This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
165 lines (120 loc) · 4.17 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
AC_PREREQ([2.19])
AC_INIT([itsctl],
[0.1],
# Automake initialisation
AM_INIT_AUTOMAKE([1.10 -Wall foreign])
# link time opt, set AR and RANLIB before LT_INIT call, unless configure overrides them.
# also Options for disabling LTO on Darwin since binutils sucks big time on that platform.
nolto=false
AC_ARG_ENABLE( [nolto],
[AC_HELP_STRING([--enable-nolto],[avoid using LTO flags, mostly for Darwin])],
[ case "${enable_nolto}" in
yes) nolto=true
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
if test "x$nolto" = "xfalse"; then
CXXFLAGS="-flto $CXXFLAGS"
test -z "$AR" && AR=gcc-ar
test -z "$RANLIB" && RANLIB=gcc-ranlib
fi
# option to indicate libddd folder
AC_ARG_WITH([libddd],
[AC_HELP_STRING([--with-libddd=/root/of/libddd],
[specify the path of libddd])])
AM_CONDITIONAL([WITH_LIBDDD_PATH], [test "x${with_libddd}" != x])
if test "x${with_libddd}" != x; then
AC_SUBST([LIBDDD_ROOT],[${with_libddd}])
fi
AC_CHECK_LIB(tcmalloc, malloc, ,AC_MSG_WARN(google perftool not detected : not using tcmalloc))
AC_CHECK_LIB(dl, dlopen, ,AC_MSG_WARN(No operational dynamic link libdl found. This is a real problem.))
#Options for disabling google hash
stdhash=false
AC_ARG_ENABLE( [stdhash],
[AC_HELP_STRING([--enable-stdhash],[revert std lib hash map(default uses google sparse hash)])],
[ case "${enable_stdhash}" in
yes) stdhash=true
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
if test "x$stdhash" = "xtrue"; then
AC_DEFINE([USE_STD_HASH],1,[Define if you want to use std hash instead of google sparse hash.])
fi
CPPFLAGS="-Wno-unused-local-typedefs $CPPFLAGS"
LDFLAGS="-all-static -static-libgcc -static-libstdc++ $LDFLAGS"
AC_ARG_ENABLE([mingw-native],
[AC_HELP_STRING([--enable-mingw-native],[build native win32 binaries for redistribution])],
[ case "${enable_mingw_native}" in
yes) CXXFLAGS="-DPSAPI_VERSION=1 $CXXFLAGS"
LDFLAGS="-Wl,-static,--stack,16777216 $LDFLAGS"
LIBS="-lPSAPI -lstdc++ -lpthread $LIBS"
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
# M4 macros location
AC_CONFIG_MACRO_DIR([m4])
# option to indicate libits folder
AC_ARG_WITH([libits],
[AC_HELP_STRING([--with-libits=/root/of/libits],
[specify the path of libits])])
AM_CONDITIONAL([WITH_LIBITS_PATH], [test "x${with_libits}" != x])
if test "x${with_libits}" != x; then
AC_SUBST([LIBITS_ROOT],[${with_libits}])
fi
# option to indicate libexpat folder
AC_ARG_WITH([libexpat],
[AC_HELP_STRING([--with-libexpat=/root/of/libexpat],
[specify the path of libexpat])])
AM_CONDITIONAL([WITH_LIBEXPAT_PATH], [test "x${with_libexpat}" != x])
if test "x${with_libexpat}" != x; then
AC_SUBST([LIBEXPAT_ROOT],[${with_libexpat}])
fi
# option to indicate the path to the antlr C runtime
AC_ARG_WITH([antlrc],
[AC_HELP_STRING([--with-antlrc=/root/of/antlrc],
[specify the path of antlr C runtime])])
AM_CONDITIONAL([WITH_ANTLRC_PATH], [test "x${with_antlrc}" != x])
if test "x${with_antlrc}" != x; then
AC_SUBST([ANTLRC_ROOT],[${with_antlrc}])
fi
# programs used to build
# we make static libs (use ranlib)
# we make shared libs (use libtool)
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT([disable-shared])
AC_LIBTOOL_DLOPEN
# If the user didn't supplied a CFLAGS value,
# set an empty one to prevent autoconf to stick -O2 -g here.
test -z "$CFLAGS" && CFLAGS=
test -z "$CXXFLAGS" && CXXFLAGS=
# we compile C++11
CXXFLAGS="-std=c++11 $CXXFLAGS"
# compile in C
AC_PROG_CC
# Compile in C++
AC_PROG_CXX
AC_LANG(C++)
# use yacc to create parsers
AM_PROG_LEX
AC_PROG_YACC
# define HAS_STDC_HEADERS
AC_HEADER_STDC
AC_CHECK_TOOL([STRIP],[strip])
# Configure makefiles
AC_CONFIG_FILES([ Makefile \
src/Makefile \
src/ctlp/Makefile \
src/mc/Makefile \
bin/Makefile
])
AC_OUTPUT