source: git/m4/options.m4 @ 9fe6c3

spielwiese
Last change on this file since 9fe6c3 was 9fe6c3, checked in by Hans Schoenemann <hannes@…>, 5 years ago
add: subsets(kn,) in subsets.so (all subsets of 1..n with k elements)
  • Property mode set to 100644
File size: 11.5 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  AM_CONDITIONAL([ENABLE_OMALLOC],[test "x$ENABLE_OMALLOC" = xyes])
110])
111
112AC_DEFUN([SING_USE_OMALLOC],
113[
114 AC_ARG_ENABLE(omalloc,
115  [AS_HELP_STRING([--disable-omalloc], [do NOT use omalloc within the factory])],
116  [if test "x$enableval"  = "xyes"; then
117    ENABLE_OMALLOC=yes
118   fi],
119    ENABLE_OMALLOC=add)
120
121 ENABLE_OMALLOC_ARG=""
122
123 if test "x$ENABLE_OMALLOC" = xadd; then
124   ENABLE_OMALLOC=yes
125   ENABLE_OMALLOC_ARG="--enable-omalloc $ENABLE_OMALLOC_ARG"
126 fi
127
128 AC_MSG_CHECKING(whether to use omalloc in factory and co.)
129
130 if test "x$ENABLE_OMALLOC" = xyes; then
131  AC_MSG_RESULT(yes)
132  OMALLOC_INCLUDES="-I$ac_abs_top_srcdir"
133
134  if test "x$ac_abs_top_srcdir" != "x$ac_abs_top_builddir"; then
135    OMALLOC_INCLUDES="$OMALLOC_INCLUDES -I$ac_abs_top_builddir"
136  fi
137
138  OMALLOC_LIBS="$ac_abs_top_builddir/omalloc/libomalloc.la"
139
140  AC_SUBST(OMALLOC_INCLUDES)
141  AC_SUBST(OMALLOC_LIBS)
142
143  ENABLE_OMALLOC_ARG="$ENABLE_OMALLOC_ARG OMALLOC_LIBS='$OMALLOC_LIBS' OMALLOC_INCLUDES='$OMALLOC_INCLUDES'"
144  ac_configure_args="$ac_configure_args $ENABLE_OMALLOC_ARG"
145
146  PKG_REQUIRE="$PKG_REQUIRE omalloc"
147  AC_SUBST(PKG_REQUIRE)
148 else
149  OMALLOC_INCLUDES="-I$ac_abs_top_srcdir"
150  OMALLOC_LIBS="$ac_abs_top_builddir/xalloc/libomalloc.la"
151  AC_SUBST(OMALLOC_INCLUDES)
152  AC_SUBST(OMALLOC_LIBS)
153  AC_MSG_RESULT(no)
154 fi
155
156
157 AM_CONDITIONAL([ENABLE_OMALLOC],[test "x$ENABLE_OMALLOC" = xyes])
158])
159
160AC_DEFUN([SING_USE_RESOURCES],
161[
162 AC_ARG_ENABLE(singular_resources,
163  [AS_HELP_STRING([--disable-singular_resources], [do NOT use libsingular_resources within the factory])],
164  [if test "x$enableval"  = "xyes"; then
165    ENABLE_RESOURCES=yes
166   fi],
167    ENABLE_RESOURCES=yes)
168
169 AC_MSG_CHECKING(whether to use libsingular_resources in factory and co.)
170 if test "x$ENABLE_RESOURCES" = xyes; then
171  AC_MSG_RESULT(yes)
172  RESOURCES_INCLUDES="-I$ac_abs_top_srcdir "
173
174  RESOURCES_LIBS="$ac_abs_top_builddir/resources/libsingular_resources.la"
175
176  AC_SUBST(RESOURCES_INCLUDES)
177  AC_SUBST(RESOURCES_LIBS)
178
179  ENABLE_ARG="--with-Singular RESOURCES_LIBS='$RESOURCES_LIBS' RESOURCES_INCLUDES='$RESOURCES_INCLUDES'"
180
181  ac_configure_args="$ac_configure_args $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 AC_MSG_CHECKING(whether factory should be enabled)
196
197 AC_ARG_ENABLE(factory, AS_HELP_STRING([--disable-factory], [Disable factory]),
198 [if test $enableval = yes; then
199     ENABLE_FACTORY="yes"
200  else
201     ENABLE_FACTORY="no"
202  fi],[ENABLE_FACTORY="yes"])
203
204 if test x$ENABLE_FACTORY = xyes; then
205
206  FACTORY_INCLUDES="-I$ac_abs_top_srcdir -I$ac_abs_top_srcdir/factory/include"
207  if test "x$ac_abs_top_srcdir" != "x$ac_abs_top_builddir"; then
208    FACTORY_INCLUDES="$FACTORY_INCLUDES -I$ac_abs_top_builddir -I$ac_abs_top_builddir/factory/include"
209  fi
210
211  FACTORY_LIBS="$ac_abs_top_builddir/factory/libfactory.la"
212
213  AC_SUBST(FACTORY_INCLUDES)
214  AC_SUBST(FACTORY_LIBS)
215
216  AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
217  AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
218
219  AC_MSG_CHECKING([  FACTORY_LIBS?..])
220  AC_MSG_RESULT(${FACTORY_LIBS:-unset})
221
222  ENABLE_ARG="FACTORY_LIBS='$FACTORY_LIBS' FACTORY_INCLUDES='$FACTORY_INCLUDES'"
223
224  ac_configure_args="$ac_configure_args $ENABLE_ARG"
225
226  PKG_REQUIRE="$PKG_REQUIRE factory"
227  AC_SUBST(PKG_REQUIRE)
228 fi
229
230
231 AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
232 AC_MSG_RESULT($ENABLE_FACTORY)
233
234])
235
236AC_DEFUN([SING_CHECK_FACTORY],
237[
238AC_ARG_ENABLE(factory, AS_HELP_STRING([--disable-factory], [Disable factory]),
239[if test $enableval = yes; then
240     ENABLE_FACTORY="yes"
241 else
242     ENABLE_FACTORY="no"
243 fi
244],[ENABLE_FACTORY="yes"])
245
246  AC_ARG_VAR( [FACTORY_INCLUDES], [INCLUDES for FACTORY] )
247  AC_ARG_VAR( [FACTORY_LIBS], [LIBS for FACTORY] )
248
249  AC_MSG_CHECKING(whether factory should be enabled)
250  if test "x$ENABLE_FACTORY" = xyes; then
251    AC_MSG_RESULT(yes)
252
253    AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
254    AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
255
256    AC_MSG_CHECKING([  FACTORY_LIBS?..])
257    AC_MSG_RESULT(${FACTORY_LIBS:-unset})
258
259
260    CPPFLAGS_save="$CPPFLAGS"
261    CFLAGS_save="$CFLAGS"
262    CXXFLAGS_save="$CXXFLAGS"
263    LIBS_save="$LIBS"
264
265    AC_LANG_PUSH([C++])
266#
267    CPPFLAGS="$CPPFLAGS ${FACTORY_INCLUDES}"
268    CFLAGS="$CFLAGS ${FACTORY_INCLUDES}"
269    CXXFLAGS="$CXXFLAGS ${FACTORY_INCLUDES}"
270    LIBS="${FACTORY_LIBS} $LIBS"
271
272    AC_CHECK_HEADERS([factory/factory.h],,AC_MSG_WARN([trusting the factory locations given: ${FACTORY_INCLUDES}]))
273
274    CFLAGS="$CFLAGS_save"
275    CXXFLAGS="$CXXFLAGS_save"
276    CPPFLAGS="$CPPFLAGS_save"
277    LIBS="$LIBS_save"
278#
279    AC_LANG_POP([C++])
280
281    PKG_REQUIRE="$PKG_REQUIRE factory"
282    AC_SUBST(PKG_REQUIRE)
283  else
284    AC_MSG_RESULT(no)
285  fi
286
287  AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
288  AC_MSG_RESULT($ENABLE_FACTORY)
289
290])
291
292AC_DEFUN([SING_CHECK_PYTHON_MODULE],
293[
294AC_ARG_ENABLE(python_module, AS_HELP_STRING([--enable-python_module], [Enable python_module.so]),
295[if test $enableval = yes; then
296     ENABLE_PYTHON_MODULE="yes"
297     AC_DEFINE(HAVE_PYTHON_MOD,1,[Enable python_module.so])
298 else
299     ENABLE_PYTHON_MODULE="no"
300 fi
301],[ENABLE_PYTHON_MODULE="no"])
302])
303
304
305AC_DEFUN([SING_BUILTIN_MODULES],
306[
307## m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
308 AC_MSG_CHECKING([built-in modules])
309
310 AC_ARG_VAR( [BUILTIN_LIBS], [LIB FLAGS for buildins] )
311 AC_ARG_WITH(builtinmodules,
312   AS_HELP_STRING([--with-builtinmodules], [List of builtin modules (experimental), default: staticdemo,bigintm,syzextra]),
313   [if test "x$with_builtinmodules" = "xyes"; then
314    with_builtinmodules=syzextra
315   fi],
316   [with_builtinmodules=""]
317 )
318 # staticdemo,bigintm,
319 # ,pyobject,gfanlib,polymake,singmathic
320
321 AH_TEMPLATE([SI_BUILTINMODULES_ADD],[Add(list) for Builtin modules])
322
323 #### TODO Dynamic Modules???
324  L=""
325  bi_staticdemo=false
326  bi_subsets=false
327  bi_syzextra=false
328  bi_pyobject=false
329  bi_gfanlib=false
330  bi_polymake=false
331  bi_python=false
332  bi_customstd=false
333  bi_singmathic=false
334  bi_bigintm=false
335  bi_Order=false
336  bi_gitfan=false
337  bi_interval=false
338
339
340 if test -z "$with_builtinmodules"; then
341  AC_MSG_RESULT(no)
342 else
343  AC_MSG_RESULT(yes)
344
345  LL=""
346
347  for a in `echo ${with_builtinmodules}|tr ',' ' '`;
348  do
349    AC_MSG_CHECKING([whether to build-in '$a'?])
350
351      L="${L} add($a)"
352      LL="${LL} $a"
353      BUILTIN_LIBS="${BUILTIN_LIBS} dyn_modules/$a/$a.la"
354      BUILTIN_MODULES="${BUILTIN_MODULES} dyn_modules/$a"
355      AC_MSG_RESULT(yes)
356
357# *) AC_MSG_ERROR([bad value ${enableval} for       --enable-debug]) ;;
358
359      case "${a}" in
360       staticdemo ) bi_staticdemo=true;;
361       subsets ) bi_subsets=true;;
362       syzextra ) bi_syzextra=true ;;
363       pyobject ) bi_pyobject=true ;;
364       gfanlib ) bi_gfanlib=true ;;
365       polymake ) bi_polymake=true ;;
366       python_module ) bi_python=true ;;
367       customstd ) bi_customstd=true ;;
368       singmathic ) bi_singmathic=true ;;
369       bigintm ) bi_bigintm=true ;;
370       Order ) bi_Order=true ;;
371       gitfan ) bi_gitfan=true ;;
372       interval ) bi_interval=true ;;
373      esac
374
375###### In case of out-of tree building: the build dir is empty in configure time!!!
376    if test ! -d "Singular/dyn_modules/$a"; then
377        AC_MSG_WARN([The directory 'Singular/dyn_modules/$a' is missing :(])
378##    else
379##      AC_MSG_RESULT(no)
380    fi
381
382#    A=`echo "SI_BUILTIN_$a" | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:"  -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
383#    echo "A:: $A"
384#    AM_CONDITIONAL(m4_unquote([A]),[test -d "Singular/dyn_modules/$a"]) ## :(((
385  done # for
386
387  AC_DEFINE_UNQUOTED([SI_BUILTINMODULES],"$LL",[Refined list of builtin modules])
388
389 fi # else ("x$with_builtinmodules" != xno)
390
391 AC_MSG_CHECKING([SI_BUILTINMODULES_ADD(add)...])
392 AC_MSG_RESULT(${L:-unset})
393
394 AC_DEFINE_UNQUOTED([SI_BUILTINMODULES_ADD(add)],[$L],[Add(list) for Builtin modules])
395 AC_SUBST(BUILTIN_LIBS)
396 AC_SUBST(BUILTIN_MODULES)
397
398 AM_CONDITIONAL([SI_BUILTIN_STATICDEMO], [test x$bi_staticdemo = xtrue])
399 AM_CONDITIONAL([SI_BUILTIN_SUBSETS], [test x$bi_subsets = 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
413 AC_MSG_CHECKING([BUILTIN_LIBS...])
414 AC_MSG_RESULT(${BUILTIN_LIBS:-unset})
415])
Note: See TracBrowser for help on using the repository browser.