source: git/configure.in @ 5615cd9

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