-
Notifications
You must be signed in to change notification settings - Fork 26
/
configure.ac
121 lines (98 loc) · 3.14 KB
/
configure.ac
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
112
113
114
115
116
117
118
119
120
121
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT
AC_CONFIG_SRCDIR([access.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
dnl AC_CMDSTDOUT_CPP(variable, command, headers)
AC_DEFUN([AC_CMDSTDOUT_CPP],
[cat > conftest.$ac_ext <<EOF
[#]line __oline__ "configure"
#include "confdefs.h"
[$3]
EOF
$1=`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $2`
rm -f conftest*
])
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_YACC
dnl ----------------------------
dnl CHECK FOR /dev/fd FILESYSTEM
dnl ----------------------------
AC_CACHE_CHECK(for /dev/fd filesystem, es_cv_sys_dev_fd,
[test -d /dev/fd && es_cv_sys_dev_fd=yes || es_cv_sys_dev_fd=no])
if test $es_cv_sys_dev_fd = yes; then
AC_DEFINE(HAVE_DEV_FD, [1], [Do you have a /dev/fd/ directory?])
fi
AC_SYS_INTERPRETER
if test "$ac_cv_sys_interpreter" = yes
then
AC_DEFINE(KERNEL_POUNDBANG, [1], [Does your kernel support #!?])
fi
dnl Checks for libraries.
AC_CHECK_LIB(sun, getpwuid)
ES_WITH_READLINE
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h memory.h stdarg.h sys/cdefs.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_FUNC_MMAP
AC_CHECK_FUNCS(strerror strtol lstat setrlimit sigrelse sighold sigaction \
sysconf setsid sigsetjmp getrusage)
AC_CACHE_CHECK(for an abused getenv, es_cv_abused_getenv,
AC_RUN_IFELSE([AC_LANG_SOURCE([[
changequote(,)
char *foo = 0;
char *foov[] = { "-a", "-bfoo", "bar" };
int fooc = (sizeof(foov) / sizeof(foov[0]));
int getenv() { return *foo; }
int main() { while (-1 != getopt(fooc, foov, "ab:")); exit(0); }
changequote([,])
]])],[es_cv_abused_getenv=no],[es_cv_abused_getenv=yes
AC_DEFINE([ABUSED_GETENV], [1], [Is getenv called by crt*.o or getopt?])],[]))
if test "$es_cv_abused_getenv" = yes
then
rm -f core conftest.core
fi
dnl Check to see if you can assign to a va_list
AC_CACHE_CHECK(whether assignment to va_list ok?, es_cv_assign_va_list,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifndef HAVE_STDARG_H
choke me
#else
#include <stdarg.h>
#endif]], [[va_list first, second; first = second; return 0;]])],[es_cv_assign_va_list=yes],[es_cv_assign_va_list=no]))
if test "$es_cv_assign_va_list" = no
then
AC_DEFINE(NO_VA_LIST_ASSIGN, [1], [NO_VA_LIST_ASSIGN])
fi
dnl check for a u_quad_t or something like that
AC_CACHE_CHECK(for rlimit type ..., es_cv_rlimit_t,
AC_CMDSTDOUT_CPP(es_cv_rlimit_t,
grep rlim_cur | sed -e 's/rlim_cur.*//' -e 's/^ //g' -e 's/^ //g' -e q,
[#ifdef HAVE_SETRLIMIT
# include <sys/resource.h>
#endif],long))
AC_CACHE_CHECK(for files to extract signal information from,
es_cv_sigfiles,
AC_CMDSTDOUT_CPP(es_cv_sigfiles,
[changequote(,)
grep -E '^#[ ]+1[ ]+' | sed 's/.*"\(.*\)".*/\1/' |sort -u |
grep '^/' |tr '\012' ' '
changequote([,])],
[#include <signal.h>], /usr/include/signal.h))
AC_SUBST(SIGFILES, $es_cv_sigfiles)
AC_DEFINE_UNQUOTED(LIMIT_T, $es_cv_rlimit_t, [What type are your limits?])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT