source: git/m4/options.m4 @ d19881

fieker-DuValspielwiese
Last change on this file since d19881 was d19881, checked in by Matthias Koeppe <mkoeppe@…>, 3 years ago
configure.ac, m4/options.m4: Replace SING_CHECK_PYTHON_MODULE by SING_ENABLE_MODULES
  • Property mode set to 100644
File size: 12.2 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  ENABLE_ARG="--with-Singular RESOURCES_LIBS='$RESOURCES_LIBS' RESOURCES_INCLUDES='$RESOURCES_INCLUDES'"
176
177  ac_configure_args="$ac_configure_args $ENABLE_ARG"
178
179  PKG_REQUIRE="$PKG_REQUIRE singular_resources"
180  AC_SUBST(PKG_REQUIRE)
181 else
182  AC_MSG_RESULT(no)
183 fi
184
185 AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$ENABLE_RESOURCES" = xyes])
186])
187
188
189AC_DEFUN([SING_USE_FACTORY],
190[
191  ENABLE_FACTORY="yes"
192
193
194  FACTORY_INCLUDES="-I$ac_abs_top_srcdir -I$ac_abs_top_srcdir/factory -I$ac_abs_top_srcdir/factory/include"
195  if test "x$ac_abs_top_srcdir" != "x$ac_abs_top_builddir"; then
196    FACTORY_INCLUDES="$FACTORY_INCLUDES -I$ac_abs_top_builddir -I$ac_abs_top_builddir/factory -I$ac_abs_top_builddir/factory/include"
197  fi
198
199  FACTORY_LIBS="$ac_abs_top_builddir/factory/libfactory.la"
200
201  AC_SUBST(FACTORY_INCLUDES)
202  AC_SUBST(FACTORY_LIBS)
203
204  AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
205  AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
206
207  AC_MSG_CHECKING([  FACTORY_LIBS?..])
208  AC_MSG_RESULT(${FACTORY_LIBS:-unset})
209
210  ENABLE_ARG="FACTORY_LIBS='$FACTORY_LIBS' FACTORY_INCLUDES='$FACTORY_INCLUDES'"
211
212  ac_configure_args="$ac_configure_args $ENABLE_ARG"
213
214  PKG_REQUIRE="$PKG_REQUIRE factory"
215  AC_SUBST(PKG_REQUIRE)
216
217
218 AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
219 AC_MSG_RESULT($ENABLE_FACTORY)
220
221])
222
223AC_DEFUN([SING_CHECK_FACTORY],
224[
225  ENABLE_FACTORY="yes"
226
227  AC_ARG_VAR( [FACTORY_INCLUDES], [INCLUDES for FACTORY] )
228  AC_ARG_VAR( [FACTORY_LIBS], [LIBS for FACTORY] )
229
230    AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
231    AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
232
233    AC_MSG_CHECKING([  FACTORY_LIBS?..])
234    AC_MSG_RESULT(${FACTORY_LIBS:-unset})
235
236
237    CPPFLAGS_save="$CPPFLAGS"
238    CFLAGS_save="$CFLAGS"
239    CXXFLAGS_save="$CXXFLAGS"
240    LIBS_save="$LIBS"
241
242    AC_LANG_PUSH([C++])
243#
244    CPPFLAGS="$CPPFLAGS ${FACTORY_INCLUDES}"
245    CFLAGS="$CFLAGS ${FACTORY_INCLUDES}"
246    CXXFLAGS="$CXXFLAGS ${FACTORY_INCLUDES}"
247    LIBS="${FACTORY_LIBS} $LIBS"
248
249    AC_CHECK_HEADERS([factory/factory.h],,AC_MSG_WARN([trusting the factory locations given: ${FACTORY_INCLUDES}]))
250
251    CFLAGS="$CFLAGS_save"
252    CXXFLAGS="$CXXFLAGS_save"
253    CPPFLAGS="$CPPFLAGS_save"
254    LIBS="$LIBS_save"
255#
256    AC_LANG_POP([C++])
257
258    PKG_REQUIRE="$PKG_REQUIRE factory"
259    AC_SUBST(PKG_REQUIRE)
260
261  AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
262  AC_MSG_RESULT($ENABLE_FACTORY)
263
264])
265
266AC_DEFUN([SING_ENABLE_MODULES], [dnl
267  m4_foreach([MOD], [pyobject, python], [dnl
268    AC_ARG_ENABLE(MOD[-module],
269                  AS_HELP_STRING([--enable-]MOD[-module], [Enable building optional module ]MOD), [dnl
270      dnl Nothing to do
271    ], [dnl
272      dnl Per default, these modules are disabled
273      AS_VAR_SET([enable_]MOD[_module], [no])
274    ])dnl
275    AM_CONDITIONAL([ENABLE_]m4_toupper(MOD)[_MODULE], [test x$enable_]MOD[_module != xno])dnl
276  ])dnl
277])
278
279AC_DEFUN([SING_DISABLE_MODULES], [dnl
280  m4_foreach([MOD], [staticdemo, subsets, freealgebra, partialgb, syzextra,
281                     gfanlib, polymake, customstd,
282                     singmathic, bigintm, Order, gitfan, interval, systhreads,
283                     loctriv, cohomo, machinelearning], [dnl
284    AC_ARG_ENABLE(MOD[-module],
285                  AS_HELP_STRING([--disable-]MOD[-module], [Disable building module ]MOD), [dnl
286      dnl Nothing to do
287    ], [dnl
288      dnl Per default, these modules are enabled
289      AS_VAR_SET([enable_]MOD[_module], [yes])
290    ])dnl
291    AM_CONDITIONAL([ENABLE_]m4_toupper(MOD)[_MODULE], [test x$enable_]MOD[_module != xno])dnl
292  ])dnl
293])
294
295AC_DEFUN([SING_BUILTIN_MODULES],
296[
297## m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
298 AC_MSG_CHECKING([built-in modules])
299
300 AC_ARG_VAR( [BUILTIN_LIBS], [LIB FLAGS for buildins] )
301 AC_ARG_WITH(builtinmodules,
302   AS_HELP_STRING([--with-builtinmodules], [List of builtin modules (experimental), default: staticdemo,bigintm,syzextra]),
303   [if test "x$with_builtinmodules" = "xyes"; then
304    with_builtinmodules=syzextra
305   fi],
306   [with_builtinmodules=""]
307 )
308 # staticdemo,bigintm,
309 # ,pyobject,gfanlib,polymake,singmathic
310
311 AH_TEMPLATE([SI_BUILTINMODULES_ADD],[Add(list) for Builtin modules])
312
313 #### TODO Dynamic Modules???
314  L=""
315  bi_staticdemo=false
316  bi_subsets=false
317  bi_freealgebra=false
318  bi_partialgb=false
319  bi_syzextra=false
320  bi_pyobject=false
321  bi_gfanlib=false
322  bi_polymake=false
323  bi_python=false
324  bi_customstd=false
325  bi_singmathic=false
326  bi_bigintm=false
327  bi_Order=false
328  bi_gitfan=false
329  bi_interval=false
330  bi_systhreads=false
331  bi_loctriv=false
332
333
334 if test -z "$with_builtinmodules"; then
335  AC_MSG_RESULT(no)
336 else
337  AC_MSG_RESULT(yes)
338
339  LL=""
340
341  for a in `echo ${with_builtinmodules}|tr ',' ' '`;
342  do
343    AC_MSG_CHECKING([whether to build-in '$a'?])
344
345      L="${L} add($a)"
346      LL="${LL} $a"
347      BUILTIN_LIBS="${BUILTIN_LIBS} dyn_modules/$a/$a.la"
348      BUILTIN_MODULES="${BUILTIN_MODULES} dyn_modules/$a"
349      AC_MSG_RESULT(yes)
350
351# *) AC_MSG_ERROR([bad value ${enableval} for       --enable-debug]) ;;
352
353      case "${a}" in
354       staticdemo ) bi_staticdemo=true;;
355       subsets ) bi_subsets=true;;
356       freealgebra ) bi_freealgebra=true;;
357       partialgb ) bi_partialgb=true;;
358       syzextra ) bi_syzextra=true ;;
359       pyobject ) bi_pyobject=true ;;
360       gfanlib ) bi_gfanlib=true ;;
361       polymake ) bi_polymake=true ;;
362       python_module ) bi_python=true ;;
363       customstd ) bi_customstd=true ;;
364       singmathic ) bi_singmathic=true ;;
365       bigintm ) bi_bigintm=true ;;
366       Order ) bi_Order=true ;;
367       gitfan ) bi_gitfan=true ;;
368       interval ) bi_interval=true ;;
369       systhreads ) bi_systhreads=true;;
370       loctriv ) bi_loctriv=true;;
371      esac
372
373###### In case of out-of tree building: the build dir is empty in configure time!!!
374    if test ! -d "Singular/dyn_modules/$a"; then
375        AC_MSG_WARN([The directory 'Singular/dyn_modules/$a' is missing :(])
376##    else
377##      AC_MSG_RESULT(no)
378    fi
379
380#    A=`echo "SI_BUILTIN_$a" | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:"  -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
381#    echo "A:: $A"
382#    AM_CONDITIONAL(m4_unquote([A]),[test -d "Singular/dyn_modules/$a"]) ## :(((
383  done # for
384
385  AC_DEFINE_UNQUOTED([SI_BUILTINMODULES],"$LL",[Refined list of builtin modules])
386
387 fi # else ("x$with_builtinmodules" != xno)
388
389 AC_MSG_CHECKING([SI_BUILTINMODULES_ADD(add)...])
390 AC_MSG_RESULT(${L:-unset})
391
392 AC_DEFINE_UNQUOTED([SI_BUILTINMODULES_ADD(add)],[$L],[Add(list) for Builtin modules])
393 AC_SUBST(BUILTIN_LIBS)
394 AC_SUBST(BUILTIN_MODULES)
395
396 AM_CONDITIONAL([SI_BUILTIN_STATICDEMO], [test x$bi_staticdemo = xtrue])
397 AM_CONDITIONAL([SI_BUILTIN_SUBSETS], [test x$bi_subsets = xtrue])
398 AM_CONDITIONAL([SI_BUILTIN_FREEALGEBRA], [test x$bi_freealgebra = xtrue])
399 AM_CONDITIONAL([SI_BUILTIN_PARTIALGB], [test x$bi_partialgb = xtrue])
400 AM_CONDITIONAL([SI_BUILTIN_SYZEXTRA], [test x$bi_syzextra = xtrue])
401 AM_CONDITIONAL([SI_BUILTIN_PYOBJECT], [test x$bi_pyobject = xtrue])
402 AM_CONDITIONAL([SI_BUILTIN_GFANLIB], [test x$bi_gfanlib = xtrue])
403 AM_CONDITIONAL([SI_BUILTIN_POLYMAKE], [test x$bi_polymake = xtrue])
404 AM_CONDITIONAL([SI_BUILTIN_PYTHON_MODULE], [test x$bi_python = xtrue])
405 AM_CONDITIONAL([HAVE_PYTHON_MODULE], [test x$ENABLE_PYTHON_MODULE = xyes])
406 AM_CONDITIONAL([SI_BUILTIN_CUSTOMSTD], [test x$bi_customstd = xtrue])
407 AM_CONDITIONAL([SI_BUILTIN_SINGMATHIC], [test x$bi_singmathic = xtrue])
408 AM_CONDITIONAL([SI_BUILTIN_BIGINTM], [test x$bi_bigintm = xtrue])
409 AM_CONDITIONAL([SI_BUILTIN_ORDER], [test x$bi_Order = xtrue])
410 AM_CONDITIONAL([SI_BUILTIN_GITFAN], [test x$bi_gitfan = xtrue])
411 AM_CONDITIONAL([SI_BUILTIN_INTERVAL], [test x$bi_interval = xtrue])
412 AM_CONDITIONAL([SI_BUILTIN_SYSTHREADS], [test x$bi_systhreads = xtrue])
413 AM_CONDITIONAL([SI_BUILTIN_LOCTRIV], [test x$bi_loctriv = xtrue])
414 AM_CONDITIONAL([SI_BUILTIN_MACHINELEARNING], [test x$bi_machinelearning = xtrue])
415
416 AC_MSG_CHECKING([BUILTIN_LIBS...])
417 AC_MSG_RESULT(${BUILTIN_LIBS:-unset})
418])
Note: See TracBrowser for help on using the repository browser.