From 00bdb261b64608f01e3504c2892dda72f98d55b5 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 a3dc9b4..1af6756 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 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 2014-11-19 Tim Ruehsen diff --git a/configure.ac b/configure.ac index f1065ee..05476b1 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.])]) @@ -311,6 +303,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, [ @@ -706,7 +711,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 -- 2.1.3