source: git/configure.ac

spielwiese
Last change on this file was 7afda2, checked in by Max Horn <max@…>, 3 months ago
Update configure.ac files, avoid obsolete syntax
  • Property mode set to 100644
File size: 11.6 KB
Line 
1AC_INIT([singular], [4.3.1], [singular@mathematik.uni-kl.de])
2
3AC_SUBST([VERSION_DATE], 2022)
4AC_DEFINE([VERSION_DATE],["Jun 2022"],[release date])
5
6_AC_SRCDIRS(["$ac_dir"])
7
8AC_CONFIG_MACRO_DIR([m4])
9AC_CONFIG_AUX_DIR([build-aux])
10
11AC_CONFIG_SRCDIR([Singular/tesths.cc])
12
13AC_CONFIG_HEADERS([_config.h])
14# Add pre'prefixed config
15AX_PREFIX_CONFIG_H([singularconfig.h],[],[_config.h])
16
17dnl Apparently, this is required for using an AC_CHECK_HEADER within AS_IF(...), at least on Cygwin.
18AC_USE_SYSTEM_EXTENSIONS
19
20AM_MAINTAINER_MODE([enable])
21dnl Use a newer tar format for "make dist" that supports longer file names
22dnl https://www.gnu.org/software/automake/manual/html_node/List-of-Automake-options.html
23AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-ustar]) # -Wno-extra-portability -Werror silent-rules
24
25m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
26
27dnl Check if build env is sane
28AM_SANITY_CHECK
29
30
31SING_RESET_FLAGS()
32SING_CHECK_SET_ARGS()
33
34#!
35# AC_PROG_CC
36# AC_PROG_CXX
37AC_PROG_CPP
38AC_PROG_CXXCPP
39AM_PROG_CC_C_O
40AM_PROG_AR
41### AM_PROG_LEX
42AC_PROG_LN_S
43AC_PROG_INSTALL
44
45AC_CHECK_HEADERS(unistd.h iostream.h fstream.h iomanip.h limits.h sys/time.h sys/times.h asm/sigcontext.h spasm.h)
46
47AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv qsort_r)
48
49AC_CHECK_PROGS([DOXYGEN], [doxygen])
50if test -z "$DOXYGEN";
51   then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
52fi
53AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
54
55LT_INIT([win32-dll])
56
57link_all_deplibs=yes
58link_all_deplibs_CXX=yes
59
60# Checks for libraries.
61
62# This test for -lpthread etc has to come before AX_PTHREAD,
63# because libtool tends to ignore -pthread in linking shared C++-libs
64# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
65# (happens with ubuntu 14.04)
66AC_SEARCH_LIBS(sem_wait,[rt pthreads pthread],[],[
67  AC_MSG_ERROR([sem_wait not found in rt,pthreads,pthread])
68])
69
70AX_PTHREAD([], [
71  AC_MSG_ERROR([Pthread library not found. Please set PTHREAD_CFLAGS and PTHREAD_LIBS correctly for your setup])
72])
73
74AC_MSG_CHECKING([Found Pthread, PTHREAD_CC:])
75AC_MSG_RESULT(${PTHREAD_CC:-unset})
76AC_MSG_CHECKING([               PTHREAD_CFLAGS:])
77AC_MSG_RESULT(${PTHREAD_CFLAGS:-unset})
78AC_MSG_CHECKING([               PTHREAD_LIBS:])
79AC_MSG_RESULT(${PTHREAD_LIBS:-unset})
80
81# Set the correct PTHREAD flags and, if needed, change the compiler to one that is pthread-enabled.
82CC="$PTHREAD_CC"
83CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
84LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS"
85
86AC_SUBST(PTHREAD_CFLAGS)
87AC_SUBST(PTHREAD_LDFLAGS)
88AC_SUBST(PTHREAD_LIBS)
89AC_SUBST(CC)
90
91
92AC_CHECK_LIB(rt,clock_gettime)
93
94
95AC_CHECK_LIB(spasm,spasm_csr_free,SPASM_LIB="-lspasm",SPASM_LIB="")
96AC_SUBST(SPASM_LIB)
97
98SING_CHECK_GMP
99LB_CHECK_NTL(5.0,,AC_MSG_WARN([Unable to find NTL (which is strongly recommended) on your machine: please use --with-ntl=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
100LB_CHECK_FLINT(2.3,,AC_MSG_WARN([Unable to find FLINT (which is strongly recommended) on your machine: please use --with-flint=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
101
102AC_CHECK_HEADERS(mpfr.h)
103
104AC_CONFIG_GOOGLE_PERFTOOLS()
105
106LB_CHECK_CCLUSTER()
107
108LB_CHECK_MATHICGB
109
110AC_FUNC_ERROR_AT_LINE
111
112# check for cpu properties
113AC_CHECK_SIZEOF(long,4)
114SING_CHECK_CPU
115
116SING_WIN_FLAGS
117
118PKG_REQUIRE="$PKG_REQUIRE"
119AC_SUBST(PKG_REQUIRE)
120
121SING_USE_OMALLOC()
122SING_USE_RESOURCES()
123SING_USE_FACTORY()
124
125SING_CHECK_P_PROCS
126SING_CHECK_READLINE
127
128SING_CHECK_DBM
129
130SING_CHECK_GFANLIB
131
132SING_CHECK_PLURAL
133
134SING_ENABLE_MODULES
135SING_DISABLE_MODULES
136SING_BUILTIN_MODULES
137
138AX_PYTHON_DEFAULT()
139  AX_PYTHON_WITH()
140  AX_PYTHON_ENABLE()
141  AX_PYTHON_PATH()
142  AX_PYTHON_VERSION_ENSURE([2.7])
143  AX_PYTHON_CSPEC
144  AX_PYTHON_LSPEC
145
146AC_ARG_ENABLE(countedref, AS_HELP_STRING([--enable-countedref], [Enable autoloading of reference counted types]),
147[if test "x$enableval" = "xyes"; then
148ENABLE_COUNTEDREF_AUTOLOAD=yes
149fi], ENABLE_COUNTEDREF_AUTOLOAD=no)
150
151if test x"${ENABLE_COUNTEDREF_AUTOLOAD}" = xyes; then
152  AC_DEFINE([SI_COUNTEDREF_AUTOLOAD],1,[Enable autoloading of reference counted types])
153  AC_SUBST(SI_COUNTEDREF_AUTOLOAD)
154fi
155
156dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however
157dnl AM_COND_IF is new to Automake 1.11.  To use it on new Automake without
158dnl requiring same, a fallback implementation for older Autoconf is provided.
159dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code
160dnl is correct only in terms of m4sh generated script.
161m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
162if test -z "$$1_TRUE"; then :
163  m4_n([$2])[]dnl
164m4_ifval([$3],
165[else
166    $3
167])dnl
168fi[]dnl
169])])
170
171AX_LIB_SOCKET_NSL
172
173dnl EXEEXT is needed for correct operation on Cygwin
174dnl https://www.gnu.org/software/automake/manual/html_node/Conditional-Programs.html
175AC_ARG_WITH([libparse],
176            [AS_HELP_STRING([--with-libparse],
177              [compile and install libparse])],
178            [optional_Singular_programs='libparse${EXEEXT}'],
179            [optional_Singular_programs=])
180
181AC_SUBST(optional_Singular_programs)
182
183AC_DEFINE_UNQUOTED([CC],"$CC",[CC])
184AC_DEFINE_UNQUOTED([CXX],"$CXX",[CXX])
185AC_DEFINE_UNQUOTED([CFLAGS],"$CFLAGS",[CFLAGS])
186AC_DEFINE_UNQUOTED([CXXFLAGS],"$CXXFLAGS -fno-delete-null-pointer-checks",[CXXFLAGS])
187AC_DEFINE_UNQUOTED([PTHREAD_CFLAGS],"$PTHREAD_CFLAGS",[PTHREAD_CFLAGS])
188AC_DEFINE_UNQUOTED([PTHREAD_LIBS],"$PTHREAD_LIBS",[PTHREAD_LIBS])
189AC_DEFINE_UNQUOTED([DEFS],"$DEFS",[DEFS])
190AC_DEFINE_UNQUOTED([CPPFLAGS],"$CPPFLAGS",[CPPFLAGS])
191AC_DEFINE_UNQUOTED([LDFLAGS],"$LDFLAGS",[LDFLAGS])
192AC_DEFINE_UNQUOTED([LIBS],"$LIBS",[LIBS])
193AC_DEFINE_UNQUOTED([AC_CONFIGURE_ARGS],"$ac_configure_args",[ac_configure_args])
194# AC_DEFINE_UNQUOTED([AC_CT_CC], "$ac_ct_CC",[ac_ct_CC])
195
196AC_DEFINE_UNQUOTED([NTL_CPPFLAGS],"$NTL_CPPFLAGS",[NTL_CPPFLAGS])
197AC_DEFINE_UNQUOTED([NTL_LIBS],"$NTL_LIBS",[NTL_LIBS])
198
199AC_DEFINE_UNQUOTED([GMP_CPPFLAGS],"$GMP_CPPFLAGS",[GMP_CPPFLAGS])
200AC_DEFINE_UNQUOTED([GMP_LIBS],"$GMP_LIBS",[GMP_LIBS])
201
202AC_DEFINE_UNQUOTED([FLINT_CFLAGS],"$FLINT_CFLAGS",[FLINT_CFLAGS])
203AC_DEFINE_UNQUOTED([FLINT_LIBS],"$FLINT_LIBS",[FLINT_LIBS])
204
205##### SEE http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
206
207AX_RECURSIVE_EVAL([[$]prefix], [config_prefix])
208AX_NORMALIZE_PATH([config_prefix],['/'])
209AC_DEFINE_UNQUOTED([PREFIX],"$config_prefix",[prefix])
210
211AX_RECURSIVE_EVAL([[$]exec_prefix], [config_exec_prefix])
212AX_NORMALIZE_PATH([config_exec_prefix],['/'])
213AC_DEFINE_UNQUOTED([EXEC_PREFIX],"$config_exec_prefix",[exec_prefix])
214
215AX_RECURSIVE_EVAL([[$]libexecdir], [config_libexecdir])
216AX_NORMALIZE_PATH([config_libexecdir],['/'])
217AC_DEFINE_UNQUOTED([LIBEXEC_DIR],"$config_libexecdir",[libexecdir])
218
219AX_RECURSIVE_EVAL([[$]libdir], [config_libdir])
220AX_NORMALIZE_PATH([config_libdir],['/'])
221AC_DEFINE_UNQUOTED([LIB_DIR],"$config_libdir",[libdir])
222
223AX_RECURSIVE_EVAL([[$]bindir], [config_bindir])
224AX_NORMALIZE_PATH([config_bindir],['/'])
225AC_DEFINE_UNQUOTED([BIN_DIR],"$config_bindir",[bindir])
226
227AX_RECURSIVE_EVAL([[$]datadir], [config_datadir])
228AX_NORMALIZE_PATH([config_datadir],['/'])
229AC_DEFINE_UNQUOTED([DATA_DIR],"$config_datadir",[datadir])
230AC_SUBST(DATA_DIR, "$config_datadir")
231
232SING_SHOW_FLAGS([Compiler/linker flags: ])
233
234
235## AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([dox/Doxyfile])])
236
237AC_CONFIG_FILES([dox/Makefile])
238
239AC_CONFIG_SUBDIRS([resources])
240AC_CONFIG_SUBDIRS([omalloc])
241
242if test "x$ENABLE_FACTORY" = xyes; then
243 AC_CONFIG_SUBDIRS([factory])
244fi
245
246AC_CONFIG_SUBDIRS([libpolys])
247
248AC_CONFIG_FILES([Makefile])
249AC_CONFIG_FILES([kernel/Makefile])
250AC_CONFIG_FILES([kernel/numeric/Makefile])
251AC_CONFIG_FILES([kernel/fglm/Makefile])
252AC_CONFIG_FILES([kernel/groebner_walk/Makefile])
253AC_CONFIG_FILES([kernel/combinatorics/Makefile])
254AC_CONFIG_FILES([kernel/spectrum/Makefile])
255AC_CONFIG_FILES([kernel/linear_algebra/Makefile])
256AC_CONFIG_FILES([kernel/maps/Makefile])
257AC_CONFIG_FILES([kernel/GBEngine/Makefile])
258AC_CONFIG_FILES([kernel/oswrapper/Makefile])
259
260AC_CONFIG_SUBDIRS([gfanlib])
261
262AC_CONFIG_FILES([Singular/dyn_modules/Makefile])
263AC_CONFIG_FILES([Singular/dyn_modules/bigintm/Makefile])
264AC_CONFIG_FILES([Singular/dyn_modules/Order/Makefile])
265AC_CONFIG_FILES([Singular/dyn_modules/syzextra/Makefile])
266AC_CONFIG_FILES([Singular/dyn_modules/gfanlib/Makefile])
267AC_CONFIG_FILES([Singular/dyn_modules/python/Makefile])
268AC_CONFIG_FILES([Singular/dyn_modules/customstd/Makefile])
269AC_CONFIG_FILES([Singular/dyn_modules/pyobject/Makefile])
270AC_CONFIG_FILES([Singular/dyn_modules/singmathic/Makefile])
271AC_CONFIG_FILES([Singular/dyn_modules/staticdemo/Makefile])
272AC_CONFIG_FILES([Singular/dyn_modules/subsets/Makefile])
273AC_CONFIG_FILES([Singular/dyn_modules/freealgebra/Makefile])
274AC_CONFIG_FILES([Singular/dyn_modules/partialgb/Makefile])
275AC_CONFIG_FILES([Singular/dyn_modules/gitfan/Makefile])
276AC_CONFIG_FILES([Singular/dyn_modules/interval/Makefile])
277AC_CONFIG_FILES([Singular/dyn_modules/cohomo/Makefile])
278AC_CONFIG_FILES([Singular/dyn_modules/systhreads/Makefile])
279AC_CONFIG_FILES([Singular/dyn_modules/loctriv/Makefile])
280AC_CONFIG_FILES([Singular/dyn_modules/machinelearning/Makefile])
281AC_CONFIG_FILES([Singular/dyn_modules/sispasm/Makefile])
282
283AC_CONFIG_FILES([Singular/Makefile])
284
285AC_CONFIG_FILES([IntegerProgramming/Makefile])
286
287AC_CONFIG_FILES([libsingular-config], [chmod +x libsingular-config])
288AC_CONFIG_FILES([Singular.pc])
289
290AC_CONFIG_FILES([emacs/Makefile])
291
292AC_CONFIG_FILES([redhat/Makefile])
293AC_CONFIG_FILES([redhat/singular.spec])
294AC_CONFIG_FILES([desktop/Makefile desktop/Singular.desktop desktop/Singular-manual.desktop])
295
296AC_CHECK_PROGS([MAKEINFO], [makeinfo])
297AC_CHECK_PROGS([TEXI2PDF], [texi2pdf])
298AC_CHECK_PROGS([TEXINDEX], [texindex])
299AC_CHECK_PROGS([DVIPS], [dvips])
300
301dnl Check for executables used by library files.
302dnl Found by: git grep 'system("\(sh\|executable\)"'
303AS_VAR_SET([DOC2TEX_EXAMPLE_EXCLUSIONS], [""])
304AC_CHECK_PROGS([QEPCAD], [qepcad])
305AS_IF([test -z "$QEPCAD"], [
306  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude qepcad "])])
307AC_CHECK_PROGS([LRCALC], [lrcalc])
308AS_IF([test -z "$LRCALC"], [
309  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude lrcalc "])])
310AC_CHECK_PROGS([NORMALIZ], [normaliz])
311AS_IF([test -z "$NORMALIZ"], [
312  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude normaliz "])])
313AC_CHECK_PROGS([GFAN], [gfan_version])
314AS_IF([test -z "$GFAN"], [
315  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude gfan "])])
316AC_CHECK_PROGS([TOPCOM], [points2triangs])
317AS_IF([test -z "$TOPCOM"], [
318  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude topcom "])])
319AS_IF([test -z "$PYTHON"], [
320  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude pyobject "])])
321AC_CHECK_PROGS([FOURTITWO_HILBERT], [hilbert 4ti2-hilbert])
322AC_CHECK_PROGS([FOURTITWO_MARKOV], [markov 4ti2-markov])
323AC_CHECK_PROGS([FOURTITWO_GRAVER], [graver 4ti2-graver])
324AS_IF([test -z "$FOURTITWO_HILBERT" -o -z "$FOURTITWO_MARKOV" -o -z "$FOURTITWO_GRAVER"], [
325  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude sing4ti2 "])])
326AC_CHECK_PROGS([BERTINI], [bertini])
327AS_IF([test -z "$BERTINI"], [
328  AS_VAR_APPEND([DOC2TEX_EXAMPLE_EXCLUSIONS], ["-exclude bertini "])])
329AC_CHECK_PROGS([DOT], [dot])
330AC_CHECK_PROGS([SURF], [surf])
331AC_CHECK_PROGS([GFAN_TROPICALBASIS], [gfan_tropicalbasis])  dnl and more gfan_tropical...
332AC_SUBST([DOC2TEX_EXAMPLE_EXCLUSIONS])
333
334AC_CONFIG_FILES([doc/Makefile])
335AC_CONFIG_FILES([doc/Makefile-docbuild])
336AC_CONFIG_FILES([doc/version.texi])
337AC_CONFIG_LINKS([doc/pyobject.doc:doc/pyobject.${enable_pyobject_module}.doc
338                 doc/cones.doc:doc/cones.no.doc])
339AC_ARG_ENABLE([doc-build],
340              [AS_HELP_STRING([--enable-doc-build],
341                              [Enable building the Singular documentation])], [
342  AS_IF([test "$enable_doc_build" = yes], [optional_Singular_programs=libparse])
343])
344AM_CONDITIONAL([ENABLE_DOC_BUILD], [test "$enable_doc_build" = yes])
345
346AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.