source: git/factory/configure.ac @ f7ced6

spielwiese
Last change on this file since f7ced6 was f7ced6, checked in by Hans Schoenemann <hannes@…>, 10 years ago
version 4-0-1
  • Property mode set to 100644
File size: 10.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], [4.0.1])
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_ENABLE(
61  cf-inline,
62  [AS_HELP_STRING([--enable-cf-inline],[build Factory with \"configurable inline methods\" enabled.])],
63  [enable_cf_inline=$enableval],
64  [enable_cf_inline=no])
65
66AC_ARG_ENABLE(
67  assertions,
68  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
69  ,
70  enable_assertions=yes)
71
72AC_ARG_ENABLE(
73  timing,
74  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
75  ,
76  enable_timing=no)
77
78AC_ARG_ENABLE(
79  debugoutput,
80  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
81  ,
82  enable_debugoutput=no)
83
84AC_ARG_ENABLE(
85  streamio,
86  [AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
87  ,
88  [enable_streamio=no])
89
90AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
91
92AC_ARG_WITH(
93  Singular,
94  [AS_HELP_STRING([--without-Singular],[(obsolete) build NOT for the use with CAS Singular.])],
95  ,
96  [with_Singular=yes])
97
98PKG_REQUIRE="$PKG_REQUIRE"
99AC_SUBST(PKG_REQUIRE)
100
101SING_CHECK_OMALLOC()
102
103AH_TEMPLATE([SINGULAR], [define if linked to Singular])
104AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
105
106# Singular
107if test "x$with_Singular" = xyes; then
108  AC_DEFINE([SINGULAR],[1]) 
109  AC_DEFINE([DISABLE_GMP_CPP],[1])
110  AC_DEFINE([NOSTREAMIO],[1])
111fi
112
113# Use no streamio (C++) if SINGULAR or explicitely disabled
114if test "x$enable_streamio" = xno || test "x$with_Singular" = xyes;  then
115  AC_DEFINE([NOSTREAMIO],[1])
116else
117  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
118  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
119
120  # since the FTE will compile only with stream IO enabled we will not
121  # check for the necessary header files if stream IO is disabled
122  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
123    [ AC_MSG_WARN(C/C++ header files not found.
124                    You will not be able to build the Factory Test Environment
125                    (though Factory itself should compile)) ])
126fi
127
128AM_CONDITIONAL(
129    [WITH_PARSER_FOR_CANONICAL_FORM],
130    [test x$with_Singular != xyes && test x$enable_streamio != xno])
131
132AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libresources] )
133AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libresources] )
134
135AC_MSG_CHECKING(whether libresources should be used)
136if test "x$with_Singular" = xyes;
137then 
138  AC_MSG_RESULT(yes)
139
140  AC_MSG_CHECKING([  RESOURCES_INCLUDES?..])
141  AC_MSG_RESULT(${RESOURCES_INCLUDES:-unset})
142
143  AC_MSG_CHECKING([  RESOURCES_LIBS?..])
144  AC_MSG_RESULT(${RESOURCES_LIBS:-unset})
145
146  PKG_REQUIRE="$PKG_REQUIRE resources"
147  AC_SUBST(PKG_REQUIRE)
148else
149  AC_MSG_RESULT(no)
150fi 
151
152AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$with_Singular" = xyes])
153
154
155AH_TEMPLATE([FACTORY_INT64], [Defenition for FACTORY_INT64])
156# Always long long int???!
157AC_DEFINE([FACTORY_INT64], [long long int]) 
158
159DX_INIT_DOXYGEN($PACKAGE_NAME, doxygen.cfg, $srcdir/docu)
160
161# do not use `MKINSTALLDIRS' and `MAKEHEADER' since there may be
162# name clashes with other peoples configure scripts via
163# `config.cache'.  Furthermore, we do not use cache at all to
164# avoid some nasty problems with our own development environment.
165#unset ac_cv_path_FACTORY_MKINSTALLDIRS
166#unset ac_cv_path_FACTORY_MAKEHEADER
167#save_path="$PATH"
168#PATH="$PATH:$srcdir/bin"
169#AC_PATH_PROG(FACTORY_MKINSTALLDIRS, mkinstalldirs, -mkdir)
170#PATH="$srcdir/bin:$save_path"
171#AC_PATH_PROG(FACTORY_MAKEHEADER, makeheader)
172#PATH="$save_path"
173
174#
175# - expand paths.
176#
177
178#AC_MSG_CHECKING(and generating explicit install paths)
179
180## generate Makefile
181#save_prefix="$prefix"
182#save_exec_prefix="$exec_prefix"
183#test "x$prefix" = xNONE && prefix=$ac_default_prefix
184#test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
185#for dir in prefix exec_prefix bindir sbindir libexecdir \
186#          datadir sysconfdir sharedstatedir localstatedir libdir \
187#          includedir oldincludedir infodir mandir; do
188#  eval "dir_value=\$$dir"
189#  cat >> ./conftest.mk << EXPLPATHEOT
190#$dir=$dir_value
191#explicit_$dir:
192#       @ echo \$($dir)
193#       @ if echo \$($dir) | grep '^/'; \\
194#       then echo \$($dir) > ./conftest.dir; \\
195#       else echo \`pwd\`/\$($dir) > ./conftest.dir; fi
196#EXPLPATHEOT
197#done
198#prefix="$save_prefix"
199#exec_prefix="$save_exec_prefix"
200
201# generate the explicit paths
202#make >&5 2>&1 -f ./conftest.mk explicit_datadir
203#explicit_datadir=`cat ./conftest.dir`
204#make >&5 2>&1 -f ./conftest.mk explicit_libdir
205#explicit_libdir=`cat ./conftest.dir`
206#make >&5 2>&1 -f ./conftest.mk explicit_includedir
207#explicit_includedir=`cat ./conftest.dir`
208
209# clean up
210#rm -f ./conftest.mk ./conftest.dir
211
212#AC_MSG_RESULT(done)
213
214#
215# - check for libraries.
216#
217AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
218
219LB_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)]))
220
221LB_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)]))
222
223LB_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)]))
224
225# arithmetic shift
226#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
227#AC_CACHE_VAL(ac_cv_shift,
228#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
229#       AC_TRY_RUN(
230#      [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
231#      ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
232#if test "x$ac_cv_shift" = xyes; then   
233#  AC_MSG_RESULT(yes)
234#else
235#  AC_MSG_RESULT(no)
236#fi
237
238#
239# - check for header files.
240#
241AC_LANG_CPLUSPLUS
242
243AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
244  [ AC_MSG_ERROR(C header files not found) ])
245AC_CHECK_HEADERS(cstdio)
246
247if test "x$enable_timing" != xno; then
248  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
249    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
250                  \`configure --disable-timing') ])
251fi
252
253# font-lock-trick: '
254
255#
256# - check for compiler characteristics.
257#
258
259# use C to check compiler characteristics instead of C++.  On
260# nextstep, checking with C++ may fail.
261# AC_LANG_C
262
263# cross-compiling ?!
264#AC_C_CROSS
265#if test "x$cross_compiling" = xyes; then
266#  AC_MSG_WARN([you better specify a cache file to get the values for
267#                    cross-compiling right (e.g., call \`configure
268#                    --cache-file=yourTarget.cache').  In particular, you
269#                    should make sure that your target machine supports
270#                    arithmetic shift.])
271#fi
272
273# font-lock-trick: '
274
275#
276# - paths.
277#
278
279# note that Singular has its own mechanism to search the tables,
280# hence we do not need to mind it here
281#gftabledir='${datadir}/factory/gftables'
282#explicit_gftabledir="$explicit_datadir/gftables"
283
284# for installation of the templates
285#templatedir='${includedir}/templates'
286
287#
288# - set defines and variables according to our tests.
289#
290
291## CFLAGS
292#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
293#  CFLAGS=""
294#fi
295
296# CXXFLAGS
297#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
298#  CXXFLAGS=""
299#
300#AC_LANG_SAVE
301#AC_LANG_CPLUSPLUS
302# check whether CXX accepts -fno-rtti
303#AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
304#tmp_flags=${CXXFLAGS}
305#CXXFLAGS="${CXXFLAGS}"
306#AC_CACHE_VAL(ac_cv_cxx_have_rtti,
307#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
308#)
309#AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
310#CXXFLAGS=$tmp_flags
311#if test "${ac_cv_cxx_have_rtti}" = yes; then
312#CXXFLAGS="$CXXFLAGS"
313#fi
314#AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
315#tmp_flags=${CXXFLAGS}
316#CXXFLAGS="${CXXFLAGS} -fno-exceptions"
317#AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
318#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
319#)
320#AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
321#CXXFLAGS=$tmp_flags
322#if test "${ac_cv_cxx_have_exceptions}" = yes; then
323#CXXFLAGS="$CXXFLAGS -fno-exceptions"
324#fi
325#AC_LANG_RESTORE
326#
327#fi
328
329# ARFLAGS
330#test "${ARFLAGS+set}" = set || ARFLAGS=cr
331
332# M4FLAGS
333#test "${M4FLAGS+set}" = set || M4FLAGS=
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([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
341# "configurable inline methods"
342if test "x$enable_cf_inline" != xno; then
343  AC_DEFINE([CF_USE_INLINE],[1])
344fi
345
346AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
347# assertions
348if test "x$enable_assertions" = xno; then
349  AC_DEFINE([NOASSERT],[1])
350fi
351
352AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
353# timing
354if test "x$enable_timing" != xno; then
355  AC_DEFINE([TIMING],[1])
356fi
357
358# debugoutput
359AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
360if test "x$enable_debugoutput" != xno; then
361  AC_DEFINE([DEBUGOUTPUT],[1]) 
362fi
363
364#
365# - complete and substitute variables, defines.
366#
367#AC_SUBST(gftabledir)
368#AC_SUBST(templatedir)
369
370
371
372# AC_SUBST(libfactory)
373
374#AC_SUBST(ARFLAGS)
375#AC_SUBST(M4FLAGS)
376
377AC_SUBST(MAKEHEADERFLAGS)
378
379#AC_SUBST(factorysrc)
380#AC_SUBST(factoryincl)
381
382#AC_SUBST(alltargets)
383#AC_SUBST(installtargets)
384#AC_SUBST(uninstalltargets)
385
386factory_version="4.0.1"
387factory_configuration="'$ac_configure_args' in `pwd`"
388AC_SUBST(factory_version)
389
390AH_TEMPLATE([FACTORYVERSION], [factory version])
391AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
392
393AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
394AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
395
396#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
397#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
398
399
400
401AC_CONFIG_FILES([Makefile include/factory/Makefile factory.pc]) #  ftest/GNUmakefile
402AC_OUTPUT
403
Note: See TracBrowser for help on using the repository browser.