source: git/factory/configure.ac @ ae8a3a

fieker-DuValspielwiese
Last change on this file since ae8a3a was d00f4f, checked in by Hans Schönemann <hannes@…>, 9 years ago
flint version: 2.4 req.
  • Property mode set to 100644
File size: 10.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.0.2])
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
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
57#
58# - check withs and enables.
59#
60AC_ARG_ENABLE(
61  cf-inline,
62  [AS_HELP_STRING([--enable-cf-inline],[build Factory with \"configurable inline methods\" enabled.])],
63  [enable_cf_inline=$enableval],
64  [enable_cf_inline=no])
65
66AC_ARG_ENABLE(
67  assertions,
68  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
69  ,
70  enable_assertions=yes)
71
72AC_ARG_ENABLE(
73  timing,
74  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
75  ,
76  enable_timing=no)
77
78AC_ARG_ENABLE(
79  debugoutput,
80  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
81  ,
82  enable_debugoutput=no)
83
84AC_ARG_ENABLE(
85  streamio,
86  [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
87  ,
88  [enable_streamio=no])
89
90AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
91
92AC_ARG_WITH(
93  Singular,
94  [AS_HELP_STRING([--without-Singular],[(obsolete) build NOT for the use with CAS Singular.])],
95  ,
96  [with_Singular=yes])
97
98PKG_REQUIRE="$PKG_REQUIRE"
99AC_SUBST(PKG_REQUIRE)
100
101SING_CHECK_OMALLOC()
102
103AH_TEMPLATE([SINGULAR], [define if linked to Singular])
104AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
105
106# Singular
107if test "x$with_Singular" = xyes; then
108  AC_DEFINE([SINGULAR],[1])
109  AC_DEFINE([DISABLE_GMP_CPP],[1])
110#  AC_DEFINE([NOSTREAMIO],[1])
111fi
112
113# || test "x$with_Singular" = xyes
114# Use no streamio (C++) if SINGULAR or explicitely disabled
115if test "x$enable_streamio" = xno;  then
116  AC_DEFINE([NOSTREAMIO],[1])
117fi
118
119AM_CONDITIONAL(
120    [WITH_PARSER_FOR_CANONICAL_FORM],
121    [test "x$enable_streamio" = xyes])
122
123AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libresources] )
124AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libresources] )
125
126AC_MSG_CHECKING(whether libresources should be used)
127if test "x$with_Singular" = xyes;
128then
129  AC_MSG_RESULT(yes)
130
131  AC_MSG_CHECKING([  RESOURCES_INCLUDES?..])
132  AC_MSG_RESULT(${RESOURCES_INCLUDES:-unset})
133
134  AC_MSG_CHECKING([  RESOURCES_LIBS?..])
135  AC_MSG_RESULT(${RESOURCES_LIBS:-unset})
136
137  PKG_REQUIRE="$PKG_REQUIRE resources"
138  AC_SUBST(PKG_REQUIRE)
139else
140  AC_MSG_RESULT(no)
141fi
142
143AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$with_Singular" = xyes])
144
145
146AH_TEMPLATE([FACTORY_INT64], [Defenition for FACTORY_INT64])
147# Always long long int???!
148AC_DEFINE([FACTORY_INT64], [long long int])
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
210LB_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)]))
211
212LB_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)]))
213
214LB_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)]))
215
216# arithmetic shift
217#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
218#AC_CACHE_VAL(ac_cv_shift,
219#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
220#       AC_TRY_RUN(
221#      [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
222#      ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
223#if test "x$ac_cv_shift" = xyes; then
224#  AC_MSG_RESULT(yes)
225#else
226#  AC_MSG_RESULT(no)
227#fi
228
229#
230# - check for header files.
231#
232AC_LANG_CPLUSPLUS
233AC_LANG_PUSH([C++])
234
235AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
236  [ AC_MSG_ERROR(C header files not found) ])
237AC_CHECK_HEADERS(cstdio)
238
239if test "x$enable_streamio" != xno;  then
240  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
241  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
242
243  # since the FTE will compile only with stream IO enabled we will not
244  # check for the necessary header files if stream IO is disabled
245  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
246    [ AC_MSG_WARN(C/C++ header files not found.
247                    You will not be able to build the Factory Test Environment
248                    (though Factory itself should compile)) ])
249fi
250
251
252if test "x$enable_timing" != xno; then
253  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
254    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
255                  \`configure --disable-timing') ])
256fi
257
258# font-lock-trick: '
259
260#
261# - check for compiler characteristics.
262#
263
264# use C to check compiler characteristics instead of C++.  On
265# nextstep, checking with C++ may fail.
266# AC_LANG_C
267
268# cross-compiling ?!
269#AC_C_CROSS
270#if test "x$cross_compiling" = xyes; then
271#  AC_MSG_WARN([you better specify a cache file to get the values for
272#                    cross-compiling right (e.g., call \`configure
273#                    --cache-file=yourTarget.cache').  In particular, you
274#                    should make sure that your target machine supports
275#                    arithmetic shift.])
276#fi
277
278# font-lock-trick: '
279
280#
281# - paths.
282#
283
284# note that Singular has its own mechanism to search the tables,
285# hence we do not need to mind it here
286#gftabledir='${datadir}/factory/gftables'
287#explicit_gftabledir="$explicit_datadir/gftables"
288
289# for installation of the templates
290#templatedir='${includedir}/templates'
291
292#
293# - set defines and variables according to our tests.
294#
295
296## CFLAGS
297#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
298#  CFLAGS=""
299#fi
300
301# CXXFLAGS
302#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
303#  CXXFLAGS=""
304#
305#AC_LANG_SAVE
306#AC_LANG_CPLUSPLUS
307# check whether CXX accepts -fno-rtti
308#AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
309#tmp_flags=${CXXFLAGS}
310#CXXFLAGS="${CXXFLAGS}"
311#AC_CACHE_VAL(ac_cv_cxx_have_rtti,
312#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
313#)
314#AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
315#CXXFLAGS=$tmp_flags
316#if test "${ac_cv_cxx_have_rtti}" = yes; then
317#CXXFLAGS="$CXXFLAGS"
318#fi
319#AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
320#tmp_flags=${CXXFLAGS}
321#CXXFLAGS="${CXXFLAGS} -fno-exceptions"
322#AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
323#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
324#)
325#AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
326#CXXFLAGS=$tmp_flags
327#if test "${ac_cv_cxx_have_exceptions}" = yes; then
328#CXXFLAGS="$CXXFLAGS -fno-exceptions"
329#fi
330#AC_LANG_RESTORE
331#
332#fi
333
334# ARFLAGS
335#test "${ARFLAGS+set}" = set || ARFLAGS=cr
336
337# M4FLAGS
338#test "${M4FLAGS+set}" = set || M4FLAGS=
339
340# arithmetic shift
341#if test "x$ac_cv_shift" = xyes; then
342#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
343#fi
344
345AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
346# "configurable inline methods"
347if test "x$enable_cf_inline" != xno; then
348  AC_DEFINE([CF_USE_INLINE],[1])
349fi
350
351AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
352# assertions
353if test "x$enable_assertions" = xno; then
354  AC_DEFINE([NOASSERT],[1])
355fi
356
357AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
358# timing
359if test "x$enable_timing" != xno; then
360  AC_DEFINE([TIMING],[1])
361fi
362
363# debugoutput
364AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
365if test "x$enable_debugoutput" != xno; then
366  AC_DEFINE([DEBUGOUTPUT],[1])
367fi
368
369#
370# - complete and substitute variables, defines.
371#
372#AC_SUBST(gftabledir)
373#AC_SUBST(templatedir)
374
375
376
377# AC_SUBST(libfactory)
378
379#AC_SUBST(ARFLAGS)
380#AC_SUBST(M4FLAGS)
381
382AC_SUBST(MAKEHEADERFLAGS)
383
384#AC_SUBST(factorysrc)
385#AC_SUBST(factoryincl)
386
387#AC_SUBST(alltargets)
388#AC_SUBST(installtargets)
389#AC_SUBST(uninstalltargets)
390
391factory_version="4.0.1"
392factory_configuration="'$ac_configure_args' in `pwd`"
393AC_SUBST(factory_version)
394
395AH_TEMPLATE([FACTORYVERSION], [factory version])
396AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
397
398AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
399AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
400
401#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
402#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
403
404
405
406AC_CONFIG_FILES([Makefile include/factory/Makefile factory.pc]) #  ftest/GNUmakefile
407AC_OUTPUT
408
Note: See TracBrowser for help on using the repository browser.