source: git/factory/configure.ac @ e37c4e

spielwiese
Last change on this file since e37c4e was e37c4e, checked in by Hans Schoenemann <hannes@…>, 3 years ago
configure: --with-gmp
  • Property mode set to 100644
File size: 12.1 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.
211AC_ARG_WITH([gmp],[AS_HELP_STRING([--with-gmp=path],
212                    [provide a non-standard location of gmp])])
213DEFAULT_CHECKING_PATH="/usr /usr/local /sw /opt/local"
214if test "${with_gmp+set}" = set; then :
215  if test "$with_gmp" = yes ; then
216        GMP_HOME_PATH="${DEFAULT_CHECKING_PATH}"
217   elif test "$with_gmp" != no ; then
218        GMP_HOME_PATH="$with_gmp ${DEFAULT_CHECKING_PATH}"
219    fi
220else
221  GMP_HOME_PATH="${DEFAULT_CHECKING_PATH}"
222fi
223
224BACKUP_CFLAGS=${CFLAGS}
225BACKUP_LIBS=${LIBS}
226
227for GMP_HOME in ${GMP_HOME_PATH}
228do
229  if test "x$GMP_HOME" != "x/usr"; then
230    if test -e ${GMP_HOME}/include/gmp.h; then
231      GMP_CPPFLAGS="-I${GMP_HOME}/include"
232      GMP_LIBS="-L${GMP_HOME}/lib -Wl,-rpath -Wl,${GMP_HOME}/lib -lgmp"
233    fi
234  else
235    GMP_CPPFLAGS=""
236    GMP_LIBS="-lgmp"
237  fi
238  CFLAGS="${BACKUP_CFLAGS} ${GMP_CPPFLAGS}"
239  LIBS="${BACKUP_LIBS} ${GMP_LIBS}"
240done
241AC_SUBST(GMP_CPPFLAGS)
242AC_SUBST(GMP_LIBS)
243
244AC_CHECK_HEADERS([gmp.h], ,[AC_MSG_ERROR([GNU MP not found])])
245AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR([GNU MP not found])])
246
247#NTL 9.6.4 requires -lpthread/-pthread
248# This test for -lpthread etc has to come before AX_PTHREAD,
249# because libtool tends to ignore -pthread in linking shared C++-libs
250# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
251# (happens with ubuntu 14.04)
252AC_SEARCH_LIBS(sem_wait,[rt pthreads pthread],[],[
253  AC_MSG_ERROR([sem_wait not found in rt,pthreads,pthread])
254])
255
256LB_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)]))
257
258LB_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)]))
259
260# arithmetic shift
261#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
262#AC_CACHE_VAL(ac_cv_shift,
263#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
264#       AC_TRY_RUN(
265#      [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
266#      ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
267#if test "x$ac_cv_shift" = xyes; then
268#  AC_MSG_RESULT(yes)
269#else
270#  AC_MSG_RESULT(no)
271#fi
272
273#
274# - check for header files.
275#
276AC_LANG_CPLUSPLUS
277AC_LANG_PUSH([C++])
278
279AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
280  [ AC_MSG_ERROR(C header files not found) ])
281AC_CHECK_HEADERS(cstdio)
282
283if test "x$enable_streamio" != xno;  then
284  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
285  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
286
287  # since the FTE will compile only with stream IO enabled we will not
288  # check for the necessary header files if stream IO is disabled
289  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
290    [ AC_MSG_WARN(C/C++ header files not found.
291                    You will not be able to build the Factory Test Environment
292                    (though Factory itself should compile)) ])
293fi
294
295
296if test "x$enable_timing" != xno; then
297  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
298    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
299                  \`configure --disable-timing') ])
300fi
301
302# font-lock-trick: '
303
304#
305# - check for compiler characteristics.
306#
307
308# use C to check compiler characteristics instead of C++.  On
309# nextstep, checking with C++ may fail.
310# AC_LANG_C
311
312# cross-compiling ?!
313#AC_C_CROSS
314#if test "x$cross_compiling" = xyes; then
315#  AC_MSG_WARN([you better specify a cache file to get the values for
316#                    cross-compiling right (e.g., call \`configure
317#                    --cache-file=yourTarget.cache').  In particular, you
318#                    should make sure that your target machine supports
319#                    arithmetic shift.])
320#fi
321
322# font-lock-trick: '
323
324#
325# - paths.
326#
327
328# note that Singular has its own mechanism to search the tables,
329# hence we do not need to mind it here
330#gftabledir='${datadir}/factory/gftables'
331#explicit_gftabledir="$explicit_datadir/gftables"
332
333# for installation of the templates
334#templatedir='${includedir}/templates'
335
336#
337# - set defines and variables according to our tests.
338#
339
340## CFLAGS
341#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
342#  CFLAGS=""
343#fi
344
345# CXXFLAGS
346#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
347#  CXXFLAGS=""
348#
349#AC_LANG_SAVE
350#AC_LANG_CPLUSPLUS
351# check whether CXX accepts -fno-rtti
352#AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
353#tmp_flags=${CXXFLAGS}
354#CXXFLAGS="${CXXFLAGS}"
355#AC_CACHE_VAL(ac_cv_cxx_have_rtti,
356#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
357#)
358#AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
359#CXXFLAGS=$tmp_flags
360#if test "${ac_cv_cxx_have_rtti}" = yes; then
361#CXXFLAGS="$CXXFLAGS"
362#fi
363#AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
364#tmp_flags=${CXXFLAGS}
365#CXXFLAGS="${CXXFLAGS} -fno-exceptions"
366#AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
367#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
368#)
369#AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
370#CXXFLAGS=$tmp_flags
371#if test "${ac_cv_cxx_have_exceptions}" = yes; then
372#CXXFLAGS="$CXXFLAGS -fno-exceptions"
373#fi
374#AC_LANG_RESTORE
375#
376#fi
377
378# ARFLAGS
379#test "${ARFLAGS+set}" = set || ARFLAGS=cr
380
381# M4FLAGS
382#test "${M4FLAGS+set}" = set || M4FLAGS=
383
384# arithmetic shift
385#if test "x$ac_cv_shift" = xyes; then
386#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
387#fi
388
389AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
390# "configurable inline methods"
391if test "x$enable_cf_inline" != xno; then
392  AC_DEFINE([CF_USE_INLINE],[1])
393fi
394
395AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
396# assertions
397if test "x$enable_assertions" = xno; then
398  AC_DEFINE([NOASSERT],[1])
399fi
400
401AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
402# timing
403if test "x$enable_timing" != xno; then
404  AC_DEFINE([TIMING],[1])
405fi
406
407# debugoutput
408AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
409if test "x$enable_debugoutput" != xno; then
410  AC_DEFINE([DEBUGOUTPUT],[1])
411fi
412
413#
414# - complete and substitute variables, defines.
415#
416#AC_SUBST(gftabledir)
417#AC_SUBST(templatedir)
418
419
420
421# AC_SUBST(libfactory)
422
423#AC_SUBST(ARFLAGS)
424#AC_SUBST(M4FLAGS)
425
426AC_SUBST(MAKEHEADERFLAGS)
427
428#AC_SUBST(factorysrc)
429#AC_SUBST(factoryincl)
430
431#AC_SUBST(alltargets)
432#AC_SUBST(installtargets)
433#AC_SUBST(uninstalltargets)
434
435factory_version="4.1.3"
436factory_configuration="'$ac_configure_args' in `pwd`"
437AC_SUBST(factory_version)
438
439AH_TEMPLATE([FACTORYVERSION], [factory version])
440AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
441
442AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
443AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
444
445#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
446#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
447
448
449
450AC_CONFIG_FILES([Makefile include/factory/Makefile factory.pc]) #  ftest/GNUmakefile
451AC_OUTPUT
452
Note: See TracBrowser for help on using the repository browser.