]> granicus.if.org Git - sudo/commitdiff
Use $ac_cv_search_FUNCTION instead of $ac_lib and $ac_res.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 25 Jan 2019 17:39:57 +0000 (10:39 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 25 Jan 2019 17:39:57 +0000 (10:39 -0700)
Fixes a problem where libcrypt is not used with autoconf caching.
Adapted from a diff from Adam Labbe.

configure
configure.ac

index e1b5dbb9ca7cd431c2f6d1d84cadd4757171fc58..8e0a18a59e3c79c705ef95fc1540bb927071298f 100755 (executable)
--- a/configure
+++ b/configure
@@ -24618,7 +24618,9 @@ $as_echo "$ac_cv_search_crypt" >&6; }
 ac_res=$ac_cv_search_crypt
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  test -n "$ac_lib" && shadow_libs="${shadow_libs} $ac_res"
+
+           test "${ac_cv_search_crypt}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_crypt}"
+
 fi
 
        LIBS="$_LIBS"
@@ -24704,8 +24706,12 @@ $as_echo "$ac_cv_search_getspnam" >&6; }
 ac_res=$ac_cv_search_getspnam
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  $as_echo "#define HAVE_GETSPNAM 1" >>confdefs.h
- CHECKSHADOW=false; test -n "$ac_lib" && shadow_libs="${shadow_libs} $ac_res"
+
+           $as_echo "#define HAVE_GETSPNAM 1" >>confdefs.h
+
+           test "${ac_cv_search_getspnam}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_getspnam}"
+           CHECKSHADOW=false
+
 fi
 
     fi
@@ -24763,8 +24769,13 @@ $as_echo "$ac_cv_search_getprpwnam" >&6; }
 ac_res=$ac_cv_search_getprpwnam
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  $as_echo "#define HAVE_GETPRPWNAM 1" >>confdefs.h
- CHECKSHADOW=false; SECUREWARE=1; test -n "$ac_lib" && shadow_libs="${shadow_libs} $ac_res"
+
+           $as_echo "#define HAVE_GETPRPWNAM 1" >>confdefs.h
+
+           test "${ac_cv_search_getprpwnam}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_getprpwnam}"
+           SECUREWARE=1
+           CHECKSHADOW=false
+
 fi
 
     fi
@@ -25100,7 +25111,7 @@ ac_res=$ac_cv_search_ldap_init
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-       test "$ac_res" != "none required" && LDAP_LIBS="$ac_res"
+       test "${ac_cv_search_ldap_init}" != "none required" && LDAP_LIBS="${ac_cv_search_ldap_init}"
        found=yes
 
 fi
index 962a032a3058a9426e544ea512755d6eff6d7fe6..32ad35c96e79993e14e39c4b8e4a923255f85a8f 100644 (file)
@@ -3755,7 +3755,9 @@ if test ${with_passwd-'no'} != "no"; then
     dnl
     if test -z "$LIB_CRYPT"; then
        _LIBS="$LIBS"
-       AC_SEARCH_LIBS([crypt], [crypt crypt_d ufc], [test -n "$ac_lib" && shadow_libs="${shadow_libs} $ac_res"])
+       AC_SEARCH_LIBS([crypt], [crypt crypt_d ufc], [
+           test "${ac_cv_search_crypt}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_crypt}"
+       ])
        LIBS="$_LIBS"
     fi
 
@@ -3775,10 +3777,19 @@ if test ${with_passwd-'no'} != "no"; then
        LIBS="$_LIBS"
     fi
     if test "$CHECKSHADOW" = "true"; then
-       AC_SEARCH_LIBS([getspnam], [gen shadow], [AC_DEFINE(HAVE_GETSPNAM)] [CHECKSHADOW=false; test -n "$ac_lib" && shadow_libs="${shadow_libs} $ac_res"])
+       AC_SEARCH_LIBS([getspnam], [gen shadow], [
+           AC_DEFINE(HAVE_GETSPNAM)
+           test "${ac_cv_search_getspnam}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_getspnam}"
+           CHECKSHADOW=false
+       ])
     fi
     if test "$CHECKSHADOW" = "true"; then
-       AC_SEARCH_LIBS([getprpwnam], [sec security prot], [AC_DEFINE(HAVE_GETPRPWNAM)] [CHECKSHADOW=false; SECUREWARE=1; test -n "$ac_lib" && shadow_libs="${shadow_libs} $ac_res"])
+       AC_SEARCH_LIBS([getprpwnam], [sec security prot], [
+           AC_DEFINE(HAVE_GETPRPWNAM)
+           test "${ac_cv_search_getprpwnam}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_getprpwnam}"
+           SECUREWARE=1
+           CHECKSHADOW=false
+       ])
     fi
     if test -n "$shadow_libs"; then
        # sudoers needs to link with shadow libs for password auth
@@ -3843,8 +3854,8 @@ if test ${with_ldap-'no'} != "no"; then
     case "$host_os" in
        hpux*) AC_CHECK_LIB(Csup, main, [IBMLDAP_EXTRA=" -lCsup"]);;
     esac
-    AC_SEARCH_LIBS(ldap_init, "ibmldap${IBMLDAP_EXTRA}" "ibmldap -lidsldif${IBMLDAP_EXTRA}" "ldap" "ldap -llber" "ldap -llber -lssl -lcrypto" "ibmldap${IBMLDAP_EXTRA}", [
-       test "$ac_res" != "none required" && LDAP_LIBS="$ac_res"
+    AC_SEARCH_LIBS([ldap_init], ["ibmldap${IBMLDAP_EXTRA}" "ibmldap -lidsldif${IBMLDAP_EXTRA}" "ldap" "ldap -llber" "ldap -llber -lssl -lcrypto" "ibmldap${IBMLDAP_EXTRA}]", [
+       test "${ac_cv_search_ldap_init}" != "none required" && LDAP_LIBS="${ac_cv_search_ldap_init}"
        found=yes
     ])
     # If nothing linked, try -lldap and hope for the best