source: git/configure.in @ 806c18

spielwiese
Last change on this file since 806c18 was ada9ee, checked in by Hans Schoenemann <hannes@…>, 13 years ago
fix configure git-svn-id: file:///usr/local/Singular/svn/trunk@13565 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 24.7 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=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="Oct 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 gfan lib)
361if test "$enable_gfanlib" = yes; then
362  if test -d gfanlib; then
363    AC_MSG_RESULT(yes)
364    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gfanlib"
365    BUILD1_SUBDIRS="$BUILD1_SUBDIRS gfanlib"
366  else
367    AC_MSG_RESULT(no)
368  fi
369else
370  AC_MSG_RESULT(no)
371fi
372
373if test "$enable_gmp" = yes; then
374# for gmp-3.0 to work for all ix86 processors, set generic target
375if test "$target" = NONE; then
376case "$ac_cv_singuname" in
377        ix86*)
378        gmp_target=`./config.guess | sed 's/^\w*-/i386-/'`
379        ac_configure_args="$ac_configure_args --target=$gmp_target"
380        ;;
381esac
382fi
383# furthermore, disable building of dynamic libraries, for we want to
384# link against the static ones
385if test "$enable_shared" != no; then
386  ac_configure_args="$ac_configure_args --disable-shared"
387fi
388fi
389
390# Check whether we have gmp
391if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
392  AC_MSG_ERROR(can neither find nor built gmp)
393fi
394
395# Check whether we need to cheat subsequent configures with --enable-gmp
396if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
397  ac_configure_args="$ac_configure_args --enable-gmp"
398fi
399
400#AC_MSG_CHECKING(whether to configure and build MP lib)
401# requires: sizeof(long)==4
402AC_CHECK_SIZEOF(long,4)
403if test "$ac_cv_sizeof_long" != 4; then
404  with_MP=no
405fi
406
407AC_MSG_CHECKING(whether to configure and build MP lib)
408
409if test "$enable_MP" != yes && test "$enable_MP" != no; then
410  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
411     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
412    AC_MSG_RESULT(yes)
413    enable_MP=yes
414    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
415    BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
416    ac_configure_args="$ac_configure_args --enable-MP"
417  else
418    AC_MSG_RESULT(no)
419    enable_MP=no
420  fi
421elif test "$enable_MP" = yes; then
422  if test ! -d MP; then
423    AC_MSG_RESULT(no)
424    AC_MSG_ERROR(can not build MP without MP directory)
425  fi
426  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
427    AC_MSG_RESULT(yes)
428    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
429    BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
430  else
431    AC_MSG_RESULT(no)
432    AC_MSG_ERROR(can not build MP without gmp)
433  fi
434else
435  AC_MSG_RESULT(no)
436fi
437
438# need MP code to be compiled with -fPIC, should not hurt anybody else
439if test "$enable_MP" = yes && test "${with_extra_cflags+set}" != set; then
440ac_configure_args="$ac_configure_args --with-extra_cflags=-fPIC"
441fi
442
443AC_MSG_CHECKING(whether to configure and build NTL lib)
444if test "$enable_NTL" != yes && test "$enable_NTL" != no; then
445  if test "$with_NTL" != no && test "$ac_NTL_ok" != yes && \
446     test -d ntl; then
447    enable_NTL=yes
448    AC_MSG_RESULT(yes)
449    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
450    BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
451    ac_configure_args="$ac_configure_args --enable-NTL"
452    AC_LANG_CPLUSPLUS
453    AC_CHECK_HEADERS(iostream.h iostream)
454    AC_LANG_RESTORE
455  else
456    enable_NTL=no
457    AC_MSG_RESULT(no)
458  fi
459elif test "$enable_NTL" = yes; then
460  if test -d ntl; then
461    AC_MSG_RESULT(yes)
462    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
463    BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
464  else
465    AC_MSG_RESULT(no)
466    AC_MSG_ERROR(can not build NTL without ntl directory)
467  fi
468else
469  AC_MSG_RESULT(no)
470fi
471
472AC_MSG_CHECKING(whether to configure and build factory lib)
473if test "$enable_factory" != yes && test "$enable_factory" != no; then
474  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
475     test -d factory; then
476    enable_factory=yes
477    AC_MSG_RESULT(yes)
478    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
479    BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
480    ac_configure_args="$ac_configure_args --enable-factory"
481  else
482    enable_factory=no
483    AC_MSG_RESULT(no)
484  fi
485elif test "$enable_factory" = yes; then
486  if test -d factory; then
487    AC_MSG_RESULT(yes)
488    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
489    BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
490  else
491    AC_MSG_RESULT(no)
492    AC_MSG_ERROR(can not build factory without factory directory)
493  fi
494else
495  AC_MSG_RESULT(no)
496fi
497
498AC_MSG_CHECKING(whether to configure and build libfac lib)
499if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
500  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
501     test -d libfac && \
502     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
503    enable_libfac=yes
504    AC_MSG_RESULT(yes)
505    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
506    BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
507    ac_configure_args="$ac_configure_args --enable-libfac"
508  else
509    enable_libfac=no
510    AC_MSG_RESULT(no)
511  fi
512elif  test "$enable_libfac" = yes; then
513  if test ! -d libfac; then
514    AC_MSG_RESULT(no)
515    AC_MSG_ERROR(can not build libfac without libfac directory)
516  fi
517  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
518    AC_MSG_RESULT(yes)
519    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
520    BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
521  else
522    AC_MSG_RESULT(no)
523    AC_MSG_ERROR(Can not build libfac without factory)
524  fi
525else
526  AC_MSG_RESULT(no)
527fi
528
529AC_MSG_CHECKING(whether to configure and build sgroup lib)
530dnl
531dnl only sgroup if explicietely requested
532dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
533dnl  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
534dnl     test -d sgroup && \
535dnl     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
536dnl    enable_sgroup=yes
537dnl    AC_MSG_RESULT(yes)
538dnl    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
539dnl    ac_configure_args="$ac_configure_args --enable-sgroup"
540dnl  else
541dnl    enable_sgroup=no
542dnl    AC_MSG_RESULT(no)
543dnl  fi
544dnl elif  test "$enable_sgroup" = yes; then
545if test "$enable_sgroup" = yes; then
546  if test ! -d sgroup; then
547    AC_MSG_RESULT(no)
548    AC_MSG_ERROR(can not build sgroup without sgroup directory)
549  fi
550  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
551    AC_MSG_RESULT(yes)
552    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
553    BUILD1_SUBDIRS="$BUILD1_SUBDIRS sgroup"
554  else
555    AC_MSG_RESULT(no)
556    AC_MSG_ERROR(Can not build sgroup without MP)
557  fi
558else
559  AC_MSG_RESULT(no)
560fi
561
562BUILD_SUBDIRS="$CONFIG_SUBDIRS"
563
564AC_MSG_CHECKING(whether to configure and build Singular)
565if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
566  if test "$with_Singular" != no && test -d Singular; then
567    enable_Singular=yes
568    AC_MSG_RESULT(yes)
569    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
570    BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"     
571    BUILD1_SUBDIRS="$BUILD1_SUBDIRS kernel Singular"   
572    ac_configure_args="$ac_configure_args --enable-Singular"
573  else
574    enable_Singular=no
575    AC_MSG_RESULT(no)
576  fi
577elif test "$enable_Singular" = yes; then
578  if test -d Singular; then
579    AC_MSG_RESULT(yes)
580    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
581    BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"     
582    BUILD1_SUBDIRS="$BUILD1_SUBDIRS kernel Singular"   
583  else
584    AC_MSG_RESULT(no)
585    AC_MSG_ERROR(can not build Singular without Singular directory)
586  fi
587else
588  AC_MSG_RESULT(no)
589fi
590
591
592# test if IntegerProgramming should be built:
593
594AC_MSG_CHECKING(whether to build IntegerProgramming)
595if test "$enable_IntegerProgramming" != no && test -d "IntegerProgramming"; then
596   BUILD_SUBDIRS="$BUILD_SUBDIRS IntegerProgramming"
597   BUILD1_SUBDIRS="$BUILD1_SUBDIRS IntegerProgramming"
598   AC_MSG_RESULT(yes)
599   if test "$enable_IntegerProgramming" != yes; then
600     ac_configure_args="$ac_configure_args --enable-IntegerProgramming"
601   fi
602else
603   AC_MSG_RESULT(no)
604fi
605
606AC_MSG_CHECKING(whether to build Plural)
607if test "$enable_Plural" != no || test "$with_Plural" != no; then
608   AC_MSG_RESULT(yes)
609   if test "$enable_Plural" != yes; then
610     ac_configure_args="$ac_configure_args --enable-Plural"
611   fi
612else
613   AC_MSG_RESULT(no)
614fi
615
616
617AC_MSG_CHECKING(whether to configure and build Texinfo)
618if test "$enable_Texinfo" != no && test -d Texinfo; then
619  AC_MSG_RESULT(yes)
620  enable_texinfo=yes
621  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
622  BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"       
623  TEXI2PDF=${bindir}/texi2pdf
624  MAKEINFO="${bindir}/makeinfo"
625  TEXINDEX=${bindir}/texindex
626  AC_SUBST(TEXI2PDF)
627  AC_SUBST(MAKEINFO)
628  AC_SUBST(TEXINDEX)
629  if test "$enable_Texinfo" != yes; then
630    ac_configure_args="$ac_configure_args --enable-Texinfo"
631  fi
632else
633  AC_MSG_RESULT(no)
634  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
635  enable_texinfo=no
636  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
637  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
638  AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, ${pwd}/warn_not_found.sh texi2pdf)
639fi 
640
641AC_MSG_CHECKING(whether to configure and build Texi2html)
642if test "$enable_Texi2html" != no && test -d Texi2html; then
643 AC_MSG_RESULT(yes)
644 CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
645 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
646 if test "$enable_Texi2html" != yes; then
647   ac_configure_args="$ac_configure_args --enable-Texi2html"
648 fi
649 TEXI2HTML=${bindir}/texi2html
650 AC_SUBST(TEXI2HTML)
651else
652 AC_MSG_RESULT(no)
653 AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
654fi
655
656if test "${UUDECODE+set}" != set; then
657AC_MSG_WARN(uudecode not found. HTML doc generation will fail)
658fi
659if test "${TEXI2HTML+set}" != set; then
660AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
661fi
662if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
663  TEXI2HTML_OPTS="-l2h"
664fi
665AC_SUBST(TEXI2HTML_OPTS)
666
667
668AC_MSG_CHECKING(whether to build doc)
669if test "$enable_doc" != no && test -d doc; then
670 AC_MSG_RESULT(yes)
671 BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
672 if test "$enable_doc" != yes; then
673   enable_doc=yes
674   ac_configure_args="$ac_configure_args --enable-doc"
675 fi
676else
677 enable_doc=no
678 AC_MSG_RESULT(no)
679fi
680
681AC_MSG_CHECKING(whether to build emacs)
682if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
683 AC_MSG_RESULT(yes)
684 BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
685 if test "$enable_emacs" != yes; then
686   ac_configure_args="$ac_configure_args --enable-emacs"
687 fi
688else
689 AC_MSG_RESULT(no)
690fi
691
692dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
693dnl Check whether or not to use various packages
694dnl
695AC_MSG_CHECKING(which apint package to use)
696if test "$with_apint" = gmp; then
697  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
698    AC_MSG_RESULT(gmp)
699  else
700    AC_MSG_RESULT(none)
701    AC_MSG_ERROR(can not use with gmp without finding or building it)
702  fi
703elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
704    AC_MSG_RESULT(gmp)
705    ac_configure_args="$ac_configure_args --with-apint=gmp"
706else
707  AC_MSG_ERROR(gmp required)
708fi
709
710AC_MSG_CHECKING(whether to use with MP)
711if test "$with_MP" = yes; then
712  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
713    AC_MSG_RESULT(yes)
714  else
715    AC_MSG_RESULT(none)
716    AC_MSG_ERROR(can not use with MP without finding or building it)
717  fi
718elif test "$with_MP" = no; then
719  AC_MSG_RESULT(no)
720elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
721  AC_MSG_RESULT(yes)
722  ac_configure_args="$ac_configure_args --with-MP"
723else
724  AC_MSG_RESULT(no)
725  ac_configure_args="$ac_configure_args --without-MP"
726  DOC2TEX_EXAMPLE_EXCLUSIONS="$DOC2TEX_EXAMPLE_EXCLUSIONS -exclude MP"
727fi
728
729AC_MSG_CHECKING(whether to use with factory)
730if test "$with_factory" = yes; then
731  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
732    AC_MSG_RESULT(yes)
733  else
734    AC_MSG_RESULT(none)
735    AC_MSG_ERROR(can not use with factory without finding or building it)
736  fi
737elif test "$with_factory" = no; then
738  AC_MSG_RESULT(no)
739elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
740  AC_MSG_RESULT(yes)
741  ac_configure_args="$ac_configure_args --with-factory"
742else
743  AC_MSG_RESULT(no)
744  ac_configure_args="$ac_configure_args --without-factory"
745fi
746 
747AC_MSG_CHECKING(whether to use with libfac)
748if test "$with_libfac" = yes; then
749  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
750    AC_MSG_RESULT(yes)
751  else
752    AC_MSG_RESULT(none)
753    AC_MSG_ERROR(can not use with libfac without finding or building it)
754  fi
755elif test "$with_libfac" = no; then
756  AC_MSG_RESULT(no)
757elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
758  AC_MSG_RESULT(yes)
759  ac_configure_args="$ac_configure_args --with-libfac"
760else
761  AC_MSG_RESULT(no)
762  ac_configure_args="$ac_configure_args --without-libfac"
763fi
764
765
766
767AC_MSG_CHECKING(whether to use with Singular)
768if test "$with_Singular" != no && test "$with_Singular" != yes; then
769  if test "$enable_Singular" = yes; then
770    with_Singular=yes
771  else
772    with_Singular=no
773  fi
774  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
775fi
776
777if test "$with_Singular" != no; then
778  AC_MSG_RESULT(yes)
779else
780  AC_MSG_RESULT(no)
781fi
782
783
784dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
785dnl Check for known subdirs
786dnl
787SUBDIRS=""
788if test -d omalloc; then
789  SUBDIRS="$SUBDIRS omalloc"
790fi
791if test -d gmp; then
792  SUBDIRS="$SUBDIRS gmp"
793fi
794if test -d MP; then
795  SUBDIRS="$SUBDIRS MP"
796fi
797if test -d ntl; then
798  SUBDIRS="$SUBDIRS ntl"
799fi
800if test -d factory; then
801  SUBDIRS="$SUBDIRS factory"
802fi
803if test -d libfac; then
804  SUBDIRS="$SUBDIRS libfac"
805fi
806if test -d sgroup; then
807  SUBDIRS="$SUBDIRS sgroup"
808fi
809if test -d kernel; then
810  SUBDIRS="$SUBDIRS kernel"
811fi
812if test -d IntegerProgramming; then
813  SUBDIRS="$SUBDIRS IntegerProgramming"
814fi
815if test -d Singular; then
816  SUBDIRS="$SUBDIRS Singular"
817fi
818if test -d Texinfo; then
819  SUBDIRS="$SUBDIRS Texinfo"
820fi
821if test -d Texi2html; then
822  SUBDIRS="$SUBDIRS Texi2html"
823fi
824if test -d doc; then
825  SUBDIRS="$SUBDIRS doc"
826fi
827if test -d emacs; then
828  SUBDIRS="$SUBDIRS emacs"
829fi
830dnl if test -d rpm; then
831dnl  SUBDIRS="$SUBDIRS rpm"
832dnl fi
833if test -d dyn_modules; then
834  SUBDIRS="$SUBDIRS dyn_modules"
835fi
836if test -d "dyn_modules"; then
837dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" dyn_modules/Makefile"
838   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" dyn_modules"
839   BUILD_SUBDIRS=$BUILD_SUBDIRS" dyn_modules"
840fi
841 
842AC_MSG_CHECKING(whether to use libsvd)
843if test "$with_svd" = yes; then
844  AC_MSG_RESULT(yes)
845dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" dyn_modules/Makefile"
846   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" svd"
847   BUILD_SUBDIRS=$BUILD_SUBDIRS" svd"
848else
849  AC_MSG_RESULT(no)
850fi
851
852dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
853dnl Enough -- wrap it up
854dnl
855AC_PROG_MAKE_SET
856AC_SUBST(SUBDIRS)
857AC_SUBST(BUILD_SUBDIRS)
858AC_SUBST(BUILD1_SUBDIRS)
859AC_SUBST(CONFIG_SUBDIRS)
860AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
861
862AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.