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