source: git/factory/configure.ac @ d187ac

fieker-DuValspielwiese
Last change on this file since d187ac was 61fc1e, checked in by Hans Schoenemann <hannes@…>, 7 years ago
Merge pull request #808 from embray/cygwin/shared Allow libSingular and associated libraries to be built as shared libraries on Cygwin
  • 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.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#
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
149AH_TEMPLATE([FACTORY_INT64], [Defenition for FACTORY_INT64])
150# Always long long int???!
151AC_DEFINE([FACTORY_INT64], [long long int])
152
153DX_INIT_DOXYGEN($PACKAGE_NAME, doxygen.cfg, $srcdir/docu)
154
155# do not use `MKINSTALLDIRS' and `MAKEHEADER' since there may be
156# name clashes with other peoples configure scripts via
157# `config.cache'.  Furthermore, we do not use cache at all to
158# avoid some nasty problems with our own development environment.
159#unset ac_cv_path_FACTORY_MKINSTALLDIRS
160#unset ac_cv_path_FACTORY_MAKEHEADER
161#save_path="$PATH"
162#PATH="$PATH:$srcdir/bin"
163#AC_PATH_PROG(FACTORY_MKINSTALLDIRS, mkinstalldirs, -mkdir)
164#PATH="$srcdir/bin:$save_path"
165#AC_PATH_PROG(FACTORY_MAKEHEADER, makeheader)
166#PATH="$save_path"
167
168#
169# - expand paths.
170#
171
172#AC_MSG_CHECKING(and generating explicit install paths)
173
174## generate Makefile
175#save_prefix="$prefix"
176#save_exec_prefix="$exec_prefix"
177#test "x$prefix" = xNONE && prefix=$ac_default_prefix
178#test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
179#for dir in prefix exec_prefix bindir sbindir libexecdir \
180#          datadir sysconfdir sharedstatedir localstatedir libdir \
181#          includedir oldincludedir infodir mandir; do
182#  eval "dir_value=\$$dir"
183#  cat >> ./conftest.mk << EXPLPATHEOT
184#$dir=$dir_value
185#explicit_$dir:
186#       @ echo \$($dir)
187#       @ if echo \$($dir) | grep '^/'; \\
188#       then echo \$($dir) > ./conftest.dir; \\
189#       else echo \`pwd\`/\$($dir) > ./conftest.dir; fi
190#EXPLPATHEOT
191#done
192#prefix="$save_prefix"
193#exec_prefix="$save_exec_prefix"
194
195# generate the explicit paths
196#make >&5 2>&1 -f ./conftest.mk explicit_datadir
197#explicit_datadir=`cat ./conftest.dir`
198#make >&5 2>&1 -f ./conftest.mk explicit_libdir
199#explicit_libdir=`cat ./conftest.dir`
200#make >&5 2>&1 -f ./conftest.mk explicit_includedir
201#explicit_includedir=`cat ./conftest.dir`
202
203# clean up
204#rm -f ./conftest.mk ./conftest.dir
205
206#AC_MSG_RESULT(done)
207
208#
209# - check for libraries.
210#
211AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
212
213LB_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)]))
214
215LB_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)]))
216
217LB_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)]))
218
219# arithmetic shift
220#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
221#AC_CACHE_VAL(ac_cv_shift,
222#  [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
223#       AC_TRY_RUN(
224#      [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
225#      ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
226#if test "x$ac_cv_shift" = xyes; then
227#  AC_MSG_RESULT(yes)
228#else
229#  AC_MSG_RESULT(no)
230#fi
231
232#
233# - check for header files.
234#
235AC_LANG_CPLUSPLUS
236AC_LANG_PUSH([C++])
237
238AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
239  [ AC_MSG_ERROR(C header files not found) ])
240AC_CHECK_HEADERS(cstdio)
241
242if test "x$enable_streamio" != xno;  then
243  AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
244  AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
245
246  # since the FTE will compile only with stream IO enabled we will not
247  # check for the necessary header files if stream IO is disabled
248  AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
249    [ AC_MSG_WARN(C/C++ header files not found.
250                    You will not be able to build the Factory Test Environment
251                    (though Factory itself should compile)) ])
252fi
253
254
255if test "x$enable_timing" != xno; then
256  AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
257    [ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found.  Try
258                  \`configure --disable-timing') ])
259fi
260
261# font-lock-trick: '
262
263#
264# - check for compiler characteristics.
265#
266
267# use C to check compiler characteristics instead of C++.  On
268# nextstep, checking with C++ may fail.
269# AC_LANG_C
270
271# cross-compiling ?!
272#AC_C_CROSS
273#if test "x$cross_compiling" = xyes; then
274#  AC_MSG_WARN([you better specify a cache file to get the values for
275#                    cross-compiling right (e.g., call \`configure
276#                    --cache-file=yourTarget.cache').  In particular, you
277#                    should make sure that your target machine supports
278#                    arithmetic shift.])
279#fi
280
281# font-lock-trick: '
282
283#
284# - paths.
285#
286
287# note that Singular has its own mechanism to search the tables,
288# hence we do not need to mind it here
289#gftabledir='${datadir}/factory/gftables'
290#explicit_gftabledir="$explicit_datadir/gftables"
291
292# for installation of the templates
293#templatedir='${includedir}/templates'
294
295#
296# - set defines and variables according to our tests.
297#
298
299## CFLAGS
300#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
301#  CFLAGS=""
302#fi
303
304# CXXFLAGS
305#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
306#  CXXFLAGS=""
307#
308#AC_LANG_SAVE
309#AC_LANG_CPLUSPLUS
310# check whether CXX accepts -fno-rtti
311#AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
312#tmp_flags=${CXXFLAGS}
313#CXXFLAGS="${CXXFLAGS}"
314#AC_CACHE_VAL(ac_cv_cxx_have_rtti,
315#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
316#)
317#AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
318#CXXFLAGS=$tmp_flags
319#if test "${ac_cv_cxx_have_rtti}" = yes; then
320#CXXFLAGS="$CXXFLAGS"
321#fi
322#AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
323#tmp_flags=${CXXFLAGS}
324#CXXFLAGS="${CXXFLAGS} -fno-exceptions"
325#AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
326#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
327#)
328#AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
329#CXXFLAGS=$tmp_flags
330#if test "${ac_cv_cxx_have_exceptions}" = yes; then
331#CXXFLAGS="$CXXFLAGS -fno-exceptions"
332#fi
333#AC_LANG_RESTORE
334#
335#fi
336
337# ARFLAGS
338#test "${ARFLAGS+set}" = set || ARFLAGS=cr
339
340# M4FLAGS
341#test "${M4FLAGS+set}" = set || M4FLAGS=
342
343# arithmetic shift
344#if test "x$ac_cv_shift" = xyes; then
345#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
346#fi
347
348AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
349# "configurable inline methods"
350if test "x$enable_cf_inline" != xno; then
351  AC_DEFINE([CF_USE_INLINE],[1])
352fi
353
354AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
355# assertions
356if test "x$enable_assertions" = xno; then
357  AC_DEFINE([NOASSERT],[1])
358fi
359
360AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
361# timing
362if test "x$enable_timing" != xno; then
363  AC_DEFINE([TIMING],[1])
364fi
365
366# debugoutput
367AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
368if test "x$enable_debugoutput" != xno; then
369  AC_DEFINE([DEBUGOUTPUT],[1])
370fi
371
372#
373# - complete and substitute variables, defines.
374#
375#AC_SUBST(gftabledir)
376#AC_SUBST(templatedir)
377
378
379
380# AC_SUBST(libfactory)
381
382#AC_SUBST(ARFLAGS)
383#AC_SUBST(M4FLAGS)
384
385AC_SUBST(MAKEHEADERFLAGS)
386
387#AC_SUBST(factorysrc)
388#AC_SUBST(factoryincl)
389
390#AC_SUBST(alltargets)
391#AC_SUBST(installtargets)
392#AC_SUBST(uninstalltargets)
393
394factory_version="4.0.1"
395factory_configuration="'$ac_configure_args' in `pwd`"
396AC_SUBST(factory_version)
397
398AH_TEMPLATE([FACTORYVERSION], [factory version])
399AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
400
401AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
402AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
403
404#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
405#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
406
407
408
409AC_CONFIG_FILES([Makefile include/factory/Makefile factory.pc]) #  ftest/GNUmakefile
410AC_OUTPUT
411
Note: See TracBrowser for help on using the repository browser.