source: git/configure.in @ f3a8c2e

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