source: git/configure.in @ 0183d6

spielwiese
Last change on this file since 0183d6 was 181d6e, checked in by Olaf Bachmann <obachman@…>, 24 years ago
* clean-up IntegerProgramming git-svn-id: file:///usr/local/Singular/svn/trunk@4360 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 22.5 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2AC_INIT(Singular/matpol.h)
3AC_PREFIX_DEFAULT(`pwd`)
4OUTPUT_MAKEFILES="Makefile"
5if test -d "doc"; then
6   OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES doc/Makefile doc/version.texi doc/uname.texi"
7fi
8if test -d "rpm"; then
9   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/Makefile"
10   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" rpm/rpmrc rpm/Singular.spec"
11fi
12if test -d "modules"; then
13   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/Makefile"
14fi
15if test -d "modules/tools"; then
16   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/tools/Makefile"
17fi
18if test -d "modules/modgen"; then
19   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" modules/modgen/Makefile"
20fi
21if test -d "emacs"; then
22   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" emacs/Makefile"
23fi
24if test -d "IntegerProgramming"; then
25   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" IntegerProgramming/Makefile"
26fi
27
28pwd=`pwd`
29
30dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
31dnl determine singuname
32dnl
33AC_MSG_CHECKING(uname for singular)
34AC_CACHE_VAL(ac_cv_singuname,
35ac_cv_singuname="unknown"
36if test -r "singuname.sh"; then
37  if (/bin/sh singuname.sh >/dev/null 2>&1) then
38    ac_cv_singuname=`/bin/sh singuname.sh`
39  fi
40fi
41)
42AC_MSG_RESULT($ac_cv_singuname)
43if test "$ac_cv_singuname" = unknown; then
44  AC_MSG_ERROR(Unknown architecture: Check singuname.sh)
45else
46  SINGUNAME=$ac_cv_singuname
47  AC_SUBST(SINGUNAME)
48fi
49
50SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
51AC_SUBST(SING_UNAME)
52
53VERSION_SEP="-"
54
55dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
56dnl Version business --  set these here
57dnl
58# make them to env variables
59# pass them indirectly to subsequent configures
60SINGULAR_MAJOR_VERSION=1
61SINGULAR_MINOR_VERSION=3
62SINGULAR_SUB_VERSION=8
63SINGULAR_SHORT_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}"
64SINGULAR_VERSION="${SINGULAR_SHORT_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
65VERSION_DATE="May 2000"
66
67export SINGULAR_MINOR_VERSION
68export SINGULAR_MAJOR_VERSION
69export SINGULAR_SUB_VERSION
70export SINGULAR_VERSION
71export VERSION_DATE
72
73dnl substitue them into the Makefiles
74AC_SUBST(SINGULAR_VERSION)
75AC_SUBST(VERSION_DATE)
76AC_SUBST(SINGULAR_SHORT_VERSION)
77
78dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
79dnl compiler stuff
80dnl is needed to check for libs and headers, later on
81dnl
82AC_PROG_CC
83AC_PROG_CPP
84AC_PROG_INSTALL
85AC_AIX
86dnl we do not want to have "-g -O" for CFLAGS
87if test "${CXXFLAGS+set}" != set; then
88  ac_cxxflags_set=no
89  CXXFLAGS="-O"
90fi
91if test "${CFLAGS+set}" != set; then
92  CFLAGS="-O"
93  ac_cflags_set=no
94fi
95
96# check whether CXX was set by user as env variable
97if test "${CXX+set}" != set; then
98  ac_cxx_set=no
99else
100  ac_cxx_set=yes
101fi
102AC_PROG_CXX
103
104# check whether the compiler accepts -pipe
105AC_MSG_CHECKING(whether compiler accepts -pipe)
106temp_cflags=${CFLAGS}
107CFLAGS="${CFLAGS} -pipe"
108AC_CACHE_VAL(ac_cv_cxx_have_pipe,
109AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no)
110)
111AC_MSG_RESULT(${ac_cv_cxx_have_pipe})
112CFLAGS=${temp_cflags}
113if test "${ac_cv_cxx_have_pipe}" != yes; then
114  PIPE=
115else
116  PIPE="-pipe"
117fi
118AC_SUBST(PIPE)
119
120AC_CHECK_PROGS(PERL, perl5 perl)
121AC_CHECK_PROGS(UUDECODE, uudecode "uudeview -i")
122AC_CHECK_PROGS(GUNZIP, gunzip,  ${pwd}/warn_not_found.sh gunzip)
123# don't use GZIP this breaks configure
124AC_CHECK_PROGS(MYGZIP, gzip, ${pwd}/warn_not_found.sh gzip)
125AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
126AC_PROG_LN_S
127
128dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
129dnl Set exec_prefix, bindir, libdir, includedir to some sensible values
130dnl
131# expand prefix and pass it to subsequent configures
132if test "x$prefix" = xNONE; then
133  prefix=${ac_default_prefix}
134  ac_configure_args="$ac_configure_args --prefix=${prefix}"
135fi
136
137# expand exec_prefix
138if test "x$exec_prefix" = xNONE; then
139 exec_prefix=${prefix}/${ac_cv_singuname}
140 ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}"
141fi
142
143# expand bindir
144if test "x$bindir" = 'x${exec_prefix}/bin'; then
145  bindir="${exec_prefix}"
146  ac_configure_args="$ac_configure_args --bindir=${bindir}"
147fi
148
149# expand libdir
150if test "x$libdir" = 'x${exec_prefix}/lib'; then
151  libdir="${exec_prefix}/lib"
152  ac_configure_args="$ac_configure_args --libdir=${libdir}"
153fi
154
155# expand includedir
156if test "x$includedir" = 'x${prefix}/include'; then
157  includedir="${exec_prefix}/include"
158  ac_configure_args="$ac_configure_args --includedir=${includedir}"
159fi
160
161# construct name of installed Singular executable
162SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}
163export SINGULAR
164AC_SUBST(SINGULAR)
165
166dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
167dnl Check for various libraries and headers
168dnl
169dnl After this part, the variables 'ac_<package>_ok' is 'yes'
170dnl if '<package>' is already existent on the system, otherwise
171dnl undefined.
172dnl
173
174# add -I to CPPFLAGS and -L to LDFLAGS, just to be sure
175LDFLAGS="-L${libdir} ${LDFLAGS}"
176CPPFLAGS="-I${includedir} ${CPPFLAGS}"
177
178# check for AIX
179AC_MSG_CHECKING(whether _AIX is defined)
180AC_CACHE_VAL(ac_cv_is_aix,
181AC_EGREP_CPP(yes,
182[#ifdef _AIX
183    yes
184#endif
185], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
186if test "$ac_cv_is_aix" = yes; then
187  AC_MSG_RESULT(yes)
188else
189  AC_MSG_RESULT(no)
190fi
191
192AC_CHECK_LIB(m, atof)
193AC_CHECK_LIB(bsd, socket)
194AC_CHECK_LIB(socket, listen)
195AC_CHECK_LIB(nsl, gethostbyname)
196AC_CHECK_LIB(gmp, main)
197AC_CHECK_LIB(smallgmp, mpz_init)
198AC_CHECK_LIB(MP, IMP_PutGmpInt)
199AC_CHECK_LIB(MPT, MPT_GetTree)
200AC_CHECK_LIB(singcf, atof)
201AC_CHECK_LIB(singfac, atof)
202
203AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.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_smallgmp_mpz_init" = yes && \
211 test "$ac_cv_header_smallgmp_h" = yes && \
212 test "$ac_cv_header_gmp_h" = yes; then
213  ac_smallgmp_ok=yes
214fi
215
216if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
217 test "$ac_cv_lib_MPT_MPT_GetTree" && \
218 test "$ac_cv_header_MP_h" = yes && \
219 test "$ac_cv_header_MPT_h" = yes; then
220  ac_MP_ok=yes
221fi
222
223if test "$ac_cv_lib_singcf_atof" = yes && \
224 test "$ac_cv_header_factory_h" = yes; then
225  ac_factory_ok=yes
226fi
227
228if test "$ac_cv_lib_singfac_atof" = yes && \
229 test "$ac_cv_header_factor_h" = yes; then
230  ac_libfac_ok=yes
231fi
232
233 
234dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
235dnl Check command line arguments
236dnl
237AC_ARG_WITH(tmpdir, \
238 [ --with-tmpdir=DIR       use DIR as temporary directory])
239AC_ARG_ENABLE(smallgmp, \
240 [ --enable-PACKAGE        configure and/or build PACKAGE
241  --disable-PACKAGE       do not configure and/or build PACKAGE
242   where PACKAGE can be:
243     smallgmp             minimal version of gmp written in C only])
244AC_ARG_ENABLE(gmp, \
245 [    gmp                  Gnu Multiple Precision package])
246AC_ARG_ENABLE(MP, \
247 [    MP                   Multi Protocol library])
248AC_ARG_ENABLE(factory, \
249 [    factory              polynomial factorization library])
250AC_ARG_ENABLE(libfac, \
251 [    libfac               char set and modp poly factorization library])
252AC_ARG_ENABLE(sgroup, \
253 [    sgroup               numerical semigroup computations])
254AC_ARG_ENABLE(mtrack, \
255 [    mtrack               utility to track unused memory])
256AC_ARG_ENABLE(Singular, \
257 [    Singular             CAS for Polynomial Computations])
258AC_ARG_ENABLE(IntegerProgramming, \
259 [    IntegerProgramming   IntegerProgramming])
260AC_ARG_ENABLE(Texinfo, \
261 [    Texinfo              Texinfo for info, texi2dvi, makeinfo])
262AC_ARG_ENABLE(Texi2html, \
263 [    Texi2html            Texinfo to HTML converter])
264AC_ARG_ENABLE(doc, \
265 [    doc                  Singular documentation])
266AC_ARG_ENABLE(emacs, \
267 [    emacs                emacs completion files])
268AC_ARG_WITH(MP,\
269 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
270  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
271   where PACKAGE can be:
272     MP                   Multi Protocol library])
273AC_ARG_WITH(factory, \
274 [    factory              polynomial factorization library])
275AC_ARG_WITH(libfac, \
276 [    libfac               char set and modp poly factorization library])
277AC_ARG_WITH(mtrack, \
278 [    mtrack               utility to track unused memory])
279AC_ARG_WITH(gmp, \
280 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
281                          where PACKAGE can be gmp or smallgmp
282All additional --enable and --with options are passed to subsequent calls
283to configure of the packages to be built. See also configure --help in
284these packages (resp. subdirs). ])
285
286dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
287dnl Check what to use as tmp dir
288dnl
289AC_MSG_CHECKING(which tmp dir to use)
290if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
291  if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
292  then
293    TMP_DIR="${pwd}/tmp"
294  else
295    TMP_DIR=${with_tmpdir}
296  fi
297else
298  TMP_DIR="${pwd}/tmp"
299fi
300AC_MSG_RESULT($TMP_DIR)
301AC_SUBST(TMP_DIR)
302
303dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
304dnl Check whether or not to configure and build various packages
305dnl
306
307AC_MSG_CHECKING(whether to configure and build gmp lib)
308if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
309  if test "$ac_gmp_ok" != yes && test -d gmp; then
310    AC_MSG_RESULT(yes)
311    enable_gmp=yes
312    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
313    ac_configure_args="$ac_configure_args --enable-gmp"
314    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
315  else
316    AC_MSG_RESULT(no)
317    enable_gmp=no
318  fi
319elif test "$enable_gmp" = yes; then
320  if test ! -d gmp; then
321    AC_MSG_RESULT(no)
322    AC_MSG_ERROR(Can not find gmp subdir)
323  else
324    AC_MSG_RESULT(yes)
325    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
326    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
327  fi
328else
329  AC_MSG_RESULT(no)
330fi
331
332AC_MSG_CHECKING(whether to configure and build smallgmp lib)
333if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
334  if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
335     test "$enable_gmp" != yes && test -d smallgmp; then
336    AC_MSG_RESULT(yes)
337    enable_smallgmp=yes
338    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
339    ac_configure_args="$ac_configure_args --enable-smallgmp --enable-gmp"
340  else
341    AC_MSG_RESULT(no)
342    enable_smallgmp=no
343  fi
344elif test "$enable_smallgmp" = yes; then
345  if test ! -d smallgmp; then
346    AC_MSG_RESULT(no)
347    AC_MSG_ERROR(Can not find smallgmp subdir)
348  else
349    AC_MSG_RESULT(yes)
350    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
351    if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
352      ac_configure_args="$ac_configure_args --enable-gmp"
353    fi
354  fi
355else
356  AC_MSG_RESULT(${enable_smallgmp})
357fi
358
359# Check whether we have at least one of smallgmp or gmp
360if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
361   test "$enable_smallgmp" != yes && test "$enable_gmp" != yes; then
362  AC_MSG_ERROR(can neither find nor built gmp or smallgmp)
363fi
364
365# Check whether we need to cheat subsequent configures with --enable-gmp
366if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes; then
367  ac_configure_args="$ac_configure_args --enable-gmp"
368fi
369
370AC_MSG_CHECKING(whether to configure and build MP lib)
371if test "$enable_MP" != yes && test "$enable_MP" != no; then
372  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
373     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
374    AC_MSG_RESULT(yes)
375    enable_MP=yes
376    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
377    ac_configure_args="$ac_configure_args --enable-MP"
378  else
379    AC_MSG_RESULT(no)
380    enable_MP=no
381  fi
382elif test "$enable_MP" = yes; then
383  if test ! -d MP; then
384    AC_MSG_RESULT(no)
385    AC_MSG_ERROR(can not build MP without MP directory)
386  fi
387  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
388    AC_MSG_RESULT(yes)
389    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
390  else
391    AC_MSG_RESULT(no)
392    AC_MSG_ERROR(can not build MP without gmp)
393  fi
394else
395  AC_MSG_RESULT(no)
396fi
397 
398AC_MSG_CHECKING(whether to configure and build factory lib)
399if test "$enable_factory" != yes && test "$enable_factory" != no; then
400  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
401     test -d factory; then
402    enable_factory=yes
403    AC_MSG_RESULT(yes)
404    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
405    ac_configure_args="$ac_configure_args --enable-factory"
406  else
407    enable_factory=no
408    AC_MSG_RESULT(no)
409  fi
410elif test "$enable_factory" = yes; then
411  if test -d factory; then
412    AC_MSG_RESULT(yes)
413    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
414  else
415    AC_MSG_RESULT(no)
416    AC_MSG_ERROR(can not build factory without factory directory)
417  fi
418else
419  AC_MSG_RESULT(no)
420fi
421
422AC_MSG_CHECKING(whether to configure and build libfac lib)
423if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
424  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
425     test -d libfac && \
426     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
427    enable_libfac=yes
428    AC_MSG_RESULT(yes)
429    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
430    ac_configure_args="$ac_configure_args --enable-libfac"
431  else
432    enable_libfac=no
433    AC_MSG_RESULT(no)
434  fi
435elif  test "$enable_libfac" = yes; then
436  if test ! -d libfac; then
437    AC_MSG_RESULT(no)
438    AC_MSG_ERROR(can not build libfac without libfac directory)
439  fi
440  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
441    AC_MSG_RESULT(yes)
442    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
443  else
444    AC_MSG_RESULT(no)
445    AC_MSG_ERROR(Can not build libfac without factory)
446  fi
447else
448  AC_MSG_RESULT(no)
449fi
450
451AC_MSG_CHECKING(whether to configure and build sgroup lib)
452dnl
453dnl only sgroup if explicietely requested
454dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
455dnl  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
456dnl     test -d sgroup && \
457dnl     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
458dnl    enable_sgroup=yes
459dnl    AC_MSG_RESULT(yes)
460dnl    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
461dnl    ac_configure_args="$ac_configure_args --enable-sgroup"
462dnl  else
463dnl    enable_sgroup=no
464dnl    AC_MSG_RESULT(no)
465dnl  fi
466dnl elif  test "$enable_sgroup" = yes; then
467if test "$enable_sgroup" = yes; then
468  if test ! -d sgroup; then
469    AC_MSG_RESULT(no)
470    AC_MSG_ERROR(can not build sgroup without sgroup directory)
471  fi
472  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
473    AC_MSG_RESULT(yes)
474    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
475  else
476    AC_MSG_RESULT(no)
477    AC_MSG_ERROR(Can not build sgroup without MP)
478  fi
479else
480  AC_MSG_RESULT(no)
481fi
482
483BUILD_SUBDIRS="$CONFIG_SUBDIRS"
484
485AC_MSG_CHECKING(whether to build mpr and use mtrack)
486if test -d mpr && test "$ac_cv_singuname" = ix86-Linux && test "$enable_mtrack" != no; then
487  AC_MSG_RESULT(yes)
488  if test "$enable_mtrack" != yes; then
489     ac_configure_args="$ac_configure_args --enable-mtrack"
490  fi
491  enable_mtrack=yes
492  OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" mpr/Makefile"
493  BUILD_SUBDIRS="$BUILD_SUBDIRS mpr"
494else
495  AC_MSG_RESULT(no)
496  enable_mtrack=no
497fi
498
499AC_MSG_CHECKING(whether to configure and build Singular)
500if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
501  if test "$with_Singular" != no && test -d Singular; then
502    enable_Singular=yes
503    AC_MSG_RESULT(yes)
504    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
505    BUILD_SUBDIRS="$BUILD_SUBDIRS Singular"     
506    ac_configure_args="$ac_configure_args --enable-Singular"
507  else
508    enable_Singular=no
509    AC_MSG_RESULT(no)
510  fi
511elif test "$enable_Singular" = yes; then
512  if test -d Singular; then
513    AC_MSG_RESULT(yes)
514    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
515    BUILD_SUBDIRS="$BUILD_SUBDIRS Singular"     
516  else
517    AC_MSG_RESULT(no)
518    AC_MSG_ERROR(can not build Singular without Singular directory)
519  fi
520else
521  AC_MSG_RESULT(no)
522fi
523
524
525# test if IntegerProgramming should be built:
526
527AC_MSG_CHECKING(whether to build IntegerProgramming)
528if test "$enable_IntegerProgramming" != no && test -d "IntegerProgramming"; then
529   BUILD_SUBDIRS="$BUILD_SUBDIRS IntegerProgramming"
530   AC_MSG_RESULT(yes)
531   if test "$enable_IntegerProgramming" != yes; then
532     ac_configure_args="$ac_configure_args --enable-IntegerProgramming"
533   fi
534else
535   AC_MSG_RESULT(no)
536fi
537
538
539AC_MSG_CHECKING(whether to configure and build Texinfo)
540if test "$enable_Texinfo" != no && test -d Texinfo; then
541  AC_MSG_RESULT(yes)
542  enable_texinfo=yes
543  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
544  BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"       
545  TEXI2DVI=${bindir}/texi2dvi
546  MAKEINFO="${bindir}/makeinfo"
547  TEXINDEX=${bindir}/texindex
548  AC_SUBST(TEXI2DVI)
549  AC_SUBST(MAKEINFO)
550  AC_SUBST(TEXINDEX)
551  if test "$enable_Texinfo" != yes; then
552    ac_configure_args="$ac_configure_args --enable-Texinfo"
553  fi
554else
555  AC_MSG_RESULT(no)
556  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
557  enable_texinfo=no
558  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
559  AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, ${pwd}/warn_not_found.sh texi2dvi)
560  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
561fi 
562
563AC_MSG_CHECKING(whether to configure and build Texi2html)
564if test "$enable_Texi2html" != no && test -d Texi2html; then
565 AC_MSG_RESULT(yes)
566 CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
567 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
568 if test "$enable_Texi2html" != yes; then
569   ac_configure_args="$ac_configure_args --enable-Texi2html"
570 fi
571 TEXI2HTML=${bindir}/texi2html
572 AC_SUBST(TEXI2HTML)
573else
574 AC_MSG_RESULT(no)
575 AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
576fi
577
578if test "${TEXI2HTML+set}" != set; then
579AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
580fi
581if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
582  TEXI2HTML_OPTS="-l2h"
583fi
584AC_SUBST(TEXI2HTML_OPTS)
585
586
587AC_MSG_CHECKING(whether to build doc)
588if test "$enable_doc" != no && test -d doc; then
589 AC_MSG_RESULT(yes)
590 BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
591 if test "$enable_doc" != yes; then
592   enable_doc=yes
593   ac_configure_args="$ac_configure_args --enable-doc"
594 fi
595else
596 enable_doc=no
597 AC_MSG_RESULT(no)
598fi
599
600AC_MSG_CHECKING(whether to build emacs)
601if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
602 AC_MSG_RESULT(yes)
603 BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
604 if test "$enable_emacs" != yes; then
605   ac_configure_args="$ac_configure_args --enable-emacs"
606 fi
607else
608 AC_MSG_RESULT(no)
609fi
610
611dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
612dnl Check whether or not to use various packages
613dnl
614AC_MSG_CHECKING(which apint package to use)
615if test "$with_apint" = gmp; then
616  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
617    AC_MSG_RESULT(gmp)
618  else
619    AC_MSG_RESULT(none)
620    AC_MSG_ERROR(can not use with gmp without finding or building it)
621  fi
622elif test "$with_apint" = smallgmp; then
623  if test "$ac_smallgmp_ok" = yes || test "$enable_smallgmp" = yes; then
624    AC_MSG_RESULT(smallgmp)
625  else
626    AC_MSG_RESULT(none)
627    AC_MSG_ERROR(can not use with smallgmp without finding or building it)
628  fi
629elif test "$ac_gmp_ok" = yes || test "$enable_gmp"; then
630    AC_MSG_RESULT(gmp)
631    ac_configure_args="$ac_configure_args --with-apint=gmp"
632else
633dnl now we are sure that we have the smallgmp --otherwise enable
634dnl checks had thrown an error
635   AC_MSG_RESULT(smallgmp)
636   ac_configure_args="$ac_configure_args --with-apint=smallgmp"
637fi
638
639AC_MSG_CHECKING(whether to use with MP)
640if test "$with_MP" = yes; then
641  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
642    AC_MSG_RESULT(yes)
643  else
644    AC_MSG_RESULT(none)
645    AC_MSG_ERROR(can not use with MP without finding or building it)
646  fi
647elif test "$with_MP" = no; then
648  AC_MSG_RESULT(no)
649elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
650  AC_MSG_RESULT(yes)
651  ac_configure_args="$ac_configure_args --with-MP"
652else
653  AC_MSG_RESULT(no)
654  ac_configure_args="$ac_configure_args --without-MP"
655fi
656
657AC_MSG_CHECKING(whether to use with factory)
658if test "$with_factory" = yes; then
659  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
660    AC_MSG_RESULT(yes)
661  else
662    AC_MSG_RESULT(none)
663    AC_MSG_ERROR(can not use with factory without finding or building it)
664  fi
665elif test "$with_factory" = no; then
666  AC_MSG_RESULT(no)
667elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
668  AC_MSG_RESULT(yes)
669  ac_configure_args="$ac_configure_args --with-factory"
670else
671  AC_MSG_RESULT(no)
672  ac_configure_args="$ac_configure_args --without-factory"
673fi
674 
675AC_MSG_CHECKING(whether to use with libfac)
676if test "$with_libfac" = yes; then
677  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
678    AC_MSG_RESULT(yes)
679  else
680    AC_MSG_RESULT(none)
681    AC_MSG_ERROR(can not use with libfac without finding or building it)
682  fi
683elif test "$with_libfac" = no; then
684  AC_MSG_RESULT(no)
685elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
686  AC_MSG_RESULT(yes)
687  ac_configure_args="$ac_configure_args --with-libfac"
688else
689  AC_MSG_RESULT(no)
690  ac_configure_args="$ac_configure_args --without-libfac"
691fi
692
693
694AC_MSG_CHECKING(whether to use with mtrack)
695if test "$with_mtrack" != no && test "$with_mtrack" != yes; then
696  if test "$enable_mtrack" = yes; then
697    with_mtrack=yes
698  else
699    with_mtrack=no
700  fi
701  ac_configure_args="$ac_configure_args --with-mtrack=$with_mtrack"
702elif test "$with_mtrack" = yes && test "$enable_mtrack" != yes; then
703  with_mtrack=no
704  ac_configure_args="$ac_configure_args --with-mtrack=no"
705fi
706if test "$with_mtrack" != yes; then
707  AC_MSG_RESULT(no)
708else
709  AC_MSG_RESULT(yes)
710fi
711
712
713AC_MSG_CHECKING(whether to use with Singular)
714if test "$with_Singular" != no && test "$with_Singular" != yes; then
715  if test "$enable_Singular" = yes; then
716    with_Singular=yes
717  else
718    with_Singular=no
719  fi
720  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
721fi
722
723if test "$with_Singular" != no; then
724  AC_MSG_RESULT(yes)
725else
726  AC_MSG_RESULT(no)
727fi
728
729
730dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
731dnl Check for known subdirs
732dnl
733SUBDIRS=""
734if test -d smallgmp; then
735  SUBDIRS="$SUBDIRS smallgmp"
736fi
737if test -d gmp; then
738  SUBDIRS="$SUBDIRS gmp"
739fi
740if test -d MP; then
741  SUBDIRS="$SUBDIRS MP"
742fi
743if test -d factory; then
744  SUBDIRS="$SUBDIRS factory"
745fi
746if test -d libfac; then
747  SUBDIRS="$SUBDIRS libfac"
748fi
749if test -d mpr; then
750  SUBDIRS="$SUBDIRS mpr"
751fi
752if test -d sgroup; then
753  SUBDIRS="$SUBDIRS sgroup"
754fi
755if test -d Singular; then
756  SUBDIRS="$SUBDIRS Singular"
757fi
758if test -d Texinfo; then
759  SUBDIRS="$SUBDIRS Texinfo"
760fi
761if test -d Texi2html; then
762  SUBDIRS="$SUBDIRS Texi2html"
763fi
764if test -d doc; then
765  SUBDIRS="$SUBDIRS doc"
766fi
767if test -d emacs; then
768  SUBDIRS="$SUBDIRS emacs"
769fi
770if test -d rpm; then
771  SUBDIRS="$SUBDIRS rpm"
772fi
773 
774
775
776dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
777dnl Enough -- wrap it up
778dnl
779AC_PROG_MAKE_SET
780AC_SUBST(SUBDIRS)
781AC_SUBST(BUILD_SUBDIRS)
782AC_SUBST(CONFIG_SUBDIRS)
783AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
784
785AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.