source: git/configure.in @ 974ce1

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