source: git/factory/configure.ac @ 0dff6bc

fieker-DuValspielwiese
Last change on this file since 0dff6bc was 280286e, checked in by Jan Engelhardt <jengelh@…>, 11 years ago
build: resolve automake 1.12 warnings /usr/share/automake-1.12/am/ltlibrary.am: warning: 'libomalloc.la': linking libtool libraries using a non-POSIX archiver requires 'AM_PROG_AR' in 'configure.ac'
  • Property mode set to 100644
File size: 13.7 KB
RevLine 
[429497]1
[8e8aca3]2dnl # emacs edit mode for this file is -*- sh -*-
[575680]3
[a013ed]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 #
[beca7c]11
12#
13# - initialisation.
14#
[635774]15AC_INIT([factory], [3.1.3])
[e76d7a6]16AC_CONFIG_SRCDIR(canonicalform.cc)
[9af8a63]17AC_CONFIG_MACRO_DIR([../m4])
[e76d7a6]18AC_CONFIG_AUX_DIR([.])
[f3ea6ce]19AC_CONFIG_HEADER(config.h)
[ab788d]20
[ea0001]21AM_MAINTAINER_MODE
[24a77fb]22AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
[2e984a]23m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
[280286e]24m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
[2e984a]25
[e76d7a6]26
[e08559]27# Add pre'prefixed config
[3af3ca]28AX_PREFIX_CONFIG_H([config.h],[],[config.h])
[e08559]29
[e76d7a6]30AC_PROG_YACC
[e078e0]31# AM_PROG_AR
[80c102]32LT_INIT
33
[beca7c]34#
[6e304e3]35# Do not change version here!!!
[beca7c]36#
[a013ed]37dnl #
38dnl # Change version here, do not believe the comment in the
39dnl # preceding lines.
40dnl #
[42653b]41factory_version="3.1.3"
[a013ed]42factory_configuration="'$ac_configure_args' in `pwd`"
[beca7c]43
44#
45# - check withs and enables.
46#
[e4fe2b]47AC_ARG_WITH(
48  Singular,
49  [AS_HELP_STRING([--without-Singular],[build NOT for the use with CAS Singular.])],
50  ,
51  [with_Singular=yes])
52
[429497]53AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--enable-omalloc],[build for use with omalloc]),
54[if test "x$enableval" = "xyes"; then
[461f40]55  ENABLE_OMALLOC=yes
56fi], ENABLE_OMALLOC=no)
[e4fe2b]57
[429497]58AC_ARG_ENABLE(omalloc_trust, AS_HELP_STRING([--enable-omalloc-trust],[do not check the omalloc header]),
59[if test "x$enableval" = "xyes"; then
60  omalloc_trust=yes
61fi], omalloc_trust=no)
[575680]62
[429497]63AC_ARG_WITH(omalloc_dir,[AS_HELP_STRING([--with-omalloc-dir=PTH],[location of omalloc])], with_omalloc_dir="$withval", with_omalloc_dir="")
64AC_ARG_WITH(omalloc_extra_dir,[AS_HELP_STRING([--with-omalloc-extra-dir=PTH],[optional extra location of omalloc])], with_omalloc_extra_dir="$withval", with_omalloc_extra_dir="")
[575680]65
[1cdedcb]66AC_ARG_ENABLE(
67  cf-inline,
[e4fe2b]68  [AS_HELP_STRING([--enable-cf-inline],[build Factory with \"configurable inline methods\" enabled.])],
69  [enable_cf_inline=$enableval],
70  [enable_cf_inline=no])
[1cdedcb]71
[beca7c]72AC_ARG_ENABLE(
73  streamio,
[e4fe2b]74  [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
[575680]75  ,
[e4fe2b]76  [enable_streamio=no])
[beca7c]77
78AC_ARG_ENABLE(
79  assertions,
[ff3a4f]80  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
[beca7c]81  ,
[ff3a4f]82  enable_assertions=yes)
[beca7c]83
84AC_ARG_ENABLE(
85  timing,
[e4fe2b]86  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
[575680]87  ,
[beca7c]88  enable_timing=no)
89
90AC_ARG_ENABLE(
91  debugoutput,
[e4fe2b]92  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
[575680]93  ,
[beca7c]94  enable_debugoutput=no)
95
[f284db]96AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [build the debugging version of the libraries]),
[2b43ac]97 [if test "x$enableval"  = "xyes"; then
98   ENABLE_DEBUG=yes
99 fi], ENABLE_DEBUG=no)
100
101AM_CONDITIONAL(WANT_DEBUG, test x"${ENABLE_DEBUG}" == xyes)
102
[beca7c]103#
[575680]104# - check for CC and CXX but be careful about CFLAGS.
[beca7c]105#
[575680]106test "${CFLAGS+set}" = set || cflags_expl_set=no
107AC_PROG_CC
[beca7c]108test "${CXXFLAGS+set}" = set || cxxflags_expl_set=no
109AC_PROG_CXX
[575680]110if test "x$GCC" != xyes && test "x$GXX" != xyes; then
[f13f4b]111  AC_MSG_WARN(you better use gcc to compile Factory)
[6e304e3]112else
113  if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
[f86531]114    AC_MSG_WARN([we use \`' as default for \`CXXFLAGS'
[a013ed]115                    (instead of the configure default \`-g -O')])
[6e304e3]116  fi
117  if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
[f86531]118    AC_MSG_WARN([we use \`' as default for \`CFLAGS'
[a013ed]119                    (instead of the configure default \`-g -O')])
[6e304e3]120  fi
[beca7c]121fi
122
123#
124# - check for some other programs.
125#
[654824]126AC_PROG_CPP
[beca7c]127AC_PROG_CXXCPP
[9d50d3]128AC_PROG_LN_S
[beca7c]129AC_PROG_INSTALL
[d2f9df]130AC_DISABLE_STATIC
131LT_INIT
[beca7c]132AC_PROG_MAKE_SET
133AC_CHECK_PROG(AR, ar, ar, where-is-your-ar)
[9d50d3]134AC_CHECK_PROG(M4, m4, m4, where-is-your-m4)
[beca7c]135AC_CHECK_PROG(BISON, bison, bison, where-is-your-bison)
[ae4d9b]136AC_CHECK_SIZEOF(long,4)
[d2f9df]137AC_C_CONST
138AC_C_INLINE
[089d1f]139
140AH_TEMPLATE([INT64], [Defenition for INT64])
141# Always long long int???!
142AC_DEFINE([INT64], [long long int]) 
143
[a11768]144DX_INIT_DOXYGEN($PACKAGE_NAME, MYDOXYGENCONFIG)
[beca7c]145
[64f32c7]146# do not use `MKINSTALLDIRS' and `MAKEHEADER' since there may be
147# name clashes with other peoples configure scripts via
148# `config.cache'.  Furthermore, we do not use cache at all to
149# avoid some nasty problems with our own development environment.
150unset ac_cv_path_FACTORY_MKINSTALLDIRS
151unset ac_cv_path_FACTORY_MAKEHEADER
[726f4d]152save_path="$PATH"
[b70273]153PATH="$PATH:$srcdir/bin"
154AC_PATH_PROG(FACTORY_MKINSTALLDIRS, mkinstalldirs, -mkdir)
[726f4d]155PATH="$srcdir/bin:$save_path"
[b70273]156AC_PATH_PROG(FACTORY_MAKEHEADER, makeheader)
[726f4d]157PATH="$save_path"
158
159#
160# - expand paths.
161#
162
163AC_MSG_CHECKING(and generating explicit install paths)
[413cbb]164
165# generate Makefile
[726f4d]166save_prefix="$prefix"
167save_exec_prefix="$exec_prefix"
168test "x$prefix" = xNONE && prefix=$ac_default_prefix
169test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
170for dir in prefix exec_prefix bindir sbindir libexecdir \
171           datadir sysconfdir sharedstatedir localstatedir libdir \
172           includedir oldincludedir infodir mandir; do
173  eval "dir_value=\$$dir"
[f95b2f]174  cat >> ./conftest.mk << EXPLPATHEOT
175$dir=$dir_value
176explicit_$dir:
177        @ echo \$($dir)
178        @ if echo \$($dir) | grep '^/'; \\
179        then echo \$($dir) > ./conftest.dir; \\
180        else echo \`pwd\`/\$($dir) > ./conftest.dir; fi
181EXPLPATHEOT
[726f4d]182done
183prefix="$save_prefix"
184exec_prefix="$save_exec_prefix"
185
[413cbb]186# generate the explicit paths
[f95b2f]187make >&5 2>&1 -f ./conftest.mk explicit_datadir
188explicit_datadir=`cat ./conftest.dir`
189make >&5 2>&1 -f ./conftest.mk explicit_libdir
190explicit_libdir=`cat ./conftest.dir`
191make >&5 2>&1 -f ./conftest.mk explicit_includedir
192explicit_includedir=`cat ./conftest.dir`
[726f4d]193
[413cbb]194# clean up
[f95b2f]195rm -f ./conftest.mk ./conftest.dir
[726f4d]196
[f95b2f]197AC_MSG_RESULT(done)
[beca7c]198
199#
200# - check for libraries.
201#
[20d724f]202AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
203
[9af8a63]204LB_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)]))
205
206LB_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)]))
[beca7c]207
[3ed6ccf]208LB_CHECK_FLINT(2.3,,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)]))
[97a059]209
[b46fb9]210# arithmetic shift
[1bc850]211#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
212#AC_CACHE_VAL(ac_cv_shift,
213#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
214#       AC_TRY_RUN(
215#      [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
216#      ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
217#if test "x$ac_cv_shift" = xyes; then   
218#  AC_MSG_RESULT(yes)
219#else
220#  AC_MSG_RESULT(no)
221#fi
[b46fb9]222
[beca7c]223#
224# - check for header files.
225#
226AC_LANG_CPLUSPLUS
227
[43b476]228AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
[9d50d3]229  [ AC_MSG_ERROR(C header files not found) ])
[958fc4]230AC_CHECK_HEADERS(cstdio)
[beca7c]231
[575680]232if test "x$enable_streamio" != xno; then
[1dc616]233  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
[beca7c]234  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
[9d50d3]235
236  # since the FTE will compile only with stream IO enabled we will not
237  # check for the necessary header files if stream IO is disabled
[dc11d0]238  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
[9d50d3]239    [ AC_MSG_WARN(C/C++ header files not found.
240                    You will not be able to build the Factory Test Environment
241                    (though Factory itself should compile)) ])
[575680]242fi
[beca7c]243
244if test "x$enable_timing" != xno; then
245  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
[a013ed]246    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
247                  \`configure --disable-timing') ])
[beca7c]248fi
249
[a013ed]250# font-lock-trick: '
251
[beca7c]252#
253# - check for compiler characteristics.
254#
255
[654824]256# use C to check compiler characteristics instead of C++.  On
257# nextstep, checking with C++ may fail.
258AC_LANG_C
259
[575680]260# cross-compiling ?!
[7f7d55f]261#AC_C_CROSS
262#if test "x$cross_compiling" = xyes; then
263#  AC_MSG_WARN([you better specify a cache file to get the values for
264#                    cross-compiling right (e.g., call \`configure
265#                    --cache-file=yourTarget.cache').  In particular, you
266#                    should make sure that your target machine supports
267#                    arithmetic shift.])
268#fi
[beca7c]269
[a013ed]270# font-lock-trick: '
271
[beca7c]272#
273# - paths.
274#
275
[726f4d]276# note that Singular has its own mechanism to search the tables,
277# hence we do not need to mind it here
278gftabledir='${datadir}/factory/gftables'
[ea0001]279explicit_gftabledir="$explicit_datadir/gftables"
[beca7c]280
[726f4d]281# for installation of the templates
282templatedir='${includedir}/templates'
[beca7c]283
284#
285# - the name of the game and the targets to create.
286#
287if test "x$with_Singular" = xyes; then
[468b57]288  libfactory=libfactory.a
[beca7c]289
290  factorysrc='$(basefactorysrc) $(singfactorysrc)'
291  factoryincl='$(basefactoryincl) $(singfactoryincl)'
292
293  alltargets=cf
294  installtargets=installcf
295  uninstalltargets=uninstallcf
296else
297  libfactory=libcf.a
298
299  factorysrc='$(basefactorysrc)'
300  factoryincl='$(basefactoryincl)'
301
302  alltargets=cf
[575680]303  installtargets=installcf
304  uninstalltargets=uninstallcf
[beca7c]305fi
306
307#
[6e304e3]308# - set defines and variables according to our tests.
[beca7c]309#
310
311# CFLAGS
312if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
[f86531]313  CFLAGS=""
[beca7c]314fi
315
316# CXXFLAGS
317if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
[f86531]318  CXXFLAGS=""
[fc7220]319
320AC_LANG_SAVE
321AC_LANG_CPLUSPLUS
[8c0b57]322# check whether CXX accepts -fno-rtti
323AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
[fc7220]324tmp_flags=${CXXFLAGS}
[f86531]325CXXFLAGS="${CXXFLAGS}"
[fc7220]326AC_CACHE_VAL(ac_cv_cxx_have_rtti,
327AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
328)
329AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
330CXXFLAGS=$tmp_flags
331if test "${ac_cv_cxx_have_rtti}" = yes; then
[f86531]332CXXFLAGS="$CXXFLAGS"
[fc7220]333fi
334
[8c0b57]335AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
[fc7220]336tmp_flags=${CXXFLAGS}
[8c0b57]337CXXFLAGS="${CXXFLAGS} -fno-exceptions"
[fc7220]338AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
[a550fd5]339AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
[fc7220]340)
341AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
342CXXFLAGS=$tmp_flags
343if test "${ac_cv_cxx_have_exceptions}" = yes; then
[8c0b57]344CXXFLAGS="$CXXFLAGS -fno-exceptions"
[fc7220]345fi
346AC_LANG_RESTORE
347
[beca7c]348fi
349
350# ARFLAGS
351test "${ARFLAGS+set}" = set || ARFLAGS=cr
352
[9d50d3]353# M4FLAGS
354test "${M4FLAGS+set}" = set || M4FLAGS=
355
[089d1f]356AH_TEMPLATE([SINGULAR], [define if linked to Singular])
357AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
358AH_TEMPLATE([NOSTREAMIO],[DISABLE_GMP_CPP])
359
[beca7c]360# Singular
361if test "x$with_Singular" = xyes; then
[089d1f]362  AC_DEFINE([SINGULAR],[1]) 
363  AC_DEFINE([DISABLE_GMP_CPP],[1])
364  AC_DEFINE([NOSTREAMIO],[1])
[beca7c]365fi
366
367# arithmetic shift
[1bc850]368#if test "x$ac_cv_shift" = xyes; then   
[e76d7a6]369#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
[1bc850]370#fi
[beca7c]371
[429497]372AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
[72486f0]373
374if test "x$with_Singular" = xyes; then
375
[461f40]376AC_MSG_CHECKING([whether to use omalloc/omalloc.h])
377if test "x$ENABLE_OMALLOC" = xyes; then
[429497]378  AC_MSG_RESULT(yes)
[461f40]379 
[429497]380  if test "x$with_omalloc_dir" != "x"; then
381    OMALLOC_CFLAGS="-I${with_omalloc_dir}"
[f79b94c]382  fi
[429497]383  if test "x$with_omalloc_extra_dir" != "x"; then
384    OMALLOC_CFLAGS="$OMALLOC_CFLAGS -I${with_omalloc_extra_dir}"
[b4a676]385    OMALLOC_LDFLAGS="$OMALLOC_LDFLAGS -L${with_omalloc_extra_dir}/omalloc -L${with_omalloc_extra_dir}/findexec"
[429497]386  fi
[461f40]387 
388  CPPFLAGS_save="$CPPFLAGS"
389  # adding $with_omalloc_dir and $with_omalloc_extra_dir to header search path
390  CPPFLAGS="$CPPFLAGS ${OMALLOC_CFLAGS}"
391  if test "x$omalloc_trust" = xno; then
392    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_ERROR([You asked for omalloc but it cannot be found with your default header search path]))
[429497]393  else
[461f40]394    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_WARN([trusting the omalloc locations given: ${OMALLOC_CFLAGS}]))
[f79b94c]395  fi
[461f40]396  CPPFLAGS="$CPPFLAGS_save"
397
[b4a676]398  OMALLOC_G_LDADD="-lfindexec_g -lomalloc_g"
399  OMALLOC_R_LDADD="-lfindexec -lomalloc"
[72486f0]400 
[461f40]401  AC_DEFINE(HAVE_OMALLOC, 1, [omalloc support])
402 
[429497]403  AC_SUBST(OMALLOC_CFLAGS)
[461f40]404  AC_SUBST(OMALLOC_LDFLAGS)
[72486f0]405
406  AC_SUBST(OMALLOC_G_LDADD)
407  AC_SUBST(OMALLOC_R_LDADD)
[429497]408else
409  AC_MSG_RESULT(no)
[43b476]410fi
411
[72486f0]412fi
413
[461f40]414AM_CONDITIONAL([ENABLE_OMALLOC],[test "x$ENABLE_OMALLOC" = xyes])
415
[beca7c]416
[089d1f]417AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
[1cdedcb]418# "configurable inline methods"
419if test "x$enable_cf_inline" != xno; then
[089d1f]420  AC_DEFINE([CF_USE_INLINE],[1])
[1cdedcb]421fi
422
[089d1f]423AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
[beca7c]424# iostream
425if test "x$enable_streamio" = xno; then
[089d1f]426  AC_DEFINE([NOSTREAMIO],[1])
[beca7c]427else
428  factorysrc="$factorysrc \$(useiofactorysrc)"
429  factoryincl="$factoryincl \$(useiofactoryincl)"
430fi
431
[089d1f]432AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
[beca7c]433# assertions
434if test "x$enable_assertions" = xno; then
[089d1f]435  AC_DEFINE([NOASSERT],[1])
[beca7c]436fi
437
[089d1f]438AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
[beca7c]439# timing
440if test "x$enable_timing" != xno; then
[089d1f]441  AC_DEFINE([TIMING],[1])
[beca7c]442fi
443
444# debugoutput
[089d1f]445AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
[beca7c]446if test "x$enable_debugoutput" != xno; then
[089d1f]447  AC_DEFINE([DEBUGOUTPUT],[1]) 
[beca7c]448fi
449
450#
451# - complete and substitute variables, defines.
452#
453AC_SUBST(gftabledir)
454AC_SUBST(templatedir)
455
456AC_SUBST(factory_version)
457
458AC_SUBST(libfactory)
459
460AC_SUBST(ARFLAGS)
[9d50d3]461AC_SUBST(M4FLAGS)
[beca7c]462AC_SUBST(MAKEHEADERFLAGS)
463
464AC_SUBST(factorysrc)
465AC_SUBST(factoryincl)
466
467AC_SUBST(alltargets)
468AC_SUBST(installtargets)
469AC_SUBST(uninstalltargets)
470
[d2f9df]471AH_TEMPLATE([FACTORYVERSION], [factory version])
[089d1f]472AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
473
[d92d71]474AH_TEMPLATE([HAVE_LIBFAC], [have libfac])
475AC_DEFINE_UNQUOTED([HAVE_LIBFAC], 1)
476
[d2f9df]477AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
[089d1f]478AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
479
[d2f9df]480AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
[089d1f]481AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
[beca7c]482
[4eb485]483AM_CONDITIONAL(
484    [WITH_PARSER_FOR_CANONICAL_FORM],
485    [test x$with_Singular != xyes && test x$enable_streamio != xno])
486
[ee668e]487AC_CONFIG_FILES([Makefile include/factory/Makefile libfac/Makefile]) #  ftest/GNUmakefile
[c2eb2e]488AC_OUTPUT
[4eb485]489
Note: See TracBrowser for help on using the repository browser.