From: Tom Lane Date: Sun, 24 Feb 2008 05:22:03 +0000 (+0000) Subject: Use our own getopt() and getopt_long() on Solaris, because that platform's X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=8b3f7514b26a050a6fe09ed14d2dec362c57e94c;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/configure b/configure index 49a1fcb16e..36dff9d47a 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 78501db754..3c288c7166 100644 --- a/configure.in +++ b/configure.in @@ -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)