-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
67 lines (56 loc) · 1.85 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(sgrep.h)
dnl And the makefile.in
AM_INIT_AUTOMAKE(sgrep, 1.94a)
dnl Checks for programs.
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_CYGWIN
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h sys/times.h sys/mman.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
dnl Checks for library functions.
dnl I don't use AC_FUNC_MMAP since it is too strict. readonly mappings are
dnl OK for sgrep, whether private or shared or whatever
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(mmap dup dup2 pipe fileno select strerror strtol times vsnprintf)
dnl Compilation options
dnl Check the preprocessor
AC_ARG_WITH(preprocessor, [ --with-preprocessor=COMMAND
Use preprocessor COMMAND [m4 -s]],
,with_preprocessor="m4 -s"
)
echo "Using preprocessor '${with_preprocessor}'"
dnl Check whether to enable assertions
AC_ARG_ENABLE(assertions,[ --disable-assertions Disable all assertions. Recommended only for
benchmarking (currently).],
,
enable_assertions="1")
if test "x${enable_assertions}" = "xno"; then
echo "Disabling assertions."
AC_DEFINE(ENABLE_ASSERTIONS,0)
else
echo "Enabling assertions."
AC_DEFINE(ENABLE_ASSERTIONS,1)
fi
dnl Check whether to disable assertions
AC_ARG_ENABLE(memory-debug,[ --disable-memory-debug Disable builtin memory leak tracing. Recommended
only for benchmarking (currently).],
,
enable_memory_debug="1")
if test "x${enable_memory_debug}" = "xno"; then
echo "Disabling memory leak and allocation debugging."
AC_DEFINE(MEMORY_DEBUG,0)
else
echo "Enabling memory leak and allocation debugging."
AC_DEFINE(MEMORY_DEBUG,1)
fi
AM_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)