source: git/configure.in @ 64c6d1

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