source: git/factory/configure.ac @ 280286e

spielwiese
Last change on this file since 280286e 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
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], [3.1.3])
16AC_CONFIG_SRCDIR(canonicalform.cc)
17AC_CONFIG_MACRO_DIR([../m4])
18AC_CONFIG_AUX_DIR([.])
19AC_CONFIG_HEADER(config.h)
20
21AM_MAINTAINER_MODE
22AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
23m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
24m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
25
26
27# Add pre'prefixed config
28AX_PREFIX_CONFIG_H([config.h],[],[config.h])
29
30AC_PROG_YACC
31# AM_PROG_AR
32LT_INIT
33
34#
35# Do not change version here!!!
36#
37dnl #
38dnl # Change version here, do not believe the comment in the
39dnl # preceding lines.
40dnl #
41factory_version="3.1.3"
42factory_configuration="'$ac_configure_args' in `pwd`"
43
44#
45# - check withs and enables.
46#
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
53AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--enable-omalloc],[build for use with omalloc]),
54[if test "x$enableval" = "xyes"; then
55  ENABLE_OMALLOC=yes
56fi], ENABLE_OMALLOC=no)
57
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)
62
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="")
65
66AC_ARG_ENABLE(
67  cf-inline,
68  [AS_HELP_STRING([--enable-cf-inline],[build Factory with \"configurable inline methods\" enabled.])],
69  [enable_cf_inline=$enableval],
70  [enable_cf_inline=no])
71
72AC_ARG_ENABLE(
73  streamio,
74  [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
75  ,
76  [enable_streamio=no])
77
78AC_ARG_ENABLE(
79  assertions,
80  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
81  ,
82  enable_assertions=yes)
83
84AC_ARG_ENABLE(
85  timing,
86  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
87  ,
88  enable_timing=no)
89
90AC_ARG_ENABLE(
91  debugoutput,
92  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
93  ,
94  enable_debugoutput=no)
95
96AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [build the debugging version of the libraries]),
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
103#
104# - check for CC and CXX but be careful about CFLAGS.
105#
106test "${CFLAGS+set}" = set || cflags_expl_set=no
107AC_PROG_CC
108test "${CXXFLAGS+set}" = set || cxxflags_expl_set=no
109AC_PROG_CXX
110if test "x$GCC" != xyes && test "x$GXX" != xyes; then
111  AC_MSG_WARN(you better use gcc to compile Factory)
112else
113  if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
114    AC_MSG_WARN([we use \`' as default for \`CXXFLAGS'
115                    (instead of the configure default \`-g -O')])
116  fi
117  if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
118    AC_MSG_WARN([we use \`' as default for \`CFLAGS'
119                    (instead of the configure default \`-g -O')])
120  fi
121fi
122
123#
124# - check for some other programs.
125#
126AC_PROG_CPP
127AC_PROG_CXXCPP
128AC_PROG_LN_S
129AC_PROG_INSTALL
130AC_DISABLE_STATIC
131LT_INIT
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)
136AC_CHECK_SIZEOF(long,4)
137AC_C_CONST
138AC_C_INLINE
139
140AH_TEMPLATE([INT64], [Defenition for INT64])
141# Always long long int???!
142AC_DEFINE([INT64], [long long int]) 
143
144DX_INIT_DOXYGEN($PACKAGE_NAME, MYDOXYGENCONFIG)
145
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
152save_path="$PATH"
153PATH="$PATH:$srcdir/bin"
154AC_PATH_PROG(FACTORY_MKINSTALLDIRS, mkinstalldirs, -mkdir)
155PATH="$srcdir/bin:$save_path"
156AC_PATH_PROG(FACTORY_MAKEHEADER, makeheader)
157PATH="$save_path"
158
159#
160# - expand paths.
161#
162
163AC_MSG_CHECKING(and generating explicit install paths)
164
165# generate Makefile
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"
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
182done
183prefix="$save_prefix"
184exec_prefix="$save_exec_prefix"
185
186# generate the explicit paths
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`
193
194# clean up
195rm -f ./conftest.mk ./conftest.dir
196
197AC_MSG_RESULT(done)
198
199#
200# - check for libraries.
201#
202AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
203
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)]))
207
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)]))
209
210# arithmetic shift
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
222
223#
224# - check for header files.
225#
226AC_LANG_CPLUSPLUS
227
228AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
229  [ AC_MSG_ERROR(C header files not found) ])
230AC_CHECK_HEADERS(cstdio)
231
232if test "x$enable_streamio" != xno; then
233  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
234  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
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
238  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
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)) ])
242fi
243
244if test "x$enable_timing" != xno; then
245  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
246    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
247                  \`configure --disable-timing') ])
248fi
249
250# font-lock-trick: '
251
252#
253# - check for compiler characteristics.
254#
255
256# use C to check compiler characteristics instead of C++.  On
257# nextstep, checking with C++ may fail.
258AC_LANG_C
259
260# cross-compiling ?!
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
269
270# font-lock-trick: '
271
272#
273# - paths.
274#
275
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'
279explicit_gftabledir="$explicit_datadir/gftables"
280
281# for installation of the templates
282templatedir='${includedir}/templates'
283
284#
285# - the name of the game and the targets to create.
286#
287if test "x$with_Singular" = xyes; then
288  libfactory=libfactory.a
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
303  installtargets=installcf
304  uninstalltargets=uninstallcf
305fi
306
307#
308# - set defines and variables according to our tests.
309#
310
311# CFLAGS
312if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
313  CFLAGS=""
314fi
315
316# CXXFLAGS
317if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
318  CXXFLAGS=""
319
320AC_LANG_SAVE
321AC_LANG_CPLUSPLUS
322# check whether CXX accepts -fno-rtti
323AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
324tmp_flags=${CXXFLAGS}
325CXXFLAGS="${CXXFLAGS}"
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
332CXXFLAGS="$CXXFLAGS"
333fi
334
335AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
336tmp_flags=${CXXFLAGS}
337CXXFLAGS="${CXXFLAGS} -fno-exceptions"
338AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
339AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
340)
341AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
342CXXFLAGS=$tmp_flags
343if test "${ac_cv_cxx_have_exceptions}" = yes; then
344CXXFLAGS="$CXXFLAGS -fno-exceptions"
345fi
346AC_LANG_RESTORE
347
348fi
349
350# ARFLAGS
351test "${ARFLAGS+set}" = set || ARFLAGS=cr
352
353# M4FLAGS
354test "${M4FLAGS+set}" = set || M4FLAGS=
355
356AH_TEMPLATE([SINGULAR], [define if linked to Singular])
357AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
358AH_TEMPLATE([NOSTREAMIO],[DISABLE_GMP_CPP])
359
360# Singular
361if test "x$with_Singular" = xyes; then
362  AC_DEFINE([SINGULAR],[1]) 
363  AC_DEFINE([DISABLE_GMP_CPP],[1])
364  AC_DEFINE([NOSTREAMIO],[1])
365fi
366
367# arithmetic shift
368#if test "x$ac_cv_shift" = xyes; then   
369#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
370#fi
371
372AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
373
374if test "x$with_Singular" = xyes; then
375
376AC_MSG_CHECKING([whether to use omalloc/omalloc.h])
377if test "x$ENABLE_OMALLOC" = xyes; then
378  AC_MSG_RESULT(yes)
379 
380  if test "x$with_omalloc_dir" != "x"; then
381    OMALLOC_CFLAGS="-I${with_omalloc_dir}"
382  fi
383  if test "x$with_omalloc_extra_dir" != "x"; then
384    OMALLOC_CFLAGS="$OMALLOC_CFLAGS -I${with_omalloc_extra_dir}"
385    OMALLOC_LDFLAGS="$OMALLOC_LDFLAGS -L${with_omalloc_extra_dir}/omalloc -L${with_omalloc_extra_dir}/findexec"
386  fi
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]))
393  else
394    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_WARN([trusting the omalloc locations given: ${OMALLOC_CFLAGS}]))
395  fi
396  CPPFLAGS="$CPPFLAGS_save"
397
398  OMALLOC_G_LDADD="-lfindexec_g -lomalloc_g"
399  OMALLOC_R_LDADD="-lfindexec -lomalloc"
400 
401  AC_DEFINE(HAVE_OMALLOC, 1, [omalloc support])
402 
403  AC_SUBST(OMALLOC_CFLAGS)
404  AC_SUBST(OMALLOC_LDFLAGS)
405
406  AC_SUBST(OMALLOC_G_LDADD)
407  AC_SUBST(OMALLOC_R_LDADD)
408else
409  AC_MSG_RESULT(no)
410fi
411
412fi
413
414AM_CONDITIONAL([ENABLE_OMALLOC],[test "x$ENABLE_OMALLOC" = xyes])
415
416
417AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
418# "configurable inline methods"
419if test "x$enable_cf_inline" != xno; then
420  AC_DEFINE([CF_USE_INLINE],[1])
421fi
422
423AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
424# iostream
425if test "x$enable_streamio" = xno; then
426  AC_DEFINE([NOSTREAMIO],[1])
427else
428  factorysrc="$factorysrc \$(useiofactorysrc)"
429  factoryincl="$factoryincl \$(useiofactoryincl)"
430fi
431
432AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
433# assertions
434if test "x$enable_assertions" = xno; then
435  AC_DEFINE([NOASSERT],[1])
436fi
437
438AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
439# timing
440if test "x$enable_timing" != xno; then
441  AC_DEFINE([TIMING],[1])
442fi
443
444# debugoutput
445AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
446if test "x$enable_debugoutput" != xno; then
447  AC_DEFINE([DEBUGOUTPUT],[1]) 
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)
461AC_SUBST(M4FLAGS)
462AC_SUBST(MAKEHEADERFLAGS)
463
464AC_SUBST(factorysrc)
465AC_SUBST(factoryincl)
466
467AC_SUBST(alltargets)
468AC_SUBST(installtargets)
469AC_SUBST(uninstalltargets)
470
471AH_TEMPLATE([FACTORYVERSION], [factory version])
472AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
473
474AH_TEMPLATE([HAVE_LIBFAC], [have libfac])
475AC_DEFINE_UNQUOTED([HAVE_LIBFAC], 1)
476
477AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
478AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
479
480AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
481AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
482
483AM_CONDITIONAL(
484    [WITH_PARSER_FOR_CANONICAL_FORM],
485    [test x$with_Singular != xyes && test x$enable_streamio != xno])
486
487AC_CONFIG_FILES([Makefile include/factory/Makefile libfac/Makefile]) #  ftest/GNUmakefile
488AC_OUTPUT
489
Note: See TracBrowser for help on using the repository browser.