]> granicus.if.org Git - php/commitdiff
getopt with long options reverted to configure problems
authorHartmut Holzgraefe <hholzgra@php.net>
Wed, 30 Oct 2002 15:11:11 +0000 (15:11 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Wed, 30 Oct 2002 15:11:11 +0000 (15:11 +0000)
(may find the wrong getopt.h so needed structures are not defined :(   )

ext/standard/basic_functions.c
ext/standard/config.m4

index 17b2f471c6f60fb30dc2208598a70673a30bfc01..0e5a88fa11ec11c198a031679ea364e3de4bdf93 100644 (file)
@@ -73,7 +73,7 @@
 # include <sys/mman.h>
 #endif
 
-#ifdef HAVE_GETOPT_H
+#ifdef HARTMUT_0
 #include <getopt.h>
 #endif
 
@@ -1373,7 +1373,7 @@ static void free_argv(char **argv, int argc)
 }
 /* }}} */
 
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
 /* {{{ free_longopts
    Free the memory allocated to an longopt array. */
 static void free_longopts(struct option *longopts)
@@ -1400,7 +1400,7 @@ PHP_FUNCTION(getopt)
        char *optname;
        int argc = 0, options_len = 0, o;
        zval *val, **args = NULL, *p_longopts = NULL;
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
        struct option *longopts = NULL;
        int longindex = 0;
 #endif
@@ -1451,7 +1451,7 @@ PHP_FUNCTION(getopt)
        }
 
        if(p_longopts) {
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
                int len, c = zend_hash_num_elements(Z_ARRVAL_P(p_longopts));
                struct option *p;
                zval **arg;
@@ -1505,7 +1505,7 @@ PHP_FUNCTION(getopt)
        optind = 0;
 
        /* Invoke getopt(3) on the argument array. */
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
        while ((o = getopt_long(argc, argv, options, longopts, &longindex)) != -1) {
 #else
        while ((o = getopt(argc, argv, options)) != -1) {
@@ -1517,7 +1517,7 @@ PHP_FUNCTION(getopt)
 
                /* Prepare the option character and the argument string. */
                if(o == 0) {
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
                        optname = (char *)longopts[longindex].name;
 #endif
                } else {                
@@ -1546,7 +1546,7 @@ PHP_FUNCTION(getopt)
        }
 
        free_argv(argv, argc);
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
        free_longopts(longopts);
 #endif
 }
index b85ef6c7ee5be20b37696fc774db584f2ab559e0..9d4fc7b9859621549da8e576e55cbb81e3f5603a 100644 (file)
@@ -225,9 +225,13 @@ AC_ARG_WITH(regex,
 
 AC_FUNC_FNMATCH        
 
-AC_CHECK_HEADERS(getopt.h)
+dnl getopt long options disabled for now
+dnl as we can't be sure that we get the right getopt.h here
+dnl using the standard AC_CHECK macros
+dnl AC_CHECK_HEADERS(getopt.h)
+dnl AC_CHECK_FUNCS(getopt_long getopt_long_only)
 
-AC_CHECK_FUNCS(glob strfmon getopt_long getopt_long_only)
+AC_CHECK_FUNCS(glob strfmon)
 
 if test "$PHP_SAPI" = "cgi"; then
   AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])