aboutsummaryrefslogtreecommitdiff
path: root/src/m4
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2013-09-18 17:09:11 -0400
committerCory Fields <cory-nospam-@coryfields.com>2013-09-18 17:11:41 -0400
commitc546dc05bb5f0e6020a7e3ecf5cda70f0f472d76 (patch)
tree91fe410f14b788d1e9358a6fe4fff2593b0d74ad /src/m4
parent2e9c8aed310bb90b607954f3b0d5135545f55a10 (diff)
autotools: fix subdir m4 check, never let it return -I
If BDB_CPPFLAGS returns only "-I", the next argument sent to the preprocessor is treated as a path. There are 2 fixes here: 1. Check in CPPFLAGS, as a user might have manually passed a path to check. 2. Ensure the value is not empty before setting BDB_CPPFLAGS to "-I value"
Diffstat (limited to 'src/m4')
-rw-r--r--src/m4/bitcoin_subdir_to_include.m46
1 files changed, 4 insertions, 2 deletions
diff --git a/src/m4/bitcoin_subdir_to_include.m4 b/src/m4/bitcoin_subdir_to_include.m4
index 9b37a75ef0..66f106c7d4 100644
--- a/src/m4/bitcoin_subdir_to_include.m4
+++ b/src/m4/bitcoin_subdir_to_include.m4
@@ -5,8 +5,10 @@ AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[
AC_MSG_RESULT([default])
else
echo "#include <$2$3.h>" >conftest.cpp
- newinclpath=`${CXXCPP} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`]
+ newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`]
AC_MSG_RESULT([${newinclpath}])
- eval "$1=\"\$$1\"' -I${newinclpath}'"
+ if test "x${newinclpath}" != "x"; then
+ eval "$1=\"\$$1\"' -I${newinclpath}'"
+ fi
fi
])