source: git/Singular/configure.in @ c232af

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