aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-24 05:22:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-24 05:22:03 +0000
commit53c64ad097462ce7df7815f61060ce6fe6c5a849 (patch)
tree2f411e1b7e85afb0d188291e3e8abe176bb7086b
parentbabbd1219e0e29f67343be2746941e9aa1767f54 (diff)
downloadpostgresql-53c64ad097462ce7df7815f61060ce6fe6c5a849.tar.gz
postgresql-53c64ad097462ce7df7815f61060ce6fe6c5a849.zip
Use our own getopt() and getopt_long() on Solaris, because that platform's
versions don't handle long options the way we want. Per Zdenek Kotala.
-rwxr-xr-xconfigure23
-rw-r--r--configure.in11
2 files changed, 29 insertions, 5 deletions
diff --git a/configure b/configure
index 49a1fcb16ef..36dff9d47a0 100755
--- 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
diff --git a/configure.in b/configure.in
index 8ef5c738379..936a1c8c80c 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.546 2008/02/01 04:16:29 scrappy Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.546.2.1 2008/02/24 05:22:03 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -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)