-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.in
More file actions
204 lines (158 loc) · 5.88 KB
/
Copy pathconfigure.in
File metadata and controls
204 lines (158 loc) · 5.88 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
dnl $Id: configure.in,v 1.15 2005/05/19 22:05:11 wangn Exp $
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
AC_INIT(mlitecc, 0.1, ning@mlite.org)
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.53)
dnl Create a configuration header
AM_CONFIG_HEADER(config.h:config-h.in)
AM_INIT_AUTOMAKE(mlitecc, 1.0)
mlite_top_srcdir=`pwd`
dnl --enable-ansi : try to force --ansi option to the compiler
AC_ARG_ENABLE(ansi,
[ --enable-ansi Force --ansi option for compilation])
dnl --disable-debug : remove -g and -Wall option to the compiler
AC_ARG_ENABLE(debug,
[ --enable-debug Add -g option for compilation (default)])
dnl --enable-checker : add --with-checker-debug option to the compiler
AC_ARG_ENABLE(checker,
[ --enable-checkergcc Option for compilation with checkergcc])
dnl --enable-gc : Enable Boehm-Weiser Conservative Garbage Collector
AC_ARG_ENABLE(checker,
[ --enable-gc Use Boehm-Weiser Conservative Garbage Collector ])
dnl --enable-nosqrt : define NOSQRT for the code
AC_ARG_ENABLE(nosqrt,
[ --enable-nosqrt Use always log/exp for nonlinear capacitances])
dnl --enable-bypass : define BYPASS for the code
AC_ARG_ENABLE(nobypass,
[ --enable-nobypass Don't bypass recalculations of slowly changing variables])
dnl --enable-smoketest : a smoketest
AC_ARG_ENABLE(smoketest,
[ --enable-smoketest Enable smoketest compile])
dnl Enable maintainer commands only if requested
dnl AM_MAINTAINER_MODE
dnl Work on compiler options according to system:
dnl Set default CFLAGS - only use -Wall if we have gcc
AC_CHECKING(for C compiler)
AC_PROG_CC
dnl Checks and sets C compiler flags
CFLAGS="-g"
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall "
fi
if test "$enable_debug" = "no"; then
AC_MSG_WARN(Removing debugging option!)
CFLAGS=" "
fi
dnl Not sure that this will work....
if test "$with_checkergcc" = "yes"; then
CC="checkergcc"
fi
dnl
AC_ARG_WITH(
mlite_build_tools,
[AC_HELP_STRING([[--with-mlite-build-tools=PATH]],[base directory for mlite-build-tools])],
[ MLITE_BUILD_TOOL_HOME="$withval" ],
[ MLITE_BUILD_TOOL_HOME="/usr/local" ])
dnl setting the enviroment flags
CPPFLAGS="$CPPFLAGS -I$MLITE_BUILD_TOOL_HOME/include"
LDFLAGS="$LDFLAGS -L$MLITE_BUILD_TOOL_HOME/lib"
dnl Checks for ANSI-C header files.
AC_HEADER_STDC
dnl Checks for more header files
AC_CHECK_HEADERS(getopt.h stdbool.h)
AC_CHECK_HEADERS(gmp.h mpfr.h)
if test "$enable_ansi" = "yes"; then
AM_PROG_CC_STDC
if test ! "$am_cv_prog_cc_stdc"="yes"; then
AC_MSG_WARN(Failed to find Ansi flag!)
fi
fi
if test "$enable_smoketest" = "yes"; then
CFLAGS="$CFLAGS -Werror"
CFLAGS="$CFLAGS -pedantic -W -Wmissing-prototypes"
CFLAGS="$CFLAGS -Wstrict-prototypes"
# CFLAGS="$CFLAGS -Wstrict-prototypes -Wtraditional"
CFLAGS="$CFLAGS -Wconversion -Wshadow -Wpointer-arith"
CFLAGS="$CFLAGS -Wcast-qual -Wcast-align -Wwrite-strings"
CFLAGS="$CFLAGS -Waggregate-return -fshort-enums -fno-common"
CFLAGS="$CFLAGS -Wnested-externs -Dinline= -g -O4"
fi
dnl Chech system we're on , and tune accordingly
AC_CANONICAL_HOST
dnl Checks for programs
dnl AC_LIBTOOL_DLOPEN
dnl AM_PROG_LIBTOOL
dnl AC_PROG_LIBTOOL
AC_PROG_RANLIB
AC_SUBST(ac_aux_dir)
dnl Call testsuite's ./configure script recursively.
dnl AC_CONFIG_SUBDIRS([foreign_package])
AM_PROG_LEX
AC_PROG_YACC
AC_CHECKING(libraries)
AC_ARG_WITH(
sqlite3,
[AC_HELP_STRING([[--with-sqlite3=PATH]],[base directory for sqlite])],
[LIBS="$LIBS -L$withval/lib"
CPPFLAGS="$CPPFLAGS -I$withval/include"])
dnl AC_CHECKING(for sqlite3 library)
dnl AC_CHECK_LIB(
dnl sqlite3, sqlite3_open,,
dnl AC_ERROR([SQLite is required. See the --with-sqlite3 configure option.]))
dnl AC_CHECKING(for Sqlite header files)
dnl AC_CHECK_HEADER(sqlite3.h,,
dnl AC_ERROR([SQLite is required. See the --with-sqlite3 configure option.]))
AC_CHECKING(for OCaml header files)
CAMLLOC=`ocamlc -where`
CPPFLAGS="$CPPFLAGS -I$CAMLLOC"
# ----------------- finish up -------------------
# names of the variables that get substituted in files; for example,
# write @ARCHOS@ somewhere in a written file to get it substituted
AC_SUBST(mlite_top_srcdir)
AC_SUBST(CAMLLOC)
AC_SUBST(MLITE_BUILD_TOOL_HOME)
dnl end of checking
AC_CONFIG_FILES([\
Makefile Makefile.conf\
OCamlMakefile\
bin/debug_mlitecc\
src/ml4/Makefile src/ml4/.depend\
src/utils/mlite_config.ml\
src/utils/Makefile src/utils/.depend\
src/frontc/Makefile src/frontc/.depend\
src/c2cmm/caml_config.ml src/c2cmm/Makefile src/c2cmm/.depend\
src/bgrab/Makefile src/bgrab/.depend\
src/cmm/Makefile src/cmm/.depend\
src/cmm_utils/Makefile src/cmm_utils/.depend\
src/const_folding/Makefile src/const_folding/.depend\
])
dnl testsuite/Makefile\
dnl testsuite/exec/Makefile\
dnl testsuite/check00/Makefile\
dnl testsuite/check10/Makefile\
dnl testsuite/check10_fs/Makefile\
dnl testsuite/check30/Makefile\
dnl testsuite/check_results/Makefile\
AC_OUTPUT
chmod 755 bin/*
echo \
"------------------------------------------------------------------------
Configuration:
Host System Type: ${host}
MLITE_BUILD_TOOL_HOME: ${MLITE_BUILD_TOOL_HOME}
Source code location: ${srcdir}
C Compiler: ${CC}
C Compiler flags: ${CFLAGS}
Ocaml lib path: ${CAMLLOC}
CPPFLAGS: ${CPPFLAGS}
LDFLAGS: ${LDFLAGS}
Install path: ${prefix}
mlite_top_srcdir: ${mlite_top_srcdir}
See config.h for further configuration information.
------------------------------------------------------------------------"