source: git/m4/options.m4 @ 1e210d

spielwiese
Last change on this file since 1e210d was 75f460, checked in by Hans Schoenemann <hannes@…>, 9 years ago
format
  • Property mode set to 100644
File size: 10.1 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(resources,
154  [AS_HELP_STRING([--disable-resources], [do NOT use libresources 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 libresources 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/libresources.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 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  AC_DEFINE(HAVE_FACTORY,[1],[Enable factory])
214
215  ENABLE_ARG="FACTORY_LIBS='$FACTORY_LIBS' FACTORY_INCLUDES='$FACTORY_INCLUDES'"
216
217  ac_configure_args="$ac_configure_args $ENABLE_ARG"
218
219  PKG_REQUIRE="$PKG_REQUIRE factory"
220  AC_SUBST(PKG_REQUIRE)
221 fi
222
223
224 AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
225 AC_MSG_RESULT($ENABLE_FACTORY)
226
227])
228
229AC_DEFUN([SING_CHECK_FACTORY],
230[
231AC_ARG_ENABLE(factory, AS_HELP_STRING([--disable-factory], [Disable factory]),
232[if test $enableval = yes; then
233     ENABLE_FACTORY="yes"
234 else
235     ENABLE_FACTORY="no"
236 fi
237],[ENABLE_FACTORY="yes"])
238
239  AC_ARG_VAR( [FACTORY_INCLUDES], [INCLUDES for FACTORY] )
240  AC_ARG_VAR( [FACTORY_LIBS], [LIBS for FACTORY] )
241
242  AC_MSG_CHECKING(whether factory should be enabled)
243  if test "x$ENABLE_FACTORY" = xyes; then
244    AC_MSG_RESULT(yes)
245
246    AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
247    AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
248
249    AC_MSG_CHECKING([  FACTORY_LIBS?..])
250    AC_MSG_RESULT(${FACTORY_LIBS:-unset})
251
252
253    CPPFLAGS_save="$CPPFLAGS"
254    CFLAGS_save="$CFLAGS"
255    CXXFLAGS_save="$CXXFLAGS"
256    LIBS_save="$LIBS"
257
258    AC_LANG_PUSH([C++])
259#
260    CPPFLAGS="$CPPFLAGS ${FACTORY_INCLUDES}"
261    CFLAGS="$CFLAGS ${FACTORY_INCLUDES}"
262    CXXFLAGS="$CXXFLAGS ${FACTORY_INCLUDES}"
263    LIBS="${FACTORY_LIBS} $LIBS"
264
265    AC_CHECK_HEADERS([factory/factory.h],,AC_MSG_WARN([trusting the factory locations given: ${FACTORY_INCLUDES}]))
266
267    CFLAGS="$CFLAGS_save"
268    CXXFLAGS="$CXXFLAGS_save"
269    CPPFLAGS="$CPPFLAGS_save"
270    LIBS="$LIBS_save"
271#
272    AC_LANG_POP([C++])
273
274    AC_DEFINE(HAVE_FACTORY,[1],[Enable factory])
275
276    PKG_REQUIRE="$PKG_REQUIRE factory"
277    AC_SUBST(PKG_REQUIRE)
278  else
279    AC_MSG_RESULT(no)
280  fi
281
282  AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
283  AC_MSG_RESULT($ENABLE_FACTORY)
284
285])
286
287
288
289AC_DEFUN([SING_BUILTIN_MODULES],
290[
291## m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
292 AC_MSG_CHECKING([built-in modules])
293
294 AC_ARG_VAR( [BUILTIN_LIBS], [LIB FLAGS for buildins] )
295 AC_ARG_WITH(builtinmodules,
296   AS_HELP_STRING([--with-builtinmodules], [List of builtin modules (experimental), default: staticdemo,bigintm,syzextra]),
297   [if test "x$with_builtinmodules" = "xyes"; then
298    with_builtinmodules=syzextra
299   fi],
300   [with_builtinmodules=""]
301 )
302 # staticdemo,bigintm,
303 # ,pyobject,gfanlib,polymake,singmathic
304
305 AH_TEMPLATE([SI_BUILTINMODULES_ADD],[Add(list) for Builtin modules])
306
307 #### TODO Dynamic Modules???
308  L=""
309  bi_staticdemo=false
310  bi_syzextra=false
311  bi_pyobject=false
312  bi_gfanlib=false
313  bi_polymake=false
314  bi_singmathic=false
315  bi_bigintm=false
316  bi_Order=false
317
318
319 if test -z "$with_builtinmodules"; then
320  AC_MSG_RESULT(no)
321 else
322  AC_MSG_RESULT(yes)
323
324  LL=""
325
326  for a in `echo ${with_builtinmodules}|tr ',' ' '`;
327  do
328    AC_MSG_CHECKING([whether to build-in '$a'?])
329
330      L="${L} add($a)"
331      LL="${LL} $a"
332      BUILTIN_LIBS="${BUILTIN_LIBS} dyn_modules/$a/$a.la"
333      AC_MSG_RESULT(yes)
334
335# *) AC_MSG_ERROR([bad value ${enableval} for       --enable-debug]) ;;
336
337      case "${a}" in
338       staticdemo ) bi_staticdemo=true;;
339       syzextra ) bi_syzextra=true ;;
340       pyobject ) bi_pyobject=true ;;
341       gfanlib ) bi_gfanlib=true ;;
342       polymake ) bi_polymake=true ;;
343       singmathic ) bi_singmathic=true ;;
344       bigintm ) bi_bigintm=true ;;
345       Order ) bi_Order=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_SINGMATHIC], [test x$bi_singmathic = xtrue])
376 AM_CONDITIONAL([SI_BUILTIN_BIGINTM], [test x$bi_bigintm = xtrue])
377 AM_CONDITIONAL([SI_BUILTIN_ORDER], [test x$bi_Order = xtrue])
378
379 AC_MSG_CHECKING([BUILTIN_LIBS...])
380 AC_MSG_RESULT(${BUILTIN_LIBS:-unset})
381])
382
383
Note: See TracBrowser for help on using the repository browser.