source: git/configure.in @ 4c001a

fieker-DuValspielwiese
Last change on this file since 4c001a was 4c001a, checked in by Olaf Bachmann <obachman@…>, 27 years ago
Merged fixes from 1-0-0 release git-svn-id: file:///usr/local/Singular/svn/trunk@358 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_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, mpz_init)
65AC_CHECK_LIB(MP, IMP_PutGmpInt)
66AC_CHECK_LIB(MPT, MPT_GetTree)
67AC_CHECK_LIB(singcf, atof)
68AC_CHECK_LIB(singfac, atof)
69
70AC_CHECK_HEADERS(gmp.h MP.h  MPT.h factory.h factor.h)
71
72if test "$ac_cv_lib_gmp_mpz_init" = yes && \
73 test "$ac_cv_header_gmp_h" = yes; then
74    ac_gmp_ok=yes
75fi
76
77if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
78 test "$ac_cv_lib_MPT_MPT_GetTree" && \
79 test "$ac_cv_header_MP_h" = yes && \
80 test "$ac_cv_header_MPT_h" = yes; then
81  ac_MP_ok=yes
82fi
83
84if test "$ac_cv_lib_singcf_atof" = yes && \
85 test "$ac_cv_header_factory_h" = yes; then
86  ac_factory_ok=yes
87fi
88
89if test "$ac_cv_lib_singfac_atof" = yes && \
90 test "$ac_cv_header_factor_h" = yes; then
91  ac_libfac_ok=yes
92fi
93
94
95 
96dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
97dnl Check whether or not to built various packages
98dnl
99AC_ARG_ENABLE(gmp, \
100 [ --enable-PACKAGE        configure and build PACKAGE
101  --disable-PACKAGE       do not configure and build PACKAGE
102  --with-PACKAGE          use PACKAGE, provide dependent functionality
103  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
104 where PACKAGE can be:
105     gmp                  GNU multiple precision library])
106AC_ARG_ENABLE(MP, \
107 [    MP                   Multi Protocol library])
108AC_ARG_ENABLE(factory, \
109 [    factory              polynomial factorization library])
110AC_ARG_ENABLE(libfac, \
111 [    libfac               char set and modp poly factorization library])
112AC_ARG_ENABLE(Singular, \
113 [    Singular,            CAS for commutative algebra])
114
115AC_MSG_CHECKING(whether to configure and build gmp lib)
116if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
117  if test "$with_gmp" != no && test "$ac_gmp_ok" != yes; then
118    enable_gmp=yes
119  else
120    enable_gmp=no
121  fi
122fi
123if test "$enable_gmp" = yes && test -d gmp; then
124  if test "$ac_cv_is_aix" = yes && test "$GCC" = yes; then
125    AC_MSG_RESULT(no)
126    AC_MSG_WARN(Building gmp v2 with gcc results in a gmp lib with bugs)
127    AC_MSG_WARN(Install gmp v2 with another compiler first or use gmp v1.3)
128    AC_MSG_WARN(For the time being gmp is neither configured/built nor used)
129    enable_gmp=no
130    ac_configure_args="$ac_configure_args --disable-gmp"
131  else
132    AC_MSG_RESULT(yes)
133    CONFIG_SUBDIRS="gmp"
134    ac_configure_args="$ac_configure_args --enable-gmp"
135  fi
136else
137  AC_MSG_RESULT(no)
138  if  test "$enable_gmp" = yes && test ! -d gmp; then
139    AC_MSG_WARN(Did not find gmp subdirectory)
140  fi
141  enable_gmp=no
142  ac_configure_args="$ac_configure_args --disable-gmp"
143fi
144
145AC_MSG_CHECKING(whether to configure and build MP lib)
146if test "$enable_MP" != yes && test "$enable_MP" != no; then
147  if test "$with_MP" != no && test "$ac_MP_ok" != yes; then
148    enable_MP=yes
149  else
150    enable_MP=no
151  fi
152fi
153if test "$enable_MP" = yes && test -d MP; then
154  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
155    AC_MSG_RESULT(yes)
156    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
157    ac_configure_args="$ac_configure_args --enable-MP"
158  else
159    AC_MSG_RESULT(no)
160    AC_MSG_WARN(Can not build MP for Singular without having gmp)
161    enable_MP=no
162    ac_configure_args="$ac_configure_args --disable-MP"
163  fi
164else
165  AC_MSG_RESULT(no)
166  if  test "$enable_MP" = yes && test ! -d MP; then
167    AC_MSG_WARN(Did not find MP subdirectory)
168  fi
169  enable_MP=no
170  ac_configure_args="$ac_configure_args --disable-MP"
171fi
172
173if test "$with_builtingmp" = yes; then
174  enable_gmp=yes
175  ac_configure_args="$ac_configure_args --enable-gmp"
176fi
177
178AC_MSG_CHECKING(whether to configure and build factory lib)
179if test "$enable_factory" != yes && test "$enable_factory" != no; then
180  if test "$with_factory" != no && test "$ac_factory_ok" != yes; then
181    enable_factory=yes
182  else
183    enable_factory=no
184  fi
185fi
186if test "$enable_factory" = yes && test -d factory; then
187  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
188  AC_MSG_RESULT(yes)
189  CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
190  ac_configure_args="$ac_configure_args --enable-factory"
191  else
192    AC_MSG_RESULT(no)
193    AC_MSG_WARN(Can not build factory without having gmp)
194    enable_factory=no
195    ac_configure_args="$ac_configure_args --disable-factory"
196  fi
197else
198  AC_MSG_RESULT(no)
199  if  test "$enable_factory" = yes && test ! -d factory; then
200    AC_MSG_WARN(Did not find factory subdirectory)
201  fi
202  enable_factory=no
203  ac_configure_args="$ac_configure_args --disable-factory"
204fi
205
206AC_MSG_CHECKING(whether to configure and build libfac lib)
207if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
208  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then
209    enable_libfac=yes
210  else
211    enable_libfac=no
212  fi
213fi
214if test "$enable_libfac" = yes && test -d libfac; then
215  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
216  AC_MSG_RESULT(yes)
217  CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
218  ac_configure_args="$ac_configure_args --enable-libfac"
219  else
220    AC_MSG_RESULT(no)
221    AC_MSG_WARN(Can not build libfac without factory)
222    enable_libfac=no
223    ac_configure_args="$ac_configure_args --disable-libfac"
224  fi
225else
226  AC_MSG_RESULT(no)
227  if  test "$enable_libfac" = yes && test ! -d libfac; then
228    AC_MSG_WARN(Did not find libfac subdirectory)
229  fi
230  enable_libfac=no
231  ac_configure_args="$ac_configure_args --disable-libfac"
232fi
233
234AC_MSG_CHECKING(whether to configure and build Singular)
235if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
236  if test "$with_Singular" != no; then
237    enable_Singular=yes
238  else
239    enable_Singular=no
240  fi
241fi
242if test "$enable_Singular" = yes && test -d Singular; then
243  AC_MSG_RESULT(yes)
244  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
245  ac_configure_args="$ac_configure_args --enable-Singular"
246else
247  AC_MSG_RESULT(no)
248  if  test "$enable_Singular" = yes && test ! -d Singular; then
249    AC_MSG_WARN(Did not find Singular subdirectory)
250  fi
251  enable_Singular=no
252  ac_configure_args="$ac_configure_args --disable-Singular"
253fi
254
255
256dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
257dnl Check whether or not to use various packages
258dnl
259AC_MSG_CHECKING(whether to use with gmp)
260if test "$with_gmp" != no && test "$with_gmp" != yes; then
261  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
262    with_gmp=yes
263  else
264    with_gmp=no
265  fi
266  ac_configure_args="$ac_configure_args --with-gmp=$with_gmp"
267fi
268if test "$with_gmp" = yes; then
269  AC_MSG_RESULT(yes)
270else
271  AC_MSG_RESULT(no)
272fi
273
274AC_MSG_CHECKING(whether to use with MP)
275if test "$with_MP" != no && test "$with_MP" != yes; then
276  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
277    with_MP=yes
278  else
279    with_MP=no
280  fi
281  ac_configure_args="$ac_configure_args --with-MP=$with_MP"
282fi
283if test "$with_MP" = yes; then
284  AC_MSG_RESULT(yes)
285else
286  AC_MSG_RESULT(no)
287fi
288
289AC_MSG_CHECKING(whether to use with factory)
290if test "$with_factory" != no && test "$with_factory" != yes; then
291  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
292    with_factory=yes
293  else
294    with_factory=no
295  fi
296  ac_configure_args="$ac_configure_args --with-factory=$with_factory"
297fi
298if test "$with_factory" = yes; then
299  AC_MSG_RESULT(yes)
300else
301  AC_MSG_RESULT(no)
302fi
303
304AC_MSG_CHECKING(whether to use with libfac)
305if test "$with_libfac" != no && test "$with_libfac" != yes; then
306  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
307    with_libfac=yes
308  else
309    with_libfac=no
310  fi
311  ac_configure_args="$ac_configure_args --with-libfac=$with_libfac"
312fi
313if test "$with_libfac" = yes; then
314  AC_MSG_RESULT(yes)
315else
316  AC_MSG_RESULT(no)
317fi
318
319AC_MSG_CHECKING(whether to use with Singular)
320if test "$with_Singular" != no && test "$with_Singular" != yes; then
321  if test "$enable_Singular" = yes; then
322    with_Singular=yes
323  else
324    with_Singular=no
325  fi
326  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
327fi
328
329if test "$with_Singular" != no; then
330  AC_MSG_RESULT(yes)
331else
332  AC_MSG_RESULT(no)
333fi
334
335dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
336dnl Check for known subdirs
337dnl
338if test -d gmp; then
339  SUBDIRS="gmp"
340fi
341if test -d MP; then
342  SUBDIRS="$SUBDIRS MP"
343fi
344if test -d factory; then
345  SUBDIRS="$SUBDIRS factory"
346fi
347if test -d libfac; then
348  SUBDIRS="$SUBDIRS libfac"
349fi
350if test -d Singular; then
351  SUBDIRS="$SUBDIRS Singular"
352fi
353 
354
355dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
356dnl Enough --wrap it up
357dnl
358AC_PROG_MAKE_SET
359AC_SUBST(SUBDIRS)
360AC_SUBST(CONFIG_SUBDIRS)
361AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
362
363AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.