Skip to content

Commit f93e7c0

Browse files
committed
configure: BITCOIN_SUBDIR_TO_INCLUDE: Improve compatibility with paths including space and multiline cpp output
1 parent c006ab2 commit f93e7c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build-aux/m4/bitcoin_subdir_to_include.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[
99
AC_MSG_RESULT([default])
1010
else
1111
echo "#include <$2$3.h>" >conftest.cpp
12-
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`]
12+
newinclpath=$(${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | sed [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)]$3\.h[([[:space:]].*)?$/\3/' -e 't' -e d])
1313
AC_MSG_RESULT([${newinclpath}])
1414
if test "${newinclpath}" != ""; then
1515
eval "$1=\"\$$1\"' -I${newinclpath}'"

0 commit comments

Comments
 (0)