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 | AC_CANONICAL_SYSTEM |
---|
6 | |
---|
7 | |
---|
8 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
9 | dnl those are needed to check for libs and headers, later on |
---|
10 | dnl |
---|
11 | AC_PROG_CC |
---|
12 | AC_PROG_CPP |
---|
13 | AC_AIX |
---|
14 | |
---|
15 | dnl and add to -I to CPPFLAGS and and -Lto LDFLAGS, just to be sure |
---|
16 | if test "$libdir" = '${exec_prefix}/lib'; then |
---|
17 | if test "x$exec_prefix" = xNONE; then |
---|
18 | if test "x$prefix" = xNONE; then |
---|
19 | LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}" |
---|
20 | else |
---|
21 | LDFLAGS="-L${prefix}/lib ${LDFLAGS}" |
---|
22 | fi |
---|
23 | else |
---|
24 | LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}" |
---|
25 | fi |
---|
26 | else |
---|
27 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
28 | fi |
---|
29 | |
---|
30 | if test "$includedir" = '${prefix}/include'; then |
---|
31 | if test "x$prefix" = xNONE; then |
---|
32 | CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}" |
---|
33 | else |
---|
34 | CPPFLAGS="-I${prefix}/include ${CPPFLAGS}" |
---|
35 | fi |
---|
36 | else |
---|
37 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
38 | fi |
---|
39 | |
---|
40 | dnl pass default prefix on to subdirs, if not explicitely given as an option |
---|
41 | if test "x$prefix" = xNONE; then |
---|
42 | ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" |
---|
43 | fi |
---|
44 | |
---|
45 | AC_MSG_CHECKING(whether _AIX is defined) |
---|
46 | AC_CACHE_VAL(ac_cv_is_aix, |
---|
47 | AC_EGREP_CPP(yes, |
---|
48 | [#ifdef _AIX |
---|
49 | yes |
---|
50 | #endif |
---|
51 | ], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1)) |
---|
52 | if test "$ac_cv_is_aix" = yes; then |
---|
53 | AC_MSG_RESULT(yes) |
---|
54 | else |
---|
55 | AC_MSG_RESULT(no) |
---|
56 | fi |
---|
57 | |
---|
58 | |
---|
59 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
60 | dnl check for various libraries and headers |
---|
61 | dnl |
---|
62 | AC_CHECK_LIB(m, atof) |
---|
63 | AC_CHECK_LIB(gmp, mpz_init) |
---|
64 | AC_CHECK_LIB(MP, IMP_PutGmpInt) |
---|
65 | AC_CHECK_LIB(MPT, MPT_GetTree) |
---|
66 | AC_CHECK_LIB(singcf, atof) |
---|
67 | AC_CHECK_LIB(singfac, atof) |
---|
68 | |
---|
69 | AC_CHECK_HEADERS(gmp.h MP.h MPT.h factory.h factor.h) |
---|
70 | |
---|
71 | if test "$ac_cv_lib_gmp_mpz_init" = yes && \ |
---|
72 | test "$ac_cv_header_gmp_h" = yes; then |
---|
73 | ac_gmp_ok=yes |
---|
74 | fi |
---|
75 | |
---|
76 | if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \ |
---|
77 | test "$ac_cv_lib_MPT_MPT_GetTree" && \ |
---|
78 | test "$ac_cv_header_MP_h" = yes && \ |
---|
79 | test "$ac_cv_header_MPT_h" = yes; then |
---|
80 | ac_MP_ok=yes |
---|
81 | fi |
---|
82 | |
---|
83 | if test "$ac_cv_lib_singcf_initCanonicalForm" = yes && \ |
---|
84 | test "$ac_cv_header_factory_h" = yes; then |
---|
85 | ac_factory_ok=yes |
---|
86 | fi |
---|
87 | |
---|
88 | if test "$ac_cv_lib_singfac_IrrCharSeries" = yes && \ |
---|
89 | test "$ac_cv_header_factor_h" = yes; then |
---|
90 | ac_libfac_ok=yes |
---|
91 | fi |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
96 | dnl Check whether or not to built various packages |
---|
97 | dnl |
---|
98 | AC_ARG_ENABLE(gmp, \ |
---|
99 | [ --enable-PACKAGE configure and build PACKAGE |
---|
100 | --disable-PACKAGE do not configure and build PACKAGE |
---|
101 | --with-PACKAGE use PACKAGE, provide dependent functionality |
---|
102 | --without-PACKAGE do not use PACKAGE, disable dependent functionality |
---|
103 | where PACKAGE can be: |
---|
104 | gmp GNU multiple precision library]) |
---|
105 | AC_ARG_ENABLE(MP, \ |
---|
106 | [ MP Multi Protocol library]) |
---|
107 | AC_ARG_ENABLE(factory, \ |
---|
108 | [ factory polynomial factorization library]) |
---|
109 | AC_ARG_ENABLE(libfac, \ |
---|
110 | [ libfac char set and modp poly factorization library]) |
---|
111 | AC_ARG_ENABLE(Singular, \ |
---|
112 | [ Singular, CAS for commutative algebra]) |
---|
113 | |
---|
114 | AC_MSG_CHECKING(whether to configure and build gmp lib) |
---|
115 | if test "$enable_gmp" != yes && test "$enable_gmp" != no; then |
---|
116 | if test "$with_gmp" != no && test "$ac_gmp_ok" != yes; then |
---|
117 | enable_gmp=yes |
---|
118 | else |
---|
119 | enable_gmp=no |
---|
120 | fi |
---|
121 | fi |
---|
122 | if test "$enable_gmp" = yes && test -d gmp; then |
---|
123 | if test "$ac_cv_is_aix" = yes && test "$GCC" = yes; then |
---|
124 | AC_MSG_RESULT(no) |
---|
125 | AC_MSG_WARN(Building gmp v2 with gcc results in a gmp lib with bugs) |
---|
126 | AC_MSG_WARN(Install gmp v2 with another compiler first or use gmp v1.3) |
---|
127 | AC_MSG_WARN(For the time being gmp is neither configured/built nor used) |
---|
128 | enable_gmp=no |
---|
129 | ac_configure_args="$ac_configure_args --disable-gmp" |
---|
130 | else |
---|
131 | AC_MSG_RESULT(yes) |
---|
132 | CONFIG_SUBDIRS="gmp" |
---|
133 | ac_configure_args="$ac_configure_args --enable-gmp" |
---|
134 | fi |
---|
135 | else |
---|
136 | AC_MSG_RESULT(no) |
---|
137 | if test "$enable_gmp" = yes && test ! -d gmp; then |
---|
138 | AC_MSG_WARN(Did not find gmp subdirectory) |
---|
139 | fi |
---|
140 | enable_gmp=no |
---|
141 | ac_configure_args="$ac_configure_args --disable-gmp" |
---|
142 | fi |
---|
143 | |
---|
144 | AC_MSG_CHECKING(whether to configure and build MP lib) |
---|
145 | if test "$enable_MP" != yes && test "$enable_MP" != no; then |
---|
146 | if test "$with_MP" != no && test "$ac_MP_ok" != yes; then |
---|
147 | enable_MP=yes |
---|
148 | else |
---|
149 | enable_MP=no |
---|
150 | fi |
---|
151 | fi |
---|
152 | if test "$enable_MP" = yes && test -d MP; then |
---|
153 | if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then |
---|
154 | AC_MSG_RESULT(yes) |
---|
155 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
156 | ac_configure_args="$ac_configure_args --enable-MP" |
---|
157 | else |
---|
158 | AC_MSG_RESULT(no) |
---|
159 | AC_MSG_WARN(Can not build MP for Singular without having gmp) |
---|
160 | enable_MP=no |
---|
161 | ac_configure_args="$ac_configure_args --disable-MP" |
---|
162 | fi |
---|
163 | else |
---|
164 | AC_MSG_RESULT(no) |
---|
165 | if test "$enable_MP" = yes && test ! -d MP; then |
---|
166 | AC_MSG_WARN(Did not find MP subdirectory) |
---|
167 | fi |
---|
168 | enable_MP=no |
---|
169 | ac_configure_args="$ac_configure_args --disable-MP" |
---|
170 | fi |
---|
171 | |
---|
172 | if test "$with_builtingmp" = yes; then |
---|
173 | enable_gmp=yes |
---|
174 | ac_configure_args="$ac_configure_args --enable-gmp" |
---|
175 | fi |
---|
176 | |
---|
177 | AC_MSG_CHECKING(whether to configure and build factory lib) |
---|
178 | if test "$enable_factory" != yes && test "$enable_factory" != no; then |
---|
179 | if test "$with_factory" != no && test "$ac_factory_ok" != yes; then |
---|
180 | enable_factory=yes |
---|
181 | else |
---|
182 | enable_factory=no |
---|
183 | fi |
---|
184 | fi |
---|
185 | if test "$enable_factory" = yes && test -d factory; then |
---|
186 | if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then |
---|
187 | AC_MSG_RESULT(yes) |
---|
188 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory" |
---|
189 | ac_configure_args="$ac_configure_args --enable-factory" |
---|
190 | else |
---|
191 | AC_MSG_RESULT(no) |
---|
192 | AC_MSG_WARN(Can not build factory without having gmp) |
---|
193 | enable_factory=no |
---|
194 | ac_configure_args="$ac_configure_args --disable-factory" |
---|
195 | fi |
---|
196 | else |
---|
197 | AC_MSG_RESULT(no) |
---|
198 | if test "$enable_factory" = yes && test ! -d factory; then |
---|
199 | AC_MSG_WARN(Did not find factory subdirectory) |
---|
200 | fi |
---|
201 | enable_factory=no |
---|
202 | ac_configure_args="$ac_configure_args --disable-factory" |
---|
203 | fi |
---|
204 | |
---|
205 | AC_MSG_CHECKING(whether to configure and build libfac lib) |
---|
206 | if test "$enable_libfac" != yes && test "$enable_libfac" != no; then |
---|
207 | if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then |
---|
208 | enable_libfac=yes |
---|
209 | else |
---|
210 | enable_libfac=no |
---|
211 | fi |
---|
212 | fi |
---|
213 | if test "$enable_libfac" = yes && test -d libfac; then |
---|
214 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
215 | AC_MSG_RESULT(yes) |
---|
216 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac" |
---|
217 | ac_configure_args="$ac_configure_args --enable-libfac" |
---|
218 | else |
---|
219 | AC_MSG_RESULT(no) |
---|
220 | AC_MSG_WARN(Can not build libfac without factory) |
---|
221 | enable_libfac=no |
---|
222 | ac_configure_args="$ac_configure_args --disable-libfac" |
---|
223 | fi |
---|
224 | else |
---|
225 | AC_MSG_RESULT(no) |
---|
226 | if test "$enable_libfac" = yes && test ! -d libfac; then |
---|
227 | AC_MSG_WARN(Did not find libfac subdirectory) |
---|
228 | fi |
---|
229 | enable_libfac=no |
---|
230 | ac_configure_args="$ac_configure_args --disable-libfac" |
---|
231 | fi |
---|
232 | |
---|
233 | AC_MSG_CHECKING(whether to configure and build Singular) |
---|
234 | if test "$enable_Singular" != yes && test "$enable_Singular" != no; then |
---|
235 | if test "$with_Singular" != no; then |
---|
236 | enable_Singular=yes |
---|
237 | else |
---|
238 | enable_Singular=no |
---|
239 | fi |
---|
240 | fi |
---|
241 | if test "$enable_Singular" = yes && test -d Singular; then |
---|
242 | AC_MSG_RESULT(yes) |
---|
243 | CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular" |
---|
244 | ac_configure_args="$ac_configure_args --enable-Singular" |
---|
245 | else |
---|
246 | AC_MSG_RESULT(no) |
---|
247 | if test "$enable_Singular" = yes && test ! -d Singular; then |
---|
248 | AC_MSG_WARN(Did not find Singular subdirectory) |
---|
249 | fi |
---|
250 | enable_Singular=no |
---|
251 | ac_configure_args="$ac_configure_args --disable-Singular" |
---|
252 | fi |
---|
253 | |
---|
254 | |
---|
255 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
256 | dnl Check whether or not to use various packages |
---|
257 | dnl |
---|
258 | AC_MSG_CHECKING(whether to use with gmp) |
---|
259 | if test "$with_gmp" != no && test "$with_gmp" != yes; then |
---|
260 | if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then |
---|
261 | with_gmp=yes |
---|
262 | else |
---|
263 | with_gmp=no |
---|
264 | fi |
---|
265 | ac_configure_args="$ac_configure_args --with-gmp=$with_gmp" |
---|
266 | fi |
---|
267 | if test "$with_gmp" = yes; then |
---|
268 | AC_MSG_RESULT(yes) |
---|
269 | else |
---|
270 | AC_MSG_RESULT(no) |
---|
271 | fi |
---|
272 | |
---|
273 | AC_MSG_CHECKING(whether to use with MP) |
---|
274 | if test "$with_MP" != no && test "$with_MP" != yes; then |
---|
275 | if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then |
---|
276 | with_MP=yes |
---|
277 | else |
---|
278 | with_MP=no |
---|
279 | fi |
---|
280 | ac_configure_args="$ac_configure_args --with-MP=$with_MP" |
---|
281 | fi |
---|
282 | if test "$with_MP" = yes; then |
---|
283 | AC_MSG_RESULT(yes) |
---|
284 | else |
---|
285 | AC_MSG_RESULT(no) |
---|
286 | fi |
---|
287 | |
---|
288 | AC_MSG_CHECKING(whether to use with factory) |
---|
289 | if test "$with_factory" != no && test "$with_factory" != yes; then |
---|
290 | if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then |
---|
291 | with_factory=yes |
---|
292 | else |
---|
293 | with_factory=no |
---|
294 | fi |
---|
295 | ac_configure_args="$ac_configure_args --with-factory=$with_factory" |
---|
296 | fi |
---|
297 | if test "$with_factory" = yes; then |
---|
298 | AC_MSG_RESULT(yes) |
---|
299 | else |
---|
300 | AC_MSG_RESULT(no) |
---|
301 | fi |
---|
302 | |
---|
303 | AC_MSG_CHECKING(whether to use with libfac) |
---|
304 | if test "$with_libfac" != no && test "$with_libfac" != yes; then |
---|
305 | if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then |
---|
306 | with_libfac=yes |
---|
307 | else |
---|
308 | with_libfac=no |
---|
309 | fi |
---|
310 | ac_configure_args="$ac_configure_args --with-libfac=$with_libfac" |
---|
311 | fi |
---|
312 | if test "$with_libfac" = yes; then |
---|
313 | AC_MSG_RESULT(yes) |
---|
314 | else |
---|
315 | AC_MSG_RESULT(no) |
---|
316 | fi |
---|
317 | |
---|
318 | AC_MSG_CHECKING(whether to use with Singular) |
---|
319 | if test "$with_Singular" != no && test "$with_Singular" != yes; then |
---|
320 | if test "$enable_Singular" = yes; then |
---|
321 | with_Singular=yes |
---|
322 | else |
---|
323 | with_Singular=no |
---|
324 | fi |
---|
325 | ac_configure_args="$ac_configure_args --with-Singular=$with_Singular" |
---|
326 | fi |
---|
327 | |
---|
328 | if test "$with_Singular" != no; then |
---|
329 | AC_MSG_RESULT(yes) |
---|
330 | else |
---|
331 | AC_MSG_RESULT(no) |
---|
332 | fi |
---|
333 | |
---|
334 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
335 | dnl Check for known subdirs |
---|
336 | dnl |
---|
337 | if test -d gmp; then |
---|
338 | SUBDIRS="gmp" |
---|
339 | fi |
---|
340 | if test -d MP; then |
---|
341 | SUBDIRS="$SUBDIRS MP" |
---|
342 | fi |
---|
343 | if test -d factory; then |
---|
344 | SUBDIRS="$SUBDIRS factory" |
---|
345 | fi |
---|
346 | if test -d libfac; then |
---|
347 | SUBDIRS="$SUBDIRS libfac" |
---|
348 | fi |
---|
349 | if test -d Singular; then |
---|
350 | SUBDIRS="$SUBDIRS Singular" |
---|
351 | fi |
---|
352 | |
---|
353 | |
---|
354 | dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
---|
355 | dnl Enough --wrap it up |
---|
356 | dnl |
---|
357 | AC_PROG_MAKE_SET |
---|
358 | AC_SUBST(SUBDIRS) |
---|
359 | AC_SUBST(CONFIG_SUBDIRS) |
---|
360 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
361 | |
---|
362 | AC_OUTPUT(Makefile) |
---|