5 dnl there are two different heuristics for doing the kernel tests
6 dnl a) running nm and greping the output
7 dnl b) trying linking against the kernel
9 dnl AC_CHECK_KERNEL(name, cv, magic, [includes])
10 AC_DEFUN([AC_CHECK_KERNEL],
11 [AC_MSG_CHECKING([for $1 in kernel])
14 if expr "$target_os" : "darwin" > /dev/null 2>&1; then
15 if nm $KERNEL | egrep "\\<_?$1\\>" >/dev/null 2>&1; then
20 elif expr "$target_os" : "osf" >/dev/null 2>&1; then
21 if nm $KERNEL | egrep "^$1 " > /dev/null 2>&1; then
26 elif expr "$target_os" : "freebsd" >/dev/null 2>&1; then
27 if nm $KERNEL | egrep "T $1" > /dev/null 2>&1; then
32 elif expr "$target_os" : "dragonfly" >/dev/null 2>&1; then
33 if nm $KERNEL | egrep "T $1" > /dev/null 2>&1; then
38 elif expr "$target_os" : "netbsd" >/dev/null 2>&1; then
39 if nm $KERNEL | egrep "T _?$1" > /dev/null 2>&1; then
45 cat > conftest.$ac_ext <<EOF
46 dnl This sometimes fails to find confdefs.h, for some reason.
47 dnl [#]line __oline__ "[$]0"
48 [#]line __oline__ "configure"
59 CFLAGS="$CFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
60 if AC_TRY_EVAL(ac_compile) && AC_TRY_EVAL(ac_kernel_ld) && test -s conftest; then
64 echo "configure: failed program was:" >&AC_FD_CC
65 cat conftest.$ac_ext >&AC_FD_CC
72 AC_MSG_RESULT($ac_res)
73 if test "$ac_res" = yes; then
74 foo=HAVE_KERNEL_[]upcase($1)
75 AC_DEFINE_UNQUOTED($foo, 1)