source: git/configure.in @ 7be8ec

spielwiese
Last change on this file since 7be8ec was b4e3253, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: 3-1 git-svn-id: file:///usr/local/Singular/svn/trunk@10987 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=1
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="Aug 2008"
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
87dnl we do not want to have "-g -O" for CFLAGS
88if test "${CXXFLAGS+set}" != set; then
89  ac_cxxflags_set=no
90  CXXFLAGS="-O"
91fi
92if test "${CFLAGS+set}" != set; then
93  CFLAGS="-O"
94  ac_cflags_set=no
95fi
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",${pwd}/warn_not_found.sh uudecode)
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(MP, IMP_PutGmpInt)
211AC_CHECK_LIB(MPT, MPT_GetTree)
212AC_CHECK_LIB(singcf, atof)
213AC_CHECK_LIB(singfac, atof)
214AC_CHECK_LIB(omalloc, omTestAddr)
215AC_CHECK_LIB(omalloc_ndebug, main)
216
217AC_CHECK_HEADERS(gmp.h MP.h  MPT.h factory.h factor.h omalloc.h)
218
219if test "$ac_cv_lib_gmp_main" = yes && \
220 test "$ac_cv_header_gmp_h" = yes; then
221  ac_gmp_ok=yes
222fi
223
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
231if test "$ac_cv_lib_singcf_atof" = yes && \
232 test "$ac_cv_header_factory_h" = yes; then
233  ac_factory_ok=yes
234fi
235
236if test "$ac_cv_lib_singfac_atof" = yes && \
237 test "$ac_cv_header_factor_h" = yes; then
238  ac_libfac_ok=yes
239fi
240
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
247 
248dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
249dnl Check command line arguments
250dnl
251
252DOC2TEX_EXAMPLE_EXCLUSIONS=""
253AC_SUBST(DOC2TEX_EXAMPLE_EXCLUSIONS)
254
255AC_ARG_WITH(tmpdir, \
256 [ --with-tmpdir=DIR       use DIR as temporary directory])
257AC_ARG_ENABLE(omalloc, \
258 [ --enable-PACKAGE        configure and/or build PACKAGE
259  --disable-PACKAGE       do not configure and/or build PACKAGE
260   where PACKAGE can be:
261     omalloc               omalloc memory managment])
262AC_ARG_ENABLE(gmp, \
263 [    gmp                  Gnu Multiple Precision package])
264AC_ARG_ENABLE(MP, \
265 [    MP                   Multi Protocol library])
266AC_ARG_ENABLE(factory, \
267 [    factory              polynomial factorization library])
268AC_ARG_ENABLE(libfac, \
269 [    libfac               char set and modp poly factorization library])
270AC_ARG_ENABLE(sgroup, \
271 [    sgroup               numerical semigroup computations])
272AC_ARG_ENABLE(Singular, \
273 [    Singular             CAS for Polynomial Computations])
274AC_ARG_ENABLE(IntegerProgramming, \
275 [    IntegerProgramming   IntegerProgramming])
276AC_ARG_ENABLE(Plural, \
277 [    Plural               Plural])
278AC_ARG_ENABLE(Texinfo, \
279 [    Texinfo              Texinfo for info, texi2dvi, makeinfo])
280AC_ARG_ENABLE(Texi2html, \
281 [    Texi2html            Texinfo to HTML converter])
282AC_ARG_ENABLE(doc, \
283 [    doc                  Singular documentation])
284AC_ARG_ENABLE(emacs, \
285 [    emacs                emacs completion files])
286AC_ARG_WITH(MP,\
287 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
288  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
289   where PACKAGE can be:
290     MP                   Multi Protocol library])
291AC_ARG_WITH(factory, \
292 [    factory              polynomial factorization library])
293AC_ARG_WITH(libfac, \
294 [    libfac               char set and modp poly factorization library])
295AC_ARG_WITH(gmp, \
296 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
297                          where PACKAGE can be gmp
298All additional --enable and --with options are passed to subsequent calls
299to configure of the packages to be built. See also configure --help in
300these packages (resp. subdirs). ])
301
302dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
303dnl Check what to use as tmp dir
304dnl
305AC_MSG_CHECKING(which tmp dir to use)
306if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
307  if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
308  then
309    TMP_DIR="${pwd}/tmp"
310  else
311    TMP_DIR=${with_tmpdir}
312  fi
313else
314  TMP_DIR="${pwd}/tmp"
315fi
316AC_MSG_RESULT($TMP_DIR)
317AC_SUBST(TMP_DIR)
318
319dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
320dnl Check whether or not to configure and build various packages
321dnl
322AC_MSG_CHECKING(whether to configure and build omalloc)
323if test "${enable_omalloc+set}" != set; then
324   if test "$ac_cv_omalloc_ok" = yes; then
325     enable_omalloc=no
326   fi
327   enable_omalloc_not_set=yes
328fi
329if test "$enable_omalloc" = no; then
330  if test "$ac_cv_omalloc_ok" != yes; then
331    AC_MSG_ERROR(can not build without omalloc)
332  fi
333  AC_MSG_RESULT(no)
334else
335  if test -d omalloc; then
336    AC_MSG_RESULT(yes)
337    if test "$enable_omalloc_not_set" = yes; then
338      ac_configure_args="$ac_configure_args --enable-omalloc --with-external-config_h='$pwd/Singular/omSingularConfig.h' --with-track-custom"
339    fi
340    CONFIG_SUBDIRS="$CONFIG_SUBDIRS omalloc"
341    BUILD1_SUBDIRS="$BUILD1_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    BUILD1_SUBDIRS="$BUILD1_SUBDIRS gmp"
367    ac_configure_args="$ac_configure_args --enable-gmp"
368    enable_gmp=yes
369#    This we used to need for our patched version of gmp 2.x
370#    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
371  else
372    AC_MSG_RESULT(no)
373    enable_gmp=no
374  fi
375elif test "$enable_gmp" = yes; then
376  if test ! -d gmp; then
377    AC_MSG_RESULT(no)
378    AC_MSG_ERROR(Can not find gmp subdir)
379  else
380    AC_MSG_RESULT(yes)
381    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
382    BUILD1_SUBDIRS="$BUILD1_SUBDIRS gmp"
383#    This we used to need for our patched version of gmp 2.x
384#    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
385  fi
386else
387  AC_MSG_RESULT(no)
388fi
389
390if test "$enable_gmp" = yes; then
391# for gmp-3.0 to work for all ix86 processors, set generic target
392if test "$target" = NONE; then
393case "$ac_cv_singuname" in
394        ix86*)
395        gmp_target=`./config.guess | sed 's/^\w*-/i386-/'`
396        ac_configure_args="$ac_configure_args --target=$gmp_target"
397        ;;
398esac
399fi
400# furthermore, disable building of dynamic libraries, for we want to
401# link against the static ones
402if test "$enable_shared" != no; then
403  ac_configure_args="$ac_configure_args --disable-shared"
404fi
405fi
406
407# Check whether we have gmp
408if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
409  AC_MSG_ERROR(can neither find nor built gmp)
410fi
411
412# Check whether we need to cheat subsequent configures with --enable-gmp
413if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
414  ac_configure_args="$ac_configure_args --enable-gmp"
415fi
416
417#AC_MSG_CHECKING(whether to configure and build MP lib)
418# requires: sizeof(long)==4
419AC_CHECK_SIZEOF(long,4)
420if test "$ac_cv_sizeof_long" != 4; then
421  with_MP=no
422fi
423
424AC_MSG_CHECKING(whether to configure and build MP lib)
425
426if test "$enable_MP" != yes && test "$enable_MP" != no; then
427  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
428     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
429    AC_MSG_RESULT(yes)
430    enable_MP=yes
431    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
432    BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
433    ac_configure_args="$ac_configure_args --enable-MP"
434  else
435    AC_MSG_RESULT(no)
436    enable_MP=no
437  fi
438elif test "$enable_MP" = yes; then
439  if test ! -d MP; then
440    AC_MSG_RESULT(no)
441    AC_MSG_ERROR(can not build MP without MP directory)
442  fi
443  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
444    AC_MSG_RESULT(yes)
445    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
446    BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
447  else
448    AC_MSG_RESULT(no)
449    AC_MSG_ERROR(can not build MP without gmp)
450  fi
451else
452  AC_MSG_RESULT(no)
453fi
454
455# need MP code to be compiled with -fPIC, should not hurt anybody else
456if test "$enable_MP" = yes && test "${with_extra_cflags+set}" != set; then
457ac_configure_args="$ac_configure_args --with-extra_cflags=-fPIC"
458fi
459
460AC_MSG_CHECKING(whether to configure and build NTL lib)
461if test "$enable_NTL" != yes && test "$enable_NTL" != no; then
462  if test "$with_NTL" != no && test "$ac_NTL_ok" != yes && \
463     test -d ntl; then
464    enable_NTL=yes
465    AC_MSG_RESULT(yes)
466    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
467    BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
468    ac_configure_args="$ac_configure_args --enable-NTL"
469    AC_LANG_CPLUSPLUS
470    AC_CHECK_HEADERS(iostream.h iostream)
471    AC_LANG_RESTORE
472  else
473    enable_NTL=no
474    AC_MSG_RESULT(no)
475  fi
476elif test "$enable_NTL" = yes; then
477  if test -d ntl; then
478    AC_MSG_RESULT(yes)
479    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
480    BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
481  else
482    AC_MSG_RESULT(no)
483    AC_MSG_ERROR(can not build NTL without ntl directory)
484  fi
485else
486  AC_MSG_RESULT(no)
487fi
488
489AC_MSG_CHECKING(whether to configure and build factory lib)
490if test "$enable_factory" != yes && test "$enable_factory" != no; then
491  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
492     test -d factory; then
493    enable_factory=yes
494    AC_MSG_RESULT(yes)
495    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
496    BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
497    ac_configure_args="$ac_configure_args --enable-factory"
498  else
499    enable_factory=no
500    AC_MSG_RESULT(no)
501  fi
502elif test "$enable_factory" = yes; then
503  if test -d factory; then
504    AC_MSG_RESULT(yes)
505    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
506    BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
507  else
508    AC_MSG_RESULT(no)
509    AC_MSG_ERROR(can not build factory without factory directory)
510  fi
511else
512  AC_MSG_RESULT(no)
513fi
514
515AC_MSG_CHECKING(whether to configure and build libfac lib)
516if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
517  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
518     test -d libfac && \
519     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
520    enable_libfac=yes
521    AC_MSG_RESULT(yes)
522    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
523    BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
524    ac_configure_args="$ac_configure_args --enable-libfac"
525  else
526    enable_libfac=no
527    AC_MSG_RESULT(no)
528  fi
529elif  test "$enable_libfac" = yes; then
530  if test ! -d libfac; then
531    AC_MSG_RESULT(no)
532    AC_MSG_ERROR(can not build libfac without libfac directory)
533  fi
534  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
535    AC_MSG_RESULT(yes)
536    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
537    BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
538  else
539    AC_MSG_RESULT(no)
540    AC_MSG_ERROR(Can not build libfac without factory)
541  fi
542else
543  AC_MSG_RESULT(no)
544fi
545
546AC_MSG_CHECKING(whether to configure and build sgroup lib)
547dnl
548dnl only sgroup if explicietely requested
549dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
550dnl  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
551dnl     test -d sgroup && \
552dnl     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
553dnl    enable_sgroup=yes
554dnl    AC_MSG_RESULT(yes)
555dnl    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
556dnl    ac_configure_args="$ac_configure_args --enable-sgroup"
557dnl  else
558dnl    enable_sgroup=no
559dnl    AC_MSG_RESULT(no)
560dnl  fi
561dnl elif  test "$enable_sgroup" = yes; then
562if test "$enable_sgroup" = yes; then
563  if test ! -d sgroup; then
564    AC_MSG_RESULT(no)
565    AC_MSG_ERROR(can not build sgroup without sgroup directory)
566  fi
567  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
568    AC_MSG_RESULT(yes)
569    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
570    BUILD1_SUBDIRS="$BUILD1_SUBDIRS sgroup"
571  else
572    AC_MSG_RESULT(no)
573    AC_MSG_ERROR(Can not build sgroup without MP)
574  fi
575else
576  AC_MSG_RESULT(no)
577fi
578
579BUILD_SUBDIRS="$CONFIG_SUBDIRS"
580
581AC_MSG_CHECKING(whether to configure and build Singular)
582if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
583  if test "$with_Singular" != no && test -d Singular; then
584    enable_Singular=yes
585    AC_MSG_RESULT(yes)
586    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
587    BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"     
588    BUILD1_SUBDIRS="$BUILD1_SUBDIRS kernel Singular"   
589    ac_configure_args="$ac_configure_args --enable-Singular"
590  else
591    enable_Singular=no
592    AC_MSG_RESULT(no)
593  fi
594elif test "$enable_Singular" = yes; then
595  if test -d Singular; then
596    AC_MSG_RESULT(yes)
597    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
598    BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"     
599    BUILD1_SUBDIRS="$BUILD1_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   BUILD1_SUBDIRS="$BUILD1_SUBDIRS IntegerProgramming"
615   AC_MSG_RESULT(yes)
616   if test "$enable_IntegerProgramming" != yes; then
617     ac_configure_args="$ac_configure_args --enable-IntegerProgramming"
618   fi
619else
620   AC_MSG_RESULT(no)
621fi
622
623AC_MSG_CHECKING(whether to build Plural)
624if test "$enable_Plural" != no || test "$with_Plural" != no; then
625   AC_MSG_RESULT(yes)
626   if test "$enable_Plural" != yes; then
627     ac_configure_args="$ac_configure_args --enable-Plural"
628   fi
629else
630   AC_MSG_RESULT(no)
631fi
632
633
634AC_MSG_CHECKING(whether to configure and build Texinfo)
635if test "$enable_Texinfo" != no && test -d Texinfo; then
636  AC_MSG_RESULT(yes)
637  enable_texinfo=yes
638  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
639  BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"       
640  TEXI2DVI=${bindir}/texi2dvi
641  TEXI2PDF=${bindir}/texi2pdf
642  MAKEINFO="${bindir}/makeinfo"
643  TEXINDEX=${bindir}/texindex
644  AC_SUBST(TEXI2DVI)
645  AC_SUBST(TEXI2PDF)
646  AC_SUBST(MAKEINFO)
647  AC_SUBST(TEXINDEX)
648  if test "$enable_Texinfo" != yes; then
649    ac_configure_args="$ac_configure_args --enable-Texinfo"
650  fi
651else
652  AC_MSG_RESULT(no)
653  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
654  enable_texinfo=no
655  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
656  AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, ${pwd}/warn_not_found.sh texi2dvi)
657  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
658  AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, ${pwd}/warn_not_found.sh texi2pdf)
659fi 
660
661AC_MSG_CHECKING(whether to configure and build Texi2html)
662if test "$enable_Texi2html" != no && test -d Texi2html; then
663 AC_MSG_RESULT(yes)
664 CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
665 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
666 if test "$enable_Texi2html" != yes; then
667   ac_configure_args="$ac_configure_args --enable-Texi2html"
668 fi
669 TEXI2HTML=${bindir}/texi2html
670 AC_SUBST(TEXI2HTML)
671else
672 AC_MSG_RESULT(no)
673 AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
674fi
675
676if test "${UUDECODE+set}" != set; then
677AC_MSG_WARN(uudecode not found. HTML doc generation will fail)
678fi
679if test "${TEXI2HTML+set}" != set; then
680AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
681fi
682if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
683  TEXI2HTML_OPTS="-l2h"
684fi
685AC_SUBST(TEXI2HTML_OPTS)
686
687
688AC_MSG_CHECKING(whether to build doc)
689if test "$enable_doc" != no && test -d doc; then
690 AC_MSG_RESULT(yes)
691 BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
692 if test "$enable_doc" != yes; then
693   enable_doc=yes
694   ac_configure_args="$ac_configure_args --enable-doc"
695 fi
696else
697 enable_doc=no
698 AC_MSG_RESULT(no)
699fi
700
701AC_MSG_CHECKING(whether to build emacs)
702if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
703 AC_MSG_RESULT(yes)
704 BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
705 if test "$enable_emacs" != yes; then
706   ac_configure_args="$ac_configure_args --enable-emacs"
707 fi
708else
709 AC_MSG_RESULT(no)
710fi
711
712dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
713dnl Check whether or not to use various packages
714dnl
715AC_MSG_CHECKING(which apint package to use)
716if test "$with_apint" = gmp; then
717  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
718    AC_MSG_RESULT(gmp)
719  else
720    AC_MSG_RESULT(none)
721    AC_MSG_ERROR(can not use with gmp without finding or building it)
722  fi
723elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
724    AC_MSG_RESULT(gmp)
725    ac_configure_args="$ac_configure_args --with-apint=gmp"
726else
727  AC_MSG_ERROR(gmp required)
728fi
729
730AC_MSG_CHECKING(whether to use with MP)
731if test "$with_MP" = yes; then
732  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
733    AC_MSG_RESULT(yes)
734  else
735    AC_MSG_RESULT(none)
736    AC_MSG_ERROR(can not use with MP without finding or building it)
737  fi
738elif test "$with_MP" = no; then
739  AC_MSG_RESULT(no)
740elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
741  AC_MSG_RESULT(yes)
742  ac_configure_args="$ac_configure_args --with-MP"
743else
744  AC_MSG_RESULT(no)
745  ac_configure_args="$ac_configure_args --without-MP"
746  DOC2TEX_EXAMPLE_EXCLUSIONS="$DOC2TEX_EXAMPLE_EXCLUSIONS -exclude MP"
747fi
748
749AC_MSG_CHECKING(whether to use with factory)
750if test "$with_factory" = yes; then
751  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
752    AC_MSG_RESULT(yes)
753  else
754    AC_MSG_RESULT(none)
755    AC_MSG_ERROR(can not use with factory without finding or building it)
756  fi
757elif test "$with_factory" = no; then
758  AC_MSG_RESULT(no)
759elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
760  AC_MSG_RESULT(yes)
761  ac_configure_args="$ac_configure_args --with-factory"
762else
763  AC_MSG_RESULT(no)
764  ac_configure_args="$ac_configure_args --without-factory"
765fi
766 
767AC_MSG_CHECKING(whether to use with libfac)
768if test "$with_libfac" = yes; then
769  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
770    AC_MSG_RESULT(yes)
771  else
772    AC_MSG_RESULT(none)
773    AC_MSG_ERROR(can not use with libfac without finding or building it)
774  fi
775elif test "$with_libfac" = no; then
776  AC_MSG_RESULT(no)
777elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
778  AC_MSG_RESULT(yes)
779  ac_configure_args="$ac_configure_args --with-libfac"
780else
781  AC_MSG_RESULT(no)
782  ac_configure_args="$ac_configure_args --without-libfac"
783fi
784
785
786
787AC_MSG_CHECKING(whether to use with Singular)
788if test "$with_Singular" != no && test "$with_Singular" != yes; then
789  if test "$enable_Singular" = yes; then
790    with_Singular=yes
791  else
792    with_Singular=no
793  fi
794  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
795fi
796
797if test "$with_Singular" != no; then
798  AC_MSG_RESULT(yes)
799else
800  AC_MSG_RESULT(no)
801fi
802
803
804dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
805dnl Check for known subdirs
806dnl
807SUBDIRS=""
808if test -d omalloc; then
809  SUBDIRS="$SUBDIRS omalloc"
810fi
811if test -d gmp; then
812  SUBDIRS="$SUBDIRS gmp"
813fi
814if test -d MP; then
815  SUBDIRS="$SUBDIRS MP"
816fi
817if test -d ntl; then
818  SUBDIRS="$SUBDIRS ntl"
819fi
820if test -d factory; then
821  SUBDIRS="$SUBDIRS factory"
822fi
823if test -d libfac; then
824  SUBDIRS="$SUBDIRS libfac"
825fi
826if test -d sgroup; then
827  SUBDIRS="$SUBDIRS sgroup"
828fi
829if test -d kernel; then
830  SUBDIRS="$SUBDIRS kernel"
831fi
832if test -d IntegerProgramming; then
833  SUBDIRS="$SUBDIRS IntegerProgramming"
834fi
835if test -d Singular; then
836  SUBDIRS="$SUBDIRS Singular"
837fi
838if test -d Texinfo; then
839  SUBDIRS="$SUBDIRS Texinfo"
840fi
841if test -d Texi2html; then
842  SUBDIRS="$SUBDIRS Texi2html"
843fi
844if test -d doc; then
845  SUBDIRS="$SUBDIRS doc"
846fi
847if test -d emacs; then
848  SUBDIRS="$SUBDIRS emacs"
849fi
850dnl if test -d rpm; then
851dnl  SUBDIRS="$SUBDIRS rpm"
852dnl fi
853if test -d modules; then
854  SUBDIRS="$SUBDIRS modules"
855fi
856if test -d "modules"; then
857dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/Makefile"
858   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" modules"
859   BUILD_SUBDIRS=$BUILD_SUBDIRS" modules"
860fi
861 
862AC_MSG_CHECKING(whether to use libsvd)
863if test "$with_svd" = yes; then
864  AC_MSG_RESULT(yes)
865dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/Makefile"
866   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" svd"
867   BUILD_SUBDIRS=$BUILD_SUBDIRS" svd"
868else
869  AC_MSG_RESULT(no)
870fi
871
872dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
873dnl Enough -- wrap it up
874dnl
875AC_PROG_MAKE_SET
876AC_SUBST(SUBDIRS)
877AC_SUBST(BUILD_SUBDIRS)
878AC_SUBST(BUILD1_SUBDIRS)
879AC_SUBST(CONFIG_SUBDIRS)
880AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
881
882AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.