source: git/m4/options.m4 @ f234fb2

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