source: git/configure.in @ 4a81ec

spielwiese
Last change on this file since 4a81ec was a04715, checked in by Olaf Bachmann <obachman@…>, 27 years ago
Sun Aug 10 19:10:54 1997 Olaf Bachmann <obachman@mathematik.uni-kl.de> * configure.in: incoporated sgroup git-svn-id: file:///usr/local/Singular/svn/trunk@607 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 12.5 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2AC_INIT(Singular/matpol.h)
3AC_PREFIX_DEFAULT(`pwd`)
4
5dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
6dnl Version business -- should be the same as in Singular subdir
7dnl
8SINGULAR_MAJOR_VERSION=1
9SINGULAR_MINOR_VERSION=1
10SINGULAR_SUB_VERSION=0
11VERSION_DATE="June 1997"
12AC_SUBST(SINGULAR_MAJOR_VERSION)
13AC_SUBST(SINGULAR_MINOR_VERSION)
14AC_SUBST(SINGULAR_SUB_VERSION)
15
16AC_CANONICAL_HOST
17AC_SUBST(host)
18
19
20dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
21dnl those are needed to check for libs and headers, later on
22dnl
23AC_PROG_CC
24AC_PROG_CPP
25AC_AIX
26
27dnl and add to -I to CPPFLAGS and and -Lto LDFLAGS, just to be sure
28if test "$libdir" = '${exec_prefix}/lib'; then
29  if test "x$exec_prefix" = xNONE; then
30    if test "x$prefix" = xNONE; then
31      LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}"
32      ac_configure_args="$ac_configure_args --libdir=${ac_default_prefix}/lib"
33    else
34      LDFLAGS="-L${prefix}/lib ${LDFLAGS}"
35      ac_configure_args="$ac_configure_args --libdir=${prefix}/lib"
36    fi
37  else
38    LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}"
39    ac_configure_args="$ac_configure_args --libdir=${exec_prefix}/lib"
40  fi
41else
42  LDFLAGS="-L${libdir} ${LDFLAGS}"
43fi
44
45if test "$includedir" = '${prefix}/include'; then
46  if test "x$prefix" = xNONE; then
47    CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}"
48    ac_configure_args="$ac_configure_args --includedir=${ac_default_prefix}/include"
49  else
50    CPPFLAGS="-I${prefix}/include ${CPPFLAGS}"
51    ac_configure_args="$ac_configure_args --includedir=${prefix}/include"
52  fi
53else
54  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
55fi
56
57dnl pass default prefix on to subdirs, if not explicitely given as an option
58if test "x$prefix" = xNONE; then
59  ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix"
60fi
61
62AC_MSG_CHECKING(whether _AIX is defined)
63AC_CACHE_VAL(ac_cv_is_aix,
64AC_EGREP_CPP(yes,
65[#ifdef _AIX
66    yes
67#endif
68], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
69if test "$ac_cv_is_aix" = yes; then
70  AC_MSG_RESULT(yes)
71else
72  AC_MSG_RESULT(no)
73fi
74
75
76dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
77dnl check for various libraries and headers
78dnl
79AC_CHECK_LIB(m, atof)
80AC_CHECK_LIB(gmp, mpq_init)
81AC_CHECK_LIB(smallgmp, mpz_init)
82AC_CHECK_LIB(MP, IMP_PutGmpInt)
83AC_CHECK_LIB(MPT, MPT_GetTree)
84AC_CHECK_LIB(singcf, atof)
85AC_CHECK_LIB(singfac, atof)
86
87AC_CHECK_HEADERS(gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h)
88
89if test "$ac_cv_lib_gmp_mpq_init" = yes && \
90 test "$ac_cv_header_gmp_h" = yes; then
91    ac_gmp_ok=yes
92fi
93
94if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \
95 test "$ac_cv_header_smallgmp_h" = yes && \
96 test "$ac_cv_header_gmp_h" = yes; then
97    ac_smallgmp_ok=yes
98fi
99
100if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
101 test "$ac_cv_lib_MPT_MPT_GetTree" && \
102 test "$ac_cv_header_MP_h" = yes && \
103 test "$ac_cv_header_MPT_h" = yes; then
104  ac_MP_ok=yes
105fi
106
107if test "$ac_cv_lib_singcf_atof" = yes && \
108 test "$ac_cv_header_factory_h" = yes; then
109  ac_factory_ok=yes
110fi
111
112if test "$ac_cv_lib_singfac_atof" = yes && \
113 test "$ac_cv_header_factor_h" = yes; then
114  ac_libfac_ok=yes
115fi
116
117
118 
119dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
120dnl Check whether or not to built various packages
121dnl
122AC_ARG_ENABLE(smallgmp, \
123 [ --enable-PACKAGE        configure and build PACKAGE
124  --disable-PACKAGE       do not configure and build PACKAGE
125 where PACKAGE can be:
126     smallgmp             minimal version of gmp written in C only])
127AC_ARG_ENABLE(MP, \
128 [    MP                   Multi Protocol library])
129AC_ARG_ENABLE(factory, \
130 [    factory              polynomial factorization library])
131AC_ARG_ENABLE(libfac, \
132 [    libfac               char set and modp poly factorization library])
133AC_ARG_ENABLE(sgroup, \
134 [    sgroup               numerical semigroup computations])
135AC_ARG_ENABLE(Singular, \
136 [    Singular             CAS for commutative algebra])
137
138AC_ARG_WITH(MP,\
139 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
140  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
141 where PACKAGE can be:
142     MP                   Multi Protocol library])
143AC_ARG_WITH(factory, \
144 [    factory              polynomial factorization library])
145AC_ARG_WITH(libfac, \
146 [    libfac               char set and modp poly factorization library])
147AC_ARG_WITH(gmp, \
148 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
149                          where PACKAGE can be gmp, smallgmp, or buildin])
150
151AC_MSG_CHECKING(whether to configure and build smallgmp lib)
152if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
153  if test "$ac_smallgmp_ok" != yes && \
154   test "$ac_gmp_ok" != yes && \
155   (test "$with_apint" = smallgmp || test "${with_apint+set}" != set); then
156    enable_smallgmp=yes
157  else
158    enable_smallgmp=no
159  fi
160fi
161if test "$enable_smallgmp" = yes && test -d smallgmp; then
162  AC_MSG_RESULT(yes)
163  CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
164  enable_smallgmp=yes
165  ac_will_have_gmp=yes
166else
167  AC_MSG_RESULT(no)
168  if test "$enable_smallgmp" = yes && test ! -d smallgmp; then
169    AC_MSG_WARN(Did not find smallgmp subdir)
170  fi
171  enable_smallgmp=no
172fi
173if test "$ac_gmp_ok" != yes && \
174  test "$ac_smallgmp_ok" != yes && \
175  test "$enable_smallgmp" != yes; then
176    AC_MSG_WARN(Would rather have gmp or smallgmp to build libs and Singular)
177    ac_configure_args="$ac_configure_args --disable-gmp"
178else
179  ac_configure_args="$ac_configure_args --enable-gmp"
180fi
181
182AC_MSG_CHECKING(whether to configure and build MP lib)
183if test "$enable_MP" != yes && test "$enable_MP" != no; then
184  if test "$with_MP" != no && test "$ac_MP_ok" != yes; then
185    enable_MP=yes
186  else
187    enable_MP=no
188  fi
189fi
190if test "$enable_MP" = yes && test -d MP; then
191  if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then
192    AC_MSG_RESULT(yes)
193    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
194    ac_configure_args="$ac_configure_args --enable-MP"
195  else
196    AC_MSG_RESULT(no)
197    AC_MSG_WARN(Can not build MP without having gmp)
198    enabl_MP=no
199    ac_configure_args="$ac_configure_args --disable-MP"
200  fi
201else
202  AC_MSG_RESULT(no)
203  if  test "$enable_MP" = yes && test ! -d MP; then
204    AC_MSG_WARN(Did not find MP subdirectory)
205  fi
206  enable_MP=no
207  ac_configure_args="$ac_configure_args --disable-MP"
208fi
209
210AC_MSG_CHECKING(whether to configure and build factory lib)
211if test "$enable_factory" != yes && test "$enable_factory" != no; then
212  if test "$with_factory" != no && test "$ac_factory_ok" != yes; then
213    enable_factory=yes
214  else
215    enable_factory=no
216  fi
217fi
218if test "$enable_factory" = yes && test -d factory; then
219  if test "$ac_will_have_gmp" = yes  || test "$ac_gmp_ok" = yes; then
220    AC_MSG_RESULT(yes)
221    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
222    ac_configure_args="$ac_configure_args --enable-factory"
223  else
224    AC_MSG_RESULT(no)
225    AC_MSG_WARN(Can not build factory without having gmp)
226    enable_factory=no
227    ac_configure_args="$ac_configure_args --disable-factory"
228  fi
229else
230  AC_MSG_RESULT(no)
231  if  test "$enable_factory" = yes && test ! -d factory; then
232    AC_MSG_WARN(Did not find factory subdirectory)
233  fi
234  enable_factory=no
235  ac_configure_args="$ac_configure_args --disable-factory"
236fi
237
238AC_MSG_CHECKING(whether to configure and build libfac lib)
239if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
240  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then
241    enable_libfac=yes
242  else
243    enable_libfac=no
244  fi
245fi
246if test "$enable_libfac" = yes && test -d libfac; then
247  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
248  AC_MSG_RESULT(yes)
249  CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
250  ac_configure_args="$ac_configure_args --enable-libfac"
251  else
252    AC_MSG_RESULT(no)
253    AC_MSG_WARN(Can not build libfac without factory)
254    enable_libfac=no
255    ac_configure_args="$ac_configure_args --disable-libfac"
256  fi
257else
258  AC_MSG_RESULT(no)
259  if  test "$enable_libfac" = yes && test ! -d libfac; then
260    AC_MSG_WARN(Did not find libfac subdirectory)
261  fi
262  enable_libfac=no
263  ac_configure_args="$ac_configure_args --disable-libfac"
264fi
265
266AC_MSG_CHECKING(whether to configure and build sgroup)
267if test "$enable_sgroup" != no; then
268    enable_sgroup=yes
269fi
270
271if test "$enable_sgroup" = yes && test -d sgroup; then
272  if test "$ac_will_have_gmp" = yes  || test "$ac_gmp_ok" = yes; then
273    if test "$enable_MP" != no || test "$ac_MP_ok" = yes; then
274      AC_MSG_RESULT(yes)
275      CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
276      ac_configure_args="$ac_configure_args --enable-sgroup"
277    else
278      AC_MSG_RESULT(no)
279      AC_MSG_WARN(Can not build sgroup without having MP)
280      enable_sgroup=no
281      ac_configure_args="$ac_configure_args --disable-sgroup"
282    fi
283  else
284    AC_MSG_RESULT(no)
285    AC_MSG_WARN(Can not build sgroup without having gmp)
286    enable_sgroup=no
287    ac_configure_args="$ac_configure_args --disable-sgroup"
288  fi
289else
290  AC_MSG_RESULT(no)
291  if  test "$enable_sgroup" = yes && test ! -d sgroup; then
292    AC_MSG_WARN(Did not find sgroup subdirectory)
293  fi
294  enable_sgroup=no
295  ac_configure_args="$ac_configure_args --disable-sgroup"
296fi
297
298AC_MSG_CHECKING(whether to configure and build Singular)
299if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
300  if test "$with_Singular" != no; then
301    enable_Singular=yes
302  else
303    enable_Singular=no
304  fi
305fi
306if test "$enable_Singular" = yes && test -d Singular; then
307  AC_MSG_RESULT(yes)
308  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
309  ac_configure_args="$ac_configure_args --enable-Singular"
310else
311  AC_MSG_RESULT(no)
312  if  test "$enable_Singular" = yes && test ! -d Singular; then
313    AC_MSG_WARN(Did not find Singular subdirectory)
314  fi
315  enable_Singular=no
316  ac_configure_args="$ac_configure_args --disable-Singular"
317fi
318
319
320dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
321dnl Check whether or not to use various packages
322dnl
323AC_MSG_CHECKING(wich apint package to use)
324if test "$with_apint" != gmp && \
325  test "$with_apint" != smallgmp && \
326  test "$with_apint" != buildin; then
327   if test "$ac_gmp_ok" = yes; then
328     with_apint=gmp
329   elif test "$ac_enable_smallgmp" = yes; then
330     with_apint=smallgmp
331   else
332     with_apint=buildin
333   fi
334  ac_configure_args="$ac_configure_args --with-apint=$with_apint"
335fi
336AC_MSG_RESULT(${with_apint})
337
338AC_MSG_CHECKING(whether to use with MP)
339if test "$with_MP" != no && test "$with_MP" != yes; then
340  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
341    with_MP=yes
342  else
343    with_MP=no
344  fi
345  ac_configure_args="$ac_configure_args --with-MP=$with_MP"
346fi
347if test "$with_MP" = yes; then
348  AC_MSG_RESULT(yes)
349else
350  AC_MSG_RESULT(no)
351fi
352
353if test "$enable_MP" = yes; then
354  if test "${with_apint}" = smallgmp; then
355    ac_configure_args="$ac_configure_args --with-default_apreal=none"
356  elif test "${with_apint}" = buildin; then
357    ac_configure_args="$ac_configure_args --with-default_apreal=none --with-default-apint=none"
358  fi
359fi
360
361AC_MSG_CHECKING(whether to use with factory)
362if test "$with_factory" != no && test "$with_factory" != yes; then
363  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
364    with_factory=yes
365  else
366    with_factory=no
367  fi
368  ac_configure_args="$ac_configure_args --with-factory=$with_factory"
369fi
370if test "$with_factory" = yes; then
371  AC_MSG_RESULT(yes)
372else
373  AC_MSG_RESULT(no)
374fi
375
376AC_MSG_CHECKING(whether to use with libfac)
377if test "$with_libfac" != no && test "$with_libfac" != yes; then
378  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
379    with_libfac=yes
380  else
381    with_libfac=no
382  fi
383  ac_configure_args="$ac_configure_args --with-libfac=$with_libfac"
384fi
385if test "$with_libfac" = yes; then
386  AC_MSG_RESULT(yes)
387else
388  AC_MSG_RESULT(no)
389fi
390
391AC_MSG_CHECKING(whether to use with Singular)
392if test "$with_Singular" != no && test "$with_Singular" != yes; then
393  if test "$enable_Singular" = yes; then
394    with_Singular=yes
395  else
396    with_Singular=no
397  fi
398  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
399fi
400
401if test "$with_Singular" != no; then
402  AC_MSG_RESULT(yes)
403else
404  AC_MSG_RESULT(no)
405fi
406
407dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
408dnl Check for known subdirs
409dnl
410if test -d smallgmp; then
411  SUBDIRS="smallgmp"
412fi
413if test -d MP; then
414  SUBDIRS="$SUBDIRS MP"
415fi
416if test -d factory; then
417  SUBDIRS="$SUBDIRS factory"
418fi
419if test -d libfac; then
420  SUBDIRS="$SUBDIRS libfac"
421fi
422if test -d Singular; then
423  SUBDIRS="$SUBDIRS Singular"
424fi
425 
426
427dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
428dnl Enough --wrap it up
429dnl
430AC_PROG_MAKE_SET
431AC_SUBST(SUBDIRS)
432AC_SUBST(CONFIG_SUBDIRS)
433AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
434
435AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.