------------------------------------------------------------ revno: 13344 revision-id: squid3@treenet.co.nz-20140408153512-wqa3s6qc8hpvtcm2 parent: squid3@treenet.co.nz-20140408130947-tv17k5hrrqu419db committer: Amos Jeffries branch nick: trunk timestamp: Wed 2014-04-09 03:35:12 +1200 message: Cleanup: Make crypt(3) detection dependent on the helpers that use it Only run detection for crypt(3) support when the NCSA and getpwnam helpers which use it are to be built. Also, move shadow.h detection to depend on getpwnam helper which is the only code using it. Also, shuffle the libcrypt and libmd5 detection up into the section with other crypto libraries so they are known in advance of helper detections which may require libcrypt. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140408153512-wqa3s6qc8hpvtcm2 # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 1b82afb63e19167acc69b77972f41b87cba58049 # timestamp: 2014-04-09 11:16:30 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140408130947-\ # tv17k5hrrqu419db # # Begin patch === modified file 'configure.ac' --- configure.ac 2014-04-08 13:09:47 +0000 +++ configure.ac 2014-04-08 15:35:12 +0000 @@ -1204,6 +1204,15 @@ AC_MSG_NOTICE([Using Nettle cryptographic library: ${with_nettle:=yes}]) AC_SUBST(NETTLELIB) +dnl Check for libcrypt +CRYPTLIB= +dnl Some of our helpers use crypt(3) which may be in libc, or in +dnl libcrypt (eg FreeBSD) +AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) +dnl Solaris10 provides MD5 natively through libmd5 +AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) +AC_SUBST(CRYPTLIB) + dnl User may specify OpenSSL is needed from a non-standard location AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl=PATH], @@ -2197,7 +2206,6 @@ paths.h \ poll.h \ pwd.h \ - shadow.h \ regex.h \ sched.h \ siginfo.h \ @@ -2562,22 +2570,6 @@ SQUID_CHECK_SIN_LEN_IN_SOCKADDR_IN -dnl Check for libcrypt -CRYPTLIB= -dnl Some of our helpers use crypt(3) which may be in libc, or in -dnl libcrypt (eg FreeBSD) -AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) -dnl Solaris10 provides MD5 natively through libmd5 -AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) -AC_SUBST(CRYPTLIB) - -# check for crypt, may require -lcrypt -SAVED_LIBS="$LIBS" -LIBS="$LIBS $CRYPTLIB" -AC_CHECK_FUNCS(crypt) -LIBS="$SAVED_LIBS" - - dnl Check for libdl, used by auth_modules/PAM if test "x$with_dl" = "xyes"; then AC_CHECK_LIB(dl, dlopen) === modified file 'helpers/basic_auth/NCSA/required.m4' --- helpers/basic_auth/NCSA/required.m4 2013-05-01 06:59:12 +0000 +++ helpers/basic_auth/NCSA/required.m4 2014-04-08 15:35:12 +0000 @@ -1,1 +1,7 @@ BUILD_HELPER="NCSA" + +# check for optional crypt(3), may require -lcrypt +SQUID_STATE_SAVE(ncsa_helper) +LIBS="$LIBS $CRYPTLIB" +AC_CHECK_FUNCS(crypt) +SQUID_STATE_ROLLBACK(ncsa_helper) === modified file 'helpers/basic_auth/getpwnam/required.m4' --- helpers/basic_auth/getpwnam/required.m4 2013-05-01 06:59:12 +0000 +++ helpers/basic_auth/getpwnam/required.m4 2014-04-08 15:35:12 +0000 @@ -1,1 +1,14 @@ -AC_CHECK_HEADERS([pwd.h],[BUILD_HELPER="getpwnam"]) +AC_CHECK_HEADERS([pwd.h],[ + # check for crypt(3), may require -lcrypt + SQUID_STATE_SAVE(getpwnam_helper) + LIBS="$LIBS $CRYPTLIB" + AC_CHECK_FUNCS(crypt) + SQUID_STATE_ROLLBACK(getpwnam_helper) + + # unconditionally requires crypt(3), for now + if test "x$cv_ac_func_crypt" != "x"; then + AC_CHECK_HEADERS(unistd.h crypt.h shadow.h) + + BUILD_HELPER="getpwnam" + fi +])