Improve getopt_long search, per Peter:
AC_SEARCH_LIBS(getopt_long, [getopt])
This commit is contained in:
parent
5af19e4227
commit
de1a6978fe
87
configure
vendored
87
configure
vendored
@ -6045,19 +6045,24 @@ _ACEOF
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: checking for library containing getopt_long" >&5
|
||||||
echo "$as_me:$LINENO: checking for main in -lgetopt" >&5
|
echo $ECHO_N "checking for library containing getopt_long... $ECHO_C" >&6
|
||||||
echo $ECHO_N "checking for main in -lgetopt... $ECHO_C" >&6
|
if test "${ac_cv_search_getopt_long+set}" = set; then
|
||||||
if test "${ac_cv_lib_getopt_main+set}" = set; then
|
|
||||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
else
|
else
|
||||||
ac_check_lib_save_LIBS=$LIBS
|
ac_func_search_save_LIBS=$LIBS
|
||||||
LIBS="-lgetopt $LIBS"
|
ac_cv_search_getopt_long=no
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
#line $LINENO "configure"
|
#line $LINENO "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
char getopt_long ();
|
||||||
#ifdef F77_DUMMY_MAIN
|
#ifdef F77_DUMMY_MAIN
|
||||||
# ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
@ -6067,7 +6072,7 @@ cat >conftest.$ac_ext <<_ACEOF
|
|||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
main ();
|
getopt_long ();
|
||||||
;
|
;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -6084,23 +6089,67 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
|||||||
ac_status=$?
|
ac_status=$?
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
(exit $ac_status); }; }; then
|
(exit $ac_status); }; }; then
|
||||||
ac_cv_lib_getopt_main=yes
|
ac_cv_search_getopt_long="none required"
|
||||||
else
|
else
|
||||||
echo "$as_me: failed program was:" >&5
|
echo "$as_me: failed program was:" >&5
|
||||||
cat conftest.$ac_ext >&5
|
cat conftest.$ac_ext >&5
|
||||||
ac_cv_lib_getopt_main=no
|
|
||||||
fi
|
fi
|
||||||
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
|
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
|
||||||
LIBS=$ac_check_lib_save_LIBS
|
if test "$ac_cv_search_getopt_long" = no; then
|
||||||
fi
|
for ac_lib in getopt; do
|
||||||
echo "$as_me:$LINENO: result: $ac_cv_lib_getopt_main" >&5
|
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||||
echo "${ECHO_T}$ac_cv_lib_getopt_main" >&6
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
if test $ac_cv_lib_getopt_main = yes; then
|
#line $LINENO "configure"
|
||||||
cat >>confdefs.h <<_ACEOF
|
#include "confdefs.h"
|
||||||
#define HAVE_LIBGETOPT 1
|
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
LIBS="-lgetopt $LIBS"
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
char getopt_long ();
|
||||||
|
#ifdef F77_DUMMY_MAIN
|
||||||
|
# ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
# endif
|
||||||
|
int F77_DUMMY_MAIN() { return 1; }
|
||||||
|
#endif
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
getopt_long ();
|
||||||
|
;
|
||||||
|
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_search_getopt_long="-l$ac_lib"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
fi
|
||||||
|
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
LIBS=$ac_func_search_save_LIBS
|
||||||
|
fi
|
||||||
|
echo "$as_me:$LINENO: result: $ac_cv_search_getopt_long" >&5
|
||||||
|
echo "${ECHO_T}$ac_cv_search_getopt_long" >&6
|
||||||
|
if test "$ac_cv_search_getopt_long" != no; then
|
||||||
|
test "$ac_cv_search_getopt_long" = "none required" || LIBS="$ac_cv_search_getopt_long $LIBS"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
dnl $Header: /cvsroot/pgsql/configure.in,v 1.190 2002/07/16 05:46:35 momjian Exp $
|
dnl $Header: /cvsroot/pgsql/configure.in,v 1.191 2002/07/17 02:54:01 momjian Exp $
|
||||||
dnl
|
dnl
|
||||||
dnl Developers, please strive to achieve this order:
|
dnl Developers, please strive to achieve this order:
|
||||||
dnl
|
dnl
|
||||||
@ -696,7 +696,7 @@ AC_CHECK_LIB(BSD, main)
|
|||||||
AC_CHECK_LIB(gen, main)
|
AC_CHECK_LIB(gen, main)
|
||||||
AC_CHECK_LIB(PW, main)
|
AC_CHECK_LIB(PW, main)
|
||||||
AC_CHECK_LIB(resolv, main)
|
AC_CHECK_LIB(resolv, main)
|
||||||
AC_CHECK_LIB(getopt, main)
|
AC_SEARCH_LIBS(getopt_long, [getopt])
|
||||||
# QNX:
|
# QNX:
|
||||||
AC_CHECK_LIB([[unix]], main)
|
AC_CHECK_LIB([[unix]], main)
|
||||||
AC_SEARCH_LIBS(crypt, crypt)
|
AC_SEARCH_LIBS(crypt, crypt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user