diff options
-rwxr-xr-x | configure | 30 | ||||
-rw-r--r-- | configure.ac | 30 |
2 files changed, 44 insertions, 16 deletions
@@ -2325,6 +2325,17 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +# 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 @@ -3905,15 +3916,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) : ;; 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) : ;; |