-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconfigure.ac
143 lines (113 loc) · 3.63 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Process this file with autoconf to produce a configure script.
dnl ========== initialization ==========
AC_INIT([mona],[1.4],[[email protected]],[mona],[http://www.brics.dk/mona/])
RELEASE=18
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(Front/mona.cpp)
AM_INIT_AUTOMAKE()
AC_CONFIG_HEADERS([config.h])
AC_SUBST(VERSION)
AC_SUBST(RELEASE)
AC_DEFINE_UNQUOTED(RELEASE, "$RELEASE", Release number of package)
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_CONFIG_MACRO_DIR([m4])
dnl ========== checks for programs ==========
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_YACC
AM_PROG_LEX
LT_INIT
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#ifndef __cplusplus
#error "broken C++"
#endif]])],,
[AC_MSG_ERROR(C++ compiler not found)])
AC_LANG_POP([C++])
if test "x$LEX" != xflex; then
AC_MSG_ERROR(flex not found)
fi
dnl ========== special configure parameters ==========
CFG=
AC_ARG_ENABLE(debug,
[ --enable-debug development mode],
[ case "${enableval}" in
yes) CXXFLAGS="$CXXFLAGS -g -ansi -pedantic" ;;
no) CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],
[ CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG" ])
if test "x$GCC" = "xyes"; then
if test -z "`echo "$CXXFLAGS" | grep "\-Wall -Wno-unused-function -Wno-unused-label -Wno-sign-compare" 2> /dev/null`" ; then
CXXFLAGS="$CXXFLAGS -Wall -Wno-unused-function -Wno-unused-label -Wno-sign-compare"
fi
fi
AC_ARG_ENABLE(profiling,
[ --enable-profiling compile with profiling],
[ case "${enableval}" in
yes) CXXFLAGS="$CXXFLAGS -pg" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
esac])
AC_ARG_ENABLE(dlmalloc,
[ --enable-dlmalloc use dlmalloc instead of built-in malloc],
[ case "${enableval}" in
yes) CXXFLAGS="$CXXFLAGS -DUSE_DLMALLOC" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-dlmalloc) ;;
esac
CFG="$CFG --enable-dlmalloc=$enableval"])
AC_ARG_ENABLE(memdebug,
[ --enable-memdebug enable debug info for dlmalloc],
[ case "${enableval}" in
yes) CXXFLAGS="$CXXFLAGS -DDEBUG" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-memdebug) ;;
esac])
AC_ARG_ENABLE(maxalloc,
[ --enable-maxalloc measure max allocated memory for dlmalloc],
[ case "${enableval}" in
yes) CXXFLAGS="$CXXFLAGS -DMAXALLOCATED" ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-maxalloc) ;;
esac])
AC_SUBST(CFG)
dnl ========== checks for operating system ==========
AC_MSG_CHECKING(Win32 compiler)
have_win32_gcc=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <windows.h> ]], [[]])],[have_win32_gcc=yes],[])
AC_MSG_RESULT($have_win32_gcc)
if test x$have_win32_gcc = xyes; then
CXXFLAGS="$CXXFLAGS -DWIN32"
fi
CFLAGS=$CXXFLAGS
AC_SUBST(CFLAGS)
dnl ========== checks for header files ==========
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h string.h sys/time.h unistd.h
,,AC_MSG_ERROR(required header file not found))
dnl ========== checks for typedefs, structures, and compiler characteristics ==========
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
dnl ========== checks for library functions ==========
AC_DEFUN([FUNCTION_MISSING], [AC_MSG_ERROR(required library function not found)])
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_CHECK_FUNCS(alarm memset mkdir,,FUNCTION_MISSING)
dnl ========== output files ==========
AC_CONFIG_FILES([mona.spec
makefile
config/makefile
Mem/makefile
BDD/makefile
DFA/makefile
GTA/makefile
Front/makefile
Lib/makefile
Examples/makefile])
AC_OUTPUT