-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
199 lines (152 loc) · 5.71 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
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
dnl GNU General Public license v3 or later
dnl Copyright 2019, 2022, 2023 Ales Cepek <[email protected]>
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
dnl GNU Gama version is also defined in CMakeLists.txt and
dnl lib/gnu_gama.version.cpp
AC_INIT([gama],[2.24],[[email protected]])
AC_CONFIG_SRCDIR([lib/gnu_gama/version.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([scripts/config.aux])
AM_INIT_AUTOMAKE(subdir-objects)
AM_SILENT_RULES([yes])
dnl You can comment out the following macro if you have the package
dnl autoconf-archive installed
AC_CONFIG_MACRO_DIR([m4])
dnl Install package autoconf-archive or download from
dnl git://git.sv.gnu.org/autoconf-archive.git
dnl
dnl https://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html
AC_LANG(C++)
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX([14], [noext], [mandatory])
AX_VALGRIND_DFLT([sgcheck], [off])
AX_VALGRIND_CHECK
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl Optional extra tests
AC_ARG_ENABLE([extra-tests],
[AS_HELP_STRING([--enable-extra-tests[[yes|=no]]],
[Turn on/off extra tests] (default is no))],
[AM_CONDITIONAL([GNU_GAMA_LOCAL_EXTRA_TESTS],
[AS_IF([test "x$enable_extra_tests" != "xyes"],
enable_extra_tests=no)]
[test "x$enable_extra_tests" = "xyes"])],
[AM_CONDITIONAL([GNU_GAMA_LOCAL_EXTRA_TESTS], [false])
enable_extra_tests=no]
)
AC_MSG_NOTICE([checking whether extra tests are enabled... $enable_extra_tests])
dnl Optional build of gama-g3
AC_ARG_ENABLE([gama-g3],
[AS_HELP_STRING([--enable-gama-g3[[=yes|no]]],
[Turn on/off build with gama-g3] (default is yes))],
[AM_CONDITIONAL([GNU_GAMA_G3_ENABLED],
[AS_IF([test "x$enable_gama_g3" != "xyes"],
enable_gama_g3=no)]
[test "x$enable_gama_g3" = "xyes"])],
[AM_CONDITIONAL([GNU_GAMA_G3_ENABLED], [true])
enable_gama_g3=yes]
)
AC_MSG_NOTICE([checking whether gama-g3 build is enabled... $enable_gama_g3])
dnl Check for makeinfo
AC_CHECK_PROG([gnu_gama_makeinfo],[makeinfo], [yes], [no])
AM_CONDITIONAL([GNU_GAMA_MAKEINFO], [test "x$gnu_gama_makeinfo" = xyes])
AM_COND_IF([GNU_GAMA_MAKEINFO],,
AC_MSG_WARN([makeinfo is missing on your system])
MAKEINFO=true
)
dnl Optional build with legacy expat 1.1 (local copy)
AC_ARG_ENABLE(
[expat_1_1],
[AS_HELP_STRING([--enable-expat_1_1[[=yes|no]]],
[Enable build with legacy expat parser version 1.1 (default is yes)])]
)
AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_EXPAT_1_1], [false])
AS_IF([test x$enable_expat_1_1 != xyes], enable_expat_1_1=no)
if test x$enable_expat_1_1 = xyes
then
AC_MSG_WARN([build with local copy of expat 1.1 XML parser])
AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_EXPAT_1_1], [true])
AC_SUBST([CPPFLAGS], "${CPPFLAGS} -DGNU_gama_expat_1_1")
else
m4_define([install_expat], [please install libexpat1-dev])
AC_CHECK_LIB([expat], [XML_ParserCreate],,
[AC_MSG_ERROR([XML expat parser is missing,] install_expat)])
AC_CHECK_HEADERS([expat.h],,
[AC_MSG_ERROR([Cannot find expat.h,] install_expat)])
fi
dnl Check for yaml-cpp library
AC_MSG_CHECKING([for yaml-cpp])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <yaml-cpp/yaml.h>],[YAML::Node node;])],
[AC_MSG_RESULT([yes])]
[AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_YAML_CPP],[true])],
[AC_MSG_RESULT([no])]
[AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_YAML_CPP],[false])]
[AC_MSG_WARN([libyaml-cpp-dev is not installed.])]
)
dnl Check for sqlite3 support
AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_SQLITE_READER], [false])
AC_CHECK_LIB([sqlite3], [sqlite3_open])
if test "x$ac_cv_lib_sqlite3_sqlite3_open" = "xyes";
then
AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_SQLITE_READER], [true])
AC_DEFINE([GNU_GAMA_LOCAL_SQLITE_READER],1,
[Conditional support for sqlite3 databases])
AC_SUBST([CPPFLAGS], "${CPPFLAGS} -DGNU_GAMA_LOCAL_SQLITE_READER")
fi
dnl Check for xmllint
AC_CHECK_PROG(GNU_GAMA_LOCAL_TEST_XMLLINT, xmllint, yes, no)
AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_XMLLINT],
[test "x$GNU_GAMA_LOCAL_TEST_XMLLINT" = "xyes"])
if test "x$GNU_GAMA_LOCAL_TEST_XMLLINT" != "xyes";
then
AC_MSG_WARN([xmllint not found, XML files will not be validated])
fi
dnl Check for octave
AC_CHECK_PROG(GNU_GAMA_LOCAL_TEST_OCTAVE, octave, yes, no)
AM_CONDITIONAL([GNU_GAMA_LOCAL_TEST_OCTAVE],
[test "x$GNU_GAMA_LOCAL_TEST_OCTAVE" = "xyes"])
if test "x$GNU_GAMA_LOCAL_TEST_OCTAVE" != "xyes";
then
AC_MSG_WARN([octave not found, .m files will not be validated])
fi
dnl AC_SUBST([CPPFLAGS], "${CPPFLAGS} -DDEBUG_ACORD2")
dnl AC_SUBST([CPPFLAGS], "${CPPFLAGS} -DA2G_DEBUG")
dnl AC_SUBST([CPPFLAGS], "${CPPFLAGS} -DDEBUG_REDUCED_OBS")
## dnl Checks for header files. ## commented out by AC
##
## m4_warn([obsolete],
## [The preprocessor macro `STDC_HEADERS' is obsolete.
## Except in unusual embedded environments, you can safely include all
## ISO C90 headers unconditionally.])dnl
# Autoupdate added the next two lines to ensure that your configure
# script's behavior did not change. They are probably safe to remove.
## AC_CHECK_INCLUDES_DEFAULT
## AC_PROG_EGREP
AC_CONFIG_FILES([
Makefile
lib/Makefile
src/Makefile
scripts/Makefile
doc/Makefile
xml/Makefile
tests/Makefile
tests/matvec/Makefile
tests/statan/Makefile
tests/acord2/Makefile
tests/acord2/input/a2g/Makefile
tests/acord2/input/a2diff/Makefile
tests/gama-local/Makefile
tests/gama-local/input/Makefile
tests/gama-local/src/Makefile
tests/gama-g3/Makefile
tests/gama-g3/input/Makefile
tests/gama-g3/src/Makefile
tests/extra-tests/Makefile
tests/extra-tests/input/Makefile
tests/krumm/Makefile
])
AC_OUTPUT