You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

starwels_subdir_to_include.m4 798B

123456789101112131415161718
  1. dnl Copyright (c) 2013-2014 The Starwels developers
  2. dnl Distributed under the MIT software license, see the accompanying
  3. dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. dnl STARWELS_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE])
  5. dnl SUBDIRECTORY-NAME must end with a path separator
  6. AC_DEFUN([STARWELS_SUBDIR_TO_INCLUDE],[
  7. if test "x$2" = "x"; then
  8. AC_MSG_RESULT([default])
  9. else
  10. echo "#include <$2$3.h>" >conftest.cpp
  11. 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. AC_MSG_RESULT([${newinclpath}])
  13. if test "x${newinclpath}" != "x"; then
  14. eval "$1=\"\$$1\"' -I${newinclpath}'"
  15. fi
  16. fi
  17. ])