Skip to content

Commit ad20c99

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 2e0e563 commit ad20c99

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

configure

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16630,8 +16630,23 @@ esac
1663016630

1663116631
fi
1663216632

16633-
# similarly, use system's getopt_long() only if system provides struct option.
16634-
if test x"$ac_cv_type_struct_option" = xyes ; then
16633+
# Similarly, use system's getopt_long() only if system provides struct option.
16634+
# Solaris' getopt() doesn't do what we want for long options, so always use
16635+
# our versions on that platform.
16636+
if test "$PORTNAME" = "solaris"; then
16637+
case " $LIBOBJS " in
16638+
*" getopt.$ac_objext "* ) ;;
16639+
*) LIBOBJS="$LIBOBJS getopt.$ac_objext"
16640+
;;
16641+
esac
16642+
16643+
case " $LIBOBJS " in
16644+
*" getopt_long.$ac_objext "* ) ;;
16645+
*) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
16646+
;;
16647+
esac
16648+
16649+
elif test x"$ac_cv_type_struct_option" = xyes ; then
1663516650

1663616651
for ac_func in getopt_long
1663716652
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.551 2008/02/19 01:05:28 momjian Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.552 2008/02/24 05:21:54 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1095,8 +1095,13 @@ else
10951095
AC_LIBOBJ(getaddrinfo)
10961096
fi
10971097

1098-
# similarly, use system's getopt_long() only if system provides struct option.
1099-
if test x"$ac_cv_type_struct_option" = xyes ; then
1098+
# Similarly, use system's getopt_long() only if system provides struct option.
1099+
# Solaris' getopt() doesn't do what we want for long options, so always use
1100+
# our versions on that platform.
1101+
if test "$PORTNAME" = "solaris"; then
1102+
AC_LIBOBJ(getopt)
1103+
AC_LIBOBJ(getopt_long)
1104+
elif test x"$ac_cv_type_struct_option" = xyes ; then
11001105
AC_REPLACE_FUNCS([getopt_long])
11011106
else
11021107
AC_LIBOBJ(getopt_long)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy