2013-09-07 12:43:25 -07:00
|
|
|
dnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE])
|
|
|
|
dnl SUBDIRECTORY-NAME must end with a path separator
|
|
|
|
AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[
|
|
|
|
if test "x$2" = "x"; then
|
|
|
|
AC_MSG_RESULT([default])
|
|
|
|
else
|
|
|
|
echo "#include <$2$3.h>" >conftest.cpp
|
2013-09-18 14:09:11 -07:00
|
|
|
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`]
|
2013-09-07 12:43:25 -07:00
|
|
|
AC_MSG_RESULT([${newinclpath}])
|
2013-09-18 14:09:11 -07:00
|
|
|
if test "x${newinclpath}" != "x"; then
|
|
|
|
eval "$1=\"\$$1\"' -I${newinclpath}'"
|
|
|
|
fi
|
2013-09-07 12:43:25 -07:00
|
|
|
fi
|
|
|
|
])
|