source: git/configure.in @ 585bbcb

spielwiese
Last change on this file since 585bbcb was e02739, checked in by Hans Schönemann <hannes@…>, 18 years ago
*hannes: 3-0-1 git-svn-id: file:///usr/local/Singular/svn/trunk@8760 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 24.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=0
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="October 2005"
19SINGULAR_ROOT_DIR=$pwd
20
21export SINGULAR_MINOR_VERSION
22export SINGULAR_MAJOR_VERSION
23export SINGULAR_SUB_VERSION
24export SINGULAR_VERSION
25export SINGULAR_RPM_VERSION
26export VERSION_DATE
27export SINGULAR_ROOT_DIR
28
29dnl substitue them into the Makefiles
30AC_SUBST(SINGULAR_VERSION)
31AC_SUBST(VERSION_DATE)
32AC_SUBST(SINGULAR_SHORT_VERSION)
33AC_SUBST(SINGULAR_RPM_VERSION)
34AC_SUBST(SINGULAR_ROOT_DIR)
35
36
37dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
38dnl Makefiles to output
39dnl
40# determine Makefiles to output
41OUTPUT_MAKEFILES="Makefile"
42if test -d "doc"; then
43   OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES doc/Makefile doc/version.texi doc/uname.texi"
44fi
45if test -d "emacs"; then
46   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" emacs/Makefile"
47fi
48if test -d "IntegerProgramming"; then
49   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" IntegerProgramming/Makefile"
50fi
51if test -d "Plural"; then
52   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" Plural/Makefile"
53fi
54if test -d "InstallShield"; then
55   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" InstallShield/Makefile InstallShield/Etc/Makefile InstallShield/Cygwin/Makefile InstallShield/Singular/Makefile InstallShield/Xemacs/Makefile"
56fi
57
58
59dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
60dnl determine singuname
61dnl
62AC_MSG_CHECKING(uname for singular)
63AC_CACHE_VAL(ac_cv_singuname,
64ac_cv_singuname="unknown"
65if test -r "singuname.sh"; then
66  if (/bin/sh singuname.sh >/dev/null 2>&1) then
67    ac_cv_singuname=`/bin/sh singuname.sh`
68  fi
69fi
70)
71AC_MSG_RESULT($ac_cv_singuname)
72if test "$ac_cv_singuname" = unknown; then
73  AC_MSG_ERROR(Unknown architecture: Check singuname.sh)
74else
75  SINGUNAME=$ac_cv_singuname
76  AC_SUBST(SINGUNAME)
77fi
78
79SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
80AC_SUBST(SING_UNAME)
81
82
83dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
84dnl compiler stuff
85dnl is needed to check for libs and headers, later on
86dnl
87AC_PROG_CC
88AC_PROG_CPP
89AC_PROG_INSTALL
90AC_AIX
91AC_PROG_CXX
92
93SING_CC=${CC}; export SING_CC
94SING_CXX=${CXX}; export SING_CXX
95
96# check whether the compiler accepts -pipe
97AC_MSG_CHECKING(whether compiler accepts -pipe)
98temp_cflags=${CFLAGS}
99CFLAGS="${CFLAGS} -pipe"
100AC_CACHE_VAL(ac_cv_cxx_have_pipe,
101AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no)
102)
103AC_MSG_RESULT(${ac_cv_cxx_have_pipe})
104CFLAGS=${temp_cflags}
105if test "${ac_cv_cxx_have_pipe}" != yes; then
106  PIPE=
107else
108  PIPE="-pipe"
109fi
110AC_SUBST(PIPE)
111
112AC_CHECK_PROGS(PERL, perl5 perl)
113AC_CHECK_PROGS(UUDECODE, uudecode "uudeview -i")
114AC_CHECK_PROGS(GUNZIP, gunzip,  ${pwd}/warn_not_found.sh gunzip)
115# don't use GZIP this breaks configure
116AC_CHECK_PROGS(MYGZIP, gzip, ${pwd}/warn_not_found.sh gzip)
117AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
118AC_PROG_LN_S
119
120if test -r "${pwd}/mkinstalldirs"; then
121  MKINSTALLDIRS=${pwd}/mkinstalldirs
122  AC_SUBST(MKINSTALLDIRS)
123else
124  AC_MSG_ERROR(mkinstalldirs not foind in ${pwd})
125fi
126
127dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
128dnl Set exec_prefix, bindir, libdir, includedir to some sensible values
129dnl
130# expand prefix and pass it to subsequent configures
131if test "x$prefix" = xNONE; then
132  prefix=${ac_default_prefix}
133  ac_configure_args="$ac_configure_args --prefix=${prefix}"
134fi
135
136# expand exec_prefix
137if test "x$exec_prefix" = xNONE; then
138 exec_prefix=${prefix}/${ac_cv_singuname}
139 ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}"
140fi
141
142# expand bindir
143if test "x$bindir" = 'x${exec_prefix}/bin'; then
144  bindir="${exec_prefix}"
145  ac_configure_args="$ac_configure_args --bindir=${bindir}"
146fi
147
148# expand libdir
149if test "x$libdir" = 'x${exec_prefix}/lib'; then
150  libdir="${exec_prefix}/lib"
151  ac_configure_args="$ac_configure_args --libdir=${libdir}"
152fi
153
154# expand includedir
155if test "x$includedir" = 'x${prefix}/include'; then
156  includedir="${exec_prefix}/include"
157  ac_configure_args="$ac_configure_args --includedir=${includedir}"
158fi
159
160# construct name of installed Singular executable
161SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}
162export SINGULAR
163AC_SUBST(SINGULAR)
164
165dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
166dnl Check for various libraries and headers
167dnl
168dnl After this part, the variables 'ac_<package>_ok' is 'yes'
169dnl if '<package>' is already existent on the system, otherwise
170dnl undefined.
171dnl
172
173# add -I to CPPFLAGS and -L to LDFLAGS, just to be sure
174LDFLAGS="-L${libdir} ${LDFLAGS}"
175CPPFLAGS="-I${includedir} ${CPPFLAGS}"
176
177# check for AIX
178AC_MSG_CHECKING(whether _AIX is defined)
179AC_CACHE_VAL(ac_cv_is_aix,
180AC_EGREP_CPP(yes,
181[#ifdef _AIX
182    yes
183#endif
184], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
185if test "$ac_cv_is_aix" = yes; then
186  AC_MSG_RESULT(yes)
187else
188  AC_MSG_RESULT(no)
189fi
190
191AC_CHECK_LIB(m, atof)
192AC_CHECK_LIB(bsd, socket)
193AC_CHECK_LIB(socket, listen)
194AC_CHECK_LIB(nsl, gethostbyname)
195AC_CHECK_LIB(gmp, main)
196AC_CHECK_LIB(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
403AC_MSG_CHECKING(whether to configure and build MP lib)
404if test "$enable_MP" != yes && test "$enable_MP" != no; then
405  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
406     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
407    AC_MSG_RESULT(yes)
408    enable_MP=yes
409    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
410    BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
411    ac_configure_args="$ac_configure_args --enable-MP"
412  else
413    AC_MSG_RESULT(no)
414    enable_MP=no
415  fi
416elif test "$enable_MP" = yes; then
417  if test ! -d MP; then
418    AC_MSG_RESULT(no)
419    AC_MSG_ERROR(can not build MP without MP directory)
420  fi
421  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
422    AC_MSG_RESULT(yes)
423    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
424    BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
425  else
426    AC_MSG_RESULT(no)
427    AC_MSG_ERROR(can not build MP without gmp)
428  fi
429else
430  AC_MSG_RESULT(no)
431fi
432
433# need MP code to be compiled with -fPIC, should not hurt anybody else
434if test "$enable_MP" = yes && test "${with_extra_cflags+set}" != set; then
435ac_configure_args="$ac_configure_args --with-extra_cflags=-fPIC"
436fi
437
438AC_MSG_CHECKING(whether to configure and build NTL lib)
439if test "$enable_NTL" != yes && test "$enable_NTL" != no; then
440  if test "$with_NTL" != no && test "$ac_NTL_ok" != yes && \
441     test -d ntl; then
442    enable_NTL=yes
443    AC_MSG_RESULT(yes)
444    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
445    BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
446    ac_configure_args="$ac_configure_args --enable-NTL"
447  else
448    enable_NTL=no
449    AC_MSG_RESULT(no)
450  fi
451elif test "$enable_NTL" = yes; then
452  if test -d ntl; then
453    AC_MSG_RESULT(yes)
454    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
455    BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
456  else
457    AC_MSG_RESULT(no)
458    AC_MSG_ERROR(can not build NTL without ntl directory)
459  fi
460else
461  AC_MSG_RESULT(no)
462fi
463
464AC_MSG_CHECKING(whether to configure and build factory lib)
465if test "$enable_factory" != yes && test "$enable_factory" != no; then
466  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
467     test -d factory; then
468    enable_factory=yes
469    AC_MSG_RESULT(yes)
470    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
471    BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
472    ac_configure_args="$ac_configure_args --enable-factory"
473  else
474    enable_factory=no
475    AC_MSG_RESULT(no)
476  fi
477elif test "$enable_factory" = yes; then
478  if test -d factory; then
479    AC_MSG_RESULT(yes)
480    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
481    BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
482  else
483    AC_MSG_RESULT(no)
484    AC_MSG_ERROR(can not build factory without factory directory)
485  fi
486else
487  AC_MSG_RESULT(no)
488fi
489
490AC_MSG_CHECKING(whether to configure and build libfac lib)
491if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
492  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
493     test -d libfac && \
494     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
495    enable_libfac=yes
496    AC_MSG_RESULT(yes)
497    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
498    BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
499    ac_configure_args="$ac_configure_args --enable-libfac"
500  else
501    enable_libfac=no
502    AC_MSG_RESULT(no)
503  fi
504elif  test "$enable_libfac" = yes; then
505  if test ! -d libfac; then
506    AC_MSG_RESULT(no)
507    AC_MSG_ERROR(can not build libfac without libfac directory)
508  fi
509  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
510    AC_MSG_RESULT(yes)
511    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
512    BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
513  else
514    AC_MSG_RESULT(no)
515    AC_MSG_ERROR(Can not build libfac without factory)
516  fi
517else
518  AC_MSG_RESULT(no)
519fi
520
521AC_MSG_CHECKING(whether to configure and build sgroup lib)
522dnl
523dnl only sgroup if explicietely requested
524dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
525dnl  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
526dnl     test -d sgroup && \
527dnl     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
528dnl    enable_sgroup=yes
529dnl    AC_MSG_RESULT(yes)
530dnl    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
531dnl    ac_configure_args="$ac_configure_args --enable-sgroup"
532dnl  else
533dnl    enable_sgroup=no
534dnl    AC_MSG_RESULT(no)
535dnl  fi
536dnl elif  test "$enable_sgroup" = yes; then
537if test "$enable_sgroup" = yes; then
538  if test ! -d sgroup; then
539    AC_MSG_RESULT(no)
540    AC_MSG_ERROR(can not build sgroup without sgroup directory)
541  fi
542  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
543    AC_MSG_RESULT(yes)
544    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
545    BUILD1_SUBDIRS="$BUILD1_SUBDIRS sgroup"
546  else
547    AC_MSG_RESULT(no)
548    AC_MSG_ERROR(Can not build sgroup without MP)
549  fi
550else
551  AC_MSG_RESULT(no)
552fi
553
554BUILD_SUBDIRS="$CONFIG_SUBDIRS"
555
556AC_MSG_CHECKING(whether to configure and build Singular)
557if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
558  if test "$with_Singular" != no && test -d Singular; then
559    enable_Singular=yes
560    AC_MSG_RESULT(yes)
561    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
562    BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"     
563    BUILD1_SUBDIRS="$BUILD1_SUBDIRS kernel Singular"   
564    ac_configure_args="$ac_configure_args --enable-Singular"
565  else
566    enable_Singular=no
567    AC_MSG_RESULT(no)
568  fi
569elif test "$enable_Singular" = yes; then
570  if test -d Singular; then
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  else
576    AC_MSG_RESULT(no)
577    AC_MSG_ERROR(can not build Singular without Singular directory)
578  fi
579else
580  AC_MSG_RESULT(no)
581fi
582
583
584# test if IntegerProgramming should be built:
585
586AC_MSG_CHECKING(whether to build IntegerProgramming)
587if test "$enable_IntegerProgramming" != no && test -d "IntegerProgramming"; then
588   BUILD_SUBDIRS="$BUILD_SUBDIRS IntegerProgramming"
589   BUILD1_SUBDIRS="$BUILD1_SUBDIRS IntegerProgramming"
590   AC_MSG_RESULT(yes)
591   if test "$enable_IntegerProgramming" != yes; then
592     ac_configure_args="$ac_configure_args --enable-IntegerProgramming"
593   fi
594else
595   AC_MSG_RESULT(no)
596fi
597
598AC_MSG_CHECKING(whether to build Plural)
599if test "$enable_Plural" != no || test "$with_Plural" != no; then
600   AC_MSG_RESULT(yes)
601   if test "$enable_Plural" != yes; then
602     ac_configure_args="$ac_configure_args --enable-Plural"
603   fi
604else
605   AC_MSG_RESULT(no)
606fi
607
608
609AC_MSG_CHECKING(whether to configure and build Texinfo)
610if test "$enable_Texinfo" != no && test -d Texinfo; then
611  AC_MSG_RESULT(yes)
612  enable_texinfo=yes
613  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
614  BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"       
615  TEXI2DVI=${bindir}/texi2dvi
616  TEXI2PDF=${bindir}/texi2pdf
617  MAKEINFO="${bindir}/makeinfo"
618  TEXINDEX=${bindir}/texindex
619  AC_SUBST(TEXI2DVI)
620  AC_SUBST(TEXI2PDF)
621  AC_SUBST(MAKEINFO)
622  AC_SUBST(TEXINDEX)
623  if test "$enable_Texinfo" != yes; then
624    ac_configure_args="$ac_configure_args --enable-Texinfo"
625  fi
626else
627  AC_MSG_RESULT(no)
628  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
629  enable_texinfo=no
630  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
631  AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, ${pwd}/warn_not_found.sh texi2dvi)
632  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
633  AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, ${pwd}/warn_not_found.sh texi2pdf)
634fi 
635
636AC_MSG_CHECKING(whether to configure and build Texi2html)
637if test "$enable_Texi2html" != no && test -d Texi2html; then
638 AC_MSG_RESULT(yes)
639 CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
640 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
641 if test "$enable_Texi2html" != yes; then
642   ac_configure_args="$ac_configure_args --enable-Texi2html"
643 fi
644 TEXI2HTML=${bindir}/texi2html
645 AC_SUBST(TEXI2HTML)
646else
647 AC_MSG_RESULT(no)
648 AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
649fi
650
651if test "${TEXI2HTML+set}" != set; then
652AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
653fi
654if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
655  TEXI2HTML_OPTS="-l2h"
656fi
657AC_SUBST(TEXI2HTML_OPTS)
658
659
660AC_MSG_CHECKING(whether to build doc)
661if test "$enable_doc" != no && test -d doc; then
662 AC_MSG_RESULT(yes)
663 BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
664 if test "$enable_doc" != yes; then
665   enable_doc=yes
666   ac_configure_args="$ac_configure_args --enable-doc"
667 fi
668else
669 enable_doc=no
670 AC_MSG_RESULT(no)
671fi
672
673AC_MSG_CHECKING(whether to build emacs)
674if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
675 AC_MSG_RESULT(yes)
676 BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
677 if test "$enable_emacs" != yes; then
678   ac_configure_args="$ac_configure_args --enable-emacs"
679 fi
680else
681 AC_MSG_RESULT(no)
682fi
683
684dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
685dnl Check whether or not to use various packages
686dnl
687AC_MSG_CHECKING(which apint package to use)
688if test "$with_apint" = gmp; then
689  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
690    AC_MSG_RESULT(gmp)
691  else
692    AC_MSG_RESULT(none)
693    AC_MSG_ERROR(can not use with gmp without finding or building it)
694  fi
695elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
696    AC_MSG_RESULT(gmp)
697    ac_configure_args="$ac_configure_args --with-apint=gmp"
698else
699  AC_MSG_ERROR(gmp required)
700fi
701
702AC_MSG_CHECKING(whether to use with MP)
703if test "$with_MP" = yes; then
704  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
705    AC_MSG_RESULT(yes)
706  else
707    AC_MSG_RESULT(none)
708    AC_MSG_ERROR(can not use with MP without finding or building it)
709  fi
710elif test "$with_MP" = no; then
711  AC_MSG_RESULT(no)
712elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
713  AC_MSG_RESULT(yes)
714  ac_configure_args="$ac_configure_args --with-MP"
715else
716  AC_MSG_RESULT(no)
717  ac_configure_args="$ac_configure_args --without-MP"
718  DOC2TEX_EXAMPLE_EXCLUSIONS="$DOC2TEX_EXAMPLE_EXCLUSIONS -exclude MP"
719fi
720
721AC_MSG_CHECKING(whether to use with factory)
722if test "$with_factory" = yes; then
723  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
724    AC_MSG_RESULT(yes)
725  else
726    AC_MSG_RESULT(none)
727    AC_MSG_ERROR(can not use with factory without finding or building it)
728  fi
729elif test "$with_factory" = no; then
730  AC_MSG_RESULT(no)
731elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
732  AC_MSG_RESULT(yes)
733  ac_configure_args="$ac_configure_args --with-factory"
734else
735  AC_MSG_RESULT(no)
736  ac_configure_args="$ac_configure_args --without-factory"
737fi
738 
739AC_MSG_CHECKING(whether to use with libfac)
740if test "$with_libfac" = yes; then
741  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
742    AC_MSG_RESULT(yes)
743  else
744    AC_MSG_RESULT(none)
745    AC_MSG_ERROR(can not use with libfac without finding or building it)
746  fi
747elif test "$with_libfac" = no; then
748  AC_MSG_RESULT(no)
749elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
750  AC_MSG_RESULT(yes)
751  ac_configure_args="$ac_configure_args --with-libfac"
752else
753  AC_MSG_RESULT(no)
754  ac_configure_args="$ac_configure_args --without-libfac"
755fi
756
757
758
759AC_MSG_CHECKING(whether to use with Singular)
760if test "$with_Singular" != no && test "$with_Singular" != yes; then
761  if test "$enable_Singular" = yes; then
762    with_Singular=yes
763  else
764    with_Singular=no
765  fi
766  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
767fi
768
769if test "$with_Singular" != no; then
770  AC_MSG_RESULT(yes)
771else
772  AC_MSG_RESULT(no)
773fi
774
775
776dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
777dnl Check for known subdirs
778dnl
779SUBDIRS=""
780if test -d omalloc; then
781  SUBDIRS="$SUBDIRS omalloc"
782fi
783if test -d gmp; then
784  SUBDIRS="$SUBDIRS gmp"
785fi
786if test -d MP; then
787  SUBDIRS="$SUBDIRS MP"
788fi
789if test -d ntl; then
790  SUBDIRS="$SUBDIRS ntl"
791fi
792if test -d factory; then
793  SUBDIRS="$SUBDIRS factory"
794fi
795if test -d libfac; then
796  SUBDIRS="$SUBDIRS libfac"
797fi
798if test -d sgroup; then
799  SUBDIRS="$SUBDIRS sgroup"
800fi
801if test -d Singular; then
802  SUBDIRS="$SUBDIRS Singular"
803fi
804if test -d Texinfo; then
805  SUBDIRS="$SUBDIRS Texinfo"
806fi
807if test -d Texi2html; then
808  SUBDIRS="$SUBDIRS Texi2html"
809fi
810if test -d doc; then
811  SUBDIRS="$SUBDIRS doc"
812fi
813if test -d emacs; then
814  SUBDIRS="$SUBDIRS emacs"
815fi
816dnl if test -d rpm; then
817dnl  SUBDIRS="$SUBDIRS rpm"
818dnl fi
819if test -d modules; then
820  SUBDIRS="$SUBDIRS modules"
821fi
822if test -d "modules"; then
823dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/Makefile"
824   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" modules"
825   BUILD_SUBDIRS=$BUILD_SUBDIRS" modules"
826fi
827 
828dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
829dnl Enough -- wrap it up
830dnl
831AC_PROG_MAKE_SET
832AC_SUBST(SUBDIRS)
833AC_SUBST(BUILD_SUBDIRS)
834AC_SUBST(BUILD1_SUBDIRS)
835AC_SUBST(CONFIG_SUBDIRS)
836AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
837
838AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.