source: git/factory/configure.ac @ 25761d

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