source: git/configure.in @ 99bdcf

spielwiese
Last change on this file since 99bdcf was 3c473c, checked in by Kai Krüger <krueger@…>, 14 years ago
rename directory modules to dyn_modules anticipating "modules" directory for cmake. git-svn-id: file:///usr/local/Singular/svn/trunk@13033 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(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=1
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="Feb 2010"
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  TEXI2PDF=${bindir}/texi2pdf
641  MAKEINFO="${bindir}/makeinfo"
642  TEXINDEX=${bindir}/texindex
643  AC_SUBST(TEXI2PDF)
644  AC_SUBST(MAKEINFO)
645  AC_SUBST(TEXINDEX)
646  if test "$enable_Texinfo" != yes; then
647    ac_configure_args="$ac_configure_args --enable-Texinfo"
648  fi
649else
650  AC_MSG_RESULT(no)
651  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
652  enable_texinfo=no
653  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
654  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
655  AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, ${pwd}/warn_not_found.sh texi2pdf)
656fi 
657
658AC_MSG_CHECKING(whether to configure and build Texi2html)
659if test "$enable_Texi2html" != no && test -d Texi2html; then
660 AC_MSG_RESULT(yes)
661 CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
662 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
663 if test "$enable_Texi2html" != yes; then
664   ac_configure_args="$ac_configure_args --enable-Texi2html"
665 fi
666 TEXI2HTML=${bindir}/texi2html
667 AC_SUBST(TEXI2HTML)
668else
669 AC_MSG_RESULT(no)
670 AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
671fi
672
673if test "${UUDECODE+set}" != set; then
674AC_MSG_WARN(uudecode not found. HTML doc generation will fail)
675fi
676if test "${TEXI2HTML+set}" != set; then
677AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
678fi
679if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
680  TEXI2HTML_OPTS="-l2h"
681fi
682AC_SUBST(TEXI2HTML_OPTS)
683
684
685AC_MSG_CHECKING(whether to build doc)
686if test "$enable_doc" != no && test -d doc; then
687 AC_MSG_RESULT(yes)
688 BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
689 if test "$enable_doc" != yes; then
690   enable_doc=yes
691   ac_configure_args="$ac_configure_args --enable-doc"
692 fi
693else
694 enable_doc=no
695 AC_MSG_RESULT(no)
696fi
697
698AC_MSG_CHECKING(whether to build emacs)
699if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
700 AC_MSG_RESULT(yes)
701 BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
702 if test "$enable_emacs" != yes; then
703   ac_configure_args="$ac_configure_args --enable-emacs"
704 fi
705else
706 AC_MSG_RESULT(no)
707fi
708
709dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
710dnl Check whether or not to use various packages
711dnl
712AC_MSG_CHECKING(which apint package to use)
713if test "$with_apint" = gmp; then
714  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
715    AC_MSG_RESULT(gmp)
716  else
717    AC_MSG_RESULT(none)
718    AC_MSG_ERROR(can not use with gmp without finding or building it)
719  fi
720elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
721    AC_MSG_RESULT(gmp)
722    ac_configure_args="$ac_configure_args --with-apint=gmp"
723else
724  AC_MSG_ERROR(gmp required)
725fi
726
727AC_MSG_CHECKING(whether to use with MP)
728if test "$with_MP" = yes; then
729  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
730    AC_MSG_RESULT(yes)
731  else
732    AC_MSG_RESULT(none)
733    AC_MSG_ERROR(can not use with MP without finding or building it)
734  fi
735elif test "$with_MP" = no; then
736  AC_MSG_RESULT(no)
737elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
738  AC_MSG_RESULT(yes)
739  ac_configure_args="$ac_configure_args --with-MP"
740else
741  AC_MSG_RESULT(no)
742  ac_configure_args="$ac_configure_args --without-MP"
743  DOC2TEX_EXAMPLE_EXCLUSIONS="$DOC2TEX_EXAMPLE_EXCLUSIONS -exclude MP"
744fi
745
746AC_MSG_CHECKING(whether to use with factory)
747if test "$with_factory" = yes; then
748  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
749    AC_MSG_RESULT(yes)
750  else
751    AC_MSG_RESULT(none)
752    AC_MSG_ERROR(can not use with factory without finding or building it)
753  fi
754elif test "$with_factory" = no; then
755  AC_MSG_RESULT(no)
756elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
757  AC_MSG_RESULT(yes)
758  ac_configure_args="$ac_configure_args --with-factory"
759else
760  AC_MSG_RESULT(no)
761  ac_configure_args="$ac_configure_args --without-factory"
762fi
763 
764AC_MSG_CHECKING(whether to use with libfac)
765if test "$with_libfac" = yes; then
766  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
767    AC_MSG_RESULT(yes)
768  else
769    AC_MSG_RESULT(none)
770    AC_MSG_ERROR(can not use with libfac without finding or building it)
771  fi
772elif test "$with_libfac" = no; then
773  AC_MSG_RESULT(no)
774elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
775  AC_MSG_RESULT(yes)
776  ac_configure_args="$ac_configure_args --with-libfac"
777else
778  AC_MSG_RESULT(no)
779  ac_configure_args="$ac_configure_args --without-libfac"
780fi
781
782
783
784AC_MSG_CHECKING(whether to use with Singular)
785if test "$with_Singular" != no && test "$with_Singular" != yes; then
786  if test "$enable_Singular" = yes; then
787    with_Singular=yes
788  else
789    with_Singular=no
790  fi
791  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
792fi
793
794if test "$with_Singular" != no; then
795  AC_MSG_RESULT(yes)
796else
797  AC_MSG_RESULT(no)
798fi
799
800
801dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
802dnl Check for known subdirs
803dnl
804SUBDIRS=""
805if test -d omalloc; then
806  SUBDIRS="$SUBDIRS omalloc"
807fi
808if test -d gmp; then
809  SUBDIRS="$SUBDIRS gmp"
810fi
811if test -d MP; then
812  SUBDIRS="$SUBDIRS MP"
813fi
814if test -d ntl; then
815  SUBDIRS="$SUBDIRS ntl"
816fi
817if test -d factory; then
818  SUBDIRS="$SUBDIRS factory"
819fi
820if test -d libfac; then
821  SUBDIRS="$SUBDIRS libfac"
822fi
823if test -d sgroup; then
824  SUBDIRS="$SUBDIRS sgroup"
825fi
826if test -d kernel; then
827  SUBDIRS="$SUBDIRS kernel"
828fi
829if test -d IntegerProgramming; then
830  SUBDIRS="$SUBDIRS IntegerProgramming"
831fi
832if test -d Singular; then
833  SUBDIRS="$SUBDIRS Singular"
834fi
835if test -d Texinfo; then
836  SUBDIRS="$SUBDIRS Texinfo"
837fi
838if test -d Texi2html; then
839  SUBDIRS="$SUBDIRS Texi2html"
840fi
841if test -d doc; then
842  SUBDIRS="$SUBDIRS doc"
843fi
844if test -d emacs; then
845  SUBDIRS="$SUBDIRS emacs"
846fi
847dnl if test -d rpm; then
848dnl  SUBDIRS="$SUBDIRS rpm"
849dnl fi
850if test -d dyn_modules; then
851  SUBDIRS="$SUBDIRS dyn_modules"
852fi
853if test -d "dyn_modules"; then
854dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" dyn_modules/Makefile"
855   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" dyn_modules"
856   BUILD_SUBDIRS=$BUILD_SUBDIRS" dyn_modules"
857fi
858 
859AC_MSG_CHECKING(whether to use libsvd)
860if test "$with_svd" = yes; then
861  AC_MSG_RESULT(yes)
862dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" dyn_modules/Makefile"
863   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" svd"
864   BUILD_SUBDIRS=$BUILD_SUBDIRS" svd"
865else
866  AC_MSG_RESULT(no)
867fi
868
869dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
870dnl Enough -- wrap it up
871dnl
872AC_PROG_MAKE_SET
873AC_SUBST(SUBDIRS)
874AC_SUBST(BUILD_SUBDIRS)
875AC_SUBST(BUILD1_SUBDIRS)
876AC_SUBST(CONFIG_SUBDIRS)
877AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
878
879AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.