source: git/factory/configure.ac @ 80c102

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