1 | # Check to see how 'make' treats includes. -*- Autoconf -*-
|
---|
2 |
|
---|
3 | # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
---|
4 |
|
---|
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)
|
---|
8 | # any later version.
|
---|
9 |
|
---|
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.
|
---|
14 |
|
---|
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
|
---|
18 | # 02111-1307, USA.
|
---|
19 |
|
---|
20 | # serial 2
|
---|
21 |
|
---|
22 | # AM_MAKE_INCLUDE()
|
---|
23 | # -----------------
|
---|
24 | # Check to see how make treats includes.
|
---|
25 | AC_DEFUN([AM_MAKE_INCLUDE],
|
---|
26 | [am_make=${MAKE-make}
|
---|
27 | cat > confinc << 'END'
|
---|
28 | am__doit:
|
---|
29 | @echo done
|
---|
30 | .PHONY: am__doit
|
---|
31 | 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])
|
---|
34 | am__include="#"
|
---|
35 | am__quote=
|
---|
36 | _am_result=none
|
---|
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
|
---|
45 | am__include=include
|
---|
46 | am__quote=
|
---|
47 | _am_result=GNU
|
---|
48 | fi
|
---|
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
|
---|
53 | am__include=.include
|
---|
54 | am__quote="\""
|
---|
55 | _am_result=BSD
|
---|
56 | fi
|
---|
57 | fi
|
---|
58 | AC_SUBST([am__include])
|
---|
59 | AC_SUBST([am__quote])
|
---|
60 | AC_MSG_RESULT([$_am_result])
|
---|
61 | rm -f confinc confmf
|
---|
62 | ])
|
---|