configure.ac 6.74 KB
Newer Older
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
1
2
3
# -*- coding: utf-8 -*-
# Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire
# de Recherche et Développement de l'Epita (LRDE).
Guillaume Sadegh's avatar
Guillaume Sadegh committed
4
# Copyright (C) 2003, 2004, 2005, 2006, 2007 Laboratoire d'Informatique de
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
5
# Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
Guillaume Sadegh's avatar
Guillaume Sadegh committed
6
# Pierre et Marie Curie.
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
7
8
9
10
11
#
# This file is part of Spot, a model checking library.
#
# Spot is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
12
# the Free Software Foundation; either version 3 of the License, or
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
13
14
15
16
17
18
19
20
# (at your option) any later version.
#
# Spot is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
21
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
22

23
AC_PREREQ([2.61])
24
AC_INIT([spot], [1.2.3a], [spot@lrde.epita.fr])
25
AC_CONFIG_AUX_DIR([tools])
26
AC_CONFIG_MACRO_DIR([m4])
27
28
29
AM_INIT_AUTOMAKE([1.11 gnu tar-ustar color-tests parallel-tests])
AC_CONFIG_HEADERS([config.h])dnl Private config, not to be used in .hh files.
AX_PREFIX_CONFIG_H([src/misc/_config.h])dnl Public config, for .hh files.
30

31
# If the user didn't supply a CFLAGS value,
32
33
34
35
# set an empty one to prevent autoconf to stick -O2 -g here.
test -z "$CFLAGS" && CFLAGS=
test -z "$CXXFLAGS" && CXXFLAGS=

36
adl_ENABLE_DEVEL
37
38
39
40
41
42
43
44
45
46
47
48
49

AC_ARG_ENABLE([python],
              [AC_HELP_STRING([--disable-python],
                              [do not compile Python bindings])],
              [], [enable_python=yes])

AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes])

if test "x${enable_python:-yes}" = xyes; then
  AC_MSG_NOTICE([You may configure with --disable-python ]dnl
[if you do not need Python bindings.])
  adl_CHECK_PYTHON
fi
50

51
AC_PROG_CC
52
53
gl_EARLY

54
AM_PROG_CC_C_O
55
56
57
AC_PROG_CXX

AM_PROG_LEX
58
adl_CHECK_BISON
59

60
61
gl_INIT

62

63
64
65
# Use -Werror since using -fvisibility under MinGW is only a warning.
# (The option is ignored anyway since this does not make sense under windows).
AX_CHECK_COMPILE_FLAG([-Werror -fvisibility=hidden],
66
67
68
69
  [CFLAGS="$CFLAGS -fvisibility=hidden"])
AC_LANG(C++)
AX_CHECK_COMPILE_FLAG([-Werror -fvisibility=hidden],
  [CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
70
  AX_CHECK_COMPILE_FLAG([-fvisibility-inlines-hidden],
71
72
    [CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"])])
CXXFLAGS="$CXXFLAGS -DSPOT_BUILD"
73

74
# Turn on C++11 support
75
76
77
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody],
[AC_LANG_SOURCE([#include <memory>
#include <string>
78

79
   template <typename T>
80
81
82
83
84
85
86
    struct check
    {
      static_assert(sizeof(int) <= sizeof(T), "not big enough");
    };

    typedef check<check<bool>> right_angle_brackets;

87
88
    auto f = std::make_shared<std::string>("shared_ptr");

89
90
91
92
93
94
95
96
    int a;
    decltype(a) b;

    typedef check<int> check_type;
    check_type c;
    check_type&& cr = static_cast<check_type&&>(c);

    auto d = a;
97
98
99
100
101
102
103
104
105
106
107
])])

for f in -std=c++11 '-std=c++11 -stdlib=libc++' -std=c++0x
do
  AX_CHECK_COMPILE_FLAG([$f], [CXXFLAGS="$CXXFLAGS $f" stdpass=true], [], [],
                        [_AX_CXX_COMPILE_STDCXX_11_testbody])
  ${stdpass-false} && break
done
if ! "${stdpass-false}"; then
  AC_ERROR([unable to turn on C++11 mode with this compiler])
fi
108

109
AX_CHECK_BUDDY
110
AX_CHECK_GSPNLIB
111

112
AC_CHECK_HEADERS([sys/times.h])
113
AC_CHECK_FUNCS([times srand48 drand48 kill alarm])
114

115
LT_CONFIG_LTDL_DIR([ltdl])
116
LT_INIT([win32-dll])
117
LTDL_INIT([subproject convenience])
118
119
120
121
122
123
# Debian resets this to no, but this break both Spot and the libtool
# test suite itself.  Instead of requiring developer to install a
# non-patched version of Libtool on any Debian they use, we just
# cancel the effect of Debian's patch here.
link_all_deplibs=yes
link_all_deplibs_CXX=yes
124

125
126
127
128
adl_ENABLE_DEBUG
ad_GCC_OPTIM
adl_NDEBUG

129
spot_INTEL
130
131
132
if test x$enable_warnings = xyes; then
  CF_GXX_WARNINGS
fi
133

134
AM_CONDITIONAL([NEVER], [false])
135
# We need the absolute path for dot in the "doc/dot" script. Other places
136
137
# only require a relative path.
AC_PATH_PROG([DOT], [dot])
138
139
AC_CHECK_PROG([LBT], [lbt], [lbt])
AC_CHECK_PROG([LTL2BA], [ltl2ba], [ltl2ba])
140
AC_CHECK_PROG([LTL3BA], [ltl3ba], [ltl3ba])
141
142
AC_CHECK_PROG([MODELLA], [modella], [modella])
AC_CHECK_PROG([LTL2NBA], [script4lbtt.py], [script4lbtt.py])
143
AC_CHECK_PROG([PERL], [perl], [perl])
144
AC_CHECK_PROG([SPIN], [spin], [spin])
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
145
AC_CHECK_PROG([LBTT], [lbtt], [lbtt])
146
AC_CHECK_PROG([EMACS], [emacs], [emacs])
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
147
AC_CHECK_PROG([LBTT_TRANSLATE], [lbtt-translate], [lbtt-translate])
148
AX_CHECK_VALGRIND
149
AC_CHECK_PROG([WRING2LBTT], [wring2lbtt], [wring2lbtt])
150
151
152
# Debian has a binary for SWIG 2.0 named swig2.0 and they kept swig as
# an alias for swig-1.3.  Let's use the former when available.
AC_CHECK_PROGS([SWIG], [swig2.0 swig], [swig])
153

154
155
AC_SUBST([CROSS_COMPILING], [$cross_compiling])

156
157
AC_CONFIG_FILES([
  Makefile
158
  bench/Makefile
159
  bench/dtgbasat/Makefile
160
161
  bench/emptchk/Makefile
  bench/emptchk/defs
162
  bench/ltlcounter/Makefile
163
  bench/ltlclasses/Makefile
164
165
  bench/ltl2tgba/Makefile
  bench/ltl2tgba/defs
Flix Abecassis's avatar
Flix Abecassis committed
166
167
  bench/scc-stats/Makefile
  bench/split-product/Makefile
168
  bench/spin13/Makefile
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
169
  bench/wdba/Makefile
170
  doc/Doxyfile
171
  doc/Makefile
172
  doc/tl/Makefile
173
  doc/org/init.el
174
  iface/dve2/defs
175
  iface/dve2/Makefile
176
  iface/gspn/defs
177
178
  iface/gspn/Makefile
  iface/Makefile
179
  lib/Makefile
180
  src/bin/Makefile
181
  src/bin/man/Makefile
182
  src/dstarparse/Makefile
183
184
  src/eltlparse/Makefile
  src/eltltest/defs
185
186
  src/eltltest/Makefile
  src/kripke/Makefile
187
  src/ltlast/Makefile
188
  src/ltlenv/Makefile
189
  src/ltlparse/Makefile
190
191
192
  src/kripkeparse/Makefile
  src/kripketest/Makefile
  src/kripketest/defs
193
  src/ltltest/defs
194
  src/ltltest/Makefile
195
  src/ltlvisit/Makefile
196
  src/Makefile
197
  src/misc/Makefile
198
  src/neverparse/Makefile
199
  src/priv/Makefile
200
  src/sanity/Makefile
201
202
203
204
  src/saba/Makefile
  src/sabaalgos/Makefile
  src/sabatest/defs
  src/sabatest/Makefile
205
  src/tgbaalgos/gtec/Makefile
206
207
  src/tgbaalgos/Makefile
  src/tgba/Makefile
208
209
  src/taalgos/Makefile
  src/ta/Makefile
210
  src/tgbaparse/Makefile
211
  src/tgbatest/defs
212
  src/tgbatest/Makefile
213
  wrap/Makefile
214
  wrap/python/Makefile
215
  wrap/python/ajax/Makefile
216
  wrap/python/tests/Makefile
217
  tools/x-to-1
218
])
219
AC_CONFIG_FILES([doc/dot], [chmod +x doc/dot])
220
AC_CONFIG_FILES([wrap/python/tests/run], [chmod +x wrap/python/tests/run])
221
AC_OUTPUT
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
222
223
224
225
226
227
228
229
230
231
232

case $VERSION:$enable_devel in
  *[[abcdefghijklmnopqrstuvwxyz]]:yes)
    echo
    echo '==================================================================='
    echo ' This is a development version of Spot: Assertions and debuging    '
    echo ' code are enabled by default.  If you find this too slow or        '
    echo ' plan to do some benchmarking, run configure with --disable-devel. '
    echo '==================================================================='
  ;;
esac