Use our own getopt() and getopt_long() on Solaris, because that platform's
authorTom Lane <[email protected]>
Sun, 24 Feb 2008 05:22:11 +0000 (05:22 +0000)
committerTom Lane <[email protected]>
Sun, 24 Feb 2008 05:22:11 +0000 (05:22 +0000)
versions don't handle long options the way we want.  Per Zdenek Kotala.

configure
configure.in

index 10bf3e37c3ebd862ffacbeeec20197dfa671951c..23dc93746d0976ecf4d93a82f7707706ad97c40d 100755 (executable)
--- a/configure
+++ b/configure
@@ -14829,8 +14829,27 @@ esac
 
 fi
 
-# similarly, use system's getopt_long() only if system provides struct option.
-if test x"$ac_cv_type_struct_option" = xyes ; then
+# Similarly, use system's getopt_long() only if system provides struct option.
+# Solaris' getopt() doesn't do what we want for long options, so always use
+# our versions on that platform.
+if test "$PORTNAME" = "solaris"; then
+  case $LIBOBJS in
+    "getopt.$ac_objext"   | \
+  *" getopt.$ac_objext"   | \
+    "getopt.$ac_objext "* | \
+  *" getopt.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;;
+esac
+
+  case $LIBOBJS in
+    "getopt_long.$ac_objext"   | \
+  *" getopt_long.$ac_objext"   | \
+    "getopt_long.$ac_objext "* | \
+  *" getopt_long.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" ;;
+esac
+
+elif test x"$ac_cv_type_struct_option" = xyes ; then
 
 for ac_func in getopt_long
 do
index ae7442a39e2aa0b97249464d00df969a4b46abcc..ea0aa6f0f5ba9de1e28c63d933ec173d6db2dcc8 100644 (file)
@@ -998,8 +998,13 @@ else
   AC_LIBOBJ(getaddrinfo)
 fi
 
-# similarly, use system's getopt_long() only if system provides struct option.
-if test x"$ac_cv_type_struct_option" = xyes ; then
+# Similarly, use system's getopt_long() only if system provides struct option.
+# Solaris' getopt() doesn't do what we want for long options, so always use
+# our versions on that platform.
+if test "$PORTNAME" = "solaris"; then
+  AC_LIBOBJ(getopt)
+  AC_LIBOBJ(getopt_long)
+elif test x"$ac_cv_type_struct_option" = xyes ; then
   AC_REPLACE_FUNCS([getopt_long])
 else
   AC_LIBOBJ(getopt_long)