source: git/factory/configure.ac @ b7fca4

fieker-DuValspielwiese
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
RevLine 
[429497]1
[8e8aca3]2dnl # emacs edit mode for this file is -*- sh -*-
[575680]3
[a013ed]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 #
[beca7c]11
12#
13# - initialisation.
14#
[181331]15AC_INIT([factory], [4.3.0])
[e76d7a6]16AC_CONFIG_SRCDIR(canonicalform.cc)
[9af8a63]17AC_CONFIG_MACRO_DIR([../m4])
[36cf22]18AC_CONFIG_AUX_DIR([../build-aux])
[0c26a1]19AC_CONFIG_HEADER([_config.h])
[ab788d]20
[24a77fb]21AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
[25761d]22m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
[280286e]23m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
[2e984a]24
[2be649e]25AM_MAINTAINER_MODE([enable])
[ea5f3f6]26
[e08559]27# Add pre'prefixed config
[996cc8]28AX_PREFIX_CONFIG_H([config.h],[],[_config.h])
[e08559]29
[7d160bb]30#
31# - check for CC and CXX but be careful about CFLAGS.
32#
[9b51ea]33AC_CHECK_SIZEOF(long,4)
[7d160bb]34SING_RESET_FLAGS()
35SING_CHECK_SET_ARGS()
36
[ea5f3f6]37#AC_PROG_CC
38#AC_PROG_CXX
[7d160bb]39#
40# - check for some other programs.
41#
42AC_PROG_CPP
43AC_PROG_CXXCPP
44AC_PROG_LN_S
45AC_PROG_INSTALL
[82e0a7]46## AC_DISABLE_STATIC
[7d160bb]47AC_PROG_YACC
[3b7b36]48LT_INIT([win32-dll])
[7d160bb]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
[3b7b36]58SING_WIN_FLAGS
59
60
[beca7c]61#
62# - check withs and enables.
63#
[1cdedcb]64AC_ARG_ENABLE(
65  cf-inline,
[423027]66  [AS_HELP_STRING([--disable-cf-inline],[build Factory with \"configurable inline methods\" disabled.])],
[e4fe2b]67  [enable_cf_inline=$enableval],
[423027]68  [enable_cf_inline=yes])
[1cdedcb]69
[beca7c]70AC_ARG_ENABLE(
71  assertions,
[ff3a4f]72  [AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
[beca7c]73  ,
[ff3a4f]74  enable_assertions=yes)
[beca7c]75
76AC_ARG_ENABLE(
77  timing,
[e4fe2b]78  [AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
[575680]79  ,
[beca7c]80  enable_timing=no)
81
82AC_ARG_ENABLE(
83  debugoutput,
[e4fe2b]84  [AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
[575680]85  ,
[beca7c]86  enable_debugoutput=no)
87
[37e66f]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
[75f460]112  AC_DEFINE([SINGULAR],[1])
[37e66f]113  AC_DEFINE([DISABLE_GMP_CPP],[1])
[37a11e]114#  AC_DEFINE([NOSTREAMIO],[1])
[37e66f]115fi
116
[37a11e]117# || test "x$with_Singular" = xyes
[37e66f]118# Use no streamio (C++) if SINGULAR or explicitely disabled
[37a11e]119if test "x$enable_streamio" = xno;  then
[37e66f]120  AC_DEFINE([NOSTREAMIO],[1])
121fi
122
123AM_CONDITIONAL(
[75f460]124    [WITH_PARSER_FOR_CANONICAL_FORM],
[37a11e]125    [test "x$enable_streamio" = xyes])
[37e66f]126
[a3a6a0]127AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libsingular_resources] )
128AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libsingular_resources] )
[37e66f]129
[a3a6a0]130AC_MSG_CHECKING(whether libsingular_resources should be used)
[37e66f]131if test "x$with_Singular" = xyes;
[75f460]132then
[37e66f]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
[a3a6a0]141  PKG_REQUIRE="$PKG_REQUIRE singular_resources"
[37e66f]142  AC_SUBST(PKG_REQUIRE)
143else
144  AC_MSG_RESULT(no)
[75f460]145fi
[37e66f]146
147AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$with_Singular" = xyes])
148
149
[815c08]150DX_INIT_DOXYGEN($PACKAGE_NAME, doxygen.cfg, $srcdir/docu)
[beca7c]151
[64f32c7]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.
[a38e457]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"
[726f4d]164
165#
166# - expand paths.
167#
168
[a38e457]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"
[726f4d]191
[413cbb]192# generate the explicit paths
[a38e457]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`
[726f4d]199
[413cbb]200# clean up
[a38e457]201#rm -f ./conftest.mk ./conftest.dir
[726f4d]202
[a38e457]203#AC_MSG_RESULT(done)
[beca7c]204
205#
206# - check for libraries.
207#
[20d724f]208AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
209
[24438cc]210# Check whether --with-gmp was given.
[585444a]211SING_CHECK_GMP
[409d930]212
[03b6ed]213#NTL 9.6.4 requires -lpthread/-pthread
[4d8cea]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)
[03b6ed]218AC_SEARCH_LIBS(sem_wait,[rt pthreads pthread],[],[
219  AC_MSG_ERROR([sem_wait not found in rt,pthreads,pthread])
220])
221
[9af8a63]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)]))
[beca7c]223
[d00f4f]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)]))
[97a059]225
[b46fb9]226# arithmetic shift
[1bc850]227#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
228#AC_CACHE_VAL(ac_cv_shift,
229#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
[0c26a1]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) ])
[75f460]233#if test "x$ac_cv_shift" = xyes; then
[1bc850]234#  AC_MSG_RESULT(yes)
235#else
236#  AC_MSG_RESULT(no)
237#fi
[b46fb9]238
[beca7c]239#
240# - check for header files.
241#
[0c26a1]242AC_LANG_CPLUSPLUS
[37a11e]243AC_LANG_PUSH([C++])
[beca7c]244
[43b476]245AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
[9d50d3]246  [ AC_MSG_ERROR(C header files not found) ])
[958fc4]247AC_CHECK_HEADERS(cstdio)
[beca7c]248
[37a11e]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
[beca7c]262if test "x$enable_timing" != xno; then
263  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
[5e1678b]264    [ AC_MSG_ERROR(sys/times.h or sys/param.h not found, try --disable-timing) ])
[beca7c]265fi
266
[a013ed]267# font-lock-trick: '
268
[beca7c]269#
270# - check for compiler characteristics.
271#
272
[654824]273# use C to check compiler characteristics instead of C++.  On
274# nextstep, checking with C++ may fail.
[0c26a1]275# AC_LANG_C
[654824]276
[575680]277# cross-compiling ?!
[0c26a1]278#AC_C_CROSS
[7f7d55f]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
[beca7c]286
[a013ed]287# font-lock-trick: '
288
[beca7c]289#
290# - paths.
291#
292
[726f4d]293# note that Singular has its own mechanism to search the tables,
294# hence we do not need to mind it here
[a38e457]295#gftabledir='${datadir}/factory/gftables'
296#explicit_gftabledir="$explicit_datadir/gftables"
[beca7c]297
[726f4d]298# for installation of the templates
[a38e457]299#templatedir='${includedir}/templates'
[beca7c]300
301#
[6e304e3]302# - set defines and variables according to our tests.
[beca7c]303#
304
[a38e457]305## CFLAGS
306#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
307#  CFLAGS=""
308#fi
[beca7c]309
310# CXXFLAGS
[a38e457]311#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
312#  CXXFLAGS=""
313#
314#AC_LANG_SAVE
[0c26a1]315#AC_LANG_CPLUSPLUS
[8c0b57]316# check whether CXX accepts -fno-rtti
[a38e457]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,
[0c26a1]321#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
[a38e457]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,
[0c26a1]332#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
[a38e457]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
[beca7c]342
343# ARFLAGS
[a38e457]344#test "${ARFLAGS+set}" = set || ARFLAGS=cr
[beca7c]345
[9d50d3]346# M4FLAGS
[a38e457]347#test "${M4FLAGS+set}" = set || M4FLAGS=
[9d50d3]348
[beca7c]349# arithmetic shift
[75f460]350#if test "x$ac_cv_shift" = xyes; then
[e76d7a6]351#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
[1bc850]352#fi
[beca7c]353
[089d1f]354AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
[1cdedcb]355# "configurable inline methods"
356if test "x$enable_cf_inline" != xno; then
[089d1f]357  AC_DEFINE([CF_USE_INLINE],[1])
[1cdedcb]358fi
359
[089d1f]360AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
[beca7c]361# assertions
362if test "x$enable_assertions" = xno; then
[089d1f]363  AC_DEFINE([NOASSERT],[1])
[beca7c]364fi
365
[089d1f]366AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
[beca7c]367# timing
368if test "x$enable_timing" != xno; then
[089d1f]369  AC_DEFINE([TIMING],[1])
[beca7c]370fi
371
372# debugoutput
[089d1f]373AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
[beca7c]374if test "x$enable_debugoutput" != xno; then
[75f460]375  AC_DEFINE([DEBUGOUTPUT],[1])
[beca7c]376fi
377
378#
379# - complete and substitute variables, defines.
380#
[a38e457]381#AC_SUBST(gftabledir)
382#AC_SUBST(templatedir)
383
[beca7c]384
385
[a38e457]386# AC_SUBST(libfactory)
387
388#AC_SUBST(ARFLAGS)
389#AC_SUBST(M4FLAGS)
[beca7c]390
391AC_SUBST(MAKEHEADERFLAGS)
392
[a38e457]393#AC_SUBST(factorysrc)
394#AC_SUBST(factoryincl)
395
396#AC_SUBST(alltargets)
397#AC_SUBST(installtargets)
398#AC_SUBST(uninstalltargets)
[beca7c]399
[a38e457]400factory_configuration="'$ac_configure_args' in `pwd`"
[beca7c]401
[b67c34f]402AH_TEMPLATE([FACTORYVERSION], [VERSION])
403AC_DEFINE_UNQUOTED([FACTORYVERSION], "$VERSION")
[089d1f]404
[d2f9df]405AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
[089d1f]406AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
407
[a38e457]408#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
409#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
410
411
[beca7c]412
[1d7ea9]413AC_CONFIG_FILES([Makefile include/factory/Makefile factory.pc]) #  ftest/GNUmakefile
[c2eb2e]414AC_OUTPUT
[4eb485]415
Note: See TracBrowser for help on using the repository browser.