source: git/Singular/configure.in @ 3a8afb6

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