source: git/configure.in @ c284ce

spielwiese
Last change on this file since c284ce was c30f2eb, checked in by Kai Krüger <krueger@…>, 24 years ago
Added generation of makefile in module/modgen git-svn-id: file:///usr/local/Singular/svn/trunk@4059 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 22.3 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
24
25pwd=`pwd`
26
27dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
28dnl determine singuname
29dnl
30AC_MSG_CHECKING(uname for singular)
31AC_CACHE_VAL(ac_cv_singuname,
32ac_cv_singuname="unknown"
33if test -r "singuname.sh"; then
34  if (/bin/sh singuname.sh >/dev/null 2>&1) then
35    ac_cv_singuname=`/bin/sh singuname.sh`
36  fi
37fi
38)
39AC_MSG_RESULT($ac_cv_singuname)
40if test "$ac_cv_singuname" = unknown; then
41  AC_MSG_ERROR(Unknown architecture: Check singuname.sh)
42else
43  SINGUNAME=$ac_cv_singuname
44  AC_SUBST(SINGUNAME)
45fi
46
47SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
48AC_SUBST(SING_UNAME)
49
50VERSION_SEP="-"
51
52dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
53dnl Version business --  set these here
54dnl
55# make them to env variables
56# pass them indirectly to subsequent configures
57SINGULAR_MAJOR_VERSION=1
58SINGULAR_MINOR_VERSION=3
59SINGULAR_SUB_VERSION=7
60SINGULAR_SHORT_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}"
61SINGULAR_VERSION="${SINGULAR_SHORT_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
62VERSION_DATE="December 1999"
63
64export SINGULAR_MINOR_VERSION
65export SINGULAR_MAJOR_VERSION
66export SINGULAR_SUB_VERSION
67export SINGULAR_VERSION
68export VERSION_DATE
69
70dnl substitue them into the Makefiles
71AC_SUBST(SINGULAR_VERSION)
72AC_SUBST(VERSION_DATE)
73AC_SUBST(SINGULAR_SHORT_VERSION)
74
75dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
76dnl Those are needed to check for libs and headers, later on
77dnl
78AC_PROG_CC
79AC_PROG_CPP
80AC_PROG_INSTALL
81AC_AIX
82
83AC_CHECK_PROGS(PERL, perl5 perl)
84AC_CHECK_PROGS(GUNZIP, gunzip,  ${pwd}/warn_not_found.sh gunzip)
85# don't use GZIP this breaks configure
86AC_CHECK_PROGS(MYGZIP, gzip, ${pwd}/warn_not_found.sh gzip)
87AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
88AC_PROG_LN_S
89if test -d Texi2html; then
90if test -r ${T2H_HOME}/texi2html.init; then
91TEXI2HTML=`pwd`/Texi2html/texi2html.pl
92else
93TEXI2HTML=`pwd`/Texi2html/texi2html
94fi
95AC_SUBST(TEXI2HTML)
96else
97AC_MSG_WARN(could not find Texi2html/texi2html HTML generation might fail)
98AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
99fi
100if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
101  TEXI2HTML_OPTS="-l2h"
102fi
103AC_SUBST(TEXI2HTML_OPTS)
104
105dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
106dnl Set exec_prefix, bindir, libdir, includedir to some sensible values
107dnl
108# expand prefix and pass it to subsequent configures
109if test "x$prefix" = xNONE; then
110  prefix=${ac_default_prefix}
111  ac_configure_args="$ac_configure_args --prefix=${prefix}"
112fi
113
114# expand exec_prefix
115if test "x$exec_prefix" = xNONE; then
116 exec_prefix=${prefix}/${ac_cv_singuname}
117 ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}"
118fi
119
120# expand bindir
121if test "x$bindir" = 'x${exec_prefix}/bin'; then
122  bindir="${exec_prefix}"
123  ac_configure_args="$ac_configure_args --bindir=${bindir}"
124fi
125
126# expand libdir
127if test "x$libdir" = 'x${exec_prefix}/lib'; then
128  libdir="${exec_prefix}/lib"
129  ac_configure_args="$ac_configure_args --libdir=${libdir}"
130fi
131
132# expand includedir
133if test "x$includedir" = 'x${prefix}/include'; then
134  includedir="${exec_prefix}/include"
135  ac_configure_args="$ac_configure_args --includedir=${includedir}"
136fi
137
138# construct name of installed Singular executable
139SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}
140export SINGULAR
141AC_SUBST(SINGULAR)
142
143dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
144dnl Check for various libraries and headers
145dnl
146dnl After this part, the variables 'ac_<package>_ok' is 'yes'
147dnl if '<package>' is already existent on the system, otherwise
148dnl undefined.
149dnl
150
151# add -I to CPPFLAGS and -L to LDFLAGS, just to be sure
152LDFLAGS="-L${libdir} ${LDFLAGS}"
153CPPFLAGS="-I${includedir} ${CPPFLAGS}"
154
155# check for AIX
156AC_MSG_CHECKING(whether _AIX is defined)
157AC_CACHE_VAL(ac_cv_is_aix,
158AC_EGREP_CPP(yes,
159[#ifdef _AIX
160    yes
161#endif
162], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
163if test "$ac_cv_is_aix" = yes; then
164  AC_MSG_RESULT(yes)
165else
166  AC_MSG_RESULT(no)
167fi
168
169AC_CHECK_LIB(m, atof)
170AC_CHECK_LIB(bsd, socket)
171AC_CHECK_LIB(socket, listen)
172AC_CHECK_LIB(nsl, gethostbyname)
173AC_CHECK_LIB(gmp, mpq_init)
174AC_CHECK_LIB(smallgmp, mpz_init)
175AC_CHECK_LIB(MP, IMP_PutGmpInt)
176AC_CHECK_LIB(MPT, MPT_GetTree)
177AC_CHECK_LIB(singcf, atof)
178AC_CHECK_LIB(singfac, atof)
179
180AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h)
181
182if test "$ac_cv_lib_gmp_mpq_init" = yes && \
183 test "$ac_cv_header_gmp_h" = yes; then
184  ac_gmp_ok=yes
185fi
186
187if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \
188 test "$ac_cv_header_smallgmp_h" = yes && \
189 test "$ac_cv_header_gmp_h" = yes; then
190  ac_smallgmp_ok=yes
191fi
192
193if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
194 test "$ac_cv_lib_MPT_MPT_GetTree" && \
195 test "$ac_cv_header_MP_h" = yes && \
196 test "$ac_cv_header_MPT_h" = yes; then
197  ac_MP_ok=yes
198fi
199
200if test "$ac_cv_lib_singcf_atof" = yes && \
201 test "$ac_cv_header_factory_h" = yes; then
202  ac_factory_ok=yes
203fi
204
205if test "$ac_cv_lib_singfac_atof" = yes && \
206 test "$ac_cv_header_factor_h" = yes; then
207  ac_libfac_ok=yes
208fi
209
210 
211dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
212dnl Check command line arguments
213dnl
214AC_ARG_WITH(tmpdir, \
215 [ --with-tmpdir=DIR       use DIR as temporary directory])
216AC_ARG_WITH(
217  perl5,
218  [  --with-perl5=[PERL5,no] uses PERL5 as perl5 program, default is perl5])
219AC_ARG_ENABLE(smallgmp, \
220 [ --enable-PACKAGE        configure and/or build PACKAGE
221  --disable-PACKAGE       do not configure and/or build PACKAGE
222   where PACKAGE can be:
223     smallgmp             minimal version of gmp written in C only])
224AC_ARG_ENABLE(gmp, \
225 [    gmp                  Gnu Multiple Precision package])
226AC_ARG_ENABLE(MP, \
227 [    MP                   Multi Protocol library])
228AC_ARG_ENABLE(factory, \
229 [    factory              polynomial factorization library])
230AC_ARG_ENABLE(libfac, \
231 [    libfac               char set and modp poly factorization library])
232AC_ARG_ENABLE(sgroup, \
233 [    sgroup               numerical semigroup computations])
234AC_ARG_ENABLE(mtrack, \
235 [    mtrack               utility to track unused memory])
236AC_ARG_ENABLE(Singular, \
237 [    Singular             CAS for Polynomial Computations])
238AC_ARG_ENABLE(Texinfo, \
239 [    Texinfo              Texinfo for info, texi2dvi, makeinfo])
240AC_ARG_ENABLE(Texi2html, \
241 [    Texi2html            Texinfo to HTML converter])
242AC_ARG_ENABLE(doc, \
243 [    doc                  Singular documentation])
244AC_ARG_ENABLE(emacs, \
245 [    emacs                emacs completion files])
246AC_ARG_WITH(MP,\
247 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
248  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
249   where PACKAGE can be:
250     MP                   Multi Protocol library])
251AC_ARG_WITH(factory, \
252 [    factory              polynomial factorization library])
253AC_ARG_WITH(libfac, \
254 [    libfac               char set and modp poly factorization library])
255AC_ARG_WITH(mtrack, \
256 [    mtrack               utility to track unused memory])
257AC_ARG_WITH(gmp, \
258 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
259                          where PACKAGE can be gmp or smallgmp
260All additional --enable and --with options are passed to subsequent calls
261to configure of the packages to be built. See also configure --help in
262these packages (resp. subdirs). ])
263
264dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
265dnl Check what to use as tmp dir
266dnl
267AC_MSG_CHECKING(which tmp dir to use)
268if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
269  if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
270  then
271    TMP_DIR="${pwd}/tmp"
272  else
273    TMP_DIR=${with_tmpdir}
274  fi
275else
276  TMP_DIR="${pwd}/tmp"
277fi
278AC_MSG_RESULT($TMP_DIR)
279AC_SUBST(TMP_DIR)
280
281dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
282dnl Check for perl 5
283dnl
284# perl version 5
285if test "${with_perl5+set}" != set; then
286  AC_MSG_CHECKING(for perl5)
287  changequote(<<,>>)dnl
288  AC_CACHE_VAL(ac_cv_prog_perl5,
289  if (perl5 -v >/dev/null 2>&1)
290  then
291   if (perl5 -v | egrep "version 5\.[0-9]" >/dev/null 2>&1 )
292    then
293    ac_cv_prog_perl5=perl5
294   fi
295  elif (perl -v >/dev/null 2>&1)
296  then
297    if (perl -v | egrep "version 5\.[0-9]" >/dev/null 2>&1 )
298    then
299      ac_cv_prog_perl5=perl
300    fi
301  fi
302  )
303  changequote([,])dnl
304  if test "${ac_cv_prog_perl5+set}" = set; then
305    AC_MSG_RESULT(${ac_cv_prog_perl5})
306    PERL5=${ac_cv_prog_perl5}
307    AC_SUBST(PERL5)
308  else
309    AC_MSG_ERROR(can not find perl version 5)
310  fi
311elif test "${with_perl5}" = no; then
312  AC_MSG_WARN(building without perl5 --  make might fail)
313else
314  unset PERL5
315  unset ac_cv_prog_PERL5
316  AC_CHECK_PROGS(PERL5, ${with_perl5})
317  if test "x${PERL5}" = x; then
318    AC_MSG_WARN(building without perl5 -- make might fail)
319  fi
320fi
321
322
323dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
324dnl Check whether or not to configure and build various packages
325dnl
326
327AC_MSG_CHECKING(whether to configure and build gmp lib)
328if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
329  if test "$ac_gmp_ok" != yes && test -d gmp; then
330    AC_MSG_RESULT(yes)
331    enable_gmp=yes
332    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
333    ac_configure_args="$ac_configure_args --enable-gmp"
334    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
335  else
336    AC_MSG_RESULT(no)
337    enable_gmp=no
338  fi
339elif test "$enable_gmp" = yes; then
340  if test ! -d gmp; then
341    AC_MSG_RESULT(no)
342    AC_MSG_ERROR(Can not find gmp subdir)
343  else
344    AC_MSG_RESULT(yes)
345    CONFIG_SUBDIRS="$CONFIG_SUBDIRS gmp"
346    OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES gmp/Makefile.in"
347  fi
348else
349  AC_MSG_RESULT(no)
350fi
351
352AC_MSG_CHECKING(whether to configure and build smallgmp lib)
353if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
354  if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
355     test "$enable_gmp" != yes && test -d smallgmp; then
356    AC_MSG_RESULT(yes)
357    enable_smallgmp=yes
358    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
359    ac_configure_args="$ac_configure_args --enable-smallgmp --enable-gmp"
360  else
361    AC_MSG_RESULT(no)
362    enable_smallgmp=no
363  fi
364elif test "$enable_smallgmp" = yes; then
365  if test ! -d smallgmp; then
366    AC_MSG_RESULT(no)
367    AC_MSG_ERROR(Can not find smallgmp subdir)
368  else
369    AC_MSG_RESULT(yes)
370    CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
371    if test "$ac_gmp_ok" != yes && test "$enable_gmp" != yes; then
372      ac_configure_args="$ac_configure_args --enable-gmp"
373    fi
374  fi
375else
376  AC_MSG_RESULT(${enable_smallgmp})
377fi
378
379# Check whether we have at least one of smallgmp or gmp
380if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
381   test "$enable_smallgmp" != yes && test "$enable_gmp" != yes; then
382  AC_MSG_ERROR(can neither find nor built gmp or smallgmp)
383fi
384
385# Check whether we need to cheat subsequent configures with --enable-gmp
386if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes; then
387  ac_configure_args="$ac_configure_args --enable-gmp"
388fi
389
390AC_MSG_CHECKING(whether to configure and build MP lib)
391if test "$enable_MP" != yes && test "$enable_MP" != no; then
392  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
393     (test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes); then
394    AC_MSG_RESULT(yes)
395    enable_MP=yes
396    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
397    ac_configure_args="$ac_configure_args --enable-MP"
398  else
399    AC_MSG_RESULT(no)
400    enable_MP=no
401  fi
402elif test "$enable_MP" = yes; then
403  if test ! -d MP; then
404    AC_MSG_RESULT(no)
405    AC_MSG_ERROR(can not build MP without MP directory)
406  fi
407  if test "$enable_gmp" = yes || test "$ac_gmp_ok" = yes; then
408    AC_MSG_RESULT(yes)
409    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
410  else
411    AC_MSG_RESULT(no)
412    AC_MSG_ERROR(can not build MP without gmp)
413  fi
414else
415  AC_MSG_RESULT(no)
416fi
417 
418AC_MSG_CHECKING(whether to configure and build factory lib)
419if test "$enable_factory" != yes && test "$enable_factory" != no; then
420  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
421     test -d factory; then
422    enable_factory=yes
423    AC_MSG_RESULT(yes)
424    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
425    ac_configure_args="$ac_configure_args --enable-factory"
426  else
427    enable_factory=no
428    AC_MSG_RESULT(no)
429  fi
430elif test "$enable_factory" = yes; then
431  if test -d factory; then
432    AC_MSG_RESULT(yes)
433    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
434  else
435    AC_MSG_RESULT(no)
436    AC_MSG_ERROR(can not build factory without factory directory)
437  fi
438else
439  AC_MSG_RESULT(no)
440fi
441
442AC_MSG_CHECKING(whether to configure and build libfac lib)
443if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
444  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
445     test -d libfac && \
446     (test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
447    enable_libfac=yes
448    AC_MSG_RESULT(yes)
449    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
450    ac_configure_args="$ac_configure_args --enable-libfac"
451  else
452    enable_libfac=no
453    AC_MSG_RESULT(no)
454  fi
455elif  test "$enable_libfac" = yes; then
456  if test ! -d libfac; then
457    AC_MSG_RESULT(no)
458    AC_MSG_ERROR(can not build libfac without libfac directory)
459  fi
460  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
461    AC_MSG_RESULT(yes)
462    CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
463  else
464    AC_MSG_RESULT(no)
465    AC_MSG_ERROR(Can not build libfac without factory)
466  fi
467else
468  AC_MSG_RESULT(no)
469fi
470
471AC_MSG_CHECKING(whether to configure and build sgroup lib)
472dnl
473dnl only sgroup if explicietely requested
474dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
475dnl  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
476dnl     test -d sgroup && \
477dnl     (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
478dnl    enable_sgroup=yes
479dnl    AC_MSG_RESULT(yes)
480dnl    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
481dnl    ac_configure_args="$ac_configure_args --enable-sgroup"
482dnl  else
483dnl    enable_sgroup=no
484dnl    AC_MSG_RESULT(no)
485dnl  fi
486dnl elif  test "$enable_sgroup" = yes; then
487if test "$enable_sgroup" = yes; then
488  if test ! -d sgroup; then
489    AC_MSG_RESULT(no)
490    AC_MSG_ERROR(can not build sgroup without sgroup directory)
491  fi
492  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
493    AC_MSG_RESULT(yes)
494    CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
495  else
496    AC_MSG_RESULT(no)
497    AC_MSG_ERROR(Can not build sgroup without MP)
498  fi
499else
500  AC_MSG_RESULT(no)
501fi
502
503BUILD_SUBDIRS="$CONFIG_SUBDIRS"
504
505AC_MSG_CHECKING(whether to build mpr and use mtrack)
506if test -d mpr && test "$ac_cv_singuname" = ix86-Linux && test "$enable_mtrack" != no; then
507  AC_MSG_RESULT(yes)
508  if test "$enable_mtrack" != yes; then
509     ac_configure_args="$ac_configure_args --enable-mtrack"
510  fi
511  enable_mtrack=yes
512  OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" mpr/Makefile"
513  BUILD_SUBDIRS="$BUILD_SUBDIRS mpr"
514else
515  AC_MSG_RESULT(no)
516  enable_mtrack=no
517fi
518
519AC_MSG_CHECKING(whether to configure and build Singular)
520if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
521  if test "$with_Singular" != no && test -d Singular; then
522    enable_Singular=yes
523    AC_MSG_RESULT(yes)
524    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
525    BUILD_SUBDIRS="$BUILD_SUBDIRS Singular"     
526    ac_configure_args="$ac_configure_args --enable-Singular"
527  else
528    enable_Singular=no
529    AC_MSG_RESULT(no)
530  fi
531elif test "$enable_Singular" = yes; then
532  if test -d Singular; then
533    AC_MSG_RESULT(yes)
534    CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
535    BUILD_SUBDIRS="$BUILD_SUBDIRS Singular"     
536  else
537    AC_MSG_RESULT(no)
538    AC_MSG_ERROR(can not build Singular without Singular directory)
539  fi
540else
541  AC_MSG_RESULT(no)
542fi
543
544AC_MSG_CHECKING(whether to configure and build Texinfo)
545if test "$enable_Texinfo" != no && test -d Texinfo; then
546  AC_MSG_RESULT(yes)
547  enable_texinfo=yes
548  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
549  BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"       
550  TEXI2DVI=${bindir}/texi2dvi
551  MAKEINFO="${bindir}/makeinfo --force"
552  TEXINDEX=${bindir}/texindex
553  AC_SUBST(TEXI2DVI)
554  AC_SUBST(MAKEINFO)
555  AC_SUBST(TEXINDEX)
556  if test "$enable_Texinfo" != yes; then
557    ac_configure_args="$ac_configure_args --enable-Texinfo"
558  fi
559else
560  AC_MSG_RESULT(no)
561  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
562  enable_texinfo=no
563  AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
564  AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, ${pwd}/warn_not_found.sh texi2dvi)
565  AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
566fi 
567
568
569AC_MSG_CHECKING(whether to build Texi2html)
570if test "$enable_Texi2html" != no && test -d Texi2html; then
571 AC_MSG_RESULT(yes)
572 BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
573 if test "$enable_Texi2html" != yes; then
574   ac_configure_args="$ac_configure_args --enable-Texi2html"
575 fi
576else
577 AC_MSG_RESULT(no)
578fi
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
768dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
769dnl Enough -- wrap it up
770dnl
771AC_PROG_MAKE_SET
772AC_SUBST(SUBDIRS)
773AC_SUBST(BUILD_SUBDIRS)
774AC_SUBST(CONFIG_SUBDIRS)
775AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
776
777AC_OUTPUT(${OUTPUT_MAKEFILES})
Note: See TracBrowser for help on using the repository browser.