source: git/m4/options.m4 @ cba9b3

fieker-DuValspielwiese
Last change on this file since cba9b3 was cba9b3, checked in by Hans Schoenemann <hannes@…>, 2 years ago
apapt to --htmdir option to configure, build a different doc.tbz2
  • Property mode set to 100644
File size: 12.4 KB
Line 
1AC_DEFUN([SING_CHECK_ARITH_RINGS],
2[
3AC_MSG_CHECKING(whether arithmetical rings should be enabled)
4
5AC_ARG_ENABLE(arith-rings, AS_HELP_STRING([--disable-arith-rings], [Disable arithmetical rings]),
6[if test $enableval = yes; then
7     ENABLE_RINGS="yes"
8 else
9     ENABLE_RINGS="no"
10 fi
11],[ENABLE_RINGS="yes"])
12
13if test x$ENABLE_RINGS = xyes; then
14  AC_DEFINE(HAVE_RINGS,1,Enable arithmetical rings)
15fi
16
17AM_CONDITIONAL([ENABLE_RINGS],[test x$ENABLE_RINGS = xyes])
18AC_MSG_RESULT($ENABLE_RINGS)
19])
20
21AC_DEFUN([SING_CHECK_PLURAL],
22[
23AC_MSG_CHECKING(whether non-commutative subsystem should be enabled)
24
25AC_ARG_ENABLE(plural, AS_HELP_STRING([--disable-plural], [Disable non-commutative subsystem]),
26[ENABLE_PLURAL="$enableval"],[ENABLE_PLURAL="yes"])
27
28if test "x$ENABLE_PLURAL" != xno; then
29  AC_DEFINE(HAVE_PLURAL,[1],[Enable non-commutative subsystem])
30  #TODO make a seperate switch
31  AC_DEFINE(HAVE_SHIFTBBA,[1],[Enable letterplace])
32fi
33
34AM_CONDITIONAL([ENABLE_PLURAL],[test x$ENABLE_PLURAL != xno])
35
36AC_MSG_RESULT($ENABLE_PLURAL)
37
38
39AC_ARG_WITH(RatGB, AS_HELP_STRING([--with-ratGB], [do compile with ratGB support (experimental)]))
40
41AC_MSG_CHECKING(whether to have ratGB)
42if test "x$with_ratGB" != xyes && test "x$enable_ratGB" != xyes; then
43  AC_MSG_RESULT(no)
44else
45  AC_DEFINE(HAVE_RATGRING, 1, [Enable RatGB support])
46  AC_MSG_RESULT(yes)
47fi
48
49
50])
51
52
53AC_DEFUN([SING_CHECK_OMALLOC],
54[
55  AC_ARG_ENABLE(omalloc,
56    [AS_HELP_STRING([--enable-omalloc],[build for use with omalloc])],
57    [if test "x$enableval" = "xyes"; then
58      ENABLE_OMALLOC=yes
59    fi],
60      ENABLE_OMALLOC=no)
61
62  AC_ARG_VAR( [OMALLOC_INCLUDES], [INCLUDES for libomalloc] )
63  AC_ARG_VAR( [OMALLOC_LIBS], [LIBS for libomalloc] )
64
65  AC_MSG_CHECKING([whether to use omalloc])
66
67  AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
68
69  if test "x$ENABLE_OMALLOC" = xyes; then
70    AC_MSG_RESULT(yes)
71
72    AC_MSG_CHECKING([  OMALLOC_INCLUDES?..])
73    AC_MSG_RESULT(${OMALLOC_INCLUDES:-unset})
74
75    AC_MSG_CHECKING([  OMALLOC_LIBS?..])
76    AC_MSG_RESULT(${OMALLOC_LIBS:-unset})
77
78    CPPFLAGS_save="$CPPFLAGS"
79    CFLAGS_save="$CFLAGS"
80    LIBS_save="$LIBS"
81
82    AC_LANG_PUSH([C])
83#
84    CPPFLAGS="$CPPFLAGS ${OMALLOC_INCLUDES}"
85    CFLAGS="$CFLAGS ${OMALLOC_INCLUDES}"
86    LIBS="$LIBS ${OMALLOC_LIBS}"
87
88    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_WARN([trusting the omalloc locations given: ${OMALLOC_INCLUDES}]))
89
90    CFLAGS="$CFLAGS_save"
91    CPPFLAGS="$CPPFLAGS_save"
92    LIBS="$LIBS_save"
93#
94    AC_LANG_POP([C])
95
96    AC_DEFINE([HAVE_OMALLOC],[1])
97
98    PKG_REQUIRE="$PKG_REQUIRE omalloc"
99    AC_SUBST(PKG_REQUIRE)
100  else
101    AC_MSG_RESULT(no)
102    AC_MSG_CHECKING([  OMALLOC_INCLUDES?..])
103    AC_MSG_RESULT(${OMALLOC_INCLUDES:-unset})
104
105    AC_MSG_CHECKING([  OMALLOC_LIBS?..])
106    AC_MSG_RESULT(${OMALLOC_LIBS:-unset})
107  fi
108])
109
110AC_DEFUN([SING_USE_OMALLOC],
111[
112 AC_ARG_ENABLE(omalloc,
113  [AS_HELP_STRING([--disable-omalloc], [do NOT use omalloc within the factory])],
114  [if test "x$enableval"  = "xyes"; then
115    ENABLE_OMALLOC=yes
116   fi],
117    ENABLE_OMALLOC=add)
118
119 ENABLE_OMALLOC_ARG=""
120
121 if test "x$ENABLE_OMALLOC" = xadd; then
122   ENABLE_OMALLOC=yes
123   ENABLE_OMALLOC_ARG="--enable-omalloc $ENABLE_OMALLOC_ARG"
124 fi
125
126 AC_MSG_CHECKING(whether to use omalloc in factory and co.)
127
128 if test "x$ENABLE_OMALLOC" = xyes; then
129  AC_MSG_RESULT(yes)
130  OMALLOC_INCLUDES="-I$ac_abs_top_srcdir"
131
132  if test "x$ac_abs_top_srcdir" != "x$ac_abs_top_builddir"; then
133    OMALLOC_INCLUDES="$OMALLOC_INCLUDES -I$ac_abs_top_builddir"
134  fi
135
136  OMALLOC_LIBS="$ac_abs_top_builddir/omalloc/libomalloc.la"
137
138  AC_SUBST(OMALLOC_INCLUDES)
139  AC_SUBST(OMALLOC_LIBS)
140
141  ENABLE_OMALLOC_ARG="$ENABLE_OMALLOC_ARG OMALLOC_LIBS='$OMALLOC_LIBS' OMALLOC_INCLUDES='$OMALLOC_INCLUDES'"
142  ac_configure_args="$ac_configure_args $ENABLE_OMALLOC_ARG"
143
144  PKG_REQUIRE="$PKG_REQUIRE omalloc"
145  AC_SUBST(PKG_REQUIRE)
146 else
147  OMALLOC_INCLUDES="-I$ac_abs_top_srcdir"
148  OMALLOC_LIBS="$ac_abs_top_builddir/omalloc/libomalloc.la"
149  AC_SUBST(OMALLOC_INCLUDES)
150  AC_SUBST(OMALLOC_LIBS)
151  AC_MSG_RESULT(no)
152 fi
153
154])
155
156AC_DEFUN([SING_USE_RESOURCES],
157[
158 AC_ARG_ENABLE(singular_resources,
159  [AS_HELP_STRING([--disable-singular_resources], [do NOT use libsingular_resources within the factory])],
160  [if test "x$enableval"  = "xyes"; then
161    ENABLE_RESOURCES=yes
162   fi],
163    ENABLE_RESOURCES=yes)
164
165 AC_MSG_CHECKING(whether to use libsingular_resources in factory and co.)
166 if test "x$ENABLE_RESOURCES" = xyes; then
167  AC_MSG_RESULT(yes)
168  RESOURCES_INCLUDES="-I$ac_abs_top_srcdir "
169
170  RESOURCES_LIBS="$ac_abs_top_builddir/resources/libsingular_resources.la"
171
172  AC_SUBST(RESOURCES_INCLUDES)
173  AC_SUBST(RESOURCES_LIBS)
174
175  if test "x$htmldir" = "x\${docdir}"; then
176    DEFAULT_HTMLDIR="--htmldir=$datarootdir/doc/singular"
177  fi
178
179  ENABLE_ARG="--with-Singular RESOURCES_LIBS='$RESOURCES_LIBS' RESOURCES_INCLUDES='$RESOURCES_INCLUDES'"
180
181  ac_configure_args="$ac_configure_args $DEFAULT_HTMLDIR $ENABLE_ARG"
182
183  PKG_REQUIRE="$PKG_REQUIRE singular_resources"
184  AC_SUBST(PKG_REQUIRE)
185 else
186  AC_MSG_RESULT(no)
187 fi
188
189 AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$ENABLE_RESOURCES" = xyes])
190])
191
192
193AC_DEFUN([SING_USE_FACTORY],
194[
195  ENABLE_FACTORY="yes"
196
197
198  FACTORY_INCLUDES="-I$ac_abs_top_srcdir -I$ac_abs_top_srcdir/factory -I$ac_abs_top_srcdir/factory/include"
199  if test "x$ac_abs_top_srcdir" != "x$ac_abs_top_builddir"; then
200    FACTORY_INCLUDES="$FACTORY_INCLUDES -I$ac_abs_top_builddir -I$ac_abs_top_builddir/factory -I$ac_abs_top_builddir/factory/include"
201  fi
202
203  FACTORY_LIBS="$ac_abs_top_builddir/factory/libfactory.la"
204
205  AC_SUBST(FACTORY_INCLUDES)
206  AC_SUBST(FACTORY_LIBS)
207
208  AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
209  AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
210
211  AC_MSG_CHECKING([  FACTORY_LIBS?..])
212  AC_MSG_RESULT(${FACTORY_LIBS:-unset})
213
214  ENABLE_ARG="FACTORY_LIBS='$FACTORY_LIBS' FACTORY_INCLUDES='$FACTORY_INCLUDES'"
215
216  ac_configure_args="$ac_configure_args $ENABLE_ARG"
217
218  PKG_REQUIRE="$PKG_REQUIRE factory"
219  AC_SUBST(PKG_REQUIRE)
220
221
222 AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
223 AC_MSG_RESULT($ENABLE_FACTORY)
224
225])
226
227AC_DEFUN([SING_CHECK_FACTORY],
228[
229  ENABLE_FACTORY="yes"
230
231  AC_ARG_VAR( [FACTORY_INCLUDES], [INCLUDES for FACTORY] )
232  AC_ARG_VAR( [FACTORY_LIBS], [LIBS for FACTORY] )
233
234    AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
235    AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
236
237    AC_MSG_CHECKING([  FACTORY_LIBS?..])
238    AC_MSG_RESULT(${FACTORY_LIBS:-unset})
239
240
241    CPPFLAGS_save="$CPPFLAGS"
242    CFLAGS_save="$CFLAGS"
243    CXXFLAGS_save="$CXXFLAGS"
244    LIBS_save="$LIBS"
245
246    AC_LANG_PUSH([C++])
247#
248    CPPFLAGS="$CPPFLAGS ${FACTORY_INCLUDES}"
249    CFLAGS="$CFLAGS ${FACTORY_INCLUDES}"
250    CXXFLAGS="$CXXFLAGS ${FACTORY_INCLUDES}"
251    LIBS="${FACTORY_LIBS} $LIBS"
252
253    AC_CHECK_HEADERS([factory/factory.h],,AC_MSG_WARN([trusting the factory locations given: ${FACTORY_INCLUDES}]))
254
255    CFLAGS="$CFLAGS_save"
256    CXXFLAGS="$CXXFLAGS_save"
257    CPPFLAGS="$CPPFLAGS_save"
258    LIBS="$LIBS_save"
259#
260    AC_LANG_POP([C++])
261
262    PKG_REQUIRE="$PKG_REQUIRE factory"
263    AC_SUBST(PKG_REQUIRE)
264
265  AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
266  AC_MSG_RESULT($ENABLE_FACTORY)
267
268])
269
270AC_DEFUN([SING_ENABLE_MODULES], [dnl
271  m4_foreach([MOD], [staticdemo, bigintm, Order, python], [dnl
272    AC_ARG_ENABLE(MOD[-module],
273                  AS_HELP_STRING([--enable-]MOD[-module], [Enable building optional module ]MOD), [dnl
274      dnl Nothing to do
275    ], [dnl
276      dnl Per default, these modules are disabled
277      AS_VAR_SET([enable_]MOD[_module], [no])
278    ])dnl
279    AM_CONDITIONAL([ENABLE_]m4_toupper(MOD)[_MODULE], [test x$enable_]MOD[_module != xno])dnl
280  ])dnl
281])
282
283AC_DEFUN([SING_DISABLE_MODULES], [dnl
284  m4_foreach([MOD], [subsets, freealgebra, partialgb, syzextra,
285                     gfanlib, polymake, customstd, pyobject,
286                     singmathic, gitfan, interval, systhreads,
287                     loctriv, cohomo, machinelearning, sispasm], [dnl
288    AC_ARG_ENABLE(MOD[-module],
289                  AS_HELP_STRING([--disable-]MOD[-module], [Disable building module ]MOD), [dnl
290      dnl Nothing to do
291    ], [dnl
292      dnl Per default, these modules are enabled
293      AS_VAR_SET([enable_]MOD[_module], [yes])
294    ])dnl
295    AM_CONDITIONAL([ENABLE_]m4_toupper(MOD)[_MODULE], [test x$enable_]MOD[_module != xno])dnl
296  ])dnl
297])
298
299AC_DEFUN([SING_BUILTIN_MODULES],
300[
301## m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
302 AC_MSG_CHECKING([built-in modules])
303
304 AC_ARG_VAR( [BUILTIN_LIBS], [LIB FLAGS for buildins] )
305 AC_ARG_WITH(builtinmodules,
306   AS_HELP_STRING([--with-builtinmodules], [List of builtin modules (experimental), default: none]),
307   [if test "x$with_builtinmodules" = "xyes"; then
308    with_builtinmodules=syzextra
309   fi],
310   [with_builtinmodules=""]
311 )
312 # staticdemo,bigintm,
313 # ,pyobject,gfanlib,polymake,singmathic
314
315 AH_TEMPLATE([SI_BUILTINMODULES_ADD],[Add(list) for Builtin modules])
316
317 #### TODO Dynamic Modules???
318  L=""
319  bi_staticdemo=false
320  bi_subsets=false
321  bi_freealgebra=false
322  bi_partialgb=false
323  bi_syzextra=false
324  bi_pyobject=false
325  bi_gfanlib=false
326  bi_polymake=false
327  bi_python=false
328  bi_customstd=false
329  bi_singmathic=false
330  bi_bigintm=false
331  bi_Order=false
332  bi_gitfan=false
333  bi_interval=false
334  bi_systhreads=false
335  bi_loctriv=false
336  bi_sispasm=false
337
338
339 if test -z "$with_builtinmodules"; then
340  AC_MSG_RESULT(no)
341 else
342  AC_MSG_RESULT(yes)
343
344  LL=""
345
346  for a in `echo ${with_builtinmodules}|tr ',' ' '`;
347  do
348    AC_MSG_CHECKING([whether to build-in '$a'?])
349
350      L="${L} add($a)"
351      LL="${LL} $a"
352      BUILTIN_LIBS="${BUILTIN_LIBS} dyn_modules/$a/$a.la"
353      BUILTIN_MODULES="${BUILTIN_MODULES} dyn_modules/$a"
354      AC_MSG_RESULT(yes)
355
356# *) AC_MSG_ERROR([bad value ${enableval} for       --enable-debug]) ;;
357
358      case "${a}" in
359       staticdemo ) bi_staticdemo=true;;
360       subsets ) bi_subsets=true;;
361       freealgebra ) bi_freealgebra=true;;
362       partialgb ) bi_partialgb=true;;
363       syzextra ) bi_syzextra=true ;;
364       pyobject ) bi_pyobject=true ;;
365       gfanlib ) bi_gfanlib=true ;;
366       polymake ) bi_polymake=true ;;
367       python_module ) bi_python=true ;;
368       customstd ) bi_customstd=true ;;
369       singmathic ) bi_singmathic=true ;;
370       bigintm ) bi_bigintm=true ;;
371       Order ) bi_Order=true ;;
372       gitfan ) bi_gitfan=true ;;
373       interval ) bi_interval=true ;;
374       systhreads ) bi_systhreads=true;;
375       loctriv ) bi_loctriv=true;;
376       sispasm ) bi_sispasm=true;;
377      esac
378
379###### In case of out-of tree building: the build dir is empty in configure time!!!
380    if test ! -d "Singular/dyn_modules/$a"; then
381        AC_MSG_WARN([The directory 'Singular/dyn_modules/$a' is missing :(])
382##    else
383##      AC_MSG_RESULT(no)
384    fi
385
386#    A=`echo "SI_BUILTIN_$a" | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:"  -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
387#    echo "A:: $A"
388#    AM_CONDITIONAL(m4_unquote([A]),[test -d "Singular/dyn_modules/$a"]) ## :(((
389  done # for
390
391  AC_DEFINE_UNQUOTED([SI_BUILTINMODULES],"$LL",[Refined list of builtin modules])
392
393 fi # else ("x$with_builtinmodules" != xno)
394
395 AC_MSG_CHECKING([SI_BUILTINMODULES_ADD(add)...])
396 AC_MSG_RESULT(${L:-unset})
397
398 AC_DEFINE_UNQUOTED([SI_BUILTINMODULES_ADD(add)],[$L],[Add(list) for Builtin modules])
399 AC_SUBST(BUILTIN_LIBS)
400 AC_SUBST(BUILTIN_MODULES)
401
402 AM_CONDITIONAL([SI_BUILTIN_STATICDEMO], [test x$bi_staticdemo = xtrue])
403 AM_CONDITIONAL([SI_BUILTIN_SUBSETS], [test x$bi_subsets = xtrue])
404 AM_CONDITIONAL([SI_BUILTIN_FREEALGEBRA], [test x$bi_freealgebra = xtrue])
405 AM_CONDITIONAL([SI_BUILTIN_PARTIALGB], [test x$bi_partialgb = xtrue])
406 AM_CONDITIONAL([SI_BUILTIN_SYZEXTRA], [test x$bi_syzextra = xtrue])
407 AM_CONDITIONAL([SI_BUILTIN_PYOBJECT], [test x$bi_pyobject = xtrue])
408 AM_CONDITIONAL([SI_BUILTIN_GFANLIB], [test x$bi_gfanlib = xtrue])
409 AM_CONDITIONAL([SI_BUILTIN_POLYMAKE], [test x$bi_polymake = xtrue])
410 AM_CONDITIONAL([SI_BUILTIN_PYTHON_MODULE], [test x$bi_python = xtrue])
411 AM_CONDITIONAL([SI_BUILTIN_CUSTOMSTD], [test x$bi_customstd = xtrue])
412 AM_CONDITIONAL([SI_BUILTIN_SINGMATHIC], [test x$bi_singmathic = xtrue])
413 AM_CONDITIONAL([SI_BUILTIN_BIGINTM], [test x$bi_bigintm = xtrue])
414 AM_CONDITIONAL([SI_BUILTIN_ORDER], [test x$bi_Order = xtrue])
415 AM_CONDITIONAL([SI_BUILTIN_GITFAN], [test x$bi_gitfan = xtrue])
416 AM_CONDITIONAL([SI_BUILTIN_INTERVAL], [test x$bi_interval = xtrue])
417 AM_CONDITIONAL([SI_BUILTIN_SYSTHREADS], [test x$bi_systhreads = xtrue])
418 AM_CONDITIONAL([SI_BUILTIN_LOCTRIV], [test x$bi_loctriv = xtrue])
419 AM_CONDITIONAL([SI_BUILTIN_MACHINELEARNING], [test x$bi_machinelearning = xtrue])
420 AM_CONDITIONAL([SI_BUILTIN_SISPASM], [test x$bi_sispasm = xtrue])
421
422 AC_MSG_CHECKING([BUILTIN_LIBS...])
423 AC_MSG_RESULT(${BUILTIN_LIBS:-unset})
424])
Note: See TracBrowser for help on using the repository browser.