1 | dnl Process this file with autoconf to produce a configure script |
---|
2 | AC_INIT(Singular/matpol.h) |
---|
3 | AC_PREFIX_DEFAULT(`pwd`) |
---|
4 | OUTPUT_MAKEFILES="Makefile" |
---|
5 | if test -d "doc"; then |
---|
6 | OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES doc/Makefile doc/version.texi doc/uname.texi" |
---|
7 | fi |
---|
8 | if test -d "rpm"; then |
---|
9 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/Makefile" |
---|
10 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/rpmrc rpm/Singular.spec" |
---|
11 | fi |
---|
12 | if test -d "modules"; then |
---|
13 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/Makefile" |
---|
14 | fi |
---|
15 | if test -d "modules/tools"; then |
---|
16 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/tools/Makefile" |
---|
17 | fi |
---|
18 | if test -d "modules/modgen"; then |
---|
19 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/modgen/Makefile" |
---|
20 | fi |
---|
21 | if test -d "emacs"; then |
---|
22 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" emacs/Makefile" |
---|
23 | fi |
---|
24 | if test -d "IntegerProgramming"; then |
---|
25 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" IntegerProgramming/Makefile" |
---|
26 | fi |
---|
27 | |
---|
28 | pwd=`pwd` |
---|
29 | |
---|
30 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
31 | dnl determine singuname |
---|
32 | dnl |
---|
33 | AC_MSG_CHECKING(uname for singular) |
---|
34 | AC_CACHE_VAL(ac_cv_singuname, |
---|
35 | ac_cv_singuname="unknown" |
---|
36 | if test -r "singuname.sh"; then |
---|
37 | if (/bin/sh singuname.sh >/dev/null 2>&1) then |
---|
38 | ac_cv_singuname=`/bin/sh singuname.sh` |
---|
39 | fi |
---|
40 | fi |
---|
41 | ) |
---|
42 | AC_MSG_RESULT($ac_cv_singuname) |
---|
43 | if test "$ac_cv_singuname" = unknown; then |
---|
44 | AC_MSG_ERROR(Unknown architecture: Check singuname.sh) |
---|
45 | else |
---|
46 | SINGUNAME=$ac_cv_singuname |
---|
47 | AC_SUBST(SINGUNAME) |
---|
48 | fi |
---|
49 | |
---|
50 | if test "$ac_cv_singuname" = ix86-Win; then |
---|
51 | EXEC_EXT=".exe" |
---|
52 | fi |
---|
53 | |
---|
54 | SING_UNAME=`echo $SINGUNAME | tr '-' '_' ` |
---|
55 | AC_SUBST(SING_UNAME) |
---|
56 | |
---|
57 | VERSION_SEP="-" |
---|
58 | |
---|
59 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
60 | dnl Version business -- set these here |
---|
61 | dnl |
---|
62 | # make them to env variables |
---|
63 | # pass them indirectly to subsequent configures |
---|
64 | SINGULAR_MAJOR_VERSION=1 |
---|
65 | SINGULAR_MINOR_VERSION=3 |
---|
66 | SINGULAR_SUB_VERSION=7 |
---|
67 | SINGULAR_SHORT_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}" |
---|
68 | SINGULAR_VERSION="${SINGULAR_SHORT_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}" |
---|
69 | VERSION_DATE="April 2000" |
---|
70 | |
---|
71 | export SINGULAR_MINOR_VERSION |
---|
72 | export SINGULAR_MAJOR_VERSION |
---|
73 | export SINGULAR_SUB_VERSION |
---|
74 | export SINGULAR_VERSION |
---|
75 | export VERSION_DATE |
---|
76 | |
---|
77 | dnl substitue them into the Makefiles |
---|
78 | AC_SUBST(SINGULAR_VERSION) |
---|
79 | AC_SUBST(VERSION_DATE) |
---|
80 | AC_SUBST(SINGULAR_SHORT_VERSION) |
---|
81 | |
---|
82 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
83 | dnl compiler stuff |
---|
84 | dnl is needed to check for libs and headers, later on |
---|
85 | dnl |
---|
86 | AC_PROG_CC |
---|
87 | AC_PROG_CPP |
---|
88 | AC_PROG_INSTALL |
---|
89 | AC_AIX |
---|
90 | dnl we do not want to have "-g -O" for CFLAGS |
---|
91 | if test "${CXXFLAGS+set}" != set; then |
---|
92 | ac_cxxflags_set=no |
---|
93 | CXXFLAGS="-O" |
---|
94 | fi |
---|
95 | if test "${CFLAGS+set}" != set; then |
---|
96 | CFLAGS="-O" |
---|
97 | ac_cflags_set=no |
---|
98 | fi |
---|
99 | |
---|
100 | # check whether CXX was set by user as env variable |
---|
101 | if test "${CXX+set}" != set; then |
---|
102 | ac_cxx_set=no |
---|
103 | else |
---|
104 | ac_cxx_set=yes |
---|
105 | fi |
---|
106 | AC_PROG_CXX |
---|
107 | |
---|
108 | # check whether the compiler accepts -pipe |
---|
109 | AC_MSG_CHECKING(whether compiler accepts -pipe) |
---|
110 | temp_cflags=${CFLAGS} |
---|
111 | CFLAGS="${CFLAGS} -pipe" |
---|
112 | AC_CACHE_VAL(ac_cv_cxx_have_pipe, |
---|
113 | AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no) |
---|
114 | ) |
---|
115 | AC_MSG_RESULT(${ac_cv_cxx_have_pipe}) |
---|
116 | CFLAGS=${temp_cflags} |
---|
117 | if test "${ac_cv_cxx_have_pipe}" != yes; then |
---|
118 | PIPE= |
---|
119 | else |
---|
120 | PIPE="-pipe" |
---|
121 | fi |
---|
122 | AC_SUBST(PIPE) |
---|
123 | |
---|
124 | AC_CHECK_PROGS(PERL, perl5 perl) |
---|
125 | AC_CHECK_PROGS(UUDECODE, uudecode "uudeview -i") |
---|
126 | AC_CHECK_PROGS(GUNZIP, gunzip, ${pwd}/warn_not_found.sh gunzip) |
---|
127 | # don't use GZIP this breaks configure |
---|
128 | AC_CHECK_PROGS(MYGZIP, gzip, ${pwd}/warn_not_found.sh gzip) |
---|
129 | AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html) |
---|
130 | AC_PROG_LN_S |
---|
131 | |
---|
132 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
133 | dnl Set exec_prefix, bindir, libdir, includedir to some sensible values |
---|
134 | dnl |
---|
135 | # expand prefix and pass it to subsequent configures |
---|
136 | if test "x$prefix" = xNONE; then |
---|
137 | prefix=${ac_default_prefix} |
---|
138 | ac_configure_args="$ac_configure_args --prefix=${prefix}" |
---|
139 | fi |
---|
140 | |
---|
141 | # expand exec_prefix |
---|
142 | if test "x$exec_prefix" = xNONE; then |
---|
143 | exec_prefix=${prefix}/${ac_cv_singuname} |
---|
144 | ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}" |
---|
145 | fi |
---|
146 | |
---|
147 | # expand bindir |
---|
148 | if test "x$bindir" = 'x${exec_prefix}/bin'; then |
---|
149 | bindir="${exec_prefix}" |
---|
150 | ac_configure_args="$ac_configure_args --bindir=${bindir}" |
---|
151 | fi |
---|
152 | |
---|
153 | # expand libdir |
---|
154 | if test "x$libdir" = 'x${exec_prefix}/lib'; then |
---|
155 | libdir="${exec_prefix}/lib" |
---|
156 | ac_configure_args="$ac_configure_args --libdir=${libdir}" |
---|
157 | fi |
---|
158 | |
---|
159 | # expand includedir |
---|
160 | if test "x$includedir" = 'x${prefix}/include'; then |
---|
161 | includedir="${exec_prefix}/include" |
---|
162 | ac_configure_args="$ac_configure_args --includedir=${includedir}" |
---|
163 | fi |
---|
164 | |
---|
165 | # construct name of installed Singular executable |
---|
166 | SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}${EXEC_EXT} |
---|
167 | export SINGULAR |
---|
168 | AC_SUBST(SINGULAR) |
---|
169 | |
---|
170 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
171 | dnl Check for various libraries and headers |
---|
172 | dnl |
---|
173 | dnl After this part, the variables 'ac_<package>_ok' is 'yes' |
---|
174 | dnl if '<package>' is already existent on the system, otherwise |
---|
175 | dnl undefined. |
---|
176 | dnl |
---|
177 | |
---|
178 | # add -I to CPPFLAGS and -L to LDFLAGS, just to be sure |
---|
179 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
180 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
181 | |
---|
182 | # check for AIX |
---|
183 | AC_MSG_CHECKING(whether _AIX is defined) |
---|
184 | AC_CACHE_VAL(ac_cv_is_aix, |
---|
185 | AC_EGREP_CPP(yes, |
---|
186 | [#ifdef _AIX |
---|
187 | yes |
---|
188 | #endif |
---|
189 | ], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1)) |
---|
190 | if test "$ac_cv_is_aix" = yes; then |
---|
191 | AC_MSG_RESULT(yes) |
---|
192 | else |
---|
193 | AC_MSG_RESULT(no) |
---|
194 | fi |
---|
195 | |
---|
196 | AC_CHECK_LIB(m, atof) |
---|
197 | AC_CHECK_LIB(bsd, socket) |
---|
198 | AC_CHECK_LIB(socket, listen) |
---|
199 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
200 | AC_CHECK_LIB(gmp, main) |
---|
201 | AC_CHECK_LIB(smallgmp, mpz_init) |
---|
202 | AC_CHECK_LIB(MP, IMP_PutGmpInt) |
---|
203 | AC_CHECK_LIB(MPT, MPT_GetTree) |
---|
204 | AC_CHECK_LIB(singcf, atof) |
---|
205 | AC_CHECK_LIB(singfac, atof) |
---|
206 | |
---|
207 | AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h MPT.h factory.h factor.h) |
---|
208 | |
---|
209 | if test "$ac_cv_lib_gmp_main" = yes && \ |
---|
210 | test "$ac_cv_header_gmp_h" = yes; then |
---|
211 | ac_gmp_ok=yes |
---|
212 | fi |
---|
213 | |
---|
214 | if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \ |
---|
215 | test "$ac_cv_header_smallgmp_h" = yes && \ |
---|
216 | test "$ac_cv_header_gmp_h" = yes; then |
---|
217 | ac_smallgmp_ok=yes |
---|
218 | fi |
---|
219 | |
---|
220 | if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \ |
---|
221 | test "$ac_cv_lib_MPT_MPT_GetTree" && \ |
---|
222 | test "$ac_cv_header_MP_h" = yes && \ |
---|
223 | test "$ac_cv_header_MPT_h" = yes; then |
---|
224 | ac_MP_ok=yes |
---|
225 | fi |
---|
226 | |
---|
227 | if test "$ac_cv_lib_singcf_atof" = yes && \ |
---|
228 | test "$ac_cv_header_factory_h" = yes; then |
---|
229 | ac_factory_ok=yes |
---|
230 | fi |
---|
231 | |
---|
232 | if test "$ac_cv_lib_singfac_atof" = yes && \ |
---|
233 | test "$ac_cv_header_factor_h" = yes; then |
---|
234 | ac_libfac_ok=yes |
---|
235 | fi |
---|
236 | |
---|
237 | |
---|
238 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
239 | dnl Check command line arguments |
---|
240 | dnl |
---|
241 | AC_ARG_WITH(tmpdir, \ |
---|
242 | [ --with-tmpdir=DIR use DIR as temporary directory]) |
---|
243 | AC_ARG_ENABLE(smallgmp, \ |
---|
244 | [ --enable-PACKAGE configure and/or build PACKAGE |
---|
245 | --disable-PACKAGE do not configure and/or build PACKAGE |
---|
246 | where PACKAGE can be: |
---|
247 | smallgmp minimal version of gmp written in C only]) |
---|
248 | AC_ARG_ENABLE(gmp, \ |
---|
249 | [ gmp Gnu Multiple Precision package]) |
---|
250 | AC_ARG_ENABLE(MP, \ |
---|
251 | [ MP Multi Protocol library]) |
---|
252 | AC_ARG_ENABLE(factory, \ |
---|
253 | [ factory polynomial factorization library]) |
---|
254 | AC_ARG_ENABLE(libfac, \ |
---|
255 | [ libfac char set and modp poly factorization library]) |
---|
256 | AC_ARG_ENABLE(sgroup, \ |
---|
257 | [ sgroup numerical semigroup computations]) |
---|
258 | AC_ARG_ENABLE(mtrack, \ |
---|
259 | [ mtrack utility to track unused memory]) |
---|
260 | AC_ARG_ENABLE(Singular, \ |
---|
261 | [ Singular CAS for Polynomial Computations]) |
---|
262 | AC_ARG_ENABLE(Texinfo, \ |
---|
263 | [ Texinfo Texinfo for info, texi2dvi, makeinfo]) |
---|
264 | AC_ARG_ENABLE(Texi2html, \ |
---|
265 | [ Texi2html Texinfo to HTML converter]) |
---|
266 | AC_ARG_ENABLE(doc, \ |
---|
267 | [ doc Singular documentation]) |
---|
268 | AC_ARG_ENABLE(emacs, \ |
---|
269 | [ emacs emacs completion files]) |
---|
270 | AC_ARG_WITH(MP,\ |
---|
271 | [ --with-PACKAGE use PACKAGE, provide dependent functionality |
---|
272 | --without-PACKAGE do not use PACKAGE, disable dependent functionality |
---|
273 | where PACKAGE can be: |
---|
274 | MP Multi Protocol library]) |
---|
275 | AC_ARG_WITH(factory, \ |
---|
276 | [ factory polynomial factorization library]) |
---|
277 | AC_ARG_WITH(libfac, \ |
---|
278 | [ libfac char set and modp poly factorization library]) |
---|
279 | AC_ARG_WITH(mtrack, \ |
---|
280 | [ mtrack utility to track unused memory]) |
---|
281 | AC_ARG_WITH(gmp, \ |
---|
282 | [ --with-apint=PACKAGE use PACKAGE for arbitary integer arithmetic |
---|
283 | where PACKAGE can be gmp or smallgmp |
---|
284 | All additional --enable and --with options are passed to subsequent calls |
---|
285 | to configure of the packages to be built. See also configure --help in |
---|
286 | these packages (resp. subdirs). ]) |
---|
287 | |
---|
288 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
289 | dnl Check what to use as tmp dir |
---|
290 | dnl |
---|
291 | AC_MSG_CHECKING(which tmp dir to use) |
---|
292 | if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then |
---|
293 | if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1) |
---|
294 | then |
---|
295 | TMP_DIR="${pwd}/tmp" |
---|
296 | else |
---|
297 | TMP_DIR=${with_tmpdir} |
---|
298 | fi |
---|
299 | else |
---|
300 | TMP_DIR="${pwd}/tmp" |
---|
301 | fi |
---|
302 | AC_MSG_RESULT($TMP_DIR) |
---|
303 | AC_SUBST(TMP_DIR) |
---|
304 | |
---|
305 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
306 | dnl Check whether or not to configure and build various packages |
---|
307 | dnl |
---|
308 | |
---|
309 | AC_MSG_CHECKING(whether to configure and build gmp lib) |
---|
310 | if test "$enable_gmp" != yes && test "$enable_gmp" != no; then |
---|
311 | if test "$ac_gmp_ok" != yes && test -d gmp; then |
---|
312 | AC_MSG_RESULT(yes) |
---|
313 | enable_gmp=yes |
---|
314 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp" |
---|
315 | ac_configure_args="$ac_configure_args --enable-gmp" |
---|
316 | OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in" |
---|
317 | else |
---|
318 | AC_MSG_RESULT(no) |
---|
319 | enable_gmp=no |
---|
320 | fi |
---|
321 | elif test "$enable_gmp" = yes; then |
---|
322 | if test ! -d gmp; then |
---|
323 | AC_MSG_RESULT(no) |
---|
324 | AC_MSG_ERROR(Can not find gmp subdir) |
---|
325 | else |
---|
326 | AC_MSG_RESULT(yes) |
---|
327 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp" |
---|
328 | OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in" |
---|
329 | fi |
---|
330 | else |
---|
331 | AC_MSG_RESULT(no) |
---|
332 | fi |
---|
333 | |
---|
334 | AC_MSG_CHECKING(whether to configure and build smallgmp lib) |
---|
335 | if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then |
---|
336 | if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \ |
---|
337 | test "$enable_gmp" != yes && test -d smallgmp; then |
---|
338 | AC_MSG_RESULT(yes) |
---|
339 | enable_smallgmp=yes |
---|
340 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp" |
---|
341 | ac_configure_args="$ac_configure_args --enable-smallgmp --enable-gmp" |
---|
342 | else |
---|
343 | AC_MSG_RESULT(no) |
---|
344 | enable_smallgmp=no |
---|
345 | fi |
---|
346 | elif test "$enable_smallgmp" = yes; then |
---|
347 | if test ! -d smallgmp; then |
---|
348 | AC_MSG_RESULT(no) |
---|
349 | AC_MSG_ERROR(Can not find smallgmp subdir) |
---|
350 | else |
---|
351 | AC_MSG_RESULT(yes) |
---|
352 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp" |
---|
353 | if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then |
---|
354 | ac_configure_args="$ac_configure_args --enable-gmp" |
---|
355 | fi |
---|
356 | fi |
---|
357 | else |
---|
358 | AC_MSG_RESULT(${enable_smallgmp}) |
---|
359 | fi |
---|
360 | |
---|
361 | # Check whether we have at least one of smallgmp or gmp |
---|
362 | if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \ |
---|
363 | test "$enable_smallgmp" != yes && test "$enable_gmp" != yes; then |
---|
364 | AC_MSG_ERROR(can neither find nor built gmp or smallgmp) |
---|
365 | fi |
---|
366 | |
---|
367 | # Check whether we need to cheat subsequent configures with --enable-gmp |
---|
368 | if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes; then |
---|
369 | ac_configure_args="$ac_configure_args --enable-gmp" |
---|
370 | fi |
---|
371 | |
---|
372 | AC_MSG_CHECKING(whether to configure and build MP lib) |
---|
373 | if test "$enable_MP" != yes && test "$enable_MP" != no; then |
---|
374 | if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \ |
---|
375 | (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then |
---|
376 | AC_MSG_RESULT(yes) |
---|
377 | enable_MP=yes |
---|
378 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
379 | ac_configure_args="$ac_configure_args --enable-MP" |
---|
380 | else |
---|
381 | AC_MSG_RESULT(no) |
---|
382 | enable_MP=no |
---|
383 | fi |
---|
384 | elif test "$enable_MP" = yes; then |
---|
385 | if test ! -d MP; then |
---|
386 | AC_MSG_RESULT(no) |
---|
387 | AC_MSG_ERROR(can not build MP without MP directory) |
---|
388 | fi |
---|
389 | if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then |
---|
390 | AC_MSG_RESULT(yes) |
---|
391 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
392 | else |
---|
393 | AC_MSG_RESULT(no) |
---|
394 | AC_MSG_ERROR(can not build MP without gmp) |
---|
395 | fi |
---|
396 | else |
---|
397 | AC_MSG_RESULT(no) |
---|
398 | fi |
---|
399 | |
---|
400 | AC_MSG_CHECKING(whether to configure and build factory lib) |
---|
401 | if test "$enable_factory" != yes && test "$enable_factory" != no; then |
---|
402 | if test "$with_factory" != no && test "$ac_factory_ok" != yes && \ |
---|
403 | test -d factory; then |
---|
404 | enable_factory=yes |
---|
405 | AC_MSG_RESULT(yes) |
---|
406 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory" |
---|
407 | ac_configure_args="$ac_configure_args --enable-factory" |
---|
408 | else |
---|
409 | enable_factory=no |
---|
410 | AC_MSG_RESULT(no) |
---|
411 | fi |
---|
412 | elif test "$enable_factory" = yes; then |
---|
413 | if test -d factory; then |
---|
414 | AC_MSG_RESULT(yes) |
---|
415 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory" |
---|
416 | else |
---|
417 | AC_MSG_RESULT(no) |
---|
418 | AC_MSG_ERROR(can not build factory without factory directory) |
---|
419 | fi |
---|
420 | else |
---|
421 | AC_MSG_RESULT(no) |
---|
422 | fi |
---|
423 | |
---|
424 | AC_MSG_CHECKING(whether to configure and build libfac lib) |
---|
425 | if test "$enable_libfac" != yes && test "$enable_libfac" != no; then |
---|
426 | if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \ |
---|
427 | test -d libfac && \ |
---|
428 | (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then |
---|
429 | enable_libfac=yes |
---|
430 | AC_MSG_RESULT(yes) |
---|
431 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac" |
---|
432 | ac_configure_args="$ac_configure_args --enable-libfac" |
---|
433 | else |
---|
434 | enable_libfac=no |
---|
435 | AC_MSG_RESULT(no) |
---|
436 | fi |
---|
437 | elif test "$enable_libfac" = yes; then |
---|
438 | if test ! -d libfac; then |
---|
439 | AC_MSG_RESULT(no) |
---|
440 | AC_MSG_ERROR(can not build libfac without libfac directory) |
---|
441 | fi |
---|
442 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
443 | AC_MSG_RESULT(yes) |
---|
444 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac" |
---|
445 | else |
---|
446 | AC_MSG_RESULT(no) |
---|
447 | AC_MSG_ERROR(Can not build libfac without factory) |
---|
448 | fi |
---|
449 | else |
---|
450 | AC_MSG_RESULT(no) |
---|
451 | fi |
---|
452 | |
---|
453 | AC_MSG_CHECKING(whether to configure and build sgroup lib) |
---|
454 | dnl |
---|
455 | dnl only sgroup if explicietely requested |
---|
456 | dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then |
---|
457 | dnl if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \ |
---|
458 | dnl test -d sgroup && \ |
---|
459 | dnl (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then |
---|
460 | dnl enable_sgroup=yes |
---|
461 | dnl AC_MSG_RESULT(yes) |
---|
462 | dnl CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup" |
---|
463 | dnl ac_configure_args="$ac_configure_args --enable-sgroup" |
---|
464 | dnl else |
---|
465 | dnl enable_sgroup=no |
---|
466 | dnl AC_MSG_RESULT(no) |
---|
467 | dnl fi |
---|
468 | dnl elif test "$enable_sgroup" = yes; then |
---|
469 | if test "$enable_sgroup" = yes; then |
---|
470 | if test ! -d sgroup; then |
---|
471 | AC_MSG_RESULT(no) |
---|
472 | AC_MSG_ERROR(can not build sgroup without sgroup directory) |
---|
473 | fi |
---|
474 | if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then |
---|
475 | AC_MSG_RESULT(yes) |
---|
476 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup" |
---|
477 | else |
---|
478 | AC_MSG_RESULT(no) |
---|
479 | AC_MSG_ERROR(Can not build sgroup without MP) |
---|
480 | fi |
---|
481 | else |
---|
482 | AC_MSG_RESULT(no) |
---|
483 | fi |
---|
484 | |
---|
485 | BUILD_SUBDIRS="$CONFIG_SUBDIRS" |
---|
486 | |
---|
487 | AC_MSG_CHECKING(whether to build mpr and use mtrack) |
---|
488 | if test -d mpr && test "$ac_cv_singuname" = ix86-Linux && test "$enable_mtrack" != no; then |
---|
489 | AC_MSG_RESULT(yes) |
---|
490 | if test "$enable_mtrack" != yes; then |
---|
491 | ac_configure_args="$ac_configure_args --enable-mtrack" |
---|
492 | fi |
---|
493 | enable_mtrack=yes |
---|
494 | OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" mpr/Makefile" |
---|
495 | BUILD_SUBDIRS="$BUILD_SUBDIRS mpr" |
---|
496 | else |
---|
497 | AC_MSG_RESULT(no) |
---|
498 | enable_mtrack=no |
---|
499 | fi |
---|
500 | |
---|
501 | AC_MSG_CHECKING(whether to configure and build Singular) |
---|
502 | if test "$enable_Singular" != yes && test "$enable_Singular" != no; then |
---|
503 | if test "$with_Singular" != no && test -d Singular; then |
---|
504 | enable_Singular=yes |
---|
505 | AC_MSG_RESULT(yes) |
---|
506 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular" |
---|
507 | BUILD_SUBDIRS="$BUILD_SUBDIRS Singular" |
---|
508 | ac_configure_args="$ac_configure_args --enable-Singular" |
---|
509 | else |
---|
510 | enable_Singular=no |
---|
511 | AC_MSG_RESULT(no) |
---|
512 | fi |
---|
513 | elif test "$enable_Singular" = yes; then |
---|
514 | if test -d Singular; then |
---|
515 | AC_MSG_RESULT(yes) |
---|
516 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular" |
---|
517 | BUILD_SUBDIRS="$BUILD_SUBDIRS Singular" |
---|
518 | else |
---|
519 | AC_MSG_RESULT(no) |
---|
520 | AC_MSG_ERROR(can not build Singular without Singular directory) |
---|
521 | fi |
---|
522 | else |
---|
523 | AC_MSG_RESULT(no) |
---|
524 | fi |
---|
525 | |
---|
526 | AC_MSG_CHECKING(whether to configure and build Texinfo) |
---|
527 | if test "$enable_Texinfo" != no && test -d Texinfo; then |
---|
528 | AC_MSG_RESULT(yes) |
---|
529 | enable_texinfo=yes |
---|
530 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo" |
---|
531 | BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo" |
---|
532 | TEXI2DVI=${bindir}/texi2dvi |
---|
533 | MAKEINFO="${bindir}/makeinfo --force" |
---|
534 | TEXINDEX=${bindir}/texindex |
---|
535 | AC_SUBST(TEXI2DVI) |
---|
536 | AC_SUBST(MAKEINFO) |
---|
537 | AC_SUBST(TEXINDEX) |
---|
538 | if test "$enable_Texinfo" != yes; then |
---|
539 | ac_configure_args="$ac_configure_args --enable-Texinfo" |
---|
540 | fi |
---|
541 | else |
---|
542 | AC_MSG_RESULT(no) |
---|
543 | AC_MSG_WARN(Building of doc might fail. Need Texinfo) |
---|
544 | enable_texinfo=no |
---|
545 | AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo) |
---|
546 | AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, ${pwd}/warn_not_found.sh texi2dvi) |
---|
547 | AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex) |
---|
548 | fi |
---|
549 | |
---|
550 | # test if IntegerProgramming should be built: |
---|
551 | |
---|
552 | if test -d "IntegerProgramming"; then |
---|
553 | BUILD_SUBDIRS="$BUILD_SUBDIRS IntegerProgramming" |
---|
554 | fi |
---|
555 | |
---|
556 | AC_MSG_CHECKING(whether to configure and build Texi2html) |
---|
557 | if test "$enable_Texi2html" != no && test -d Texi2html; then |
---|
558 | AC_MSG_RESULT(yes) |
---|
559 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html" |
---|
560 | BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html" |
---|
561 | if test "$enable_Texi2html" != yes; then |
---|
562 | ac_configure_args="$ac_configure_args --enable-Texi2html" |
---|
563 | fi |
---|
564 | TEXI2HTML=${bindir}/texi2html |
---|
565 | AC_SUBST(TEXI2HTML) |
---|
566 | else |
---|
567 | AC_MSG_RESULT(no) |
---|
568 | AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html) |
---|
569 | fi |
---|
570 | |
---|
571 | if test "${TEXI2HTML+set}" != set; then |
---|
572 | AC_MSG_WARN(texi2html not found. HTML doc generation will fail) |
---|
573 | fi |
---|
574 | if test "$ac_cv_prog_LATEX2HTML" = latex2html; then |
---|
575 | TEXI2HTML_OPTS="-l2h" |
---|
576 | fi |
---|
577 | AC_SUBST(TEXI2HTML_OPTS) |
---|
578 | |
---|
579 | |
---|
580 | AC_MSG_CHECKING(whether to build doc) |
---|
581 | if test "$enable_doc" != no && test -d doc; then |
---|
582 | AC_MSG_RESULT(yes) |
---|
583 | BUILD_SUBDIRS="$BUILD_SUBDIRS doc" |
---|
584 | if test "$enable_doc" != yes; then |
---|
585 | enable_doc=yes |
---|
586 | ac_configure_args="$ac_configure_args --enable-doc" |
---|
587 | fi |
---|
588 | else |
---|
589 | enable_doc=no |
---|
590 | AC_MSG_RESULT(no) |
---|
591 | fi |
---|
592 | |
---|
593 | AC_MSG_CHECKING(whether to build emacs) |
---|
594 | if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then |
---|
595 | AC_MSG_RESULT(yes) |
---|
596 | BUILD_SUBDIRS="$BUILD_SUBDIRS emacs" |
---|
597 | if test "$enable_emacs" != yes; then |
---|
598 | ac_configure_args="$ac_configure_args --enable-emacs" |
---|
599 | fi |
---|
600 | else |
---|
601 | AC_MSG_RESULT(no) |
---|
602 | fi |
---|
603 | |
---|
604 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
605 | dnl Check whether or not to use various packages |
---|
606 | dnl |
---|
607 | AC_MSG_CHECKING(which apint package to use) |
---|
608 | if test "$with_apint" = gmp; then |
---|
609 | if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then |
---|
610 | AC_MSG_RESULT(gmp) |
---|
611 | else |
---|
612 | AC_MSG_RESULT(none) |
---|
613 | AC_MSG_ERROR(can not use with gmp without finding or building it) |
---|
614 | fi |
---|
615 | elif test "$with_apint" = smallgmp; then |
---|
616 | if test "$ac_smallgmp_ok" = yes || test "$enable_smallgmp" = yes; then |
---|
617 | AC_MSG_RESULT(smallgmp) |
---|
618 | else |
---|
619 | AC_MSG_RESULT(none) |
---|
620 | AC_MSG_ERROR(can not use with smallgmp without finding or building it) |
---|
621 | fi |
---|
622 | elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then |
---|
623 | AC_MSG_RESULT(gmp) |
---|
624 | ac_configure_args="$ac_configure_args --with-apint=gmp" |
---|
625 | else |
---|
626 | dnl now we are sure that we have the smallgmp --otherwise enable |
---|
627 | dnl checks had thrown an error |
---|
628 | AC_MSG_RESULT(smallgmp) |
---|
629 | ac_configure_args="$ac_configure_args --with-apint=smallgmp" |
---|
630 | fi |
---|
631 | |
---|
632 | AC_MSG_CHECKING(whether to use with MP) |
---|
633 | if test "$with_MP" = yes; then |
---|
634 | if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then |
---|
635 | AC_MSG_RESULT(yes) |
---|
636 | else |
---|
637 | AC_MSG_RESULT(none) |
---|
638 | AC_MSG_ERROR(can not use with MP without finding or building it) |
---|
639 | fi |
---|
640 | elif test "$with_MP" = no; then |
---|
641 | AC_MSG_RESULT(no) |
---|
642 | elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then |
---|
643 | AC_MSG_RESULT(yes) |
---|
644 | ac_configure_args="$ac_configure_args --with-MP" |
---|
645 | else |
---|
646 | AC_MSG_RESULT(no) |
---|
647 | ac_configure_args="$ac_configure_args --without-MP" |
---|
648 | fi |
---|
649 | |
---|
650 | AC_MSG_CHECKING(whether to use with factory) |
---|
651 | if test "$with_factory" = yes; then |
---|
652 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
653 | AC_MSG_RESULT(yes) |
---|
654 | else |
---|
655 | AC_MSG_RESULT(none) |
---|
656 | AC_MSG_ERROR(can not use with factory without finding or building it) |
---|
657 | fi |
---|
658 | elif test "$with_factory" = no; then |
---|
659 | AC_MSG_RESULT(no) |
---|
660 | elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
661 | AC_MSG_RESULT(yes) |
---|
662 | ac_configure_args="$ac_configure_args --with-factory" |
---|
663 | else |
---|
664 | AC_MSG_RESULT(no) |
---|
665 | ac_configure_args="$ac_configure_args --without-factory" |
---|
666 | fi |
---|
667 | |
---|
668 | AC_MSG_CHECKING(whether to use with libfac) |
---|
669 | if test "$with_libfac" = yes; then |
---|
670 | if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then |
---|
671 | AC_MSG_RESULT(yes) |
---|
672 | else |
---|
673 | AC_MSG_RESULT(none) |
---|
674 | AC_MSG_ERROR(can not use with libfac without finding or building it) |
---|
675 | fi |
---|
676 | elif test "$with_libfac" = no; then |
---|
677 | AC_MSG_RESULT(no) |
---|
678 | elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then |
---|
679 | AC_MSG_RESULT(yes) |
---|
680 | ac_configure_args="$ac_configure_args --with-libfac" |
---|
681 | else |
---|
682 | AC_MSG_RESULT(no) |
---|
683 | ac_configure_args="$ac_configure_args --without-libfac" |
---|
684 | fi |
---|
685 | |
---|
686 | |
---|
687 | AC_MSG_CHECKING(whether to use with mtrack) |
---|
688 | if test "$with_mtrack" != no && test "$with_mtrack" != yes; then |
---|
689 | if test "$enable_mtrack" = yes; then |
---|
690 | with_mtrack=yes |
---|
691 | else |
---|
692 | with_mtrack=no |
---|
693 | fi |
---|
694 | ac_configure_args="$ac_configure_args --with-mtrack=$with_mtrack" |
---|
695 | elif test "$with_mtrack" = yes && test "$enable_mtrack" != yes; then |
---|
696 | with_mtrack=no |
---|
697 | ac_configure_args="$ac_configure_args --with-mtrack=no" |
---|
698 | fi |
---|
699 | if test "$with_mtrack" != yes; then |
---|
700 | AC_MSG_RESULT(no) |
---|
701 | else |
---|
702 | AC_MSG_RESULT(yes) |
---|
703 | fi |
---|
704 | |
---|
705 | |
---|
706 | AC_MSG_CHECKING(whether to use with Singular) |
---|
707 | if test "$with_Singular" != no && test "$with_Singular" != yes; then |
---|
708 | if test "$enable_Singular" = yes; then |
---|
709 | with_Singular=yes |
---|
710 | else |
---|
711 | with_Singular=no |
---|
712 | fi |
---|
713 | ac_configure_args="$ac_configure_args --with-Singular=$with_Singular" |
---|
714 | fi |
---|
715 | |
---|
716 | if test "$with_Singular" != no; then |
---|
717 | AC_MSG_RESULT(yes) |
---|
718 | else |
---|
719 | AC_MSG_RESULT(no) |
---|
720 | fi |
---|
721 | |
---|
722 | |
---|
723 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
724 | dnl Check for known subdirs |
---|
725 | dnl |
---|
726 | SUBDIRS="" |
---|
727 | if test -d smallgmp; then |
---|
728 | SUBDIRS="$SUBDIRS smallgmp" |
---|
729 | fi |
---|
730 | if test -d gmp; then |
---|
731 | SUBDIRS="$SUBDIRS gmp" |
---|
732 | fi |
---|
733 | if test -d MP; then |
---|
734 | SUBDIRS="$SUBDIRS MP" |
---|
735 | fi |
---|
736 | if test -d factory; then |
---|
737 | SUBDIRS="$SUBDIRS factory" |
---|
738 | fi |
---|
739 | if test -d libfac; then |
---|
740 | SUBDIRS="$SUBDIRS libfac" |
---|
741 | fi |
---|
742 | if test -d mpr; then |
---|
743 | SUBDIRS="$SUBDIRS mpr" |
---|
744 | fi |
---|
745 | if test -d sgroup; then |
---|
746 | SUBDIRS="$SUBDIRS sgroup" |
---|
747 | fi |
---|
748 | if test -d Singular; then |
---|
749 | SUBDIRS="$SUBDIRS Singular" |
---|
750 | fi |
---|
751 | if test -d Texinfo; then |
---|
752 | SUBDIRS="$SUBDIRS Texinfo" |
---|
753 | fi |
---|
754 | if test -d Texi2html; then |
---|
755 | SUBDIRS="$SUBDIRS Texi2html" |
---|
756 | fi |
---|
757 | if test -d doc; then |
---|
758 | SUBDIRS="$SUBDIRS doc" |
---|
759 | fi |
---|
760 | if test -d emacs; then |
---|
761 | SUBDIRS="$SUBDIRS emacs" |
---|
762 | fi |
---|
763 | if test -d rpm; then |
---|
764 | SUBDIRS="$SUBDIRS rpm" |
---|
765 | fi |
---|
766 | |
---|
767 | |
---|
768 | |
---|
769 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
770 | dnl Enough -- wrap it up |
---|
771 | dnl |
---|
772 | AC_PROG_MAKE_SET |
---|
773 | AC_SUBST(SUBDIRS) |
---|
774 | AC_SUBST(BUILD_SUBDIRS) |
---|
775 | AC_SUBST(CONFIG_SUBDIRS) |
---|
776 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
777 | |
---|
778 | AC_OUTPUT(${OUTPUT_MAKEFILES}) |
---|