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