source: git/configure.ac @ 7d160bb

spielwiese
Last change on this file since 7d160bb was 7d160bb, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Better compiler flags handling by BS fix: empty default compiler flags add: use optimization flags by default (incompatible with debug, see --disable-optimizationflags) add: check multiple compiler flags (debug/optimization) NOTE: some optimization flags lead to GCC crashes. NOTE: no implicit templates cannot be used due to some templated code (tgb*) :(
  • Property mode set to 100644
File size: 5.2 KB
Line 
1AC_INIT([singular],[3.1.3.sw])
2
3_AC_SRCDIRS(["$ac_dir"])
4
5AC_CONFIG_MACRO_DIR([m4])
6AC_CONFIG_AUX_DIR([.])
7
8AC_CONFIG_SRCDIR([Singular/tesths.cc])
9
10AC_CONFIG_HEADER([config.h])
11
12AM_MAINTAINER_MODE
13AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
14
15m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
16
17dnl Check if build env is sane
18AM_SANITY_CHECK
19
20#
21# - Check for CC and CXX but be careful about CFLAGS.
22SING_RESET_FLAGS()
23SING_CHECK_SET_ARGS()
24
25#!
26AC_PROG_CC
27AC_PROG_CXX
28AC_PROG_CPP
29AC_PROG_CXXCPP
30AM_PROG_CC_C_O
31### AM_PROG_LEX
32AC_PROG_LN_S
33AC_PROG_INSTALL
34m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
35
36AC_HEADER_STDC
37AC_CHECK_HEADERS(unistd.h iostream.h)
38
39AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv)
40
41
42AC_CHECK_PROGS([DOXYGEN], [doxygen])
43if test -z "$DOXYGEN";
44   then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
45fi
46AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
47                                                                   
48LT_INIT
49
50# Checks for libraries.
51AC_CHECK_LIB(rt,clock_gettime)
52AC_CHECK_LIB(pthread,pthread_create)
53
54LB_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)]))
55LB_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)]))
56LB_CHECK_FLINT(2.3,,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)]))
57
58AX_PYTHON_DEFAULT()
59AX_PYTHON_WITH_VERSION([2.4])
60
61
62AC_FUNC_ERROR_AT_LINE
63AC_FUNC_MALLOC
64
65SING_CHECK_PIPE
66
67# check for cpu properties
68AC_CHECK_SIZEOF(long,4)
69SING_CHECK_CPU
70
71#check for host:
72AC_CANONICAL_HOST
73case $host_os in
74  *cygwin* ) LIBPREFIX="-Xlinker -Bdynamic";;
75  * ) LIBPREFIX="";;
76esac
77
78
79SING_CHECK_P_PROCS
80SING_CHECK_FACTORY
81SING_CHECK_READLINE
82SING_CHECK_DBM
83SING_CHECK_GFANLIB
84
85### the following is needed due to the use of om_sing_opt_show_mem in misc_ip.cc...
86#ac_configure_args="$ac_configure_args --with-external-config_h=../Singular/omSingularConfig.h"
87
88AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--disable-omalloc], [do NOT use omalloc within the factory]),
89 [if test "x$enableval"  = "xyes"; then
90   ENABLE_OMALLOC=yes
91 fi], ENABLE_OMALLOC=add)
92
93ENABLE_OMALLOC_ARG="--with-omalloc-dir=$ac_abs_top_srcdir --with-omalloc-extra-dir=$ac_abs_top_builddir --enable-omalloc-trust"
94
95if test "x$ENABLE_OMALLOC" = xadd; then
96   ENABLE_OMALLOC=yes
97   ENABLE_OMALLOC_ARG="--enable-omalloc $ENABLE_OMALLOC_ARG"
98fi
99
100if test "x$ENABLE_FACTORY" = xyes; then
101 AC_MSG_CHECKING(whether to use omalloc in factory)
102 if test "x$ENABLE_OMALLOC" = xyes; then
103  AC_MSG_RESULT(yes)
104  ac_configure_args="$ac_configure_args $ENABLE_OMALLOC_ARG"
105 else
106  AC_MSG_RESULT(no)
107 fi
108fi
109
110AC_ARG_ENABLE(countedref, AS_HELP_STRING([--enable-countedref], [Enable autoloading of reference counted types]),
111[if test "x$enableval" = "xyes"; then
112ENABLE_COUNTEDREF_AUTOLOAD=yes
113fi], ENABLE_COUNTEDREF_AUTOLOAD=no)
114
115if test x"${ENABLE_COUNTEDREF_AUTOLOAD}" == xyes; then
116  AC_DEFINE([SI_COUNTEDREF_AUTOLOAD],1,[Enable autoloading of reference counted types])
117  AC_SUBST(SI_COUNTEDREF_AUTOLOAD)
118fi
119
120dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however
121dnl AM_COND_IF is new to Automake 1.11.  To use it on new Automake without
122dnl requiring same, a fallback implementation for older Autoconf is provided.
123dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code
124dnl is correct only in terms of m4sh generated script.
125m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
126if test -z "$$1_TRUE"; then :
127  m4_n([$2])[]dnl
128m4_ifval([$3],
129[else
130    $3
131])dnl
132fi[]dnl
133])])
134
135
136AC_DEFINE_UNQUOTED([CC],"$CC",[CC])
137AC_DEFINE_UNQUOTED([CXX],"$CXX",[CXX])
138AC_DEFINE_UNQUOTED([CFLAGS],"$CFLAGS",[CFLAGS])
139AC_DEFINE_UNQUOTED([CXXFLAGS],"$CXXFLAGS",[CXXFLAGS])
140AC_DEFINE_UNQUOTED([DEFS],"$DEFS",[DEFS])
141AC_DEFINE_UNQUOTED([CPPFLAGS],"$CPPFLAGS",[CPPFLAGS])
142AC_DEFINE_UNQUOTED([LDFLAGS],"$LDFLAGS",[LDFLAGS])
143AC_DEFINE_UNQUOTED([LIBS],"$LIBS",[LIBS])
144 
145 
146SING_SHOW_FLAGS([Compiler/linker flags: ])
147
148   
149AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([dox/Doxyfile])])
150AC_CONFIG_FILES([dox/Makefile])
151
152AC_CONFIG_SUBDIRS([resources])
153AC_CONFIG_SUBDIRS([omalloc])
154
155if test "x$ENABLE_FACTORY" = xyes; then
156 AC_CONFIG_SUBDIRS([factory])
157fi
158
159AC_CONFIG_SUBDIRS([libpolys])
160
161AC_CONFIG_FILES([Makefile])
162AC_CONFIG_FILES([xalloc/Makefile])
163AC_CONFIG_FILES([kernel/Makefile])
164AC_CONFIG_FILES([numeric/Makefile])
165AC_CONFIG_FILES([Singular/Makefile])
166AC_CONFIG_FILES([dyn_modules/Makefile])
167AC_CONFIG_FILES([dyn_modules/bigintm/Makefile])
168AC_CONFIG_FILES([dyn_modules/syzextra/Makefile])
169AC_CONFIG_FILES([dyn_modules/callgfanlib/Makefile])
170AC_CONFIG_FILES([IntegerProgramming/Makefile])
171AC_CONFIG_FILES([libsingular-config])
172AC_CONFIG_SUBDIRS([gfanlib])
173
174AC_CONFIG_FILES([redhat/singular.spec])
175AC_CONFIG_FILES([desktop/Singular.desktop])
176AC_CONFIG_FILES([desktop/Singular-manual.desktop])
177
178AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.