source: git/factory/configure.ac @ b7fca4

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