source: git/factory/configure.ac @ 68df85

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