diff --git a/acinclude/pam.m4 b/acinclude/pam.m4 index 4c5f08553df..8b4b6f0f5a7 100644 --- a/acinclude/pam.m4 +++ b/acinclude/pam.m4 @@ -47,7 +47,7 @@ static struct pam_conv conv = { &password_conversation, 0 }; dnl check for --with-pam option AC_DEFUN_ONCE([SQUID_CHECK_LIBPAM],[ -SQUID_AUTO_LIB(pam,[Pluggable Authentication Modules],[LIBPAM]) +SQUID_AUTO_LIB(pam,[Pluggable Authentication Modules]) SQUID_CHECK_LIB_WORKS(pam,[ LIBS="$LIBS $LIBPAM_PATH" PKG_CHECK_MODULES([LIBPAM],[pam],[:],[:]) diff --git a/acinclude/squid-util.m4 b/acinclude/squid-util.m4 index 7f02b688483..96bb00d60df 100644 --- a/acinclude/squid-util.m4 +++ b/acinclude/squid-util.m4 @@ -251,30 +251,35 @@ dnl check the build parameters for a library to auto-enable dnl Parameters for this macro are: dnl 1) binary library name (without 'lib' prefix) dnl 2) name of the library for human reading -dnl 3) prefix used for pkg-check macros AC_DEFUN([SQUID_AUTO_LIB],[ - AC_ARG_WITH([$1],AS_HELP_STRING([--without-$1],[Compile without the $2 library.]),[ + AC_PREREQ([2.61]) + m4_pushdef([VARIABLE], m4_toupper(m4_translit([LIB$1],[-+.],[___]))) + m4_pushdef([OPTION], m4_ifdef([OPTOUT],[--with-$1],[--without-$1])) + m4_pushdef([OPTIONTXT], m4_ifdef([OPTOUT],[with],[without])) + m4_pushdef([WITHVAR], m4_translit([with_$1],[-+.],[___])) + AC_ARG_WITH([$1],AS_HELP_STRING([OPTION],[Compile OPTIONTXT the $2 library.]),[ AS_CASE(["$withval"],[yes|no],,[ AS_IF([test ! -d "$withval"],AC_MSG_ERROR([--with-$1 path does not point to a directory])) - m4_translit([with_$1], [-+.], [___])=yes - AS_IF([test -d "$withval/lib64"],[$3_PATH="$$3_PATH -L$withval/lib64"]) - AS_IF([test -d "$withval/lib"],[$3_PATH="$$3_PATH -L$withval/lib"]) - AS_IF([test -d "$withval/include"],[$3_CFLAGS="$$3_CFLAGS -I$withval/include"]) + WITHVAR=yes + AS_IF([test -d "$withval/lib64"],[VARIABLE[]_PATH="$[]VARIABLE[]_PATH -L$withval/lib64"]) + AS_IF([test -d "$withval/lib"],[VARIABLE[]_PATH="$[]VARIABLE[]_PATH -L$withval/lib"]) + AS_IF([test -d "$withval/include"],[VARIABLE[]_CFLAGS="$[]VARIABLE[]_CFLAGS -I$withval/include"]) ]) ]) + m4_popdef([WITHVAR]) + m4_popdef([OPTIONTXT]) + m4_popdef([OPTION]) + m4_popdef([VARIABLE]) ]) dnl same as SQUID_AUTO_LIB but for default-disabled libraries AC_DEFUN([SQUID_OPTIONAL_LIB],[ - AC_ARG_WITH([$1],AS_HELP_STRING([--with-$1],[Compile with the $2 library.]),[ - AS_CASE(["$withval"],[yes|no],,[ - AS_IF([test ! -d "$withval"],AC_MSG_ERROR([--with-$1 path does not point to a directory])) - m4_translit([with_$1], [-+.], [___])=yes - AS_IF([test -d "$withval/lib64"],[$3_PATH="$$3_PATH -L$withval/lib64"]) - AS_IF([test -d "$withval/lib"],[$3_PATH="$$3_PATH -L$withval/lib"]) - AS_IF([test -d "$withval/include"],[$3_CFLAGS="$$3_CFLAGS -I$withval/include"]) - ]) - ]) - AS_IF([test "x$withval" = "x"],[m4_translit([with_$1], [-+.], [___])=no]) + AC_REQUIRE([SQUID_AUTO_LIB]) + m4_pushdef([OPTOUT], [out]) + m4_pushdef([RESULT], m4_translit([with_$1],[-+.],[___])) + SQUID_AUTO_LIB([$1],[$2]) + AS_IF([test "x$[]RESULT" = "x"],[RESULT=no]) + m4_popdef([RESULT]) + m4_popdef([OPTOUT]) ]) AC_DEFUN([SQUID_EMBED_BUILD_INFO],[ diff --git a/acinclude/tdb.m4 b/acinclude/tdb.m4 index e1682483152..2b8d9f53322 100644 --- a/acinclude/tdb.m4 +++ b/acinclude/tdb.m4 @@ -7,7 +7,7 @@ dnl check for --with-tdb option AC_DEFUN_ONCE([SQUID_CHECK_LIBTDB],[ -SQUID_AUTO_LIB(tdb,[Samba TrivialDB],[LIBTDB]) +SQUID_AUTO_LIB(tdb,[Samba TrivialDB]) SQUID_CHECK_LIB_WORKS(tdb,[ SQUID_STATE_SAVE(squid_libtdb_state) LIBS="$LIBS $LIBTDB_PATH" diff --git a/configure.ac b/configure.ac index 605cea996f9..2938f07662a 100644 --- a/configure.ac +++ b/configure.ac @@ -444,7 +444,7 @@ AS_IF([test "x$libatomic_checker_result" = "xno"],[ SQUID_STATE_ROLLBACK(LIBATOMIC) AC_SUBST(ATOMICLIB) -SQUID_AUTO_LIB(psapi,[Windows PSAPI.dll],[LIBPSAPI]) +SQUID_AUTO_LIB(psapi,[Windows PSAPI.dll]) SQUID_CHECK_LIB_WORKS(psapi,[ CPPFLAGS="$LIBPSAPI_CFLAGS $CPPFLAGS" LIBS="$LIBPSAPI_PATH $LIBS" @@ -1031,7 +1031,7 @@ AM_CONDITIONAL(ENABLE_HTCP, [test "x$enable_htcp" = "xyes"]) AC_MSG_NOTICE([HTCP support enabled: $enable_htcp]) # Cryptograhic libraries -SQUID_AUTO_LIB(nettle,[Nettle crypto],[LIBNETTLE]) +SQUID_AUTO_LIB(nettle,[Nettle crypto]) SQUID_CHECK_LIB_WORKS(nettle,[ PKG_CHECK_MODULES([LIBNETTLE],[nettle >= 3.4],[ CPPFLAGS="$LIBNETTLE_CFLAGS $CPPFLAGS" @@ -1048,7 +1048,7 @@ dnl Solaris10 provides MD5 natively through libmd5 AC_CHECK_LIB(md5, MD5Init, [CRYPTLIB="$CRYPTLIB -lmd5"]) AC_SUBST(CRYPTLIB) -SQUID_AUTO_LIB(gnutls,[GnuTLS crypto],[LIBGNUTLS]) +SQUID_AUTO_LIB(gnutls,[GnuTLS crypto]) SQUID_CHECK_LIB_WORKS(gnutls,[ PKG_CHECK_MODULES([LIBGNUTLS],[gnutls >= 3.4.0],[ CPPFLAGS="$LIBGNUTLS_CFLAGS $CPPFLAGS" @@ -1058,7 +1058,7 @@ SQUID_CHECK_LIB_WORKS(gnutls,[ SSLLIB="" dnl User may specify OpenSSL is needed from a non-standard location -SQUID_OPTIONAL_LIB(openssl,[OpenSSL],[LIBOPENSSL]) +SQUID_OPTIONAL_LIB(openssl,[OpenSSL]) AH_TEMPLATE(USE_OPENSSL,[OpenSSL support is available]) ## OpenSSL is default disable due to licensing issues on some OS AS_IF([test "x$with_openssl" = "xyes"],[ @@ -1142,7 +1142,7 @@ AM_CONDITIONAL(ENABLE_SSL,[ test "x$with_openssl" = "xyes" ]) AC_SUBST(SSLLIB) # Kerberos support libraries: MIT -SQUID_AUTO_LIB(mit-krb5,[MIT Kerberos],[LIBMIT_KRB5]) +SQUID_AUTO_LIB(mit-krb5,[MIT Kerberos]) AH_TEMPLATE(USE_APPLE_KRB5,[Apple Kerberos support is available]) AH_TEMPLATE(USE_SOLARIS_KRB5,[Solaris Kerberos support is available]) SQUID_CHECK_LIB_WORKS(mit-krb5,[ @@ -1169,7 +1169,7 @@ SQUID_CHECK_LIB_WORKS(mit-krb5,[ ]) # Kerberos support libraries: Heimdal -SQUID_AUTO_LIB(heimdal-krb5,[Heimdal Kerberos],[LIBHEIMDAL_KRB5]) +SQUID_AUTO_LIB(heimdal-krb5,[Heimdal Kerberos]) SQUID_CHECK_LIB_WORKS(heimdal-krb5,[ AS_IF([test "x$LIBMIT_KRB5_LIBS" = "x"],[ PKG_CHECK_MODULES([LIBHEIMDAL_KRB5],[heimdal-krb5 heimdal-gssapi],[:],[ @@ -1188,7 +1188,7 @@ SQUID_CHECK_LIB_WORKS(heimdal-krb5,[ ]) # Kerberos support libraries: GNU GSS -SQUID_AUTO_LIB(gss,[GNU gss],[LIBGSS]) +SQUID_AUTO_LIB(gss,[GNU gss]) SQUID_CHECK_LIB_WORKS(gss,[ AS_IF([test "x$LIBMIT_KRB5_LIBS" = "x" -a "x$LIBHEIMDAL_KRB5_LIBS" = "x"],[ PKG_CHECK_MODULES([LIBGSS],[gss],[ @@ -1205,7 +1205,7 @@ SQUID_CHECK_LIB_WORKS(gss,[ ]) ]) -SQUID_AUTO_LIB(ldap,[LDAP],[LIBLDAP]) +SQUID_AUTO_LIB(ldap,[LDAP]) SQUID_CHECK_LIB_WORKS(ldap,[ PKG_CHECK_MODULES([LIBLDAP],[ldap],[:],[:]) AS_IF([test "$squid_host_os" = "mingw" -a "x$LIBLDAP_LIBS" = "x"],[ @@ -1223,7 +1223,7 @@ SQUID_CHECK_LIB_WORKS(ldap,[ SQUID_CHECK_LDAP_API ]) -SQUID_AUTO_LIB(sasl,[Cyrus SASL],[LIBSASL]) +SQUID_AUTO_LIB(sasl,[Cyrus SASL]) SQUID_CHECK_LIB_WORKS([sasl],[ PKG_CHECK_MODULES([LIBSASL],[libsasl2],[:],[:]) CPPFLAGS="$LIBSASL_CFLAGS $CPPFLAGS" @@ -1231,7 +1231,7 @@ SQUID_CHECK_LIB_WORKS([sasl],[ AC_CHECK_HEADERS([sasl/sasl.h sasl.h]) ]) -SQUID_AUTO_LIB(systemd,[systemd API for start-up notification],[LIBSYSTEMD]) +SQUID_AUTO_LIB(systemd,[systemd API for start-up notification]) SQUID_CHECK_LIB_WORKS(systemd,[ LIBS="$LIBS $LIBSYSTEMD_PATH" PKG_CHECK_MODULES(LIBSYSTEMD,[libsystemd >= 209],[ @@ -1424,7 +1424,7 @@ AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking) -SQUID_AUTO_LIB(netfilter-conntrack,[Netfilter conntrack],[LIBNETFILTER_CONNTRACK]) +SQUID_AUTO_LIB(netfilter-conntrack,[Netfilter conntrack]) SQUID_CHECK_LIB_WORKS(netfilter-conntrack,[ PKG_CHECK_MODULES([LIBNETFILTER_CONNTRACK],[libnetfilter_conntrack],[:],[:]) CPPFLAGS="$LIBNETFILTER_CONNTRACK_CFLAGS $CPPFLAGS" @@ -1751,7 +1751,7 @@ SQUID_DEFINE_BOOL(X_ACCELERATOR_VARY,${enable_x_accelerator_vary:=no}, [Enable support for the X-Accelerator-Vary HTTP header]) AC_MSG_NOTICE([X-Accelerator-Vary support enabled: $enable_x_accelerator_vary]) -SQUID_AUTO_LIB(cppunit,[cppunit test framework],[LIBCPPUNIT]) +SQUID_AUTO_LIB(cppunit,[cppunit test framework]) SQUID_CHECK_LIB_WORKS(cppunit,[ PKG_CHECK_MODULES([LIBCPPUNIT],[cppunit],[ squid_cv_cppunit_version="`pkg-config --modversion cppunit`" @@ -1973,7 +1973,7 @@ AC_CHECK_TYPE(cpu_set_t, dnl Check for special functions AC_FUNC_ALLOCA -SQUID_AUTO_LIB(cap,[Linux capabilities],[LIBCAP]) +SQUID_AUTO_LIB(cap,[Linux capabilities]) SQUID_CHECK_LIB_WORKS(cap,[ PKG_CHECK_MODULES([LIBCAP],[libcap >= 2.09],[:],[:]) CPPFLAGS="$LIBCAP_CFLAGS $CPPFLAGS"