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