source: git/configure.ac @ 37e66f

spielwiese
Last change on this file since 37e66f was 37e66f, checked in by Oleksandr Motsak <motsak@…>, 10 years ago
Better approach to configuring multiple packages: omalloc/resources/factory add: precious configure variables {OMALLOC/RESOURCES/FACTORY}_{LIBS/INCLUDES} fix: also related minor fixes NOTE: main changes are in m4/options.m4 and factory/configure.ac (which was the motivator for the whole thing) NOTE2: the cleanup of "-I${top_srcdir}/.." and "-I${top_srcdir}/../factory/include" (and similar for builddir) in favor of {OMALLOC/RESOURCES/FACTORY}_INCLUDES
  • Property mode set to 100644
File size: 6.8 KB
Line 
1AC_INIT([singular], [4.0.0], [singular@mathematik.uni-kl.de])
2AC_DEFINE([VERSION_DATE],["Dec 2013"],[release date])
3
4_AC_SRCDIRS(["$ac_dir"])
5
6AC_CONFIG_MACRO_DIR([m4])
7AC_CONFIG_AUX_DIR([.])
8
9AC_CONFIG_SRCDIR([Singular/tesths.cc])
10
11AC_CONFIG_HEADER([_config.h])
12# Add pre'prefixed config
13AX_PREFIX_CONFIG_H([singularconfig.h],[],[_config.h])
14
15dnl Apparently, this is required for using an AC_CHECK_HEADER within AS_IF(...), at least on Cygwin.
16AC_USE_SYSTEM_EXTENSIONS
17
18AM_MAINTAINER_MODE([enable])   
19AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
20
21m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
22
23dnl Check if build env is sane
24AM_SANITY_CHECK
25
26
27SING_RESET_FLAGS()
28SING_CHECK_SET_ARGS()
29
30#!
31# AC_PROG_CC
32# AC_PROG_CXX
33AC_PROG_CPP
34AC_PROG_CXXCPP
35AM_PROG_CC_C_O
36### AM_PROG_LEX
37AC_PROG_LN_S
38AC_PROG_INSTALL
39m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
40
41AC_HEADER_STDC
42AC_CHECK_HEADERS(unistd.h iostream.h sys/time.h sys/times.h asm/sigcontext.h)
43
44AC_CHECK_FUNCS(readlink getcwd getwd setenv putenv)
45
46
47AC_CHECK_PROGS([DOXYGEN], [doxygen])
48if test -z "$DOXYGEN";
49   then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
50fi
51AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
52
53LT_INIT
54
55link_all_deplibs=yes
56link_all_deplibs_CXX=yes
57
58# Checks for libraries.
59AC_CHECK_LIB(pthread,pthread_create)
60AC_CHECK_LIB(rt,clock_gettime)
61
62LB_CHECK_GMP(4.0,,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)]))
63LB_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)]))
64LB_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)]))
65
66AC_CONFIG_GOOGLE_PERFTOOLS()
67
68## AX_PYTHON_DEFAULT()
69AX_PYTHON_WITH_VERSION([2.4])
70
71LB_CHECK_MATHICGB
72
73AC_FUNC_ERROR_AT_LINE
74AC_FUNC_MALLOC
75
76# check for cpu properties
77AC_CHECK_SIZEOF(long,4)
78SING_CHECK_CPU
79
80#check for host:
81AC_CANONICAL_HOST
82
83case $host_os in
84  *cygwin* ) AX_APPEND_LINK_FLAGS([-Wl,-Bdynamic]);;
85esac
86
87PKG_REQUIRE="$PKG_REQUIRE"
88AC_SUBST(PKG_REQUIRE)
89
90SING_USE_OMALLOC()
91SING_USE_RESOURCES()
92SING_USE_FACTORY()
93
94SING_CHECK_P_PROCS
95SING_CHECK_READLINE
96SING_CHECK_DBM
97
98SING_CHECK_GFANLIB
99SING_CHECK_POLYMAKE
100
101SING_CHECK_PLURAL
102
103### the following is needed due to the use of om_sing_opt_show_mem in misc_ip.cc...
104#ac_configure_args="$ac_configure_args --with-external-config_h=../Singular/omSingularConfig.h"
105
106AC_ARG_ENABLE(countedref, AS_HELP_STRING([--enable-countedref], [Enable autoloading of reference counted types]),
107[if test "x$enableval" = "xyes"; then
108ENABLE_COUNTEDREF_AUTOLOAD=yes
109fi], ENABLE_COUNTEDREF_AUTOLOAD=no)
110
111if test x"${ENABLE_COUNTEDREF_AUTOLOAD}" == xyes; then
112  AC_DEFINE([SI_COUNTEDREF_AUTOLOAD],1,[Enable autoloading of reference counted types])
113  AC_SUBST(SI_COUNTEDREF_AUTOLOAD)
114fi
115
116dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however
117dnl AM_COND_IF is new to Automake 1.11.  To use it on new Automake without
118dnl requiring same, a fallback implementation for older Autoconf is provided.
119dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code
120dnl is correct only in terms of m4sh generated script.
121m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
122if test -z "$$1_TRUE"; then :
123  m4_n([$2])[]dnl
124m4_ifval([$3],
125[else
126    $3
127])dnl
128fi[]dnl
129])])
130
131
132AC_DEFINE_UNQUOTED([CC],"$CC",[CC])
133AC_DEFINE_UNQUOTED([CXX],"$CXX",[CXX])
134AC_DEFINE_UNQUOTED([CFLAGS],"$CFLAGS",[CFLAGS])
135AC_DEFINE_UNQUOTED([CXXFLAGS],"$CXXFLAGS",[CXXFLAGS])
136AC_DEFINE_UNQUOTED([DEFS],"$DEFS",[DEFS])
137AC_DEFINE_UNQUOTED([CPPFLAGS],"$CPPFLAGS",[CPPFLAGS])
138AC_DEFINE_UNQUOTED([LDFLAGS],"$LDFLAGS",[LDFLAGS])
139AC_DEFINE_UNQUOTED([LIBS],"$LIBS",[LIBS])
140AC_DEFINE_UNQUOTED([AC_CONFIGURE_ARGS],"$ac_configure_args",[ac_configure_args])
141# AC_DEFINE_UNQUOTED([AC_CT_CC], "$ac_ct_CC",[ac_ct_CC])
142
143AC_DEFINE_UNQUOTED([NTL_CFLAGS],"$NTL_CFLAGS",[NTL_CFLAGS])
144AC_DEFINE_UNQUOTED([NTL_LIBS],"$NTL_LIBS",[NTL_LIBS])
145
146AC_DEFINE_UNQUOTED([GMP_CFLAGS],"$GMP_CFLAGS",[GMP_CFLAGS])
147AC_DEFINE_UNQUOTED([GMP_LIBS],"$GMP_LIBS",[GMP_LIBS])
148
149AC_DEFINE_UNQUOTED([FLINT_CFLAGS],"$FLINT_CFLAGS",[FLINT_CFLAGS])
150AC_DEFINE_UNQUOTED([FLINT_LIBS],"$FLINT_LIBS",[FLINT_LIBS])
151
152##### SEE http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
153
154AX_RECURSIVE_EVAL([[$]prefix], [config_prefix])
155AX_NORMALIZE_PATH([config_prefix],['/'])
156AC_DEFINE_UNQUOTED([PREFIX],"$config_prefix",[prefix])
157
158AX_RECURSIVE_EVAL([[$]exec_prefix], [config_exec_prefix])
159AX_NORMALIZE_PATH([config_exec_prefix],['/'])
160AC_DEFINE_UNQUOTED([EXEC_PREFIX],"$config_exec_prefix",[exec_prefix])
161
162AX_RECURSIVE_EVAL([[$]libexecdir], [config_libexecdir])
163AX_NORMALIZE_PATH([config_libexecdir],['/'])
164AC_DEFINE_UNQUOTED([LIBEXEC_DIR],"$config_libexecdir",[libexecdir])
165
166AX_RECURSIVE_EVAL([[$]libdir], [config_libdir])
167AX_NORMALIZE_PATH([config_libdir],['/'])
168AC_DEFINE_UNQUOTED([LIB_DIR],"$config_libdir",[libdir])
169
170AX_RECURSIVE_EVAL([[$]bindir], [config_bindir])
171AX_NORMALIZE_PATH([config_bindir],['/'])
172AC_DEFINE_UNQUOTED([BIN_DIR],"$config_bindir",[bindir])
173
174AX_RECURSIVE_EVAL([[$]datadir], [config_datadir])
175AX_NORMALIZE_PATH([config_datadir],['/'])
176AC_DEFINE_UNQUOTED([DATA_DIR],"$config_datadir",[datadir])
177AC_SUBST(DATA_DIR)
178
179AX_RECURSIVE_EVAL([[$]docdir], [config_docdir])
180AX_NORMALIZE_PATH([config_docdir],['/'])
181AC_DEFINE_UNQUOTED([DOC_DIR],"$config_docdir",[docdir])
182AC_SUBST(DOC_DIR)
183
184SING_SHOW_FLAGS([Compiler/linker flags: ])
185
186
187AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([dox/Doxyfile])])
188AC_CONFIG_FILES([dox/Makefile])
189
190AC_CONFIG_SUBDIRS([resources])
191AC_CONFIG_SUBDIRS([omalloc])
192
193if test "x$ENABLE_FACTORY" = xyes; then
194 AC_CONFIG_SUBDIRS([factory])
195fi
196
197AC_CONFIG_SUBDIRS([libpolys])
198
199AC_CONFIG_FILES([Makefile])
200AC_CONFIG_FILES([xalloc/Makefile])
201AC_CONFIG_FILES([kernel/Makefile])
202AC_CONFIG_FILES([kernel/sample/Makefile]) # kernelsample
203AC_CONFIG_FILES([kernel/numeric/Makefile])
204
205AC_CONFIG_SUBDIRS([gfanlib])
206
207AC_CONFIG_FILES([dyn_modules/Makefile])
208AC_CONFIG_FILES([dyn_modules/bigintm/Makefile])
209AC_CONFIG_FILES([dyn_modules/syzextra/Makefile])
210AC_CONFIG_FILES([dyn_modules/callgfanlib/Makefile])
211AC_CONFIG_FILES([dyn_modules/callpolymake/Makefile])
212
213AC_CONFIG_FILES([Singular/Makefile])
214
215AC_CONFIG_FILES([IntegerProgramming/Makefile])
216
217AC_CONFIG_FILES([libsingular-config Singular.pc])
218
219AC_CONFIG_FILES([emacs/Makefile])
220
221AC_CONFIG_FILES([debian/Makefile])
222AC_CONFIG_FILES([redhat/Makefile])
223AC_CONFIG_FILES([redhat/singular.spec])
224AC_CONFIG_FILES([desktop/Makefile desktop/Singular.desktop desktop/Singular-manual.desktop])
225
226AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.