source: git/configure.in @ 9ae4da

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