source: git/configure.in @ 6b86672

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