test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / m4 / make.m4
blobb5e8f9d4697b4e1b2bfa1cfd3c6533b8e8ae900a
1 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
3 # Copyright (C) 2001-2024 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # AM_MAKE_INCLUDE()
10 # -----------------
11 # Check whether make has an 'include' directive that can support all
12 # the idioms we need for our automatic dependency tracking code.
13 AC_DEFUN([AM_MAKE_INCLUDE],
14 [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
15 cat > confinc.mk << 'END'
16 am__doit:
17         @echo this is the am__doit target >confinc.out
18 .PHONY: am__doit
19 END
20 am__include="#"
21 am__quote=
22 # BSD make does it like this.
23 echo '.include "confinc.mk" # ignored' > confmf.BSD
24 # Other make implementations (GNU, Solaris 10, AIX) do it like this.
25 echo 'include confinc.mk # ignored' > confmf.GNU
26 _am_result=no
27 for s in GNU BSD; do
28   AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
29   AS_CASE([$?:`cat confinc.out 2>/dev/null`],
30       ['0:this is the am__doit target'],
31       [AS_CASE([$s],
32           [BSD], [am__include='.include' am__quote='"'],
33           [am__include='include' am__quote=''])])
34   if test "$am__include" != "#"; then
35     _am_result="yes ($s style)"
36     break
37   fi
38 done
39 rm -f confinc.* confmf.*
40 AC_MSG_RESULT([${_am_result}])
41 AC_SUBST([am__include])])
42 AC_SUBST([am__quote])])