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 | if test "$enable_gmp" != no && test -d gmp; then |
---|
144 | CONFIG_SUBDIRS="gmp" |
---|
145 | enable_gmp=yes |
---|
146 | fi |
---|
147 | BUILD_SUBDIRS="$CONFIG_SUBDIRS MP" |
---|
148 | |
---|
149 | if test "$enable_MPT" != no && test -d MPT; then |
---|
150 | BUILD_SUBDIRS="${BUILD_SUBDIRS} MPT" |
---|
151 | fi |
---|
152 | |
---|
153 | if test "$enable_examples" = yes && test -d examples; then |
---|
154 | BUILD_SUBDIRS="${BUILD_SUBDIRS} examples" |
---|
155 | ac_check_prog=yes |
---|
156 | fi |
---|
157 | |
---|
158 | if test "$enable_mpviewer" = yes && test -d mpviewer; then |
---|
159 | BUILD_SUBDIRS="${BUILD_SUBDIRS} mpviewer" |
---|
160 | ac_check_prog=yes |
---|
161 | fi |
---|
162 | |
---|
163 | if test "$enable_mppvm" = yes && test -d mp-pvm3; then |
---|
164 | BUILD_SUBDIRS="${BUILD_SUBDIRS} mp-pvm3" |
---|
165 | ac_check_prog=yes |
---|
166 | with_pvm=yes |
---|
167 | fi |
---|
168 | |
---|
169 | AC_SUBST(BUILD_SUBDIRS) |
---|
170 | AC_SUBST(CONFIG_SUBDIRS) |
---|
171 | |
---|
172 | if test "$ac_check_prog" = yes; then |
---|
173 | AC_CHECK_LIB(m, atof) |
---|
174 | AC_CHECK_LIB(bsd, socket) |
---|
175 | AC_CHECK_LIB(gmp, mpz_init) |
---|
176 | |
---|
177 | if test "$ac_cv_lib_gmp_mpz_init" != yes || "$enable_gmp" != no; then |
---|
178 | AC_MSG_WARN(Did not find gmp library: Linking programs with MP will fail) |
---|
179 | NEED_LIBS=$LIBS |
---|
180 | else |
---|
181 | NEED_LIBS="-lgmp $LIBS" |
---|
182 | fi |
---|
183 | |
---|
184 | AC_CHECK_FUNCS(select socket gethostname gethostbyname strtol strstr) |
---|
185 | if test "$ac_cv_func_select" != yes; then |
---|
186 | AC_MSG_WARN(Did not find library containing function select) |
---|
187 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
188 | fi |
---|
189 | if test "$ac_cv_func_gethostname" != yes; then |
---|
190 | AC_MSG_WARN(Did not find library containing gethostname) |
---|
191 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
192 | fi |
---|
193 | |
---|
194 | if test "$ac_cv_func_gethostbyname" != yes; then |
---|
195 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
196 | if test "$ac_cv_lib_nsl_gethostbyname" != yes; then |
---|
197 | AC_MSG_WARN(Did not find library containing gethostname) |
---|
198 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
199 | fi |
---|
200 | fi |
---|
201 | |
---|
202 | if test "$ac_cv_func_socket" != yes; then |
---|
203 | AC_CHECK_LIB(socket, socket) |
---|
204 | if test "$ac_cv_lib_socket_socket" != yes; then |
---|
205 | AC_MSG_WARN(Did not find library containing socket) |
---|
206 | AC_MSG_WARN(Linking programs with MP might fail) |
---|
207 | fi |
---|
208 | fi |
---|
209 | fi |
---|
210 | AC_SUBST(NEED_LIBS) |
---|
211 | |
---|
212 | dnl Do the header checks now |
---|
213 | AC_HEADER_STDC |
---|
214 | AC_HEADER_CHECK(arpa/inet.h,:, echo "*** no arpa/inet.h";exit) |
---|
215 | AC_HEADER_CHECK(assert.h,:, echo "*** no assert.h";exit) |
---|
216 | AC_HEADER_CHECK(ctype.h,:, echo "*** no ctype.h";exit) |
---|
217 | AC_HEADER_CHECK(errno.h,:, echo "*** no errno.h";exit) |
---|
218 | AC_HEADER_CHECK(netdb.h,:, echo "*** no netdb.h";exit) |
---|
219 | AC_HEADER_CHECK(netinet/in.h,:, echo "*** no netinet/in.h";exit) |
---|
220 | AC_HEADER_CHECK(netinet/tcp.h,:, echo "*** no netinet/tcp.h";exit) |
---|
221 | AC_HEADER_CHECK(signal.h,:, echo "*** no sihnal.h";exit) |
---|
222 | AC_HEADER_CHECK(stdarg.h,:, echo "*** no stdarg.h";exit) |
---|
223 | AC_HEADER_CHECK(stdio.h,:, echo "*** no stdio.h";exit) |
---|
224 | AC_HEADER_CHECK(stdlib.h,:, echo "*** no stdlib.h";exit) |
---|
225 | AC_HEADER_CHECK(string.h,:, echo "*** no string.h";exit) |
---|
226 | AC_HEADER_CHECK(stddef.h,:, echo "*** no stddef.h";exit) |
---|
227 | AC_HEADER_CHECK(values.h,:, echo "*** no values.h";exit) |
---|
228 | |
---|
229 | AC_HEADER_CHECK(fcntl.h,:, echo "*** no fcntl.h";exit) |
---|
230 | AC_HEADER_CHECK(sys/ioctl.h,:, echo "*** no sys/ioctl.h";exit) |
---|
231 | AC_HEADER_CHECK(sys/param.h,:, echo "*** no sys/param.h";exit) |
---|
232 | AC_HEADER_CHECK(sys/socket.h,:, echo "*** no sys/socket.h";exit) |
---|
233 | AC_HEADER_CHECK(sys/stat.h,:, echo "*** no sys/stat.h";exit) |
---|
234 | AC_HEADER_CHECK(sys/time.h,:, echo "*** no sys/time.h";exit) |
---|
235 | AC_HEADER_CHECK(sys/types.h,:, echo "*** no sys/types.h";exit) |
---|
236 | AC_HEADER_CHECK(sys/uio.h,:, echo "*** no sys/uio.h";exit) |
---|
237 | AC_HEADER_CHECK(sys/un.h,:, echo "*** no sys/un.h";exit) |
---|
238 | AC_HEADER_CHECK(unistd.h,:, echo "*** no unistd.h";exit) |
---|
239 | AC_HEADER_CHECK(math.h,:, echo "*** no math.h";exit) |
---|
240 | |
---|
241 | |
---|
242 | AC_CHECK_HEADERS(sys/select.h gmp.h genpari.h saclib.h) |
---|
243 | |
---|
244 | dnl Check whether mpz_ptr is defined (is not defined in earlier gmp versions) |
---|
245 | if test "$ac_cv_header_gmp_h" = yes; then |
---|
246 | AC_EGREP_HEADER(mpz_ptr, gmp.h, MPZ_PTR=mpz_ptr) |
---|
247 | if test ! "$MPZ_PTR" = mpz_ptr; then |
---|
248 | AC_EGREP_HEADER(MP_INT, gmp.h, MPZ_PTR="MP_INT*") |
---|
249 | AC_DEFINE_UNQUOTED(mpz_ptr, MP_INT*) |
---|
250 | AC_DEFINE_UNQUOTED(_mp_alloc,alloc) |
---|
251 | AC_DEFINE_UNQUOTED(_mp_size,size) |
---|
252 | AC_DEFINE_UNQUOTED(_mp_d,d) |
---|
253 | fi |
---|
254 | AC_EGREP_HEADER(mpf_ptr, gmp.h, MPF_PTR=mpf_ptr) |
---|
255 | fi |
---|
256 | |
---|
257 | dnl |
---|
258 | dnl deal with Ap Number configuration |
---|
259 | dnl |
---|
260 | AC_ARG_WITH(apint, \ |
---|
261 | [ --with-default_apint=PACKAGE use PACKAGE as MP's default ApInt format |
---|
262 | where PACKAGE can be: gmp (default), pari, |
---|
263 | saclib, none]) |
---|
264 | AC_ARG_WITH(apreal, \ |
---|
265 | [ --with-default_apreal=PACKAGE use PACKAGE as MP's default ApReal format |
---|
266 | where PACKAGE can be: gmp (default), none]) |
---|
267 | AC_ARG_WITH(gmp, \ |
---|
268 | [ --without-gmp build without gmp ApNumber routines]) |
---|
269 | |
---|
270 | AC_ARG_WITH(pari, \ |
---|
271 | [ --with-pari build with pari ApInt routines]) |
---|
272 | |
---|
273 | AC_ARG_WITH(saclib, \ |
---|
274 | [ --with-saclib build with saclib ApInt routines]) |
---|
275 | |
---|
276 | AC_ARG_WITH(tb, \ |
---|
277 | [ --with-tb build with Toolbus device interface]) |
---|
278 | |
---|
279 | AC_ARG_WITH(pvm, \ |
---|
280 | [ --with-pvm build with Pvm saclib device interface]) |
---|
281 | |
---|
282 | AC_ARG_WITH(debug, \ |
---|
283 | [ --with-debug build with debug options and logging]) |
---|
284 | |
---|
285 | AC_ARG_WITH(extra_cflags, \ |
---|
286 | [ --with-extra_cflags=cflags build with 'cflags' appended to |
---|
287 | CFLAGS given to the compiler]) |
---|
288 | |
---|
289 | AC_ARG_WITH(rsh, \ |
---|
290 | [ --with-rsh=command use 'command' as remote shell command]) |
---|
291 | |
---|
292 | dnl evaluate specifications |
---|
293 | AC_DEFINE(MP_DUMMY, 0) |
---|
294 | AC_DEFINE(MP_GMP, 1) |
---|
295 | AC_DEFINE(MP_PARI, 2) |
---|
296 | AC_DEFINE(MP_SAC, 3) |
---|
297 | |
---|
298 | if test "$with_default_apint" = none; then |
---|
299 | AC_DEFINE(MP_DEFAULT_APINT, MP_DUMMY) |
---|
300 | elif test "$with_default_apint" = pari; then |
---|
301 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
302 | AC_MSG_WARN(Need genpari.h to use pari as default ApInt format) |
---|
303 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
304 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_DUMMY) |
---|
305 | else |
---|
306 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_PARI) |
---|
307 | AC_DEFINE(MP_HAVE_PARI) |
---|
308 | fi |
---|
309 | elif test "$with_default_apint" = saclib; then |
---|
310 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
311 | AC_MSG_WARN(Need saclib.h to use saclib as default ApInt format) |
---|
312 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
313 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
314 | else |
---|
315 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_SAC) |
---|
316 | AC_DEFINE(MP_HAVE_SACLIB) |
---|
317 | fi |
---|
318 | else |
---|
319 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
320 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
321 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
322 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
323 | elif test -z "$MPZ_PTR" && test "$enable_gmp" != yes; then |
---|
324 | AC_MSG_WARN(Need gmp.h containing typedef of 'mpz_ptr' or 'MP_INT') |
---|
325 | AC_MSG_WARN(Use dummy as default MP ApInt format) |
---|
326 | AC_DEFINE(MP_DEFAULT_APINTFORMAT, MP_DUMMY) |
---|
327 | else |
---|
328 | AC_DEFINE(MP_DEFAULT_APINT_FORMAT, MP_GMP) |
---|
329 | AC_DEFINE(MP_HAVE_GMP_APINT) |
---|
330 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
331 | AC_MSG_WARN(Need gmp.h to use gmp as default ApInt format) |
---|
332 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
333 | fi |
---|
334 | fi |
---|
335 | fi |
---|
336 | |
---|
337 | if test "$with_default_apreal" = none; then |
---|
338 | AC_DEFINE(MP_DEFAULT_APREAL, MP_DUMMY) |
---|
339 | else |
---|
340 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
341 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
342 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
343 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
344 | elif test -z "$MPF_PTR" && test "$enable_gmp" != yes; then |
---|
345 | AC_MSG_WARN(Need gmp.h containing tyedef of 'mpf_ptr') |
---|
346 | AC_MSG_WARN(Use dummy as default MP ApReal format) |
---|
347 | AC_DEFINE(MP_DEFAULT_APREALFORMAT, MP_DUMMY) |
---|
348 | else |
---|
349 | AC_DEFINE(MP_DEFAULT_APREAL_FORMAT, MP_GMP) |
---|
350 | AC_DEFINE(MP_HAVE_GMP_APREAL) |
---|
351 | if test "$ac_cv_header_gmp_h" != yes ; then |
---|
352 | AC_MSG_WARN(Need gmp.h to use gmp as default ApReal format) |
---|
353 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
354 | fi |
---|
355 | fi |
---|
356 | fi |
---|
357 | |
---|
358 | if test "$with_gmp" != no; then |
---|
359 | if test "$ac_cv_header_gmp_h" != yes && test "$enable_gmp" != yes; then |
---|
360 | AC_MSG_WARN(Can not build MP with gmp ApInt routines: Need gmp.h) |
---|
361 | else |
---|
362 | AC_DEFINE(MP_HAVE_GMP) |
---|
363 | if test "$ac_cv_header_gmp_h" != yes; then |
---|
364 | AC_MSG_WARN(Need gmp.h to build MP with gmp ApInt routines) |
---|
365 | AC_MSG_WARN(Install gmp.h before making MP) |
---|
366 | fi |
---|
367 | fi |
---|
368 | fi |
---|
369 | |
---|
370 | if test "$with_saclib" = yes; then |
---|
371 | if test "$ac_cv_header_saclib_h" != yes; then |
---|
372 | AC_MSG_WARN(Can not build MP with saclib ApInt routines: Need saclib.h) |
---|
373 | else |
---|
374 | AC_DEFINE(MP_HAVE_SAC) |
---|
375 | fi |
---|
376 | fi |
---|
377 | |
---|
378 | if test "$with_pari" = yes; then |
---|
379 | if test "$ac_cv_header_genpari_h" != yes; then |
---|
380 | AC_MSG_WARN(Can not build MP with pari ApInt routines: Need genpari.h) |
---|
381 | else |
---|
382 | AC_DEFINE(MP_HAVE_PARI) |
---|
383 | AC_DEFINE(LONG_IS_32BIT) |
---|
384 | AC_CHECK_TYPE(ulong, no) |
---|
385 | if test "$ac_cv_type_ulong" = no; then |
---|
386 | AC_DEFINE(ULONG_NOT_DEFINED) |
---|
387 | fi |
---|
388 | fi |
---|
389 | fi |
---|
390 | |
---|
391 | |
---|
392 | |
---|
393 | if test "$with_tb" = yes; then |
---|
394 | AC_CHECK_HEADER(TB.h) |
---|
395 | if test "$ac_cv_header_TB_h" != yes; then |
---|
396 | AC_MSG_WARN(Can not build with Toolbus: Need TB.h) |
---|
397 | else |
---|
398 | AC_DEFINE(MP_HAVE_TB) |
---|
399 | fi |
---|
400 | fi |
---|
401 | |
---|
402 | if test "$with_pvm" = yes; then |
---|
403 | AC_CHECK_HEADER(pvm3.h) |
---|
404 | if test "$ac_cv_header_pvm3_h" != yes; then |
---|
405 | AC_MSG_WARN(Can not build with Pvm: Need pvm3.h) |
---|
406 | else |
---|
407 | AC_DEFINE(MP_HAVE_PVM) |
---|
408 | fi |
---|
409 | fi |
---|
410 | |
---|
411 | if test "${with_extra_cflags+set}" = set; then |
---|
412 | CFLAGS="$CFLAGS ${with_extra_cflags}" |
---|
413 | fi |
---|
414 | |
---|
415 | if test "${with_rsh+set}" = set; then |
---|
416 | ac_cv_rsh_program=${with_rsh} |
---|
417 | else |
---|
418 | AC_CHECK_PROGS(ac_cv_rsh_program,remsh rsh ssh, none) |
---|
419 | fi |
---|
420 | AC_MSG_CHECKING(which remote shell command to use) |
---|
421 | AC_DEFINE_UNQUOTED(MP_RSH_COMMAND, "$ac_cv_rsh_program") |
---|
422 | AC_MSG_RESULT($ac_cv_rsh_program) |
---|
423 | |
---|
424 | AC_MSG_CHECKING(whether remote shell command works) |
---|
425 | if $ac_cv_rsh_program `hostname` -n uname \>\& /dev/null; then |
---|
426 | AC_MSG_RESULT(yes) |
---|
427 | else |
---|
428 | AC_MSG_RESULT(no) |
---|
429 | AC_MSG_WARN(Remote shell does not work. Check your .rhosts file) |
---|
430 | fi |
---|
431 | |
---|
432 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
433 | AC_C_BIGENDIAN |
---|
434 | AC_C_CONST |
---|
435 | AC_TYPE_SIZE_T |
---|
436 | AC_HEADER_TIME |
---|
437 | |
---|
438 | dnl miscellanous stuff |
---|
439 | dnl check for sizeof(long) |
---|
440 | AC_CHECK_SIZEOF(long, 4) |
---|
441 | if test "$ac_cv_sizeof_long" != 4; then |
---|
442 | AC_MSG_ERROR(Need sizeof long to equal 4) |
---|
443 | fi |
---|
444 | |
---|
445 | dnl add some defines for if pari is used |
---|
446 | |
---|
447 | CLEAN="rm -f *~ a.out core *.o .log" |
---|
448 | AC_SUBST(CLEAN) |
---|
449 | |
---|
450 | dnl if we use GCC, then we know CFLAGS best and do not let user overwrite it |
---|
451 | if test "${GCC}" = yes && test "$ac_cv_cflags_not_set" = yes; then |
---|
452 | if test "$with_debug" = yes; then |
---|
453 | CFLAGS="-g -Wall -Wno-unused ${with_extra_cflags}" |
---|
454 | else |
---|
455 | CFLAGS="-O3 -w -fomit-frame-pointer ${with_extra_cflags}" |
---|
456 | fi |
---|
457 | fi |
---|
458 | |
---|
459 | dnl check for args to pass to subconfigure |
---|
460 | if test "$prefix" = NONE; then |
---|
461 | ac_configure_args="$ac_configure_args --prefix=$ac_default_prefix" |
---|
462 | fi |
---|
463 | |
---|
464 | AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS) |
---|
465 | |
---|
466 | AC_OUTPUT(Makefile MP/Makefile MPT/Makefile mpviewer/Makefile \ |
---|
467 | mp-pvm3/Makefile examples/Makefile, \ |
---|
468 | if test "$CONFIG_HEADERS"; then echo timestamp > MP/stamp-h; fi) |
---|