From acc76b1e02d777c019d6c9a28ca236d744afd49a Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Thu, 20 Nov 2014 15:33:32 +0530 Subject: [PATCH] Use pkg-config for libpsl checking --- ChangeLog | 5 +++++ configure.ac | 23 ++++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 812ffffc..17c71dbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-20 Darshit Shah + + * configure.ac: Use pkg-config for libpsl detection + config status for libpsl is reflected by $with_libpsl + 2014-11-20 Darshit Shah * configure.ac: Use autoconf macros where available diff --git a/configure.ac b/configure.ac index 5cd75d99..e22bb09f 100644 --- a/configure.ac +++ b/configure.ac @@ -75,14 +75,6 @@ AC_ARG_WITH([libpsl], [with_libpsl=yes] ) -AS_IF([test "x$with_libpsl" = xyes], - [AC_SEARCH_LIBS(psl_builtin, psl, - [ENABLE_PSL=yes; AC_DEFINE([HAVE_LIBPSL], [1], [PSL Support Enabled])], - [ENABLE_PSL=no; AC_MSG_WARN(*** libpsl not found. Falling back to Wget builtin cookie checking.)])], - [ENABLE_PSL=no] -) - - dnl SSL: Configure SSL backend to use AC_ARG_WITH([ssl], [AS_HELP_STRING([--with-ssl={gnutls,openssl}], [specify SSL backend. GNU TLS is the default.])]) @@ -313,6 +305,19 @@ dnl PKG_PROG_PKG_CONFIG +AS_IF([test "x$with_libpsl" != xno], [ + PKG_CHECK_MODULES([LIBPSL], libpsl, [ + with_libpsl=yes + LIBS="$LIBPSL_LIBS $LIBS" + CFLAGS="$LIBPSL_CFLAGS $CFLAGS" + AC_DEFINE([HAVE_LIBPSL], [1], [PSL support enabled]) + ], [ + AC_SEARCH_LIBS(psl_builtin, psl, + [with_libpsl=yes; AC_DEFINE([HAVE_LIBPSL], [1], [PSL support enabled])], + [with_libpsl=no; AC_MSG_WARN(*** libpsl was not found. Fallback to builtin cookie checking.)]) + ]) +]) + AS_IF([test x"$with_zlib" != xno], [ with_zlib=yes PKG_CHECK_MODULES([ZLIB], zlib, [ @@ -708,7 +713,7 @@ AC_MSG_NOTICE([Summary of build options: Libs: $LIBS SSL: $with_ssl Zlib: $with_zlib - PSL: $ENABLE_PSL + PSL: $with_libpsl Digest: $ENABLE_DIGEST NTLM: $ENABLE_NTLM OPIE: $ENABLE_OPIE