aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2011-05-09 19:19:11 +0000
committerRob Austein <sra@hactrn.net>2011-05-09 19:19:11 +0000
commit0a6d3dfa022f7c6199e0cc590bf852c76fff829c (patch)
tree311b4bd56ef4f8a72468149ecdc31d992393a5a8 /configure.ac
parent34e1d304cd086bc3646d62ad6415e965dfc18b7f (diff)
Better handling of --with-system-openssl=yes
svn path=/configure; revision=3808
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 22 insertions, 8 deletions
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)
:
;;