source: git/Singular/configure.in @ 2f436b

spielwiese
Last change on this file since 2f436b was 2f436b, checked in by Olaf Bachmann <obachman@…>, 23 years ago
* version 1-3-13: sparsemat improivements git-svn-id: file:///usr/local/Singular/svn/trunk@5003 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 21.6 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(mmalloc.cc)
3AC_CONFIG_HEADER(mod2.h)
4
5dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
6dnl determine singuname
7dnl
8
9AC_MSG_CHECKING(uname for singular)
10AC_CACHE_VAL(ac_cv_singuname,
11ac_cv_singuname="unknown"
12if test -r "singuname.sh"; then
13  if (/bin/sh singuname.sh >/dev/null 2>&1) then
14    ac_cv_singuname=`/bin/sh singuname.sh`
15  fi
16fi
17if test "$ac_cv_singuname" = unknown && test -r "../singuname.sh"; then
18  if (/bin/sh ../singuname.sh >/dev/null 2>&1) then
19    ac_cv_singuname=`/bin/sh ../singuname.sh`
20  fi
21fi
22)
23AC_MSG_RESULT($ac_cv_singuname)
24if test "$ac_cv_singuname" = unknown; then
25  AC_MSG_WARN(Unknown architecture: Check singuname.sh)
26  ac_cv_singuname="unknown"
27fi
28AC_DEFINE_UNQUOTED(S_UNAME, "$ac_cv_singuname")
29SINGUNAME=$ac_cv_singuname
30AC_SUBST(SINGUNAME)
31
32if test "$ac_cv_singuname" = ix86-Win; then
33  EXEC_EXT=".exe"
34fi
35AC_SUBST(EXEC_EXT)
36
37SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
38AC_SUBST(SING_UNAME)
39
40# stupid Win programs do not like dots in their pathnames
41VERSION_SEP="-"
42
43dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
44dnl version stuff -- should be set in ../configure.in
45dnl
46dnl here are some defaults
47
48SINGULAR_MAJOR_VERSION=${SINGULAR_MAJOR_VERSION:-1}
49SINGULAR_MINOR_VERSION=${SINGULAR_MINOR_VERSION:-3}
50SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-13}
51SINGULAR_VERSION="${SINGULAR_VERSION:-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}"
52VERSION_DATE=${VERSION_DATE:-"January 2001"}
53
54dnl pass them on into the Makefiles
55AC_SUBST(SINGULAR_VERSION)
56AC_SUBST(VERSION_DATE)
57AC_SUBST(SINGULAR_MAJOR_VERSION)
58AC_SUBST(SINGULAR_MINOR_VERSION)
59AC_SUBST(SINGULAR_SUB_VERSION)
60AC_DEFINE_UNQUOTED(SINGULAR_MAJOR_VERSION, ${SINGULAR_MAJOR_VERSION})
61AC_DEFINE_UNQUOTED(SINGULAR_MINOR_VERSION, ${SINGULAR_MINOR_VERSION})
62AC_DEFINE_UNQUOTED(SINGULAR_SUB_VERSION, ${SINGULAR_SUB_VERSION})
63AC_DEFINE_UNQUOTED(S_VERSION1, "${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}")
64AC_DEFINE_UNQUOTED(S_VERSION2, "${VERSION_DATE}")
65AC_DEFINE_UNQUOTED(SINGULAR_SUB_VERSION, ${SINGULAR_SUB_VERSION})
66
67
68dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
69dnl compiler stuff
70dnl is needed to check for libs and headers, later on
71dnl
72dnl we do not want to have "-g -O" for CFLAGS
73if test "${CXXFLAGS+set}" != set; then
74  ac_cxxflags_set=no
75  CXXFLAGS="-O"
76fi
77if test "${CFLAGS+set}" != set; then
78  CFLAGS="-O"
79  ac_cflags_set=no
80fi
81
82# check whether CXX was set by user as env variable
83if test "${CXX+set}" != set; then
84  ac_cxx_set=no
85else
86  ac_cxx_set=yes
87fi
88AC_PROG_CC
89AC_PROG_CPP
90AC_PROG_CXX
91AC_PROG_INSTALL
92AC_AIX
93
94# we prefer using gcc for compiling C++ files, provided the user did
95# not overwrite it explicitely
96if test "${GXX}" = yes && test "${ac_cxx_set}" = no; then
97  CXX=gcc
98temp_cflags=${CXXFLAGS}
99AC_LANG_SAVE
100AC_LANG_CPLUSPLUS
101# check whether gcc accepts --no-rtti
102AC_MSG_CHECKING(whether gcc accepts --no-rtti)
103CXXFLAGS="${CXXFLAGS} --no-rtti"
104AC_CACHE_VAL(ac_cv_cxx_have_rtti,
105AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
106)
107AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
108if test "${ac_cv_cxx_have_rtti}" != yes; then
109CXXFLAGS=$temp_flags
110else
111CXX="${CXX} --no-rtti"
112fi
113
114# check whether gcc accepts --no-exceptions
115AC_MSG_CHECKING(whether gcc accepts --no-exceptions)
116CXXFLAGS="${CXXFLAGS} --no-exceptions"
117AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
118AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
119)
120AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
121if test "${ac_cv_cxx_have_exceptions}" != yes; then
122CXXFLAGS=$temp_flags
123else
124CXX="${CXX} --no-exceptions"
125fi
126
127AC_LANG_RESTORE
128CXXFLAGS=$temp_flags
129
130fi
131
132# check whether the compiler accepts -pipe
133AC_MSG_CHECKING(whether compiler accepts -pipe)
134temp_cflags=${CFLAGS}
135CFLAGS="${CFLAGS} -pipe"
136AC_CACHE_VAL(ac_cv_cxx_have_pipe,
137AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no)
138)
139AC_MSG_RESULT(${ac_cv_cxx_have_pipe})
140CFLAGS=${temp_cflags}
141if test "${ac_cv_cxx_have_pipe}" != yes; then
142  PIPE=
143else
144  PIPE="-pipe"
145fi
146AC_SUBST(PIPE)
147
148# Customize CFLAGS
149AC_MSG_CHECKING(whether _AIX is defined)
150AC_CACHE_VAL(ac_cv_is_aix,
151AC_EGREP_CPP(yes,
152[#ifdef _AIX
153    yes
154#endif
155], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
156if test "$ac_cv_is_aix" = yes; then
157  AC_MSG_RESULT(yes)
158else
159  AC_MSG_RESULT(no)
160fi
161
162# we know best when compiling with gcc
163if test "${GXX}" = yes; then
164  if test "$ac_cxxflags_set" = no; then
165    CXXFLAGS="-O3 -w -fomit-frame-pointer"
166  fi
167  CXXTEMPLFLAGS="-fno-implicit-templates"
168  if test "$ac_cv_is_aix" = yes; then
169    CXXNOOPTFLAGS="-w"
170  else
171    CXXNOOPTFLAGS=$CXXFLAGS
172  fi
173  STATIC_LDFLAGS="-static"
174else
175  CXXTEMPFLAGS=""
176  CXXNOOPTFLAGS=$CXXFLAGS
177  STATIC_LDFLAGS=""
178fi
179AC_SUBST(CXXTEMPLFLAGS)
180AC_SUBST(CXXNOOPTFLAGS)
181AC_SUBST(STATIC_LDFLAGS)
182
183if test "${GCC}" = yes && test "$ac_cflags_set" = no ; then
184  CFLAGS="-O3 -w -fomit-frame-pointer"
185fi
186
187AC_PROG_MAKE_SET
188
189dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
190dnl path stuff
191dnl
192AC_PREFIX_DEFAULT(`pwd`/..)
193
194dnl set exec_prefix, bindir, libdir, includedir to some sensible values
195dnl if they are not yet already set
196
197# expand prefix
198test "x$prefix" = xNONE && prefix=$ac_default_prefix
199if test "${with_rootdir+set}" != set; then
200  AC_DEFINE_UNQUOTED(S_ROOT_DIR, "${prefix}")
201else
202  AC_DEFINE_UNQUOTED(S_ROOT_DIR, "${with_rootdir}")
203fi
204
205# expand exec_prefixad
206if test "x$exec_prefix" = xNONE; then
207 exec_prefix=${prefix}/${ac_cv_singuname}
208fi
209
210# expand bindir
211test "x$bindir" = 'x${exec_prefix}/bin' && bindir="${exec_prefix}"
212SINGULAR=${SINGULAR:-$bindir/Singular-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}
213AC_SUBST(SINGULAR)
214AC_DEFINE_UNQUOTED(S_BIN_DIR, "${bindir}")
215
216# expand libdir
217test "x$libdir" = 'x${exec_prefix}/lib'&& libdir="${exec_prefix}/lib"
218
219# expand includedir
220test "x$includedir" = 'x${prefix}/include' && includedir="${exec_prefix}/include"
221
222# add to -I to CPPFLAGS and and -L to LDFLAGS, just to be sure
223LDFLAGS="-L${libdir} ${LDFLAGS} -L/usr/local/lib"
224CPPFLAGS="-I${includedir} ${CPPFLAGS} -I/usr/local/include"
225
226# this is a work-around to include the right term.h
227if test "$ac_cv_singuname" = SunOS-5; then
228CPPFLAGS="-I/usr/xpg4/include ${CPPFLAGS}"
229fi
230
231
232dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
233dnl Checks for programs.
234dnl
235
236# lex
237if test "${with_lex+set}" != set; then
238  AC_MSG_CHECKING(for flex)
239  changequote(<<,>>)dnl
240  AC_CACHE_VAL(ac_cv_prog_flex,
241  if (flex --version >/dev/null 2>&1)
242  then
243    if (flex --version | egrep "[2-9]\.[5-9]" >/dev/null 2>&1)
244    then
245      ac_cv_prog_flex=flex
246    fi
247  fi
248  )
249  changequote([,])dnl
250  if test "${ac_cv_prog_flex+set}" = set; then
251    AC_MSG_RESULT(flex)
252    LEX=flex
253    AC_SUBST(LEX)
254  else
255    AC_MSG_ERROR(can not find flex with version greater 2.4)
256  fi
257elif test "${with_lex}" = no; then
258  AC_MSG_WARN(building without lex -- make might fail)
259else
260  unset LEX
261  unset ac_cv_prog_LEX
262  AC_CHECK_PROGS(LEX, ${with_lex})
263  if test "x${LEX}" = x; then
264    AC_MSG_WARN(building without lex -- make might fail)
265  fi
266fi
267
268# bison
269AC_CHECK_PROGS(BISON, bison)
270if test "${BISON+set}" != set; then
271  AC_MSG_WARN(did not find bison -- make might fail)
272fi
273
274# ln -s
275AC_PROG_LN_S
276
277AC_CHECK_PROGS(PERL, perl5 perl)
278
279dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
280dnl check for general libraries, header files, typedefs, etc
281dnl
282# lib checks
283AC_CHECK_LIB(m, atof)
284SAVE_LIBS=${LIBS}
285LIBS=
286
287dnl I'm not sure what they are for
288dnl AC_CHECK_LIB(bsd, socket)
289dnl AC_CHECK_LIB(socket, listen)
290dnl AC_CHECK_LIB(nsl, gethostbyname)
291dnl AC_CHECK_LIB(ucb, index)
292dnl MP_LIBS=${LIBS}
293# check for dl lib
294case "$ac_cv_singuname" in
295        HPUX*)
296          AC_CHECK_LIB(dld, shl_load)
297          if test "$ac_cv_lib_dld_shl_load" = yes; then
298                LD_DYN_FLAGS="-ldld -Xlinker -E"
299                SFLAGS="-fPIC -DPIC"
300                SLDFLAGS=-shared
301                ac_lib_dl=yes
302          fi
303        ;;
304        *Linux*)
305          AC_CHECK_LIB(dl, dlopen)
306          if test "$ac_cv_lib_dl_dlopen" = yes; then
307                LD_DYN_FLAGS="-ldl -rdynamic"
308                SFLAGS="-fpic -DPIC"
309                SLDFLAGS=-shared
310                ac_lib_dl=yes
311          fi
312        ;;
313        IRIX-6)
314          LD_DYN_FLAGS="-lc"
315          ac_lib_dl=yes
316        ;;
317esac
318AC_SUBST(LD_DYN_FLAGS)
319AC_SUBST(SFLAGS)
320AC_SUBST(SLDFLAGS)
321LIBS=${SAVE_LIBS}
322
323
324# heder file checks
325AC_HEADER_STDC
326AC_CHECK_HEADERS(limits.h unistd.h,,
327  AC_MSG_ERROR(Can not compile without limits.h unistd.h))
328
329AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/time.h sys/times.h sys/types.h sys/stat.h fcntl.h sys/param.h pwd.h asm/sigcontext.h pwd.h termcap.h termios.h term.h readline/readline.h)
330
331# typedefs, structures
332AC_C_CONST
333AC_C_INLINE
334AC_TYPE_SIZE_T
335AC_HEADER_TIME
336AC_STRUCT_TM
337
338# library functions.
339AC_FUNC_ALLOCA
340AC_PROG_GCC_TRADITIONAL
341AC_FUNC_MMAP
342AC_TYPE_SIGNAL
343AC_FUNC_VPRINTF
344AC_SEARCH_LIBS(setenv, bsd)
345AC_CHECK_FUNCS(gettimeofday atexit bcopy getcwd getwd vsnprintf readlink sleep usleep getpwnam popen setenv)
346
347
348dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
349dnl Find out more about particularity of the system
350dnl
351
352# arithmetic shifts
353AC_MSG_CHECKING(whether your machine has correct arithmetic shifts)
354AC_CACHE_VAL(ac_cv_shift, AC_TRY_RUN(
355  [ int main() { if (-2 >> 1 == -1) exit(0); else exit(1); } ],
356   ac_cv_shift=yes,
357   ac_cv_shift=no,
358   if test "$ac_c_cross_dos" = yes; then
359     ac_cv_shift=yes;
360   else
361     AC_MSG_RESULT(no)
362     AC_MSG_ERROR(cross compilation without default value)
363   fi))
364
365if test "$ac_cv_shift" = yes; then
366  AC_MSG_RESULT(yes)
367else
368  AC_MSG_RESULT(no)
369  AC_MSG_ERROR(need  -2 >> 1 == -1)
370fi
371
372
373# check for a peculiar constructor initialization
374AC_MSG_CHECKING(whether explicit C++ constructor calls are allowed)
375AC_LANG_SAVE
376AC_LANG_CPLUSPLUS
377AC_CACHE_VAL(ac_cv_explicit_const,AC_TRY_COMPILE(,
378  class testclass
379  {
380  public:
381    int value;
382    testclass() : value(0) {}
383    testclass( int i ) : value(i) {}
384    ~testclass() { value = 0; }
385  };
386
387  testclass ptr;
388  ptr.testclass(1);
389, ac_cv_explicit_const=yes, ac_cv_explicit_const=no))
390AC_LANG_RESTORE
391AC_MSG_RESULT($ac_cv_explicit_const)
392if test "$ac_cv_explicit_const" = yes; then
393  AC_DEFINE(HAVE_EXPLICIT_CONSTR)
394fi
395
396# sprintf returns number of printed chars
397AC_MSG_CHECKING(whether vsprintf returns number of printed chars)
398AC_CACHE_VAL(ac_cv_returns_n_of_chars, AC_TRY_RUN(
399 [#include <stdio.h>
400 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); }],
401   ac_cv_returns_n_of_chars=yes,
402   ac_cv_returns_n_of_chars=no,
403   ac_cv_returns_n_of_chars=no))
404if test "$ac_cv_returns_n_of_chars" = yes; then
405  AC_MSG_RESULT(yes)
406else
407  AC_MSG_RESULT(no)
408  AC_DEFINE(BSD_SPRINTF)
409fi
410
411# determine ALIGN_8
412AC_CHECK_SIZEOF(char,1)
413AC_CHECK_SIZEOF(short,2)
414AC_CHECK_SIZEOF(int,4)
415AC_CHECK_SIZEOF(long,4)
416AC_CHECK_SIZEOF(void*,4)
417AC_CHECK_SIZEOF(double, 8)
418AC_C_BIGENDIAN
419if test "$ac_cv_sizeof_int" != 4; then
420  AC_MSG_ERROR(need int to be four bytes long)
421fi
422if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then
423  AC_MSG_ERROR(need equal sizes for long and void*)
424fi
425if test "$ac_cv_sizeof_double" != 8; then
426  AC_MSG_ERROR(need double to b 8 bytes long)
427fi
428if test "$ac_cv_sizeof_voidp" != 4 && test "$ac_cv_sizeof_voidp" != 8; then
429  AC_MSG_ERROR(need void* to be 4 or 8 bytes long)
430fi
431
432dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
433dnl help for configure
434dnl
435AC_ARG_WITH(
436  rootdir,
437  [  --with-rootdir=DIR      use DIR ass compiled-in root directory
438                             (default is PREFIX)])
439AC_ARG_WITH(
440  lex,
441  [  --with-lex=[LEX,no]     uses LEX as lex program, default is flex])
442AC_ARG_WITH(
443  readline,
444  [  --with-readline=[dynamic,static,no]         
445                          do use dynamic/static/no readline for fancy display])
446AC_ARG_WITH(
447  MP,
448  [  --without-MP            do not use MP (no MP links)])
449AC_ARG_WITH(
450  dbm,
451  [  --without-dbm           do not use dbm (no DBM links)])
452AC_ARG_WITH(
453  factory,
454  [  --without-factory       do not use factory (no poly factorization)])
455AC_ARG_WITH(
456  libfac,
457  [  --without-libfac        do not use libfac (no primary decompositions)])
458AC_ARG_WITH(
459  namespaces,
460  [  --with-namespaces       do compile namespace support])
461AC_ARG_WITH(
462  dl,
463  [  --without-dl            do not use dynamic linking, modules, and kernel])
464AC_ARG_WITH(
465  dynamic-modules,
466  [  --with-dynamic-modules  do compile with dynamic modules support])
467AC_ARG_WITH(
468  dynamic-kernel,
469  [  --without-dynamic-kernel               
470                          do not compile with dynamic kernel parts])
471AC_ARG_WITH(apint,
472  [  --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic])
473AC_ARG_WITH(
474  plural,
475  [  --with-plural           do compile with Plural support])
476
477dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
478dnl check for packages we need
479dnl for gmp, MP, factory and libfac, we built them in, even if the libs
480dnl and headers were not found under the condition that the respective
481dnl  --enable argument was given
482dnl
483
484
485AC_MSG_CHECKING(whether to use dynamic linking)
486if test "$with_dl" != no && test "$ac_lib_dl" = yes; then
487  AC_DEFINE(HAVE_DL)
488  ac_have_dl=yes
489  AC_MSG_RESULT(yes)
490else
491  AC_MSG_RESULT(no)
492fi
493
494AC_CHECK_LIB(ncurses,tgetent,,\
495 AC_CHECK_LIB(curses,tgetent,,\
496  AC_CHECK_LIB(termcap,tgetent)))
497
498# readline
499if test "$with_readline" = dynamic && test "$ac_have_dl" != yes; then
500  AC_MSG_WARN(can not build dynamic readline without dynamic linking)
501  with_readline=static
502fi
503
504
505if test "$with_readline" != dynamic && test "$with_readline" != no; then
506AC_LANG_SAVE
507AC_LANG_CPLUSPLUS
508   AC_CHECK_LIB(readline, rl_abort)
509   AC_CHECK_HEADERS(readline/readline.h readline/history.h)
510   if test "$ac_cv_lib_readline_rl_abort" = yes && \
511      test "$ac_cv_header_readline_readline_h" = yes; then
512     AC_MSG_CHECKING(whether readline.h is ok)
513     AC_CACHE_VAL(ac_cv_header_readline_readline_h_ok,
514     AC_TRY_LINK(
515#include<unistd.h>
516#include<stdio.h>
517#include<readline/readline.h>
518#ifdef HAVE_READLINE_HISTORY_H
519#include<readline/history.h>
520#endif
521,
522#ifndef NULL
523#define NULL 0
524#endif
525rl_readline_name=NULL;
526*rl_line_buffer=1;
527completion_matches(NULL, filename_completion_function);
528rl_attempted_completion_function = (CPPFunction *) NULL;
529rl_outstream=NULL;
530readline(NULL);
531add_history(NULL);
532read_history(NULL);
533write_history(NULL);
534,
535ac_cv_header_readline_readline_h_ok="yes",
536ac_cv_header_readline_readline_h_ok="no",
537))
538    AC_MSG_RESULT($ac_cv_header_readline_readline_h_ok)
539    if test "$ac_cv_header_readline_readline_h_ok" != yes; then
540#not ok -- try once more with explicitly declaring everything
541      AC_MSG_CHECKING(whether or not we nevertheless can use readline)
542      AC_CACHE_VAL(ac_cv_have_readline,
543      AC_TRY_LINK(
544#include <stdio.h>
545extern "C"
546{
547extern char * rl_readline_name;
548extern char *rl_line_buffer;
549char *filename_completion_function();
550typedef char **CPPFunction ();
551extern char ** completion_matches ();
552extern CPPFunction * rl_attempted_completion_function;
553extern FILE * rl_outstream;
554char * readline ();
555void add_history ();
556int write_history ();
557int read_history();
558}
559#ifndef NULL
560#define NULL 0
561#endif
562,
563rl_readline_name=NULL;
564*rl_line_buffer=1;
565completion_matches(NULL, filename_completion_function);
566rl_attempted_completion_function = (CPPFunction *) NULL;
567rl_outstream=NULL;
568readline(NULL);
569add_history(NULL);
570read_history(NULL);
571write_history(NULL);
572,
573ac_cv_have_readline="yes"
574,
575ac_cv_have_readline="no"
576))
577      AC_MSG_RESULT($ac_cv_have_readline)
578    else
579      AC_DEFINE(READLINE_READLINE_H_OK)
580      ac_cv_have_readline="yes"
581    fi
582  fi
583  if test "$ac_cv_have_readline" = yes; then
584    AC_DEFINE(HAVE_READLINE)
585  fi
586AC_LANG_RESTORE
587fi
588
589AC_MSG_CHECKING(which readline to use)
590if test "$ac_cv_with_readline" = dynamic; then
591  AC_MSG_RESULT(dynamic)
592  AC_DEFINE(HAVE_DYN_RL)
593elif test "$ac_cv_have_readline" = yes; then
594  AC_MSG_RESULT(static)
595else
596  AC_MSG_RESULT(none)
597  AC_MSG_WARN(building without readline: disabling fancy display)
598fi
599 
600NEED_LIBS=$LIBS
601
602# gmp, smallgmp, MP, MPT, factory, libfac
603AC_CHECK_LIB(gmp, main)
604if test "ac_cv_lib_gmp_main" = yes && test "$with-apint" = smallgmp; then
605  LIBS=${NEED_LIBS}
606fi
607AC_CHECK_LIB(smallgmp, main)
608SAVE_LIBS=$LIBS
609AC_CHECK_LIB(MP, IMP_PutGmpInt,,,$MP_LIBS)
610AC_CHECK_LIB(MPT, MPT_GetTree,,,$MP_LIBS)
611LIBS=$SAVE_LIBS
612AC_CHECK_LIB(singcf, atof)
613AC_CHECK_LIB(singfac, atof)
614AC_CHECK_LIB(omalloc, omTestAddr)
615AC_CHECK_LIB(omalloc_ndebug, main)
616
617AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h omalloc.h omalloc.c)
618
619if test "$ac_cv_lib_gmp_main" = yes && \
620 test "$ac_cv_header_gmp_h" = yes; then
621    ac_gmp_ok=yes
622fi
623
624if test "$ac_cv_lib_smallgmp_main" = yes && \
625 test "$ac_cv_header_smallgmp_h" = yes && \
626 test "$ac_cv_header_gmp_h" = yes; then
627    ac_smallgmp_ok=yes
628fi
629
630if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
631 test "$ac_cv_lib_MPT_MPT_GetTree" && \
632 test "$ac_cv_header_MP_h" = yes && \
633 test "$ac_cv_header_MPT_h" = yes; then
634  ac_MP_ok=yes
635fi
636
637if test "$ac_cv_lib_singcf_atof" = yes && \
638 test "$ac_cv_header_factory_h" = yes; then
639  ac_factory_ok=yes
640fi
641
642if test "$ac_cv_lib_singfac_atof" = yes && \
643 test "$ac_cv_header_factor_h" = yes; then
644  ac_libfac_ok=yes
645fi
646
647if test "$ac_cv_lib_omalloc_omTestAddr" = yes && \
648   test "$ac_cv_lib_omalloc_ndebug_main" = yes && \
649   test "$ac_cv_header_omalloc_c" = yes && \
650   test "$ac_cv_header_omalloc_h" = yes; then
651  ac_cv_omalloc_ok=yes
652fi
653
654
655# evaluate results
656dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
657dnl make sure that omalloc is there
658dnl
659if test "$ac_cv_omalloc_ok" != yes && test "$enable_omalloc" != yes; then
660  AC_MSG_ERROR(can not build without omalloc)
661fi
662
663AC_MSG_CHECKING(which apint package to use)
664if test "${with_apint}" != gmp && test "${with_apint}" != smallgmp; then
665  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
666    AC_MSG_RESULT(gmp)
667    will_have_gmp=yes
668    NEED_LIBS="-lgmp ${NEED_LIBS}"
669  elif test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
670    AC_MSG_RESULT(smallgmp)
671    AC_DEFINE(HAVE_SMALLGMP)
672    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
673  else
674    AC_MSG_RESULT(none)
675    AC_MSG_ERROR(can not build without gmp or smallgmp)
676  fi
677elif test "${with_apint}" = gmp; then
678  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
679    AC_MSG_RESULT(gmp)
680    will_have_gmp=yes
681    NEED_LIBS="-lgmp ${NEED_LIBS}"
682  else
683    AC_MSG_RESULT(none)
684    AC_MSG_ERROR(can not build with gmp)
685  fi
686else
687  if test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
688    AC_MSG_RESULT(smallgmp)
689    AC_DEFINE(HAVE_SMALLGMP)
690    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
691  else
692    AC_MSG_RESULT(none)
693    AC_MSG_ERROR(can not build with smallgmp)
694  fi
695fi
696
697#
698AC_MSG_CHECKING(whether to have MP)
699if test "${with_MP}" != yes && test "${with_MP}" != no; then
700  if (test "${will_have_gmp}" = yes) && \
701     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
702    AC_MSG_RESULT(yes)
703    AC_DEFINE(HAVE_MPSR)
704    HAVE_MPSR=1
705    MP_LIBS="-lMPT -lMP ${MP_LIBS}"
706  else
707    AC_MSG_RESULT(no)
708  fi
709elif  test "${with_MP}" = yes; then
710  if (test "${will_have_gmp}" = yes) && \
711     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
712    AC_MSG_RESULT(yes)
713    AC_DEFINE(HAVE_MPSR)
714    HAVE_MPSR=1
715    MP_LIBS="-lMPT -lMP ${MP_LIBS}"
716  else
717    AC_MSG_RESULT(no)
718    AC_MSG_ERROR(can not build with MP)
719  fi
720else
721  AC_MSG_RESULT(no)
722fi
723AC_SUBST(HAVE_MPSR)
724AC_SUBST(MP_LIBS)
725
726AC_MSG_CHECKING(whether to have factory)
727if test "${with_factory}" != yes && test "${with_factory}" != no; then
728  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
729    AC_MSG_RESULT(yes)
730    AC_DEFINE(HAVE_FACTORY)
731    will_have_factory=yes
732    NEED_LIBS="-lsingcf ${NEED_LIBS}"
733  else
734    AC_MSG_RESULT(no)
735  fi
736elif  test "${with_factory}" = yes; then
737  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
738    AC_MSG_RESULT(yes)
739    AC_DEFINE(HAVE_FACTORY)
740    will_have_factory=yes
741    NEED_LIBS="-lsingcf ${NEED_LIBS}"
742  else
743    AC_MSG_RESULT(no)
744    AC_MSG_ERROR(can not build with factory)
745  fi
746else
747  AC_MSG_RESULT(no)
748fi
749
750AC_MSG_CHECKING(whether to have libfac)
751if test "${with_libfac}" != yes && test "${with_libfac}" != no; then
752  if (test "${will_have_factory}" = yes) && \
753     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
754    AC_MSG_RESULT(yes)
755    AC_DEFINE(HAVE_LIBFAC_P)
756    NEED_LIBS="-lsingfac ${NEED_LIBS}"
757  else
758    AC_MSG_RESULT(no)
759  fi
760elif  test "${with_libfac}" = yes; then
761  if (test "${will_have_factory}" = yes) && \
762     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
763    AC_MSG_RESULT(yes)
764    AC_DEFINE(HAVE_LIBFAC_P)
765    NEED_LIBS="-lsingfac ${NEED_LIBS}"
766  else
767    AC_MSG_RESULT(no)
768    AC_MSG_ERROR(can not build with libfac)
769  fi
770else
771  AC_MSG_RESULT(no)
772fi
773
774
775AC_SUBST(NEED_LIBS)
776
777AC_MSG_CHECKING(whether to have dbm links)
778if test "$with_dbm" != no; then
779  AC_DEFINE(HAVE_DBM)
780  AC_MSG_RESULT(yes)
781else
782  AC_MSG_RESULT(no)
783fi
784
785AC_MSG_CHECKING(whether to have namespaces)
786if test "$with_namespaces" != yes; then
787  AC_MSG_RESULT(no)
788else
789  AC_DEFINE(HAVE_NAMESPACES)
790  AC_MSG_RESULT(yes)
791fi
792
793AC_MSG_CHECKING(whether to have dynamic modules)
794if test "$with_dynamic_modules" != yes || test "$ac_have_dl" != yes; then
795  AC_MSG_RESULT(no)
796else
797  AC_DEFINE(HAVE_DYNAMIC_LOADING)
798  AC_MSG_RESULT(yes)
799fi
800
801AC_MSG_CHECKING(whether to have dynamic kernel)
802if test "$with_dynamic_kernel" != no && test "$ac_lib_dl" = yes; then
803  DL_KERNEL=1
804  AC_SUBST(DL_KERNEL)
805  AC_MSG_RESULT(yes)
806fi
807
808AC_MSG_CHECKING(whether to have Plural)
809if test "$with_plural" != yes; then
810  AC_MSG_RESULT(no)
811else
812  AC_DEFINE(HAVE_PLURAL)
813  AC_MSG_RESULT(yes)
814fi
815
816
817OUTPUT_MAKEFILES=Makefile
818
819if test "$ac_cv_singuname" = "ix86-Win"; then
820  OUTPUT_MAKEFILES="${OUTPUT_MAKEFILES} Singular.rc"
821fi
822
823AC_OUTPUT(${OUTPUT_MAKEFILES}, \
824 if test "$CONFIG_HEADERS"; then echo timestamp > stamp-h; fi)
Note: See TracBrowser for help on using the repository browser.