2016-09-22 00:54:41 +02:00
|
|
|
dnl Copyright (c) 2013-2014 The Bitcoin Core developers
|
|
|
|
dnl Distributed under the MIT software license, see the accompanying
|
|
|
|
dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2013-09-07 21:43:25 +02: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],[
|
2021-11-24 13:16:53 +01:00
|
|
|
if test "$2" = ""; then
|
2013-09-07 21:43:25 +02:00
|
|
|
AC_MSG_RESULT([default])
|
|
|
|
else
|
|
|
|
echo "#include <$2$3.h>" >conftest.cpp
|
2013-09-18 23:09:11 +02: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 21:43:25 +02:00
|
|
|
AC_MSG_RESULT([${newinclpath}])
|
2021-11-24 13:16:53 +01:00
|
|
|
if test "${newinclpath}" != ""; then
|
2013-09-18 23:09:11 +02:00
|
|
|
eval "$1=\"\$$1\"' -I${newinclpath}'"
|
|
|
|
fi
|
2013-09-07 21:43:25 +02:00
|
|
|
fi
|
|
|
|
])
|