source: git/factory/configure.ac @ c0bbad

spielwiese
Last change on this file since c0bbad was c0bbad, checked in by Oleksandr Motsak <motsak@…>, 10 years ago
Minor BS cleanup
  • Property mode set to 100644
File size: 12.6 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.0])
16AC_CONFIG_SRCDIR(canonicalform.cc)
17AC_CONFIG_MACRO_DIR([../m4])
18AC_CONFIG_AUX_DIR([.])
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_WITH(
61  Singular,
62  [AS_HELP_STRING([--without-Singular],[build NOT for the use with CAS Singular.])],
63  ,
64  [with_Singular=yes])
65
66AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--enable-omalloc],[build for use with omalloc]),
67[if test "x$enableval" = "xyes"; then
68  ENABLE_OMALLOC=yes
69fi], ENABLE_OMALLOC=no)
70
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)
75
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="")
78
79AC_ARG_ENABLE(
80  cf-inline,
81  [AS_HELP_STRING([--enable-cf-inline],[build Factory with \"configurable inline methods\" enabled.])],
82  [enable_cf_inline=$enableval],
83  [enable_cf_inline=no])
84
85AC_ARG_ENABLE(
86  streamio,
87  [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
88  ,
89  [enable_streamio=no])
90
91AC_ARG_ENABLE(
92  assertions,
93  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
94  ,
95  enable_assertions=yes)
96
97AC_ARG_ENABLE(
98  timing,
99  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
100  ,
101  enable_timing=no)
102
103AC_ARG_ENABLE(
104  debugoutput,
105  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
106  ,
107  enable_debugoutput=no)
108
109AH_TEMPLATE([FACTORY_INT64], [Defenition for FACTORY_INT64])
110# Always long long int???!
111AC_DEFINE([FACTORY_INT64], [long long int]) 
112
113DX_INIT_DOXYGEN($PACKAGE_NAME, MYDOXYGENCONFIG)
114
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.
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"
127
128#
129# - expand paths.
130#
131
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"
154
155# generate the explicit paths
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`
162
163# clean up
164#rm -f ./conftest.mk ./conftest.dir
165
166#AC_MSG_RESULT(done)
167
168#
169# - check for libraries.
170#
171AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
172
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)]))
176
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)]))
178
179# arithmetic shift
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
191
192#
193# - check for header files.
194#
195AC_LANG_CPLUSPLUS
196
197AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
198  [ AC_MSG_ERROR(C header files not found) ])
199AC_CHECK_HEADERS(cstdio)
200
201if test "x$enable_streamio" != xno; then
202  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
203  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
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
207  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
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)) ])
211fi
212
213if test "x$enable_timing" != xno; then
214  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
215    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
216                  \`configure --disable-timing') ])
217fi
218
219# font-lock-trick: '
220
221#
222# - check for compiler characteristics.
223#
224
225# use C to check compiler characteristics instead of C++.  On
226# nextstep, checking with C++ may fail.
227# AC_LANG_C
228
229# cross-compiling ?!
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
238
239# font-lock-trick: '
240
241#
242# - paths.
243#
244
245# note that Singular has its own mechanism to search the tables,
246# hence we do not need to mind it here
247#gftabledir='${datadir}/factory/gftables'
248#explicit_gftabledir="$explicit_datadir/gftables"
249
250# for installation of the templates
251#templatedir='${includedir}/templates'
252
253#
254# - set defines and variables according to our tests.
255#
256
257## CFLAGS
258#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
259#  CFLAGS=""
260#fi
261
262# CXXFLAGS
263#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
264#  CXXFLAGS=""
265#
266#AC_LANG_SAVE
267#AC_LANG_CPLUSPLUS
268# check whether CXX accepts -fno-rtti
269#AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
270#tmp_flags=${CXXFLAGS}
271#CXXFLAGS="${CXXFLAGS}"
272#AC_CACHE_VAL(ac_cv_cxx_have_rtti,
273#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
274#)
275#AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
276#CXXFLAGS=$tmp_flags
277#if test "${ac_cv_cxx_have_rtti}" = yes; then
278#CXXFLAGS="$CXXFLAGS"
279#fi
280#AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
281#tmp_flags=${CXXFLAGS}
282#CXXFLAGS="${CXXFLAGS} -fno-exceptions"
283#AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
284#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
285#)
286#AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
287#CXXFLAGS=$tmp_flags
288#if test "${ac_cv_cxx_have_exceptions}" = yes; then
289#CXXFLAGS="$CXXFLAGS -fno-exceptions"
290#fi
291#AC_LANG_RESTORE
292#
293#fi
294
295# ARFLAGS
296#test "${ARFLAGS+set}" = set || ARFLAGS=cr
297
298# M4FLAGS
299#test "${M4FLAGS+set}" = set || M4FLAGS=
300
301AH_TEMPLATE([SINGULAR], [define if linked to Singular])
302AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
303AH_TEMPLATE([NOSTREAMIO],[DISABLE_GMP_CPP])
304
305# Singular
306if test "x$with_Singular" = xyes; then
307  AC_DEFINE([SINGULAR],[1]) 
308  AC_DEFINE([DISABLE_GMP_CPP],[1])
309  AC_DEFINE([NOSTREAMIO],[1])
310fi
311
312# arithmetic shift
313#if test "x$ac_cv_shift" = xyes; then   
314#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
315#fi
316
317AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
318
319AC_MSG_CHECKING([whether to use omalloc/omalloc.h])
320if test "x$ENABLE_OMALLOC" = xyes; then
321  AC_MSG_RESULT(yes)
322 
323  if test "x$with_omalloc_dir" != "x"; then
324    OMALLOC_CFLAGS="-I${with_omalloc_dir}"
325  fi
326  if test "x$with_omalloc_extra_dir" != "x"; then
327    OMALLOC_CFLAGS="$OMALLOC_CFLAGS -I${with_omalloc_extra_dir}"
328    OMALLOC_LDFLAGS="$OMALLOC_LDFLAGS -L${with_omalloc_extra_dir}/omalloc"
329  fi
330 
331  CPPFLAGS_save="$CPPFLAGS"
332  # adding $with_omalloc_dir and $with_omalloc_extra_dir to header search path
333  CPPFLAGS="$CPPFLAGS ${OMALLOC_CFLAGS}"
334  if test "x$omalloc_trust" = xno; then
335    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_ERROR([You asked for omalloc but it cannot be found with your default header search path]))
336  else
337    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_WARN([trusting the omalloc locations given: ${OMALLOC_CFLAGS}]))
338  fi
339  CPPFLAGS="$CPPFLAGS_save"
340
341#  OMALLOC_G_LDADD="-lresources_g -lomalloc_g"
342  OMALLOC_R_LDADD="-lomalloc"
343
344  AC_DEFINE(HAVE_OMALLOC, 1, [omalloc support])
345 
346  AC_SUBST(OMALLOC_CFLAGS)
347  AC_SUBST(OMALLOC_LDFLAGS)
348
349#  AC_SUBST(OMALLOC_G_LDADD)
350  AC_SUBST(OMALLOC_R_LDADD)
351else
352  AC_MSG_RESULT(no)
353fi
354
355if test "x$ENABLE_OMALLOC" = xyes && test "x$with_Singular" = xyes; then
356  RESOURCES_LDFLAGS="$RESOURCES_LDFLAGS -L${with_omalloc_dir}/resources -L${with_omalloc_extra_dir}/resources -lresources "
357  AC_SUBST(RESOURCES_LDFLAGS)
358fi 
359
360AM_CONDITIONAL([ENABLE_OMALLOC],[test "x$ENABLE_OMALLOC" = xyes])
361
362
363AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
364# "configurable inline methods"
365if test "x$enable_cf_inline" != xno; then
366  AC_DEFINE([CF_USE_INLINE],[1])
367fi
368
369AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
370# iostream
371if test "x$enable_streamio" = xno; then
372  AC_DEFINE([NOSTREAMIO],[1])
373#else
374#  factorysrc="$factorysrc \$(useiofactorysrc)"
375#  factoryincl="$factoryincl \$(useiofactoryincl)"
376fi
377
378AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
379# assertions
380if test "x$enable_assertions" = xno; then
381  AC_DEFINE([NOASSERT],[1])
382fi
383
384AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
385# timing
386if test "x$enable_timing" != xno; then
387  AC_DEFINE([TIMING],[1])
388fi
389
390# debugoutput
391AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
392if test "x$enable_debugoutput" != xno; then
393  AC_DEFINE([DEBUGOUTPUT],[1]) 
394fi
395
396#
397# - complete and substitute variables, defines.
398#
399#AC_SUBST(gftabledir)
400#AC_SUBST(templatedir)
401
402
403
404# AC_SUBST(libfactory)
405
406#AC_SUBST(ARFLAGS)
407#AC_SUBST(M4FLAGS)
408
409AC_SUBST(MAKEHEADERFLAGS)
410
411#AC_SUBST(factorysrc)
412#AC_SUBST(factoryincl)
413
414#AC_SUBST(alltargets)
415#AC_SUBST(installtargets)
416#AC_SUBST(uninstalltargets)
417
418factory_version="4.0.0"
419factory_configuration="'$ac_configure_args' in `pwd`"
420AC_SUBST(factory_version)
421
422AH_TEMPLATE([FACTORYVERSION], [factory version])
423AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
424
425AH_TEMPLATE([HAVE_LIBFAC], [have libfac])
426AC_DEFINE_UNQUOTED([HAVE_LIBFAC], 1)
427
428AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
429AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
430
431#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
432#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
433
434
435
436AM_CONDITIONAL(
437    [WITH_PARSER_FOR_CANONICAL_FORM],
438    [test x$with_Singular != xyes && test x$enable_streamio != xno])
439
440AC_CONFIG_FILES([Makefile include/factory/Makefile libfac/Makefile factory.pc]) #  ftest/GNUmakefile
441AC_OUTPUT
442
Note: See TracBrowser for help on using the repository browser.