source: git/configure.in @ e1759c

spielwiese
Last change on this file since e1759c was e1759c, checked in by Hans Schönemann <hannes@…>, 26 years ago
*** empty log message *** git-svn-id: file:///usr/local/Singular/svn/trunk@2031 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 14.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 --  set these here
7dnl
8# make them to env variables
9# pass them indirectly to subsequent configures
10SINGULAR_MAJOR_VERSION=1
11SINGULAR_MINOR_VERSION=2
12SINGULAR_SUB_VERSION=0
13SINGULAR_VERSION="${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION}.${SINGULAR_SUB_VERSION}"
14VERSION_DATE="June 1998"
15export SINGULAR_MINOR_VERSION
16export SINGULAR_MAJOR_VERSION
17export SINGULAR_SUB_VERSION
18export SINGULAR_VERSION
19export VERSION_DATE
20
21dnl substitue them into the Makefiles
22AC_SUBST(SINGULAR_MAJOR_VERSION)
23AC_SUBST(SINGULAR_MINOR_VERSION)
24AC_SUBST(SINGULAR_SUB_VERSION)
25
26dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
27dnl those are needed to check for libs and headers, later on
28dnl
29AC_PROG_CC
30AC_PROG_CPP
31AC_AIX
32
33dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
34dnl exec_prefix, bindir, libdir, includedir to some sensible values
35dnl
36
37# expand prefix and pass it to subsequent configures
38test "x$prefix" = xNONE && prefix=${ac_default_prefix}; \
39    ac_configure_args="$ac_configure_args --prefix=${prefix}"
40
41# expand exec_prefix
42if test "x$exec_prefix" = xNONE; then
43  if test -r "singuname.sh"; then
44    if (/bin/sh singuname.sh >/dev/null 2>&1) then
45        exec_prefix=${prefix}/`/bin/sh singuname.sh`
46        ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}"
47    else
48      AC_MSG_ERROR(Unknown architecture: Check singuname.sh)
49    fi
50  else
51    AC_MSG_ERROR(Need singuname.sh)
52  fi
53fi
54
55# expand bindir
56test "x$bindir" = 'x${exec_prefix}/bin' && \
57  bindir="${exec_prefix}/bin" ; \
58   ac_configure_args="$ac_configure_args --bindir=${bindir}"
59
60# construct name of installed Singular executable
61SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION}.${SINGULAR_SUB_VERSION}
62export SINGULAR
63AC_SUBST(SINGULAR)
64
65# expand libdir
66test "x$libdir" = 'x${exec_prefix}/lib' && \
67  libdir="${exec_prefix}/lib/${SINGULAR_VERSION}" ; \
68   ac_configure_args="$ac_configure_args --libdir=${libdir}"
69
70# expand includedir
71test "x$includedir" = 'x${prefix}/include' &&  \
72  includedir="${exec_prefix}/include/${SINGULAR_VERSION}" ; \
73   ac_configure_args="$ac_configure_args --includedir=${includedir}"
74
75# add to -I to CPPFLAGS and and -L to LDFLAGS, just to be sure
76LDFLAGS="-L${libdir} ${LDFLAGS}"
77CPPFLAGS="-I${includedir} ${CPPFLAGS}"
78
79
80AC_MSG_CHECKING(whether _AIX is defined)
81AC_CACHE_VAL(ac_cv_is_aix,
82AC_EGREP_CPP(yes,
83[#ifdef _AIX
84    yes
85#endif
86], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
87if test "$ac_cv_is_aix" = yes; then
88  AC_MSG_RESULT(yes)
89else
90  AC_MSG_RESULT(no)
91fi
92
93
94dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
95dnl check for various libraries and headers
96dnl
97AC_CHECK_LIB(m, atof)
98AC_CHECK_LIB(bsd, socket)
99AC_CHECK_LIB(socket, listen)
100AC_CHECK_LIB(nsl, gethostbyname)
101AC_CHECK_LIB(gmp, mpq_init)
102AC_CHECK_LIB(smallgmp, mpz_init)
103AC_CHECK_LIB(MP, IMP_PutGmpInt)
104AC_CHECK_LIB(MPT, MPT_GetTree)
105AC_CHECK_LIB(singcf, atof)
106AC_CHECK_LIB(singfac, atof)
107
108AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h)
109
110if test "$ac_cv_lib_gmp_mpq_init" = yes && \
111 test "$ac_cv_header_gmp_h" = yes; then
112    ac_gmp_ok=yes
113fi
114
115if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \
116 test "$ac_cv_header_smallgmp_h" = yes && \
117 test "$ac_cv_header_gmp_h" = yes; then
118    ac_smallgmp_ok=yes
119fi
120
121if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
122 test "$ac_cv_lib_MPT_MPT_GetTree" && \
123 test "$ac_cv_header_MP_h" = yes && \
124 test "$ac_cv_header_MPT_h" = yes; then
125  ac_MP_ok=yes
126fi
127
128if test "$ac_cv_lib_singcf_atof" = yes && \
129 test "$ac_cv_header_factory_h" = yes; then
130  ac_factory_ok=yes
131fi
132
133if test "$ac_cv_lib_singfac_atof" = yes && \
134 test "$ac_cv_header_factor_h" = yes; then
135  ac_libfac_ok=yes
136fi
137
138
139 
140dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
141dnl Check whether or not to built various packages
142dnl
143AC_ARG_ENABLE(smallgmp, \
144 [ --enable-PACKAGE        configure and build PACKAGE
145  --disable-PACKAGE       do not configure and build PACKAGE
146   where PACKAGE can be:
147     smallgmp             minimal version of gmp written in C only])
148AC_ARG_ENABLE(gmp, \
149 [    gmp                  Gnu Multiple Precision package])
150AC_ARG_ENABLE(MP, \
151 [    MP                   Multi Protocol library])
152AC_ARG_ENABLE(factory, \
153 [    factory              polynomial factorization library])
154AC_ARG_ENABLE(libfac, \
155 [    libfac               char set and modp poly factorization library])
156AC_ARG_ENABLE(sgroup, \
157 [    sgroup               numerical semigroup computations])
158AC_ARG_ENABLE(Singular, \
159 [    Singular             CAS for Polynomial Computations])
160
161AC_ARG_WITH(MP,\
162 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
163  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
164   where PACKAGE can be:
165     MP                   Multi Protocol library])
166AC_ARG_WITH(factory, \
167 [    factory              polynomial factorization library])
168AC_ARG_WITH(libfac, \
169 [    libfac               char set and modp poly factorization library])
170AC_ARG_WITH(gmp, \
171 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
172                          where PACKAGE can be gmp or smallgmp])
173
174AC_MSG_CHECKING(whether to configure and build gmp lib)
175if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
176  if test "$ac_gmp_ok" != yes && test -d gmp; then
177    AC_MSG_RESULT(yes)
178    enable_gmp=yes
179    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
180    ac_configure_args="$ac_configure_args --enable-gmp"
181  else
182    AC_MSG_RESULT(no)
183    enable_gmp=no
184  fi
185elif test "$enable_gmp" = yes; then
186  if test ! -d gmp; then
187    AC_MSG_RESULT(no)
188    AC_MSG_ERROR(Can not find gmp subdir)
189  else
190    AC_MSG_RESULT(yes)
191    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
192  fi
193else
194  AC_MSG_RESULT(no)
195fi
196
197AC_MSG_CHECKING(whether to configure and build smallgmp lib)
198if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
199  if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
200     test "$enable_gmp" != yes && test -d smallgmp; then
201    AC_MSG_RESULT(yes)
202    enable_smallgmp=yes
203    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
204    ac_configure_args="$ac_configure_args --enable-smallgmp --enable-gmp"
205  else
206    AC_MSG_RESULT(no)
207    enable_smallgmp=no
208  fi
209elif test "$enable_smallgmp" = yes; then
210  if test ! -d smallgmp; then
211    AC_MSG_RESULT(no)
212    AC_MSG_ERROR(Can not find smallgmp subdir)
213  else
214    AC_MSG_RESULT(yes)
215    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
216    if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
217      ac_configure_args="$ac_configure_args --enable-gmp"
218    fi
219  fi
220else
221  AC_MSG_RESULT(${enable_smallgmp})
222fi
223
224# Check whether we have at least one of smallgmp or gmp
225if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
226   test "$enable_smallgmp" != yes && test "$enable_gmp" != yes; then
227  AC_MSG_ERROR(can neither find nor built gmp or smallgmp)
228fi
229
230# Check whether we need to cheat subsequent configures with --enable-gmp
231if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes; then
232  ac_configure_args="$ac_configure_args --enable-gmp"
233fi
234
235AC_MSG_CHECKING(whether to configure and build MP lib)
236if test "$enable_MP" != yes && test "$enable_MP" != no; then
237  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
238     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
239    AC_MSG_RESULT(yes)
240    enable_MP=yes
241    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
242    ac_configure_args="$ac_configure_args --enable-MP"
243  else
244    AC_MSG_RESULT(no)
245    enable_MP=no
246  fi
247elif test "$enable_MP" = yes; then
248  if test ! -d MP; then
249    AC_MSG_RESULT(no)
250    AC_MSG_ERROR(can not build MP without MP directory)
251  fi
252  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
253    AC_MSG_RESULT(yes)
254    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
255  else
256    AC_MSG_RESULT(no)
257    AC_MSG_ERROR(can not build MP without gmp)
258  fi
259else
260  AC_MSG_RESULT(no)
261fi
262
263 
264AC_MSG_CHECKING(whether to configure and build factory lib)
265if test "$enable_factory" != yes && test "$enable_factory" != no; then
266  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
267     test -d factory; then
268    enable_factory=yes
269    AC_MSG_RESULT(yes)
270    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
271    ac_configure_args="$ac_configure_args --enable-factory"
272  else
273    enable_factory=no
274    AC_MSG_RESULT(no)
275  fi
276elif test "$enable_factory" = yes; then
277  if test -d factory; then
278    AC_MSG_RESULT(yes)
279    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
280  else
281    AC_MSG_RESULT(no)
282    AC_MSG_ERROR(can not build factory without factory directory)
283  fi
284else
285  AC_MSG_RESULT(no)
286fi
287
288AC_MSG_CHECKING(whether to configure and build libfac lib)
289if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
290  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
291     test -d libfac && \
292     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
293    enable_libfac=yes
294    AC_MSG_RESULT(yes)
295    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
296    ac_configure_args="$ac_configure_args --enable-libfac"
297  else
298    enable_libfac=no
299    AC_MSG_RESULT(no)
300  fi
301elif  test "$enable_libfac" = yes; then
302  if test ! -d libfac; then
303    AC_MSG_RESULT(no)
304    AC_MSG_ERROR(can not build libfac without libfac directory)
305  fi
306  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
307    AC_MSG_RESULT(yes)
308    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
309  else
310    AC_MSG_RESULT(no)
311    AC_MSG_ERROR(Can not build libfac without factory)
312  fi
313else
314  AC_MSG_RESULT(no)
315fi
316
317AC_MSG_CHECKING(whether to configure and build sgroup lib)
318if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
319  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
320     test -d sgroup && \
321     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
322    enable_sgroup=yes
323    AC_MSG_RESULT(yes)
324    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
325    ac_configure_args="$ac_configure_args --enable-sgroup"
326  else
327    enable_sgroup=no
328    AC_MSG_RESULT(no)
329  fi
330elif  test "$enable_sgroup" = yes; then
331  if test ! -d sgroup; then
332    AC_MSG_RESULT(no)
333    AC_MSG_ERROR(can not build sgroup without sgroup directory)
334  fi
335  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
336    AC_MSG_RESULT(yes)
337    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
338  else
339    AC_MSG_RESULT(no)
340    AC_MSG_ERROR(Can not build sgroup without MP)
341  fi
342else
343  AC_MSG_RESULT(no)
344fi
345
346
347AC_MSG_CHECKING(whether to configure and build Singular)
348if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
349  if test "$with_Singular" != no && test -d Singular; then
350    enable_Singular=yes
351    AC_MSG_RESULT(yes)
352    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
353    ac_configure_args="$ac_configure_args --enable-Singular"
354  else
355    enable_Singular=no
356    AC_MSG_RESULT(no)
357  fi
358elif test "$enable_Singular" = yes; then
359  if test -d Singular; then
360    AC_MSG_RESULT(yes)
361    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
362  else
363    AC_MSG_RESULT(no)
364    AC_MSG_ERROR(can not build Singular without Singular directory)
365  fi
366else
367  AC_MSG_RESULT(no)
368fi
369
370
371dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
372dnl Check whether or not to use various packages
373dnl
374AC_MSG_CHECKING(wich apint package to use)
375if test "$with_apint" = gmp; then
376  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
377    AC_MSG_RESULT(gmp)
378  else
379    AC_MSG_RESULT(none)
380    AC_MSG_ERROR(can not use with gmp without finding or building it)
381  fi
382elif test "$with_apint" = smallgmp; then
383  if test "$ac_smallgmp_ok" = yes || test "$enable_smallgmp" = yes; then
384    AC_MSG_RESULT(smallgmp)
385  else
386    AC_MSG_RESULT(none)
387    AC_MSG_ERROR(can not use with smallgmp without finding or building it)
388  fi
389elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
390    AC_MSG_RESULT(gmp)
391    ac_configure_args="$ac_configure_args --with-apint=gmp"
392else
393   AC_MSG_RESULT(smallgmp)
394   ac_configure_args="$ac_configure_args --with-apint=smallgmp"
395fi
396
397AC_MSG_CHECKING(whether to use with MP)
398if test "$with_MP" = yes; then
399  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
400    AC_MSG_RESULT(yes)
401  else
402    AC_MSG_RESULT(none)
403    AC_MSG_ERROR(can not use with MP without finding or building it)
404  fi
405elif test "$with_MP" = no; then
406  AC_MSG_RESULT(no)
407elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
408  AC_MSG_RESULT(yes)
409  ac_configure_args="$ac_configure_args --with-MP"
410else
411  AC_MSG_RESULT(no)
412  ac_configure_args="$ac_configure_args --without-MP"
413fi
414
415AC_MSG_CHECKING(whether to use with factory)
416if test "$with_factory" = yes; then
417  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
418    AC_MSG_RESULT(yes)
419  else
420    AC_MSG_RESULT(none)
421    AC_MSG_ERROR(can not use with factory without finding or building it)
422  fi
423elif test "$with_factory" = no; then
424  AC_MSG_RESULT(no)
425elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
426  AC_MSG_RESULT(yes)
427  ac_configure_args="$ac_configure_args --with-factory"
428else
429  AC_MSG_RESULT(no)
430  ac_configure_args="$ac_configure_args --without-factory"
431fi
432 
433AC_MSG_CHECKING(whether to use with libfac)
434if test "$with_libfac" = yes; then
435  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
436    AC_MSG_RESULT(yes)
437  else
438    AC_MSG_RESULT(none)
439    AC_MSG_ERROR(can not use with libfac without finding or building it)
440  fi
441elif test "$with_libfac" = no; then
442  AC_MSG_RESULT(no)
443elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
444  AC_MSG_RESULT(yes)
445  ac_configure_args="$ac_configure_args --with-libfac"
446else
447  AC_MSG_RESULT(no)
448  ac_configure_args="$ac_configure_args --without-libfac"
449fi
450
451
452AC_MSG_CHECKING(whether to use with Singular)
453if test "$with_Singular" != no && test "$with_Singular" != yes; then
454  if test "$enable_Singular" = yes; then
455    with_Singular=yes
456  else
457    with_Singular=no
458  fi
459  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
460fi
461
462if test "$with_Singular" != no; then
463  AC_MSG_RESULT(yes)
464else
465  AC_MSG_RESULT(no)
466fi
467
468dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
469dnl Check for known subdirs
470dnl
471if test -d smallgmp; then
472  SUBDIRS="smallgmp"
473fi
474if test -d gmp; then
475  SUBDIRS="gmp"
476fi
477if test -d MP; then
478  SUBDIRS="$SUBDIRS MP"
479fi
480if test -d factory; then
481  SUBDIRS="$SUBDIRS factory"
482fi
483if test -d libfac; then
484  SUBDIRS="$SUBDIRS libfac"
485fi
486if test -d sgroup; then
487  SUBDIRS="sgroup"
488fi
489if test -d Singular; then
490  SUBDIRS="$SUBDIRS Singular"
491fi
492 
493
494dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
495dnl Enough --wrap it up
496dnl
497AC_PROG_MAKE_SET
498AC_SUBST(SUBDIRS)
499AC_SUBST(CONFIG_SUBDIRS)
500AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
501
502AC_OUTPUT(Makefile doc/Makefile)
Note: See TracBrowser for help on using the repository browser.