source: git/configure.in @ 9cef8c

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