configure.ac 8.12 KB
Newer Older
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
1
# -*- coding: utf-8 -*-
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
2
# Copyright (C) 2008-2020, Laboratoire de Recherche et Développement
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
3 4 5 6
# de l'Epita (LRDE).
# Copyright (C) 2003-2007 Laboratoire d'Informatique de Paris 6
# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
# 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.63])
24
AC_INIT([spot], [2.9.0.dev], [spot@lrde.epita.fr])
25
AC_CONFIG_AUX_DIR([tools])
26
AC_CONFIG_MACRO_DIR([m4])
27 28
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.
29
AX_PREFIX_CONFIG_H([spot/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
AC_PROG_CC
39 40
gl_EARLY

41
AM_PROG_CC_C_O
42 43 44
AC_PROG_CXX

AM_PROG_LEX
45
adl_CHECK_BISON
46

47 48 49
# Decrease verbosity when passing argument V=0
AM_SILENT_RULES([no])

50 51 52 53
# Option to activate C++17
AC_ARG_ENABLE([c++17],
              [AC_HELP_STRING([--enable-c++17],
                              [Compile in C++17 mode.])],
54
              [enable_17=$enableval], [enable_17=no])
55

56 57
AC_ARG_ENABLE([doxygen],
              [AC_HELP_STRING([--enable-doxygen]),
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
58
  [enable generation of Doxygen documentation (requires Doxygen)])],
59
  [enable_doxygen=$enableval], [enable_doxygen=no])
60 61
AM_CONDITIONAL([ENABLE_DOXYGEN], [test "x${enable_doxygen:-no}" = xyes])

62
# Option to indicate the maximal number of acceptance marks
63 64 65 66 67 68 69
AC_COMPUTE_INT([default_max_accsets], [8*sizeof(unsigned)])
AC_ARG_ENABLE([max-accsets],
              [AC_HELP_STRING([--enable-max-accsets=N],
                              [Support up to N acceptance sets])],
              [enable_max_accsets=$enableval],
              [enable_max_accsets=$default_max_accsets])
if test 0 -eq `expr $enable_max_accsets % $default_max_accsets`
70
then
71 72
  AC_DEFINE_UNQUOTED([MAX_ACCSETS], [$enable_max_accsets],
    [The maximal number of acceptance sets supported (also known as acceptance marks)])
73
else
74
  AC_ERROR([The argument of --enable-max-accsets must be a multiple of $default_nb_acc])
75 76
fi

77 78
# Activate C11 for gnulib tests
AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS="$CFLAGS -std=c11"])
79

80
gl_INIT
81

82 83 84
dnl Check if -latomic is required for <std::atomic>
CHECK_ATOMIC

85 86 87
# 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],
88 89 90 91
  [CFLAGS="$CFLAGS -fvisibility=hidden"])
AC_LANG(C++)
AX_CHECK_COMPILE_FLAG([-Werror -fvisibility=hidden],
  [CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
92
  AX_CHECK_COMPILE_FLAG([-fvisibility-inlines-hidden],
93 94
    [CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"])])
CXXFLAGS="$CXXFLAGS -DSPOT_BUILD"
95

96 97 98 99
# Turn on C++14 support
m4_define([_AX_CXX_COMPILE_STDCXX_14_testbody],
[AC_LANG_SOURCE([#include <memory>
#include <string>
100
#include <chrono>  // used to fail in C++11 with some installation of clang
101 102 103
#include <map>

    template <typename T>
104 105 106 107 108 109 110
    struct check
    {
      static_assert(sizeof(int) <= sizeof(T), "not big enough");
    };

    typedef check<check<bool>> right_angle_brackets;

111
    auto f = std::make_unique<std::string>("uniq_ptr");
112

113 114 115 116 117 118 119 120
    int a;
    decltype(a) b;

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

    auto d = a;
121 122
])])

123 124
if test x"${enable_17}" = xyes; then
  for f in -std=c++17 '-std=c++17 -stdlib=libc++' -std=c++1z
125 126 127 128 129 130
  do
    AX_CHECK_COMPILE_FLAG([$f], [CXXFLAGS="$CXXFLAGS $f" stdpass=true], [], [],
                          [_AX_CXX_COMPILE_STDCXX_14_testbody])
    ${stdpass-false} && break
  done
  if ! "${stdpass-false}"; then
131
    AC_ERROR([unable to turn on C++17 mode with this compiler])
132 133
  fi
else
134
  for f in -std=c++14 '-std=c++14 -stdlib=libc++' -std=c++1y
135 136
  do
    AX_CHECK_COMPILE_FLAG([$f], [CXXFLAGS="$CXXFLAGS $f" stdpass=true], [], [],
137
                          [_AX_CXX_COMPILE_STDCXX_14_testbody])
138 139 140
    ${stdpass-false} && break
  done
  if ! "${stdpass-false}"; then
141
    AC_ERROR([unable to turn on C++14 mode with this compiler])
142
  fi
143
fi
144

145 146
AX_CHECK_BUDDY

147
AC_CHECK_HEADERS([sys/times.h valgrind/memcheck.h spawn.h])
148
AX_CHECK_DIVINE
149
AC_CHECK_FUNCS([times kill alarm sigaction])
150

151
LT_CONFIG_LTDL_DIR([ltdl])
152
LT_INIT([win32-dll])
153
LTDL_INIT([subproject convenience])
154

155
AX_BSYMBOLIC
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171

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

case $enable_shared:$enable_python in
 no:no);;
 no:*)
    enable_python=no
    AC_MSG_NOTICE([Not building Python bindings because of --disable-shared.])
    ;;
esac

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

172 173
AM_CONDITIONAL([USE_LTSMIN], [test "x${enable_shared:-yes}" = xyes])

174 175 176 177 178 179 180
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


181 182 183
adl_ENABLE_DEBUG
ad_GCC_OPTIM
adl_NDEBUG
184
adl_ENABLE_GLIBCXX_DEBUG
185

186
spot_INTEL
187 188 189
if test x$enable_warnings = xyes; then
  CF_GXX_WARNINGS
fi
190

191
AM_CONDITIONAL([NEVER], [false])
192
AC_CHECK_PROG([DOT], [dot], [dot])
193
AC_CHECK_PROG([LTL2BA], [ltl2ba], [ltl2ba])
194
AC_CHECK_PROG([LTL3BA], [ltl3ba], [ltl3ba])
195
AC_CHECK_PROG([PERL], [perl], [perl])
196
AC_CHECK_PROG([SPIN], [spin], [spin])
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
197
AC_CHECK_PROG([LBTT], [lbtt], [lbtt])
198
AC_CHECK_PROG([EMACS], [emacs], [emacs])
199
AC_CHECK_PROGS([IPYTHON], [ipython3 ipython], [ipython])
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
200
AC_CHECK_PROG([LBTT_TRANSLATE], [lbtt-translate], [lbtt-translate])
201
AX_CHECK_VALGRIND
202 203 204
# Debian has a binary for SWIG 3.0 named swig3.0 and they kept swig as
# an alias for swig-2.0.  Let's use the former when available.
AC_CHECK_PROGS([SWIG], [swig3.0 swig], [swig])
205

206 207
AC_SUBST([CROSS_COMPILING], [$cross_compiling])

208
AC_SUBST([GITPATCH], [$(if (git rev-parse) >/dev/null 2>&1; then
209 210
 echo ".$(git rev-list $(git rev-list --tags='spot-*' --no-walk \
 --max-count=1)..HEAD --count)"
211 212
fi)])

213 214
AC_CONFIG_FILES([
  Makefile
215 216
  bin/Makefile
  bin/man/Makefile
217
  bench/Makefile
218
  bench/dtgbasat/Makefile
219 220
  bench/emptchk/Makefile
  bench/emptchk/defs
221
  bench/ltlcounter/Makefile
222
  bench/ltlclasses/Makefile
223 224
  bench/ltl2tgba/Makefile
  bench/ltl2tgba/defs
225
  bench/spin13/Makefile
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
226
  bench/wdba/Makefile
227
  bench/stutter/Makefile
228
  doc/Doxyfile
229
  doc/Makefile
230
  doc/tl/Makefile
231
  doc/org/.dir-locals.el
232
  doc/org/init.el
233
  elisp/Makefile
234
  lib/Makefile
235
  picosat/Makefile
236 237
  spot/graph/Makefile
  spot/kripke/Makefile
238
  spot/ltsmin/Makefile
239 240
  spot/Makefile
  spot/misc/Makefile
241
  spot/mc/Makefile
242 243 244 245 246 247 248 249
  spot/parseaut/Makefile
  spot/parsetl/Makefile
  spot/priv/Makefile
  spot/taalgos/Makefile
  spot/ta/Makefile
  spot/tl/Makefile
  spot/twaalgos/gtec/Makefile
  spot/twaalgos/Makefile
250
  spot/twacube_algos/Makefile
251
  spot/twa/Makefile
252
  spot/gen/Makefile
253
  spot/twacube/Makefile
254
  python/Makefile
255
  tests/core/defs
256
  tests/ltsmin/defs:tests/core/defs.in
257
  tests/Makefile
258
  tools/x-to-1
259
])
260
AC_CONFIG_FILES([doc/org/g++wrap], [chmod +x doc/org/g++wrap])
261
AC_CONFIG_FILES([tests/run], [chmod +x tests/run])
262
AC_OUTPUT
Alexandre Duret-Lutz's avatar
Alexandre Duret-Lutz committed
263 264 265 266 267 268 269 270 271 272 273

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