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

configure
configure.in

index 49a1fcb16efae6f9ba6a068ca697a1fe68a6ca9c..36dff9d47a0840956a00757fb2a2444662a81e26 100755 (executable)
--- a/configure
+++ b/configure
@@ -16974,8 +16974,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 78501db7542bd855118f546a7a442cba1c4a611a..3c288c7166741780bf80f6f5b3891312ba6f011a 100644 (file)
@@ -1107,8 +1107,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)