From 374d0b57dade4c128ca5b7e51a4b1a91d4af13aa Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 5 Mar 2021 10:08:14 +0900 Subject: Imported Upstream version 1.16.2 --- configure.ac | 101 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 41 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index a366e83..01ea237 100644 --- a/configure.ac +++ b/configure.ac @@ -334,14 +334,19 @@ AS_IF([test x"$with_zlib" != xno], [ ]) AS_IF([test x"$with_ssl" = xopenssl], [ - PKG_CHECK_MODULES([OPENSSL], [openssl], [ - AC_MSG_NOTICE([compiling in support for SSL via OpenSSL]) - AC_LIBOBJ([openssl]) - LIBS="$OPENSSL_LIBS $LIBS" - CFLAGS="$OPENSSL_CFLAGS -DHAVE_LIBSSL $CFLAGS" - LIBSSL=" " # ntlm check below wants this - AC_DEFINE([HAVE_LIBSSL], [1], [Define if using openssl.]) - ], [ + if [test x"$with_libssl_prefix" = x]; then + PKG_CHECK_MODULES([OPENSSL], [openssl], [ + AC_MSG_NOTICE([compiling in support for SSL via OpenSSL]) + AC_LIBOBJ([openssl]) + LIBS="$OPENSSL_LIBS $LIBS" + CFLAGS="$OPENSSL_CFLAGS -DHAVE_LIBSSL $CFLAGS" + LIBSSL=" " # ntlm check below wants this + AC_CHECK_FUNCS([RAND_egd]) + AC_DEFINE([HAVE_LIBSSL], [1], [Define if using openssl.]) + ssl_found=yes + ]) + fi + if [test x"$ssl_found" != xyes]; then dnl As of this writing (OpenSSL 0.9.6), the libcrypto shared library dnl doesn't record its dependency on libdl, so we need to make sure dnl -ldl ends up in LIBS on systems that have it. Most OSes use @@ -392,12 +397,13 @@ AS_IF([test x"$with_ssl" = xopenssl], [ AC_MSG_NOTICE([compiling in support for SSL via OpenSSL]) AC_LIBOBJ([openssl]) LIBS="$LIBSSL $LIBS" + AC_CHECK_FUNCS([RAND_egd]) elif test x"$with_ssl" != x then AC_MSG_ERROR([--with-ssl=openssl was given, but SSL is not available.]) fi ]) - ]) + fi ], [ # --with-ssl is not openssl: check if it's no AS_IF([test x"$with_ssl" != xno], [ @@ -405,13 +411,17 @@ AS_IF([test x"$with_ssl" = xopenssl], [ with_ssl=gnutls dnl Now actually check for -lgnutls - PKG_CHECK_MODULES([GNUTLS], [gnutls], [ - AC_MSG_NOTICE([compiling in support for SSL via GnuTLS]) - AC_LIBOBJ([gnutls]) - LIBS="$GNUTLS_LIBS $LIBS" - CFLAGS="$GNUTLS_CFLAGS -DHAVE_LIBGNUTLS $CFLAGS" - AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define if using gnutls.]) - ], [ + if [test x"$with_libgnutls_prefix" = x]; then + PKG_CHECK_MODULES([GNUTLS], [gnutls], [ + AC_MSG_NOTICE([compiling in support for SSL via GnuTLS]) + AC_LIBOBJ([gnutls]) + LIBS="$GNUTLS_LIBS $LIBS" + CFLAGS="$GNUTLS_CFLAGS -DHAVE_LIBGNUTLS $CFLAGS" + AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define if using gnutls.]) + ssl_found=yes + ]) + fi + if [test x"$ssl_found" != xyes]; then AC_LIB_HAVE_LINKFLAGS([gnutls], [], [ #include ], [gnutls_global_init()]) @@ -424,7 +434,7 @@ AS_IF([test x"$with_ssl" = xopenssl], [ else AC_MSG_ERROR([GnuTLS has not been found. Use --with-ssl=openssl if you explicitly want OpenSSL.]) fi - ]) + fi AC_CHECK_FUNCS(gnutls_priority_set_direct) ]) # endif: --with-ssl != no? @@ -646,29 +656,37 @@ dnl AC_ARG_WITH(libuuid, AC_HELP_STRING([--without-libuuid], [Generate UUIDs for WARC files via libuuid])) -AS_IF([test "X$with_libuuid" != "Xno"],[ +AS_IF([test "x$with_libuuid" = xyes], [ + # libuuid was explicitly requested PKG_CHECK_MODULES([UUID], uuid, [ LIBS="$UUID_LIBS $LIBS" CFLAGS="$UUID_CFLAGS $CFLAGS" - AC_DEFINE([HAVE_LIBUUID], [1], [Define if using libuuid.]) + uuid_mode=1 + ], [ + AC_SEARCH_LIBS(uuid_generate, uuid, + [uuid_mode=1], + [AC_MSG_ERROR(*** libuuid was explicitly requested but wasn't found.)]) + ]) +], [test "x$with_libuuid" = xno], [ + # libuuid was explicitly *not* requested + AC_CHECK_HEADER(uuid.h, + AC_CHECK_FUNC(uuid_create, [uuid_mode=2])) +], [ + # default: + AC_CHECK_HEADER(uuid.h, [ + AC_CHECK_FUNC(uuid_create, [uuid_mode=2]) ], [ - AC_CHECK_HEADER(uuid.h, - AC_CHECK_FUNC(uuid, uuid_create, - [AC_DEFINE([HAVE_UUID_CREATE], 1, - [Define if uuid_create is available.]) - ]) - ) - AC_CHECK_HEADER(uuid/uuid.h, - AC_CHECK_LIB(uuid, uuid_generate, - [LIBS="${LIBS} -luuid" - AC_DEFINE([HAVE_LIBUUID], 1, - [Define if libuuid is available.]) - ]) - ) + AC_SEARCH_LIBS(uuid_generate, uuid, [uuid_mode=1])) ]) ]) +AS_IF([test "x$uuid_mode" = x1], [ + AC_DEFINE([HAVE_LIBUUID], [1], [Define if using libuuid.]) +], [test "x$uuid_mode" = x2], [ + AC_DEFINE([HAVE_UUID_CREATE], 1, [Define if uuid_create is available.]) +]) + dnl dnl Check for PCRE dnl @@ -678,17 +696,18 @@ AC_ARG_ENABLE(pcre, AC_HELP_STRING([--disable-pcre], AS_IF([test "X$enable_pcre" != "Xno"],[ PKG_CHECK_MODULES([PCRE], libpcre, [ - LIBS="$PCRE_LIBS $LIBS" CFLAGS="$PCRE_CFLAGS $CFLAGS" - AC_DEFINE([HAVE_LIBPCRE], [1], [Define if using libpcre.]) + AC_CHECK_HEADER(pcre.h, [ + LIBS="$PCRE_LIBS $LIBS" + AC_DEFINE([HAVE_LIBPCRE], [1], [Define if libpcre is available.]) + ]) ], [ - AC_CHECK_HEADER(pcre.h, - AC_CHECK_LIB(pcre, pcre_compile, - [LIBS="${LIBS} -lpcre" - AC_DEFINE([HAVE_LIBPCRE], 1, - [Define if libpcre is available.]) - ]) - ) + AC_CHECK_HEADER(pcre.h, [ + AC_CHECK_LIB(pcre, pcre_compile, [ + LIBS="${LIBS} -lpcre" + AC_DEFINE([HAVE_LIBPCRE], 1, [Define if libpcre is available.]) + ]) + ]) ]) ]) -- cgit v1.2.3