1 # Check to see how 'make' treats includes. -*- Autoconf -*-
3 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 # Check to see how make treats includes.
25 AC_DEFUN([AM_MAKE_INCLUDE],
27 cat > confinc << 'END'
32 # If we don't find an include directive, just comment out the code.
33 AC_MSG_CHECKING([for style of include used by $am_make])
37 # First try GNU make style include.
38 echo "include confinc" > confmf
39 # We grep out `Entering directory' and `Leaving directory'
40 # messages which can occur if `w' ends up in MAKEFLAGS.
41 # In particular we don't look at `^make:' because GNU make might
42 # be invoked under some other name (usually "gmake"), in which
43 # case it prints its new name instead of `make'.
44 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
49 # Now try BSD make style include.
50 if test "$am__include" = "#"; then
51 echo '.include "confinc"' > confmf
52 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
58 AC_SUBST([am__include])
60 AC_MSG_RESULT([$_am_result])