source: git/factory/configure.ac @ 4d8cea

spielwiese
Last change on this file since 4d8cea was 4d8cea, checked in by Hans Schoenemann <hannes@…>, 5 years ago
fix: add -pthread test to all NTL tests
  • Property mode set to 100644
File size: 11.2 KB
Line 
1
2dnl # emacs edit mode for this file is -*- sh -*-
3
4dnl #
5dnl # configure.in - process this file with `autoconf' to generate
6dnl #   a `configure' script.
7dnl #
8dnl # See the `INSTALL' file for information on how the `configure'
9dnl # script works.
10dnl #
11
12#
13# - initialisation.
14#
15AC_INIT([factory], [4.1.1])
16AC_CONFIG_SRCDIR(canonicalform.cc)
17AC_CONFIG_MACRO_DIR([../m4])
18AC_CONFIG_AUX_DIR([../build-aux])
19AC_CONFIG_HEADER([_config.h])
20
21AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
22m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
23m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
24
25AM_MAINTAINER_MODE([enable])
26
27# Add pre'prefixed config
28AX_PREFIX_CONFIG_H([config.h],[],[_config.h])
29
30#
31# - check for CC and CXX but be careful about CFLAGS.
32#
33SING_RESET_FLAGS()
34SING_CHECK_SET_ARGS()
35
36#AC_PROG_CC
37#AC_PROG_CXX
38#
39# - check for some other programs.
40#
41AC_PROG_CPP
42AC_PROG_CXXCPP
43AC_PROG_LN_S
44AC_PROG_INSTALL
45## AC_DISABLE_STATIC
46AC_PROG_YACC
47LT_INIT([win32-dll])
48AC_PROG_MAKE_SET
49AC_CHECK_PROG(AR, ar, ar, where-is-your-ar)
50AC_CHECK_PROG(M4, m4, m4, where-is-your-m4)
51AC_CHECK_PROG(BISON, bison, bison, where-is-your-bison)
52AC_CHECK_SIZEOF(long,4)
53AC_C_CONST
54AC_C_INLINE
55
56
57SING_WIN_FLAGS
58
59
60#
61# - check withs and enables.
62#
63AC_ARG_ENABLE(
64  cf-inline,
65  [AS_HELP_STRING([--disable-cf-inline],[build Factory with \"configurable inline methods\" disabled.])],
66  [enable_cf_inline=$enableval],
67  [enable_cf_inline=yes])
68
69AC_ARG_ENABLE(
70  assertions,
71  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
72  ,
73  enable_assertions=yes)
74
75AC_ARG_ENABLE(
76  timing,
77  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
78  ,
79  enable_timing=no)
80
81AC_ARG_ENABLE(
82  debugoutput,
83  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
84  ,
85  enable_debugoutput=no)
86
87AC_ARG_ENABLE(
88  streamio,
89  [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
90  ,
91  [enable_streamio=no])
92
93AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
94
95AC_ARG_WITH(
96  Singular,
97  [AS_HELP_STRING([--without-Singular],[(obsolete) build NOT for the use with CAS Singular.])],
98  ,
99  [with_Singular=yes])
100
101PKG_REQUIRE="$PKG_REQUIRE"
102AC_SUBST(PKG_REQUIRE)
103
104SING_CHECK_OMALLOC()
105
106AH_TEMPLATE([SINGULAR], [define if linked to Singular])
107AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
108
109# Singular
110if test "x$with_Singular" = xyes; then
111  AC_DEFINE([SINGULAR],[1])
112  AC_DEFINE([DISABLE_GMP_CPP],[1])
113#  AC_DEFINE([NOSTREAMIO],[1])
114fi
115
116# || test "x$with_Singular" = xyes
117# Use no streamio (C++) if SINGULAR or explicitely disabled
118if test "x$enable_streamio" = xno;  then
119  AC_DEFINE([NOSTREAMIO],[1])
120fi
121
122AM_CONDITIONAL(
123    [WITH_PARSER_FOR_CANONICAL_FORM],
124    [test "x$enable_streamio" = xyes])
125
126AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libsingular_resources] )
127AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libsingular_resources] )
128
129AC_MSG_CHECKING(whether libsingular_resources should be used)
130if test "x$with_Singular" = xyes;
131then
132  AC_MSG_RESULT(yes)
133
134  AC_MSG_CHECKING([  RESOURCES_INCLUDES?..])
135  AC_MSG_RESULT(${RESOURCES_INCLUDES:-unset})
136
137  AC_MSG_CHECKING([  RESOURCES_LIBS?..])
138  AC_MSG_RESULT(${RESOURCES_LIBS:-unset})
139
140  PKG_REQUIRE="$PKG_REQUIRE singular_resources"
141  AC_SUBST(PKG_REQUIRE)
142else
143  AC_MSG_RESULT(no)
144fi
145
146AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$with_Singular" = xyes])
147
148
149DX_INIT_DOXYGEN($PACKAGE_NAME, doxygen.cfg, $srcdir/docu)
150
151# do not use `MKINSTALLDIRS' and `MAKEHEADER' since there may be
152# name clashes with other peoples configure scripts via
153# `config.cache'.  Furthermore, we do not use cache at all to
154# avoid some nasty problems with our own development environment.
155#unset ac_cv_path_FACTORY_MKINSTALLDIRS
156#unset ac_cv_path_FACTORY_MAKEHEADER
157#save_path="$PATH"
158#PATH="$PATH:$srcdir/bin"
159#AC_PATH_PROG(FACTORY_MKINSTALLDIRS, mkinstalldirs, -mkdir)
160#PATH="$srcdir/bin:$save_path"
161#AC_PATH_PROG(FACTORY_MAKEHEADER, makeheader)
162#PATH="$save_path"
163
164#
165# - expand paths.
166#
167
168#AC_MSG_CHECKING(and generating explicit install paths)
169
170## generate Makefile
171#save_prefix="$prefix"
172#save_exec_prefix="$exec_prefix"
173#test "x$prefix" = xNONE && prefix=$ac_default_prefix
174#test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
175#for dir in prefix exec_prefix bindir sbindir libexecdir \
176#          datadir sysconfdir sharedstatedir localstatedir libdir \
177#          includedir oldincludedir infodir mandir; do
178#  eval "dir_value=\$$dir"
179#  cat >> ./conftest.mk << EXPLPATHEOT
180#$dir=$dir_value
181#explicit_$dir:
182#       @ echo \$($dir)
183#       @ if echo \$($dir) | grep '^/'; \\
184#       then echo \$($dir) > ./conftest.dir; \\
185#       else echo \`pwd\`/\$($dir) > ./conftest.dir; fi
186#EXPLPATHEOT
187#done
188#prefix="$save_prefix"
189#exec_prefix="$save_exec_prefix"
190
191# generate the explicit paths
192#make >&5 2>&1 -f ./conftest.mk explicit_datadir
193#explicit_datadir=`cat ./conftest.dir`
194#make >&5 2>&1 -f ./conftest.mk explicit_libdir
195#explicit_libdir=`cat ./conftest.dir`
196#make >&5 2>&1 -f ./conftest.mk explicit_includedir
197#explicit_includedir=`cat ./conftest.dir`
198
199# clean up
200#rm -f ./conftest.mk ./conftest.dir
201
202#AC_MSG_RESULT(done)
203
204#
205# - check for libraries.
206#
207AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
208
209LB_CHECK_GMP(3.1.1,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
210
211#NTL 9.6.4 requires -lpthread/-pthread
212# This test for -lpthread etc has to come before AX_PTHREAD,
213# because libtool tends to ignore -pthread in linking shared C++-libs
214# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
215# (happens with ubuntu 14.04)
216AC_SEARCH_LIBS(sem_wait,[rt pthreads pthread],[],[
217  AC_MSG_ERROR([sem_wait not found in rt,pthreads,pthread])
218])
219
220LB_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)]))
221
222LB_CHECK_FLINT(2.4,,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)]))
223
224# arithmetic shift
225#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
226#AC_CACHE_VAL(ac_cv_shift,
227#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
228#       AC_TRY_RUN(
229#      [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
230#      ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
231#if test "x$ac_cv_shift" = xyes; then
232#  AC_MSG_RESULT(yes)
233#else
234#  AC_MSG_RESULT(no)
235#fi
236
237#
238# - check for header files.
239#
240AC_LANG_CPLUSPLUS
241AC_LANG_PUSH([C++])
242
243AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
244  [ AC_MSG_ERROR(C header files not found) ])
245AC_CHECK_HEADERS(cstdio)
246
247if test "x$enable_streamio" != xno;  then
248  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
249  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
250
251  # since the FTE will compile only with stream IO enabled we will not
252  # check for the necessary header files if stream IO is disabled
253  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
254    [ AC_MSG_WARN(C/C++ header files not found.
255                    You will not be able to build the Factory Test Environment
256                    (though Factory itself should compile)) ])
257fi
258
259
260if test "x$enable_timing" != xno; then
261  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
262    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
263                  \`configure --disable-timing') ])
264fi
265
266# font-lock-trick: '
267
268#
269# - check for compiler characteristics.
270#
271
272# use C to check compiler characteristics instead of C++.  On
273# nextstep, checking with C++ may fail.
274# AC_LANG_C
275
276# cross-compiling ?!
277#AC_C_CROSS
278#if test "x$cross_compiling" = xyes; then
279#  AC_MSG_WARN([you better specify a cache file to get the values for
280#                    cross-compiling right (e.g., call \`configure
281#                    --cache-file=yourTarget.cache').  In particular, you
282#                    should make sure that your target machine supports
283#                    arithmetic shift.])
284#fi
285
286# font-lock-trick: '
287
288#
289# - paths.
290#
291
292# note that Singular has its own mechanism to search the tables,
293# hence we do not need to mind it here
294#gftabledir='${datadir}/factory/gftables'
295#explicit_gftabledir="$explicit_datadir/gftables"
296
297# for installation of the templates
298#templatedir='${includedir}/templates'
299
300#
301# - set defines and variables according to our tests.
302#
303
304## CFLAGS
305#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
306#  CFLAGS=""
307#fi
308
309# CXXFLAGS
310#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
311#  CXXFLAGS=""
312#
313#AC_LANG_SAVE
314#AC_LANG_CPLUSPLUS
315# check whether CXX accepts -fno-rtti
316#AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
317#tmp_flags=${CXXFLAGS}
318#CXXFLAGS="${CXXFLAGS}"
319#AC_CACHE_VAL(ac_cv_cxx_have_rtti,
320#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
321#)
322#AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
323#CXXFLAGS=$tmp_flags
324#if test "${ac_cv_cxx_have_rtti}" = yes; then
325#CXXFLAGS="$CXXFLAGS"
326#fi
327#AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
328#tmp_flags=${CXXFLAGS}
329#CXXFLAGS="${CXXFLAGS} -fno-exceptions"
330#AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
331#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
332#)
333#AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
334#CXXFLAGS=$tmp_flags
335#if test "${ac_cv_cxx_have_exceptions}" = yes; then
336#CXXFLAGS="$CXXFLAGS -fno-exceptions"
337#fi
338#AC_LANG_RESTORE
339#
340#fi
341
342# ARFLAGS
343#test "${ARFLAGS+set}" = set || ARFLAGS=cr
344
345# M4FLAGS
346#test "${M4FLAGS+set}" = set || M4FLAGS=
347
348# arithmetic shift
349#if test "x$ac_cv_shift" = xyes; then
350#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
351#fi
352
353AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
354# "configurable inline methods"
355if test "x$enable_cf_inline" != xno; then
356  AC_DEFINE([CF_USE_INLINE],[1])
357fi
358
359AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
360# assertions
361if test "x$enable_assertions" = xno; then
362  AC_DEFINE([NOASSERT],[1])
363fi
364
365AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
366# timing
367if test "x$enable_timing" != xno; then
368  AC_DEFINE([TIMING],[1])
369fi
370
371# debugoutput
372AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
373if test "x$enable_debugoutput" != xno; then
374  AC_DEFINE([DEBUGOUTPUT],[1])
375fi
376
377#
378# - complete and substitute variables, defines.
379#
380#AC_SUBST(gftabledir)
381#AC_SUBST(templatedir)
382
383
384
385# AC_SUBST(libfactory)
386
387#AC_SUBST(ARFLAGS)
388#AC_SUBST(M4FLAGS)
389
390AC_SUBST(MAKEHEADERFLAGS)
391
392#AC_SUBST(factorysrc)
393#AC_SUBST(factoryincl)
394
395#AC_SUBST(alltargets)
396#AC_SUBST(installtargets)
397#AC_SUBST(uninstalltargets)
398
399factory_version="4.1.0"
400factory_configuration="'$ac_configure_args' in `pwd`"
401AC_SUBST(factory_version)
402
403AH_TEMPLATE([FACTORYVERSION], [factory version])
404AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
405
406AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
407AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
408
409#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
410#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
411
412
413
414AC_CONFIG_FILES([Makefile include/factory/Makefile factory.pc]) #  ftest/GNUmakefile
415AC_OUTPUT
416
Note: See TracBrowser for help on using the repository browser.