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