source: git/m4/options.m4 @ 26b42d

fieker-DuValspielwiese
Last change on this file since 26b42d was 88534e9, checked in by Hans Schoenemann <hannes@…>, 4 years ago
fix: factory paths for a sep. factory distribution
  • Property mode set to 100644
File size: 12.0 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 AC_MSG_CHECKING(whether factory should be enabled)
192
193 AC_ARG_ENABLE(factory, AS_HELP_STRING([--disable-factory], [Disable factory]),
194 [if test $enableval = yes; then
195     ENABLE_FACTORY="yes"
196  else
197     ENABLE_FACTORY="no"
198  fi],[ENABLE_FACTORY="yes"])
199
200 if test x$ENABLE_FACTORY = xyes; then
201
202  FACTORY_INCLUDES="-I$ac_abs_top_srcdir -I$ac_abs_top_srcdir/factory -I$ac_abs_top_srcdir/factory/include"
203  if test "x$ac_abs_top_srcdir" != "x$ac_abs_top_builddir"; then
204    FACTORY_INCLUDES="$FACTORY_INCLUDES -I$ac_abs_top_builddir -I$ac_abs_top_builddir/factory -I$ac_abs_top_builddir/factory/include"
205  fi
206
207  FACTORY_LIBS="$ac_abs_top_builddir/factory/libfactory.la"
208
209  AC_SUBST(FACTORY_INCLUDES)
210  AC_SUBST(FACTORY_LIBS)
211
212  AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
213  AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
214
215  AC_MSG_CHECKING([  FACTORY_LIBS?..])
216  AC_MSG_RESULT(${FACTORY_LIBS:-unset})
217
218  ENABLE_ARG="FACTORY_LIBS='$FACTORY_LIBS' FACTORY_INCLUDES='$FACTORY_INCLUDES'"
219
220  ac_configure_args="$ac_configure_args $ENABLE_ARG"
221
222  PKG_REQUIRE="$PKG_REQUIRE factory"
223  AC_SUBST(PKG_REQUIRE)
224 fi
225
226
227 AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
228 AC_MSG_RESULT($ENABLE_FACTORY)
229
230])
231
232AC_DEFUN([SING_CHECK_FACTORY],
233[
234AC_ARG_ENABLE(factory, AS_HELP_STRING([--disable-factory], [Disable factory]),
235[if test $enableval = yes; then
236     ENABLE_FACTORY="yes"
237 else
238     ENABLE_FACTORY="no"
239 fi
240],[ENABLE_FACTORY="yes"])
241
242  AC_ARG_VAR( [FACTORY_INCLUDES], [INCLUDES for FACTORY] )
243  AC_ARG_VAR( [FACTORY_LIBS], [LIBS for FACTORY] )
244
245  AC_MSG_CHECKING(whether factory should be enabled)
246  if test "x$ENABLE_FACTORY" = xyes; then
247    AC_MSG_RESULT(yes)
248
249    AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
250    AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
251
252    AC_MSG_CHECKING([  FACTORY_LIBS?..])
253    AC_MSG_RESULT(${FACTORY_LIBS:-unset})
254
255
256    CPPFLAGS_save="$CPPFLAGS"
257    CFLAGS_save="$CFLAGS"
258    CXXFLAGS_save="$CXXFLAGS"
259    LIBS_save="$LIBS"
260
261    AC_LANG_PUSH([C++])
262#
263    CPPFLAGS="$CPPFLAGS ${FACTORY_INCLUDES}"
264    CFLAGS="$CFLAGS ${FACTORY_INCLUDES}"
265    CXXFLAGS="$CXXFLAGS ${FACTORY_INCLUDES}"
266    LIBS="${FACTORY_LIBS} $LIBS"
267
268    AC_CHECK_HEADERS([factory/factory.h],,AC_MSG_WARN([trusting the factory locations given: ${FACTORY_INCLUDES}]))
269
270    CFLAGS="$CFLAGS_save"
271    CXXFLAGS="$CXXFLAGS_save"
272    CPPFLAGS="$CPPFLAGS_save"
273    LIBS="$LIBS_save"
274#
275    AC_LANG_POP([C++])
276
277    PKG_REQUIRE="$PKG_REQUIRE factory"
278    AC_SUBST(PKG_REQUIRE)
279  else
280    AC_MSG_RESULT(no)
281  fi
282
283  AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
284  AC_MSG_RESULT($ENABLE_FACTORY)
285
286])
287
288AC_DEFUN([SING_CHECK_PYTHON_MODULE],
289[
290AC_ARG_ENABLE(python_module, AS_HELP_STRING([--enable-python_module], [Enable python_module.so]),
291[if test $enableval = yes; then
292     ENABLE_PYTHON_MODULE="yes"
293     AC_DEFINE(HAVE_PYTHON_MOD,1,[Enable python_module.so])
294 else
295     ENABLE_PYTHON_MODULE="no"
296 fi
297],[ENABLE_PYTHON_MODULE="no"])
298])
299
300
301AC_DEFUN([SING_BUILTIN_MODULES],
302[
303## m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
304 AC_MSG_CHECKING([built-in modules])
305
306 AC_ARG_VAR( [BUILTIN_LIBS], [LIB FLAGS for buildins] )
307 AC_ARG_WITH(builtinmodules,
308   AS_HELP_STRING([--with-builtinmodules], [List of builtin modules (experimental), default: staticdemo,bigintm,syzextra]),
309   [if test "x$with_builtinmodules" = "xyes"; then
310    with_builtinmodules=syzextra
311   fi],
312   [with_builtinmodules=""]
313 )
314 # staticdemo,bigintm,
315 # ,pyobject,gfanlib,polymake,singmathic
316
317 AH_TEMPLATE([SI_BUILTINMODULES_ADD],[Add(list) for Builtin modules])
318
319 #### TODO Dynamic Modules???
320  L=""
321  bi_staticdemo=false
322  bi_subsets=false
323  bi_freealgebra=false
324  bi_partialgb=false
325  bi_syzextra=false
326  bi_pyobject=false
327  bi_gfanlib=false
328  bi_polymake=false
329  bi_python=false
330  bi_customstd=false
331  bi_singmathic=false
332  bi_bigintm=false
333  bi_Order=false
334  bi_gitfan=false
335  bi_interval=false
336  bi_systhreads=false
337  bi_loctriv=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       freealgebra ) bi_freealgebra=true;;
363       partialgb ) bi_partialgb=true;;
364       syzextra ) bi_syzextra=true ;;
365       pyobject ) bi_pyobject=true ;;
366       gfanlib ) bi_gfanlib=true ;;
367       polymake ) bi_polymake=true ;;
368       python_module ) bi_python=true ;;
369       customstd ) bi_customstd=true ;;
370       singmathic ) bi_singmathic=true ;;
371       bigintm ) bi_bigintm=true ;;
372       Order ) bi_Order=true ;;
373       gitfan ) bi_gitfan=true ;;
374       interval ) bi_interval=true ;;
375       systhreads ) bi_systhreads=true;;
376       loctriv ) bi_loctriv=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([HAVE_PYTHON_MODULE], [test x$ENABLE_PYTHON_MODULE = xyes])
412 AM_CONDITIONAL([SI_BUILTIN_CUSTOMSTD], [test x$bi_customstd = xtrue])
413 AM_CONDITIONAL([SI_BUILTIN_SINGMATHIC], [test x$bi_singmathic = xtrue])
414 AM_CONDITIONAL([SI_BUILTIN_BIGINTM], [test x$bi_bigintm = xtrue])
415 AM_CONDITIONAL([SI_BUILTIN_ORDER], [test x$bi_Order = xtrue])
416 AM_CONDITIONAL([SI_BUILTIN_GITFAN], [test x$bi_gitfan = xtrue])
417 AM_CONDITIONAL([SI_BUILTIN_INTERVAL], [test x$bi_interval = xtrue])
418 AM_CONDITIONAL([SI_BUILTIN_SYSTHREADS], [test x$bi_systhreads = xtrue])
419 AM_CONDITIONAL([SI_BUILTIN_LOCTRIV], [test x$bi_loctriv = xtrue])
420 AM_CONDITIONAL([SI_BUILTIN_MACHINELEARNING], [test x$bi_machinelearning = 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.