source: git/configure.in @ 9b7eb0

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