source: git/configure.in @ 35aab3

spielwiese
Last change on this file since 35aab3 was 54c4f0, checked in by Viktor Levandovskyy <levandov@…>, 21 years ago
*levandov: version_date is set to July 2003 git-svn-id: file:///usr/local/Singular/svn/trunk@6856 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 25.4 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2AC_INIT(Singular/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=2
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="July 2003"
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
45dnl if test -d "rpm"; then
46dnl   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/Makefile"
47dnl   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/Singular.spec"
48dnl fi
49if test -d "modules"; then
50dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/Makefile"
51   CONFIG_SUBDIRS=$CONFIG_SUBDIRS" modules"
52fi
53dnl if test -d "modules/tools"; then
54dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/tools/Makefile"
55dnl fi
56dnl if test -d "modules/modgen"; then
57dnl    OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/modgen/Makefile"
58dnl fi
59if test -d "emacs"; then
60   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" emacs/Makefile"
61fi
62if test -d "IntegerProgramming"; then
63   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" IntegerProgramming/Makefile"
64fi
65if test -d "Plural"; then
66   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" Plural/Makefile"
67fi
68if test -d "InstallShield"; then
69   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" InstallShield/Makefile InstallShield/Etc/Makefile InstallShield/Cygwin/Makefile InstallShield/Singular/Makefile InstallShield/Xemacs/Makefile"
70fi
71
72
73dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
74dnl determine singuname
75dnl
76AC_MSG_CHECKING(uname for singular)
77AC_CACHE_VAL(ac_cv_singuname,
78ac_cv_singuname="unknown"
79if test -r "singuname.sh"; then
80  if (/bin/sh singuname.sh >/dev/null 2>&1) then
81    ac_cv_singuname=`/bin/sh singuname.sh`
82  fi
83fi
84)
85AC_MSG_RESULT($ac_cv_singuname)
86if test "$ac_cv_singuname" = unknown; then
87  AC_MSG_ERROR(Unknown architecture: Check singuname.sh)
88else
89  SINGUNAME=$ac_cv_singuname
90  AC_SUBST(SINGUNAME)
91fi
92
93SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
94AC_SUBST(SING_UNAME)
95
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
107# check whether the compiler accepts -pipe
108AC_MSG_CHECKING(whether compiler accepts -pipe)
109temp_cflags=${CFLAGS}
110CFLAGS="${CFLAGS} -pipe"
111AC_CACHE_VAL(ac_cv_cxx_have_pipe,
112AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no)
113)
114AC_MSG_RESULT(${ac_cv_cxx_have_pipe})
115CFLAGS=${temp_cflags}
116if test "${ac_cv_cxx_have_pipe}" != yes; then
117  PIPE=
118else
119  PIPE="-pipe"
120fi
121AC_SUBST(PIPE)
122
123AC_CHECK_PROGS(PERL, perl5 perl)
124AC_CHECK_PROGS(UUDECODE, uudecode "uudeview -i")
125AC_CHECK_PROGS(GUNZIP, gunzip,  ${pwd}/warn_not_found.sh gunzip)
126# don't use GZIP this breaks configure
127AC_CHECK_PROGS(MYGZIP, gzip, ${pwd}/warn_not_found.sh gzip)
128AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
129AC_PROG_LN_S
130
131if test -r "${pwd}/mkinstalldirs"; then
132  MKINSTALLDIRS=${pwd}/mkinstalldirs
133  AC_SUBST(MKINSTALLDIRS)
134else
135  AC_MSG_ERROR(mkinstalldirs not foind in ${pwd})
136fi
137
138dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
139dnl Set exec_prefix, bindir, libdir, includedir to some sensible values
140dnl
141# expand prefix and pass it to subsequent configures
142if test "x$prefix" = xNONE; then
143  prefix=${ac_default_prefix}
144  ac_configure_args="$ac_configure_args --prefix=${prefix}"
145fi
146
147# expand exec_prefix
148if test "x$exec_prefix" = xNONE; then
149 exec_prefix=${prefix}/${ac_cv_singuname}
150 ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}"
151fi
152
153# expand bindir
154if test "x$bindir" = 'x${exec_prefix}/bin'; then
155  bindir="${exec_prefix}"
156  ac_configure_args="$ac_configure_args --bindir=${bindir}"
157fi
158
159# expand libdir
160if test "x$libdir" = 'x${exec_prefix}/lib'; then
161  libdir="${exec_prefix}/lib"
162  ac_configure_args="$ac_configure_args --libdir=${libdir}"
163fi
164
165# expand includedir
166if test "x$includedir" = 'x${prefix}/include'; then
167  includedir="${exec_prefix}/include"
168  ac_configure_args="$ac_configure_args --includedir=${includedir}"
169fi
170
171# construct name of installed Singular executable
172SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}
173export SINGULAR
174AC_SUBST(SINGULAR)
175
176dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
177dnl Check for various libraries and headers
178dnl
179dnl After this part, the variables 'ac_<package>_ok' is 'yes'
180dnl if '<package>' is already existent on the system, otherwise
181dnl undefined.
182dnl
183
184# add -I to CPPFLAGS and -L to LDFLAGS, just to be sure
185LDFLAGS="-L${libdir} ${LDFLAGS}"
186CPPFLAGS="-I${includedir} ${CPPFLAGS}"
187
188# check for AIX
189AC_MSG_CHECKING(whether _AIX is defined)
190AC_CACHE_VAL(ac_cv_is_aix,
191AC_EGREP_CPP(yes,
192[#ifdef _AIX
193    yes
194#endif
195], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
196if test "$ac_cv_is_aix" = yes; then
197  AC_MSG_RESULT(yes)
198else
199  AC_MSG_RESULT(no)
200fi
201
202AC_CHECK_LIB(m, atof)
203AC_CHECK_LIB(bsd, socket)
204AC_CHECK_LIB(socket, listen)
205AC_CHECK_LIB(nsl, gethostbyname)
206AC_CHECK_LIB(gmp, main)
207AC_CHECK_LIB(smallgmp, mpz_init)
208AC_CHECK_LIB(MP, IMP_PutGmpInt)
209AC_CHECK_LIB(MPT, MPT_GetTree)
210AC_CHECK_LIB(singcf, atof)
211AC_CHECK_LIB(singfac, atof)
212AC_CHECK_LIB(omalloc, omTestAddr)
213AC_CHECK_LIB(omalloc_ndebug, main)
214
215AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h omalloc.h)
216
217if test "$ac_cv_lib_gmp_main" = yes && \
218 test "$ac_cv_header_gmp_h" = yes; then
219  ac_gmp_ok=yes
220fi
221
222if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \
223 test "$ac_cv_header_smallgmp_h" = yes && \
224 test "$ac_cv_header_gmp_h" = yes; then
225  ac_smallgmp_ok=yes
226fi
227
228if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
229 test "$ac_cv_lib_MPT_MPT_GetTree" && \
230 test "$ac_cv_header_MP_h" = yes && \
231 test "$ac_cv_header_MPT_h" = yes; then
232  ac_MP_ok=yes
233fi
234
235if test "$ac_cv_lib_singcf_atof" = yes && \
236 test "$ac_cv_header_factory_h" = yes; then
237  ac_factory_ok=yes
238fi
239
240if test "$ac_cv_lib_singfac_atof" = yes && \
241 test "$ac_cv_header_factor_h" = yes; then
242  ac_libfac_ok=yes
243fi
244
245if test "$ac_cv_lib_omalloc_omTestAddr" = yes && \
246   test "$ac_cv_lib_omalloc_ndebug_main" = yes && \
247   test "$ac_cv_header_omalloc_c" = yes && \
248   test "$ac_cv_header_omalloc_h" = yes; then
249  ac_cv_omalloc_ok=yes
250fi
251 
252dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
253dnl Check command line arguments
254dnl
255AC_ARG_WITH(tmpdir, \
256 [ --with-tmpdir=DIR       use DIR as temporary directory])
257AC_ARG_ENABLE(smallgmp, \
258 [ --enable-PACKAGE        configure and/or build PACKAGE
259  --disable-PACKAGE       do not configure and/or build PACKAGE
260   where PACKAGE can be:
261     smallgmp             minimal version of gmp written in C only])
262AC_ARG_ENABLE(omalloc,\
263 [    omalloc              omalloc memory managment])
264AC_ARG_ENABLE(gmp, \
265 [    gmp                  Gnu Multiple Precision package])
266AC_ARG_ENABLE(MP, \
267 [    MP                   Multi Protocol library])
268AC_ARG_ENABLE(factory, \
269 [    factory              polynomial factorization library])
270AC_ARG_ENABLE(libfac, \
271 [    libfac               char set and modp poly factorization library])
272AC_ARG_ENABLE(sgroup, \
273 [    sgroup               numerical semigroup computations])
274AC_ARG_ENABLE(Singular, \
275 [    Singular             CAS for Polynomial Computations])
276AC_ARG_ENABLE(IntegerProgramming, \
277 [    IntegerProgramming   IntegerProgramming])
278AC_ARG_ENABLE(Plural, \
279 [    Plural               Plural])
280AC_ARG_ENABLE(Texinfo, \
281 [    Texinfo              Texinfo for info, texi2dvi, makeinfo])
282AC_ARG_ENABLE(Texi2html, \
283 [    Texi2html            Texinfo to HTML converter])
284AC_ARG_ENABLE(doc, \
285 [    doc                  Singular documentation])
286AC_ARG_ENABLE(emacs, \
287 [    emacs                emacs completion files])
288AC_ARG_WITH(MP,\
289 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
290  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
291   where PACKAGE can be:
292     MP                   Multi Protocol library])
293AC_ARG_WITH(factory, \
294 [    factory              polynomial factorization library])
295AC_ARG_WITH(libfac, \
296 [    libfac               char set and modp poly factorization library])
297AC_ARG_WITH(gmp, \
298 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
299                          where PACKAGE can be gmp or smallgmp
300All additional --enable and --with options are passed to subsequent calls
301to configure of the packages to be built. See also configure --help in
302these packages (resp. subdirs). ])
303
304dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
305dnl Check what to use as tmp dir
306dnl
307AC_MSG_CHECKING(which tmp dir to use)
308if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
309  if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
310  then
311    TMP_DIR="${pwd}/tmp"
312  else
313    TMP_DIR=${with_tmpdir}
314  fi
315else
316  TMP_DIR="${pwd}/tmp"
317fi
318AC_MSG_RESULT($TMP_DIR)
319AC_SUBST(TMP_DIR)
320
321dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
322dnl Check whether or not to configure and build various packages
323dnl
324AC_MSG_CHECKING(whether to configure and build omalloc)
325if test "${enable_omalloc+set}" != set; then
326   if test "$ac_cv_omalloc_ok" = yes; then
327     enable_omalloc=no
328   fi
329   enable_omalloc_not_set=yes
330fi
331if test "$enable_omalloc" = no; then
332  if test "$ac_cv_omalloc_ok" != yes; then
333    AC_MSG_ERROR(can not build without omalloc)
334  fi
335  AC_MSG_RESULT(no)
336else
337  if test -d omalloc; then
338    AC_MSG_RESULT(yes)
339    if test "$enable_omalloc_not_set" = yes; then
340      ac_configure_args="$ac_configure_args --enable-omalloc --with-external-config_h='$pwd/Singular/omSingularConfig.h' --with-track-custom"
341    fi
342    CONFIG_SUBDIRS="$CONFIG_SUBDIRS omalloc"
343    if test "${with_malloc+set}" != set; then
344case "$ac_cv_singuname" in
345# under windows, it is best to use the provided malloc
346        ix86-Win*)
347        with_malloc=system
348        ac_configure_args="$ac_configure_args --with-malloc=system"
349        ;;
350        PowerMacintosh-darwin*)
351        with_malloc=system
352        ac_configure_args="$ac_configure_args --with-malloc=system"
353        ;;
354esac
355fi
356  else
357    AC_MSG_ERROR(need omalloc subdir)
358  fi
359fi
360
361AC_MSG_CHECKING(whether to configure and build gmp lib)
362if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
363  if test "$ac_gmp_ok" != yes && test -d gmp; then
364    AC_MSG_RESULT(yes)
365    enable_gmp=yes
366    CONFIG_SUBDIRS="$CONFIG_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#    This we used to need for our patched version of gmp 2.x
383#    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
384  fi
385else
386  AC_MSG_RESULT(no)
387fi
388
389if test "$enable_gmp" = yes; then
390# for gmp-3.0 to work for all ix86 processors, set generic target
391if test "$target" = NONE; then
392case "$ac_cv_singuname" in
393        ix86*)
394        gmp_target=`./config.guess | sed 's/^\w*-/i386-/'`
395        ac_configure_args="$ac_configure_args --target=$gmp_target"
396        ;;
397esac
398fi
399# furthermore, disable building of dynamic libraries, for we want to
400# link against the static ones
401if test "$enable_shared" != no; then
402  ac_configure_args="$ac_configure_args --disable-shared"
403fi
404fi
405
406AC_MSG_CHECKING(whether to configure and build smallgmp lib)
407if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
408  if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
409     test "$enable_gmp" != yes && test -d smallgmp; then
410    AC_MSG_RESULT(yes)
411    enable_smallgmp=yes
412    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
413    ac_configure_args="$ac_configure_args --enable-smallgmp --enable-gmp"
414    enable_gmp=yes
415  else
416    AC_MSG_RESULT(no)
417    enable_smallgmp=no
418  fi
419elif test "$enable_smallgmp" = yes; then
420  if test ! -d smallgmp; then
421    AC_MSG_RESULT(no)
422    AC_MSG_ERROR(Can not find smallgmp subdir)
423  else
424    AC_MSG_RESULT(yes)
425    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
426    if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
427      ac_configure_args="$ac_configure_args --enable-gmp"
428      enable_gmp=yes
429    fi
430  fi
431else
432  AC_MSG_RESULT(${enable_smallgmp})
433fi
434
435# Check whether we have at least one of smallgmp or gmp
436if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
437   test "$enable_smallgmp" != yes && test "$enable_gmp" != yes; then
438  AC_MSG_ERROR(can neither find nor built gmp or smallgmp)
439fi
440
441# Check whether we need to cheat subsequent configures with --enable-gmp
442if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
443  ac_configure_args="$ac_configure_args --enable-gmp"
444fi
445
446AC_MSG_CHECKING(whether to configure and build MP lib)
447if test "$enable_MP" != yes && test "$enable_MP" != no; then
448  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
449     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
450    AC_MSG_RESULT(yes)
451    enable_MP=yes
452    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
453    ac_configure_args="$ac_configure_args --enable-MP"
454  else
455    AC_MSG_RESULT(no)
456    enable_MP=no
457  fi
458elif test "$enable_MP" = yes; then
459  if test ! -d MP; then
460    AC_MSG_RESULT(no)
461    AC_MSG_ERROR(can not build MP without MP directory)
462  fi
463  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
464    AC_MSG_RESULT(yes)
465    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
466  else
467    AC_MSG_RESULT(no)
468    AC_MSG_ERROR(can not build MP without gmp)
469  fi
470else
471  AC_MSG_RESULT(no)
472fi
473
474# need MP code to be compiled with -fPIC, should not hurt anybody else
475if test "$enable_MP" = yes && test "${with_extra_cflags+set}" != set; then
476ac_configure_args="$ac_configure_args --with-extra_cflags=-fPIC"
477fi
478
479AC_MSG_CHECKING(whether to configure and build NTL lib)
480if test "$enable_NTL" != yes && test "$enable_NTL" != no; then
481  if test "$with_NTL" != no && test "$ac_NTL_ok" != yes && \
482     test -d ntl; then
483    enable_NTL=yes
484    AC_MSG_RESULT(yes)
485    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
486    ac_configure_args="$ac_configure_args --enable-NTL"
487  else
488    enable_NTL=no
489    AC_MSG_RESULT(no)
490  fi
491elif test "$enable_NTL" = yes; then
492  if test -d ntl; then
493    AC_MSG_RESULT(yes)
494    CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
495  else
496    AC_MSG_RESULT(no)
497    AC_MSG_ERROR(can not build NTL without ntl directory)
498  fi
499else
500  AC_MSG_RESULT(no)
501fi
502
503AC_MSG_CHECKING(whether to configure and build factory lib)
504if test "$enable_factory" != yes && test "$enable_factory" != no; then
505  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
506     test -d factory; then
507    enable_factory=yes
508    AC_MSG_RESULT(yes)
509    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
510    ac_configure_args="$ac_configure_args --enable-factory"
511  else
512    enable_factory=no
513    AC_MSG_RESULT(no)
514  fi
515elif test "$enable_factory" = yes; then
516  if test -d factory; then
517    AC_MSG_RESULT(yes)
518    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
519  else
520    AC_MSG_RESULT(no)
521    AC_MSG_ERROR(can not build factory without factory directory)
522  fi
523else
524  AC_MSG_RESULT(no)
525fi
526
527AC_MSG_CHECKING(whether to configure and build libfac lib)
528if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
529  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
530     test -d libfac && \
531     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
532    enable_libfac=yes
533    AC_MSG_RESULT(yes)
534    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
535    ac_configure_args="$ac_configure_args --enable-libfac"
536  else
537    enable_libfac=no
538    AC_MSG_RESULT(no)
539  fi
540elif  test "$enable_libfac" = yes; then
541  if test ! -d libfac; then
542    AC_MSG_RESULT(no)
543    AC_MSG_ERROR(can not build libfac without libfac directory)
544  fi
545  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
546    AC_MSG_RESULT(yes)
547    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
548  else
549    AC_MSG_RESULT(no)
550    AC_MSG_ERROR(Can not build libfac without factory)
551  fi
552else
553  AC_MSG_RESULT(no)
554fi
555
556AC_MSG_CHECKING(whether to configure and build sgroup lib)
557dnl
558dnl only sgroup if explicietely requested
559dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
560dnl  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
561dnl     test -d sgroup && \
562dnl     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
563dnl    enable_sgroup=yes
564dnl    AC_MSG_RESULT(yes)
565dnl    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
566dnl    ac_configure_args="$ac_configure_args --enable-sgroup"
567dnl  else
568dnl    enable_sgroup=no
569dnl    AC_MSG_RESULT(no)
570dnl  fi
571dnl elif  test "$enable_sgroup" = yes; then
572if test "$enable_sgroup" = yes; then
573  if test ! -d sgroup; then
574    AC_MSG_RESULT(no)
575    AC_MSG_ERROR(can not build sgroup without sgroup directory)
576  fi
577  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
578    AC_MSG_RESULT(yes)
579    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
580  else
581    AC_MSG_RESULT(no)
582    AC_MSG_ERROR(Can not build sgroup without MP)
583  fi
584else
585  AC_MSG_RESULT(no)
586fi
587
588BUILD_SUBDIRS="$CONFIG_SUBDIRS"
589
590AC_MSG_CHECKING(whether to configure and build Singular)
591if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
592  if test "$with_Singular" != no && test -d Singular; then
593    enable_Singular=yes
594    AC_MSG_RESULT(yes)
595    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
596    BUILD_SUBDIRS="$BUILD_SUBDIRS Singular"     
597    ac_configure_args="$ac_configure_args --enable-Singular"
598  else
599    enable_Singular=no
600    AC_MSG_RESULT(no)
601  fi
602elif test "$enable_Singular" = yes; then
603  if test -d Singular; then
604    AC_MSG_RESULT(yes)
605    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
606    BUILD_SUBDIRS="$BUILD_SUBDIRS Singular"     
607  else
608    AC_MSG_RESULT(no)
609    AC_MSG_ERROR(can not build Singular without Singular directory)
610  fi
611else
612  AC_MSG_RESULT(no)
613fi
614
615
616# test if IntegerProgramming should be built:
617
618AC_MSG_CHECKING(whether to build IntegerProgramming)
619if test "$enable_IntegerProgramming" != no && test -d "IntegerProgramming"; then
620   BUILD_SUBDIRS="$BUILD_SUBDIRS IntegerProgramming"
621   AC_MSG_RESULT(yes)
622   if test "$enable_IntegerProgramming" != yes; then
623     ac_configure_args="$ac_configure_args --enable-IntegerProgramming"
624   fi
625else
626   AC_MSG_RESULT(no)
627fi
628
629AC_MSG_CHECKING(whether to build Plural)
630if test "$enable_Plural" != no || test "$with_Plural" != no; then
631   AC_MSG_RESULT(yes)
632   if test "$enable_Plural" != yes; then
633     ac_configure_args="$ac_configure_args --enable-Plural"
634   fi
635else
636   AC_MSG_RESULT(no)
637fi
638
639
640AC_MSG_CHECKING(whether to configure and build Texinfo)
641if test "$enable_Texinfo" != no && test -d Texinfo; then
642  AC_MSG_RESULT(yes)
643  enable_texinfo=yes
644  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
645  BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"       
646  TEXI2DVI=${bindir}/texi2dvi
647  MAKEINFO="${bindir}/makeinfo"
648  TEXINDEX=${bindir}/texindex
649  AC_SUBST(TEXI2DVI)
650  AC_SUBST(MAKEINFO)
651  AC_SUBST(TEXINDEX)
652  if test "$enable_Texinfo" != yes; then
653    ac_configure_args="$ac_configure_args --enable-Texinfo"
654  fi
655else
656  AC_MSG_RESULT(no)
657  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
658  enable_texinfo=no
659  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
660  AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, ${pwd}/warn_not_found.sh texi2dvi)
661  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
662fi 
663
664AC_MSG_CHECKING(whether to configure and build Texi2html)
665if test "$enable_Texi2html" != no && test -d Texi2html; then
666 AC_MSG_RESULT(yes)
667 CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
668 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
669 if test "$enable_Texi2html" != yes; then
670   ac_configure_args="$ac_configure_args --enable-Texi2html"
671 fi
672 TEXI2HTML=${bindir}/texi2html
673 AC_SUBST(TEXI2HTML)
674else
675 AC_MSG_RESULT(no)
676 AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
677fi
678
679if test "${TEXI2HTML+set}" != set; then
680AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
681fi
682if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
683  TEXI2HTML_OPTS="-l2h"
684fi
685AC_SUBST(TEXI2HTML_OPTS)
686
687
688AC_MSG_CHECKING(whether to build doc)
689if test "$enable_doc" != no && test -d doc; then
690 AC_MSG_RESULT(yes)
691 BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
692 if test "$enable_doc" != yes; then
693   enable_doc=yes
694   ac_configure_args="$ac_configure_args --enable-doc"
695 fi
696else
697 enable_doc=no
698 AC_MSG_RESULT(no)
699fi
700
701AC_MSG_CHECKING(whether to build emacs)
702if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
703 AC_MSG_RESULT(yes)
704 BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
705 if test "$enable_emacs" != yes; then
706   ac_configure_args="$ac_configure_args --enable-emacs"
707 fi
708else
709 AC_MSG_RESULT(no)
710fi
711
712dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
713dnl Check whether or not to use various packages
714dnl
715AC_MSG_CHECKING(which apint package to use)
716if test "$with_apint" = gmp; then
717  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
718    AC_MSG_RESULT(gmp)
719  else
720    AC_MSG_RESULT(none)
721    AC_MSG_ERROR(can not use with gmp without finding or building it)
722  fi
723elif test "$with_apint" = smallgmp; then
724  if test "$ac_smallgmp_ok" = yes || test "$enable_smallgmp" = yes; then
725    AC_MSG_RESULT(smallgmp)
726  else
727    AC_MSG_RESULT(none)
728    AC_MSG_ERROR(can not use with smallgmp without finding or building it)
729  fi
730elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
731    AC_MSG_RESULT(gmp)
732    ac_configure_args="$ac_configure_args --with-apint=gmp"
733else
734dnl now we are sure that we have the smallgmp --otherwise enable
735dnl checks had thrown an error
736   AC_MSG_RESULT(smallgmp)
737   ac_configure_args="$ac_configure_args --with-apint=smallgmp"
738fi
739
740AC_MSG_CHECKING(whether to use with MP)
741if test "$with_MP" = yes; then
742  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
743    AC_MSG_RESULT(yes)
744  else
745    AC_MSG_RESULT(none)
746    AC_MSG_ERROR(can not use with MP without finding or building it)
747  fi
748elif test "$with_MP" = no; then
749  AC_MSG_RESULT(no)
750elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
751  AC_MSG_RESULT(yes)
752  ac_configure_args="$ac_configure_args --with-MP"
753else
754  AC_MSG_RESULT(no)
755  ac_configure_args="$ac_configure_args --without-MP"
756fi
757
758AC_MSG_CHECKING(whether to use with factory)
759if test "$with_factory" = yes; then
760  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
761    AC_MSG_RESULT(yes)
762  else
763    AC_MSG_RESULT(none)
764    AC_MSG_ERROR(can not use with factory without finding or building it)
765  fi
766elif test "$with_factory" = no; then
767  AC_MSG_RESULT(no)
768elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
769  AC_MSG_RESULT(yes)
770  ac_configure_args="$ac_configure_args --with-factory"
771else
772  AC_MSG_RESULT(no)
773  ac_configure_args="$ac_configure_args --without-factory"
774fi
775 
776AC_MSG_CHECKING(whether to use with libfac)
777if test "$with_libfac" = yes; then
778  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
779    AC_MSG_RESULT(yes)
780  else
781    AC_MSG_RESULT(none)
782    AC_MSG_ERROR(can not use with libfac without finding or building it)
783  fi
784elif test "$with_libfac" = no; then
785  AC_MSG_RESULT(no)
786elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
787  AC_MSG_RESULT(yes)
788  ac_configure_args="$ac_configure_args --with-libfac"
789else
790  AC_MSG_RESULT(no)
791  ac_configure_args="$ac_configure_args --without-libfac"
792fi
793
794
795
796AC_MSG_CHECKING(whether to use with Singular)
797if test "$with_Singular" != no && test "$with_Singular" != yes; then
798  if test "$enable_Singular" = yes; then
799    with_Singular=yes
800  else
801    with_Singular=no
802  fi
803  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
804fi
805
806if test "$with_Singular" != no; then
807  AC_MSG_RESULT(yes)
808else
809  AC_MSG_RESULT(no)
810fi
811
812
813dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
814dnl Check for known subdirs
815dnl
816SUBDIRS=""
817if test -d omalloc; then
818  SUBDIRS="$SUBDIRS omalloc"
819fi
820if test -d smallgmp; then
821  SUBDIRS="$SUBDIRS smallgmp"
822fi
823if test -d gmp; then
824  SUBDIRS="$SUBDIRS gmp"
825fi
826if test -d MP; then
827  SUBDIRS="$SUBDIRS MP"
828fi
829if test -d ntl; then
830  SUBDIRS="$SUBDIRS ntl"
831fi
832if test -d factory; then
833  SUBDIRS="$SUBDIRS factory"
834fi
835if test -d libfac; then
836  SUBDIRS="$SUBDIRS libfac"
837fi
838if test -d sgroup; then
839  SUBDIRS="$SUBDIRS sgroup"
840fi
841if test -d Singular; then
842  SUBDIRS="$SUBDIRS Singular"
843fi
844if test -d Texinfo; then
845  SUBDIRS="$SUBDIRS Texinfo"
846fi
847if test -d Texi2html; then
848  SUBDIRS="$SUBDIRS Texi2html"
849fi
850if test -d doc; then
851  SUBDIRS="$SUBDIRS doc"
852fi
853if test -d emacs; then
854  SUBDIRS="$SUBDIRS emacs"
855fi
856dnl if test -d rpm; then
857dnl  SUBDIRS="$SUBDIRS rpm"
858dnl fi
859if test -d modules; then
860  SUBDIRS="$SUBDIRS modules"
861fi
862 
863dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
864dnl Enough -- wrap it up
865dnl
866AC_PROG_MAKE_SET
867AC_SUBST(SUBDIRS)
868AC_SUBST(BUILD_SUBDIRS)
869AC_SUBST(CONFIG_SUBDIRS)
870AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
871
872AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.