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