source: git/Singular/configure.in @ a550fd5

spielwiese
Last change on this file since a550fd5 was a550fd5, checked in by Hans Schönemann <hannes@…>, 23 years ago
*hannes: --no-exceptions stuff git-svn-id: file:///usr/local/Singular/svn/trunk@4909 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 21.5 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}
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        ;;
313esac
314AC_SUBST(LD_DYN_FLAGS)
315AC_SUBST(SFLAGS)
316AC_SUBST(SLDFLAGS)
317LIBS=${SAVE_LIBS}
318
319
320# heder file checks
321AC_HEADER_STDC
322AC_CHECK_HEADERS(limits.h unistd.h,,
323  AC_MSG_ERROR(Can not compile without limits.h unistd.h))
324
325AC_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)
326
327# typedefs, structures
328AC_C_CONST
329AC_C_INLINE
330AC_TYPE_SIZE_T
331AC_HEADER_TIME
332AC_STRUCT_TM
333
334# library functions.
335AC_FUNC_ALLOCA
336AC_PROG_GCC_TRADITIONAL
337AC_FUNC_MMAP
338AC_TYPE_SIGNAL
339AC_FUNC_VPRINTF
340AC_SEARCH_LIBS(setenv, bsd)
341AC_CHECK_FUNCS(gettimeofday atexit bcopy getcwd getwd vsnprintf readlink sleep usleep getpwnam popen setenv)
342
343
344dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
345dnl Find out more about particularity of the system
346dnl
347
348# arithmetic shifts
349AC_MSG_CHECKING(whether your machine has correct arithmetic shifts)
350AC_CACHE_VAL(ac_cv_shift, AC_TRY_RUN(
351  [ int main() { if (-2 >> 1 == -1) exit(0); else exit(1); } ],
352   ac_cv_shift=yes,
353   ac_cv_shift=no,
354   if test "$ac_c_cross_dos" = yes; then
355     ac_cv_shift=yes;
356   else
357     AC_MSG_RESULT(no)
358     AC_MSG_ERROR(cross compilation without default value)
359   fi))
360
361if test "$ac_cv_shift" = yes; then
362  AC_MSG_RESULT(yes)
363else
364  AC_MSG_RESULT(no)
365  AC_MSG_ERROR(need  -2 >> 1 == -1)
366fi
367
368
369# check for a peculiar constructor initialization
370AC_MSG_CHECKING(whether explicit C++ constructor calls are allowed)
371AC_LANG_SAVE
372AC_LANG_CPLUSPLUS
373AC_CACHE_VAL(ac_cv_explicit_const,AC_TRY_COMPILE(,
374  class testclass
375  {
376  public:
377    int value;
378    testclass() : value(0) {}
379    testclass( int i ) : value(i) {}
380    ~testclass() { value = 0; }
381  };
382
383  testclass ptr;
384  ptr.testclass(1);
385, ac_cv_explicit_const=yes, ac_cv_explicit_const=no))
386AC_LANG_RESTORE
387AC_MSG_RESULT($ac_cv_explicit_const)
388if test "$ac_cv_explicit_const" = yes; then
389  AC_DEFINE(HAVE_EXPLICIT_CONSTR)
390fi
391
392# sprintf returns number of printed chars
393AC_MSG_CHECKING(whether vsprintf returns number of printed chars)
394AC_CACHE_VAL(ac_cv_returns_n_of_chars, AC_TRY_RUN(
395 [#include <stdio.h>
396 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); }],
397   ac_cv_returns_n_of_chars=yes,
398   ac_cv_returns_n_of_chars=no,
399   ac_cv_returns_n_of_chars=no))
400if test "$ac_cv_returns_n_of_chars" = yes; then
401  AC_MSG_RESULT(yes)
402else
403  AC_MSG_RESULT(no)
404  AC_DEFINE(BSD_SPRINTF)
405fi
406
407# determine ALIGN_8
408AC_CHECK_SIZEOF(char,1)
409AC_CHECK_SIZEOF(short,2)
410AC_CHECK_SIZEOF(int,4)
411AC_CHECK_SIZEOF(long,4)
412AC_CHECK_SIZEOF(void*,4)
413AC_CHECK_SIZEOF(double, 8)
414AC_C_BIGENDIAN
415if test "$ac_cv_sizeof_int" != 4; then
416  AC_MSG_ERROR(need int to be four bytes long)
417fi
418if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then
419  AC_MSG_ERROR(need equal sizes for long and void*)
420fi
421if test "$ac_cv_sizeof_double" != 8; then
422  AC_MSG_ERROR(need double to b 8 bytes long)
423fi
424if test "$ac_cv_sizeof_voidp" != 4 && test "$ac_cv_sizeof_voidp" != 8; then
425  AC_MSG_ERROR(need void* to be 4 or 8 bytes long)
426fi
427
428dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
429dnl help for configure
430dnl
431AC_ARG_WITH(
432  rootdir,
433  [  --with-rootdir=DIR      use DIR ass compiled-in root directory
434                             (default is PREFIX)])
435AC_ARG_WITH(
436  lex,
437  [  --with-lex=[LEX,no]     uses LEX as lex program, default is flex])
438AC_ARG_WITH(
439  readline,
440  [  --with-readline=[dynamic,static,no]         
441                          do use dynamic/static/no readline for fancy display])
442AC_ARG_WITH(
443  MP,
444  [  --without-MP            do not use MP (no MP links)])
445AC_ARG_WITH(
446  dbm,
447  [  --without-dbm           do not use dbm (no DBM links)])
448AC_ARG_WITH(
449  factory,
450  [  --without-factory       do not use factory (no poly factorization)])
451AC_ARG_WITH(
452  libfac,
453  [  --without-libfac        do not use libfac (no primary decompositions)])
454AC_ARG_WITH(
455  namespaces,
456  [  --with-namespaces       do compile namespace support])
457AC_ARG_WITH(
458  dl,
459  [  --without-dl            do not use dynamic linking, modules, and kernel])
460AC_ARG_WITH(
461  dynamic-modules,
462  [  --with-dynamic-modules  do compile with dynamic modules support])
463AC_ARG_WITH(
464  dynamic-kernel,
465  [  --without-dynamic-kernel               
466                          do not compile with dynamic kernel parts])
467AC_ARG_WITH(apint,
468  [  --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic])
469AC_ARG_WITH(
470  plural,
471  [  --with-plural           do compile with Plural support])
472
473dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
474dnl check for packages we need
475dnl for gmp, MP, factory and libfac, we built them in, even if the libs
476dnl and headers were not found under the condition that the respective
477dnl  --enable argument was given
478dnl
479
480
481AC_MSG_CHECKING(whether to use dynamic linking)
482if test "$with_dl" != no && test "$ac_lib_dl" = yes; then
483  AC_DEFINE(HAVE_DL)
484  ac_have_dl=yes
485  AC_MSG_RESULT(yes)
486else
487  AC_MSG_RESULT(no)
488fi
489
490AC_CHECK_LIB(ncurses,tgetent,,\
491 AC_CHECK_LIB(curses,tgetent,,\
492  AC_CHECK_LIB(termcap,tgetent)))
493
494# readline
495if test "$with_readline" = dynamic && test "$ac_have_dl" != yes; then
496  AC_MSG_WARN(can not build dynamic readline without dynamic linking)
497  with_readline=static
498fi
499
500
501if test "$with_readline" != dynamic && test "$with_readline" != no; then
502AC_LANG_SAVE
503AC_LANG_CPLUSPLUS
504   AC_CHECK_LIB(readline, rl_abort)
505   AC_CHECK_HEADERS(readline/readline.h readline/history.h)
506   if test "$ac_cv_lib_readline_rl_abort" = yes && \
507      test "$ac_cv_header_readline_readline_h" = yes; then
508     AC_MSG_CHECKING(whether readline.h is ok)
509     AC_CACHE_VAL(ac_cv_header_readline_readline_h_ok,
510     AC_TRY_LINK(
511#include<unistd.h>
512#include<stdio.h>
513#include<readline/readline.h>
514#ifdef HAVE_READLINE_HISTORY_H
515#include<readline/history.h>
516#endif
517,
518#ifndef NULL
519#define NULL 0
520#endif
521rl_readline_name=NULL;
522*rl_line_buffer=1;
523completion_matches(NULL, filename_completion_function);
524rl_attempted_completion_function = (CPPFunction *) NULL;
525rl_outstream=NULL;
526readline(NULL);
527add_history(NULL);
528read_history(NULL);
529write_history(NULL);
530,
531ac_cv_header_readline_readline_h_ok="yes",
532ac_cv_header_readline_readline_h_ok="no",
533))
534    AC_MSG_RESULT($ac_cv_header_readline_readline_h_ok)
535    if test "$ac_cv_header_readline_readline_h_ok" != yes; then
536#not ok -- try once more with explicitly declaring everything
537      AC_MSG_CHECKING(whether or not we nevertheless can use readline)
538      AC_CACHE_VAL(ac_cv_have_readline,
539      AC_TRY_LINK(
540#include <stdio.h>
541extern "C"
542{
543extern char * rl_readline_name;
544extern char *rl_line_buffer;
545char *filename_completion_function();
546typedef char **CPPFunction ();
547extern char ** completion_matches ();
548extern CPPFunction * rl_attempted_completion_function;
549extern FILE * rl_outstream;
550char * readline ();
551void add_history ();
552int write_history ();
553int read_history();
554}
555#ifndef NULL
556#define NULL 0
557#endif
558,
559rl_readline_name=NULL;
560*rl_line_buffer=1;
561completion_matches(NULL, filename_completion_function);
562rl_attempted_completion_function = (CPPFunction *) NULL;
563rl_outstream=NULL;
564readline(NULL);
565add_history(NULL);
566read_history(NULL);
567write_history(NULL);
568,
569ac_cv_have_readline="yes"
570,
571ac_cv_have_readline="no"
572))
573      AC_MSG_RESULT($ac_cv_have_readline)
574    else
575      AC_DEFINE(READLINE_READLINE_H_OK)
576      ac_cv_have_readline="yes"
577    fi
578  fi
579  if test "$ac_cv_have_readline" = yes; then
580    AC_DEFINE(HAVE_READLINE)
581  fi
582AC_LANG_RESTORE
583fi
584
585AC_MSG_CHECKING(which readline to use)
586if test "$ac_cv_with_readline" = dynamic; then
587  AC_MSG_RESULT(dynamic)
588  AC_DEFINE(HAVE_DYN_RL)
589elif test "$ac_cv_have_readline" = yes; then
590  AC_MSG_RESULT(static)
591else
592  AC_MSG_RESULT(none)
593  AC_MSG_WARN(building without readline: disabling fancy display)
594fi
595 
596NEED_LIBS=$LIBS
597
598# gmp, smallgmp, MP, MPT, factory, libfac
599AC_CHECK_LIB(gmp, main)
600if test "ac_cv_lib_gmp_main" = yes && test "$with-apint" = smallgmp; then
601  LIBS=${NEED_LIBS}
602fi
603AC_CHECK_LIB(smallgmp, main)
604SAVE_LIBS=$LIBS
605AC_CHECK_LIB(MP, IMP_PutGmpInt,,,$MP_LIBS)
606AC_CHECK_LIB(MPT, MPT_GetTree,,,$MP_LIBS)
607LIBS=$SAVE_LIBS
608AC_CHECK_LIB(singcf, atof)
609AC_CHECK_LIB(singfac, atof)
610AC_CHECK_LIB(omalloc, omTestAddr)
611AC_CHECK_LIB(omalloc_ndebug, main)
612
613AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h omalloc.h omalloc.c)
614
615if test "$ac_cv_lib_gmp_main" = yes && \
616 test "$ac_cv_header_gmp_h" = yes; then
617    ac_gmp_ok=yes
618fi
619
620if test "$ac_cv_lib_smallgmp_main" = yes && \
621 test "$ac_cv_header_smallgmp_h" = yes && \
622 test "$ac_cv_header_gmp_h" = yes; then
623    ac_smallgmp_ok=yes
624fi
625
626if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
627 test "$ac_cv_lib_MPT_MPT_GetTree" && \
628 test "$ac_cv_header_MP_h" = yes && \
629 test "$ac_cv_header_MPT_h" = yes; then
630  ac_MP_ok=yes
631fi
632
633if test "$ac_cv_lib_singcf_atof" = yes && \
634 test "$ac_cv_header_factory_h" = yes; then
635  ac_factory_ok=yes
636fi
637
638if test "$ac_cv_lib_singfac_atof" = yes && \
639 test "$ac_cv_header_factor_h" = yes; then
640  ac_libfac_ok=yes
641fi
642
643if test "$ac_cv_lib_omalloc_omTestAddr" = yes && \
644   test "$ac_cv_lib_omalloc_ndebug_main" = yes && \
645   test "$ac_cv_header_omalloc_c" = yes && \
646   test "$ac_cv_header_omalloc_h" = yes; then
647  ac_cv_omalloc_ok=yes
648fi
649
650
651# evaluate results
652dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
653dnl make sure that omalloc is there
654dnl
655if test "$ac_cv_omalloc_ok" != yes && test "$enable_omalloc" != yes; then
656  AC_MSG_ERROR(can not build without omalloc)
657fi
658
659AC_MSG_CHECKING(which apint package to use)
660if test "${with_apint}" != gmp && test "${with_apint}" != smallgmp; then
661  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
662    AC_MSG_RESULT(gmp)
663    will_have_gmp=yes
664    NEED_LIBS="-lgmp ${NEED_LIBS}"
665  elif test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
666    AC_MSG_RESULT(smallgmp)
667    AC_DEFINE(HAVE_SMALLGMP)
668    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
669  else
670    AC_MSG_RESULT(none)
671    AC_MSG_ERROR(can not build without gmp or smallgmp)
672  fi
673elif test "${with_apint}" = gmp; then
674  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
675    AC_MSG_RESULT(gmp)
676    will_have_gmp=yes
677    NEED_LIBS="-lgmp ${NEED_LIBS}"
678  else
679    AC_MSG_RESULT(none)
680    AC_MSG_ERROR(can not build with gmp)
681  fi
682else
683  if test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
684    AC_MSG_RESULT(smallgmp)
685    AC_DEFINE(HAVE_SMALLGMP)
686    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
687  else
688    AC_MSG_RESULT(none)
689    AC_MSG_ERROR(can not build with smallgmp)
690  fi
691fi
692
693#
694AC_MSG_CHECKING(whether to have MP)
695if test "${with_MP}" != yes && test "${with_MP}" != no; then
696  if (test "${will_have_gmp}" = yes) && \
697     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
698    AC_MSG_RESULT(yes)
699    AC_DEFINE(HAVE_MPSR)
700    HAVE_MPSR=1
701    MP_LIBS="-lMPT -lMP ${MP_LIBS}"
702  else
703    AC_MSG_RESULT(no)
704  fi
705elif  test "${with_MP}" = yes; then
706  if (test "${will_have_gmp}" = yes) && \
707     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
708    AC_MSG_RESULT(yes)
709    AC_DEFINE(HAVE_MPSR)
710    HAVE_MPSR=1
711    MP_LIBS="-lMPT -lMP ${MP_LIBS}"
712  else
713    AC_MSG_RESULT(no)
714    AC_MSG_ERROR(can not build with MP)
715  fi
716else
717  AC_MSG_RESULT(no)
718fi
719AC_SUBST(HAVE_MPSR)
720AC_SUBST(MP_LIBS)
721
722AC_MSG_CHECKING(whether to have factory)
723if test "${with_factory}" != yes && test "${with_factory}" != no; then
724  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
725    AC_MSG_RESULT(yes)
726    AC_DEFINE(HAVE_FACTORY)
727    will_have_factory=yes
728    NEED_LIBS="-lsingcf ${NEED_LIBS}"
729  else
730    AC_MSG_RESULT(no)
731  fi
732elif  test "${with_factory}" = yes; then
733  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
734    AC_MSG_RESULT(yes)
735    AC_DEFINE(HAVE_FACTORY)
736    will_have_factory=yes
737    NEED_LIBS="-lsingcf ${NEED_LIBS}"
738  else
739    AC_MSG_RESULT(no)
740    AC_MSG_ERROR(can not build with factory)
741  fi
742else
743  AC_MSG_RESULT(no)
744fi
745
746AC_MSG_CHECKING(whether to have libfac)
747if test "${with_libfac}" != yes && test "${with_libfac}" != no; then
748  if (test "${will_have_factory}" = yes) && \
749     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
750    AC_MSG_RESULT(yes)
751    AC_DEFINE(HAVE_LIBFAC_P)
752    NEED_LIBS="-lsingfac ${NEED_LIBS}"
753  else
754    AC_MSG_RESULT(no)
755  fi
756elif  test "${with_libfac}" = yes; then
757  if (test "${will_have_factory}" = yes) && \
758     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
759    AC_MSG_RESULT(yes)
760    AC_DEFINE(HAVE_LIBFAC_P)
761    NEED_LIBS="-lsingfac ${NEED_LIBS}"
762  else
763    AC_MSG_RESULT(no)
764    AC_MSG_ERROR(can not build with libfac)
765  fi
766else
767  AC_MSG_RESULT(no)
768fi
769
770
771AC_SUBST(NEED_LIBS)
772
773AC_MSG_CHECKING(whether to have dbm links)
774if test "$with_dbm" != no; then
775  AC_DEFINE(HAVE_DBM)
776  AC_MSG_RESULT(yes)
777else
778  AC_MSG_RESULT(no)
779fi
780
781AC_MSG_CHECKING(whether to have namespaces)
782if test "$with_namespaces" != yes; then
783  AC_MSG_RESULT(no)
784else
785  AC_DEFINE(HAVE_NAMESPACES)
786  AC_MSG_RESULT(yes)
787fi
788
789AC_MSG_CHECKING(whether to have dynamic modules)
790if test "$with_dynamic_modules" != yes || test "$ac_have_dl" != yes; then
791  AC_MSG_RESULT(no)
792else
793  AC_DEFINE(HAVE_DYNAMIC_LOADING)
794  AC_MSG_RESULT(yes)
795fi
796
797AC_MSG_CHECKING(whether to have dynamic kernel)
798if test "$with_dynamic_kernel" != no && test "$ac_lib_dl" = yes; then
799  DL_KERNEL=1
800  AC_SUBST(DL_KERNEL)
801  AC_MSG_RESULT(yes)
802fi
803
804AC_MSG_CHECKING(whether to have Plural)
805if test "$with_plural" != yes; then
806  AC_MSG_RESULT(no)
807else
808  AC_DEFINE(HAVE_PLURAL)
809  AC_MSG_RESULT(yes)
810fi
811
812
813OUTPUT_MAKEFILES=Makefile
814
815if test "$ac_cv_singuname" = "ix86-Win"; then
816  OUTPUT_MAKEFILES="${OUTPUT_MAKEFILES} Singular.rc"
817fi
818
819AC_OUTPUT(${OUTPUT_MAKEFILES}, \
820 if test "$CONFIG_HEADERS"; then echo timestamp > stamp-h; fi)
Note: See TracBrowser for help on using the repository browser.