Skip to content

Commit 53c64ad

Browse files
committed
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.
1 parent babbd12 commit 53c64ad

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

configure

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16974,8 +16974,27 @@ esac
1697416974

1697516975
fi
1697616976

16977-
# similarly, use system's getopt_long() only if system provides struct option.
16978-
if test x"$ac_cv_type_struct_option" = xyes ; then
16977+
# Similarly, use system's getopt_long() only if system provides struct option.
16978+
# Solaris' getopt() doesn't do what we want for long options, so always use
16979+
# our versions on that platform.
16980+
if test "$PORTNAME" = "solaris"; then
16981+
case $LIBOBJS in
16982+
"getopt.$ac_objext" | \
16983+
*" getopt.$ac_objext" | \
16984+
"getopt.$ac_objext "* | \
16985+
*" getopt.$ac_objext "* ) ;;
16986+
*) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;;
16987+
esac
16988+
16989+
case $LIBOBJS in
16990+
"getopt_long.$ac_objext" | \
16991+
*" getopt_long.$ac_objext" | \
16992+
"getopt_long.$ac_objext "* | \
16993+
*" getopt_long.$ac_objext "* ) ;;
16994+
*) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" ;;
16995+
esac
16996+
16997+
elif test x"$ac_cv_type_struct_option" = xyes ; then
1697916998

1698016999
for ac_func in getopt_long
1698117000
do

configure.in

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.546 2008/02/01 04:16:29 scrappy Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.546.2.1 2008/02/24 05:22:03 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1107,8 +1107,13 @@ else
11071107
AC_LIBOBJ(getaddrinfo)
11081108
fi
11091109

1110-
# similarly, use system's getopt_long() only if system provides struct option.
1111-
if test x"$ac_cv_type_struct_option" = xyes ; then
1110+
# Similarly, use system's getopt_long() only if system provides struct option.
1111+
# Solaris' getopt() doesn't do what we want for long options, so always use
1112+
# our versions on that platform.
1113+
if test "$PORTNAME" = "solaris"; then
1114+
AC_LIBOBJ(getopt)
1115+
AC_LIBOBJ(getopt_long)
1116+
elif test x"$ac_cv_type_struct_option" = xyes ; then
11121117
AC_REPLACE_FUNCS([getopt_long])
11131118
else
11141119
AC_LIBOBJ(getopt_long)

0 commit comments

Comments
 (0)