summaryrefslogtreecommitdiffstats
path: root/aclocal.m4
blob: ab61fe7df0615a8f8fed5cf35836c92ab744c6c1 (plain)
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
dnl --------------------------------------------------------------------------
dnl MF_PATH_INCLUDE:
dnl
dnl Like AC_PATH_PROGS, but add to the .h file as well
dnl --------------------------------------------------------------------------
AC_DEFUN(MF_PATH_INCLUDE,
[AC_PATH_PROGS($1,$2)
if test -n "$$1"; then
  AC_DEFINE(HAVE_$1)
  AC_DEFINE_UNQUOTED(PATH_$1, "$$1")
fi])

dnl --------------------------------------------------------------------------
dnl MF_FILE_R:
dnl
dnl Look for a file entry and define a variable if exists and is readable
dnl Redirect stdin in case we're checking for /dev/stdin
dnl --------------------------------------------------------------------------
AC_DEFUN(MF_FILE_R,
[AC_MSG_CHECKING(for $2)
if test -r "$2" < /dev/null; then
  AC_DEFINE(HAVE_$1)
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi])

dnl --------------------------------------------------------------------------
dnl MF_FILE_W:
dnl
dnl Look for a file entry and define a variable if exists and is writeable
dnl Redirect stdout, stderr in case we're checking for /dev/stdout,err
dnl --------------------------------------------------------------------------
AC_DEFUN(MF_FILE_W,
[AC_MSG_CHECKING(for $2)
if test -w "$2" > /dev/null 2>&1; then
  AC_DEFINE(HAVE_$1)
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi])

dnl --------------------------------------------------------------------------
dnl MF_PROG_GNU_ZCAT:
dnl
dnl Check to see if zcat is really gzip
dnl --------------------------------------------------------------------------
AC_DEFUN(MF_PROG_GNU_ZCAT,
[AC_MSG_CHECKING(whether zcat is really gzip)

AC_CACHE_VAL(mf_cv_prog_gnu_zcat,
[if echo -e "\37\213\10\10\273\31\152\57\4\3\170\0\3\0\0\0\0\0\0\0\0\0\c"| $1 \
	2>&1 >/dev/null || grep "GNU" $1 2>&1 >/dev/null
then
	mf_cv_prog_gnu_zcat=yes
else
	mf_cv_prog_gnu_zcat=no
fi])

if test "$mf_cv_prog_gnu_zcat" = "yes" 
then
	AC_DEFINE(ZCAT_IS_GZIP)
fi
AC_MSG_RESULT($mf_cv_prog_gnu_zcat)
])

dnl --------------------------------------------------------------------------
dnl MF_PROG_DITROFF:
dnl
dnl Check to see if ditroff works
dnl --------------------------------------------------------------------------
AC_DEFUN(MF_PROG_DITROFF,
[AC_MSG_CHECKING(whether ditroff works)

AC_CACHE_VAL(mf_cv_prog_ditroff,
[if cat << EOF | $1 2>&1 >/dev/null
x T ps
x res 72000 1 1
x init
p1
x trailer
V792000
x stop
EOF
then
	mf_cv_prog_ditroff=yes
else
	mf_cv_prog_ditroff=no
fi])

if test "$mf_cv_prog_ditroff" = "yes" 
then
	AC_DEFINE(DITROFF_WORKS)
fi
AC_MSG_RESULT($mf_cv_prog_ditroff)
])