source: git/factory/configure.ac @ 284578

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