blob: dd859bbdf896fb9aa305649f68ea97f882f5136c [file] [log] [blame]
Dmitry V. Levin916aded2010-09-09 17:36:36 +00001dnl ### A macro to find the include directory, useful for cross-compiling.
2AC_DEFUN([AC_INCLUDEDIR],
3[AC_REQUIRE([AC_PROG_AWK])dnl
4AC_SUBST(includedir)
5AC_MSG_CHECKING(for primary include directory)
6includedir=/usr/include
7if test -n "$GCC"
8then
9 >conftest.c
10 new_includedir=`
11 $CC -v -E conftest.c 2>&1 | $AWK '
12 /^End of search list/ { print last; exit }
13 { last = [$]1 }
14 '
15 `
16 rm -f conftest.c
17 if test -n "$new_includedir" && test -d "$new_includedir"
18 then
19 includedir=$new_includedir
20 fi
21fi
22AC_MSG_RESULT($includedir)
23])