source: git/configure.in @ ebe3e8

spielwiese
Last change on this file since ebe3e8 was ebe3e8, checked in by Olaf Bachmann <obachman@…>, 27 years ago
* samll changes with version numbers git-svn-id: file:///usr/local/Singular/svn/trunk@467 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 11.4 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(Singular, \
134 [    Singular             CAS for commutative algebra])
135
136AC_ARG_WITH(MP,\
137 [ --with-PACKAGE          use PACKAGE, provide dependent functionality
138  --without-PACKAGE       do not use PACKAGE, disable dependent functionality
139 where PACKAGE can be:
140     MP                   Multi Protocol library])
141AC_ARG_WITH(factory, \
142 [    factory              polynomial factorization library])
143AC_ARG_WITH(libfac, \
144 [    libfac               char set and modp poly factorization library])
145AC_ARG_WITH(gmp, \
146 [ --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic
147                          where PACKAGE can be gmp, smallgmp, or buildin])
148
149AC_MSG_CHECKING(whether to configure and build smallgmp lib)
150if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
151  if test "$ac_smallgmp_ok" != yes && \
152   test "$ac_gmp_ok" != yes && \
153   (test "$with_apint" = smallgmp || test "${with_apint+set}" != set); then
154    enable_smallgmp=yes
155  else
156    enable_smallgmp=no
157  fi
158fi
159if test "$enable_smallgmp" = yes && test -d smallgmp; then
160  AC_MSG_RESULT(yes)
161  CONFIG_SUBDIRS="$CONFIG_SUBDIRS smallgmp"
162  enable_smallgmp=yes
163  ac_will_have_gmp=yes
164else
165  AC_MSG_RESULT(no)
166  if test "$enable_smallgmp" = yes && test ! -d smallgmp; then
167    AC_MSG_WARN(Did not find smallgmp subdir)
168  fi
169  enable_smallgmp=no
170fi
171if test "$ac_gmp_ok" != yes && \
172  test "$ac_smallgmp_ok" != yes && \
173  test "$enable_smallgmp" != yes; then
174    AC_MSG_WARN(Would rather have gmp or smallgmp to build libs and Singular)
175    ac_configure_args="$ac_configure_args --disable-gmp"
176else
177  ac_configure_args="$ac_configure_args --enable-gmp"
178fi
179
180AC_MSG_CHECKING(whether to configure and build MP lib)
181if test "$enable_MP" != yes && test "$enable_MP" != no; then
182  if test "$with_MP" != no && test "$ac_MP_ok" != yes; then
183    enable_MP=yes
184  else
185    enable_MP=no
186  fi
187fi
188if test "$enable_MP" = yes && test -d MP; then
189  if test "$ac_will_have_gmp" = yes || test "$ac_gmp_ok" = yes; then
190    AC_MSG_RESULT(yes)
191    CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
192    ac_configure_args="$ac_configure_args --enable-MP"
193  else
194    AC_MSG_RESULT(no)
195    AC_MSG_WARN(Can not build MP without having gmp)
196    enabl_MP=no
197    ac_configure_args="$ac_configure_args --disable-MP"
198  fi
199else
200  AC_MSG_RESULT(no)
201  if  test "$enable_MP" = yes && test ! -d MP; then
202    AC_MSG_WARN(Did not find MP subdirectory)
203  fi
204  enable_MP=no
205  ac_configure_args="$ac_configure_args --disable-MP"
206fi
207
208AC_MSG_CHECKING(whether to configure and build factory lib)
209if test "$enable_factory" != yes && test "$enable_factory" != no; then
210  if test "$with_factory" != no && test "$ac_factory_ok" != yes; then
211    enable_factory=yes
212  else
213    enable_factory=no
214  fi
215fi
216if test "$enable_factory" = yes && test -d factory; then
217  if test "$ac_will_have_gmp" = yes  || test "$ac_gmp_ok" = yes; then
218    AC_MSG_RESULT(yes)
219    CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
220    ac_configure_args="$ac_configure_args --enable-factory"
221  else
222    AC_MSG_RESULT(no)
223    AC_MSG_WARN(Can not build factory without having gmp)
224    enable_factory=no
225    ac_configure_args="$ac_configure_args --disable-factory"
226  fi
227else
228  AC_MSG_RESULT(no)
229  if  test "$enable_factory" = yes && test ! -d factory; then
230    AC_MSG_WARN(Did not find factory subdirectory)
231  fi
232  enable_factory=no
233  ac_configure_args="$ac_configure_args --disable-factory"
234fi
235
236AC_MSG_CHECKING(whether to configure and build libfac lib)
237if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
238  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes; then
239    enable_libfac=yes
240  else
241    enable_libfac=no
242  fi
243fi
244if test "$enable_libfac" = yes && test -d libfac; then
245  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
246  AC_MSG_RESULT(yes)
247  CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
248  ac_configure_args="$ac_configure_args --enable-libfac"
249  else
250    AC_MSG_RESULT(no)
251    AC_MSG_WARN(Can not build libfac without factory)
252    enable_libfac=no
253    ac_configure_args="$ac_configure_args --disable-libfac"
254  fi
255else
256  AC_MSG_RESULT(no)
257  if  test "$enable_libfac" = yes && test ! -d libfac; then
258    AC_MSG_WARN(Did not find libfac subdirectory)
259  fi
260  enable_libfac=no
261  ac_configure_args="$ac_configure_args --disable-libfac"
262fi
263
264AC_MSG_CHECKING(whether to configure and build Singular)
265if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
266  if test "$with_Singular" != no; then
267    enable_Singular=yes
268  else
269    enable_Singular=no
270  fi
271fi
272if test "$enable_Singular" = yes && test -d Singular; then
273  AC_MSG_RESULT(yes)
274  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
275  ac_configure_args="$ac_configure_args --enable-Singular"
276else
277  AC_MSG_RESULT(no)
278  if  test "$enable_Singular" = yes && test ! -d Singular; then
279    AC_MSG_WARN(Did not find Singular subdirectory)
280  fi
281  enable_Singular=no
282  ac_configure_args="$ac_configure_args --disable-Singular"
283fi
284
285
286dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
287dnl Check whether or not to use various packages
288dnl
289AC_MSG_CHECKING(wich apint package to use)
290if test "$with_apint" != gmp && \
291  test "$with_apint" != smallgmp && \
292  test "$with_apint" != buildin; then
293   if test "$ac_gmp_ok" = yes; then
294     with_apint=gmp
295   elif test "$ac_enable_smallgmp" = yes; then
296     with_apint=smallgmp
297   else
298     with_apint=buildin
299   fi
300  ac_configure_args="$ac_configure_args --with-apint=$with_apint"
301fi
302AC_MSG_RESULT(${with_apint})
303
304AC_MSG_CHECKING(whether to use with MP)
305if test "$with_MP" != no && test "$with_MP" != yes; then
306  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
307    with_MP=yes
308  else
309    with_MP=no
310  fi
311  ac_configure_args="$ac_configure_args --with-MP=$with_MP"
312fi
313if test "$with_MP" = yes; then
314  AC_MSG_RESULT(yes)
315else
316  AC_MSG_RESULT(no)
317fi
318
319if test "$enable_MP" = yes; then
320  if test "${with_apint}" = smallgmp; then
321    ac_configure_args="$ac_configure_args --with-default_apreal=none"
322  elif test "${with_apint}" = buildin; then
323    ac_configure_args="$ac_configure_args --with-default_apreal=none --with-default-apint=none"
324  fi
325fi
326
327AC_MSG_CHECKING(whether to use with factory)
328if test "$with_factory" != no && test "$with_factory" != yes; then
329  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
330    with_factory=yes
331  else
332    with_factory=no
333  fi
334  ac_configure_args="$ac_configure_args --with-factory=$with_factory"
335fi
336if test "$with_factory" = yes; then
337  AC_MSG_RESULT(yes)
338else
339  AC_MSG_RESULT(no)
340fi
341
342AC_MSG_CHECKING(whether to use with libfac)
343if test "$with_libfac" != no && test "$with_libfac" != yes; then
344  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
345    with_libfac=yes
346  else
347    with_libfac=no
348  fi
349  ac_configure_args="$ac_configure_args --with-libfac=$with_libfac"
350fi
351if test "$with_libfac" = yes; then
352  AC_MSG_RESULT(yes)
353else
354  AC_MSG_RESULT(no)
355fi
356
357AC_MSG_CHECKING(whether to use with Singular)
358if test "$with_Singular" != no && test "$with_Singular" != yes; then
359  if test "$enable_Singular" = yes; then
360    with_Singular=yes
361  else
362    with_Singular=no
363  fi
364  ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
365fi
366
367if test "$with_Singular" != no; then
368  AC_MSG_RESULT(yes)
369else
370  AC_MSG_RESULT(no)
371fi
372
373dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
374dnl Check for known subdirs
375dnl
376if test -d smallgmp; then
377  SUBDIRS="smallgmp"
378fi
379if test -d MP; then
380  SUBDIRS="$SUBDIRS MP"
381fi
382if test -d factory; then
383  SUBDIRS="$SUBDIRS factory"
384fi
385if test -d libfac; then
386  SUBDIRS="$SUBDIRS libfac"
387fi
388if test -d Singular; then
389  SUBDIRS="$SUBDIRS Singular"
390fi
391 
392
393dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
394dnl Enough --wrap it up
395dnl
396AC_PROG_MAKE_SET
397AC_SUBST(SUBDIRS)
398AC_SUBST(CONFIG_SUBDIRS)
399AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
400
401AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.