diff options
| author | 2020-06-02 03:23:07 +0200 | |
|---|---|---|
| committer | 2020-06-02 03:23:07 +0200 | |
| commit | 571e9645410482e74714e5089048682e05b3d3f8 (patch) | |
| tree | f2309cc8cabdb9e681623ae1c7df75f921daf0e8 /configure.ac | |
| parent | 8036f3f227211fdff18cbbf85ab84f45a44c5add (diff) | |
| download | idevicerestore-571e9645410482e74714e5089048682e05b3d3f8.tar.gz idevicerestore-571e9645410482e74714e5089048682e05b3d3f8.tar.bz2 | |
Make OpenSSL dependency optional (used for SHA1)
Can be disabled with --without-openssl, otherwise auto-detected.
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 31 | 
1 files changed, 29 insertions, 2 deletions
| 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) | 
