source: git/configure.in @ 64c6d1

spielwiese
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
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
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
17AC_SUBST(SINGULAR_MAJOR_VERSION)
18AC_SUBST(SINGULAR_MINOR_VERSION)
19AC_SUBST(SINGULAR_SUB_VERSION)
20
21dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
22dnl those are needed to check for libs and headers, later on
23dnl
24AC_PROG_CC
25AC_PROG_CPP
26AC_AIX
27
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}"
42    else
43      AC_MSG_ERROR(Unknown architecture: Check singuname.sh)
44    fi
45  else
46    AC_MSG_ERROR(Need singuname.sh)
47  fi
48fi
49
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}"
72
73
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
86
87
88dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
89dnl check for various libraries and headers
90dnl
91AC_CHECK_LIB(m, atof)
92AC_CHECK_LIB(bsd, socket)
93AC_CHECK_LIB(socket, listen)
94AC_CHECK_LIB(nsl, gethostbyname)
95AC_CHECK_LIB(gmp, mpq_init)
96AC_CHECK_LIB(smallgmp, mpz_init)
97AC_CHECK_LIB(MP, IMP_PutGmpInt)
98AC_CHECK_LIB(MPT, MPT_GetTree)
99AC_CHECK_LIB(singcf, atof)
100AC_CHECK_LIB(singfac, atof)
101
102AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h)
103
104if test "$ac_cv_lib_gmp_mpq_init" = yes && \
105 test "$ac_cv_header_gmp_h" = yes; then
106    ac_gmp_ok=yes
107fi
108
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
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
122if test "$ac_cv_lib_singcf_atof" = yes && \
123 test "$ac_cv_header_factory_h" = yes; then
124  ac_factory_ok=yes
125fi
126
127if test "$ac_cv_lib_singfac_atof" = yes && \
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
137AC_ARG_ENABLE(smallgmp, \
138 [ --enable-PACKAGE        configure and build PACKAGE
139  --disable-PACKAGE       do not configure and build PACKAGE
140   where PACKAGE can be:
141     smallgmp             minimal version of gmp written in C only])
142AC_ARG_ENABLE(gmp, \
143 [    gmp                  Gnu Multiple Precision package])
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])
150AC_ARG_ENABLE(sgroup, \
151 [    sgroup               numerical semigroup computations])
152AC_ARG_ENABLE(Singular, \
153 [    Singular             CAS for Polynomial Computations])
154
155AC_ARG_WITH(MP,\
156 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
157  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
158   where PACKAGE can be:
159     MP                   Multi Protocol library])
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
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
190
191AC_MSG_CHECKING(whether to configure and build smallgmp lib)
192if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
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)
196    enable_smallgmp=yes
197    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
198    ac_configure_args="$ac_configure_args --enable-smallgmp --enable-gmp"
199  else
200    AC_MSG_RESULT(no)
201    enable_smallgmp=no
202  fi
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
213  fi
214else
215  AC_MSG_RESULT(${enable_smallgmp})
216fi
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
226  ac_configure_args="$ac_configure_args --enable-gmp"
227fi
228
229AC_MSG_CHECKING(whether to configure and build MP lib)
230if test "$enable_MP" != yes && test "$enable_MP" != no; then
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)
234    enable_MP=yes
235    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
236    ac_configure_args="$ac_configure_args --enable-MP"
237  else
238    AC_MSG_RESULT(no)
239    enable_MP=no
240  fi
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
247    AC_MSG_RESULT(yes)
248    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
249  else
250    AC_MSG_RESULT(no)
251    AC_MSG_ERROR(can not build MP without gmp)
252  fi
253else
254  AC_MSG_RESULT(no)
255fi
256
257 
258AC_MSG_CHECKING(whether to configure and build factory lib)
259if test "$enable_factory" != yes && test "$enable_factory" != no; then
260  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
261     test -d factory; then
262    enable_factory=yes
263    AC_MSG_RESULT(yes)
264    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
265    ac_configure_args="$ac_configure_args --enable-factory"
266  else
267    enable_factory=no
268    AC_MSG_RESULT(no)
269  fi
270elif test "$enable_factory" = yes; then
271  if test -d factory; then
272    AC_MSG_RESULT(yes)
273    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
274  else
275    AC_MSG_RESULT(no)
276    AC_MSG_ERROR(can not build factory without factory directory)
277  fi
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
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
287    enable_libfac=yes
288    AC_MSG_RESULT(yes)
289    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
290    ac_configure_args="$ac_configure_args --enable-libfac"
291  else
292    enable_libfac=no
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)
299  fi
300  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
301    AC_MSG_RESULT(yes)
302    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
303  else
304    AC_MSG_RESULT(no)
305    AC_MSG_ERROR(Can not build libfac without factory)
306  fi
307else
308  AC_MSG_RESULT(no)
309fi
310
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
316    enable_sgroup=yes
317    AC_MSG_RESULT(yes)
318    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
319    ac_configure_args="$ac_configure_args --enable-sgroup"
320  else
321    enable_sgroup=no
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)
335  fi
336else
337  AC_MSG_RESULT(no)
338fi
339
340
341AC_MSG_CHECKING(whether to configure and build Singular)
342if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
343  if test "$with_Singular" != no && test -d Singular; then
344    enable_Singular=yes
345    AC_MSG_RESULT(yes)
346    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
347    ac_configure_args="$ac_configure_args --enable-Singular"
348  else
349    enable_Singular=no
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)
359  fi
360else
361  AC_MSG_RESULT(no)
362fi
363
364
365dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
366dnl Check whether or not to use various packages
367dnl
368AC_MSG_CHECKING(wich apint package to use)
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"
389fi
390
391AC_MSG_CHECKING(whether to use with MP)
392if test "$with_MP" = yes; then
393  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
394    AC_MSG_RESULT(yes)
395  else
396    AC_MSG_RESULT(none)
397    AC_MSG_ERROR(can not use with MP without finding or building it)
398  fi
399elif test "$with_MP" = no; then
400  AC_MSG_RESULT(no)
401elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
402  AC_MSG_RESULT(yes)
403  ac_configure_args="$ac_configure_args --with-MP"
404else
405  AC_MSG_RESULT(no)
406  ac_configure_args="$ac_configure_args --without-MP"
407fi
408
409AC_MSG_CHECKING(whether to use with factory)
410if test "$with_factory" = yes; then
411  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
412    AC_MSG_RESULT(yes)
413  else
414    AC_MSG_RESULT(none)
415    AC_MSG_ERROR(can not use with factory without finding or building it)
416  fi
417elif test "$with_factory" = no; then
418  AC_MSG_RESULT(no)
419elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
420  AC_MSG_RESULT(yes)
421  ac_configure_args="$ac_configure_args --with-factory"
422else
423  AC_MSG_RESULT(no)
424  ac_configure_args="$ac_configure_args --without-factory"
425fi
426 
427AC_MSG_CHECKING(whether to use with libfac)
428if test "$with_libfac" = yes; then
429  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
430    AC_MSG_RESULT(yes)
431  else
432    AC_MSG_RESULT(none)
433    AC_MSG_ERROR(can not use with libfac without finding or building it)
434  fi
435elif test "$with_libfac" = no; then
436  AC_MSG_RESULT(no)
437elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
438  AC_MSG_RESULT(yes)
439  ac_configure_args="$ac_configure_args --with-libfac"
440else
441  AC_MSG_RESULT(no)
442  ac_configure_args="$ac_configure_args --without-libfac"
443fi
444
445
446AC_MSG_CHECKING(whether to use with Singular)
447if test "$with_Singular" != no && test "$with_Singular" != yes; then
448  if test "$enable_Singular" = yes; then
449    with_Singular=yes
450  else
451    with_Singular=no
452  fi
453  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
454fi
455
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
465if test -d smallgmp; then
466  SUBDIRS="smallgmp"
467fi
468if test -d gmp; then
469  SUBDIRS="gmp"
470fi
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
480if test -d sgroup; then
481  SUBDIRS="sgroup"
482fi
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
496AC_OUTPUT(Makefile doc/Makefile)
Note: See TracBrowser for help on using the repository browser.