1 | dnl Process this file with autoconf to produce a configure script |
---|
2 | AC_INIT(Singular/matpol.h) |
---|
3 | AC_PREFIX_DEFAULT(`pwd`) |
---|
4 | |
---|
5 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
6 | dnl Version business -- should be the same as in Singular subdir |
---|
7 | dnl |
---|
8 | SINGULAR_MAJOR_VERSION=1 |
---|
9 | SINGULAR_MINOR_VERSION=1 |
---|
10 | SINGULAR_SUB_VERSION=0 |
---|
11 | VERSION_DATE="June 1997" |
---|
12 | AC_SUBST(SINGULAR_MAJOR_VERSION) |
---|
13 | AC_SUBST(SINGULAR_MINOR_VERSION) |
---|
14 | AC_SUBST(SINGULAR_SUB_VERSION) |
---|
15 | |
---|
16 | AC_CANONICAL_HOST |
---|
17 | AC_SUBST(host) |
---|
18 | |
---|
19 | |
---|
20 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
21 | dnl those are needed to check for libs and headers, later on |
---|
22 | dnl |
---|
23 | AC_PROG_CC |
---|
24 | AC_PROG_CPP |
---|
25 | AC_AIX |
---|
26 | |
---|
27 | dnl and add to -I to CPPFLAGS and and -Lto LDFLAGS, just to be sure |
---|
28 | if test "$libdir" = '${exec_prefix}/lib'; then |
---|
29 | if test "x$exec_prefix" = xNONE; then |
---|
30 | if test "x$prefix" = xNONE; then |
---|
31 | LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}" |
---|
32 | ac_configure_args="$ac_configure_args --libdir=${ac_default_prefix}/lib" |
---|
33 | else |
---|
34 | LDFLAGS="-L${prefix}/lib ${LDFLAGS}" |
---|
35 | ac_configure_args="$ac_configure_args --libdir=${prefix}/lib" |
---|
36 | fi |
---|
37 | else |
---|
38 | LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}" |
---|
39 | ac_configure_args="$ac_configure_args --libdir=${exec_prefix}/lib" |
---|
40 | fi |
---|
41 | else |
---|
42 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
43 | fi |
---|
44 | |
---|
45 | if test "$includedir" = '${prefix}/include'; then |
---|
46 | if test "x$prefix" = xNONE; then |
---|
47 | CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}" |
---|
48 | ac_configure_args="$ac_configure_args --includedir=${ac_default_prefix}/include" |
---|
49 | else |
---|
50 | CPPFLAGS="-I${prefix}/include ${CPPFLAGS}" |
---|
51 | ac_configure_args="$ac_configure_args --includedir=${prefix}/include" |
---|
52 | fi |
---|
53 | else |
---|
54 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
55 | fi |
---|
56 | |
---|
57 | dnl pass default prefix on to subdirs, if not explicitely given as an option |
---|
58 | if test "x$prefix" = xNONE; then |
---|
59 | ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" |
---|
60 | fi |
---|
61 | |
---|
62 | AC_MSG_CHECKING(whether _AIX is defined) |
---|
63 | AC_CACHE_VAL(ac_cv_is_aix, |
---|
64 | AC_EGREP_CPP(yes, |
---|
65 | [#ifdef _AIX |
---|
66 | yes |
---|
67 | #endif |
---|
68 | ], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1)) |
---|
69 | if test "$ac_cv_is_aix" = yes; then |
---|
70 | AC_MSG_RESULT(yes) |
---|
71 | else |
---|
72 | AC_MSG_RESULT(no) |
---|
73 | fi |
---|
74 | |
---|
75 | |
---|
76 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
77 | dnl check for various libraries and headers |
---|
78 | dnl |
---|
79 | AC_CHECK_LIB(m, atof) |
---|
80 | AC_CHECK_LIB(gmp, mpq_init) |
---|
81 | AC_CHECK_LIB(smallgmp, mpz_init) |
---|
82 | AC_CHECK_LIB(MP, IMP_PutGmpInt) |
---|
83 | AC_CHECK_LIB(MPT, MPT_GetTree) |
---|
84 | AC_CHECK_LIB(singcf, atof) |
---|
85 | AC_CHECK_LIB(singfac, atof) |
---|
86 | |
---|
87 | AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h MPT.h factory.h factor.h) |
---|
88 | |
---|
89 | if test "$ac_cv_lib_gmp_mpq_init" = yes && \ |
---|
90 | test "$ac_cv_header_gmp_h" = yes; then |
---|
91 | ac_gmp_ok=yes |
---|
92 | fi |
---|
93 | |
---|
94 | if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \ |
---|
95 | test "$ac_cv_header_smallgmp_h" = yes && \ |
---|
96 | test "$ac_cv_header_gmp_h" = yes; then |
---|
97 | ac_smallgmp_ok=yes |
---|
98 | fi |
---|
99 | |
---|
100 | if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \ |
---|
101 | test "$ac_cv_lib_MPT_MPT_GetTree" && \ |
---|
102 | test "$ac_cv_header_MP_h" = yes && \ |
---|
103 | test "$ac_cv_header_MPT_h" = yes; then |
---|
104 | ac_MP_ok=yes |
---|
105 | fi |
---|
106 | |
---|
107 | if test "$ac_cv_lib_singcf_atof" = yes && \ |
---|
108 | test "$ac_cv_header_factory_h" = yes; then |
---|
109 | ac_factory_ok=yes |
---|
110 | fi |
---|
111 | |
---|
112 | if test "$ac_cv_lib_singfac_atof" = yes && \ |
---|
113 | test "$ac_cv_header_factor_h" = yes; then |
---|
114 | ac_libfac_ok=yes |
---|
115 | fi |
---|
116 | |
---|
117 | |
---|
118 | |
---|
119 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
120 | dnl Check whether or not to built various packages |
---|
121 | dnl |
---|
122 | AC_ARG_ENABLE(smallgmp, \ |
---|
123 | [ --enable-PACKAGE configure and build PACKAGE |
---|
124 | --disable-PACKAGE do not configure and build PACKAGE |
---|
125 | where PACKAGE can be: |
---|
126 | smallgmp minimal version of gmp written in C only]) |
---|
127 | AC_ARG_ENABLE(MP, \ |
---|
128 | [ MP Multi Protocol library]) |
---|
129 | AC_ARG_ENABLE(factory, \ |
---|
130 | [ factory polynomial factorization library]) |
---|
131 | AC_ARG_ENABLE(libfac, \ |
---|
132 | [ libfac char set and modp poly factorization library]) |
---|
133 | AC_ARG_ENABLE(sgroup, \ |
---|
134 | [ sgroup numerical semigroup computations]) |
---|
135 | AC_ARG_ENABLE(Singular, \ |
---|
136 | [ Singular CAS for commutative algebra]) |
---|
137 | |
---|
138 | AC_ARG_WITH(MP,\ |
---|
139 | [ --with-PACKAGE use PACKAGE, provide dependent functionality |
---|
140 | --without-PACKAGE do not use PACKAGE, disable dependent functionality |
---|
141 | where PACKAGE can be: |
---|
142 | MP Multi Protocol library]) |
---|
143 | AC_ARG_WITH(factory, \ |
---|
144 | [ factory polynomial factorization library]) |
---|
145 | AC_ARG_WITH(libfac, \ |
---|
146 | [ libfac char set and modp poly factorization library]) |
---|
147 | AC_ARG_WITH(gmp, \ |
---|
148 | [ --with-apint=PACKAGE use PACKAGE for arbitary integer arithmetic |
---|
149 | where PACKAGE can be gmp, smallgmp, or buildin]) |
---|
150 | |
---|
151 | AC_MSG_CHECKING(whether to configure and build smallgmp lib) |
---|
152 | if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then |
---|
153 | if test "$ac_smallgmp_ok" != yes && \ |
---|
154 | test "$ac_gmp_ok" != yes && \ |
---|
155 | (test "$with_apint" = smallgmp || test "${with_apint+set}" != set); then |
---|
156 | enable_smallgmp=yes |
---|
157 | else |
---|
158 | enable_smallgmp=no |
---|
159 | fi |
---|
160 | fi |
---|
161 | if test "$enable_smallgmp" = yes && test -d smallgmp; then |
---|
162 | AC_MSG_RESULT(yes) |
---|
163 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp" |
---|
164 | enable_smallgmp=yes |
---|
165 | ac_will_have_gmp=yes |
---|
166 | else |
---|
167 | AC_MSG_RESULT(no) |
---|
168 | if test "$enable_smallgmp" = yes && test ! -d smallgmp; then |
---|
169 | AC_MSG_WARN(Did not find smallgmp subdir) |
---|
170 | fi |
---|
171 | enable_smallgmp=no |
---|
172 | fi |
---|
173 | if test "$ac_gmp_ok" != yes && \ |
---|
174 | test "$ac_smallgmp_ok" != yes && \ |
---|
175 | test "$enable_smallgmp" != yes; then |
---|
176 | AC_MSG_WARN(Would rather have gmp or smallgmp to build libs and Singular) |
---|
177 | ac_configure_args="$ac_configure_args --disable-gmp" |
---|
178 | else |
---|
179 | ac_configure_args="$ac_configure_args --enable-gmp" |
---|
180 | fi |
---|
181 | |
---|
182 | AC_MSG_CHECKING(whether to configure and build MP lib) |
---|
183 | if test "$enable_MP" != yes && test "$enable_MP" != no; then |
---|
184 | if test "$with_MP" != no && test "$ac_MP_ok" != yes; then |
---|
185 | enable_MP=yes |
---|
186 | else |
---|
187 | enable_MP=no |
---|
188 | fi |
---|
189 | fi |
---|
190 | if test "$enable_MP" = yes && test -d MP; then |
---|
191 | if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then |
---|
192 | AC_MSG_RESULT(yes) |
---|
193 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
194 | ac_configure_args="$ac_configure_args --enable-MP" |
---|
195 | else |
---|
196 | AC_MSG_RESULT(no) |
---|
197 | AC_MSG_WARN(Can not build MP without having gmp) |
---|
198 | enabl_MP=no |
---|
199 | ac_configure_args="$ac_configure_args --disable-MP" |
---|
200 | fi |
---|
201 | else |
---|
202 | AC_MSG_RESULT(no) |
---|
203 | if test "$enable_MP" = yes && test ! -d MP; then |
---|
204 | AC_MSG_WARN(Did not find MP subdirectory) |
---|
205 | fi |
---|
206 | enable_MP=no |
---|
207 | ac_configure_args="$ac_configure_args --disable-MP" |
---|
208 | fi |
---|
209 | |
---|
210 | AC_MSG_CHECKING(whether to configure and build factory lib) |
---|
211 | if test "$enable_factory" != yes && test "$enable_factory" != no; then |
---|
212 | if test "$with_factory" != no && test "$ac_factory_ok" != yes; then |
---|
213 | enable_factory=yes |
---|
214 | else |
---|
215 | enable_factory=no |
---|
216 | fi |
---|
217 | fi |
---|
218 | if test "$enable_factory" = yes && test -d factory; then |
---|
219 | if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then |
---|
220 | AC_MSG_RESULT(yes) |
---|
221 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory" |
---|
222 | ac_configure_args="$ac_configure_args --enable-factory" |
---|
223 | else |
---|
224 | AC_MSG_RESULT(no) |
---|
225 | AC_MSG_WARN(Can not build factory without having gmp) |
---|
226 | enable_factory=no |
---|
227 | ac_configure_args="$ac_configure_args --disable-factory" |
---|
228 | fi |
---|
229 | else |
---|
230 | AC_MSG_RESULT(no) |
---|
231 | if test "$enable_factory" = yes && test ! -d factory; then |
---|
232 | AC_MSG_WARN(Did not find factory subdirectory) |
---|
233 | fi |
---|
234 | enable_factory=no |
---|
235 | ac_configure_args="$ac_configure_args --disable-factory" |
---|
236 | fi |
---|
237 | |
---|
238 | AC_MSG_CHECKING(whether to configure and build libfac lib) |
---|
239 | if test "$enable_libfac" != yes && test "$enable_libfac" != no; then |
---|
240 | if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then |
---|
241 | enable_libfac=yes |
---|
242 | else |
---|
243 | enable_libfac=no |
---|
244 | fi |
---|
245 | fi |
---|
246 | if test "$enable_libfac" = yes && test -d libfac; then |
---|
247 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
248 | AC_MSG_RESULT(yes) |
---|
249 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac" |
---|
250 | ac_configure_args="$ac_configure_args --enable-libfac" |
---|
251 | else |
---|
252 | AC_MSG_RESULT(no) |
---|
253 | AC_MSG_WARN(Can not build libfac without factory) |
---|
254 | enable_libfac=no |
---|
255 | ac_configure_args="$ac_configure_args --disable-libfac" |
---|
256 | fi |
---|
257 | else |
---|
258 | AC_MSG_RESULT(no) |
---|
259 | if test "$enable_libfac" = yes && test ! -d libfac; then |
---|
260 | AC_MSG_WARN(Did not find libfac subdirectory) |
---|
261 | fi |
---|
262 | enable_libfac=no |
---|
263 | ac_configure_args="$ac_configure_args --disable-libfac" |
---|
264 | fi |
---|
265 | |
---|
266 | AC_MSG_CHECKING(whether to configure and build sgroup) |
---|
267 | if test "$enable_sgroup" != no; then |
---|
268 | enable_sgroup=yes |
---|
269 | fi |
---|
270 | |
---|
271 | if test "$enable_sgroup" = yes && test -d sgroup; then |
---|
272 | if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then |
---|
273 | if test "$enable_MP" != no || test "$ac_MP_ok" = yes; then |
---|
274 | AC_MSG_RESULT(yes) |
---|
275 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup" |
---|
276 | ac_configure_args="$ac_configure_args --enable-sgroup" |
---|
277 | else |
---|
278 | AC_MSG_RESULT(no) |
---|
279 | AC_MSG_WARN(Can not build sgroup without having MP) |
---|
280 | enable_sgroup=no |
---|
281 | ac_configure_args="$ac_configure_args --disable-sgroup" |
---|
282 | fi |
---|
283 | else |
---|
284 | AC_MSG_RESULT(no) |
---|
285 | AC_MSG_WARN(Can not build sgroup without having gmp) |
---|
286 | enable_sgroup=no |
---|
287 | ac_configure_args="$ac_configure_args --disable-sgroup" |
---|
288 | fi |
---|
289 | else |
---|
290 | AC_MSG_RESULT(no) |
---|
291 | if test "$enable_sgroup" = yes && test ! -d sgroup; then |
---|
292 | AC_MSG_WARN(Did not find sgroup subdirectory) |
---|
293 | fi |
---|
294 | enable_sgroup=no |
---|
295 | ac_configure_args="$ac_configure_args --disable-sgroup" |
---|
296 | fi |
---|
297 | |
---|
298 | AC_MSG_CHECKING(whether to configure and build Singular) |
---|
299 | if test "$enable_Singular" != yes && test "$enable_Singular" != no; then |
---|
300 | if test "$with_Singular" != no; then |
---|
301 | enable_Singular=yes |
---|
302 | else |
---|
303 | enable_Singular=no |
---|
304 | fi |
---|
305 | fi |
---|
306 | if test "$enable_Singular" = yes && test -d Singular; then |
---|
307 | AC_MSG_RESULT(yes) |
---|
308 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular" |
---|
309 | ac_configure_args="$ac_configure_args --enable-Singular" |
---|
310 | else |
---|
311 | AC_MSG_RESULT(no) |
---|
312 | if test "$enable_Singular" = yes && test ! -d Singular; then |
---|
313 | AC_MSG_WARN(Did not find Singular subdirectory) |
---|
314 | fi |
---|
315 | enable_Singular=no |
---|
316 | ac_configure_args="$ac_configure_args --disable-Singular" |
---|
317 | fi |
---|
318 | |
---|
319 | |
---|
320 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
321 | dnl Check whether or not to use various packages |
---|
322 | dnl |
---|
323 | AC_MSG_CHECKING(wich apint package to use) |
---|
324 | if test "$with_apint" != gmp && \ |
---|
325 | test "$with_apint" != smallgmp && \ |
---|
326 | test "$with_apint" != buildin; then |
---|
327 | if test "$ac_gmp_ok" = yes; then |
---|
328 | with_apint=gmp |
---|
329 | elif test "$ac_enable_smallgmp" = yes; then |
---|
330 | with_apint=smallgmp |
---|
331 | else |
---|
332 | with_apint=buildin |
---|
333 | fi |
---|
334 | ac_configure_args="$ac_configure_args --with-apint=$with_apint" |
---|
335 | fi |
---|
336 | AC_MSG_RESULT(${with_apint}) |
---|
337 | |
---|
338 | AC_MSG_CHECKING(whether to use with MP) |
---|
339 | if test "$with_MP" != no && test "$with_MP" != yes; then |
---|
340 | if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then |
---|
341 | with_MP=yes |
---|
342 | else |
---|
343 | with_MP=no |
---|
344 | fi |
---|
345 | ac_configure_args="$ac_configure_args --with-MP=$with_MP" |
---|
346 | fi |
---|
347 | if test "$with_MP" = yes; then |
---|
348 | AC_MSG_RESULT(yes) |
---|
349 | else |
---|
350 | AC_MSG_RESULT(no) |
---|
351 | fi |
---|
352 | |
---|
353 | if test "$enable_MP" = yes; then |
---|
354 | if test "${with_apint}" = smallgmp; then |
---|
355 | ac_configure_args="$ac_configure_args --with-default_apreal=none" |
---|
356 | elif test "${with_apint}" = buildin; then |
---|
357 | ac_configure_args="$ac_configure_args --with-default_apreal=none --with-default-apint=none" |
---|
358 | fi |
---|
359 | fi |
---|
360 | |
---|
361 | AC_MSG_CHECKING(whether to use with factory) |
---|
362 | if test "$with_factory" != no && test "$with_factory" != yes; then |
---|
363 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
364 | with_factory=yes |
---|
365 | else |
---|
366 | with_factory=no |
---|
367 | fi |
---|
368 | ac_configure_args="$ac_configure_args --with-factory=$with_factory" |
---|
369 | fi |
---|
370 | if test "$with_factory" = yes; then |
---|
371 | AC_MSG_RESULT(yes) |
---|
372 | else |
---|
373 | AC_MSG_RESULT(no) |
---|
374 | fi |
---|
375 | |
---|
376 | AC_MSG_CHECKING(whether to use with libfac) |
---|
377 | if test "$with_libfac" != no && test "$with_libfac" != yes; then |
---|
378 | if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then |
---|
379 | with_libfac=yes |
---|
380 | else |
---|
381 | with_libfac=no |
---|
382 | fi |
---|
383 | ac_configure_args="$ac_configure_args --with-libfac=$with_libfac" |
---|
384 | fi |
---|
385 | if test "$with_libfac" = yes; then |
---|
386 | AC_MSG_RESULT(yes) |
---|
387 | else |
---|
388 | AC_MSG_RESULT(no) |
---|
389 | fi |
---|
390 | |
---|
391 | AC_MSG_CHECKING(whether to use with Singular) |
---|
392 | if test "$with_Singular" != no && test "$with_Singular" != yes; then |
---|
393 | if test "$enable_Singular" = yes; then |
---|
394 | with_Singular=yes |
---|
395 | else |
---|
396 | with_Singular=no |
---|
397 | fi |
---|
398 | ac_configure_args="$ac_configure_args --with-Singular=$with_Singular" |
---|
399 | fi |
---|
400 | |
---|
401 | if test "$with_Singular" != no; then |
---|
402 | AC_MSG_RESULT(yes) |
---|
403 | else |
---|
404 | AC_MSG_RESULT(no) |
---|
405 | fi |
---|
406 | |
---|
407 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
408 | dnl Check for known subdirs |
---|
409 | dnl |
---|
410 | if test -d smallgmp; then |
---|
411 | SUBDIRS="smallgmp" |
---|
412 | fi |
---|
413 | if test -d MP; then |
---|
414 | SUBDIRS="$SUBDIRS MP" |
---|
415 | fi |
---|
416 | if test -d factory; then |
---|
417 | SUBDIRS="$SUBDIRS factory" |
---|
418 | fi |
---|
419 | if test -d libfac; then |
---|
420 | SUBDIRS="$SUBDIRS libfac" |
---|
421 | fi |
---|
422 | if test -d Singular; then |
---|
423 | SUBDIRS="$SUBDIRS Singular" |
---|
424 | fi |
---|
425 | |
---|
426 | |
---|
427 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
428 | dnl Enough --wrap it up |
---|
429 | dnl |
---|
430 | AC_PROG_MAKE_SET |
---|
431 | AC_SUBST(SUBDIRS) |
---|
432 | AC_SUBST(CONFIG_SUBDIRS) |
---|
433 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
434 | |
---|
435 | AC_OUTPUT(Makefile) |
---|