source: git/configure.in @ 22e84a

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