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

configure
configure.in

index 43688c3d623bbbefed654551180e5c1623513229..2de0049ba7481b79778fa76ec7ef6e4f06a854a6 100755 (executable)
--- a/configure
+++ b/configure
@@ -14787,8 +14787,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 8fac3a5de27e629dd5054333b721053ee731c873..f4f94290e0c5181e11576f26cf982f4a4e142d53 100644 (file)
@@ -945,8 +945,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)