From 240d5a2b723e760cc72c819e94b0c0076d04a55b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 27 Mar 2009 19:58:11 +0000 Subject: [PATCH] On Solaris, we should only force use of our own getopt(); it's okay to use the system's getopt_long(). The previous coding was the result of a sloppy discussion that failed to draw this distinction. The result was that PG programs don't handle options as users of that platform expect. Per gripe from Chuck McDevitt. Although this is a pre-existing bug, I'm not backpatching since I think we could do with a bit of beta testing before concluding this is really OK. --- configure | 28 ++++++++++++---------------- configure.in | 13 +++++++------ 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 40ba33c9ef..f20c8a2d30 100755 --- a/configure +++ b/configure @@ -17787,22 +17787,7 @@ esac fi # 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 "* ) ;; - *) LIBOBJS="$LIBOBJS getopt.$ac_objext" - ;; -esac - - case " $LIBOBJS " in - *" getopt_long.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" - ;; -esac - -elif test x"$ac_cv_type_struct_option" = xyes ; then +if test x"$ac_cv_type_struct_option" = xyes ; then for ac_func in getopt_long do @@ -17914,6 +17899,17 @@ esac fi +# Solaris' getopt() doesn't do what we want for long options, so always use +# our version on that platform. +if test "$PORTNAME" = "solaris"; then + case " $LIBOBJS " in + *" getopt.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt.$ac_objext" + ;; +esac + +fi + # Win32 support if test "$PORTNAME" = "win32"; then diff --git a/configure.in b/configure.in index e22d570b8b..055c740d19 100644 --- a/configure.in +++ b/configure.in @@ -1270,17 +1270,18 @@ else fi # 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 +if test x"$ac_cv_type_struct_option" = xyes ; then AC_REPLACE_FUNCS([getopt_long]) else AC_LIBOBJ(getopt_long) fi +# Solaris' getopt() doesn't do what we want for long options, so always use +# our version on that platform. +if test "$PORTNAME" = "solaris"; then + AC_LIBOBJ(getopt) +fi + # Win32 support if test "$PORTNAME" = "win32"; then AC_REPLACE_FUNCS(gettimeofday) -- 2.39.5