source: git/configure.in @ 553006

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