1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl GMP specific autoconf macros
16 dnl Copyright (C) 2000 Free Software Foundation, Inc.
18 dnl This file is part of the GNU MP Library.
20 dnl The GNU MP Library is free software; you can redistribute it and/or modify
21 dnl it under the terms of the GNU Lesser General Public License as published
22 dnl by the Free Software Foundation; either version 2.1 of the License, or (at
23 dnl your option) any later version.
25 dnl The GNU MP Library is distributed in the hope that it will be useful, but
26 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
27 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
28 dnl License for more details.
30 dnl You should have received a copy of the GNU Lesser General Public License
31 dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
32 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
33 dnl MA 02111-1307, USA.
36 dnl GMP_HEADER_GETVAL(NAME,FILE)
37 dnl ----------------------------
38 dnl Expand to the value of a "#define NAME" from the given FILE.
39 dnl The regexps here aren't very rugged, but are enough for gmp.
40 dnl /dev/null as a parameter prevents a hang if $2 is accidentally omitted.
42 define(GMP_HEADER_GETVAL,
44 esyscmd([grep "^#define $1 " $2 /dev/null 2>/dev/null]),
52 dnl The gmp version number, extracted from the #defines in gmp.h.
53 dnl Two digits like 3.0 if patchlevel <= 0, or three digits like 3.0.1 if
57 [GMP_HEADER_GETVAL(__GNU_MP_VERSION,gmp.h)[]dnl
58 .GMP_HEADER_GETVAL(__GNU_MP_VERSION_MINOR,gmp.h)[]dnl
59 ifelse(m4_eval(GMP_HEADER_GETVAL(__GNU_MP_VERSION_PATCHLEVEL,gmp.h) > 0),1,
60 [.GMP_HEADER_GETVAL(__GNU_MP_VERSION_PATCHLEVEL,gmp.h)])])
66 dnl Find a working m4, either in $PATH or likely locations, and setup $M4
67 dnl and an AC_SUBST accordingly. If $M4 is already set then it's a user
68 dnl choice and is accepted with no checks. GMP_PROG_M4 is like
69 dnl AC_PATH_PROG or AC_CHECK_PROG, but it tests each m4 found to see if
72 dnl See mpn/asm-defs.m4 for details on the known bad m4s.
75 [AC_CACHE_CHECK([for suitable m4],
77 [if test -n "$M4"; then
80 cat >conftest.m4 <<\EOF
81 dnl must protect this against being expanded during autoconf m4!
82 [define(dollarhash,``$][#'')dnl
83 ifelse(dollarhash(x),1,`define(t1,Y)',
84 ``bad: $][# not supported (SunOS /usr/bin/m4)
86 ifelse(eval(89),89,`define(t2,Y)',
87 `bad: eval() doesnt support 8 or 9 in a constant (OpenBSD 2.6 m4)
89 ifelse(t1`'t2,YY,`good
92 echo "trying m4" 1>&AC_FD_CC
93 gmp_tmp_val="`(m4 conftest.m4) 2>&AC_FD_CC`"
94 echo "$gmp_tmp_val" 1>&AC_FD_CC
95 if test "$gmp_tmp_val" = good; then
98 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
99 dnl $ac_dummy forces splitting on constant user-supplied paths.
100 dnl POSIX.2 word splitting is done only on the output of word expansions,
101 dnl not every word. This closes a longstanding sh security hole.
102 ac_dummy="$PATH:/usr/5bin"
103 for ac_dir in $ac_dummy; do
104 test -z "$ac_dir" && ac_dir=.
105 echo "trying $ac_dir/m4" 1>&AC_FD_CC
106 gmp_tmp_val="`($ac_dir/m4 conftest.m4) 2>&AC_FD_CC`"
107 echo "$gmp_tmp_val" 1>&AC_FD_CC
108 if test "$gmp_tmp_val" = good; then
109 gmp_cv_prog_m4="$ac_dir/m4"
114 if test -z "$gmp_cv_prog_m4"; then
115 AC_MSG_ERROR([No usable m4 in \$PATH or /usr/5bin (see config.log for reasons).])
125 dnl GMP_PROG_CC_FIND([CC_LIST], [REQ_64BIT_CC])
126 dnl Find first working compiler in CC_LIST.
127 dnl If REQ_64BIT_CC is "yes", the compiler is required to be able to
128 dnl produce 64-bit code.
129 dnl NOTE: If a compiler needs any special flags for producing 64-bit code,
130 dnl these have to be found in shell variable `gmp_cflags64_{cc}', where `{cc}'
131 dnl is the name of the compiler.
132 dnl Set CC to the name of the first working compiler.
133 dnl If a 64-bit compiler is found, set CC64 to the name of the compiler and
134 dnl CFLAGS64 to flags to use.
135 dnl This macro does not test if any of the compilers found is a GNU compiler.
136 dnl To do this, when you have finally made up your mind on which one to use,
137 dnl and set CC accordingly, invoke [GMP_PROG_CC_SELECT]. That macro will
138 dnl also make sure that your selection of CFLAGS is valid.
140 AC_DEFUN(GMP_PROG_CC_FIND,
141 [AC_BEFORE([$0], [CC_PROG_CPP])
142 ifelse([$1], , gmp_cc_list="gcc cc", gmp_cc_list="[$1]")
143 ifelse([$2], , gmp_req_64bit_cc="no", gmp_req_64bit_cc="[$2]")
147 for c in $gmp_cc_list; do
151 AC_CHECK_TOOL(CC, $c, $c)
152 if test -n "$CC"; then
153 eval c_flags=\$gmp_cflags_$c
154 GMP_PROG_CC_WORKS($CC, $c_flags,
155 gmp_prog_cc_works=yes,
156 gmp_prog_cc_works=no)
158 if test "$gmp_prog_cc_works" != "yes"; then
162 # Save first working compiler, whether 32- or 64-bit capable.
163 if test -z "$CC32"; then
166 if test "$gmp_req_64bit_cc" = "yes"; then
167 eval c_flags=\$gmp_cflags64_$c
169 # Verify that the compiler works in 64-bit mode as well.
170 # /usr/ucb/cc on Solaris 7 can *compile* in 64-bit mode, but not link.
171 GMP_PROG_CC_WORKS($c, $c_flags,
172 gmp_prog_cc_works=yes,
173 gmp_prog_cc_works=no)
175 if test "$gmp_prog_cc_works" = "yes"; then
176 GMP_CHECK_CC_64BIT($c, $c_flags)
177 if test "$gmp_cv_cc_64bit" = "yes"; then
178 test -z "$CC64" && CC64="$c"
179 test -z "$CFLAGS64" && CFLAGS64="$c_flags"
180 # We have CC64 so we're done.
185 # We have CC32, and we don't need a 64-bit compiler so we're done.
193 dnl GMP_PROG_CC_SELECT
194 dnl Check that `CC' works with `CFLAGS'. Check if `CC' is a GNU compiler.
195 dnl Cache the result as `ac_cv_prog_CC'.
196 AC_DEFUN(GMP_PROG_CC_SELECT,
197 [AC_BEFORE([$0], [CC_PROG_CPP])
201 if test "$ac_cv_prog_gcc" = "yes"; then
207 # Set CFLAGS if not already set.
208 if test -z "$CFLAGS"; then
210 if test "$GCC" = "yes"; then
216 AC_CACHE_VAL(ac_cv_prog_CC, ac_cv_prog_CC="$CC")
217 AC_PROVIDE([AC_PROG_CC])
220 dnl GMP_CHECK_CC_64BIT(cc, cflags64)
221 dnl Find out if `CC' can produce 64-bit code.
222 dnl Requires NM to be set to nm for target.
223 dnl FIXME: Cache result.
224 AC_DEFUN(GMP_CHECK_CC_64BIT,
226 gmp_tmp_CC_save="$CC"
228 AC_MSG_CHECKING([whether the C compiler ($CC) is 64-bit capable])
229 if test -z "$NM"; then
230 echo; echo ["configure: $0: fatal: need nm"]
233 gmp_tmp_CFLAGS_save="$CFLAGS"
238 # FIXME: If gcc is installed under another name than "gcc", we will
239 # test the wrong thing.
240 if test "$CC" != "gcc"; then
241 dnl Let compiler version A.10.32.30 or higher be ok.
242 dnl Bad compiler output:
243 dnl ccom: HP92453-01 G.10.32.05 HP C Compiler
244 dnl Good compiler output:
245 dnl ccom: HP92453-01 A.10.32.30 HP C Compiler
247 gmp_tmp_vs=`$CC $CFLAGS -V -c -o conftest.o conftest.c 2>&1 | grep "^ccom:"`
249 gmp_tmp_v1=`echo $gmp_tmp_vs | sed 's/.* .\.\(.*\)\..*\..* HP C.*/\1/'`
250 gmp_tmp_v2=`echo $gmp_tmp_vs | sed 's/.* .\..*\.\(.*\)\..* HP C.*/\1/'`
251 gmp_tmp_v3=`echo $gmp_tmp_vs | sed 's/.* .\..*\..*\.\(.*\) HP C.*/\1/'`
253 test -n "$gmp_tmp_v1" && test "$gmp_tmp_v1" -ge "10" \
254 && test -n "$gmp_tmp_v2" && test "$gmp_tmp_v2" -ge "32" \
255 && test -n "$gmp_tmp_v3" && test "$gmp_tmp_v3" -ge "30" \
256 && gmp_cv_cc_64bit=yes
258 # FIXME: Compile a minimal file and determine if the resulting object
259 # file is an ELF file. If so, gcc can produce 64-bit code.
260 # Do we have file(1) for target?
265 # We use `-n32' to cc and `-mabi=n32' to gcc, resulting in 64-bit
266 # arithmetic but not 64-bit pointers, so the general test for sizeof
267 # (void *) is not valid.
268 # Simply try to compile an empty main. If that succeeds return
271 gmp_cv_cc_64bit=yes, gmp_cv_cc_64bit=no,
275 # Allocate an array of size sizeof (void *) and use nm to determine its
276 # size. We depend on the first declared variable being put at address 0.
277 cat >conftest.c <<EOF
278 [char arr[sizeof (void *)]={0};
281 gmp_compile="$CC $CFLAGS -c conftest.c 1>&AC_FD_CC"
282 if AC_TRY_EVAL(gmp_compile); then
284 gmp_tmp_val=`$NM conftest.o | grep post | sed -e 's;[[][0-9][]]\(.*\);\1;' \
285 -e 's;[^1-9]*\([0-9]*\).*;\1;'`
287 if test "$gmp_tmp_val" = "8"; then
293 echo "configure: failed program was:" >&AC_FD_CC
294 cat conftest.$ac_ext >&AC_FD_CC
301 CC="$gmp_tmp_CC_save"
302 CFLAGS="$gmp_tmp_CFLAGS_save"
303 AC_MSG_RESULT($gmp_cv_cc_64bit)
306 dnl GMP_INIT([M4-DEF-FILE])
309 [ifelse([$1], , gmp_configm4=config.m4, gmp_configm4="[$1]")
310 gmp_tmpconfigm4=cnfm4.tmp
311 gmp_tmpconfigm4i=cnfm4i.tmp
312 gmp_tmpconfigm4p=cnfm4p.tmp
313 test -f $gmp_tmpconfigm4 && rm $gmp_tmpconfigm4
314 test -f $gmp_tmpconfigm4i && rm $gmp_tmpconfigm4i
315 test -f $gmp_tmpconfigm4p && rm $gmp_tmpconfigm4p
320 dnl Create config.m4 from its accumulated parts.
322 dnl __CONFIG_M4_INCLUDED__ is used so that a second or subsequent include
323 dnl of config.m4 is harmless.
325 dnl A separate ifdef on the angle bracket quoted part ensures the quoting
326 dnl style there is respected. The basic defines from gmp_tmpconfigm4 are
327 dnl fully quoted but are still put under an ifdef in case any have been
328 dnl redefined by one of the m4 include files.
330 dnl Doing a big ifdef within asm-defs.m4 and/or other macro files wouldn't
331 dnl work, since it'd interpret parentheses and quotes in dnl comments, and
332 dnl having a whole file as a macro argument would overflow the string space
336 [AC_REQUIRE([GMP_INIT])
337 echo "creating $gmp_configm4"
338 echo ["dnl $gmp_configm4. Generated automatically by configure."] > $gmp_configm4
339 if test -f $gmp_tmpconfigm4; then
340 echo ["changequote(<,>)dnl"] >> $gmp_configm4
341 echo ["ifdef(<__CONFIG_M4_INCLUDED__>,,<"] >> $gmp_configm4
342 cat $gmp_tmpconfigm4 >> $gmp_configm4
343 echo [">)"] >> $gmp_configm4
344 echo ["changequote(\`,')dnl"] >> $gmp_configm4
347 echo ["ifdef(\`__CONFIG_M4_INCLUDED__',,\`"] >> $gmp_configm4
348 if test -f $gmp_tmpconfigm4i; then
349 cat $gmp_tmpconfigm4i >> $gmp_configm4
352 if test -f $gmp_tmpconfigm4p; then
353 cat $gmp_tmpconfigm4p >> $gmp_configm4
356 echo ["')"] >> $gmp_configm4
357 echo ["define(\`__CONFIG_M4_INCLUDED__')"] >> $gmp_configm4
360 dnl GMP_INCLUDE(FILE)
361 AC_DEFUN(GMP_INCLUDE,
362 [AC_REQUIRE([GMP_INIT])
363 echo ["include(\`$1')"] >> $gmp_tmpconfigm4i
366 dnl GMP_SINCLUDE(FILE)
367 AC_DEFUN(GMP_SINCLUDE,
368 [AC_REQUIRE([GMP_INIT])
369 echo ["sinclude(\`$1')"] >> $gmp_tmpconfigm4i
372 dnl GMP_DEFINE(MACRO, DEFINITION [, LOCATION])
373 dnl [ Define M4 macro MACRO as DEFINITION in temporary file. ]
374 dnl [ If LOCATION is `POST', the definition will appear after any ]
375 dnl [ include() directives inserted by GMP_INCLUDE/GMP_SINCLUDE. ]
376 dnl [ Mind the quoting! No shell variables will get expanded. ]
377 dnl [ Don't forget to invoke GMP_FINISH to create file config.m4. ]
378 dnl [ config.m4 uses `<' and '>' as quote characters for all defines. ]
380 [AC_REQUIRE([GMP_INIT])
381 echo ['define(<$1>, <$2>)'] >> ifelse([$3], [POST], $gmp_tmpconfigm4p, $gmp_tmpconfigm4)
384 dnl GMP_DEFINE_RAW(STRING, [, LOCATION])
385 dnl [ Put STRING in temporary file. ]
386 dnl [ If LOCATION is `POST', the definition will appear after any ]
387 dnl [ include() directives inserted by GMP_INCLUDE/GMP_SINCLUDE. ]
388 dnl [ Don't forget to invoke GMP_FINISH to create file config.m4. ]
389 AC_DEFUN(GMP_DEFINE_RAW,
390 [AC_REQUIRE([GMP_INIT])
391 echo [$1] >> ifelse([$2], [POST], $gmp_tmpconfigm4p, $gmp_tmpconfigm4)
394 dnl GMP_CHECK_ASM_LABEL_SUFFIX
395 dnl Should a label have a colon or not?
396 AC_DEFUN(GMP_CHECK_ASM_LABEL_SUFFIX,
397 [AC_CACHE_CHECK([what assembly label suffix to use],
398 gmp_cv_check_asm_label_suffix,
400 *-*-hpux*) gmp_cv_check_asm_label_suffix=[""] ;;
401 *) gmp_cv_check_asm_label_suffix=[":"] ;;
404 echo ["define(<LABEL_SUFFIX>, <\$][1$gmp_cv_check_asm_label_suffix>)"] >> $gmp_tmpconfigm4
407 dnl GMP_CHECK_ASM_UNDERSCORE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
408 dnl Shamelessly borrowed from glibc.
409 AC_DEFUN(GMP_CHECK_ASM_UNDERSCORE,
410 [AC_CACHE_CHECK([if symbols are prefixed by underscore],
411 gmp_cv_check_asm_underscore,
412 [cat > conftest.$ac_ext <<EOF
413 dnl This sometimes fails to find confdefs.h, for some reason.
414 dnl [#]line __oline__ "[$]0"
415 [#]line __oline__ "configure"
416 #include "confdefs.h"
417 int underscore_test() {
420 if AC_TRY_EVAL(ac_compile); then
421 if grep _underscore_test conftest* >/dev/null; then
422 gmp_cv_check_asm_underscore=yes
424 gmp_cv_check_asm_underscore=no
427 echo "configure: failed program was:" >&AC_FD_CC
428 cat conftest.$ac_ext >&AC_FD_CC
432 if test "$gmp_cv_check_asm_underscore" = "yes"; then
433 GMP_DEFINE(GSYM_PREFIX, [_])
434 ifelse([$1], , :, [$1])
436 GMP_DEFINE(GSYM_PREFIX, [])
437 ifelse([$2], , :, [$2])
441 dnl GMP_CHECK_ASM_ALIGN_LOG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
442 dnl Is parameter to `.align' logarithmic?
443 dnl Requires NM to be set to nm for target.
444 AC_DEFUN(GMP_CHECK_ASM_ALIGN_LOG,
445 [AC_REQUIRE([GMP_CHECK_ASM_GLOBL])
446 AC_REQUIRE([GMP_CHECK_ASM_DATA])
447 AC_REQUIRE([GMP_CHECK_ASM_LABEL_SUFFIX])
448 AC_CACHE_CHECK([if .align assembly directive is logarithmic],
449 gmp_cv_check_asm_align_log,
450 [if test -z "$NM"; then
451 echo; echo ["configure: $0: fatal: need nm"]
454 cat > conftest.s <<EOF
455 $gmp_cv_check_asm_data
457 $gmp_cv_check_asm_globl foo
460 foo$gmp_cv_check_asm_label_suffix
463 ac_assemble="$CCAS $CFLAGS conftest.s 1>&AC_FD_CC"
464 if AC_TRY_EVAL(ac_assemble); then
466 gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
467 -e 's;[^1-9]*\([0-9]*\).*;\1;'`
469 if test "$gmp_tmp_val" = "10" || test "$gmp_tmp_val" = "16"; then
470 gmp_cv_check_asm_align_log=yes
472 gmp_cv_check_asm_align_log=no
475 echo "configure: failed program was:" >&AC_FD_CC
476 cat conftest.s >&AC_FD_CC
480 GMP_DEFINE_RAW(["define(<ALIGN_LOGARITHMIC>,<$gmp_cv_check_asm_align_log>)"])
481 if test "$gmp_cv_check_asm_align_log" = "yes"; then
482 ifelse([$1], , :, [$1])
484 ifelse([$2], , :, [$2])
489 dnl GMP_CHECK_ASM_ALIGN_FILL_0x90
490 dnl -----------------------------
491 dnl Determine whether a ",0x90" suffix works on a .align directive.
492 dnl This is only meant for use on x86, where 0x90 is a "nop".
494 dnl Old gas, eg. 1.92.3 - needs ",0x90" or else the fill is an invalid 0x00.
495 dnl New gas, eg. 2.91 - generates the good multibyte nop fills even when
496 dnl ",0x90" is given.
497 dnl Solaris 2.6 as - doesn't allow ",0x90", gives a fatal error.
498 dnl Solaris 2.8 as - gives a warning for ",0x90", no ill effect.
500 dnl Note that both solaris "as"s only care about ",0x90" if they actually
501 dnl have to use it to fill something, hence the .byte in the sample. It's
502 dnl only the second .align that provokes an error or warning.
504 dnl We prefer to suppress the warning from solaris 2.8 to stop anyone
505 dnl worrying something might be wrong.
507 AC_DEFUN(GMP_CHECK_ASM_ALIGN_FILL_0x90,
508 [AC_CACHE_CHECK([if the .align directive accepts an 0x90 fill in .text],
509 gmp_cv_check_asm_align_fill_0x90,
510 [AC_REQUIRE([GMP_CHECK_ASM_TEXT])
511 cat > conftest.s <<EOF
512 $gmp_cv_check_asm_text
517 gmp_tmp_val="`$CCAS $CFLAGS conftest.s 2>&1`"
519 echo "$gmp_tmp_val" 1>&AC_FD_CC
520 if echo "$gmp_tmp_val" | grep "Warning: Fill parameter ignored for executable section"; then
521 echo "Supressing this warning by omitting 0x90" 1>&AC_FD_CC
522 gmp_cv_check_asm_align_fill_0x90=no
524 gmp_cv_check_asm_align_fill_0x90=yes
527 echo "Non-zero exit code" 1>&AC_FD_CC
528 echo "$gmp_tmp_val" 1>&AC_FD_CC
529 gmp_cv_check_asm_align_fill_0x90=no
534 ["define(<ALIGN_FILL_0x90>,<$gmp_cv_check_asm_align_fill_0x90>)"])
538 dnl GMP_CHECK_ASM_TEXT
539 AC_DEFUN(GMP_CHECK_ASM_TEXT,
540 [AC_CACHE_CHECK([how to switch to text section], gmp_cv_check_asm_text,
544 gmp_cv_check_asm_text={".csect .text[PR]"}
547 *-*-hpux*) gmp_cv_check_asm_text=[".code"] ;;
548 *) gmp_cv_check_asm_text=[".text"] ;;
551 echo ["define(<TEXT>, <$gmp_cv_check_asm_text>)"] >> $gmp_tmpconfigm4
554 dnl GMP_CHECK_ASM_DATA
555 dnl Can we say `.data'?
556 AC_DEFUN(GMP_CHECK_ASM_DATA,
557 [AC_CACHE_CHECK([how to switch to data section], gmp_cv_check_asm_data,
561 gmp_cv_check_asm_data={".csect .data[RW]"}
564 *) gmp_cv_check_asm_data=[".data"] ;;
567 echo ["define(<DATA>, <$gmp_cv_check_asm_data>)"] >> $gmp_tmpconfigm4
570 dnl GMP_CHECK_ASM_GLOBL
571 dnl Can we say `.global'?
572 AC_DEFUN(GMP_CHECK_ASM_GLOBL,
573 [AC_CACHE_CHECK([how to export a symbol], gmp_cv_check_asm_globl,
575 *-*-hpux*) gmp_cv_check_asm_globl=[".export"] ;;
576 *) gmp_cv_check_asm_globl=[".globl"] ;;
579 echo ["define(<GLOBL>, <$gmp_cv_check_asm_globl>)"] >> $gmp_tmpconfigm4
582 dnl GMP_CHECK_ASM_TYPE
583 dnl Can we say `.type'?
584 AC_DEFUN(GMP_CHECK_ASM_TYPE,
585 [AC_CACHE_CHECK([how the .type assembly directive should be used],
586 gmp_cv_check_asm_type,
587 [ac_assemble="$CCAS $CFLAGS conftest.s 1>&AC_FD_CC"
588 for gmp_tmp_prefix in @ \# %; do
589 echo " .type sym,${gmp_tmp_prefix}function" > conftest.s
590 if AC_TRY_EVAL(ac_assemble); then
591 gmp_cv_check_asm_type="[.type \$][1,${gmp_tmp_prefix}\$][2]"
595 if test -z "$gmp_cv_check_asm_type"; then
596 gmp_cv_check_asm_type="[dnl]"
599 echo ["define(<TYPE>, <$gmp_cv_check_asm_type>)"] >> $gmp_tmpconfigm4
602 dnl GMP_CHECK_ASM_SIZE
603 dnl Can we say `.size'?
604 AC_DEFUN(GMP_CHECK_ASM_SIZE,
605 [AC_CACHE_CHECK([if the .size assembly directive works], gmp_cv_check_asm_size,
606 [ac_assemble="$CCAS $CFLAGS conftest.s 1>&AC_FD_CC"
607 echo ' .size sym,1' > conftest.s
608 if AC_TRY_EVAL(ac_assemble); then
609 gmp_cv_check_asm_size="[.size \$][1,\$][2]"
611 gmp_cv_check_asm_size="[dnl]"
614 echo ["define(<SIZE>, <$gmp_cv_check_asm_size>)"] >> $gmp_tmpconfigm4
617 dnl GMP_CHECK_ASM_LSYM_PREFIX
618 dnl What is the prefix for a local label?
619 dnl Requires NM to be set to nm for target.
620 AC_DEFUN(GMP_CHECK_ASM_LSYM_PREFIX,
621 [AC_REQUIRE([GMP_CHECK_ASM_LABEL_SUFFIX])
622 AC_CACHE_CHECK([what prefix to use for a local label],
623 gmp_cv_check_asm_lsym_prefix,
624 [if test -z "$NM"; then
625 echo; echo ["$0: fatal: need nm"]
628 ac_assemble="$CCAS $CFLAGS conftest.s 1>&AC_FD_CC"
629 gmp_cv_check_asm_lsym_prefix="L"
630 for gmp_tmp_pre in L .L $ L$; do
631 cat > conftest.s <<EOF
632 dummy${gmp_cv_check_asm_label_suffix}
633 ${gmp_tmp_pre}gurkmacka${gmp_cv_check_asm_label_suffix}
636 if AC_TRY_EVAL(ac_assemble); then
637 $NM conftest.o >/dev/null 2>&1
639 if test "$gmp_rc" != "0"; then
640 echo "configure: $NM failure, using default"
643 if $NM conftest.o | grep gurkmacka >/dev/null; then true; else
644 gmp_cv_check_asm_lsym_prefix="$gmp_tmp_pre"
648 echo "configure: failed program was:" >&AC_FD_CC
649 cat conftest.s >&AC_FD_CC
655 echo ["define(<LSYM_PREFIX>, <${gmp_cv_check_asm_lsym_prefix}>)"] >> $gmp_tmpconfigm4
658 dnl GMP_CHECK_ASM_W32
659 dnl How to [define] a 32-bit word.
660 dnl Requires NM to be set to nm for target.
661 AC_DEFUN(GMP_CHECK_ASM_W32,
662 [AC_REQUIRE([GMP_CHECK_ASM_DATA])
663 AC_REQUIRE([GMP_CHECK_ASM_GLOBL])
664 AC_REQUIRE([GMP_CHECK_ASM_LABEL_SUFFIX])
665 AC_CACHE_CHECK([how to [define] a 32-bit word],
666 gmp_cv_check_asm_w32,
667 [if test -z "$NM"; then
668 echo; echo ["configure: $0: fatal: need nm"]
672 # FIXME: HPUX puts first symbol at 0x40000000, breaking our assumption
673 # that it's at 0x0. We'll have to declare another symbol before the
674 # .long/.word and look at the distance between the two symbols. The
675 # only problem is that the sed expression(s) barfs (on Solaris, for
676 # example) for the symbol with value 0. For now, HPUX uses .word.
680 gmp_cv_check_asm_w32=".word"
683 ac_assemble="$CCAS $CFLAGS conftest.s 1>&AC_FD_CC"
684 for gmp_tmp_op in .long .word; do
685 cat > conftest.s <<EOF
686 $gmp_cv_check_asm_data
687 $gmp_cv_check_asm_globl foo
689 foo${gmp_cv_check_asm_label_suffix}
692 if AC_TRY_EVAL(ac_assemble); then
694 gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
695 -e 's;[^1-9]*\([0-9]*\).*;\1;'`
697 if test "$gmp_tmp_val" = "4"; then
698 gmp_cv_check_asm_w32="$gmp_tmp_op"
706 if test -z "$gmp_cv_check_asm_w32"; then
707 echo; echo ["configure: $0: fatal: do not know how to define a 32-bit word"]
712 echo ["define(<W32>, <$gmp_cv_check_asm_w32>)"] >> $gmp_tmpconfigm4
715 dnl GMP_CHECK_ASM_MMX([ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]])
716 dnl Can we assemble MMX insns?
717 AC_DEFUN(GMP_CHECK_ASM_MMX,
718 [AC_REQUIRE([GMP_CHECK_ASM_TEXT])
719 AC_CACHE_CHECK([if the assembler knows about MMX instructions],
720 gmp_cv_check_asm_mmx,
721 [cat > conftest.s <<EOF
722 $gmp_cv_check_asm_text
725 ac_assemble="$CCAS $CFLAGS conftest.s 1>&AC_FD_CC"
726 if AC_TRY_EVAL(ac_assemble); then
727 gmp_cv_check_asm_mmx=yes
729 gmp_cv_check_asm_mmx=no
733 if test "$gmp_cv_check_asm_mmx" = "yes"; then
734 ifelse([$1], , :, [$1])
736 AC_MSG_WARN([+----------------------------------------------------------])
737 AC_MSG_WARN([| WARNING WARNING WARNING])
738 AC_MSG_WARN([| Target CPU has MMX code, but it can't be assembled by])
739 AC_MSG_WARN([| $CCAS $CFLAGS])
740 AC_MSG_WARN([| Non-MMX replacements will be used.])
741 AC_MSG_WARN([| This will be an inferior build.])
742 AC_MSG_WARN([+----------------------------------------------------------])
743 ifelse([$2], , :, [$2])
747 dnl GMP_CHECK_ASM_SHLDL_CL([ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]])
748 AC_DEFUN(GMP_CHECK_ASM_SHLDL_CL,
749 [AC_REQUIRE([GMP_CHECK_ASM_TEXT])
750 AC_CACHE_CHECK([if the assembler takes cl with shldl],
751 gmp_cv_check_asm_shldl_cl,
752 [cat > conftest.s <<EOF
753 $gmp_cv_check_asm_text
754 shldl %cl, %eax, %ebx
756 ac_assemble="$CCAS $CFLAGS conftest.s 1>&AC_FD_CC"
757 if AC_TRY_EVAL(ac_assemble); then
758 gmp_cv_check_asm_shldl_cl=yes
760 gmp_cv_check_asm_shldl_cl=no
764 if test "$gmp_cv_check_asm_shldl_cl" = "yes"; then
765 ifelse([$1], , :, [$1])
767 ifelse([$2], , :, [$2])
771 dnl GMP_PROG_CC_WORKS(CC, CFLAGS, ACTION-IF-WORKS, [ACTION-IF-NOT-WORKS])
772 dnl Check if CC can compile and link. Perform various target specific tests.
773 dnl FIXME: Require `$target'.
774 AC_DEFUN(GMP_PROG_CC_WORKS,
775 [AC_LANG_C dnl Note: Destructive.
778 AC_MSG_CHECKING([if the C compiler ($CC) works with flags $CFLAGS])
780 # Simple test for all targets.
781 AC_TRY_COMPILER([int main(){return(0);}],
782 tmp_works, tmp_cross)
784 # Target specific tests.
785 if test "$tmp_works" = "yes"; then
787 *-*-aix*) # Returning a funcptr.
788 AC_TRY_COMPILE( , [} void *g(); void *f() { return g(); } int bar(){],
789 tmp_works=yes, tmp_works=no)
794 if test "$tmp_works" = "yes"; then
797 ifelse([$4], , :, [$4])
800 AC_MSG_RESULT($tmp_works)
806 dnl Setup to use ansi2knr if necessary.
808 dnl The test here is simply that if an ANSI style function works then
809 dnl ansi2knr isn't needed. The normal tests for whether $CC works mean we
810 dnl don't need to worry here about anything badly broken.
812 dnl AM_C_PROTOTYPES is the normal way to set up ansi2knr, but (in automake
813 dnl March 2000) it gives the wrong answer on a C++ compiler because its
814 dnl test requires that the compiler accept both ANSI and K&R, or otherwise
815 dnl ansi2knr is used. A C++ compiler fails on the K&R part, which makes
816 dnl AM_C_PROTOTYPES think it needs ansi2knr! GMP has no bare K&R so we
817 dnl only need ANSI or K&R to work, not both.
819 AC_DEFUN(GMP_C_ANSI2KNR,
820 [AC_CACHE_CHECK([if ansi2knr should be used],
822 [cat >conftest.c <<EOF
823 int main (int argc, char *argv[]) { return 0; }
825 if AC_TRY_EVAL(ac_compile); then
828 gmp_cv_c_ansi2knr=yes
832 if test $gmp_cv_c_ansi2knr = no; then
835 U=_ ANSI2KNR=./ansi2knr
836 # Ensure some checks needed by ansi2knr itself.
838 AC_CHECK_HEADERS(string.h)
845 dnl Deal with bad synchronization of Autoconf with Libtool.
846 AC_DEFUN(AC_CANONICAL_BUILD, [_AC_CANONICAL_BUILD])
847 AC_DEFUN(AC_CHECK_TOOL_PREFIX, [_AC_CHECK_TOOL_PREFIX])
852 AC_DEFUN(AM_C_PROTOTYPES,
853 [AC_REQUIRE([AM_PROG_CC_STDC])
854 AC_REQUIRE([AC_PROG_CPP])
855 AC_MSG_CHECKING([for function prototypes])
856 if test "$am_cv_prog_cc_stdc" != no; then
858 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
862 U=_ ANSI2KNR=./ansi2knr
863 # Ensure some checks needed by ansi2knr itself.
865 AC_CHECK_HEADERS(string.h)
868 AC_SUBST(ANSI2KNR)dnl
874 # @defmac AC_PROG_CC_STDC
875 # @maindex PROG_CC_STDC
877 # If the C compiler in not in ANSI C mode by default, try to add an option
878 # to output variable @code{CC} to make it so. This macro tries various
879 # options that select ANSI C on some system or another. It considers the
880 # compiler to be in ANSI C mode if it handles function prototypes correctly.
882 # If you use this macro, you should check after calling it whether the C
883 # compiler has been set to accept ANSI C; if not, the shell variable
884 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
885 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
886 # program @code{ansi2knr}, which comes with Ghostscript.
889 AC_DEFUN(AM_PROG_CC_STDC,
890 [AC_REQUIRE([AC_PROG_CC])
891 AC_BEFORE([$0], [AC_C_INLINE])
892 AC_BEFORE([$0], [AC_C_CONST])
893 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
894 dnl a magic option to avoid problems with ANSI preprocessor commands
896 dnl FIXME: can't do this because then AC_AIX won't work due to a
897 dnl circular dependency.
898 dnl AC_BEFORE([$0], [AC_PROG_CPP])
899 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
900 AC_CACHE_VAL(am_cv_prog_cc_stdc,
901 [am_cv_prog_cc_stdc=no
903 # Don't try gcc -ansi; that turns off useful extensions and
904 # breaks some systems' header files.
906 # Ultrix and OSF/1 -std1
907 # HP-UX -Aa -D_HPUX_SOURCE
908 # SVR4 -Xc -D__EXTENSIONS__
909 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
911 CC="$ac_save_CC $ac_arg"
915 #include <sys/types.h>
916 #include <sys/stat.h>
917 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
918 struct buf { int x; };
919 FILE * (*rcsopen) (struct buf *, struct stat *, int);
920 static char *e (p, i)
926 static char *f (char * (*g) (char **, int), char **p, ...)
931 s = g (p, va_arg (v,int));
935 int test (int i, double x);
936 struct s1 {int (*f) (int a);};
937 struct s2 {int (*f) (double a);};
938 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
942 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
944 [am_cv_prog_cc_stdc="$ac_arg"; break])
948 if test -z "$am_cv_prog_cc_stdc"; then
949 AC_MSG_RESULT([none needed])
951 AC_MSG_RESULT($am_cv_prog_cc_stdc)
953 case "x$am_cv_prog_cc_stdc" in
955 *) CC="$CC $am_cv_prog_cc_stdc" ;;
959 # Do all the work for Automake. This macro actually does too much --
960 # some checks are only needed if your package does certain things.
961 # But this isn't really a big deal.
966 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
968 AC_DEFUN(AM_INIT_AUTOMAKE,
969 [AC_REQUIRE([AC_PROG_INSTALL])
974 dnl test to see if srcdir already configured
975 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
976 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
979 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
980 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
981 AC_REQUIRE([AM_SANITY_CHECK])
982 AC_REQUIRE([AC_ARG_PROGRAM])
983 dnl FIXME This is truly gross.
984 missing_dir=`cd $ac_aux_dir && pwd`
985 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
986 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
987 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
988 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
989 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
990 AC_REQUIRE([AC_PROG_MAKE_SET])])
993 # Check to make sure that the build environment is sane.
996 AC_DEFUN(AM_SANITY_CHECK,
997 [AC_MSG_CHECKING([whether build environment is sane])
1000 echo timestamp > conftestfile
1001 # Do `set' in a subshell so we don't clobber the current shell's
1002 # arguments. Must try -L first in case configure is actually a
1003 # symlink; some systems play weird games with the mod time of symlinks
1004 # (eg FreeBSD returns the mod time of the symlink's containing
1007 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1008 if test "[$]*" = "X"; then
1010 set X `ls -t $srcdir/configure conftestfile`
1012 if test "[$]*" != "X $srcdir/configure conftestfile" \
1013 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1015 # If neither matched, then we have a broken ls. This can happen
1016 # if, for instance, CONFIG_SHELL is bash and it inherits a
1017 # broken ls alias from the environment. This has actually
1018 # happened. Such a system could not be considered "sane".
1019 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1020 alias in your environment])
1023 test "[$]2" = conftestfile
1029 AC_MSG_ERROR([newly created file is older than distributed files!
1030 Check your system clock])
1033 AC_MSG_RESULT(yes)])
1035 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1036 dnl The program must properly implement --version.
1037 AC_DEFUN(AM_MISSING_PROG,
1038 [AC_MSG_CHECKING(for working $2)
1039 # Run test in a subshell; some versions of sh will print an error if
1040 # an executable is not found, even if stderr is redirected.
1041 # Redirect stdin to placate older versions of autoconf. Sigh.
1042 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1044 AC_MSG_RESULT(found)
1047 AC_MSG_RESULT(missing)
1051 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1053 AC_DEFUN(AM_CONFIG_HEADER,
1055 AC_CONFIG_HEADER([$1])
1056 dnl When config.status generates a header, we must update the stamp-h file.
1057 dnl This file resides in the same directory as the config header
1058 dnl that is generated. We must strip everything past the first ":",
1059 dnl and everything past the last "/".
1060 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1061 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1062 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1064 for am_file in <<$1>>; do
1065 case " <<$>>CONFIG_HEADERS " in
1066 *" <<$>>am_file "*<<)>>
1067 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1070 am_indx=`expr "<<$>>am_indx" + 1`
1074 # Add --enable-maintainer-mode option to configure.
1079 AC_DEFUN(AM_MAINTAINER_MODE,
1080 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1081 dnl maintainer-mode is disabled by default
1082 AC_ARG_ENABLE(maintainer-mode,
1083 [ --enable-maintainer-mode enable make rules and dependencies not useful
1084 (and sometimes confusing) to the casual installer],
1085 USE_MAINTAINER_MODE=$enableval,
1086 USE_MAINTAINER_MODE=no)
1087 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1088 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1089 MAINT=$MAINTAINER_MODE_TRUE
1094 # Define a conditional.
1096 AC_DEFUN(AM_CONDITIONAL,
1108 # serial 40 AC_PROG_LIBTOOL
1109 AC_DEFUN(AC_PROG_LIBTOOL,
1110 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1112 # Save cache, so that ltconfig can load it
1115 # Actually configure libtool. ac_aux_dir is where install-sh is found.
1116 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1117 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1118 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
1119 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
1120 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1121 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
1122 || AC_MSG_ERROR([libtool configure failed])
1124 # Reload cache, that may have been modified by ltconfig
1127 # This can be used to rebuild libtool when needed
1128 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1130 # Always use our own libtool.
1131 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1132 AC_SUBST(LIBTOOL)dnl
1134 # Redirect the config.log output again, so that the ltconfig log is not
1135 # clobbered by the next message.
1136 exec 5>>./config.log
1139 AC_DEFUN(AC_LIBTOOL_SETUP,
1141 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1142 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1143 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1144 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1145 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1146 AC_REQUIRE([AC_PROG_RANLIB])dnl
1147 AC_REQUIRE([AC_PROG_CC])dnl
1148 AC_REQUIRE([AC_PROG_LD])dnl
1149 AC_REQUIRE([AC_PROG_NM])dnl
1150 AC_REQUIRE([AC_PROG_LN_S])dnl
1154 NONE) lt_target="$host" ;;
1155 *) lt_target="$target" ;;
1158 # Check for any special flags to pass to ltconfig.
1159 libtool_flags="--cache-file=$cache_file"
1160 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1161 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1162 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1163 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1164 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1165 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1166 [libtool_flags="$libtool_flags --enable-dlopen"])
1167 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1168 [libtool_flags="$libtool_flags --enable-win32-dll"])
1169 AC_ARG_ENABLE(libtool-lock,
1170 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1171 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1172 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1174 # Some flags need to be propagated to the compiler or linker for good
1176 case "$lt_target" in
1178 # Find out which ABI we are using.
1179 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1180 if AC_TRY_EVAL(ac_compile); then
1181 case "`/usr/bin/file conftest.o`" in
1197 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1198 SAVE_CFLAGS="$CFLAGS"
1199 CFLAGS="$CFLAGS -belf"
1200 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1201 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1202 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1203 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1204 CFLAGS="$SAVE_CFLAGS"
1208 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1209 [*-*-cygwin* | *-*-mingw*)
1210 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1211 AC_CHECK_TOOL(AS, as, false)
1212 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1218 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1219 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1221 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1222 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1224 # AC_ENABLE_SHARED - implement the --enable-shared flag
1225 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1226 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1228 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1229 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1230 AC_ARG_ENABLE(shared,
1231 changequote(<<, >>)dnl
1232 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1233 changequote([, ])dnl
1234 [p=${PACKAGE-default}
1235 case "$enableval" in
1236 yes) enable_shared=yes ;;
1237 no) enable_shared=no ;;
1240 # Look at the argument we got. We use all the common list separators.
1241 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1242 for pkg in $enableval; do
1243 if test "X$pkg" = "X$p"; then
1250 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1253 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1254 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1255 AC_ENABLE_SHARED(no)])
1257 # AC_ENABLE_STATIC - implement the --enable-static flag
1258 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1259 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1261 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1262 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1263 AC_ARG_ENABLE(static,
1264 changequote(<<, >>)dnl
1265 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1266 changequote([, ])dnl
1267 [p=${PACKAGE-default}
1268 case "$enableval" in
1269 yes) enable_static=yes ;;
1270 no) enable_static=no ;;
1273 # Look at the argument we got. We use all the common list separators.
1274 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1275 for pkg in $enableval; do
1276 if test "X$pkg" = "X$p"; then
1283 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1286 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1287 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1288 AC_ENABLE_STATIC(no)])
1291 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1292 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1293 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1295 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1296 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1297 AC_ARG_ENABLE(fast-install,
1298 changequote(<<, >>)dnl
1299 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1300 changequote([, ])dnl
1301 [p=${PACKAGE-default}
1302 case "$enableval" in
1303 yes) enable_fast_install=yes ;;
1304 no) enable_fast_install=no ;;
1306 enable_fast_install=no
1307 # Look at the argument we got. We use all the common list separators.
1308 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1309 for pkg in $enableval; do
1310 if test "X$pkg" = "X$p"; then
1311 enable_fast_install=yes
1317 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1320 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1321 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1322 AC_ENABLE_FAST_INSTALL(no)])
1324 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1325 AC_DEFUN(AC_PROG_LD,
1326 [AC_ARG_WITH(gnu-ld,
1327 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1328 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1329 AC_REQUIRE([AC_PROG_CC])dnl
1330 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1331 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1333 if test "$ac_cv_prog_gcc" = yes; then
1334 # Check if gcc -print-prog-name=ld gives a path.
1335 AC_MSG_CHECKING([for ld used by GCC])
1336 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1338 # Accept absolute paths.
1340 [\\/]* | [A-Za-z]:[\\/]*)
1341 re_direlt='/[^/][^/]*/\.\./'
1343 # Canonicalize the path of ld
1344 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1345 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1346 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1348 test -z "$LD" && LD="$ac_prog"
1351 # If it fails, then pretend we aren't using GCC.
1355 # If it is relative, then search for the first ld in PATH.
1359 elif test "$with_gnu_ld" = yes; then
1360 AC_MSG_CHECKING([for GNU ld])
1362 AC_MSG_CHECKING([for non-GNU ld])
1364 AC_CACHE_VAL(ac_cv_path_LD,
1365 [if test -z "$LD"; then
1366 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1367 for ac_dir in $PATH; do
1368 test -z "$ac_dir" && ac_dir=.
1369 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1370 ac_cv_path_LD="$ac_dir/$ac_prog"
1371 # Check to see if the program is GNU ld. I'd rather use --version,
1372 # but apparently some GNU ld's only accept -v.
1373 # Break only if it was the GNU/non-GNU ld that we prefer.
1374 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1375 test "$with_gnu_ld" != no && break
1377 test "$with_gnu_ld" != yes && break
1383 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1386 if test -n "$LD"; then
1391 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1395 AC_DEFUN(AC_PROG_LD_GNU,
1396 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1397 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1398 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1399 ac_cv_prog_gnu_ld=yes
1401 ac_cv_prog_gnu_ld=no
1405 # AC_PROG_NM - find the path to a BSD-compatible name lister
1406 AC_DEFUN(AC_PROG_NM,
1407 [AC_MSG_CHECKING([for BSD-compatible nm])
1408 AC_CACHE_VAL(ac_cv_path_NM,
1409 [if test -n "$NM"; then
1410 # Let the user override the test.
1413 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1414 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1415 test -z "$ac_dir" && ac_dir=.
1416 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1417 # Check to see if the nm accepts a BSD-compat flag.
1418 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1419 # nm: unknown option "B" ignored
1420 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1421 ac_cv_path_NM="$ac_dir/nm -B"
1423 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1424 ac_cv_path_NM="$ac_dir/nm -p"
1427 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1428 continue # so that we can try to find one that supports BSD flags
1433 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1436 AC_MSG_RESULT([$NM])
1439 # AC_CHECK_LIBM - check for math library
1440 AC_DEFUN(AC_CHECK_LIBM,
1441 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1443 case "$lt_target" in
1444 *-*-beos* | *-*-cygwin*)
1445 # These system don't have libm
1448 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1449 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1452 AC_CHECK_LIB(m, main, LIBM="-lm")
1457 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1458 # the libltdl convenience library, adds --enable-ltdl-convenience to
1459 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1460 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1461 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1462 # '${top_builddir}/' (note the single quotes!) if your package is not
1463 # flat, and, if you're not using automake, define top_builddir as
1464 # appropriate in the Makefiles.
1465 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1466 case "$enable_ltdl_convenience" in
1467 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1468 "") enable_ltdl_convenience=yes
1469 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1471 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1472 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1475 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1476 # the libltdl installable library, and adds --enable-ltdl-install to
1477 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1478 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1479 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1480 # '${top_builddir}/' (note the single quotes!) if your package is not
1481 # flat, and, if you're not using automake, define top_builddir as
1482 # appropriate in the Makefiles.
1483 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1484 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1485 AC_CHECK_LIB(ltdl, main,
1486 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1487 [if test x"$enable_ltdl_install" = xno; then
1488 AC_MSG_WARN([libltdl not installed, but installation disabled])
1490 enable_ltdl_install=yes
1493 if test x"$enable_ltdl_install" = x"yes"; then
1494 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1495 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1496 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1498 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1505 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1506 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1507 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1508 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1509 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1510 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1511 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1513 dnl This is just to silence aclocal about the macro not being used
1514 ifelse([AC_DISABLE_FAST_INSTALL])dnl