source: git/configure.in @ 70afd2

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