source: git/configure.in @ 7a9a32

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