source: git/configure.in @ a3600c

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