From cc618f2653278a72ec908a21e4a5c7b9ad486016 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 15 Jul 2002 22:41:45 +0000 Subject: [PATCH] Add search for libgetopt.a in hopes of finding getopt_long(). --- configure | 75 ++++++++++++++++++++++++++++++++++++++++++++++------ configure.in | 19 ++++++------- 2 files changed, 77 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 9515829a9e..2e3924a53d 100755 --- a/configure +++ b/configure @@ -6045,6 +6045,65 @@ _ACEOF fi + +echo "$as_me:$LINENO: checking for main in -lgetopt" >&5 +echo $ECHO_N "checking for main in -lgetopt... $ECHO_C" >&6 +if test "${ac_cv_lib_getopt_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgetopt $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_getopt_main=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_getopt_main=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_getopt_main" >&5 +echo "${ECHO_T}$ac_cv_lib_getopt_main" >&6 +if test $ac_cv_lib_getopt_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGETOPT 1 +_ACEOF + + LIBS="-lgetopt $LIBS" + +fi + # QNX: echo "$as_me:$LINENO: checking for main in -lunix" >&5 @@ -11070,7 +11129,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - GETRUSAGE='getrusage.o' + GETRUSAGE='$(top_builddir)/src/backend/port/getrusage.o' fi done @@ -11149,7 +11208,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - SRANDOM='srandom.o' + SRANDOM='$(top_builddir)/src/backend/port/srandom.o' fi done @@ -11228,7 +11287,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - GETHOSTNAME='gethostname.o' + GETHOSTNAME='$(top_builddir)/src/backend/port/gethostname.o' fi done @@ -11307,7 +11366,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - MISSING_RANDOM='random.o' + MISSING_RANDOM='$(top_builddir)/src/backend/port/random.o' fi done @@ -11386,7 +11445,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - INET_ATON='inet_aton.o' + INET_ATON='$(top_builddir)/src/backend/port/inet_aton.o' fi done @@ -11623,7 +11682,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - STRTOL='strtol.o' + STRTOL='$(top_builddir)/src/backend/port/strtol.o' fi done @@ -11702,7 +11761,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - STRTOUL='strtoul.o' + STRTOUL='$(top_builddir)/src/backend/port/strtoul.o' fi done @@ -11781,7 +11840,7 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - STRCASECMP='strcasecmp.o' + STRCASECMP='$(top_builddir)/src/backend/port/strcasecmp.o' fi done diff --git a/configure.in b/configure.in index 3e96614af5..4d5adcd239 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Header: /cvsroot/pgsql/configure.in,v 1.188 2002/07/15 21:34:04 momjian Exp $ +dnl $Header: /cvsroot/pgsql/configure.in,v 1.189 2002/07/15 22:41:45 momjian Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -696,6 +696,7 @@ AC_CHECK_LIB(BSD, main) AC_CHECK_LIB(gen, main) AC_CHECK_LIB(PW, main) AC_CHECK_LIB(resolv, main) +AC_CHECK_LIB(getopt, main) # QNX: AC_CHECK_LIB([[unix]], main) AC_SEARCH_LIBS(crypt, crypt) @@ -903,25 +904,25 @@ fi AC_SUBST(ISINF) -AC_CHECK_FUNCS(getrusage, [], GETRUSAGE='getrusage.o') +AC_CHECK_FUNCS(getrusage, [], GETRUSAGE='$(top_builddir)/src/backend/port/getrusage.o') AC_SUBST(GETRUSAGE) -AC_CHECK_FUNCS(srandom, [], SRANDOM='srandom.o') +AC_CHECK_FUNCS(srandom, [], SRANDOM='$(top_builddir)/src/backend/port/srandom.o') AC_SUBST(SRANDOM) -AC_CHECK_FUNCS(gethostname, [], GETHOSTNAME='gethostname.o') +AC_CHECK_FUNCS(gethostname, [], GETHOSTNAME='$(top_builddir)/src/backend/port/gethostname.o') AC_SUBST(GETHOSTNAME) -AC_CHECK_FUNCS(random, [], MISSING_RANDOM='random.o') +AC_CHECK_FUNCS(random, [], MISSING_RANDOM='$(top_builddir)/src/backend/port/random.o') AC_SUBST(MISSING_RANDOM) -AC_CHECK_FUNCS(inet_aton, [], INET_ATON='inet_aton.o') +AC_CHECK_FUNCS(inet_aton, [], INET_ATON='$(top_builddir)/src/backend/port/inet_aton.o') AC_SUBST(INET_ATON) AC_CHECK_FUNCS(strerror, [], STRERROR='$(top_builddir)/src/backend/port/strerror.o') AC_SUBST(STRERROR) AC_CHECK_FUNCS(strdup, [], STRDUP='$(top_builddir)/src/utils/strdup.o') AC_SUBST(STRDUP) -AC_CHECK_FUNCS(strtol, [], STRTOL='strtol.o') +AC_CHECK_FUNCS(strtol, [], STRTOL='$(top_builddir)/src/backend/port/strtol.o') AC_SUBST(STRTOL) -AC_CHECK_FUNCS(strtoul, [], STRTOUL='strtoul.o') +AC_CHECK_FUNCS(strtoul, [], STRTOUL='$(top_builddir)/src/backend/port/strtoul.o') AC_SUBST(STRTOUL) -AC_CHECK_FUNCS(strcasecmp, [], STRCASECMP='strcasecmp.o') +AC_CHECK_FUNCS(strcasecmp, [], STRCASECMP='$(top_builddir)/src/backend/port/strcasecmp.o') AC_SUBST(STRCASECMP) # On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a; -- GitLab