-
Notifications
You must be signed in to change notification settings - Fork 3
/
aclocal.m4
87 lines (79 loc) · 2.56 KB
/
aclocal.m4
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
# aclocal.m4
#
# Local macros for 'configure' scripts.
#
# Copyright (C) 1999, Andrew Arensburger
#
# $Id$
# XXX - This won't compile on systems that use 'struct direct'. Then
# again, is that bad?
AC_DEFUN(CS_DIRENT_TYPE,
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_CACHE_CHECK([for d_type in struct dirent], cs_cv_dirent_type,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <$ac_header_dirent>
],[struct dirent d; d.d_type],
cs_cv_dirent_type=yes, cs_cv_dirent_type=no)])
if test "$cs_cv_dirent_type" = yes; then
AC_DEFINE(HAVE_DIRENT_TYPE)
fi
])
# CS_CHECK_GNU(name,path)
# E.g., CS_CHECK_GNU([c++],[/usr/bin/c++])
#
# See if 'path' is a GNU program. If you invoke it as "<path> --version",
# it must exit with a status of 0, and its output must contain the string
# "GNU".
# 'name' is the program's name for purposes of constructing ac_cv_*
# variables, and is also printed in the "checking" message.
#
# If the program is GNU, sets ac_cv_have_gnu_<name> to "yes". Otherwise,
# sets it to "no".
AC_DEFUN(CS_CHECK_GNU,dnl
[AC_CACHE_CHECK([for GNU $1],ac_cv_have_gnu_$1,dnl
[if "$2" --version 2>&1 < /dev/null | grep "GNU" > /dev/null; then
ac_cv_have_gnu_$1=yes
else
ac_cv_have_gnu_$1=no
fi])])
# CS_CHECK_GNU_PROGS(variable,progs-to-check-for,value-if-not-found)
# A convenience wrapper around AC_CHECK_PROGS and CS_CHECK_GNU: checks to
# see if the program exists. If yes, also checks whether it's a GNU
# program.
# XXX - This is somewhat misleading: the name contains "PROGS", and the
# syntax is that of AC_CHECK_PROGS (except that the third argument is
# mandatory), but this macro assumes that the second argument is a single
# word. Hence, you can't use this with multiple programs (e.g.,
# CS_CHECK_GNU_PROGS(TAR, tar gtar, true)
AC_DEFUN(CS_CHECK_GNU_PROGS,dnl
[AC_CHECK_PROGS($1,$2,$3)
if test x"$[$1]" != x"$3"; then
CS_CHECK_GNU($2,$[$1])
fi])
dnl CS_CHECK_TYPE(TYPE, DEFAULT, HEADERS)
dnl Check for TYPE in non-standard places: includes HEADERS. If TYPE cannot
dnl be found, define it to be DEFAULT.
AC_DEFUN(CS_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
changequote([,]), [#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
$3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
AC_MSG_RESULT($ac_cv_type_$1)
if test $ac_cv_type_$1 = no; then
AC_DEFINE($1, $2)
fi
])
dnl # This is for Emacs's benefit:
dnl # Local Variables: ***
dnl # mode: auto-fill ***
dnl # fill-column: 75 ***
dnl # End: ***