source: git/Singular/configure.in @ c88397

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