diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-05-14 03:02:29 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-05-14 03:02:52 -0700 |
commit | e3af1bc260eee91de3da3b741629dcb6fed0ac2a (patch) | |
tree | f52025a14a71064b6dd659a8cdb40e49b22f95ec | |
parent | c115ab8ae92fd369ac227e93419e76fd6ae8e75c (diff) | |
download | tcpdump-4.7.tar.gz |
Don't check for libcrypto if we don't have openssl/crypto.h.tcpdump-4.7
Thanks, Apple, for making us do this (and for making tcpdump unable to
do some decryption without either installing OpenSSL or working on
trying to do the decryption with Apple's frameworks).
-rw-r--r-- | config.h.in | 3 | ||||
-rwxr-xr-x | configure | 25 | ||||
-rw-r--r-- | configure.in | 15 |
3 files changed, 39 insertions, 4 deletions
diff --git a/config.h.in b/config.h.in index 914289a8..882f4223 100644 --- a/config.h.in +++ b/config.h.in @@ -85,6 +85,9 @@ /* Define to 1 if you have the `openat' function. */ #undef HAVE_OPENAT +/* Define to 1 if you have the <openssl/crypto.h> header file. */ +#undef HAVE_OPENSSL_CRYPTO_H + /* Define to 1 if you have the <openssl/evp.h> header file. */ #undef HAVE_OPENSSL_EVP_H @@ -8161,7 +8161,23 @@ $as_echo "yes, if available" >&6; } fi if test "$want_libcrypto" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DES_cbc_encrypt in -lcrypto" >&5 + # + # If we don't have the header, no point in checking the + # library. + # + # Yes, there are OSes that provide the library but not + # the header. (I'm looking at *you*, recent versions of + # OS X/macOS.) + # + for ac_header in openssl/crypto.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "openssl/crypto.h" "ac_cv_header_openssl_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_crypto_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OPENSSL_CRYPTO_H 1 +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DES_cbc_encrypt in -lcrypto" >&5 $as_echo_n "checking for DES_cbc_encrypt in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_DES_cbc_encrypt+:} false; then : $as_echo_n "(cached) " >&6 @@ -8206,7 +8222,7 @@ _ACEOF fi - for ac_header in openssl/evp.h + for ac_header in openssl/evp.h do : ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" if test "x$ac_cv_header_openssl_evp_h" = xyes; then : @@ -8218,6 +8234,11 @@ fi done + +fi + +done + fi # Check for libcap-ng diff --git a/configure.in b/configure.in index a629559e..abb4c0eb 100644 --- a/configure.in +++ b/configure.in @@ -1112,8 +1112,19 @@ AC_ARG_WITH(crypto, AC_MSG_RESULT([yes, if available]) ]) if test "$want_libcrypto" != "no"; then - AC_CHECK_LIB(crypto, DES_cbc_encrypt) - AC_CHECK_HEADERS(openssl/evp.h) + # + # If we don't have the header, no point in checking the + # library. + # + # Yes, there are OSes that provide the library but not + # the header. (I'm looking at *you*, recent versions of + # OS X/macOS.) + # + AC_CHECK_HEADERS(openssl/crypto.h, + [ + AC_CHECK_LIB(crypto, DES_cbc_encrypt) + AC_CHECK_HEADERS(openssl/evp.h) + ]) fi # Check for libcap-ng |