summaryrefslogtreecommitdiff
path: root/src/scripts/Configure-Makefile
diff options
context:
space:
mode:
authorPhil Pennock <pdp@exim.org>2016-10-18 23:22:03 -0400
committerPhil Pennock <pdp@exim.org>2016-10-18 23:28:13 -0400
commit8b0fb68e04323248df1208516e8a9293af9859d8 (patch)
tree63c1589280b367a4fa75c72824c6a7508e3b4577 /src/scripts/Configure-Makefile
parent8d330698b5121d75af35b62b420314f68026d1e5 (diff)
downloadexim4-8b0fb68e04323248df1208516e8a9293af9859d8.tar.gz
Unbreak build: crypto hdrs not in system includes
If using pkg-config to get the paths for various packages and the crypto library headers are not in the system headers, then the hash work broke the Exim build by requiring the CFLAGS manipulation for _all_ builds, not just the TLS libraries. Shows up on MacOS where there's a system OpenSSL but not system OpenSSL headers (because only SecureTransport is supported) and using brew-installed OpenSSL. I've also coded the fix for GnuTLS on the same basis, but that's untested. Fixes bug 1906
Diffstat (limited to 'src/scripts/Configure-Makefile')
-rwxr-xr-xsrc/scripts/Configure-Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile
index 4aa7d76cd..3e486a6bb 100755
--- a/src/scripts/Configure-Makefile
+++ b/src/scripts/Configure-Makefile
@@ -136,13 +136,16 @@ then
USE_*_PC)
eval "pc_value=\"\$$var\""
need_this=''
+ need_core=''
if [ ".$SUPPORT_TLS" = "." ]; then
# no TLS, not referencing
true
elif [ ".$var" = ".USE_GNUTLS_PC" ] && [ ".$USE_GNUTLS" != "." ]; then
need_this=t
+ need_core="gnutls-special"
elif [ ".$var" = ".USE_OPENSSL_PC" ] && [ ".$USE_GNUTLS" = "." ]; then
need_this=t
+ need_core=t
fi
if [ ".$need_this" != "." ]; then
tls_include=`pkg-config --cflags $pc_value`
@@ -153,6 +156,19 @@ then
tls_libs=`pkg-config --libs $pc_value`
echo "TLS_INCLUDE=$tls_include"
echo "TLS_LIBS=$tls_libs"
+ # With hash.h pulling crypto into the core, we need to also handle that
+ if [ ".$need_this" = ".t" ]; then
+ echo "CFLAGS += $tls_include"
+ echo "LDFLAGS += $tls_libs"
+ elif [ ".$need_this" = ".gnutls-special" ]; then
+ if pkg-config --atleast-version=2.10 gnutls ; then
+ echo "CFLAGS += $tls_include"
+ echo "LDFLAGS += $tls_libs"
+ else
+ echo "CFLAGS += $(libgcrypt-config --cflags)"
+ echo "LDFLAGS += $(libgcrypt-config --libs)"
+ fi
+ fi
fi
;;