From 4fb375b96d6a133132e89dc74a92422a72a2672c Mon Sep 17 00:00:00 2001 From: david Date: Wed, 19 Oct 2011 22:40:49 +0000 Subject: [PATCH] Check for libcrypt on AIX, otherwise static linking doesn't work. --- configure | 45 +++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 1 + 2 files changed, 46 insertions(+) diff --git a/configure b/configure index 21ae95d54..88f46c13f 100755 --- a/configure +++ b/configure @@ -4674,6 +4674,51 @@ _ACEOF LIBS="-lcfg $LIBS" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt_r in -lcrypt" >&5 +$as_echo_n "checking for crypt_r in -lcrypt... " >&6; } +if ${ac_cv_lib_crypt_crypt_r+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char crypt_r (); +int +main () +{ +return crypt_r (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypt_crypt_r=yes +else + ac_cv_lib_crypt_crypt_r=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt_r" >&5 +$as_echo "$ac_cv_lib_crypt_crypt_r" >&6; } +if test "x$ac_cv_lib_crypt_crypt_r" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPT 1 +_ACEOF + + LIBS="-lcrypt $LIBS" + fi ;; diff --git a/configure.ac b/configure.ac index 82a079bd1..9632b159e 100644 --- a/configure.ac +++ b/configure.ac @@ -121,6 +121,7 @@ case "$host" in # use some AIX specific libraries AC_CHECK_LIB(odm, odm_initialize) AC_CHECK_LIB(cfg, _system_configuration) + AC_CHECK_LIB(crypt, crypt_r) ;; *-solaris2.0*) AC_DEFINE(STUPID_SOLARIS_CHECKSUM_BUG)