source: git/Singular/configure.in @ 1cb879

spielwiese
Last change on this file since 1cb879 was 1cb879, checked in by Alexander Dreyer <dreyer@…>, 13 years ago
Merge branch 'master' of git+ssh://dreyer@git.berlios.de/gitroot/singular git-svn-id: file:///usr/local/Singular/svn/trunk@13805 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 35.1 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(tesths.cc)
3AC_CONFIG_HEADER(mod2.h)
4AC_CONFIG_HEADER(../kernel/mod2.h)
5
6dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
7dnl check for python (see AC_PYTHON_DEVEL in newer autoconf versions)
8dnl
9AC_DEFUN([AC_PYTHON_DEVEL_SINGULAR],[
10        #
11        # Allow the use of a (user set) custom python version
12        #
13        PYTHON_VERSION="$1"
14        PYTHON="$2"
15
16        #
17        # Check for a version of Python >= 2.1.0
18        #
19        AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
20        ac_supports_python_ver=`$PYTHON -c "import sys, string; \
21                        ver = string.split(sys.version)[[0]]; \
22                        print ver >= '2.1.0'"`
23        if test "$ac_supports_python_ver" != "True"; then
24                if test -z "$PYTHON_NOVERSIONCHECK"; then
25                        AC_MSG_RESULT([no])
26                        AC_MSG_ERROR([
27This version of the AC@&t@_PYTHON_DEVEL macro
28doesn't work properly with versions of Python before
292.1.0. You may need to re-run configure, setting the
30variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
31PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
32Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
33to something else than an empty string.
34])
35                else
36                        AC_MSG_RESULT([skip at user request])
37                fi
38        else
39                AC_MSG_RESULT([yes])
40        fi
41
42        #
43        # if the macro parameter ``version'' is set, honour it
44        #
45        if test -n "$1"; then
46                AC_MSG_CHECKING([for a version of Python $1])
47                ac_supports_python_ver=`$PYTHON -c "import sys, string; \
48                        ver = string.split(sys.version)[[0]]; print ver $1"`
49                if test "$ac_supports_python_ver" = "True"; then
50                   AC_MSG_RESULT([yes])
51                else
52                        AC_MSG_RESULT([no])
53                        AC_MSG_ERROR([this package requires Python $1.
54If you have it installed, but it isn't the default Python
55interpreter in your system path, please pass the PYTHON_VERSION
56variable to configure. See ``configure --help'' for reference.
57])
58                        PYTHON_VERSION=""
59                fi
60        fi
61
62        #
63        # Check if you have distutils, else fail
64        #
65        AC_MSG_CHECKING([for the distutils Python package])
66        ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
67        if test -z "$ac_distutils_result"; then
68                AC_MSG_RESULT([yes])
69        else
70                AC_MSG_RESULT([no])
71                AC_MSG_ERROR([cannot import Python module "distutils".
72Please check your Python installation. The error was:
73$ac_distutils_result])
74                PYTHON_VERSION=""
75        fi
76
77        #
78        # Check for Python include path
79        #
80        AC_MSG_CHECKING([for Python include path])
81        if test -z "$PYTHON_CPPFLAGS"; then
82                python_path=`$PYTHON -c "import distutils.sysconfig; \
83                                print distutils.sysconfig.get_python_inc();"`
84                if test -n "${python_path}"; then
85                        python_path="-I$python_path"
86                fi
87                PYTHON_CPPFLAGS=$python_path
88        fi
89        AC_MSG_RESULT([$PYTHON_CPPFLAGS])
90        AC_SUBST([PYTHON_CPPFLAGS])
91
92        #
93        # Check for Python library path
94        #
95        AC_MSG_CHECKING([for Python library path])
96        if test -z "$PYTHON_LDFLAGS"; then
97                # (makes two attempts to ensure we've got a version number
98                # from the interpreter)
99                py_version=`$PYTHON -c "from distutils.sysconfig import *; \
100                        from string import join; \
101                        print join(get_config_vars('VERSION'))"`
102                if test "$py_version" == "[None]"; then
103                        if test -n "$PYTHON_VERSION"; then
104                                py_version=$PYTHON_VERSION
105                        else
106                                py_version=`$PYTHON -c "import sys; \
107                                        print sys.version[[:3]]"`
108                        fi
109                fi
110
111                PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
112                        from string import join; \
113                        from os import path; \
114                        print '-L' + get_python_lib(0,1), \
115                        '-L' + path.dirname(get_python_lib(0,1)), \
116                        '-lpython';"`$py_version
117        fi
118        AC_MSG_RESULT([$PYTHON_LDFLAGS])
119        AC_SUBST([PYTHON_LDFLAGS])
120
121        #
122        # Check for site packages
123        #
124        AC_MSG_CHECKING([for Python site-packages path])
125        if test -z "$PYTHON_SITE_PKG"; then
126                PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
127print distutils.sysconfig.get_python_lib(0,0);"`
128        fi
129        AC_MSG_RESULT([$PYTHON_SITE_PKG])
130        AC_SUBST([PYTHON_SITE_PKG])
131
132        #
133        # libraries which must be linked in when embedding
134        #
135        AC_MSG_CHECKING(python extra libraries)
136        if test -z "$PYTHON_EXTRA_LIBS"; then
137           PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
138conf = distutils.sysconfig.get_config_var; \
139print conf('LOCALMODLIBS'), conf('LIBS')"`
140        fi
141        AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
142        AC_SUBST(PYTHON_EXTRA_LIBS)
143
144        #
145        # linking flags needed when embedding
146        #
147        AC_MSG_CHECKING(python extra linking flags)
148        if test -z "$PYTHON_EXTRA_LDFLAGS"; then
149                PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
150                        conf = distutils.sysconfig.get_config_var; \
151                        print conf('LINKFORSHARED')"`
152        fi
153        AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
154        AC_SUBST(PYTHON_EXTRA_LDFLAGS)
155
156        #
157        # final check to see if everything compiles alright
158        #
159        AC_MSG_CHECKING([consistency of all components of python development environment])
160#       AC_LANG_PUSH([C])
161        # save current global flags
162        ac_save_LIBS_for_python="${LIBS}"
163        LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
164        ac_save_CPPFLAGS_for_python="${CPPFLAGS}"
165        CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
166        AC_TRY_LINK([
167                #include <Python.h>
168        ],[
169                Py_Initialize();
170        ],[pythonexists=yes],[pythonexists=no])
171
172        AC_MSG_RESULT([$pythonexists])
173
174        if test ! "$pythonexists" = "yes"; then
175           AC_MSG_ERROR([
176  Could not link test program to Python. Maybe the main Python library has been
177  installed in some non-standard library path. If so, pass it to configure,
178  via the LDFLAGS environment variable.
179  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
180  ============================================================================
181   ERROR!
182   You probably have to install the development version of the Python package
183   for your distribution.  The exact name of this package varies among them.
184  ============================================================================
185           ])
186          PYTHON_VERSION=""
187        else
188          AC_DEFINE(HAVE_PYTHON)
189          HAVE_PYTHON_VALUE=1
190          AC_SUBST(HAVE_PYTHON_VALUE)     
191        fi
192#       AC_LANG_POP
193        # turn back to default flags
194        CPPFLAGS="$ac_save_CPPFLAGS_for_python"
195        LIBS="$ac_save_LIBS_for_python"
196
197        #
198        # all done!
199        #
200])
201
202
203dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
204dnl determine singuname
205dnl
206
207AC_MSG_CHECKING(CPU for singular)
208ac_cv_singcpuname=`uname -m`
209AC_MSG_RESULT($ac_cv_singcpuname)
210
211AC_MSG_CHECKING(uname for singular)
212AC_CACHE_VAL(ac_cv_singuname,
213ac_cv_singuname="unknown"
214if test -r "singuname.sh"; then
215  if (/bin/sh singuname.sh >/dev/null 2>&1) then
216    ac_cv_singuname=`/bin/sh singuname.sh`
217  fi
218fi
219if test "$ac_cv_singuname" = unknown && test -r "../singuname.sh"; then
220  if (/bin/sh ../singuname.sh >/dev/null 2>&1) then
221    ac_cv_singuname=`/bin/sh ../singuname.sh`
222  fi
223fi
224)
225AC_MSG_RESULT($ac_cv_singuname)
226if test "$ac_cv_singuname" = unknown; then
227  AC_MSG_WARN(Unknown architecture: Check singuname.sh)
228  ac_cv_singuname="unknown"
229fi
230AC_DEFINE_UNQUOTED(S_UNAME, "$ac_cv_singuname")
231SINGUNAME=$ac_cv_singuname
232AC_SUBST(SINGUNAME)
233
234if test "$ac_cv_singuname" = ix86-Win; then
235  EXEC_EXT=".exe"
236  AC_DEFINE(SI_CPU_I386)
237  AC_SUBST(SI_CPU_I386)
238  AC_MSG_RESULT(SI_CPU_I386)
239fi
240AC_SUBST(EXEC_EXT)
241if test "$ac_cv_singuname" = x86_64-Linux; then
242  AC_DEFINE(SI_CPU_X86_64)
243  AC_SUBST(SI_CPU_X86_64)
244  AC_MSG_RESULT(SI_CPU_X86_64)
245fi
246if test "$ac_cv_singuname" = ix86-Linux; then
247  AC_DEFINE(SI_CPU_I386)
248  AC_SUBST(SI_CPU_I386)
249  AC_MSG_RESULT(SI_CPU_I386)
250fi
251if test "$ac_cv_singuname" = IA64-Linux; then
252  AC_DEFINE(SI_CPU_IA64)
253  AC_SUBST(SI_CPU_IA64)
254  AC_MSG_RESULT(SI_CPU_IA64)
255fi
256if test "$ac_cv_singuname" = ppc-Linux; then
257  AC_DEFINE(SI_CPU_PPC)
258  AC_SUBST(SI_CPU_PPC)
259  AC_MSG_RESULT(SI_CPU_PPC)
260fi
261if test "$ac_cv_singuname" = ppcMac-darwin; then
262  AC_DEFINE(SI_CPU_PPC)
263  AC_SUBST(SI_CPU_PPC)
264  AC_MSG_RESULT(SI_CPU_PPC)
265fi
266# test again with CPU names
267if test "$ac_cv_singcpuname" = i386; then
268  AC_DEFINE(SI_CPU_I386)
269  AC_SUBST(SI_CPU_I386)
270  AC_MSG_RESULT(SI_CPU_I386)
271fi
272if test "$ac_cv_singcpuname" = i686; then
273  AC_DEFINE(SI_CPU_I386)
274  AC_SUBST(SI_CPU_I386)
275  AC_MSG_RESULT(SI_CPU_I386)
276fi
277if test "$ac_cv_singcpuname" = x86_64; then
278  AC_DEFINE(SI_CPU_X86_64)
279  AC_SUBST(SI_CPU_X86_64)
280  AC_MSG_RESULT(SI_CPU_X86_64)
281fi
282if test "$ac_cv_singcpuname" = ia64; then
283  AC_DEFINE(SI_CPU_IA64)
284  AC_SUBST(SI_CPU_IA64)
285  AC_MSG_RESULT(SI_CPU_IA64)
286fi
287if test "$ac_cv_singcpuname" = sparc; then
288  AC_DEFINE(SI_CPU_SPARC)
289  AC_SUBST(SI_CPU_SPARC)
290  AC_MSG_RESULT(SI_CPU_SPARC)
291fi
292if test "$ac_cv_singcpuname" = ppc; then
293  AC_DEFINE(SI_CPU_PPC)
294  AC_SUBST(SI_CPU_PPC)
295  AC_MSG_RESULT(SI_CPU_PPC)
296fi
297
298SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
299AC_SUBST(SING_UNAME)
300
301# stupid Win programs do not like dots in their pathnames
302VERSION_SEP="-"
303
304dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
305dnl version stuff -- should be set in ../configure.in
306dnl
307dnl here are some defaults
308
309SINGULAR_MAJOR_VERSION=${SINGULAR_MAJOR_VERSION:-3}
310SINGULAR_MINOR_VERSION=${SINGULAR_MINOR_VERSION:-1}
311SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-2}
312SINGULAR_VERSION="${SINGULAR_VERSION:-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}"
313VERSION_DATE=${VERSION_DATE:-"Oct 2010"}
314
315dnl pass them on into the Makefiles
316AC_SUBST(SINGULAR_VERSION)
317AC_SUBST(VERSION_DATE)
318AC_SUBST(SINGULAR_MAJOR_VERSION)
319AC_SUBST(SINGULAR_MINOR_VERSION)
320AC_SUBST(SINGULAR_SUB_VERSION)
321AC_DEFINE_UNQUOTED(SINGULAR_MAJOR_VERSION, ${SINGULAR_MAJOR_VERSION})
322AC_DEFINE_UNQUOTED(SINGULAR_MINOR_VERSION, ${SINGULAR_MINOR_VERSION})
323AC_DEFINE_UNQUOTED(SINGULAR_SUB_VERSION, ${SINGULAR_SUB_VERSION})
324AC_DEFINE_UNQUOTED(S_VERSION1, "${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}")
325AC_DEFINE_UNQUOTED(S_VERSION2, "${VERSION_DATE}")
326AC_DEFINE_UNQUOTED(SINGULAR_SUB_VERSION, ${SINGULAR_SUB_VERSION})
327
328
329dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
330dnl compiler stuff
331dnl is needed to check for libs and headers, later on
332dnl
333dnl we do not want to have "-g -O" for CFLAGS
334if test "${CXXFLAGS+set}" != set; then
335  ac_cxxflags_set=no
336  CXXFLAGS="-O"
337fi
338if test "${CFLAGS+set}" != set; then
339  CFLAGS="-O"
340  ac_cflags_set=no
341fi
342
343# check whether CXX was set by user as env variable
344if test "${CXX+set}" != set; then
345  ac_cxx_set=no
346else
347  ac_cxx_set=yes
348fi
349AC_PROG_CC
350AC_PROG_CPP
351AC_PROG_CXX
352AC_PROG_INSTALL
353AC_AIX
354
355# test for gcc-version: gcc2: prefer CC=gcc, CXX=gcc (if not with boost)
356#                       gcc3:        CC=gcc  CXX=g++
357#                       other:       CC=cc   CXX=c++
358AC_MSG_CHECKING(gcc version)
359AC_CACHE_VAL(ac_cv_c_cpp,
360ac_cv_c_cp="unknown"
361if test -r "gccversion.sh"; then
362  ac_cv_c_cpp=`/bin/sh gccversion.sh`
363fi
364)
365AC_MSG_RESULT($ac_cv_c_cpp)
366
367# we prefer using gcc for compiling C++ files, provided the user did
368# not overwrite it explicitely
369if test "${GXX}" = yes && test "${ac_cxx_set}" = no; then
370  if test "${ac_cv_c_cpp}" = gcc2; then
371    CXX=g++
372  elif test "${ac_cv_c_cpp}" = gcc3; then
373    CXX=g++
374  fi
375  temp_flags="${CXXFLAGS}"
376  AC_LANG_SAVE
377  AC_LANG_CPLUSPLUS
378  # check whether gcc accepts --no-rtti
379  AC_MSG_CHECKING(whether gcc accepts --no-rtti)
380  CXXFLAGS="${CXXFLAGS} --no-rtti"
381  AC_CACHE_VAL(ac_cv_cxx_have_rtti,
382    AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
383  )
384  AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
385  if test "${ac_cv_cxx_have_rtti}" != yes; then
386    CXXFLAGS="$temp_flags"
387  else
388    CXXFLAGS="${temp_flags} --no-rtti"
389    temp_flags="${CXXFLAGS}"
390  fi
391
392# check whether gcc accepts --no-exceptions
393  AC_MSG_CHECKING(whether gcc accepts --no-exceptions)
394  CXXFLAGS="${CXXFLAGS} --no-exceptions"
395  AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
396    AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
397  )
398  AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
399  if test "${ac_cv_cxx_have_exceptions}" != yes; then
400    CXXFLAGS="$temp_flags"
401  else
402    CXXFLAGS="${temp_flags} --no-exceptions"
403    temp_flags="${CXXFLAGS}"
404  fi
405
406  AC_LANG_RESTORE
407  CXXFLAGS="$temp_flags"
408  #here is broking something
409  #uncommented breaks CXXFLAGS variable set
410  #only pipes would remain then in CXXFLAGS
411fi
412
413# check whether the compiler accepts -pipe
414if test x$ac_cv_c_cpp = xgcc2 -o  x$ac_cv_c_cpp = xgcc3
415then
416  AC_MSG_CHECKING(whether compiler accepts -pipe)
417  temp_cflags="${CFLAGS}"
418  CFLAGS="${CFLAGS} -pipe"
419  AC_CACHE_VAL(ac_cv_cxx_have_pipe,
420  AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no))
421  AC_MSG_RESULT(${ac_cv_cxx_have_pipe})
422  CFLAGS=${temp_cflags}
423else
424  ac_cv_cxx_have_pipe="no"
425fi
426
427if test "${ac_cv_cxx_have_pipe}" != yes; then
428  PIPE=
429else
430  PIPE="-pipe"
431fi
432AC_SUBST(PIPE)
433
434# Customize CFLAGS
435AC_MSG_CHECKING(whether _AIX is defined)
436AC_CACHE_VAL(ac_cv_is_aix,
437AC_EGREP_CPP(yes,
438[#ifdef _AIX
439    yes
440#endif
441], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
442if test "$ac_cv_is_aix" = yes; then
443  AC_MSG_RESULT(yes)
444else
445  AC_MSG_RESULT(no)
446fi
447
448# we know best when compiling with gcc
449if test "${GXX}" = yes; then
450  if test "$ac_cxxflags_set" = no; then
451    CXXFLAGS="-O3 -w -fomit-frame-pointer"
452  fi
453  temp_flags="${CXXFLAGS}"
454  if test "${ac_cv_cxx_have_rtti}" = yes; then
455    CXXFLAGS="${temp_flags} --no-rtti"
456  fi
457  temp_flags="${CXXFLAGS}"
458  CXXTEMPLFLAGS="-fno-implicit-templates"
459  if test "${ac_cv_cxx_have_exceptions}" = yes; then
460    CXXTEMPLFLAGS="${CXXTEMPLFLAGS} --no-exceptions"
461  fi
462  if test "$ac_cv_is_aix" = yes; then
463    CXXNOOPTFLAGS="-w"
464  else
465    CXXNOOPTFLAGS=$CXXFLAGS
466  fi
467  STATIC_LDFLAGS="-static"
468else
469  CXXTEMPFLAGS=""
470  CXXNOOPTFLAGS=$CXXFLAGS
471  STATIC_LDFLAGS=""
472fi
473AC_SUBST(CXXTEMPLFLAGS)
474AC_SUBST(CXXNOOPTFLAGS)
475AC_SUBST(STATIC_LDFLAGS)
476
477if test "${GCC}" = yes && test "$ac_cflags_set" = no ; then
478  CFLAGS="-O3 -w -fomit-frame-pointer"
479fi
480
481AC_PROG_MAKE_SET
482
483dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
484dnl path stuff
485dnl
486AC_PREFIX_DEFAULT(`pwd`/..)
487
488dnl set exec_prefix, bindir, libdir, includedir to some sensible values
489dnl if they are not yet already set
490
491# expand prefix
492test "x$prefix" = xNONE && prefix=$ac_default_prefix
493if test "${with_rootdir+set}" != set; then
494  AC_DEFINE_UNQUOTED(S_ROOT_DIR, "${prefix}")
495else
496  AC_DEFINE_UNQUOTED(S_ROOT_DIR, "${with_rootdir}")
497fi
498
499# expand exec_prefixad
500if test "x$exec_prefix" = xNONE; then
501 exec_prefix=${prefix}/${ac_cv_singuname}
502fi
503
504# expand bindir
505test "x$bindir" = 'x${exec_prefix}/bin' && bindir="${exec_prefix}"
506SINGULAR=${SINGULAR:-$bindir/Singular-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}
507AC_SUBST(SINGULAR)
508AC_DEFINE_UNQUOTED(S_BIN_DIR, "${bindir}")
509
510# expand libdir
511test "x$libdir" = 'x${exec_prefix}/lib'&& libdir="${exec_prefix}/lib"
512
513# expand includedir
514test "x$includedir" = 'x${prefix}/include' && includedir="${exec_prefix}/include"
515
516# add to -I to CPPFLAGS and and -L to LDFLAGS, just to be sure
517if test "$ac_cv_c_cpp" = gcc3 ; then
518  LDFLAGS="-L${libdir} ${LDFLAGS}"
519  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
520else
521  LDFLAGS="-L${libdir} ${LDFLAGS} -L/usr/local/lib"
522  CPPFLAGS="-I${includedir} ${CPPFLAGS} -I/usr/local/include"
523fi
524
525# this is a work-around to include the right term.h
526if test "$ac_cv_singuname" = SunOS-5; then
527CPPFLAGS="-I/usr/xpg4/include ${CPPFLAGS}"
528fi
529
530
531dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
532dnl Checks for programs.
533dnl
534
535# lex
536if test "${with_lex+set}" != set; then
537  AC_MSG_CHECKING(for flex)
538  changequote(<<,>>)dnl
539  cmd="egrep [2-9]\.[5-9]"
540  changequote([,])dnl
541  AC_CACHE_VAL(ac_cv_prog_flex,
542  if (flex --version >/dev/null 2>&1)
543    then
544    if (flex --version | $cmd >/dev/null 2>&1 )
545    then
546        ac_cv_prog_flex=flex
547    fi
548  fi
549  )
550  dnl changequote([,])dnl
551  if test "${ac_cv_prog_flex+set}" = set; then
552    AC_MSG_RESULT(flex)
553    LEX=flex
554    AC_SUBST(LEX)
555  else
556    AC_MSG_WARN(can not find flex with version 2.4.5-2.5.4)
557  fi
558elif test "${with_lex}" = no; then
559  AC_MSG_WARN(building without lex -- make might fail)
560else
561  unset LEX
562  unset ac_cv_prog_LEX
563  AC_CHECK_PROGS(LEX, ${with_lex})
564  if test "x${LEX}" = x; then
565    AC_MSG_WARN(building without lex -- make might fail)
566  fi
567fi
568
569# bison
570AC_CHECK_PROGS(BISON, bison)
571if test "${BISON+set}" != set; then
572  AC_MSG_WARN(did not find bison -- make might fail)
573fi
574
575# ln -s
576AC_PROG_LN_S
577
578AC_CHECK_PROGS(PERL, perl5 perl)
579
580# python
581if test "${with_python+set}" != set; then
582dnl Default value here!
583  PYTHON_EXE="no"
584else
585  if test "${with_python}" = yes; then
586    PYTHON_EXE="python"
587  else
588    PYTHON_EXE="${with_python}"
589  fi
590fi
591
592if test "${PYTHON_EXE}" = no; then
593  AC_MSG_WARN(building without python support)
594else
595  AC_PATH_PROG([PYTHON],[$PYTHON_EXE])
596  if test -z "$PYTHON"; then
597    AC_MSG_WARN([Cannot find $PYTHON_EXE in your system path - skipping python support])
598  else
599    AC_PYTHON_DEVEL_SINGULAR(>= '2.4', "${PYTHON}")
600  fi
601fi
602
603dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
604dnl check for general libraries, header files, typedefs, etc
605dnl
606# lib checks
607# under cygwin, we should not explicitly link with -lm, except for
608# it really is the last thing to link with
609if test "$ac_cv_singuname" != ix86-Win; then
610AC_CHECK_LIB(m, atof)
611fi
612AC_CHECK_LIB(nsl)
613AC_CHECK_LIB(socket)
614SAVE_LIBS=${LIBS}
615LIBS=
616
617dnl I'm not sure what they are for
618AC_CHECK_LIB(bsd, setenv)
619dnl i386-SunOS needs nsl and socket
620AC_CHECK_LIB(socket, listen)
621AC_CHECK_LIB(nsl, gethostbyname)
622dnl AC_CHECK_LIB(ucb, index)
623MP_LIBS=${LIBS}
624# check for dl lib
625case "$ac_cv_singuname" in
626        HPUX*)
627          AC_CHECK_LIB(dld, shl_load)
628          if test "$ac_cv_lib_dld_shl_load" = yes; then
629                LD_DYN_FLAGS="-ldld -Xlinker -E"
630                SFLAGS="-fpic -fPIC -DPIC"
631                SLDFLAGS="-fPIC -DPIC -shared"
632                if test "${LD+set}" != set; then
633                  LD=gcc
634                fi
635                ac_lib_dl=yes
636          fi
637        ;;
638        *Linux*)
639          AC_CHECK_LIB(dl, dlopen)
640          if test "$ac_cv_lib_dl_dlopen" = yes; then
641                LD_DYN_FLAGS="-ldl -rdynamic"
642                SFLAGS="-fpic -DPIC"
643                SLDFLAGS=-shared
644                if test "${LD+set}" != set; then
645                  LD=ld
646                fi
647                ac_lib_dl=yes
648          fi
649        ;;
650        IRIX-6)
651          LD_DYN_FLAGS="-lc"
652          SFLAGS="-fPIC -DPIC"
653          SLDFLAGS="-w -no_unresolved -_SYSTYPE_SVR4 -n32 -shared"
654          if test "${LD+set}" != set; then
655            LD=ld
656          fi
657          ac_lib_dl=yes
658        ;;
659        SunOS-5)
660          AC_CHECK_LIB(dl, dlopen)
661          if test "$ac_cv_lib_dl_dlopen" = yes; then
662                LD_DYN_FLAGS="-ldl"
663                SFLAGS="-fpic -DPIC"
664                SLDFLAGS=-shared
665                if test "${LD+set}" != set; then
666                  LD=$CC
667                fi
668                ac_lib_dl=yes
669          fi
670        ;;
671        #use export MACOSX_DEPLOYMENT_TARGET=10.3
672        ppcMac-darwin)
673          AC_CHECK_LIB(dl, dlopen)
674          if test "$ac_cv_lib_dl_dlopen" = yes; then
675                LD_DYN_FLAGS="-ldl -dynamic"
676                SFLAGS="-fpic -DPIC"
677                SLDFLAGS="-dynamic -twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup"
678                if test "${LD+set}" != set; then
679                  LD=libtool
680                fi
681                ac_lib_dl=yes
682          fi
683        ;;
684        ix86Mac-darwin)
685          AC_CHECK_LIB(dl, dlopen)
686          if test "$ac_cv_lib_dl_dlopen" = yes; then
687                LD_DYN_FLAGS="-ldl -dynamic"
688                SFLAGS="-fpic -DPIC"
689                SLDFLAGS="-dynamic -twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup"
690                if test "${LD+set}" != set; then
691                  LD=libtool
692                fi
693                ac_lib_dl=yes
694          fi
695        ;;
696        ix86-freebsd)
697          AC_CHECK_LIB(c, dlopen)
698          if test "$ac_cv_lib_c_dlopen" = yes; then
699                LD_DYN_FLAGS="-Xlinker -E"
700                SFLAGS="-fpic -DPIC"
701                SLDFLAGS=-shared
702                if test "${LD+set}" != set; then
703                  LD=ld
704                fi
705                ac_lib_dl=yes
706          fi
707        ;;
708esac
709AC_SUBST(LD_DYN_FLAGS)
710AC_SUBST(SFLAGS)
711AC_SUBST(SLDFLAGS)
712AC_SUBST(LD)
713LIBS="${SAVE_LIBS} ${MP_LIBS}"
714
715
716# heder file checks
717AC_HEADER_STDC
718AC_CHECK_HEADERS(limits.h unistd.h,,
719  AC_MSG_ERROR(Can not compile without limits.h unistd.h))
720
721AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/time.h sys/times.h sys/types.h \
722 sys/stat.h fcntl.h sys/param.h pwd.h asm/sigcontext.h pwd.h termcap.h \
723 termios.h term.h readline/readline.h)
724
725# typedefs, structures
726AC_C_CONST
727AC_C_INLINE
728AC_TYPE_SIZE_T
729AC_STRUCT_TM
730AC_HEADER_TIME
731
732# library functions.
733AC_FUNC_ALLOCA
734AC_PROG_GCC_TRADITIONAL
735AC_FUNC_MMAP
736AC_TYPE_SIGNAL
737AC_FUNC_VPRINTF
738AC_SEARCH_LIBS(setenv, bsd)
739AC_CHECK_FUNCS(gettimeofday atexit bcopy getcwd getwd vsnprintf readlink \
740 sleep usleep getpwnam popen setenv siginterrupt sysconf)
741
742
743dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
744dnl Find out more about particularity of the system
745dnl
746
747# arithmetic shifts
748#AC_MSG_CHECKING(whether your machine has correct arithmetic shifts)
749#AC_CACHE_VAL(ac_cv_shift, AC_TRY_RUN(
750#  [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
751#   ac_cv_shift=yes,
752#   ac_cv_shift=no,
753#   if test "$ac_c_cross_dos" = yes; then
754#     ac_cv_shift=yes;
755#   else
756#     AC_MSG_RESULT(no)
757#     AC_MSG_ERROR(cross compilation without default value)
758#   fi))
759#
760#if test "$ac_cv_shift" = yes; then
761#  AC_MSG_RESULT(yes)
762#else
763#  AC_MSG_RESULT(no)
764#  AC_MSG_ERROR(need  -2 >> 1 == -1)
765#fi
766
767
768# check for a peculiar constructor initialization
769AC_MSG_CHECKING(whether explicit C++ constructor calls are allowed)
770AC_LANG_SAVE
771AC_LANG_CPLUSPLUS
772AC_CACHE_VAL(ac_cv_explicit_const,AC_TRY_COMPILE(,
773  class testclass
774  {
775  public:
776    int value;
777    testclass() : value(0) {}
778    testclass( int i ) : value(i) {}
779    ~testclass() { value = 0; }
780  };
781
782  testclass ptr;
783  ptr.testclass(1);
784, ac_cv_explicit_const=yes, ac_cv_explicit_const=no))
785AC_LANG_RESTORE
786AC_MSG_RESULT($ac_cv_explicit_const)
787if test "$ac_cv_explicit_const" = yes; then
788  AC_DEFINE(HAVE_EXPLICIT_CONSTR)
789fi
790
791# sprintf returns number of printed chars
792AC_MSG_CHECKING(whether vsprintf returns number of printed chars)
793AC_CACHE_VAL(ac_cv_returns_n_of_chars, AC_TRY_RUN(
794 [#include <stdio.h>
795 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); }],
796   ac_cv_returns_n_of_chars=yes,
797   ac_cv_returns_n_of_chars=no,
798   ac_cv_returns_n_of_chars=no))
799if test "$ac_cv_returns_n_of_chars" = yes; then
800  AC_MSG_RESULT(yes)
801else
802  AC_MSG_RESULT(no)
803  AC_DEFINE(BSD_SPRINTF)
804fi
805
806# determine ALIGN_8
807AC_CHECK_SIZEOF(char,1)
808AC_CHECK_SIZEOF(short,2)
809AC_CHECK_SIZEOF(int,4)
810AC_CHECK_SIZEOF(long,4)
811AC_CHECK_SIZEOF(void*,4)
812AC_CHECK_SIZEOF(double, 8)
813AC_C_BIGENDIAN
814if test "$ac_cv_sizeof_int" != 4; then
815  AC_MSG_ERROR(need int to be four bytes long)
816fi
817if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then
818  AC_MSG_ERROR(need equal sizes for long and void*)
819fi
820if test "$ac_cv_sizeof_double" != 8; then
821  AC_MSG_ERROR(need double to b 8 bytes long)
822fi
823if test "$ac_cv_sizeof_voidp" != 4 && test "$ac_cv_sizeof_voidp" != 8; then
824  AC_MSG_ERROR(need void* to be 4 or 8 bytes long)
825fi
826if test "$ac_cv_sizeof_voidp" != 4; then
827  DEFS="-UOM_NDEBUG"
828  AC_SUBST(DEFS)
829fi
830
831dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
832dnl help for configure
833dnl
834AC_ARG_WITH(
835  rootdir,
836  [  --with-rootdir=DIR      use DIR ass compiled-in root directory
837                             (default is PREFIX)])
838AC_ARG_WITH(
839  lex,
840  [  --with-lex=[LEX,no]     uses LEX as lex program, default is flex])
841AC_ARG_WITH(
842  readline,
843  [  --with-readline=[dynamic,static,no]
844                        do use dynamic/static/no readline for fancy display])
845AC_ARG_WITH(
846  python,
847  [  --with-python=[PYTHON,no]     uses PYTHON as python executable, default is python])
848AC_ARG_WITH(
849  Boost,
850  [  --without-Boost         do not use Boost ])
851AC_ARG_WITH(
852  stdvec,
853  [  --with-stdvec           use std::vector ])
854AC_ARG_WITH(
855  MP,
856  [  --without-MP            do not use MP (no MP links)])
857AC_ARG_WITH(
858  dbm,
859  [  --without-dbm           do not use dbm (no DBM links)])
860AC_ARG_WITH(
861  factory,
862  [  --without-factory       do not use factory (no poly factorization)])
863AC_ARG_WITH(
864  libfac,
865  [  --without-libfac        do not use libfac (no primary decompositions)])
866AC_ARG_WITH(
867  dl,
868  [  --without-dl            do not use dynamic linking, modules, and kernel])
869AC_ARG_WITH(
870  dynamic-modules,
871  [  --with-dynamic-modules  do compile with dynamic modules support])
872AC_ARG_WITH(
873  dynamic-kernel,
874  [  --without-dynamic-kernel
875                          do not compile with dynamic kernel parts])
876AC_ARG_WITH(apint,
877  [  --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic])
878AC_ARG_WITH(svd,
879  [  --with-svd              use libsvd])
880AC_ARG_WITH(
881  Plural,
882  [  --without-Plural        do compile without Plural support])
883AC_ARG_WITH(
884  NTL,
885  [  --with-NTL              build for use with NTL.],
886  ,
887  with_NTL=yes)
888AC_ARG_WITH(
889  RatGB,
890  [  --with-ratGB            do compile with ratGB support (experimental)])
891
892dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
893dnl check for packages we need
894dnl for gmp, MP, factory and libfac, we built them in, even if the libs
895dnl and headers were not found under the condition that the respective
896dnl  --enable argument was given
897dnl
898
899
900AC_MSG_CHECKING(whether to use dynamic linking)
901if test "$with_dl" != no && test "$ac_lib_dl" = yes; then
902  AC_DEFINE(HAVE_DL)
903  ac_have_dl=yes
904  AC_MSG_RESULT(yes)
905else
906  AC_MSG_RESULT(no)
907fi
908
909AC_CHECK_LIB(ncurses,tgetent,,\
910 AC_CHECK_LIB(curses,tgetent,,\
911  AC_CHECK_LIB(termcap,tgetent)))
912
913# readline
914if test "$with_readline" = dynamic && test "$ac_have_dl" != yes; then
915  AC_MSG_WARN(can not build dynamic readline without dynamic linking)
916  with_readline=static
917fi
918
919
920if test "$with_readline" != dynamic && test "$with_readline" != no; then
921AC_LANG_SAVE
922AC_LANG_CPLUSPLUS
923   AC_CHECK_LIB(readline, rl_abort)
924   AC_CHECK_HEADERS(readline/readline.h readline/history.h)
925   if test "$ac_cv_lib_readline_rl_abort" = yes && \
926      test "$ac_cv_header_readline_readline_h" = yes; then
927     AC_MSG_CHECKING(whether readline.h is ok)
928     AC_CACHE_VAL(ac_cv_header_readline_readline_h_ok,
929     AC_TRY_LINK(
930#include<unistd.h>
931#include<stdio.h>
932#include<readline/readline.h>
933#ifdef HAVE_READLINE_HISTORY_H
934#include<readline/history.h>
935#endif
936,
937,
938ac_cv_header_readline_readline_h_ok="yes",
939ac_cv_header_readline_readline_h_ok="no",
940))
941    AC_MSG_RESULT($ac_cv_header_readline_readline_h_ok)
942    if test "$ac_cv_header_readline_readline_h_ok" != yes; then
943#not ok -- try once more with explicitly declaring everything
944      AC_MSG_CHECKING(whether or not we nevertheless can use readline)
945      AC_CACHE_VAL(ac_cv_have_readline,
946      AC_TRY_LINK(
947#include <stdio.h>
948extern "C"
949{
950extern char * rl_readline_name;
951extern char *rl_line_buffer;
952char *filename_completion_function();
953typedef char **CPPFunction ();
954extern char ** completion_matches ();
955extern CPPFunction * rl_attempted_completion_function;
956extern FILE * rl_outstream;
957char * readline ();
958void add_history ();
959int write_history ();
960int read_history();
961}
962#ifndef NULL
963#define NULL 0
964#endif
965,
966rl_readline_name=NULL;
967*rl_line_buffer=1;
968completion_matches(NULL, filename_completion_function);
969rl_attempted_completion_function = (CPPFunction *) NULL;
970rl_outstream=NULL;
971readline(NULL);
972add_history(NULL);
973read_history(NULL);
974write_history(NULL);
975,
976ac_cv_have_readline="yes"
977,
978ac_cv_have_readline="no"
979))
980      AC_MSG_RESULT($ac_cv_have_readline)
981    else
982      AC_DEFINE(READLINE_READLINE_H_OK)
983      ac_cv_have_readline="yes"
984    fi
985  fi
986  if test "$ac_cv_have_readline" = yes; then
987    AC_DEFINE(HAVE_READLINE)
988  fi
989AC_LANG_RESTORE
990fi
991
992AC_MSG_CHECKING(which readline to use)
993if test "$ac_cv_with_readline" = dynamic; then
994  AC_MSG_RESULT(dynamic)
995  AC_DEFINE(HAVE_DYN_RL)
996elif test "$ac_cv_have_readline" = yes; then
997  AC_MSG_RESULT(static)
998elif test "$ac_cv_singuname" = PowerMacintosh-darwin; then
999  AC_MSG_ERROR(building without readline impossible on PowerMacintosh-darwin)
1000else
1001  AC_MSG_RESULT(none)
1002  AC_MSG_WARN(building without readline: disabling fancy display)
1003fi
1004
1005NEED_LIBS=$LIBS
1006
1007# gmp, MP, MPT, factory, libfac
1008AC_CHECK_LIB(gmp, main)
1009SAVE_LIBS=$LIBS
1010AC_CHECK_LIB(MP, IMP_PutGmpInt,,,$MP_LIBS)
1011AC_CHECK_LIB(MPT, MPT_GetTree,,,$MP_LIBS)
1012LIBS=$SAVE_LIBS
1013AC_CHECK_LIB(singcf, atof)
1014AC_CHECK_LIB(singfac, atof)
1015AC_CHECK_LIB(omalloc, omTestAddr)
1016AC_CHECK_LIB(omalloc_ndebug, main)
1017AC_CHECK_LIB(ntl,main)
1018
1019AC_CHECK_HEADERS(gmp.h MP.h  MPT.h factory.h factor.h omalloc.h \
1020 omalloc.c)
1021
1022AC_MSG_CHECKING(whether to use Boost)
1023if test "$with_Boost" != no; then
1024  AC_MSG_RESULT(yes)
1025  AC_LANG_SAVE
1026  AC_LANG_CPLUSPLUS
1027  AC_CHECK_HEADERS(boost/dynamic_bitset.hpp)
1028  AC_LANG_RESTORE
1029else
1030  AC_MSG_RESULT(no)
1031  AC_MSG_CHECKING(whether to use std::vector)
1032  if test "$with_stdvec" != yes; then
1033    AC_MSG_RESULT(no)
1034  else
1035    AC_MSG_RESULT(yes)
1036    AC_DEFINE(USE_STDVECBOOL)
1037    USE_STDVECBOOL=1
1038  fi
1039fi
1040AC_SUBST(USE_STDVECBOOL)
1041
1042if test "$ac_cv_lib_gmp_main" = yes && \
1043 test "$ac_cv_header_gmp_h" = yes; then
1044    ac_gmp_ok=yes
1045fi
1046
1047if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
1048 test "$ac_cv_lib_MPT_MPT_GetTree" && \
1049 test "$ac_cv_header_MP_h" = yes && \
1050 test "$ac_cv_header_MPT_h" = yes; then
1051  ac_MP_ok=yes
1052fi
1053
1054if test "$ac_cv_lib_singcf_atof" = yes && \
1055 test "$ac_cv_header_factory_h" = yes; then
1056  ac_factory_ok=yes
1057fi
1058
1059if test "$ac_cv_lib_singfac_atof" = yes && \
1060 test "$ac_cv_header_factor_h" = yes; then
1061  ac_libfac_ok=yes
1062fi
1063
1064if test "$ac_cv_lib_omalloc_omTestAddr" = yes && \
1065   test "$ac_cv_lib_omalloc_ndebug_main" = yes && \
1066   test "$ac_cv_header_omalloc_c" = yes && \
1067   test "$ac_cv_header_omalloc_h" = yes; then
1068  ac_cv_omalloc_ok=yes
1069fi
1070
1071if test "$ac_cv_lib_ntl_main" = yes; then
1072  ac_cv_ntl_ok=yes
1073fi
1074
1075SAVE_LIBS=$LIBS
1076AC_CHECK_LIB(c_nonshared,__stack_chk_fail_local,GLIBC_DYN_FIX="-lc_nonshared",GLIBC_DYN_FIX="")
1077LIBS=$SAVE_LIBS
1078AC_SUBST(GLIBC_DYN_FIX)
1079
1080# evaluate results
1081dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
1082dnl make sure that omalloc is there
1083dnl
1084if test "$ac_cv_omalloc_ok" != yes && test "$enable_omalloc" != yes; then
1085  AC_MSG_ERROR(can not build without omalloc)
1086fi
1087
1088AC_MSG_CHECKING(which apint package to use)
1089if test "${with_apint}" != gmp; then
1090  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
1091    AC_MSG_RESULT(gmp)
1092    will_have_gmp=yes
1093    NEED_LIBS="-lgmp ${NEED_LIBS}"
1094  else
1095    AC_MSG_RESULT(none)
1096    AC_MSG_ERROR(can not build without gmp)
1097  fi
1098else
1099  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
1100    AC_MSG_RESULT(gmp)
1101    will_have_gmp=yes
1102    NEED_LIBS="-lgmp ${NEED_LIBS}"
1103  else
1104    AC_MSG_RESULT(none)
1105    AC_MSG_ERROR(can not build with gmp)
1106  fi
1107fi
1108
1109AC_MSG_CHECKING(gfanlib)
1110if test "$enable_gfanlib" = yes; then
1111  AC_MSG_RESULT(yes)
1112  NEED_LIBS="${NEED_LIBS} -lgfan -lcddgmp"
1113else
1114  AC_MSG_RESULT(can not build with gfan lib)
1115fi
1116
1117AC_MSG_CHECKING(whether to use libsvd)
1118if test "$with_svd" = yes; then
1119  AC_MSG_RESULT(yes)
1120  AC_DEFINE(HAVE_SVD)
1121  NEED_LIBS="-lsvd -lmpfr ${NEED_LIBS}"
1122else
1123  AC_MSG_RESULT(no)
1124fi
1125AC_SUBST(HAVE_SVD)
1126
1127#
1128AC_MSG_CHECKING(whether to have MP)
1129if test "${with_MP}" != yes && test "${with_MP}" != no; then
1130  if (test "${will_have_gmp}" = yes) && \
1131     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
1132    AC_MSG_RESULT(yes)
1133    AC_DEFINE(HAVE_MPSR)
1134    HAVE_MPSR=1
1135    MP_LIBS="-lMPT -lMP ${MP_LIBS}"
1136  else
1137    AC_MSG_RESULT(no)
1138  fi
1139elif  test "${with_MP}" = yes; then
1140  if (test "${will_have_gmp}" = yes) && \
1141     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
1142    AC_MSG_RESULT(yes)
1143    AC_DEFINE(HAVE_MPSR)
1144    HAVE_MPSR=1
1145    MP_LIBS="-lMPT -lMP ${MP_LIBS}"
1146  else
1147    AC_MSG_RESULT(no)
1148    AC_MSG_ERROR(can not build with MP)
1149  fi
1150else
1151  AC_MSG_RESULT(no)
1152fi
1153AC_SUBST(HAVE_MPSR)
1154AC_SUBST(MP_LIBS)
1155
1156AC_MSG_CHECKING(whether to have NTL)
1157if test "${with_NTL}" = yes ; then
1158  AC_MSG_RESULT(yes)
1159  NEED_LIBS="-lntl ${NEED_LIBS}"
1160else
1161  AC_MSG_RESULT(no)
1162fi
1163
1164AC_MSG_CHECKING(whether to have factory)
1165if test "${with_factory}" != yes && test "${with_factory}" != no; then
1166  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
1167    AC_MSG_RESULT(yes)
1168    AC_DEFINE(HAVE_FACTORY)
1169    will_have_factory=yes
1170    NEED_LIBS="-lsingcf ${NEED_LIBS}"
1171  else
1172    AC_MSG_RESULT(no)
1173  fi
1174elif  test "${with_factory}" = yes; then
1175  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
1176    AC_MSG_RESULT(yes)
1177    AC_DEFINE(HAVE_FACTORY)
1178    will_have_factory=yes
1179    NEED_LIBS="-lsingcf ${NEED_LIBS}"
1180  else
1181    AC_MSG_RESULT(no)
1182    AC_MSG_ERROR(can not build with factory)
1183  fi
1184else
1185  AC_MSG_RESULT(no)
1186fi
1187
1188AC_MSG_CHECKING(whether to have libfac)
1189if test "${with_libfac}" != yes && test "${with_libfac}" != no; then
1190  if (test "${will_have_factory}" = yes) && \
1191     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
1192    AC_MSG_RESULT(yes)
1193    NEED_LIBS="-lsingfac ${NEED_LIBS}"
1194  else
1195    AC_MSG_RESULT(no)
1196    AC_MSG_ERROR(can not build without libfac)
1197  fi
1198elif  test "${with_libfac}" = yes; then
1199  if (test "${will_have_factory}" = yes) && \
1200     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
1201    AC_MSG_RESULT(yes)
1202    NEED_LIBS="-lsingfac ${NEED_LIBS}"
1203  else
1204    AC_MSG_RESULT(no)
1205    AC_MSG_ERROR(can not build with libfac)
1206  fi
1207else
1208  AC_MSG_RESULT(no)
1209fi
1210
1211NEED_LIBSG="${NEED_LIBS}"
1212if test "$ac_cv_sizeof_voidp" != 4; then
1213  NEED_LIBS="${NEED_LIBS} -lomalloc"
1214else
1215  NEED_LIBS="${NEED_LIBS} -lomalloc_ndebug"
1216fi
1217
1218
1219AC_SUBST(NEED_LIBS)
1220AC_SUBST(NEED_LIBSG)
1221
1222AC_MSG_CHECKING(whether to have dbm links)
1223if test "$with_dbm" != no; then
1224  AC_DEFINE(HAVE_DBM)
1225  AC_MSG_RESULT(yes)
1226else
1227  AC_MSG_RESULT(no)
1228fi
1229
1230AC_MSG_CHECKING(whether to have dynamic modules)
1231if test "$with_dynamic_modules" = no || test "$ac_have_dl" != yes; then
1232  AC_MSG_RESULT(no)
1233else
1234  AC_DEFINE(HAVE_DYNAMIC_LOADING)
1235  AC_MSG_RESULT(yes)
1236fi
1237
1238AC_MSG_CHECKING(whether to have dynamic kernel)
1239if test "$with_dynamic_kernel" != no && test "$ac_lib_dl" = yes; then
1240  DL_KERNEL=1
1241  AC_SUBST(DL_KERNEL)
1242  AC_MSG_RESULT(yes)
1243else
1244  AC_MSG_RESULT(no)
1245fi
1246
1247AC_MSG_CHECKING(whether to have Plural)
1248if test "$with_Plural" != no && test "$enable_Plural" != no; then
1249  AC_DEFINE(HAVE_PLURAL)
1250  AC_MSG_RESULT(yes)
1251  PLURAL=1
1252  AC_SUBST(PLURAL)
1253else
1254  AC_MSG_RESULT(no)
1255fi
1256
1257AC_MSG_CHECKING(whether to have ratGB)
1258if test "$with_ratGB" != yes && test "$enable_ratGB" != yes; then
1259  AC_MSG_RESULT(no)
1260else
1261  AC_DEFINE(HAVE_RATGRING)
1262  AC_MSG_RESULT(yes)
1263fi
1264
1265
1266OUTPUT_MAKEFILES="Makefile ../kernel/Makefile"
1267
1268if test "$ac_cv_singuname" = "ix86-Win"; then
1269  OUTPUT_MAKEFILES="${OUTPUT_MAKEFILES} Singular.rc"
1270fi
1271
1272AC_OUTPUT(${OUTPUT_MAKEFILES}, \
1273 cp mod2.h ../kernel/mod2.h; \
1274 if test "$CONFIG_HEADERS"; then echo timestamp > stamp-h; fi)
Note: See TracBrowser for help on using the repository browser.