File: acinclude.m4

package info (click to toggle)
latex-mk 2.1-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,988 kB
  • ctags: 243
  • sloc: sh: 4,252; makefile: 165
file content (111 lines) | stat: -rw-r--r-- 3,319 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
dnl $Id: acinclude.m4,v 1.4 2005/09/30 10:53:53 dan Exp $
dnl
dnl Copyright (c) 2003, 2005 Dan McMahill
dnl All rights reserved.
dnl
dnl This code is derived from software written by Dan McMahill
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl 1. Redistributions of source code must retain the above copyright
dnl    notice, this list of conditions and the following disclaimer.
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl    notice, this list of conditions and the following disclaimer in the
dnl    documentation and/or other materials provided with the distribution.
dnl 3. All advertising materials mentioning features or use of this software
dnl    must display the following acknowledgement:
dnl        This product includes software developed by Dan McMahill
dnl 4. The name of the author may not be used to endorse or promote products
dnl    derived from this software without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
dnl IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
dnl OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
dnl INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
dnl BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
dnl LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
dnl AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
dnl OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dnl SUCH DAMAGE.
dnl

# Look for GNU make

AC_DEFUN([AC_PATH_GNU_MAKE],
[#AC_MSG_CHECKING([for GNU make])
gnu_make=
for mk in "$GMAKE" "$MAKE" gmake make gnumake ; do
	if test -n "$mk" ; then
		AC_MSG_CHECKING([if $mk is GNU make >= 3.80])
		tmp=`sh -c "$mk --version" 2> /dev/null | grep GNU`
		if test -z "$tmp" ; then
			AC_MSG_RESULT([no])
		else
			case $tmp in
	                *\ 3.[[8-9]][[0-9]]*|*\ [[4-9]].[[0-9]]*)
				AC_MSG_RESULT([yes])
				gnu_make="$mk"
				break
                	        ;;

			* )
				AC_MSG_RESULT([no])
				;;
	                esac    
		fi
	fi
done
if test -z "$gnu_make" ; then
	AC_MSG_NOTICE([No suitable GNU make found.])
	GMAKE=none
	AC_SUBST(GMAKE)
else
	AC_PATH_PROG(GMAKE, $gnu_make)
fi
])dnl


# Look for BSD make
AC_DEFUN([AC_PATH_BSD_MAKE],
[
cat > tmp.mk << EOF
# include some of the "." commands that we need from a 
# BSD make.
MYVAR= BSDmake
MYFLAG= #defined
test:
.for __tmp__ in \${MYVAR}
.if defined(MYFLAG)
	@echo \${__tmp__}
.endif
.endfor

EOF
bsd_make=
for mk in "$BMAKE" "$MAKE" make bmake nbmake ; do
	if test -n "$mk" ; then
		AC_MSG_CHECKING([if $mk is BSD make])
		tmp=`sh -c "$mk -f tmp.mk test" 2> /dev/null | grep BSDmake`
		if test "X$tmp" = "XBSDmake" ; then
			AC_MSG_RESULT([yes])
			bsd_make="$mk"
			break
		else
			AC_MSG_RESULT([no])
		fi
	fi
done
if test -f tmp.mk ; then rm tmp.mk ; fi
if test -z "$bsd_make" ; then
	AC_MSG_NOTICE([No suitable BSD make found.])
	BMAKE=none
	AC_SUBST(BMAKE)
else
	AC_PATH_PROG(BMAKE, $bsd_make)
fi
])dnl