postgres.git / summary / log / commit / refs
commit f004ac180acac9db2d2e6354136463e25473ce37
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun Feb 24 05:22:22 2008 +0000
First released in: 8.4.0, 7.4.20, 8.0.16, 8.1.12, 8.2.7, 8.3.1
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.
configure | 23 +++++++++++++++++++++--
configure.in | 11 ++++++++---
2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index 43688c3d623..2de0049ba74 100755
--- 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
diff --git a/configure.in b/configure.in
index d071f00122a..7307cc8a04e 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.431.2.22 2008/01/03 21:41:23 tgl Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.431.2.23 2008/02/24 05:22:22 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -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)
[parent: 0f6acc4509e3]