# include <sys/mman.h>
#endif
-#ifdef HAVE_GETOPT_H
+#ifdef HARTMUT_0
#include <getopt.h>
#endif
}
/* }}} */
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
/* {{{ free_longopts
Free the memory allocated to an longopt array. */
static void free_longopts(struct option *longopts)
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
}
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;
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) {
/* 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 {
}
free_argv(argv, argc);
-#ifdef HAVE_GETOPT_LONG
+#ifdef HARTMUT_0
free_longopts(longopts);
#endif
}
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])