source: git/factory/configure.ac @ fd68165

jengelh-datetimespielwiese
Last change on this file since fd68165 was fd68165, checked in by Janko Boehm <boehm@…>, 9 years ago
Fixed name conflict INT64 and wrong type
  • Property mode set to 100644
File size: 12.9 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_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
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# - the name of the game and the targets to create.
255#
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
275
276#
277# - set defines and variables according to our tests.
278#
279
280## CFLAGS
281#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
282#  CFLAGS=""
283#fi
284
285# CXXFLAGS
286#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
287#  CXXFLAGS=""
288#
289#AC_LANG_SAVE
290#AC_LANG_CPLUSPLUS
291# check whether CXX accepts -fno-rtti
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
317
318# ARFLAGS
319#test "${ARFLAGS+set}" = set || ARFLAGS=cr
320
321# M4FLAGS
322#test "${M4FLAGS+set}" = set || M4FLAGS=
323
324AH_TEMPLATE([SINGULAR], [define if linked to Singular])
325AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
326AH_TEMPLATE([NOSTREAMIO],[DISABLE_GMP_CPP])
327
328# Singular
329if test "x$with_Singular" = xyes; then
330  AC_DEFINE([SINGULAR],[1]) 
331  AC_DEFINE([DISABLE_GMP_CPP],[1])
332  AC_DEFINE([NOSTREAMIO],[1])
333fi
334
335# arithmetic shift
336#if test "x$ac_cv_shift" = xyes; then   
337#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
338#fi
339
340AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
341
342if test "x$with_Singular" = xyes; then
343
344AC_MSG_CHECKING([whether to use omalloc/omalloc.h])
345if test "x$ENABLE_OMALLOC" = xyes; then
346  AC_MSG_RESULT(yes)
347 
348  if test "x$with_omalloc_dir" != "x"; then
349    OMALLOC_CFLAGS="-I${with_omalloc_dir}"
350  fi
351  if test "x$with_omalloc_extra_dir" != "x"; then
352    OMALLOC_CFLAGS="$OMALLOC_CFLAGS -I${with_omalloc_extra_dir}"
353    OMALLOC_LDFLAGS="$OMALLOC_LDFLAGS -L${with_omalloc_extra_dir}/omalloc -L${with_omalloc_extra_dir}/resources"
354  fi
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]))
361  else
362    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_WARN([trusting the omalloc locations given: ${OMALLOC_CFLAGS}]))
363  fi
364  CPPFLAGS="$CPPFLAGS_save"
365
366#  OMALLOC_G_LDADD="-lresources_g -lomalloc_g"
367  OMALLOC_R_LDADD="-lresources -lomalloc"
368 
369  AC_DEFINE(HAVE_OMALLOC, 1, [omalloc support])
370 
371  AC_SUBST(OMALLOC_CFLAGS)
372  AC_SUBST(OMALLOC_LDFLAGS)
373
374#  AC_SUBST(OMALLOC_G_LDADD)
375  AC_SUBST(OMALLOC_R_LDADD)
376else
377  AC_MSG_RESULT(no)
378fi
379
380fi
381
382AM_CONDITIONAL([ENABLE_OMALLOC],[test "x$ENABLE_OMALLOC" = xyes])
383
384
385AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
386# "configurable inline methods"
387if test "x$enable_cf_inline" != xno; then
388  AC_DEFINE([CF_USE_INLINE],[1])
389fi
390
391AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
392# iostream
393if test "x$enable_streamio" = xno; then
394  AC_DEFINE([NOSTREAMIO],[1])
395#else
396#  factorysrc="$factorysrc \$(useiofactorysrc)"
397#  factoryincl="$factoryincl \$(useiofactoryincl)"
398fi
399
400AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
401# assertions
402if test "x$enable_assertions" = xno; then
403  AC_DEFINE([NOASSERT],[1])
404fi
405
406AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
407# timing
408if test "x$enable_timing" != xno; then
409  AC_DEFINE([TIMING],[1])
410fi
411
412# debugoutput
413AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
414if test "x$enable_debugoutput" != xno; then
415  AC_DEFINE([DEBUGOUTPUT],[1]) 
416fi
417
418#
419# - complete and substitute variables, defines.
420#
421#AC_SUBST(gftabledir)
422#AC_SUBST(templatedir)
423
424
425
426# AC_SUBST(libfactory)
427
428#AC_SUBST(ARFLAGS)
429#AC_SUBST(M4FLAGS)
430
431AC_SUBST(MAKEHEADERFLAGS)
432
433#AC_SUBST(factorysrc)
434#AC_SUBST(factoryincl)
435
436#AC_SUBST(alltargets)
437#AC_SUBST(installtargets)
438#AC_SUBST(uninstalltargets)
439
440factory_version="3.1.3"
441factory_configuration="'$ac_configure_args' in `pwd`"
442AC_SUBST(factory_version)
443
444AH_TEMPLATE([FACTORYVERSION], [factory version])
445AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
446
447AH_TEMPLATE([HAVE_LIBFAC], [have libfac])
448AC_DEFINE_UNQUOTED([HAVE_LIBFAC], 1)
449
450AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
451AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
452
453#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
454#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
455
456
457
458AM_CONDITIONAL(
459    [WITH_PARSER_FOR_CANONICAL_FORM],
460    [test x$with_Singular != xyes && test x$enable_streamio != xno])
461
462AC_CONFIG_FILES([Makefile include/factory/Makefile libfac/Makefile]) #  ftest/GNUmakefile
463AC_OUTPUT
464
Note: See TracBrowser for help on using the repository browser.