From 571e9645410482e74714e5089048682e05b3d3f8 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 2 Jun 2020 03:23:07 +0200 Subject: Make OpenSSL dependency optional (used for SHA1) Can be disabled with --without-openssl, otherwise auto-detected. --- configure.ac | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 3a5543c..eb7b347 100644 --- a/configure.ac +++ b/configure.ac @@ -40,10 +40,12 @@ PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= $LIBIMOBILEDEVICE_VE PKG_CHECK_MODULES(libplist, libplist >= $LIBPLIST_VERSION) PKG_CHECK_MODULES(libzip, libzip >= $LIBZIP_VERSION) PKG_CHECK_MODULES(libcurl, libcurl >= $LIBCURL_VERSION) -PKG_CHECK_MODULES(openssl, openssl >= $OPENSSL_VERSION) PKG_CHECK_MODULES(zlib, zlib) -GLOBAL_CFLAGS="-Wno-multichar " +# optional +PKG_CHECK_MODULES(openssl, openssl >= $OPENSSL_VERSION, have_openssl=yes, have_openssl=no) + +GLOBAL_CFLAGS="-Wno-multichar -O2" AC_LDADD="" AC_LDFLAGS="" AC_MSG_CHECKING([whether we need platform-specific build settings]) @@ -111,6 +113,31 @@ fi CFLAGS="$CACHED_CFLAGS" +AC_ARG_WITH([openssl], + [AS_HELP_STRING([--without-openssl], + [Do not use OpenSSL])], + [use_openssl=$withval], + [use_openssl=$have_openssl]) + +if test "x$use_openssl" == "xyes"; then + if test "x$have_openssl" != "xyes"; then + echo "*** NOTE: --with-openssl passed but OpenSSL is not available ***" + use_openssl=no + fi +fi +if test "x$use_openssl" != "xyes"; then + echo "*** NOTE: Using internal SHA1 implementation ***" + have_openssl=no + openssl_CFLAGS= + openssl_LIBS= +fi +if test "x$have_openssl" == "xyes"; then + AC_DEFINE(HAVE_OPENSSL, [1], [Define if you have OpenSSL]) +fi +AC_SUBST(openssl_CFLAGS) +AC_SUBST(openssl_LIBS) + +AM_CONDITIONAL(USE_INTERNAL_SHA1, test x$use_openssl != xyes) AC_SUBST(GLOBAL_CFLAGS) AC_SUBST(AC_LDFLAGS) -- cgit v1.1-32-gdbae