From 0a6d3dfa022f7c6199e0cc590bf852c76fff829c Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 9 May 2011 19:19:11 +0000 Subject: Better handling of --with-system-openssl=yes svn path=/configure; revision=3808 --- configure.ac | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 90b1ca28..ca1ee198 100644 --- a/configure.ac +++ b/configure.ac @@ -13,6 +13,17 @@ AC_CONFIG_SRCDIR([rcynic/rcynic.c]) AC_CONFIG_AUX_DIR([buildtools]) AC_CANONICAL_HOST +# Remember whether CFLAGS or LDFLAGS were set explictly. This has to +# come early in the script, before we mess it up testing things. + +if test "x${CFLAGS+set}" = "x" && test "x${LDFLAGS+set}" = "x" +then + CFLAGS_or_LDFLAGS_were_set=no +else + CFLAGS_or_LDFLAGS_were_set=yes +fi + + # Put all the user option stuff up front AC_ARG_WITH([system_openssl], [AS_HELP_STRING([--with-system-openssl], [Link against system copy of OpenSSL])], [], [with_system_openssl=auto]) @@ -88,15 +99,18 @@ old_CFLAGS="$CFLAGS" old_LDFLAGS="$LDFLAGS" case $with_system_openssl in - auto) - case $host_os in - freebsd*) - CFLAGS="-I/usr/local/include" - LDFLAGS="-L/usr/local/lib" - ;; - esac + yes|auto) + if test $CFLAGS_or_LDFLAGS_were_set = no + then + case $host_os in + freebsd*) + CFLAGS="-I/usr/local/include $CFLAGS" + LDFLAGS="-L/usr/local/lib $LDFLAGS" + ;; + esac + fi ;; - yes|no|/usr) + no|/usr) : ;; -- cgit v1.2.3