From 9dbb31b6ce1a96c9da50bb1e9c8b56b9c5c54d43 Mon Sep 17 00:00:00 2001 From: Kurt Newman Date: Tue, 5 May 2015 16:04:23 -0500 Subject: [PATCH] Fix WITH_APU_CRYPTO check on 32-bit Linux platform All of the apr flags needed to compile APU_HAVE_CRYPTO check in configure.ac aren't passed. While this works fine for 64-bit machines (because _LARGEFILE64_SOURCE is already defined), this does not work on 32-bit. This in-turn breaks the apr_off_t definition in apr.h. By passing along the apr --cflags and --cppflags to compile, 32-bit machines will allow WITH_APU_CRYPTO to be set if there's support for it. --- CHANGES | 2 ++ configure.ac | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 03e4a283..becf7acb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ DD mmm YYYY - X.Y.Z (To be released) ------------------------------------ + * Fix apr_crypto.h check on 32-bit Linux platform + [Issue #882 - Kurt Newman] * Fix variable resolution duration (Content of the DURATION variable). [Issue #662 - Andrew Elble] * Fix crash while adding empty keys to persistent collections. diff --git a/configure.ac b/configure.ac index f00172a7..75178858 100644 --- a/configure.ac +++ b/configure.ac @@ -712,7 +712,12 @@ CHECK_YAJL() CHECK_SSDEEP() #AC_SEARCH_LIBS([fuzzy_hash_buf], [fuzzy]) -CFLAGS="$CFLAGS $APU_CFLAGS" +# Temporarily set cflags for apr_crypto check, then restore +# since it's already used correctly to compile modsecurity module. +ORIG_CFLAGS="$CFLAGS $APU_CFLAGS" +ORIG_CPPFLAGS="$CPPFLAGS" +CFLAGS="$CFLAGS $APR_CFLAGS" +CPPFLAGS="$CPPFLAGS $APR_CPPFLAGS" AC_TRY_COMPILE( [#include ], [ @@ -725,6 +730,10 @@ AC_TRY_COMPILE( ], [ AC_MSG_WARN([APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto']) ] ) +# Restore env vars so that we don't clutter with duplicates that +# are eventually appended later on +CFLAGS="$ORIG_CFLAGS" +CPPFLAGS="$ORIG_CPPFLAGS" # Current our unique download backend is curl, furhter we can support more. if test ! -z "${CURL_VERSION}"; then