/
configure.in
122 lines (122 loc) · 3.69 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
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
122
dnl Copyright (c) 1994 Darren Erik Vengroff
dnl
dnl File: configure.in
dnl Author: Darren Erik Vengroff <darrenv@eecs.umich.edu>
dnl Created: 10/13/94
dnl
dnl $Id: configure.in,v 1.11 2002-06-06 16:44:20 tavi Exp $
dnl
dnl Macro file for autoconfig for the TPIE system.
dnl
AC_PREREQ(2.0)
AC_INIT(include/ami.h)
AC_CONFIG_HEADER(include/config.h)
AC_REVISION($Revision: 1.11 $)dnl
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_RANLIB
dnl
dnl Check for OSF/1.
define(AC_OSF,
[AC_CHECKING(for OSF/1)
AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes,
[#include <standards.h>
#ifdef _OSF_SOURCE
yes
#endif
],
AC_MSG_RESULT(detected.)
OSF1=1,
AC_MSG_RESULT(not detected.)
OSF1=0)
])dnl
AC_SUBST(OSF1)
dnl
AC_OSF
dnl Set the language to C when checking for functions so that we look
dnl for them as C functions and not as C++ functions (e.g. foo()
dnl becomes foo__Fv).
AC_LANG_C
AC_HAVE_FUNCS(mmap getrusage)
AC_CHECK_LIB(aio,aioread)
AC_LANG_CPLUSPLUS
AC_HAVE_HEADERS(strings.h string.h unistd.h sys/unistd.h)
dnl
dnl A macro for searching for prototypes in header files.
dnl Unfortunately, not all library functions have prototypes
dnl in header files on all systems.
dnl
define(AC_PROTOTYPE,
[AC_PROVIDE([$0])AC_CHECKING([for $1() prototype in $2])
AC_HEADER_EGREP($1, $2,
[AC_DEFINE(HAVE_PROTOTYPE_]translit($1,a-z,A-Z)[)])])
dnl
AC_PROTOTYPE(mmap, sys/mman.h)
AC_PROTOTYPE(munmap, sys/mman.h)
AC_PROTOTYPE(ftruncate, unistd.h)
AC_PROTOTYPE(ftruncate, sys/types.h)
dnl
dnl How to check for perl and indent
dnl
AC_DEFUN(AC_PROG_PERL,
[AC_CHECK_PROG(PERL, perl, perl, )])
AC_DEFUN(AC_PROG_INDENT,
[AC_CHECK_PROG(INDENT, indent, indent, cat)])
dnl
dnl Enable or disable expansion AMI_scan.h. Expansion is useful for
dnl debugging.
dnl
AC_CHECKING(whether to enable expansion of ami_scan.h...)
AC_ARG_ENABLE(expand-ami-scan, Expand the ami_scan.h header file,
[
AC_MSG_RESULT("enabled.")
EXPAND_AMI_SCAN_H=yes
AC_PROG_INDENT
if test [$]INDENT = cat; then
AC_MSG_WARN(indent not found. Using [$]INDENT)
INDENTFLAGS=" "
else
if ($INDENT --version >/dev/null); then
INDENTFLAGS="-st -kr"
else
AC_MSG_WARN([$]INDENT is not GNU indent. I'll try it anyway.)
INDENTFLAGS=" "
fi
fi
dnl
AC_PROG_PERL
if test "[$]PERL" = ""; then
AC_MSG_WARN(perl not found. Use --disable-expand-ami-scan and it is not needed.)
fi],
[EXPAND_AMI_SCAN_H=no
INDENT=" "
INDENTFLAGS=" "
AC_MSG_RESULT("disabled.")])
AC_SUBST(INDENTFLAGS)
AC_SUBST(EXPAND_AMI_SCAN_H)
dnl
dnl
dnl Enable or disable assertions and logging for the library and/or apps.
dnl
AC_CHECKING(whether to enable assertions...)
AC_ARG_ENABLE(assert-apps, --disable-assert-apps Turn assertions off in application code (default is on).,
AC_DEFINE(TP_ASSERT_APPS, 0)
AC_MSG_RESULT(app assertions disabled.),
AC_MSG_RESULT(app assertions enabled.))
AC_ARG_ENABLE(assert-lib, --disable-assert-lib Turn assertions off in library code (default is on).,
AC_DEFINE(TP_ASSERT_LIB, 0)
AC_MSG_RESULT(lib assertions disabled.),
AC_MSG_RESULT(lib assertions enabled.))
AC_CHECKING(whether to enable logs...)
AC_ARG_ENABLE(log-apps, --disable-log-apps Turn logging off in application code (default is on).,
AC_DEFINE(TP_LOG_APPS, 0)
AC_MSG_RESULT(app logging disabled.),
AC_MSG_RESULT(app logging enabled.))
AC_ARG_ENABLE(log-lib, --disable-log-lib Turn logging off in libray code (default is on).,
AC_DEFINE(TP_LOG_LIB, 0)
AC_MSG_RESULT(lib logging disabled.),
AC_MSG_RESULT(lib logging enabled.))
dnl
AC_OUTPUT(Makefile test/Makefile include/Makefile lib/Makefile lib/src/Makefile)