diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-16 11:56:31 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-16 12:00:18 +0200 |
commit | 6fc1dc1a32b0f16ac6bdee323496ab1fd5d0b6c9 (patch) | |
tree | 7f75c48762589fc8f6ae509b562ecd98e2cb35a4 /build-aux/m4/bitcoin_subdir_to_include.m4 | |
parent | f0103441564b828e4d16142490a2f4bbef62da9a (diff) | |
parent | 52a5f903605760f54370863679740f5ac0354f13 (diff) | |
download | bitcoin-6fc1dc1a32b0f16ac6bdee323496ab1fd5d0b6c9.tar.xz |
Merge pull request #4719
52a5f90 Create the common location for all m4 autotool build scripts, build-aux/m4.
Diffstat (limited to 'build-aux/m4/bitcoin_subdir_to_include.m4')
-rw-r--r-- | build-aux/m4/bitcoin_subdir_to_include.m4 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/build-aux/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4 new file mode 100644 index 0000000000..66f106c7d4 --- /dev/null +++ b/build-aux/m4/bitcoin_subdir_to_include.m4 @@ -0,0 +1,14 @@ +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 + 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}]) + if test "x${newinclpath}" != "x"; then + eval "$1=\"\$$1\"' -I${newinclpath}'" + fi + fi +]) |