source: git/configure.in @ 8c8a76

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