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:33 +0000 (05:22 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 24 Feb 2008 05:22:33 +0000 (05:22 +0000)
versions don't handle long options the way we want.  Per Zdenek Kotala.

configure
configure.in

index 23aa9facc9cd01f8b0e07b19784ccb85cfd34b3e..c673b3ee02563bf76fb41966d9707e44dcb30cd9 100755 (executable)
--- a/configure
+++ b/configure
@@ -12758,8 +12758,13 @@ else
   LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
 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
+  LIBOBJS="$LIBOBJS getopt.$ac_objext"
+  LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
+elif test x"$ac_cv_type_struct_option" = xyes ; then
 
 for ac_func in getopt_long
 do
index bac42a7e8f7324a71aae16ec1cb5876136dd59ad..3b5508e1eab36f313eee1be0d784642276320f7f 100644 (file)
@@ -19,7 +19,7 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
 
 AC_INIT([PostgreSQL], [8.0.15], [pgsql-bugs@postgresql.org])
 
-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.53], [], [m4_fatal([Autoconf version 2.59 is required.
+m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.53], [], [m4_fatal([Autoconf version 2.53 is required.
 Untested combinations of 'autoconf' and PostgreSQL versions are not
 recommended.  You can remove the check from 'configure.in' but it is then
 your responsibility whether the result works or not.])])
@@ -942,8 +942,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)