source: git/configure.in @ adeaee

spielwiese
Last change on this file since adeaee was adeaee, checked in by Olaf Bachmann <obachman@…>, 27 years ago
Thu May 22 16:50:33 1997 Olaf Bachmann <obachman@schlupp.mathematik.uni-kl.de (Olaf Bachmann)> * configure.in/acconfig.h: added HAVE_BUITIN_GMP to defines git-svn-id: file:///usr/local/Singular/svn/trunk@316 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 9.8 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2AC_INIT(Singular/matpol.h)
3AC_PREFIX_DEFAULT(`pwd`)
4
5AC_CANONICAL_SYSTEM
6
7
8dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
9dnl those are needed to check for libs and headers, later on
10dnl
11AC_PROG_CC
12AC_PROG_CPP
13AC_AIX
14
15dnl and add to -I to CPPFLAGS and and -Lto LDFLAGS, just to be sure
16if test "$libdir" = '${exec_prefix}/lib'; then
17  if test "x$exec_prefix" = xNONE; then
18    if test "x$prefix" = xNONE; then
19      LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}"
20    else
21      LDFLAGS="-L${prefix}/lib ${LDFLAGS}"
22    fi
23  else
24    LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}"
25  fi
26else
27  LDFLAGS="-L${libdir} ${LDFLAGS}"
28fi
29
30if test "$includedir" = '${prefix}/include'; then
31  if test "x$prefix" = xNONE; then
32    CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}"
33  else
34    CPPFLAGS="-I${prefix}/include ${CPPFLAGS}"
35  fi
36else
37  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
38fi
39
40dnl pass default prefix on to subdirs, if not explicitely given as an option
41if test "x$prefix" = xNONE; then
42  ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix"
43fi
44
45AC_MSG_CHECKING(whether _AIX is defined)
46AC_CACHE_VAL(ac_cv_is_aix,
47AC_EGREP_CPP(yes,
48[#ifdef _AIX
49    yes
50#endif
51], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
52if test "$ac_cv_is_aix" = yes; then
53  AC_MSG_RESULT(yes)
54else
55  AC_MSG_RESULT(no)
56fi
57
58
59dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
60dnl check for various libraries and headers
61dnl
62AC_CHECK_LIB(m, atof)
63AC_CHECK_LIB(gmp, mpz_init)
64AC_CHECK_LIB(MP, IMP_PutGmpInt)
65AC_CHECK_LIB(MPT, MPT_GetTree)
66AC_CHECK_LIB(singcf, atof)
67AC_CHECK_LIB(singfac, atof)
68
69AC_CHECK_HEADERS(gmp.h MP.h  MPT.h factory.h factor.h)
70
71if test "$ac_cv_lib_gmp_mpz_init" = yes && \
72 test "$ac_cv_header_gmp_h" = yes; then
73    ac_gmp_ok=yes
74fi
75
76if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
77 test "$ac_cv_lib_MPT_MPT_GetTree" && \
78 test "$ac_cv_header_MP_h" = yes && \
79 test "$ac_cv_header_MPT_h" = yes; then
80  ac_MP_ok=yes
81fi
82
83if test "$ac_cv_lib_singcf_initCanonicalForm" = yes && \
84 test "$ac_cv_header_factory_h" = yes; then
85  ac_factory_ok=yes
86fi
87
88if test "$ac_cv_lib_singfac_IrrCharSeries" = yes && \
89 test "$ac_cv_header_factor_h" = yes; then
90  ac_libfac_ok=yes
91fi
92
93
94 
95dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
96dnl Check whether or not to built various packages
97dnl
98AC_ARG_ENABLE(gmp, \
99 [ --enable-PACKAGE        configure and build PACKAGE
100  --disable-PACKAGE       do not configure and build PACKAGE
101  --with-PACKAGE          use PACKAGE, provide dependent functionality
102  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
103 where PACKAGE can be:
104     gmp                  GNU multiple precision library])
105AC_ARG_ENABLE(MP, \
106 [    MP                   Multi Protocol library])
107AC_ARG_ENABLE(factory, \
108 [    factory              polynomial factorization library])
109AC_ARG_ENABLE(libfac, \
110 [    libfac               char set and modp poly factorization library])
111AC_ARG_ENABLE(Singular, \
112 [    Singular,            CAS for commutative algebra])
113
114AC_MSG_CHECKING(whether to configure and build gmp lib)
115if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
116  if test "$with_gmp" != no && test "$ac_gmp_ok" != yes; then
117    enable_gmp=yes
118  else
119    enable_gmp=no
120  fi
121fi
122if test "$enable_gmp" = yes && test -d gmp; then
123  if test "$ac_cv_is_aix" = yes && test "$GCC" = yes; then
124    AC_MSG_RESULT(no)
125    AC_MSG_WARN(Building gmp v2 with gcc results in a gmp lib with bugs)
126    AC_MSG_WARN(Install gmp v2 with another compiler first or use gmp v1.3)
127    AC_MSG_WARN(For the time being gmp is neither configured/built nor used)
128    enable_gmp=no
129    ac_configure_args="$ac_configure_args --disable-gmp"
130  else
131    AC_MSG_RESULT(yes)
132    CONFIG_SUBDIRS="gmp"
133    ac_configure_args="$ac_configure_args --enable-gmp"
134  fi
135else
136  AC_MSG_RESULT(no)
137  if  test "$enable_gmp" = yes && test ! -d gmp; then
138    AC_MSG_WARN(Did not find gmp subdirectory)
139  fi
140  enable_gmp=no
141  ac_configure_args="$ac_configure_args --disable-gmp"
142fi
143
144AC_MSG_CHECKING(whether to configure and build MP lib)
145if test "$enable_MP" != yes && test "$enable_MP" != no; then
146  if test "$with_MP" != no && test "$ac_MP_ok" != yes; then
147    enable_MP=yes
148  else
149    enable_MP=no
150  fi
151fi
152if test "$enable_MP" = yes && test -d MP; then
153  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
154    AC_MSG_RESULT(yes)
155    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
156    ac_configure_args="$ac_configure_args --enable-MP"
157  else
158    AC_MSG_RESULT(no)
159    AC_MSG_WARN(Can not build MP for Singular without having gmp)
160    enable_MP=no
161    ac_configure_args="$ac_configure_args --disable-MP"
162  fi
163else
164  AC_MSG_RESULT(no)
165  if  test "$enable_MP" = yes && test ! -d MP; then
166    AC_MSG_WARN(Did not find MP subdirectory)
167  fi
168  enable_MP=no
169  ac_configure_args="$ac_configure_args --disable-MP"
170fi
171
172if test "$with_builtingmp" = yes; then
173  enable_gmp=yes
174  ac_configure_args="$ac_configure_args --enable-gmp"
175fi
176
177AC_MSG_CHECKING(whether to configure and build factory lib)
178if test "$enable_factory" != yes && test "$enable_factory" != no; then
179  if test "$with_factory" != no && test "$ac_factory_ok" != yes; then
180    enable_factory=yes
181  else
182    enable_factory=no
183  fi
184fi
185if test "$enable_factory" = yes && test -d factory; then
186  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
187  AC_MSG_RESULT(yes)
188  CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
189  ac_configure_args="$ac_configure_args --enable-factory"
190  else
191    AC_MSG_RESULT(no)
192    AC_MSG_WARN(Can not build factory without having gmp)
193    enable_factory=no
194    ac_configure_args="$ac_configure_args --disable-factory"
195  fi
196else
197  AC_MSG_RESULT(no)
198  if  test "$enable_factory" = yes && test ! -d factory; then
199    AC_MSG_WARN(Did not find factory subdirectory)
200  fi
201  enable_factory=no
202  ac_configure_args="$ac_configure_args --disable-factory"
203fi
204
205AC_MSG_CHECKING(whether to configure and build libfac lib)
206if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
207  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then
208    enable_libfac=yes
209  else
210    enable_libfac=no
211  fi
212fi
213if test "$enable_libfac" = yes && test -d libfac; then
214  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
215  AC_MSG_RESULT(yes)
216  CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
217  ac_configure_args="$ac_configure_args --enable-libfac"
218  else
219    AC_MSG_RESULT(no)
220    AC_MSG_WARN(Can not build libfac without factory)
221    enable_libfac=no
222    ac_configure_args="$ac_configure_args --disable-libfac"
223  fi
224else
225  AC_MSG_RESULT(no)
226  if  test "$enable_libfac" = yes && test ! -d libfac; then
227    AC_MSG_WARN(Did not find libfac subdirectory)
228  fi
229  enable_libfac=no
230  ac_configure_args="$ac_configure_args --disable-libfac"
231fi
232
233AC_MSG_CHECKING(whether to configure and build Singular)
234if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
235  if test "$with_Singular" != no; then
236    enable_Singular=yes
237  else
238    enable_Singular=no
239  fi
240fi
241if test "$enable_Singular" = yes && test -d Singular; then
242  AC_MSG_RESULT(yes)
243  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
244  ac_configure_args="$ac_configure_args --enable-Singular"
245else
246  AC_MSG_RESULT(no)
247  if  test "$enable_Singular" = yes && test ! -d Singular; then
248    AC_MSG_WARN(Did not find Singular subdirectory)
249  fi
250  enable_Singular=no
251  ac_configure_args="$ac_configure_args --disable-Singular"
252fi
253
254
255dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
256dnl Check whether or not to use various packages
257dnl
258AC_MSG_CHECKING(whether to use with gmp)
259if test "$with_gmp" != no && test "$with_gmp" != yes; then
260  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
261    with_gmp=yes
262  else
263    with_gmp=no
264  fi
265  ac_configure_args="$ac_configure_args --with-gmp=$with_gmp"
266fi
267if test "$with_gmp" = yes; then
268  AC_MSG_RESULT(yes)
269else
270  AC_MSG_RESULT(no)
271fi
272
273AC_MSG_CHECKING(whether to use with MP)
274if test "$with_MP" != no && test "$with_MP" != yes; then
275  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
276    with_MP=yes
277  else
278    with_MP=no
279  fi
280  ac_configure_args="$ac_configure_args --with-MP=$with_MP"
281fi
282if test "$with_MP" = yes; then
283  AC_MSG_RESULT(yes)
284else
285  AC_MSG_RESULT(no)
286fi
287
288AC_MSG_CHECKING(whether to use with factory)
289if test "$with_factory" != no && test "$with_factory" != yes; then
290  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
291    with_factory=yes
292  else
293    with_factory=no
294  fi
295  ac_configure_args="$ac_configure_args --with-factory=$with_factory"
296fi
297if test "$with_factory" = yes; then
298  AC_MSG_RESULT(yes)
299else
300  AC_MSG_RESULT(no)
301fi
302
303AC_MSG_CHECKING(whether to use with libfac)
304if test "$with_libfac" != no && test "$with_libfac" != yes; then
305  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
306    with_libfac=yes
307  else
308    with_libfac=no
309  fi
310  ac_configure_args="$ac_configure_args --with-libfac=$with_libfac"
311fi
312if test "$with_libfac" = yes; then
313  AC_MSG_RESULT(yes)
314else
315  AC_MSG_RESULT(no)
316fi
317
318AC_MSG_CHECKING(whether to use with Singular)
319if test "$with_Singular" != no && test "$with_Singular" != yes; then
320  if test "$enable_Singular" = yes; then
321    with_Singular=yes
322  else
323    with_Singular=no
324  fi
325  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
326fi
327
328if test "$with_Singular" != no; then
329  AC_MSG_RESULT(yes)
330else
331  AC_MSG_RESULT(no)
332fi
333
334dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
335dnl Check for known subdirs
336dnl
337if test -d gmp; then
338  SUBDIRS="gmp"
339fi
340if test -d MP; then
341  SUBDIRS="$SUBDIRS MP"
342fi
343if test -d factory; then
344  SUBDIRS="$SUBDIRS factory"
345fi
346if test -d libfac; then
347  SUBDIRS="$SUBDIRS libfac"
348fi
349if test -d Singular; then
350  SUBDIRS="$SUBDIRS Singular"
351fi
352 
353
354dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
355dnl Enough --wrap it up
356dnl
357AC_PROG_MAKE_SET
358AC_SUBST(SUBDIRS)
359AC_SUBST(CONFIG_SUBDIRS)
360AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
361
362AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.