From 6b9e3a5a85a3a37253c36006f536f3db182d6293 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 30 Apr 2014 15:28:06 -0700 Subject: Use getopt_long(). This requires us to check for it in the configure script and to include a version of getopt_long() for the benefit of platforms that don't have it; we pick up the FreeBSD version and tweak it a bit (eliminating some features specific to the BSD version of getopt_long(), as we want to use it only in a fashion portable to Linux/*BSD/Solaris/etc.) We also get rid of the version of getopt() we supply for Windows in favor of the version of getopt_long() we provide. --- configure | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 21ce37b8..65d2f298 100755 --- a/configure +++ b/configure @@ -3779,6 +3779,7 @@ $as_echo "$ac_cv___attribute___format_function_pointer" >&6; } fi fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5463,6 +5464,19 @@ esac fi +ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" +if test "x$ac_cv_func_getopt_long" = xyes; then : + $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" getopt_long.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" + ;; +esac + +fi + for ac_func in fork vfork strftime do : -- cgit v1.2.1