source: git/Singular/configure.in @ 98d771

spielwiese
Last change on this file since 98d771 was 98d771, checked in by Olaf Bachmann <obachman@…>, 27 years ago
Fri May 23 13:17:24 1997 Olaf Bachmann <obachman@schlupp.mathematik.uni-kl.de (Olaf Bachmann)> * configure.in: added option --without-info git-svn-id: file:///usr/local/Singular/svn/trunk@324 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 10.9 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(matpol.h)
3AC_CONFIG_HEADER(mod2.h)
4
5dnl
6dnl set the version here
7dnl
8SINGULAR_MAJOR_VERSION=1
9SINGULAR_MINOR_VERSION=0
10SINGULAR_SUB_VERSION=0
11VERSION_DATE="Beta, May 1997"
12AC_SUBST(SINGULAR_MAJOR_VERSION)
13AC_SUBST(SINGULAR_MINOR_VERSION)
14AC_SUBST(SINGULAR_SUB_VERSION)
15AC_DEFINE_UNQUOTED(SINGULAR_MAJOR_VERSION, ${SINGULAR_MAJOR_VERSION})
16AC_DEFINE_UNQUOTED(SINGULAR_MINOR_VERSION, ${SINGULAR_MINOR_VERSION})
17AC_DEFINE_UNQUOTED(S_VERSION1, "version: ${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION}.${SINGULAR_SUB_VERSION}")
18AC_DEFINE_UNQUOTED(S_VERSION2, "${VERSION_DATE}")
19
20dnl
21dnl paths stuff
22dnl
23AC_PREFIX_DEFAULT(`pwd`/..)
24
25dnl
26if test "x$datadir" = 'x${prefix}/share'; then
27  if test "x${prefix}" = xNONE; then
28    singulardatadir=${ac_default_prefix}/share/Singular;
29  else
30    singulardatadir=${prefix}/share/Singular;
31  fi
32else
33  singulardatadir=${datadir}/Singular;
34fi
35
36if test "x$infodir" = 'x${prefix}/info'; then
37  if test "x${prefix}" = xNONE; then
38    singularinfodir=${ac_default_prefix}/info;
39  else
40    singularinfodir=${prefix}/info;
41  fi
42else
43  singularinfodir=$infodir;
44fi
45AC_DEFINE_UNQUOTED(SINGULAR_DATADIR, "${singulardatadir}")
46AC_DEFINE_UNQUOTED(SINGULAR_INFODIR, "${singularinfodir}")
47
48AC_SUBST(singulardatadir)
49
50dnl
51dnl Checks for programs.
52dnl
53
54dnl compiler stuff
55dnl we do not want to have "-g -O" for CFLAGS 
56if test "${CXXFLAGS+set}" != set; then
57  CXXFLAGS="-O"
58fi
59if test "${CFLAGS+set}" != set; then
60  CFLAGS="-O"
61fi
62
63AC_PROG_CC
64AC_PROG_CPP
65AC_PROG_CXX
66AC_SET_MAKE
67
68dnl we prefer using gcc for compiling C++ files
69if test ${GXX} = yes; then
70  CXX=gcc
71fi 
72
73dnl and add to -I to CPPFLAGS and and -Lto LDFLAGS, just to be sure
74if test "$libdir" = '${exec_prefix}/lib'; then
75  if test "x$exec_prefix" = xNONE; then
76    if test "x$prefix" = xNONE; then
77      LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}"
78    else
79      LDFLAGS="-L${prefix}/lib ${LDFLAGS}"
80    fi
81  else
82    LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}"
83  fi
84else
85  LDFLAGS="-L${libdir} ${LDFLAGS}"
86fi
87
88if test "$includedir" = '${prefix}/include'; then
89  if test "x$prefix" = xNONE; then
90    CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}"
91  else
92    CPPFLAGS="-I${prefix}/include ${CPPFLAGS}"
93  fi
94else
95  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
96fi
97
98dnl programs to built the grammar/parser
99dnl check for info
100if test "$with_info" != no; then
101  AC_CHECK_PROG(INFO, info, info)
102  if test -n "$INFO"; then
103    AC_DEFINE(HAVE_INFO)
104  fi
105fi
106
107 
108dnl
109dnl CHECK --without arguments
110dnl
111AC_ARG_WITH(
112  readline,
113  [  --without-readline   do not use readline for fancy display])
114
115AC_ARG_WITH(
116  gmp,
117  [  --without-gmp        do not use gmp library])
118   
119AC_ARG_WITH(
120  MP,
121  [  --without-MP         do not use MP (disables MP links)])
122
123AC_ARG_WITH(
124  dbm,
125  [  --without-dbm        do not use dbm (disables DBM links)])
126AC_ARG_WITH(
127  info,
128  [  --without-info       do not use info for help (use buildin help, instead)])
129AC_ARG_WITH(
130  dld,
131  [  --without-dld        do not use dld (disables dynamic linking)])
132
133AC_ARG_WITH(
134  factory,
135  [  --without-factory    do not use factory (disables poly factorization)])
136
137AC_ARG_WITH(
138  libfac,
139  [  --without-libfac     do not use libfac (disables primary decompositions)])
140
141dnl without info !
142
143dnl
144dnl CHECK VARIOUS LIBRARIES
145dnl for gmp, MP, factory and libfac, we built them in, even if the libs
146dnl and headers were not found under the condition that the respective
147dnl  --enable argument was given
148dnl
149 
150AC_CHECK_LIB(m, atof)
151AC_CHECK_LIB(bsd, socket)
152AC_CHECK_LIB(socket, listen)
153AC_CHECK_LIB(nsl, gethostbyname)
154
155dnl Check -lreadline
156if test "$with_readline" != no; then
157  AC_CHECK_LIB(ncurses,tgetent,,\
158   AC_CHECK_LIB(curses,tgetent,,\
159   AC_CHECK_LIB(termcap,tgetent)))
160  AC_CHECK_LIB(readline, rl_abort)
161  if test "$ac_cv_lib_readline_rl_abort" = yes; then
162     AC_CHECK_HEADERS(readline/readline.h readline/history.h sys/file.h,ac_readline_ok=yes,ac_readline_ok=no; break)
163   fi
164   if test "$ac_readline_ok" = yes; then
165     AC_DEFINE(HAVE_READLINE)
166   else
167     AC_MSG_WARN(building without readline: disabling fancy display);
168     AC_DEFINE(HAVE_FEREAD)
169   fi
170 else
171   AC_DEFINE(HAVE_FEREAD)
172fi
173 
174dnl Check dbm
175if test "$with_dbm" != no; then
176  AC_CHECK_LIB(
177    dbm,
178    dbminit,
179    AC_DEFINE(HAVE_DBM) LIBS="-ldbm $LIBS",
180    AC_CHECK_LIB(
181      gdbm,
182      dbminit,
183      AC_DEFINE(HAVE_DBM) LIBS="-lgdbm $LIBS",
184      AC_MSG_WARN(building without dbm: disabling DBM links)))
185fi
186
187dnl Check dld
188if test "$with_dld" = yes; then
189  AC_CHECK_LIB(dld, dld_init,\
190   AC_MSG_WARN(building without dld: disabling dynamic linking))
191fi
192
193NEED_LIBS=$LIBS
194
195dnl Check gmp
196if test "$with_builtingmp" = yes; then
197  AC_DEFINE(HAVE_BUILTIN_GMP)
198  AC_DEFINE(HAVE_GMP)
199  ac_gmp_ok=yes
200elif test "$with_gmp" != no; then
201  AC_CHECK_LIB(gmp, mpz_init)
202  AC_CHECK_HEADER(gmp.h)
203  if test "$ac_cv_lib_gmp_mpz_init" = yes && \
204   test "$ac_cv_header_gmp_h" = yes; then
205    AC_DEFINE(HAVE_GMP)
206    NEED_LIBS="-lgmp ${NEED_LIBS}"
207    ac_gmp_ok=yes
208  elif test "$enable_gmp" = yes; then
209    AC_DEFINE(HAVE_GMP)
210    NEED_LIBS="-lgmp ${NEED_LIBS}"
211    ac_gmp_ok=yes
212    AC_MSG_WARN(install gmp before making Singular or configure --without-gmp)
213  else
214    AC_MSG_WARN(building without gmp: using build-in rational arithmetic)
215  fi
216fi
217
218dnl Check MP
219WITH_MP=no
220if test "$with_MP" != no; then
221  if test "$ac_gmp_ok" != yes; then
222    AC_MSG_WARN(building without MP: can not use MP without gmp)
223  else
224    if test "$ac_cv_lib_gmp_mpz_init"=yes; then
225      AC_CHECK_LIB(MP, IMP_PutGmpInt)
226      AC_CHECK_LIB(MPT, MPT_GetTree)
227    fi
228    AC_CHECK_HEADERS(MP.h MPT.h)
229    if test "$ac_cv_lib_MPT_MPT_GetTree" = yes && \
230     test "$ac_cv_header_MP_h" = yes && \
231     test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
232     test "$ac_cv_header_MPT_h" = yes; then
233      AC_DEFINE(HAVE_MPSR)
234      NEED_LIBS="-lMPT -lMP ${NEED_LIBS}"
235      WITH_MP=yes
236    elif test "$enable_MP" = yes; then
237      AC_DEFINE(HAVE_MPSR)
238      NEED_LIBS="-lMPT -lMP ${NEED_LIBS}"
239      WITH_MP=yes
240      AC_MSG_WARN(install MP before making Singular or configure --without-MP)
241    else
242      AC_MSG_WARN(building without MP: disabling MP links)
243    fi
244  fi
245fi
246AC_SUBST(WITH_MP)
247
248dnl Check factory
249WITH_FACTORY=no
250if test "$with_factory" != no; then
251  if test "$ac_gmp_ok" != yes; then
252    AC_MSG_WARN(building without factory: can not use factory without gmp)
253  else
254    if test "$ac_cv_lib_gmp_mpz_init"=yes;then
255      AC_CHECK_LIB(singcf,atof)
256    fi
257    AC_CHECK_HEADERS(factory.h)
258    if test "$ac_cv_lib_singcf_atof" = yes && \
259     test "$ac_cv_header_factory_h" = yes; then
260      AC_DEFINE(HAVE_FACTORY)
261      NEED_LIBS="-lsingcf ${NEED_LIBS}"
262      WITH_FACTORY=yes
263    elif test "$enable_factory" = yes; then
264      NEED_LIBS="-lsingcf ${NEED_LIBS}"
265      AC_DEFINE(HAVE_FACTORY)
266      WITH_FACTORY=yes
267      AC_MSG_WARN(install factory before making Singular or configure --without-factory)
268    else
269      AC_MSG_WARN(building without factory: disabling poly factorization)
270    fi
271  fi
272fi
273AC_SUBST(WITH_FACTORY)
274
275dnl Check libfac
276WITH_LIBFAC=no
277if test "$with_libfac" != no; then
278  if test "${WITH_FACTORY}" != yes; then
279    AC_MSG_WARN(building without libfac: can not use libfac without factory)
280  else
281    if test "$ac_cv_lib_singcf_atof" = yes; then
282      AC_CHECK_LIB(singfac,atof)
283    fi
284    AC_CHECK_HEADERS(factor.h)
285    if test "$ac_cv_lib_singfac_atof" = yes && \
286     test "$ac_cv_header_factor_h" = yes; then
287      NEED_LIBS="-lsingfac ${NEED_LIBS}"
288      AC_DEFINE(HAVE_LIBFAC_P)
289      WITH_LIBFAC=yes
290    elif test "$enable_libfac" = yes; then
291      NEED_LIBS="-lsingfac ${NEED_LIBS}"
292      AC_DEFINE(HAVE_LIBFAC_P)
293      WITH_LIBFAC=yes
294      AC_MSG_WARN(install libfac before making Singular or configure --without-libfac)
295    else
296      AC_MSG_WARN(building without libfac: disabling char series)
297    fi
298  fi
299fi
300AC_SUBST(WITH_LIBFAC)
301
302AC_SUBST(NEED_LIBS)
303
304dnl
305dnl CHECKS FOR HEADER FILES.
306dnl
307
308AC_HEADER_STDC
309
310AC_CHECK_HEADERS(limits.h unistd.h,,
311  AC_MSG_ERROR(Can not compile without limits.h unistd.h))
312
313AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/time.h sys/times.h)
314
315dnl
316dnl Checks for typedefs, structures, and compiler characteristics.
317dnl 
318AC_C_CONST
319AC_C_INLINE
320AC_TYPE_SIZE_T
321AC_HEADER_TIME
322AC_STRUCT_TM
323
324dnl
325dnl Checks for library functions.
326dnl
327AC_FUNC_ALLOCA
328AC_PROG_GCC_TRADITIONAL
329AC_FUNC_MMAP
330AC_TYPE_SIGNAL
331AC_FUNC_VPRINTF
332AC_CHECK_FUNCS(gettimeofday strstr strtod strtol atexit)
333
334dnl
335dnl System specific tests
336dnl
337
338dnl arithmetic shifts
339AC_MSG_CHECKING(whether your machine has correct arithmetic shifts)
340AC_CACHE_VAL(ac_cv_shift, AC_TRY_RUN(
341  [ int main() { if (-2 >> 1 == -1) exit(0); else exit(1); } ],
342   ac_cv_shift=yes,
343   ac_cv_shift=no,
344   1))
345if test "$ac_cv_shift" = yes; then   
346  AC_MSG_RESULT(yes)
347else
348  AC_MSG_RESULT(no)
349  AC_MSG_ERROR(need  -2 >> 1 == -1)
350fi
351
352
353dnl sizeof(int) == 4
354AC_MSG_CHECKING(whether sizeof int is four bytes)
355AC_CACHE_VAL(ac_cv_sizeof_int_equals_four, AC_TRY_RUN(
356[ int main() {if (sizeof(int) == 4)  exit(0); else exit(1); } ],
357  ac_cv_sizeof_int_equals_four=yes,
358  ac_cv_sizeof_int_equals_four=no,
359  1))
360
361if test "$ac_cv_sizeof_int_equals_four" = yes; then
362  AC_MSG_RESULT(yes)
363else
364  AC_MSG_RESULT(no)
365  AC_MSG_ERROR(need int to be four bytes long)
366fi
367
368dnl sizeof(long) == sizeof (void *)
369AC_MSG_CHECKING(whether sizeof long equals sizeof void*)
370AC_CACHE_VAL(ac_cv_sizeof_long_equals_voidp, AC_TRY_RUN(
371  [ int main() {if (sizeof(long) == sizeof(void*))  exit(0); else exit(1); }],
372    ac_cv_sizeof_long_equals_voidp=yes,
373    ac_cv_sizeof_long_equals_voidp=no,
374    1))
375if test "$ac_cv_sizeof_long_equals_voidp" = yes; then
376  AC_MSG_RESULT(yes)
377else
378  AC_MSG_RESULT(no)
379  AC_MSG_ERROR(need equal sizes for long and void*)
380fi
381
382dnl sprintf returns number of printed chars
383AC_MSG_CHECKING(whether vsprintf returns number of printed chars)
384AC_CACHE_VAL(ac_cv_returns_n_of_chars, AC_TRY_RUN(
385 [#include <stdio.h>
386 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); }],
387   ac_cv_returns_n_of_chars=yes,
388   ac_cv_returns_n_of_chars=no,
389   1))
390if test "$ac_cv_returns_n_of_chars" = yes; then
391  AC_MSG_RESULT(yes)
392else
393  AC_MSG_RESULT(no)
394  AC_DEFINE(BSD_SPRINTF)
395fi
396
397dnl determine ALIGN_8
398AC_CHECK_SIZEOF(void*,4)
399
400
401dnl
402dnl Last, but not least, customize CFLAGS
403dnl
404AC_MSG_CHECKING(whether _AIX is defined)
405AC_CACHE_VAL(ac_cv_is_aix,
406AC_EGREP_CPP(yes,
407[#ifdef _AIX
408    yes
409#endif
410], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
411if test "$ac_cv_is_aix" = yes; then
412  AC_MSG_RESULT(yes)
413else
414  AC_MSG_RESULT(no)
415fi
416
417
418if test ${GXX} = yes; then
419  CXXFLAGS="-O3 -w -fomit-frame-pointer"
420  CXXTEMPLFLAGS="-fno-implicit-templates"
421  if test "$ac_cv_is_aix" = yes; then
422    CXXNOOPTFLAGS="-O -w -fomit-frame-pointer"
423  else
424    CXXNOOPTFLAGS=$CXXFLAGS
425  fi
426else
427  CXXTEMPFLAGS=""
428  CXXNOOPTFLAGS=$CXXFLAGS
429fi
430AC_SUBST(CXXTEMPLFLAGS)
431AC_SUBST(CXXNOOPTFLAGS)
432
433if test ${GCC} = yes; then
434  CFLAGS="-O3 -w -fomit-frame-pointer"
435fi
436
437AC_OUTPUT(Makefile doc/Makefile, \
438 if test "$CONFIG_HEADERS"; then echo timestamp > stamp-h; fi)
Note: See TracBrowser for help on using the repository browser.