source: git/m4/options.m4 @ 7761b3

spielwiese
Last change on this file since 7761b3 was 7761b3, checked in by Oleksandr Motsak <motsak@…>, 9 years ago
Fix configure test for built-ins / FreeBSD10
  • Property mode set to 100644
File size: 10.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[if test "x$enableval" = xyes; then
27     ENABLE_PLURAL="yes"
28 else
29     ENABLE_PLURAL="no"
30 fi
31],[ENABLE_PLURAL="yes"])
32
33if test "x$ENABLE_PLURAL" = xyes; then
34  AC_DEFINE(HAVE_PLURAL,[1],[Enable non-commutative subsystem])
35  #TODO make a seperate switch
36  AC_DEFINE(HAVE_SHIFTBBA,[1],[Enable letterplace])
37fi
38
39AM_CONDITIONAL([ENABLE_PLURAL],[test x$ENABLE_PLURAL = xyes])
40
41AC_MSG_RESULT($ENABLE_PLURAL)
42
43
44AC_ARG_WITH(RatGB, AS_HELP_STRING([--with-ratGB], [do compile with ratGB support (experimental)]))
45
46AC_MSG_CHECKING(whether to have ratGB)
47if test "x$with_ratGB" != xyes && test "x$enable_ratGB" != xyes; then
48  AC_MSG_RESULT(no)
49else
50  AC_DEFINE(HAVE_RATGRING, 1, [Enable RatGB support])
51  AC_MSG_RESULT(yes)
52fi
53
54
55])
56
57
58AC_DEFUN([SING_CHECK_OMALLOC],
59[
60  AC_ARG_ENABLE(omalloc,
61    [AS_HELP_STRING([--enable-omalloc],[build for use with omalloc])],
62    [if test "x$enableval" = "xyes"; then
63      ENABLE_OMALLOC=yes
64    fi],
65      ENABLE_OMALLOC=no)
66
67  AC_ARG_VAR( [OMALLOC_INCLUDES], [INCLUDES for libomalloc] )
68  AC_ARG_VAR( [OMALLOC_LIBS], [LIBS for libomalloc] )
69
70  AC_MSG_CHECKING([whether to use omalloc])
71
72  AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
73
74  if test "x$ENABLE_OMALLOC" = xyes; then
75    AC_MSG_RESULT(yes)
76
77    AC_MSG_CHECKING([  OMALLOC_INCLUDES?..])
78    AC_MSG_RESULT(${OMALLOC_INCLUDES:-unset})
79
80    AC_MSG_CHECKING([  OMALLOC_LIBS?..])
81    AC_MSG_RESULT(${OMALLOC_LIBS:-unset})
82
83    CPPFLAGS_save="$CPPFLAGS"
84    CFLAGS_save="$CFLAGS"
85    LIBS_save="$LIBS"
86
87    AC_LANG_PUSH([C])
88#
89    CPPFLAGS="$CPPFLAGS ${OMALLOC_INCLUDES}"
90    CFLAGS="$CFLAGS ${OMALLOC_INCLUDES}"
91    LIBS="$LIBS ${OMALLOC_LIBS}"
92
93    AC_CHECK_HEADERS([omalloc/omalloc.h],,AC_MSG_WARN([trusting the omalloc locations given: ${OMALLOC_INCLUDES}]))
94
95    CFLAGS="$CFLAGS_save"
96    CPPFLAGS="$CPPFLAGS_save"
97    LIBS="$LIBS_save"
98#
99    AC_LANG_POP([C])
100
101    AC_DEFINE([HAVE_OMALLOC],[1])
102 
103    PKG_REQUIRE="$PKG_REQUIRE omalloc"
104    AC_SUBST(PKG_REQUIRE)
105  else
106    AC_MSG_RESULT(no)
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  AC_MSG_RESULT(no)
150 fi
151
152
153 AM_CONDITIONAL([ENABLE_OMALLOC],[test "x$ENABLE_OMALLOC" = xyes])
154])
155
156AC_DEFUN([SING_USE_RESOURCES],
157[
158 AC_ARG_ENABLE(resources,
159  [AS_HELP_STRING([--disable-resources], [do NOT use libresources 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 libresources 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/libresources.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 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/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/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  AC_DEFINE(HAVE_FACTORY,[1],[Enable factory])
219
220  ENABLE_ARG="FACTORY_LIBS='$FACTORY_LIBS' FACTORY_INCLUDES='$FACTORY_INCLUDES'"
221
222  ac_configure_args="$ac_configure_args $ENABLE_ARG"
223
224  PKG_REQUIRE="$PKG_REQUIRE factory"
225  AC_SUBST(PKG_REQUIRE)
226 fi
227
228
229 AM_CONDITIONAL([ENABLE_FACTORY],[test x$ENABLE_FACTORY = xyes])
230 AC_MSG_RESULT($ENABLE_FACTORY)
231
232])
233
234AC_DEFUN([SING_CHECK_FACTORY],
235[
236AC_ARG_ENABLE(factory, AS_HELP_STRING([--disable-factory], [Disable factory]),
237[if test $enableval = yes; then
238     ENABLE_FACTORY="yes"
239 else
240     ENABLE_FACTORY="no"
241 fi
242],[ENABLE_FACTORY="yes"])
243
244  AC_ARG_VAR( [FACTORY_INCLUDES], [INCLUDES for FACTORY] )
245  AC_ARG_VAR( [FACTORY_LIBS], [LIBS for FACTORY] )
246
247  AC_MSG_CHECKING(whether factory should be enabled)
248  if test "x$ENABLE_FACTORY" = xyes; then
249    AC_MSG_RESULT(yes)
250
251    AC_MSG_CHECKING([  FACTORY_INCLUDES?..])
252    AC_MSG_RESULT(${FACTORY_INCLUDES:-unset})
253
254    AC_MSG_CHECKING([  FACTORY_LIBS?..])
255    AC_MSG_RESULT(${FACTORY_LIBS:-unset})
256
257
258    CPPFLAGS_save="$CPPFLAGS"
259    CFLAGS_save="$CFLAGS"
260    CXXFLAGS_save="$CXXFLAGS"
261    LIBS_save="$LIBS"
262
263    AC_LANG_PUSH([C++])
264#
265    CPPFLAGS="$CPPFLAGS ${FACTORY_INCLUDES}"
266    CFLAGS="$CFLAGS ${FACTORY_INCLUDES}"
267    CXXFLAGS="$CXXFLAGS ${FACTORY_INCLUDES}"
268    LIBS="${FACTORY_LIBS} $LIBS"
269 
270    AC_CHECK_HEADERS([factory/factory.h],,AC_MSG_WARN([trusting the factory locations given: ${FACTORY_INCLUDES}]))
271
272    CFLAGS="$CFLAGS_save"
273    CXXFLAGS="$CXXFLAGS_save"
274    CPPFLAGS="$CPPFLAGS_save"
275    LIBS="$LIBS_save"
276#
277    AC_LANG_POP([C++])
278
279    AC_DEFINE(HAVE_FACTORY,[1],[Enable factory])
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
292
293
294AC_DEFUN([SING_BUILTIN_MODULES],
295[
296## m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
297 AC_MSG_CHECKING([built-in modules])
298
299 AC_ARG_VAR( [BUILTIN_LIBS], [LIB FLAGS for buildins] )
300 AC_ARG_WITH(builtinmodules,
301   AS_HELP_STRING([--with-builtinmodules], [List of builtin modules (experimental), default: staticdemo,bigintm,syzextra]),
302   [if test "x$with_builtinmodules" == xyes; then
303    with_builtinmodules=syzextra
304   fi],
305   [with_builtinmodules=""]
306 )
307 # staticdemo,bigintm,
308 # ,pyobject,gfanlib,polymake,singmathic
309
310 AH_TEMPLATE([SI_BUILTINMODULES_ADD],[Add(list) for Builtin modules])
311
312 #### TODO Dynamic Modules???
313  L=""
314  bi_staticdemo=false
315  bi_syzextra=false
316  bi_pyobject=false
317  bi_gfanlib=false
318  bi_polymake=false
319  bi_singmathic=false
320  bi_bigintm=false
321  bi_Order=false
322 
323 
324 if test -z "$with_builtinmodules"; then
325  AC_MSG_RESULT(no)
326 else
327  AC_MSG_RESULT(yes)
328 
329  LL=""
330 
331  for a in `echo ${with_builtinmodules}|tr ',' ' '`;
332  do
333    AC_MSG_CHECKING([whether to build-in '$a'?])
334   
335      L="${L} add($a)"
336      LL="${LL} $a"
337      BUILTIN_LIBS="${BUILTIN_LIBS} dyn_modules/$a/$a.la"
338      AC_MSG_RESULT(yes)
339     
340# *) AC_MSG_ERROR([bad value ${enableval} for       --enable-debug]) ;;
341
342      case "${a}" in
343       staticdemo ) bi_staticdemo=true;;
344       syzextra ) bi_syzextra=true ;;
345       pyobject ) bi_pyobject=true ;;
346       gfanlib ) bi_gfanlib=true ;;
347       polymake ) bi_polymake=true ;;
348       singmathic ) bi_singmathic=true ;;
349       bigintm ) bi_bigintm=true ;;       
350       Order ) bi_Order=true ;;       
351      esac
352
353###### In case of out-of tree building: the build dir is empty in configure time!!!
354    if test ! -d "Singular/dyn_modules/$a"; then
355        AC_MSG_WARN([The directory 'Singular/dyn_modules/$a' is missing :(])
356##    else
357##      AC_MSG_RESULT(no)
358    fi
359   
360#    A=`echo "SI_BUILTIN_$a" | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:"  -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`     
361#    echo "A:: $A"
362#    AM_CONDITIONAL(m4_unquote([A]),[test -d "Singular/dyn_modules/$a"]) ## :(((
363  done # for
364
365  AC_DEFINE_UNQUOTED([SI_BUILTINMODULES],"$LL",[Refined list of builtin modules])
366
367 fi # else ("x$with_builtinmodules" != xno)
368 
369 AC_MSG_CHECKING([SI_BUILTINMODULES_ADD(add)...])
370 AC_MSG_RESULT(${L:-unset})
371 
372 AC_DEFINE_UNQUOTED([SI_BUILTINMODULES_ADD(add)],[$L],[Add(list) for Builtin modules])
373 AC_SUBST(BUILTIN_LIBS)
374 
375 AM_CONDITIONAL([SI_BUILTIN_STATICDEMO], [test x$bi_staticdemo = xtrue])
376 AM_CONDITIONAL([SI_BUILTIN_SYZEXTRA], [test x$bi_syzextra = xtrue])
377 AM_CONDITIONAL([SI_BUILTIN_PYOBJECT], [test x$bi_pyobject = xtrue])
378 AM_CONDITIONAL([SI_BUILTIN_GFANLIB], [test x$bi_gfanlib = xtrue])
379 AM_CONDITIONAL([SI_BUILTIN_POLYMAKE], [test x$bi_polymake = xtrue])
380 AM_CONDITIONAL([SI_BUILTIN_SINGMATHIC], [test x$bi_singmathic = xtrue])
381 AM_CONDITIONAL([SI_BUILTIN_BIGINTM], [test x$bi_bigintm = xtrue])
382 AM_CONDITIONAL([SI_BUILTIN_ORDER], [test x$bi_Order = xtrue])
383 
384 AC_MSG_CHECKING([BUILTIN_LIBS...])
385 AC_MSG_RESULT(${BUILTIN_LIBS:-unset})
386])
387
388
Note: See TracBrowser for help on using the repository browser.