source: git/factory/configure.ac @ e14941

spielwiese
Last change on this file since e14941 was ea0001, checked in by Mohamed Barakat <mohamed.barakat@…>, 13 years ago
make check finds the gftables and dynamic modules (also out of tree) - added AM_MAINTAINER_MODE to configure.ac everywhere - we now symlink to gftables rather than copying - use GFTABLEDIR to find gftables in nfReadTable (this is a hack which breaks Singular when it is installed) - symlink the dynamic modules from libpolys/polys to libpolys/tests
  • Property mode set to 100644
File size: 12.2 KB
Line 
1dnl # emacs edit mode for this file is -*- sh -*-
2dnl # $Id$
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], [3.1.2.sw])
16AC_CONFIG_SRCDIR(canonicalform.cc)
17AC_CONFIG_MACRO_DIR([../m4])
18AC_CONFIG_HEADER(config.h)
19AC_CONFIG_AUX_DIR([.])
20AM_MAINTAINER_MODE
21AM_INIT_AUTOMAKE
22
23AC_PROG_YACC
24
25#
26# Do not change version here!!!
27#
28dnl #
29dnl # Change version here, do not believe the comment in the
30dnl # preceding lines.
31dnl #
32factory_version="3.1.3"
33factory_configuration="'$ac_configure_args' in `pwd`"
34
35#
36# - check withs and enables.
37#
38AC_ARG_WITH(
39  memman,
40  [  --with-memman(=<memman>) specify Factory memory manager.
41                          <memman> is either \`old' (default), \`new', or \`no'.],
42  ,
43  [ if test "x$with_Singular" = xyes; then
44      with_memman=no
45    else
46      with_memman=old
47    fi ])
48
49# font-lock-trick: '
50
51AC_ARG_WITH(
52  omalloc,
53  [  --with-omalloc           build for use with omalloc])
54
55AC_ARG_WITH(
56  Singular,
57  [  --with-Singular         build for use with computer algebra system Singular.],
58  ,
59  with_Singular=no)
60
61AC_ARG_ENABLE(
62  cf-inline,
63  [  --enable-cf-inline      build Factory with \"configurable inline methods\"
64                          enabled.],
65  ,
66  enable_cf_inline=no)
67
68AC_ARG_ENABLE(
69  streamio,
70  [  --disable-streamio      build Factory without stream IO],
71  ,
72  [ if test "x$with_Singular" = xyes; then
73      enable_streamio=no
74    else
75      enable_streamio=yes
76    fi ])
77
78AC_ARG_ENABLE(
79  memdebug,
80  [  --enable-memdebug=<level> switch on memory management debugging.  Meaningful
81                          with \`--with-memman=new' only.  <level> may be either
82                          \`no' (default), \`normal', or \`full'.],
83  ,
84  enable_memdebug=no)
85
86AC_ARG_ENABLE(
87  assertions,
88  [  --enable-assertions     build Factory with assertions activated],
89  ,
90  enable_assertions=no)
91
92AC_ARG_ENABLE(
93  timing,
94  [  --enable-timing         build Factory so it will print timing information],
95  ,
96  enable_timing=no)
97
98AC_ARG_ENABLE(
99  debugoutput,
100  [  --enable-debugoutput    build Factory so it will print debugging information],
101  ,
102  enable_debugoutput=no)
103
104#
105# - check for CC and CXX but be careful about CFLAGS.
106#
107test "${CFLAGS+set}" = set || cflags_expl_set=no
108AC_PROG_CC
109test "${CXXFLAGS+set}" = set || cxxflags_expl_set=no
110AC_PROG_CXX
111if test "x$GCC" != xyes && test "x$GXX" != xyes; then
112  AC_MSG_WARN(you better use gcc to compile Factory)
113else
114  if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
115    AC_MSG_WARN([we use \`-O2 -fomit-frame-pointer' as default for \`CXXFLAGS'
116                    (instead of the configure default \`-g -O')])
117  fi
118  if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
119    AC_MSG_WARN([we use \`-O2 -fomit-frame-pointer' as default for \`CFLAGS'
120                    (instead of the configure default \`-g -O')])
121  fi
122fi
123
124#
125# - check for some other programs.
126#
127AC_PROG_CPP
128AC_PROG_CXXCPP
129AC_PROG_LN_S
130AC_PROG_INSTALL
131AC_PROG_RANLIB
132AC_PROG_MAKE_SET
133AC_CHECK_PROG(AR, ar, ar, where-is-your-ar)
134AC_CHECK_PROG(M4, m4, m4, where-is-your-m4)
135AC_CHECK_PROG(BISON, bison, bison, where-is-your-bison)
136DX_INIT_DOXYGEN($PACKAGE_NAME, MYDOXYGENCONFIG)
137
138# do not use `MKINSTALLDIRS' and `MAKEHEADER' since there may be
139# name clashes with other peoples configure scripts via
140# `config.cache'.  Furthermore, we do not use cache at all to
141# avoid some nasty problems with our own development environment.
142unset ac_cv_path_FACTORY_MKINSTALLDIRS
143unset ac_cv_path_FACTORY_MAKEHEADER
144save_path="$PATH"
145PATH="$PATH:$srcdir/bin"
146AC_PATH_PROG(FACTORY_MKINSTALLDIRS, mkinstalldirs, -mkdir)
147PATH="$srcdir/bin:$save_path"
148AC_PATH_PROG(FACTORY_MAKEHEADER, makeheader)
149PATH="$save_path"
150
151#
152# - expand paths.
153#
154
155AC_MSG_CHECKING(and generating explicit install paths)
156
157# generate Makefile
158save_prefix="$prefix"
159save_exec_prefix="$exec_prefix"
160test "x$prefix" = xNONE && prefix=$ac_default_prefix
161test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
162for dir in prefix exec_prefix bindir sbindir libexecdir \
163           datadir sysconfdir sharedstatedir localstatedir libdir \
164           includedir oldincludedir infodir mandir; do
165  eval "dir_value=\$$dir"
166  cat >> ./conftest.mk << EXPLPATHEOT
167$dir=$dir_value
168explicit_$dir:
169        @ echo \$($dir)
170        @ if echo \$($dir) | grep '^/'; \\
171        then echo \$($dir) > ./conftest.dir; \\
172        else echo \`pwd\`/\$($dir) > ./conftest.dir; fi
173EXPLPATHEOT
174done
175prefix="$save_prefix"
176exec_prefix="$save_exec_prefix"
177
178# generate the explicit paths
179make >&5 2>&1 -f ./conftest.mk explicit_datadir
180explicit_datadir=`cat ./conftest.dir`
181make >&5 2>&1 -f ./conftest.mk explicit_libdir
182explicit_libdir=`cat ./conftest.dir`
183make >&5 2>&1 -f ./conftest.mk explicit_includedir
184explicit_includedir=`cat ./conftest.dir`
185
186# clean up
187rm -f ./conftest.mk ./conftest.dir
188
189AC_MSG_RESULT(done)
190
191#
192# - check for libraries.
193#
194AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
195
196LB_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)]))
197
198LB_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)]))
199
200# arithmetic shift
201#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
202#AC_CACHE_VAL(ac_cv_shift,
203#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
204#       AC_TRY_RUN(
205#      [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
206#      ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
207#if test "x$ac_cv_shift" = xyes; then   
208#  AC_MSG_RESULT(yes)
209#else
210#  AC_MSG_RESULT(no)
211#fi
212
213#
214# - check for header files.
215#
216AC_LANG_CPLUSPLUS
217
218AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
219  [ AC_MSG_ERROR(C header files not found) ])
220AC_CHECK_HEADERS(cstdio)
221
222if test "x$enable_streamio" != xno; then
223  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
224  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
225
226  # since the FTE will compile only with stream IO enabled we will not
227  # check for the necessary header files if stream IO is disabled
228  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
229    [ AC_MSG_WARN(C/C++ header files not found.
230                    You will not be able to build the Factory Test Environment
231                    (though Factory itself should compile)) ])
232fi
233
234if test "x$enable_timing" != xno; then
235  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
236    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
237                  \`configure --disable-timing') ])
238fi
239
240AC_CHECK_HEADERS(omalloc.h,,)
241
242# font-lock-trick: '
243
244#
245# - check for compiler characteristics.
246#
247
248# use C to check compiler characteristics instead of C++.  On
249# nextstep, checking with C++ may fail.
250AC_LANG_C
251
252# cross-compiling ?!
253#AC_C_CROSS
254#if test "x$cross_compiling" = xyes; then
255#  AC_MSG_WARN([you better specify a cache file to get the values for
256#                    cross-compiling right (e.g., call \`configure
257#                    --cache-file=yourTarget.cache').  In particular, you
258#                    should make sure that your target machine supports
259#                    arithmetic shift.])
260#fi
261
262# font-lock-trick: '
263
264#
265# - paths.
266#
267
268# note that Singular has its own mechanism to search the tables,
269# hence we do not need to mind it here
270gftabledir='${datadir}/factory/gftables'
271explicit_gftabledir="$explicit_datadir/gftables"
272
273# for installation of the templates
274templatedir='${includedir}/templates'
275
276#
277# - the name of the game and the targets to create.
278#
279if test "x$with_Singular" = xyes; then
280  libfactory=libfactory.a
281
282  factorysrc='$(basefactorysrc) $(singfactorysrc)'
283  factoryincl='$(basefactoryincl) $(singfactoryincl)'
284  memmansrc=
285  memmanincl=
286
287  alltargets=cf
288  installtargets=installcf
289  uninstalltargets=uninstallcf
290else
291  libfactory=libcf.a
292
293  factorysrc='$(basefactorysrc)'
294  factoryincl='$(basefactoryincl)'
295  memmansrc='$(basememmansrc)'
296  memmanincl=
297
298  alltargets=cf
299  installtargets=installcf
300  uninstalltargets=uninstallcf
301fi
302
303#
304# - set defines and variables according to our tests.
305#
306
307# CFLAGS
308if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
309  CFLAGS="-O2 -fomit-frame-pointer"
310fi
311
312# CXXFLAGS
313if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
314  CXXFLAGS="-O2 -fomit-frame-pointer"
315
316AC_LANG_SAVE
317AC_LANG_CPLUSPLUS
318# check whether CXX accepts -fno-rtti
319AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
320tmp_flags=${CXXFLAGS}
321CXXFLAGS="${CXXFLAGS} -fno-rtti"
322AC_CACHE_VAL(ac_cv_cxx_have_rtti,
323AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
324)
325AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
326CXXFLAGS=$tmp_flags
327if test "${ac_cv_cxx_have_rtti}" = yes; then
328CXXFLAGS="$CXXFLAGS -fno-rtti"
329fi
330
331AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
332tmp_flags=${CXXFLAGS}
333CXXFLAGS="${CXXFLAGS} -fno-exceptions"
334AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
335AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
336)
337AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
338CXXFLAGS=$tmp_flags
339if test "${ac_cv_cxx_have_exceptions}" = yes; then
340CXXFLAGS="$CXXFLAGS -fno-exceptions"
341fi
342AC_LANG_RESTORE
343
344fi
345
346# ARFLAGS
347test "${ARFLAGS+set}" = set || ARFLAGS=cr
348
349# M4FLAGS
350test "${M4FLAGS+set}" = set || M4FLAGS=
351
352# Singular
353if test "x$with_Singular" = xyes; then
354  AC_DEFINE([SINGULAR],[1],[SINGULAR])
355fi
356
357# arithmetic shift
358#if test "x$ac_cv_shift" = xyes; then   
359#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
360#fi
361
362AC_MSG_CHECKING(whether to use omalloc)
363
364if test "$with_omalloc" = yes; then
365  if test "$ac_cv_header_omalloc_h" != yes; then
366    if test "$enable_omalloc" = yes; then
367       warn_omalloc=yes
368    else
369       with_omalloc=no
370    fi
371  fi
372else
373  if test "$with_omalloc" != no; then
374    if test "$enable_omalloc" = yes; then
375      if test "$ac_cv_header_omalloc_h" != yes; then
376        warn_omalloc=yes
377      fi
378      with_omalloc=yes
379    else
380      with_omalloc=no
381    fi
382  fi
383fi
384if test "$with_omalloc" = yes; then
385  AC_DEFINE([HAVE_OMALLOC],[1],[HAVE_OMALLOC])
386  with_memman=no
387fi
388AC_MSG_RESULT($with_omalloc)
389if test "$warn_omalloc" = yes; then
390  AC_MSG_WARN(did not find omalloc.h -- install before compiling)
391fi
392
393   
394# memory manager
395if test "x$with_memman" = xyes; then
396  alltargets="$alltargets mem"
397  installtargets="$installtargets installmem"
398  uninstalltargets="$uninstalltargets uninstallmem"
399  AC_DEFINE([USE_MEMUTIL],[1],[USE_MEMUTIL])
400
401  if test "x$with_memman" != xnew; then
402    memmansrc="$memmansrc \$(oldmemmansrc)"
403    memmanincl='$(oldmemmanincl)'
404    AC_DEFINE([USE_OLD_MEMMAN],[1],[USE_OLD_MEMMAN])
405  else
406    memmansrc="$memmansrc \$(newmemmansrc)"
407    memmanincl='$(newmemmanincl)'
408
409    if test "x$enable_memdebug" = xfull; then
410      AC_DEFINE([MDEBUG], [1], [MDEBUG])
411    elif test "x$enable_memdebug" != xno; then
412      AC_DEFINE([MDEBUG], [0], [MDEBUG])
413    fi
414  fi
415fi
416
417# "configurable inline methods"
418if test "x$enable_cf_inline" != xno; then
419  AC_DEFINE([CF_USE_INLINE],[1],[CF_USE_INLINE])
420fi
421
422# iostream
423if test "x$enable_streamio" = xno; then
424  AC_DEFINE([NOSTREAMIO],[1],[NOSTREAMIO])
425else
426  factorysrc="$factorysrc \$(useiofactorysrc)"
427  factoryincl="$factoryincl \$(useiofactoryincl)"
428fi
429
430# assertions
431if test "x$enable_assertions" = xno; then
432  AC_DEFINE([NOASSERT],[1],[NOASSERT])
433fi
434
435# timing
436if test "x$enable_timing" != xno; then
437  AC_DEFINE([TIMING],[1],[TIMING])
438fi
439
440# debugoutput
441if test "x$enable_debugoutput" != xno; then
442  AC_DEFINE([DEBUGOUTPUT],[1],[DEBUGOUTPUT])
443fi
444
445#
446# - complete and substitute variables, defines.
447#
448AC_SUBST(gftabledir)
449AC_SUBST(templatedir)
450
451AC_SUBST(factory_version)
452
453AC_SUBST(libfactory)
454
455AC_SUBST(ARFLAGS)
456AC_SUBST(M4FLAGS)
457AC_SUBST(MAKEHEADERFLAGS)
458
459AC_SUBST(factorysrc)
460AC_SUBST(factoryincl)
461AC_SUBST(memmansrc)
462AC_SUBST(memmanincl)
463
464AC_SUBST(alltargets)
465AC_SUBST(installtargets)
466AC_SUBST(uninstalltargets)
467
468AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version", [FACTORYVERSION])
469AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration", [FACTORYCONFIGURATION])
470AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir", [GFTABLEDIR])
471
472AC_OUTPUT(Makefile ftest/GNUmakefile)
Note: See TracBrowser for help on using the repository browser.