* m4/make.m4 (AM_MAKE_INCLUDE): Serial 2.
[platform/upstream/automake.git] / m4 / make.m4
1 # Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2, or (at your option)
6 # any later version.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 # 02111-1307, USA.
17
18 # serial 2
19
20 # AM_MAKE_INCLUDE()
21 # -----------------
22 # Check to see how make treats includes.
23 AC_DEFUN([AM_MAKE_INCLUDE],
24 [am_make=${MAKE-make}
25 cat > confinc << 'END'
26 doit:
27         @echo done
28 END
29 # If we don't find an include directive, just comment out the code.
30 AC_MSG_CHECKING([for style of include used by $am_make])
31 am__include="#"
32 am__quote=
33 _am_result=none
34 # First try GNU make style include.
35 echo "include confinc" > confmf
36 # We grep out `Entering directory' and `Leaving directory'
37 # messages which can occur if `w' ends up in MAKEFLAGS.
38 # In particular we don't look at `^make:' because GNU make might
39 # be invoked under some other name (usually "gmake"), in which
40 # case it prints its new name instead of `make'.
41 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
42    am__include=include
43    am__quote=
44    _am_result=GNU
45 fi
46 # Now try BSD make style include.
47 if test "$am__include" = "#"; then
48    echo '.include "confinc"' > confmf
49    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
50       am__include=.include
51       am__quote="\""
52       _am_result=BSD
53    fi
54 fi
55 AC_SUBST(am__include)
56 AC_SUBST(am__quote)
57 AC_MSG_RESULT($_am_result)
58 rm -f confinc confmf
59 ])