1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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 10.20 and later -Ae
908 # HP-UX older versions -Aa -D_HPUX_SOURCE
909 # SVR4 -Xc -D__EXTENSIONS__
910 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
912 CC="$ac_save_CC $ac_arg"
916 #include <sys/types.h>
917 #include <sys/stat.h>
918 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
919 struct buf { int x; };
920 FILE * (*rcsopen) (struct buf *, struct stat *, int);
921 static char *e (p, i)
927 static char *f (char * (*g) (char **, int), char **p, ...)
932 s = g (p, va_arg (v,int));
936 int test (int i, double x);
937 struct s1 {int (*f) (int a);};
938 struct s2 {int (*f) (double a);};
939 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
943 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
945 [am_cv_prog_cc_stdc="$ac_arg"; break])
949 if test -z "$am_cv_prog_cc_stdc"; then
950 AC_MSG_RESULT([none needed])
952 AC_MSG_RESULT($am_cv_prog_cc_stdc)
954 case "x$am_cv_prog_cc_stdc" in
956 *) CC="$CC $am_cv_prog_cc_stdc" ;;
960 # Do all the work for Automake. This macro actually does too much --
961 # some checks are only needed if your package does certain things.
962 # But this isn't really a big deal.
967 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
969 AC_DEFUN(AM_INIT_AUTOMAKE,
970 [AC_REQUIRE([AC_PROG_INSTALL])
971 dnl We require 2.13 because we rely on SHELL being computed by configure.
977 dnl test to see if srcdir already configured
978 if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
979 test -f $srcdir/config.status; then
980 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
983 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
984 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
985 AC_REQUIRE([AM_SANITY_CHECK])
986 AC_REQUIRE([AC_ARG_PROGRAM])
987 AM_MISSING_PROG(ACLOCAL, aclocal)
988 AM_MISSING_PROG(AUTOCONF, autoconf)
989 AM_MISSING_PROG(AUTOMAKE, automake)
990 AM_MISSING_PROG(AUTOHEADER, autoheader)
991 AM_MISSING_PROG(MAKEINFO, makeinfo)
992 AM_MISSING_PROG(AMTAR, tar)
993 AM_MISSING_INSTALL_SH
994 dnl We need awk for the "check" target. The system "awk" is bad on
996 AC_REQUIRE([AC_PROG_AWK])
997 AC_REQUIRE([AC_PROG_MAKE_SET])
998 AC_REQUIRE([AM_DEP_TRACK])
999 AC_REQUIRE([AM_SET_DEPDIR])
1000 ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [
1001 define([AC_PROG_CC], defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])
1002 ifdef([AC_PROVIDE_AC_PROG_CXX], [AM_DEPENDENCIES(CXX)], [
1003 define([AC_PROG_CXX], defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])
1007 # Check to make sure that the build environment is sane.
1010 AC_DEFUN(AM_SANITY_CHECK,
1011 [AC_MSG_CHECKING([whether build environment is sane])
1014 echo timestamp > conftestfile
1015 # Do `set' in a subshell so we don't clobber the current shell's
1016 # arguments. Must try -L first in case configure is actually a
1017 # symlink; some systems play weird games with the mod time of symlinks
1018 # (eg FreeBSD returns the mod time of the symlink's containing
1021 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1022 if test "[$]*" = "X"; then
1024 set X `ls -t $srcdir/configure conftestfile`
1026 if test "[$]*" != "X $srcdir/configure conftestfile" \
1027 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1029 # If neither matched, then we have a broken ls. This can happen
1030 # if, for instance, CONFIG_SHELL is bash and it inherits a
1031 # broken ls alias from the environment. This has actually
1032 # happened. Such a system could not be considered "sane".
1033 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1034 alias in your environment])
1037 test "[$]2" = conftestfile
1043 AC_MSG_ERROR([newly created file is older than distributed files!
1044 Check your system clock])
1047 AC_MSG_RESULT(yes)])
1049 dnl AM_MISSING_PROG(NAME, PROGRAM)
1050 AC_DEFUN(AM_MISSING_PROG, [
1051 AC_REQUIRE([AM_MISSING_HAS_RUN])
1052 $1=${$1-"${am_missing_run}$2"}
1055 dnl Like AM_MISSING_PROG, but only looks for install-sh.
1056 dnl AM_MISSING_INSTALL_SH()
1057 AC_DEFUN(AM_MISSING_INSTALL_SH, [
1058 AC_REQUIRE([AM_MISSING_HAS_RUN])
1059 if test -z "$install_sh"; then
1060 install_sh="$ac_aux_dir/install-sh"
1061 test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
1062 test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
1063 dnl FIXME: an evil hack: we remove the SHELL invocation from
1064 dnl install_sh because automake adds it back in. Sigh.
1065 install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
1067 AC_SUBST(install_sh)])
1069 dnl AM_MISSING_HAS_RUN.
1070 dnl Define MISSING if not defined so far and test if it supports --run.
1071 dnl If it does, set am_missing_run to use it, otherwise, to nothing.
1072 AC_DEFUN([AM_MISSING_HAS_RUN], [
1073 test x"${MISSING+set}" = xset || \
1074 MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing"
1075 dnl Use eval to expand $SHELL
1076 if eval "$MISSING --run :"; then
1077 am_missing_run="$MISSING --run "
1081 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
1085 dnl See how the compiler implements dependency checking.
1087 dnl AM_DEPENDENCIES(NAME)
1088 dnl NAME is "CC", "CXX" or "OBJC".
1090 dnl We try a few techniques and use that to set a single cache variable.
1092 AC_DEFUN(AM_DEPENDENCIES,[
1093 AC_REQUIRE([AM_SET_DEPDIR])
1094 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
1096 AC_REQUIRE([AC_PROG_CC])
1097 AC_REQUIRE([AC_PROG_CPP])
1099 depcpp="$CPP"],[$1],CXX,[
1100 AC_REQUIRE([AC_PROG_CXX])
1101 AC_REQUIRE([AC_PROG_CXXCPP])
1103 depcpp="$CXXCPP"],[$1],OBJC,[
1104 am_cv_OBJC_dependencies_compiler_type=gcc],[
1105 AC_REQUIRE([AC_PROG_][$1])
1108 AC_MSG_CHECKING([dependency style of $depcc])
1109 AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
1110 if test -z "$AMDEP"; then
1111 echo '#include "conftest.h"' > conftest.c
1112 echo 'int i;' > conftest.h
1114 am_cv_[$1]_dependencies_compiler_type=none
1115 for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
1118 # after this tag, mechanisms are not by side-effect, so they'll
1119 # only be used when explicitly requested
1120 if test "x$enable_dependency_tracking" = xyes; then
1128 if depmode="$depmode" \
1129 source=conftest.c object=conftest.o \
1130 depfile=conftest.Po tmpdepfile=conftest.TPo \
1131 $SHELL $am_depcomp $depcc -c conftest.c 2>/dev/null &&
1132 grep conftest.h conftest.Po > /dev/null 2>&1; then
1133 am_cv_[$1]_dependencies_compiler_type="$depmode"
1140 am_cv_[$1]_dependencies_compiler_type=none
1143 AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
1144 [$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
1145 AC_SUBST([$1]DEPMODE)
1148 dnl Choose a directory name for dependency files.
1149 dnl This macro is AC_REQUIREd in AM_DEPENDENCIES
1151 AC_DEFUN(AM_SET_DEPDIR,[
1152 if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
1160 AC_DEFUN(AM_DEP_TRACK,[
1161 AC_ARG_ENABLE(dependency-tracking,
1162 [ --disable-dependency-tracking Speeds up one-time builds
1163 --enable-dependency-tracking Do not reject slow dependency extractors])
1164 if test "x$enable_dependency_tracking" = xno; then
1167 am_depcomp="$ac_aux_dir/depcomp"
1168 if test ! -f "$am_depcomp"; then
1175 if test -z "$AMDEP"; then
1180 pushdef([subst], defn([AC_SUBST]))
1181 subst(AMDEPBACKSLASH)
1185 dnl Generate code to set up dependency tracking.
1186 dnl This macro should only be invoked once -- use via AC_REQUIRE.
1188 dnl AM_OUTPUT_DEPENDENCY_COMMANDS
1191 dnl This code is only required when automatic dependency tracking
1192 dnl is enabled. FIXME. This creates each `.P' file that we will
1193 dnl need in order to bootstrap the dependency handling code.
1194 AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[
1195 AC_OUTPUT_COMMANDS([
1196 test x"$AMDEP" != x"" ||
1197 for mf in $CONFIG_FILES; do
1199 Makefile) dirpart=.;;
1200 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
1203 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
1204 # Extract the definition of DEP_FILES from the Makefile without
1206 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
1207 test -z "$DEPDIR" && continue
1208 # When using ansi2knr, U may be empty or an underscore; expand it
1209 U=`sed -n -e '/^U = / s///p' < "$mf"`
1210 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
1211 # We invoke sed twice because it is the simplest approach to
1212 # changing $(DEPDIR) to its actual value in the expansion.
1213 for file in `sed -n -e '
1214 /^DEP_FILES = .*\\\\$/ {
1223 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
1224 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1225 # Make sure the directory exists.
1226 test -f "$dirpart/$file" && continue
1227 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
1228 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
1229 # echo "creating $dirpart/$file"
1230 echo '# dummy' > "$dirpart/$file"
1234 ac_aux_dir="$ac_aux_dir"])])
1236 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1238 AC_DEFUN(AM_CONFIG_HEADER,
1240 AC_CONFIG_HEADER([$1])
1241 dnl When config.status generates a header, we must update the stamp-h file.
1242 dnl This file resides in the same directory as the config header
1243 dnl that is generated. We must strip everything past the first ":",
1244 dnl and everything past the last "/".
1245 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1246 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1247 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1249 for am_file in <<$1>>; do
1250 case " <<$>>CONFIG_HEADERS " in
1251 *" <<$>>am_file "*<<)>>
1252 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1255 am_indx=`expr "<<$>>am_indx" + 1`
1259 # Add --enable-maintainer-mode option to configure.
1264 AC_DEFUN(AM_MAINTAINER_MODE,
1265 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1266 dnl maintainer-mode is disabled by default
1267 AC_ARG_ENABLE(maintainer-mode,
1268 [ --enable-maintainer-mode enable make rules and dependencies not useful
1269 (and sometimes confusing) to the casual installer],
1270 USE_MAINTAINER_MODE=$enableval,
1271 USE_MAINTAINER_MODE=no)
1272 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1273 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1274 MAINT=$MAINTAINER_MODE_TRUE
1279 # Define a conditional.
1281 AC_DEFUN(AM_CONDITIONAL,
1293 # serial 42 AC_PROG_LIBTOOL
1294 AC_DEFUN(AC_PROG_LIBTOOL,
1295 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1297 # Save cache, so that ltconfig can load it
1300 # Actually configure libtool. ac_aux_dir is where install-sh is found.
1301 AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1302 MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1303 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
1304 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
1305 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
1306 deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
1307 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1308 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $lt_target \
1309 || AC_MSG_ERROR([libtool configure failed])
1311 # Reload cache, that may have been modified by ltconfig
1314 # This can be used to rebuild libtool when needed
1315 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1317 # Always use our own libtool.
1318 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1319 AC_SUBST(LIBTOOL)dnl
1321 # Redirect the config.log output again, so that the ltconfig log is not
1322 # clobbered by the next message.
1323 exec 5>>./config.log
1326 AC_DEFUN(AC_LIBTOOL_SETUP,
1328 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1329 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1330 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1331 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1332 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1333 AC_REQUIRE([AC_PROG_CC])dnl
1334 AC_REQUIRE([AC_PROG_LD])dnl
1335 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1336 AC_REQUIRE([AC_PROG_NM])dnl
1337 AC_REQUIRE([AC_PROG_LN_S])dnl
1338 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1339 AC_REQUIRE([AC_OBJEXT])dnl
1340 AC_REQUIRE([AC_EXEEXT])dnl
1343 # Only perform the check for file, if the check method requires it
1344 case "$deplibs_check_method" in
1346 if test "$file_magic_cmd" = '${MAGIC}'; then
1353 NONE) lt_target="$host" ;;
1354 *) lt_target="$target" ;;
1357 AC_CHECK_TOOL(RANLIB, ranlib, :)
1358 AC_CHECK_TOOL(STRIP, strip, :)
1360 # Check for any special flags to pass to ltconfig.
1361 libtool_flags="--cache-file=$cache_file"
1362 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1363 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1364 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1365 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1366 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1367 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1368 [libtool_flags="$libtool_flags --enable-dlopen"])
1369 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1370 [libtool_flags="$libtool_flags --enable-win32-dll"])
1371 AC_ARG_ENABLE(libtool-lock,
1372 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1373 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1374 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1377 [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
1378 pic_mode="$withval", pic_mode=default)
1379 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
1380 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
1382 # Some flags need to be propagated to the compiler or linker for good
1384 case "$lt_target" in
1386 # Find out which ABI we are using.
1387 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1388 if AC_TRY_EVAL(ac_compile); then
1389 case "`/usr/bin/file conftest.o`" in
1405 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1406 SAVE_CFLAGS="$CFLAGS"
1407 CFLAGS="$CFLAGS -belf"
1408 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1411 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1413 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1414 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1415 CFLAGS="$SAVE_CFLAGS"
1419 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1420 [*-*-cygwin* | *-*-mingw*)
1421 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1422 AC_CHECK_TOOL(AS, as, false)
1423 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1425 # recent cygwin and mingw systems supply a stub DllMain which the user
1426 # can override, but on older systems we have to supply one
1427 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1429 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1430 DllMain (0, 0, 0);],
1431 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1433 case "$lt_target/$CC" in
1434 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1435 # old mingw systems require "-dll" to link a DLL, while more recent ones
1437 SAVE_CFLAGS="$CFLAGS"
1438 CFLAGS="$CFLAGS -mdll"
1439 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1440 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1441 CFLAGS="$SAVE_CFLAGS" ;;
1443 # cygwin systems need to pass --dll to the linker, and not link
1444 # crt.o which will require a WinMain@16 definition.
1445 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1452 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1453 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1455 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1456 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1458 # AC_ENABLE_SHARED - implement the --enable-shared flag
1459 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1460 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1462 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1463 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1464 AC_ARG_ENABLE(shared,
1465 changequote(<<, >>)dnl
1466 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1467 changequote([, ])dnl
1468 [p=${PACKAGE-default}
1469 case "$enableval" in
1470 yes) enable_shared=yes ;;
1471 no) enable_shared=no ;;
1474 # Look at the argument we got. We use all the common list separators.
1475 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1476 for pkg in $enableval; do
1477 if test "X$pkg" = "X$p"; then
1484 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1487 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1488 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1489 AC_ENABLE_SHARED(no)])
1491 # AC_ENABLE_STATIC - implement the --enable-static flag
1492 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1493 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1495 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1496 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1497 AC_ARG_ENABLE(static,
1498 changequote(<<, >>)dnl
1499 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1500 changequote([, ])dnl
1501 [p=${PACKAGE-default}
1502 case "$enableval" in
1503 yes) enable_static=yes ;;
1504 no) enable_static=no ;;
1507 # Look at the argument we got. We use all the common list separators.
1508 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1509 for pkg in $enableval; do
1510 if test "X$pkg" = "X$p"; then
1517 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1520 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1521 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1522 AC_ENABLE_STATIC(no)])
1525 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1526 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1527 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1529 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1530 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1531 AC_ARG_ENABLE(fast-install,
1532 changequote(<<, >>)dnl
1533 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1534 changequote([, ])dnl
1535 [p=${PACKAGE-default}
1536 case "$enableval" in
1537 yes) enable_fast_install=yes ;;
1538 no) enable_fast_install=no ;;
1540 enable_fast_install=no
1541 # Look at the argument we got. We use all the common list separators.
1542 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1543 for pkg in $enableval; do
1544 if test "X$pkg" = "X$p"; then
1545 enable_fast_install=yes
1551 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1554 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1555 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1556 AC_ENABLE_FAST_INSTALL(no)])
1559 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
1560 AC_DEFUN(AC_PATH_TOOL_PREFIX,
1561 [AC_MSG_CHECKING([for $1])
1562 AC_CACHE_VAL(lt_cv_path_MAGIC,
1565 lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
1568 ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
1571 ac_save_MAGIC="$MAGIC"
1572 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1573 dnl $ac_dummy forces splitting on constant user-supplied paths.
1574 dnl POSIX.2 word splitting is done only on the output of word expansions,
1575 dnl not every word. This closes a longstanding sh security hole.
1576 ac_dummy="ifelse([$2], , $PATH, [$2])"
1577 for ac_dir in $ac_dummy; do
1578 test -z "$ac_dir" && ac_dir=.
1579 if test -f $ac_dir/$1; then
1580 lt_cv_path_MAGIC="$ac_dir/$1"
1581 if test -n "$file_magic_test_file"; then
1582 case "$deplibs_check_method" in
1584 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
1585 MAGIC="$lt_cv_path_MAGIC"
1586 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
1587 egrep "$file_magic_regex" > /dev/null; then
1592 *** Warning: the command libtool uses to detect shared libraries,
1593 *** $file_magic_cmd, produces output that libtool cannot recognize.
1594 *** The result is that libtool may fail to recognize shared libraries
1595 *** as such. This will affect the creation of libtool libraries that
1596 *** depend on shared libraries, but programs linked with such libtool
1597 *** libraries will work regardless of this problem. Nevertheless, you
1598 *** may want to report the problem to your system manager and/or to
1599 *** bug-libtool@gnu.org
1609 MAGIC="$ac_save_MAGIC"
1612 MAGIC="$lt_cv_path_MAGIC"
1613 if test -n "$MAGIC"; then
1614 AC_MSG_RESULT($MAGIC)
1621 # AC_PATH_MAGIC - find a file program which can recognise a shared library
1622 AC_DEFUN(AC_PATH_MAGIC,
1623 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
1624 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
1625 if test -z "$lt_cv_path_MAGIC"; then
1626 if test -n "$ac_tool_prefix"; then
1627 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
1635 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1636 AC_DEFUN(AC_PROG_LD,
1637 [AC_ARG_WITH(gnu-ld,
1638 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1639 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1640 AC_REQUIRE([AC_PROG_CC])dnl
1641 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1642 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1644 if test "$ac_cv_prog_gcc" = yes; then
1645 # Check if gcc -print-prog-name=ld gives a path.
1646 AC_MSG_CHECKING([for ld used by GCC])
1649 # gcc leaves a trailing carriage return which upsets mingw
1650 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1652 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1655 # Accept absolute paths.
1657 [\\/]* | [A-Za-z]:[\\/]*)
1658 re_direlt='/[^/][^/]*/\.\./'
1660 # Canonicalize the path of ld
1661 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1662 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1663 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1665 test -z "$LD" && LD="$ac_prog"
1668 # If it fails, then pretend we aren't using GCC.
1672 # If it is relative, then search for the first ld in PATH.
1676 elif test "$with_gnu_ld" = yes; then
1677 AC_MSG_CHECKING([for GNU ld])
1679 AC_MSG_CHECKING([for non-GNU ld])
1681 AC_CACHE_VAL(ac_cv_path_LD,
1682 [if test -z "$LD"; then
1683 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1684 for ac_dir in $PATH; do
1685 test -z "$ac_dir" && ac_dir=.
1686 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1687 ac_cv_path_LD="$ac_dir/$ac_prog"
1688 # Check to see if the program is GNU ld. I'd rather use --version,
1689 # but apparently some GNU ld's only accept -v.
1690 # Break only if it was the GNU/non-GNU ld that we prefer.
1691 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1692 test "$with_gnu_ld" != no && break
1694 test "$with_gnu_ld" != yes && break
1700 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1703 if test -n "$LD"; then
1708 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1712 AC_DEFUN(AC_PROG_LD_GNU,
1713 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1714 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1715 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1716 ac_cv_prog_gnu_ld=yes
1718 ac_cv_prog_gnu_ld=no
1720 with_gnu_ld=$ac_cv_prog_gnu_ld
1723 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
1724 # -- PORTME Some linkers may need a different reload flag.
1725 AC_DEFUN(AC_PROG_LD_RELOAD_FLAG,
1726 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
1727 [lt_cv_ld_reload_flag='-r'])
1728 reload_flag=$lt_cv_ld_reload_flag
1729 test -n "$reload_flag" && reload_flag=" $reload_flag"
1732 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
1733 # -- PORTME fill in with the dynamic library characteristics
1734 AC_DEFUN(AC_DEPLIBS_CHECK_METHOD,
1735 [AC_CACHE_CHECK([how to recognise dependant libraries],
1736 lt_cv_deplibs_check_method,
1737 [lt_cv_file_magic_cmd='${MAGIC}'
1738 lt_cv_file_magic_test_file=
1739 lt_cv_deplibs_check_method='unknown'
1740 # Need to set the preceding variable on all platforms that support
1741 # interlibrary dependencies.
1742 # 'none' -- dependencies not supported.
1743 # `unknown' -- same as none, but documents that we really don't know.
1744 # 'pass_all' -- all dependencies passed with no checks.
1745 # 'test_compile' -- check by making test program.
1746 # 'file_magic [regex]' -- check by looking for files in library path
1747 # which responds to the $file_magic_cmd with a given egrep regex.
1748 # If you have `file' or equivalent on your system and you're not sure
1749 # whether `pass_all' will *always* work, you probably want this one.
1753 lt_cv_deplibs_check_method=pass_all
1758 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
1759 changequote([, ])dnl
1760 lt_cv_file_magic_test_file=/shlib/libc.so
1764 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
1765 lt_cv_file_magic_cmd='${OBJDUMP} -f'
1769 case "$version_type" in
1771 lt_cv_deplibs_check_method=pass_all
1777 lt_cv_deplibs_check_method=pass_all
1783 # this will be overridden with pass_all, but let us keep it just in case
1784 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
1788 *-32|*"-32 ") libmagic=32-bit;;
1789 *-n32|*"-n32 ") libmagic=N32;;
1790 *-64|*"-64 ") libmagic=64-bit;;
1791 *) libmagic=never-match;;
1793 # this will be overridden with pass_all, but let us keep it just in case
1795 lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
1796 changequote([, ])dnl
1799 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
1800 lt_cv_deplibs_check_method=pass_all
1803 # This must be Linux ELF.
1806 alpha* | i*86 | powerpc* | sparc* )
1807 lt_cv_deplibs_check_method=pass_all ;;
1809 # glibc up to 2.1.1 does not perform some relocations on ARM
1811 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
1812 changequote([, ])dnl
1814 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
1817 osf3* | osf4* | osf5*)
1818 # this will be overridden with pass_all, but let us keep it just in case
1819 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
1820 lt_cv_file_magic_test_file=/shlib/libc.so
1821 lt_cv_deplibs_check_method=pass_all
1825 lt_cv_deplibs_check_method=pass_all
1829 lt_cv_deplibs_check_method=pass_all
1830 lt_cv_file_magic_test_file=/lib/libc.so
1833 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1834 case "$host_vendor" in
1836 lt_cv_deplibs_check_method=pass_all
1840 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
1841 changequote([, ])dnl
1842 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
1848 file_magic_cmd=$lt_cv_file_magic_cmd
1849 deplibs_check_method=$lt_cv_deplibs_check_method
1853 # AC_PROG_NM - find the path to a BSD-compatible name lister
1854 AC_DEFUN(AC_PROG_NM,
1855 [AC_MSG_CHECKING([for BSD-compatible nm])
1856 AC_CACHE_VAL(ac_cv_path_NM,
1857 [if test -n "$NM"; then
1858 # Let the user override the test.
1861 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1862 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1863 test -z "$ac_dir" && ac_dir=.
1864 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1865 # Check to see if the nm accepts a BSD-compat flag.
1866 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1867 # nm: unknown option "B" ignored
1868 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1869 ac_cv_path_NM="$ac_dir/nm -B"
1871 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1872 ac_cv_path_NM="$ac_dir/nm -p"
1875 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1876 continue # so that we can try to find one that supports BSD flags
1881 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1884 AC_MSG_RESULT([$NM])
1887 # AC_CHECK_LIBM - check for math library
1888 AC_DEFUN(AC_CHECK_LIBM,
1889 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1891 case "$lt_target" in
1892 *-*-beos* | *-*-cygwin*)
1893 # These system don't have libm
1896 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1897 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1900 AC_CHECK_LIB(m, main, LIBM="-lm")
1905 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1906 # the libltdl convenience library, adds --enable-ltdl-convenience to
1907 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1908 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1909 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1910 # '${top_builddir}/' (note the single quotes!) if your package is not
1911 # flat, and, if you're not using automake, define top_builddir as
1912 # appropriate in the Makefiles.
1913 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1914 case "$enable_ltdl_convenience" in
1915 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1916 "") enable_ltdl_convenience=yes
1917 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1919 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1920 INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl'])
1923 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1924 # the libltdl installable library, and adds --enable-ltdl-install to
1925 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1926 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1927 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1928 # '${top_builddir}/' (note the single quotes!) if your package is not
1929 # flat, and, if you're not using automake, define top_builddir as
1930 # appropriate in the Makefiles.
1931 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1932 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1933 AC_CHECK_LIB(ltdl, main,
1934 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1935 [if test x"$enable_ltdl_install" = xno; then
1936 AC_MSG_WARN([libltdl not installed, but installation disabled])
1938 enable_ltdl_install=yes
1941 if test x"$enable_ltdl_install" = x"yes"; then
1942 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1943 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1944 INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl'])
1946 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1953 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1954 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1955 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1956 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1957 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1958 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1959 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1961 dnl This is just to silence aclocal about the macro not being used
1962 ifelse([AC_DISABLE_FAST_INSTALL])dnl