1 | dnl |
---|
2 | dnl Written by Olaf Bachmann (obachman@mathematik.uni-kl.de) |
---|
3 | dnl |
---|
4 | dnl configure.in for MP |
---|
5 | dnl Process this file with autoconf to produce a configure script. |
---|
6 | AC_INIT(MP/MP_Put.c) |
---|
7 | AC_CONFIG_HEADER(MP/MP_Config.h:MP/h/MP_Config.h.in) |
---|
8 | |
---|
9 | PRODUCT=MP |
---|
10 | VERSION=1.1.2.1 |
---|
11 | AC_SUBST(PRODUCT) |
---|
12 | AC_SUBST(VERSION) |
---|
13 | AC_DEFINE_UNQUOTED(MP_VERSION, "$VERSION") |
---|
14 | AC_CANONICAL_SYSTEM |
---|
15 | |
---|
16 | AC_PREFIX_DEFAULT(`pwd`) |
---|
17 | |
---|
18 | dnl The "philosophy" is this: |
---|
19 | dnl 1) by default the libraries are stored in ${prefix}/lib/${ARCH} |
---|
20 | dnl 2) the user can override this by setting either --exec-prefix |
---|
21 | dnl or --libdir |
---|
22 | dnl 3) If --libdir is given, then libraries are put exactly there |
---|
23 | dnl 4) If --libdir is not given, and --exec-dir is given, then |
---|
24 | dnl libraries are put into $exec_prefix/lib (as is standard) |
---|
25 | dnl 5) The same thing applies to bindir |
---|
26 | |
---|
27 | AC_MSG_CHECKING(for architecture identifier) |
---|
28 | AC_CACHE_VAL(ac_cv_arch,ac_cv_arch=`./pvmgetarch`) |
---|
29 | AC_MSG_RESULT($ac_cv_arch) |
---|
30 | |
---|
31 | if test "$libdir" = '${exec_prefix}/lib' && test "$exec_prefix" = "NONE"; then |
---|
32 | libdir='${prefix}/lib/'$ac_cv_arch |
---|
33 | fi |
---|
34 | |
---|
35 | if test "$bindir" = '${exec_prefix}/bin' && test "$exec_prefix" = "NONE"; then |
---|
36 | bindir='${prefix}/bin/'$ac_cv_arch |
---|
37 | fi |
---|
38 | |
---|
39 | dnl Check for programs |
---|
40 | AC_PROG_RANLIB |
---|
41 | AC_CHECK_PROG(AR, ar, ar, :) |
---|
42 | if test "$ac_cv_prog_AR" != ar; then |
---|
43 | AC_MSG_ERROR(*** ar program not found) |
---|
44 | fi |
---|
45 | |
---|
46 | dnl compiler stuff |
---|
47 | dnl we do not want to have "-g -O" for CFLAGS |
---|
48 | |
---|
49 | if test "$with_debug" = yes; then |
---|
50 | if test "${CFLAGS+set}" != set; then |
---|
51 | CFLAGS="-g" |
---|
52 | ac_cv_cflags_not_set=yes |
---|
53 | fi |
---|
54 | AC_DEFINE(MPT_DEBUG) |
---|
55 | else |
---|
56 | if test "${CFLAGS+set}" != set; then |
---|
57 | CFLAGS="-O" |
---|
58 | ac_cv_cflags_not_set=yes |
---|
59 | fi |
---|
60 | AC_DEFINE(NO_LOGGING) |
---|
61 | fi |
---|
62 | |
---|
63 | AC_PROG_CC |
---|
64 | AC_PROG_CPP |
---|
65 | AC_AIX |
---|
66 | |
---|
67 | dnl compiler/system specific options |
---|
68 | if test "${GCC}" != yes; then |
---|
69 | echo not using gcc, so checking for special flags and defines |
---|
70 | case "$target" in |
---|
71 | hppa1*) |
---|
72 | if test "$ac_cv_prog_CC" = cc; then |
---|
73 | echo Using HPUX native compiler with -Aa and -D_HPUX_SOURCE |
---|
74 | CFLAGS="$CFLAGS -Aa " |
---|
75 | AC_DEFUN(_HPUX_SOURCE) |
---|
76 | fi |
---|
77 | esac |
---|
78 | fi |
---|
79 | |
---|
80 | dnl add to CPPFLAGS and LDFLAGS so that ${includedir} and ${libdir} |
---|
81 | dnl are in there |
---|
82 | if test "$libdir" = '${exec_prefix}/lib'; then |
---|
83 | if test "x$exec_prefix" = xNONE; then |
---|
84 | if test "x$prefix" = xNONE; then |
---|
85 | LDFLAGS="-L${ac_default_prefix}/lib ${LDFLAGS}" |
---|
86 | else |
---|
87 | LDFLAGS="-L${prefix}/lib ${LDFLAGS}" |
---|
88 | fi |
---|
89 | else |
---|
90 | LDFLAGS="-L${exec_prefix}/lib ${LDFLAGS}" |
---|
91 | fi |
---|
92 | elif test "$libdir" = '${prefix}/lib/'$ac_cv_arch ; then |
---|
93 | if test "x$prefix" = xNONE; then |
---|
94 | LDFLAGS="-L${ac_default_prefix}/lib/$ac_cv_arch ${LDFLAGS}" |
---|
95 | else |
---|
96 | LDFLAGS="-L${prefix}/lib/$ac_cv_arch ${LDFLAGS}" |
---|
97 | fi |
---|
98 | else |
---|
99 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
100 | fi |
---|
101 | |
---|
102 | if test "$includedir" = '${prefix}/include'; then |
---|
103 | if test "x$prefix" = xNONE; then |
---|
104 | CPPFLAGS="-I${ac_default_prefix}/include ${CPPFLAGS}" |
---|
105 | else |
---|
106 | CPPFLAGS="-I${prefix}/include ${CPPFLAGS}" |
---|
107 | fi |
---|
108 | else |
---|
109 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
110 | fi |
---|
111 | |
---|
112 | dnl add to CPPFLAGS and LDFLAGS if PVM_ROOT and PVM_ARCH are set |
---|
113 | if test "${PVM_ROOT+set}" = set; then |
---|
114 | if test "$enable_mppvm" = yes || test "$with_pvm" = yes; then |
---|
115 | CPPFLAGS="${CPPFLAGS} -I${PVM_ROOT}/include" |
---|
116 | if test "${PVM_ARCH+set}" = set; then |
---|
117 | LDFLAGS="${LDFLAGS} -L{PVM_ROOT}/lib/${PVM_ARCH}" |
---|
118 | fi |
---|
119 | fi |
---|
120 | fi |
---|
121 | |
---|
122 | AC_SET_MAKE |
---|
123 | AC_FUNC_VFORK |
---|
124 | |
---|
125 | dnl |
---|
126 | dnl Lib checks --depend on enable/disable options |
---|
127 | dnl |
---|
128 | AC_ARG_ENABLE(MPT, \ |
---|
129 | [ --disable-MPT disable building of MPT library]) |
---|
130 | |
---|
131 | AC_ARG_ENABLE(gmp, \ |
---|
132 | [ --disable-gmp configure and build without gmp library]) |
---|
133 | |
---|
134 | AC_ARG_ENABLE(tests, \ |
---|
135 | [ --enable-example enable building of example programs]) |
---|
136 | |
---|
137 | AC_ARG_ENABLE(mpviewer, \ |
---|
138 | [ --enable-mpviewer enable building of mpviewer program]) |
---|
139 | |
---|
140 | AC_ARG_ENABLE(mppvm, \ |
---|
141 | [ --enable-mppvm enable building of mppvm routines]) |
---|
142 | |
---|
143 | |
---|
144 | if test "$enable_gmp" != no && test -d gmp; then |
---|
145 | CONFIG_SUBDIRS="gmp" |
---|
146 | enable_gmp=yes |
---|
147 | fi |
---|
148 | BUILD_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
149 | |
---|
150 | if test "$enable_MPT" != no && test -d MPT; then |
---|
151 | BUILD_SUBDIRS="${BUILD_SUBDIRS} MPT" |
---|
152 | fi |
---|
153 | |
---|
154 | if test "$enable_examples" = yes && test -d examples; then |
---|
155 | BUILD_SUBDIRS="${BUILD_SUBDIRS} examples" |
---|
156 | ac_check_prog=yes |
---|
157 | fi |
---|
158 | |
---|
159 | if test "$enable_mpviewer" = yes && test -d mpviewer; then |
---|
160 | BUILD_SUBDIRS="${BUILD_SUBDIRS} mpviewer" |
---|
161 | ac_check_prog=yes |
---|
162 | fi |
---|
163 | |
---|
164 | if test "$enable_mppvm" = yes && test -d mp-pvm3; then |
---|
165 | BUILD_SUBDIRS="${BUILD_SUBDIRS} mp-pvm3" |
---|
166 | ac_check_prog=yes |
---|
167 | with_pvm=yes |
---|
168 | fi |
---|
169 | |
---|
170 | AC_SUBST(BUILD_SUBDIRS) |
---|
171 | AC_SUBST(CONFIG_SUBDIRS) |
---|
172 | |
---|
173 | if test "$ac_check_prog" = yes; then |
---|
174 | AC_CHECK_LIB(m, atof) |
---|
175 | AC_CHECK_LIB(bsd, socket) |
---|
176 | AC_CHECK_LIB(gmp, mpz_init) |
---|
177 | |
---|
178 | if test "$ac_cv_lib_gmp_mpz_init" != yes || "$enable_gmp" != no; then |
---|
179 | AC_MSG_WARN(Did not find gmp library: Linking programs with MP will fail) |
---|
180 | NEED_LIBS=$LIBS |
---|
181 | else |
---|
182 | NEED_LIBS="-lgmp $LIBS" |
---|
183 | fi |
---|
184 | |
---|
185 | AC_CHECK_FUNCS(select socket gethostname gethostbyname strtol strstr) |
---|
186 | if test "$ac_cv_func_select" != yes; then |
---|
187 | AC_MSG_WARN(Did not find library containing function select) |
---|
188 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
189 | fi |
---|
190 | if test "$ac_cv_func_gethostname" != yes; then |
---|
191 | AC_MSG_WARN(Did not find library containing gethostname) |
---|
192 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
193 | fi |
---|
194 | |
---|
195 | if test "$ac_cv_func_gethostbyname" != yes; then |
---|
196 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
197 | if test "$ac_cv_lib_nsl_gethostbyname" != yes; then |
---|
198 | AC_MSG_WARN(Did not find library containing gethostname) |
---|
199 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
200 | fi |
---|
201 | fi |
---|
202 | |
---|
203 | if test "$ac_cv_func_socket" != yes; then |
---|
204 | AC_CHECK_LIB(socket, socket) |
---|
205 | if test "$ac_cv_lib_socket_socket" != yes; then |
---|
206 | AC_MSG_WARN(Did not find library containing socket) |
---|
207 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
208 | fi |
---|
209 | fi |
---|
210 | fi |
---|
211 | AC_SUBST(NEED_LIBS) |
---|
212 | |
---|
213 | dnl Do the header checks now |
---|
214 | AC_HEADER_STDC |
---|
215 | AC_HEADER_CHECK(arpa/inet.h,:, echo "*** no arpa/inet.h";exit) |
---|
216 | AC_HEADER_CHECK(assert.h,:, echo "*** no assert.h";exit) |
---|
217 | AC_HEADER_CHECK(ctype.h,:, echo "*** no ctype.h";exit) |
---|
218 | AC_HEADER_CHECK(errno.h,:, echo "*** no errno.h";exit) |
---|
219 | AC_HEADER_CHECK(netdb.h,:, echo "*** no netdb.h";exit) |
---|
220 | AC_HEADER_CHECK(netinet/in.h,:, echo "*** no netinet/in.h";exit) |
---|
221 | AC_HEADER_CHECK(netinet/tcp.h,:, echo "*** no netinet/tcp.h";exit) |
---|
222 | AC_HEADER_CHECK(signal.h,:, echo "*** no sihnal.h";exit) |
---|
223 | AC_HEADER_CHECK(stdarg.h,:, echo "*** no stdarg.h";exit) |
---|
224 | AC_HEADER_CHECK(stdio.h,:, echo "*** no stdio.h";exit) |
---|
225 | AC_HEADER_CHECK(stdlib.h,:, echo "*** no stdlib.h";exit) |
---|
226 | AC_HEADER_CHECK(string.h,:, echo "*** no string.h";exit) |
---|
227 | AC_HEADER_CHECK(stddef.h,:, echo "*** no stddef.h";exit) |
---|
228 | AC_HEADER_CHECK(values.h,:, echo "*** no values.h";exit) |
---|
229 | |
---|
230 | AC_HEADER_CHECK(fcntl.h,:, echo "*** no fcntl.h";exit) |
---|
231 | AC_HEADER_CHECK(sys/ioctl.h,:, echo "*** no sys/ioctl.h";exit) |
---|
232 | AC_HEADER_CHECK(sys/param.h,:, echo "*** no sys/param.h";exit) |
---|
233 | AC_HEADER_CHECK(sys/socket.h,:, echo "*** no sys/socket.h";exit) |
---|
234 | AC_HEADER_CHECK(sys/stat.h,:, echo "*** no sys/stat.h";exit) |
---|
235 | AC_HEADER_CHECK(sys/time.h,:, echo "*** no sys/time.h";exit) |
---|
236 | AC_HEADER_CHECK(sys/types.h,:, echo "*** no sys/types.h";exit) |
---|
237 | AC_HEADER_CHECK(sys/uio.h,:, echo "*** no sys/uio.h";exit) |
---|
238 | AC_HEADER_CHECK(sys/un.h,:, echo "*** no sys/un.h";exit) |
---|
239 | AC_HEADER_CHECK(unistd.h,:, echo "*** no unistd.h";exit) |
---|
240 | AC_HEADER_CHECK(math.h,:, echo "*** no math.h";exit) |
---|
241 | |
---|
242 | |
---|
243 | AC_CHECK_HEADERS(sys/select.h gmp.h genpari.h saclib.h) |
---|
244 | |
---|
245 | dnl Check whether mpz_ptr is defined (is not defined in earlier gmp versions) |
---|
246 | if test "$ac_cv_header_gmp_h" = yes; then |
---|
247 | AC_EGREP_HEADER(mpz_ptr, gmp.h, MPZ_PTR=mpz_ptr) |
---|
248 | if test ! "$MPZ_PTR" = mpz_ptr; then |
---|
249 | AC_EGREP_HEADER(MP_INT, gmp.h, MPZ_PTR="MP_INT*") |
---|
250 | AC_DEFINE_UNQUOTED(mpz_ptr, MP_INT*) |
---|
251 | AC_DEFINE_UNQUOTED(_mp_alloc,alloc) |
---|
252 | AC_DEFINE_UNQUOTED(_mp_size,size) |
---|
253 | AC_DEFINE_UNQUOTED(_mp_d,d) |
---|
254 | fi |
---|
255 | AC_EGREP_HEADER(mpf_ptr, gmp.h, MPF_PTR=mpf_ptr) |
---|
256 | fi |
---|
257 | |
---|
258 | dnl |
---|
259 | dnl deal with Ap Number configuration |
---|
260 | dnl |
---|
261 | AC_ARG_WITH(apint, \ |
---|
262 | [ --with-default_apint=PACKAGE use PACKAGE as MP's default ApInt format |
---|
263 | where PACKAGE can be: gmp (default), pari, |
---|
264 | saclib, none]) |
---|
265 | AC_ARG_WITH(apreal, \ |
---|
266 | [ --with-default_apreal=PACKAGE use PACKAGE as MP's default ApReal format |
---|
267 | where PACKAGE can be: gmp (default), none]) |
---|
268 | AC_ARG_WITH(gmp, \ |
---|
269 | [ --without-gmp build without gmp ApNumber routines]) |
---|
270 | |
---|
271 | AC_ARG_WITH(pari, \ |
---|
272 | [ --with-pari build with pari ApInt routines]) |
---|
273 | |
---|
274 | AC_ARG_WITH(saclib, \ |
---|
275 | [ --with-saclib build with saclib ApInt routines]) |
---|
276 | |
---|
277 | AC_ARG_WITH(tb, \ |
---|
278 | [ --with-tb build with Toolbus device interface]) |
---|
279 | |
---|
280 | AC_ARG_WITH(pvm, \ |
---|
281 | [ --with-pvm build with Pvm saclib device interface]) |
---|
282 | |
---|
283 | AC_ARG_WITH(debug, \ |
---|
284 | [ --with-debug build with debug options and logging]) |
---|
285 | |
---|
286 | AC_ARG_WITH(extra_cflags, \ |
---|
287 | [ --with-extra_cflags=cflags build with 'cflags' appended to |
---|
288 | CFLAGS given to the compiler]) |
---|
289 | |
---|
290 | AC_ARG_WITH(rsh, \ |
---|
291 | [ --with-rsh=command use 'command' as remote shell command]) |
---|
292 | |
---|
293 | dnl evaluate specifications |
---|
294 | AC_DEFINE(MP_DUMMY, 0) |
---|
295 | AC_DEFINE(MP_GMP, 1) |
---|
296 | AC_DEFINE(MP_PARI, 2) |
---|
297 | AC_DEFINE(MP_SAC, 3) |
---|
298 | |
---|
299 | if test "$with_default_apint" = none; then |
---|
300 | AC_DEFINE(MP_DEFAULT_APINT, MP_DUMMY) |
---|
301 | elif test "$with_default_apint" = pari; then |
---|
302 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
303 | AC_MSG_WARN(Need genpari.h to use pari as default ApInt format) |
---|
304 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
305 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_DUMMY) |
---|
306 | else |
---|
307 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_PARI) |
---|
308 | AC_DEFINE(MP_HAVE_PARI) |
---|
309 | fi |
---|
310 | elif test "$with_default_apint" = saclib; then |
---|
311 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
312 | AC_MSG_WARN(Need saclib.h to use saclib as default ApInt format) |
---|
313 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
314 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
315 | else |
---|
316 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_SAC) |
---|
317 | AC_DEFINE(MP_HAVE_SACLIB) |
---|
318 | fi |
---|
319 | else |
---|
320 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
321 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
322 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
323 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
324 | elif test -z "$MPZ_PTR" && test "$enable_gmp" != yes; then |
---|
325 | AC_MSG_WARN(Need gmp.h containing typedef of 'mpz_ptr' or 'MP_INT') |
---|
326 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
327 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
328 | else |
---|
329 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_GMP) |
---|
330 | AC_DEFINE(MP_HAVE_GMP_APINT) |
---|
331 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
332 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
333 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
334 | fi |
---|
335 | fi |
---|
336 | fi |
---|
337 | |
---|
338 | if test "$with_default_apreal" = none; then |
---|
339 | AC_DEFINE(MP_DEFAULT_APREAL, MP_DUMMY) |
---|
340 | else |
---|
341 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
342 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
343 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
344 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
345 | elif test -z "$MPF_PTR" && test "$enable_gmp" != yes; then |
---|
346 | AC_MSG_WARN(Need gmp.h containing tyedef of 'mpf_ptr') |
---|
347 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
348 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
349 | else |
---|
350 | AC_DEFINE(MP_DEFAULT_APREAL_FORMAT, MP_GMP) |
---|
351 | AC_DEFINE(MP_HAVE_GMP_APREAL) |
---|
352 | if test "$ac_cv_header_gmp_h" != yes ; then |
---|
353 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
354 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
355 | fi |
---|
356 | fi |
---|
357 | fi |
---|
358 | |
---|
359 | if test "$with_gmp" != no; then |
---|
360 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
361 | AC_MSG_WARN(Can not build MP with gmp ApInt routines: Need gmp.h) |
---|
362 | else |
---|
363 | AC_DEFINE(MP_HAVE_GMP) |
---|
364 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
365 | AC_MSG_WARN(Need gmp.h to build MP with gmp ApInt routines) |
---|
366 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
367 | fi |
---|
368 | fi |
---|
369 | fi |
---|
370 | |
---|
371 | if test "$with_saclib" = yes; then |
---|
372 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
373 | AC_MSG_WARN(Can not build MP with saclib ApInt routines: Need saclib.h) |
---|
374 | else |
---|
375 | AC_DEFINE(MP_HAVE_SAC) |
---|
376 | fi |
---|
377 | fi |
---|
378 | |
---|
379 | if test "$with_pari" = yes; then |
---|
380 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
381 | AC_MSG_WARN(Can not build MP with pari ApInt routines: Need genpari.h) |
---|
382 | else |
---|
383 | AC_DEFINE(MP_HAVE_PARI) |
---|
384 | AC_DEFINE(LONG_IS_32BIT) |
---|
385 | AC_CHECK_TYPE(ulong, no) |
---|
386 | if test "$ac_cv_type_ulong" = no; then |
---|
387 | AC_DEFINE(ULONG_NOT_DEFINED) |
---|
388 | fi |
---|
389 | fi |
---|
390 | fi |
---|
391 | |
---|
392 | |
---|
393 | |
---|
394 | if test "$with_tb" = yes; then |
---|
395 | AC_CHECK_HEADER(TB.h) |
---|
396 | if test "$ac_cv_header_TB_h" != yes; then |
---|
397 | AC_MSG_WARN(Can not build with Toolbus: Need TB.h) |
---|
398 | else |
---|
399 | AC_DEFINE(MP_HAVE_TB) |
---|
400 | fi |
---|
401 | fi |
---|
402 | |
---|
403 | if test "$with_pvm" = yes; then |
---|
404 | AC_CHECK_HEADER(pvm3.h) |
---|
405 | if test "$ac_cv_header_pvm3_h" != yes; then |
---|
406 | AC_MSG_WARN(Can not build with Pvm: Need pvm3.h) |
---|
407 | else |
---|
408 | AC_DEFINE(MP_HAVE_PVM) |
---|
409 | fi |
---|
410 | fi |
---|
411 | |
---|
412 | if test "${with_extra_cflags+set}" = set; then |
---|
413 | CFLAGS="$CFLAGS ${with_extra_cflags}" |
---|
414 | fi |
---|
415 | |
---|
416 | if test "${with_rsh+set}" = set; then |
---|
417 | AC_CHECK_PROG(with_rsh, ${with_rsh}, ${with_rsh}) |
---|
418 | if test "$ac_cv_prog_with_rsh" = $with_rsh; then |
---|
419 | ac_rsh_programs=${with_rsh} |
---|
420 | else |
---|
421 | ac_rsh_programs= |
---|
422 | fi |
---|
423 | fi |
---|
424 | |
---|
425 | |
---|
426 | |
---|
427 | AC_CHECK_PROG(mp_rsh, rsh, rsh, no) |
---|
428 | if test "$ac_cv_prog_mp_rsh" = rsh; then |
---|
429 | ac_rsh_programs="$ac_rsh_programs rsh" |
---|
430 | fi |
---|
431 | |
---|
432 | AC_CHECK_PROG(mp_remsh, remsh, remsh, no) |
---|
433 | if test "$ac_cv_prog_mp_remsh" = remsh; then |
---|
434 | ac_rsh_programs="$ac_rsh_programs remsh" |
---|
435 | fi |
---|
436 | |
---|
437 | AC_CHECK_PROG(mp_ssh, ssh, ssh, no) |
---|
438 | if test "$ac_cv_prog_mp_ssh" = ssh; then |
---|
439 | ac_rsh_programs="$ac_rsh_programs ssh" |
---|
440 | fi |
---|
441 | |
---|
442 | AC_MSG_CHECKING(which remote shell command to use) |
---|
443 | for mp_rsh in $ac_rsh_programs; do |
---|
444 | if $mp_rsh `hostname` -n uname \>\& /dev/null; then |
---|
445 | mp_rsh_found=$mp_rsh |
---|
446 | break; |
---|
447 | else |
---|
448 | mp_rsh_found=none |
---|
449 | fi |
---|
450 | done |
---|
451 | AC_MSG_RESULT($mp_rsh_found) |
---|
452 | if test "${mp_rsh_found}" = none; then |
---|
453 | AC_MSG_WARN("No working remote shell command found") |
---|
454 | else |
---|
455 | AC_DEFINE_UNQUOTED(MP_RSH_COMMAND, "$mp_rsh_found") |
---|
456 | fi |
---|
457 | |
---|
458 | dnl Check for external memory managements |
---|
459 | AC_ARG_WITH(malloc, \ |
---|
460 | [ --with-malloc=HEADER use external malloc routines declared in HEADER]) |
---|
461 | |
---|
462 | if test "${with_malloc+set}" = set; then |
---|
463 | AC_CHECK_HEADER(${with_malloc},,with_malloc=) |
---|
464 | fi |
---|
465 | AC_MSG_CHECKING(where malloc rotuines come from) |
---|
466 | if test "${with_malloc+set}" = set; then |
---|
467 | AC_MSG_RESULT(${with_malloc}) |
---|
468 | AC_DEFINE(WITH_EXTERNAL_MALLOC) |
---|
469 | AC_DEFINE_UNQUOTED(EXTERNAL_MALLOC_H, "${with_malloc}") |
---|
470 | else |
---|
471 | AC_MSG_RESULT(stdlib.h) |
---|
472 | fi |
---|
473 | |
---|
474 | |
---|
475 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
476 | AC_C_BIGENDIAN |
---|
477 | AC_C_CONST |
---|
478 | AC_TYPE_SIZE_T |
---|
479 | AC_HEADER_TIME |
---|
480 | |
---|
481 | dnl miscellanous stuff |
---|
482 | dnl check for sizeof(long) |
---|
483 | AC_CHECK_SIZEOF(long, 4) |
---|
484 | if test "$ac_cv_sizeof_long" != 4; then |
---|
485 | AC_MSG_ERROR(Need sizeof long to equal 4) |
---|
486 | fi |
---|
487 | |
---|
488 | dnl add some defines for if pari is used |
---|
489 | |
---|
490 | CLEAN="rm -f *~ a.out core *.o .log" |
---|
491 | AC_SUBST(CLEAN) |
---|
492 | |
---|
493 | dnl if we use GCC, then we know CFLAGS best and do not let user overwrite it |
---|
494 | if test "${GCC}" = yes && test "$ac_cv_cflags_not_set" = yes; then |
---|
495 | if test "$with_debug" = yes; then |
---|
496 | CFLAGS="-g -Wall -Wno-unused ${with_extra_cflags}" |
---|
497 | else |
---|
498 | CFLAGS="-O3 -w -fomit-frame-pointer ${with_extra_cflags}" |
---|
499 | fi |
---|
500 | fi |
---|
501 | |
---|
502 | dnl check for args to pass to subconfigure |
---|
503 | if test "$prefix" = NONE; then |
---|
504 | ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" |
---|
505 | fi |
---|
506 | |
---|
507 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
508 | |
---|
509 | AC_OUTPUT(Makefile MP/Makefile MPT/Makefile mpviewer/Makefile \ |
---|
510 | mp-pvm3/Makefile examples/Makefile, \ |
---|
511 | if test "$CONFIG_HEADERS"; then echo timestamp > MP/stamp-h; fi) |
---|