source: git/configure.in @ 690e864

spielwiese
Last change on this file since 690e864 was 690e864, checked in by Kai Krüger <krueger@…>, 19 years ago
added missing directory kernel git-svn-id: file:///usr/local/Singular/svn/trunk@7866 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 25.6 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2AC_INIT(kernel/matpol.h)
3AC_PREFIX_DEFAULT(`pwd`)
4pwd=`pwd`
5
6dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
7dnl Version business --  set these here
8dnl
9# make them to env variables
10# pass them indirectly to subsequent configures
11SINGULAR_MAJOR_VERSION=2
12SINGULAR_MINOR_VERSION=1
13SINGULAR_SUB_VERSION=99
14VERSION_SEP="-"
15SINGULAR_SHORT_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}"
16SINGULAR_VERSION="${SINGULAR_SHORT_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
17SINGULAR_RPM_VERSION="${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION}.${SINGULAR_SUB_VERSION}"
18VERSION_DATE="August 2004"
19SINGULAR_ROOT_DIR=$pwd
20
21export SINGULAR_MINOR_VERSION
22export SINGULAR_MAJOR_VERSION
23export SINGULAR_SUB_VERSION
24export SINGULAR_VERSION
25export SINGULAR_RPM_VERSION
26export VERSION_DATE
27export SINGULAR_ROOT_DIR
28
29dnl substitue them into the Makefiles
30AC_SUBST(SINGULAR_VERSION)
31AC_SUBST(VERSION_DATE)
32AC_SUBST(SINGULAR_SHORT_VERSION)
33AC_SUBST(SINGULAR_RPM_VERSION)
34AC_SUBST(SINGULAR_ROOT_DIR)
35
36
37dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
38dnl Makefiles to output
39dnl
40# determine Makefiles to output
41OUTPUT_MAKEFILES="Makefile"
42if test -d "doc"; then
43   OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES doc/Makefile doc/version.texi doc/uname.texi"
44fi
45dnl if test -d "rpm"; then
46dnl   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/Makefile"
47dnl   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/Singular.spec"
48dnl fi
49if test -d "modules"; then
50dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/Makefile"
51   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" modules"
52fi
53dnl if test -d "modules/tools"; then
54dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/tools/Makefile"
55dnl fi
56dnl if test -d "modules/modgen"; then
57dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/modgen/Makefile"
58dnl fi
59if test -d "emacs"; then
60   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" emacs/Makefile"
61fi
62if test -d "IntegerProgramming"; then
63   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" IntegerProgramming/Makefile"
64fi
65if test -d "Plural"; then
66   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" Plural/Makefile"
67fi
68if test -d "InstallShield"; then
69   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" InstallShield/Makefile InstallShield/Etc/Makefile InstallShield/Cygwin/Makefile InstallShield/Singular/Makefile InstallShield/Xemacs/Makefile"
70fi
71
72
73dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
74dnl determine singuname
75dnl
76AC_MSG_CHECKING(uname for singular)
77AC_CACHE_VAL(ac_cv_singuname,
78ac_cv_singuname="unknown"
79if test -r "singuname.sh"; then
80  if (/bin/sh singuname.sh >/dev/null 2>&1) then
81    ac_cv_singuname=`/bin/sh singuname.sh`
82  fi
83fi
84)
85AC_MSG_RESULT($ac_cv_singuname)
86if test "$ac_cv_singuname" = unknown; then
87  AC_MSG_ERROR(Unknown architecture: Check singuname.sh)
88else
89  SINGUNAME=$ac_cv_singuname
90  AC_SUBST(SINGUNAME)
91fi
92
93SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
94AC_SUBST(SING_UNAME)
95
96
97dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
98dnl compiler stuff
99dnl is needed to check for libs and headers, later on
100dnl
101AC_PROG_CC
102AC_PROG_CPP
103AC_PROG_INSTALL
104AC_AIX
105AC_PROG_CXX
106
107SING_CC=${CC}; export SING_CC
108SING_CXX=${CXX}; export SING_CXX
109
110# check whether the compiler accepts -pipe
111AC_MSG_CHECKING(whether compiler accepts -pipe)
112temp_cflags=${CFLAGS}
113CFLAGS="${CFLAGS} -pipe"
114AC_CACHE_VAL(ac_cv_cxx_have_pipe,
115AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no)
116)
117AC_MSG_RESULT(${ac_cv_cxx_have_pipe})
118CFLAGS=${temp_cflags}
119if test "${ac_cv_cxx_have_pipe}" != yes; then
120  PIPE=
121else
122  PIPE="-pipe"
123fi
124AC_SUBST(PIPE)
125
126AC_CHECK_PROGS(PERL, perl5 perl)
127AC_CHECK_PROGS(UUDECODE, uudecode "uudeview -i")
128AC_CHECK_PROGS(GUNZIP, gunzip,  ${pwd}/warn_not_found.sh gunzip)
129# don't use GZIP this breaks configure
130AC_CHECK_PROGS(MYGZIP, gzip, ${pwd}/warn_not_found.sh gzip)
131AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
132AC_PROG_LN_S
133
134if test -r "${pwd}/mkinstalldirs"; then
135  MKINSTALLDIRS=${pwd}/mkinstalldirs
136  AC_SUBST(MKINSTALLDIRS)
137else
138  AC_MSG_ERROR(mkinstalldirs not foind in ${pwd})
139fi
140
141dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
142dnl Set exec_prefix, bindir, libdir, includedir to some sensible values
143dnl
144# expand prefix and pass it to subsequent configures
145if test "x$prefix" = xNONE; then
146  prefix=${ac_default_prefix}
147  ac_configure_args="$ac_configure_args --prefix=${prefix}"
148fi
149
150# expand exec_prefix
151if test "x$exec_prefix" = xNONE; then
152 exec_prefix=${prefix}/${ac_cv_singuname}
153 ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}"
154fi
155
156# expand bindir
157if test "x$bindir" = 'x${exec_prefix}/bin'; then
158  bindir="${exec_prefix}"
159  ac_configure_args="$ac_configure_args --bindir=${bindir}"
160fi
161
162# expand libdir
163if test "x$libdir" = 'x${exec_prefix}/lib'; then
164  libdir="${exec_prefix}/lib"
165  ac_configure_args="$ac_configure_args --libdir=${libdir}"
166fi
167
168# expand includedir
169if test "x$includedir" = 'x${prefix}/include'; then
170  includedir="${exec_prefix}/include"
171  ac_configure_args="$ac_configure_args --includedir=${includedir}"
172fi
173
174# construct name of installed Singular executable
175SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}
176export SINGULAR
177AC_SUBST(SINGULAR)
178
179dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
180dnl Check for various libraries and headers
181dnl
182dnl After this part, the variables 'ac_<package>_ok' is 'yes'
183dnl if '<package>' is already existent on the system, otherwise
184dnl undefined.
185dnl
186
187# add -I to CPPFLAGS and -L to LDFLAGS, just to be sure
188LDFLAGS="-L${libdir} ${LDFLAGS}"
189CPPFLAGS="-I${includedir} ${CPPFLAGS}"
190
191# check for AIX
192AC_MSG_CHECKING(whether _AIX is defined)
193AC_CACHE_VAL(ac_cv_is_aix,
194AC_EGREP_CPP(yes,
195[#ifdef _AIX
196    yes
197#endif
198], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
199if test "$ac_cv_is_aix" = yes; then
200  AC_MSG_RESULT(yes)
201else
202  AC_MSG_RESULT(no)
203fi
204
205AC_CHECK_LIB(m, atof)
206AC_CHECK_LIB(bsd, socket)
207AC_CHECK_LIB(socket, listen)
208AC_CHECK_LIB(nsl, gethostbyname)
209AC_CHECK_LIB(gmp, main)
210AC_CHECK_LIB(smallgmp, mpz_init)
211AC_CHECK_LIB(MP, IMP_PutGmpInt)
212AC_CHECK_LIB(MPT, MPT_GetTree)
213AC_CHECK_LIB(singcf, atof)
214AC_CHECK_LIB(singfac, atof)
215AC_CHECK_LIB(omalloc, omTestAddr)
216AC_CHECK_LIB(omalloc_ndebug, main)
217
218AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h omalloc.h)
219
220if test "$ac_cv_lib_gmp_main" = yes && \
221 test "$ac_cv_header_gmp_h" = yes; then
222  ac_gmp_ok=yes
223fi
224
225if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \
226 test "$ac_cv_header_smallgmp_h" = yes && \
227 test "$ac_cv_header_gmp_h" = yes; then
228  ac_smallgmp_ok=yes
229fi
230
231if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
232 test "$ac_cv_lib_MPT_MPT_GetTree" && \
233 test "$ac_cv_header_MP_h" = yes && \
234 test "$ac_cv_header_MPT_h" = yes; then
235  ac_MP_ok=yes
236fi
237
238if test "$ac_cv_lib_singcf_atof" = yes && \
239 test "$ac_cv_header_factory_h" = yes; then
240  ac_factory_ok=yes
241fi
242
243if test "$ac_cv_lib_singfac_atof" = yes && \
244 test "$ac_cv_header_factor_h" = yes; then
245  ac_libfac_ok=yes
246fi
247
248if test "$ac_cv_lib_omalloc_omTestAddr" = yes && \
249   test "$ac_cv_lib_omalloc_ndebug_main" = yes && \
250   test "$ac_cv_header_omalloc_c" = yes && \
251   test "$ac_cv_header_omalloc_h" = yes; then
252  ac_cv_omalloc_ok=yes
253fi
254 
255dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
256dnl Check command line arguments
257dnl
258AC_ARG_WITH(tmpdir, \
259 [ --with-tmpdir=DIR       use DIR as temporary directory])
260AC_ARG_ENABLE(smallgmp, \
261 [ --enable-PACKAGE        configure and/or build PACKAGE
262  --disable-PACKAGE       do not configure and/or build PACKAGE
263   where PACKAGE can be:
264     smallgmp             minimal version of gmp written in C only])
265AC_ARG_ENABLE(omalloc,\
266 [    omalloc              omalloc memory managment])
267AC_ARG_ENABLE(gmp, \
268 [    gmp                  Gnu Multiple Precision package])
269AC_ARG_ENABLE(MP, \
270 [    MP                   Multi Protocol library])
271AC_ARG_ENABLE(factory, \
272 [    factory              polynomial factorization library])
273AC_ARG_ENABLE(libfac, \
274 [    libfac               char set and modp poly factorization library])
275AC_ARG_ENABLE(sgroup, \
276 [    sgroup               numerical semigroup computations])
277AC_ARG_ENABLE(Singular, \
278 [    Singular             CAS for Polynomial Computations])
279AC_ARG_ENABLE(IntegerProgramming, \
280 [    IntegerProgramming   IntegerProgramming])
281AC_ARG_ENABLE(Plural, \
282 [    Plural               Plural])
283AC_ARG_ENABLE(Texinfo, \
284 [    Texinfo              Texinfo for info, texi2dvi, makeinfo])
285AC_ARG_ENABLE(Texi2html, \
286 [    Texi2html            Texinfo to HTML converter])
287AC_ARG_ENABLE(doc, \
288 [    doc                  Singular documentation])
289AC_ARG_ENABLE(emacs, \
290 [    emacs                emacs completion files])
291AC_ARG_WITH(MP,\
292 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
293  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
294   where PACKAGE can be:
295     MP                   Multi Protocol library])
296AC_ARG_WITH(factory, \
297 [    factory              polynomial factorization library])
298AC_ARG_WITH(libfac, \
299 [    libfac               char set and modp poly factorization library])
300AC_ARG_WITH(gmp, \
301 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
302                          where PACKAGE can be gmp or smallgmp
303All additional --enable and --with options are passed to subsequent calls
304to configure of the packages to be built. See also configure --help in
305these packages (resp. subdirs). ])
306
307dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
308dnl Check what to use as tmp dir
309dnl
310AC_MSG_CHECKING(which tmp dir to use)
311if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
312  if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
313  then
314    TMP_DIR="${pwd}/tmp"
315  else
316    TMP_DIR=${with_tmpdir}
317  fi
318else
319  TMP_DIR="${pwd}/tmp"
320fi
321AC_MSG_RESULT($TMP_DIR)
322AC_SUBST(TMP_DIR)
323
324dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
325dnl Check whether or not to configure and build various packages
326dnl
327AC_MSG_CHECKING(whether to configure and build omalloc)
328if test "${enable_omalloc+set}" != set; then
329   if test "$ac_cv_omalloc_ok" = yes; then
330     enable_omalloc=no
331   fi
332   enable_omalloc_not_set=yes
333fi
334if test "$enable_omalloc" = no; then
335  if test "$ac_cv_omalloc_ok" != yes; then
336    AC_MSG_ERROR(can not build without omalloc)
337  fi
338  AC_MSG_RESULT(no)
339else
340  if test -d omalloc; then
341    AC_MSG_RESULT(yes)
342    if test "$enable_omalloc_not_set" = yes; then
343      ac_configure_args="$ac_configure_args --enable-omalloc --with-external-config_h='$pwd/Singular/omSingularConfig.h' --with-track-custom"
344    fi
345    CONFIG_SUBDIRS="$CONFIG_SUBDIRS omalloc"
346    if test "${with_malloc+set}" != set; then
347case "$ac_cv_singuname" in
348# under windows, it is best to use the provided malloc
349        ix86-Win*)
350        with_malloc=system
351        ac_configure_args="$ac_configure_args --with-malloc=system"
352        ;;
353        PowerMacintosh-darwin*)
354        with_malloc=system
355        ac_configure_args="$ac_configure_args --with-malloc=system"
356        ;;
357esac
358fi
359  else
360    AC_MSG_ERROR(need omalloc subdir)
361  fi
362fi
363
364AC_MSG_CHECKING(whether to configure and build gmp lib)
365if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
366  if test "$ac_gmp_ok" != yes && test -d gmp; then
367    AC_MSG_RESULT(yes)
368    enable_gmp=yes
369    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
370    ac_configure_args="$ac_configure_args --enable-gmp"
371    enable_gmp=yes
372#    This we used to need for our patched version of gmp 2.x
373#    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
374  else
375    AC_MSG_RESULT(no)
376    enable_gmp=no
377  fi
378elif test "$enable_gmp" = yes; then
379  if test ! -d gmp; then
380    AC_MSG_RESULT(no)
381    AC_MSG_ERROR(Can not find gmp subdir)
382  else
383    AC_MSG_RESULT(yes)
384    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
385#    This we used to need for our patched version of gmp 2.x
386#    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
387  fi
388else
389  AC_MSG_RESULT(no)
390fi
391
392if test "$enable_gmp" = yes; then
393# for gmp-3.0 to work for all ix86 processors, set generic target
394if test "$target" = NONE; then
395case "$ac_cv_singuname" in
396        ix86*)
397        gmp_target=`./config.guess | sed 's/^\w*-/i386-/'`
398        ac_configure_args="$ac_configure_args --target=$gmp_target"
399        ;;
400esac
401fi
402# furthermore, disable building of dynamic libraries, for we want to
403# link against the static ones
404if test "$enable_shared" != no; then
405  ac_configure_args="$ac_configure_args --disable-shared"
406fi
407fi
408
409AC_MSG_CHECKING(whether to configure and build smallgmp lib)
410if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
411  if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
412     test "$enable_gmp" != yes && test -d smallgmp; then
413    AC_MSG_RESULT(yes)
414    enable_smallgmp=yes
415    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
416    ac_configure_args="$ac_configure_args --enable-smallgmp --enable-gmp"
417    enable_gmp=yes
418  else
419    AC_MSG_RESULT(no)
420    enable_smallgmp=no
421  fi
422elif test "$enable_smallgmp" = yes; then
423  if test ! -d smallgmp; then
424    AC_MSG_RESULT(no)
425    AC_MSG_ERROR(Can not find smallgmp subdir)
426  else
427    AC_MSG_RESULT(yes)
428    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
429    if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
430      ac_configure_args="$ac_configure_args --enable-gmp"
431      enable_gmp=yes
432    fi
433  fi
434else
435  AC_MSG_RESULT(${enable_smallgmp})
436fi
437
438# Check whether we have at least one of smallgmp or gmp
439if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
440   test "$enable_smallgmp" != yes && test "$enable_gmp" != yes; then
441  AC_MSG_ERROR(can neither find nor built gmp or smallgmp)
442fi
443
444# Check whether we need to cheat subsequent configures with --enable-gmp
445if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
446  ac_configure_args="$ac_configure_args --enable-gmp"
447fi
448
449AC_MSG_CHECKING(whether to configure and build MP lib)
450if test "$enable_MP" != yes && test "$enable_MP" != no; then
451  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
452     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
453    AC_MSG_RESULT(yes)
454    enable_MP=yes
455    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
456    ac_configure_args="$ac_configure_args --enable-MP"
457  else
458    AC_MSG_RESULT(no)
459    enable_MP=no
460  fi
461elif test "$enable_MP" = yes; then
462  if test ! -d MP; then
463    AC_MSG_RESULT(no)
464    AC_MSG_ERROR(can not build MP without MP directory)
465  fi
466  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
467    AC_MSG_RESULT(yes)
468    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
469  else
470    AC_MSG_RESULT(no)
471    AC_MSG_ERROR(can not build MP without gmp)
472  fi
473else
474  AC_MSG_RESULT(no)
475fi
476
477# need MP code to be compiled with -fPIC, should not hurt anybody else
478if test "$enable_MP" = yes && test "${with_extra_cflags+set}" != set; then
479ac_configure_args="$ac_configure_args --with-extra_cflags=-fPIC"
480fi
481
482AC_MSG_CHECKING(whether to configure and build NTL lib)
483if test "$enable_NTL" != yes && test "$enable_NTL" != no; then
484  if test "$with_NTL" != no && test "$ac_NTL_ok" != yes && \
485     test -d ntl; then
486    enable_NTL=yes
487    AC_MSG_RESULT(yes)
488    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
489    ac_configure_args="$ac_configure_args --enable-NTL"
490  else
491    enable_NTL=no
492    AC_MSG_RESULT(no)
493  fi
494elif test "$enable_NTL" = yes; then
495  if test -d ntl; then
496    AC_MSG_RESULT(yes)
497    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
498  else
499    AC_MSG_RESULT(no)
500    AC_MSG_ERROR(can not build NTL without ntl directory)
501  fi
502else
503  AC_MSG_RESULT(no)
504fi
505
506AC_MSG_CHECKING(whether to configure and build factory lib)
507if test "$enable_factory" != yes && test "$enable_factory" != no; then
508  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
509     test -d factory; then
510    enable_factory=yes
511    AC_MSG_RESULT(yes)
512    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
513    ac_configure_args="$ac_configure_args --enable-factory"
514  else
515    enable_factory=no
516    AC_MSG_RESULT(no)
517  fi
518elif test "$enable_factory" = yes; then
519  if test -d factory; then
520    AC_MSG_RESULT(yes)
521    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
522  else
523    AC_MSG_RESULT(no)
524    AC_MSG_ERROR(can not build factory without factory directory)
525  fi
526else
527  AC_MSG_RESULT(no)
528fi
529
530AC_MSG_CHECKING(whether to configure and build libfac lib)
531if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
532  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
533     test -d libfac && \
534     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
535    enable_libfac=yes
536    AC_MSG_RESULT(yes)
537    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
538    ac_configure_args="$ac_configure_args --enable-libfac"
539  else
540    enable_libfac=no
541    AC_MSG_RESULT(no)
542  fi
543elif  test "$enable_libfac" = yes; then
544  if test ! -d libfac; then
545    AC_MSG_RESULT(no)
546    AC_MSG_ERROR(can not build libfac without libfac directory)
547  fi
548  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
549    AC_MSG_RESULT(yes)
550    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
551  else
552    AC_MSG_RESULT(no)
553    AC_MSG_ERROR(Can not build libfac without factory)
554  fi
555else
556  AC_MSG_RESULT(no)
557fi
558
559AC_MSG_CHECKING(whether to configure and build sgroup lib)
560dnl
561dnl only sgroup if explicietely requested
562dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
563dnl  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
564dnl     test -d sgroup && \
565dnl     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
566dnl    enable_sgroup=yes
567dnl    AC_MSG_RESULT(yes)
568dnl    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
569dnl    ac_configure_args="$ac_configure_args --enable-sgroup"
570dnl  else
571dnl    enable_sgroup=no
572dnl    AC_MSG_RESULT(no)
573dnl  fi
574dnl elif  test "$enable_sgroup" = yes; then
575if test "$enable_sgroup" = yes; then
576  if test ! -d sgroup; then
577    AC_MSG_RESULT(no)
578    AC_MSG_ERROR(can not build sgroup without sgroup directory)
579  fi
580  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
581    AC_MSG_RESULT(yes)
582    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
583  else
584    AC_MSG_RESULT(no)
585    AC_MSG_ERROR(Can not build sgroup without MP)
586  fi
587else
588  AC_MSG_RESULT(no)
589fi
590
591BUILD_SUBDIRS="$CONFIG_SUBDIRS"
592
593AC_MSG_CHECKING(whether to configure and build Singular)
594if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
595  if test "$with_Singular" != no && test -d Singular; then
596    enable_Singular=yes
597    AC_MSG_RESULT(yes)
598    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
599    BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"     
600    ac_configure_args="$ac_configure_args --enable-Singular"
601  else
602    enable_Singular=no
603    AC_MSG_RESULT(no)
604  fi
605elif test "$enable_Singular" = yes; then
606  if test -d Singular; then
607    AC_MSG_RESULT(yes)
608    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
609    BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"     
610  else
611    AC_MSG_RESULT(no)
612    AC_MSG_ERROR(can not build Singular without Singular directory)
613  fi
614else
615  AC_MSG_RESULT(no)
616fi
617
618
619# test if IntegerProgramming should be built:
620
621AC_MSG_CHECKING(whether to build IntegerProgramming)
622if test "$enable_IntegerProgramming" != no && test -d "IntegerProgramming"; then
623   BUILD_SUBDIRS="$BUILD_SUBDIRS IntegerProgramming"
624   AC_MSG_RESULT(yes)
625   if test "$enable_IntegerProgramming" != yes; then
626     ac_configure_args="$ac_configure_args --enable-IntegerProgramming"
627   fi
628else
629   AC_MSG_RESULT(no)
630fi
631
632AC_MSG_CHECKING(whether to build Plural)
633if test "$enable_Plural" != no || test "$with_Plural" != no; then
634   AC_MSG_RESULT(yes)
635   if test "$enable_Plural" != yes; then
636     ac_configure_args="$ac_configure_args --enable-Plural"
637   fi
638else
639   AC_MSG_RESULT(no)
640fi
641
642
643AC_MSG_CHECKING(whether to configure and build Texinfo)
644if test "$enable_Texinfo" != no && test -d Texinfo; then
645  AC_MSG_RESULT(yes)
646  enable_texinfo=yes
647  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
648  BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"       
649  TEXI2DVI=${bindir}/texi2dvi
650  TEXI2PDF=${bindir}/texi2pdf
651  MAKEINFO="${bindir}/makeinfo"
652  TEXINDEX=${bindir}/texindex
653  AC_SUBST(TEXI2DVI)
654  AC_SUBST(TEXI2PDF)
655  AC_SUBST(MAKEINFO)
656  AC_SUBST(TEXINDEX)
657  if test "$enable_Texinfo" != yes; then
658    ac_configure_args="$ac_configure_args --enable-Texinfo"
659  fi
660else
661  AC_MSG_RESULT(no)
662  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
663  enable_texinfo=no
664  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
665  AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, ${pwd}/warn_not_found.sh texi2dvi)
666  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
667  AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, ${pwd}/warn_not_found.sh texi2pdf)
668fi 
669
670AC_MSG_CHECKING(whether to configure and build Texi2html)
671if test "$enable_Texi2html" != no && test -d Texi2html; then
672 AC_MSG_RESULT(yes)
673 CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
674 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
675 if test "$enable_Texi2html" != yes; then
676   ac_configure_args="$ac_configure_args --enable-Texi2html"
677 fi
678 TEXI2HTML=${bindir}/texi2html
679 AC_SUBST(TEXI2HTML)
680else
681 AC_MSG_RESULT(no)
682 AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
683fi
684
685if test "${TEXI2HTML+set}" != set; then
686AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
687fi
688if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
689  TEXI2HTML_OPTS="-l2h"
690fi
691AC_SUBST(TEXI2HTML_OPTS)
692
693
694AC_MSG_CHECKING(whether to build doc)
695if test "$enable_doc" != no && test -d doc; then
696 AC_MSG_RESULT(yes)
697 BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
698 if test "$enable_doc" != yes; then
699   enable_doc=yes
700   ac_configure_args="$ac_configure_args --enable-doc"
701 fi
702else
703 enable_doc=no
704 AC_MSG_RESULT(no)
705fi
706
707AC_MSG_CHECKING(whether to build emacs)
708if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
709 AC_MSG_RESULT(yes)
710 BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
711 if test "$enable_emacs" != yes; then
712   ac_configure_args="$ac_configure_args --enable-emacs"
713 fi
714else
715 AC_MSG_RESULT(no)
716fi
717
718dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
719dnl Check whether or not to use various packages
720dnl
721AC_MSG_CHECKING(which apint package to use)
722if test "$with_apint" = gmp; then
723  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
724    AC_MSG_RESULT(gmp)
725  else
726    AC_MSG_RESULT(none)
727    AC_MSG_ERROR(can not use with gmp without finding or building it)
728  fi
729elif test "$with_apint" = smallgmp; then
730  if test "$ac_smallgmp_ok" = yes || test "$enable_smallgmp" = yes; then
731    AC_MSG_RESULT(smallgmp)
732  else
733    AC_MSG_RESULT(none)
734    AC_MSG_ERROR(can not use with smallgmp without finding or building it)
735  fi
736elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
737    AC_MSG_RESULT(gmp)
738    ac_configure_args="$ac_configure_args --with-apint=gmp"
739else
740dnl now we are sure that we have the smallgmp --otherwise enable
741dnl checks had thrown an error
742   AC_MSG_RESULT(smallgmp)
743   ac_configure_args="$ac_configure_args --with-apint=smallgmp"
744fi
745
746AC_MSG_CHECKING(whether to use with MP)
747if test "$with_MP" = yes; then
748  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
749    AC_MSG_RESULT(yes)
750  else
751    AC_MSG_RESULT(none)
752    AC_MSG_ERROR(can not use with MP without finding or building it)
753  fi
754elif test "$with_MP" = no; then
755  AC_MSG_RESULT(no)
756elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
757  AC_MSG_RESULT(yes)
758  ac_configure_args="$ac_configure_args --with-MP"
759else
760  AC_MSG_RESULT(no)
761  ac_configure_args="$ac_configure_args --without-MP"
762fi
763
764AC_MSG_CHECKING(whether to use with factory)
765if test "$with_factory" = yes; then
766  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
767    AC_MSG_RESULT(yes)
768  else
769    AC_MSG_RESULT(none)
770    AC_MSG_ERROR(can not use with factory without finding or building it)
771  fi
772elif test "$with_factory" = no; then
773  AC_MSG_RESULT(no)
774elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
775  AC_MSG_RESULT(yes)
776  ac_configure_args="$ac_configure_args --with-factory"
777else
778  AC_MSG_RESULT(no)
779  ac_configure_args="$ac_configure_args --without-factory"
780fi
781 
782AC_MSG_CHECKING(whether to use with libfac)
783if test "$with_libfac" = yes; then
784  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
785    AC_MSG_RESULT(yes)
786  else
787    AC_MSG_RESULT(none)
788    AC_MSG_ERROR(can not use with libfac without finding or building it)
789  fi
790elif test "$with_libfac" = no; then
791  AC_MSG_RESULT(no)
792elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
793  AC_MSG_RESULT(yes)
794  ac_configure_args="$ac_configure_args --with-libfac"
795else
796  AC_MSG_RESULT(no)
797  ac_configure_args="$ac_configure_args --without-libfac"
798fi
799
800
801
802AC_MSG_CHECKING(whether to use with Singular)
803if test "$with_Singular" != no && test "$with_Singular" != yes; then
804  if test "$enable_Singular" = yes; then
805    with_Singular=yes
806  else
807    with_Singular=no
808  fi
809  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
810fi
811
812if test "$with_Singular" != no; then
813  AC_MSG_RESULT(yes)
814else
815  AC_MSG_RESULT(no)
816fi
817
818
819dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
820dnl Check for known subdirs
821dnl
822SUBDIRS=""
823if test -d omalloc; then
824  SUBDIRS="$SUBDIRS omalloc"
825fi
826if test -d smallgmp; then
827  SUBDIRS="$SUBDIRS smallgmp"
828fi
829if test -d gmp; then
830  SUBDIRS="$SUBDIRS gmp"
831fi
832if test -d MP; then
833  SUBDIRS="$SUBDIRS MP"
834fi
835if test -d ntl; then
836  SUBDIRS="$SUBDIRS ntl"
837fi
838if test -d factory; then
839  SUBDIRS="$SUBDIRS factory"
840fi
841if test -d libfac; then
842  SUBDIRS="$SUBDIRS libfac"
843fi
844if test -d sgroup; then
845  SUBDIRS="$SUBDIRS sgroup"
846fi
847if test -d Singular; then
848  SUBDIRS="$SUBDIRS Singular"
849fi
850if test -d Texinfo; then
851  SUBDIRS="$SUBDIRS Texinfo"
852fi
853if test -d Texi2html; then
854  SUBDIRS="$SUBDIRS Texi2html"
855fi
856if test -d doc; then
857  SUBDIRS="$SUBDIRS doc"
858fi
859if test -d emacs; then
860  SUBDIRS="$SUBDIRS emacs"
861fi
862dnl if test -d rpm; then
863dnl  SUBDIRS="$SUBDIRS rpm"
864dnl fi
865if test -d modules; then
866  SUBDIRS="$SUBDIRS modules"
867fi
868 
869dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
870dnl Enough -- wrap it up
871dnl
872AC_PROG_MAKE_SET
873AC_SUBST(SUBDIRS)
874AC_SUBST(BUILD_SUBDIRS)
875AC_SUBST(CONFIG_SUBDIRS)
876AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
877
878AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.