1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 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 sinclude(../bfd/acinclude.m4)
15 dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
16 dnl The lines below arrange for aclocal not to bring libtool.m4
17 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
18 dnl to add a definition of LIBTOOL to Makefile.in.
20 AC_DEFUN([AM_PROG_LIBTOOL],)
24 dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
26 AC_DEFUN([CY_WITH_NLS],)
30 # lib-prefix.m4 serial 3 (gettext-0.13)
31 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
32 dnl This file is free software, distributed under the terms of the GNU
33 dnl General Public License. As a special exception to the GNU General
34 dnl Public License, this file may be distributed as part of a program
35 dnl that contains a configuration script generated by Autoconf, under
36 dnl the same distribution terms as the rest of that program.
38 dnl From Bruno Haible.
40 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
41 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
42 dnl require excessive bracketing.
43 ifdef([AC_HELP_STRING],
44 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
45 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
47 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
48 dnl to access previously installed libraries. The basic assumption is that
49 dnl a user will want packages to use other packages he previously installed
50 dnl with the same --prefix option.
51 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
52 dnl libraries, but is otherwise very convenient.
53 AC_DEFUN([AC_LIB_PREFIX],
55 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
56 AC_REQUIRE([AC_PROG_CC])
57 AC_REQUIRE([AC_CANONICAL_HOST])
58 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
59 dnl By default, look in $includedir and $libdir.
61 AC_LIB_WITH_FINAL_PREFIX([
62 eval additional_includedir=\"$includedir\"
63 eval additional_libdir=\"$libdir\"
65 AC_LIB_ARG_WITH([lib-prefix],
66 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
67 --without-lib-prefix don't search for libraries in includedir and libdir],
69 if test "X$withval" = "Xno"; then
72 if test "X$withval" = "X"; then
73 AC_LIB_WITH_FINAL_PREFIX([
74 eval additional_includedir=\"$includedir\"
75 eval additional_libdir=\"$libdir\"
78 additional_includedir="$withval/include"
79 additional_libdir="$withval/lib"
83 if test $use_additional = yes; then
84 dnl Potentially add $additional_includedir to $CPPFLAGS.
86 dnl 1. if it's the standard /usr/include,
87 dnl 2. if it's already present in $CPPFLAGS,
88 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
89 dnl 4. if it doesn't exist as a directory.
90 if test "X$additional_includedir" != "X/usr/include"; then
92 for x in $CPPFLAGS; do
93 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
94 if test "X$x" = "X-I$additional_includedir"; then
99 if test -z "$haveit"; then
100 if test "X$additional_includedir" = "X/usr/local/include"; then
101 if test -n "$GCC"; then
107 if test -z "$haveit"; then
108 if test -d "$additional_includedir"; then
109 dnl Really add $additional_includedir to $CPPFLAGS.
110 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
115 dnl Potentially add $additional_libdir to $LDFLAGS.
117 dnl 1. if it's the standard /usr/lib,
118 dnl 2. if it's already present in $LDFLAGS,
119 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
120 dnl 4. if it doesn't exist as a directory.
121 if test "X$additional_libdir" != "X/usr/lib"; then
123 for x in $LDFLAGS; do
124 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
125 if test "X$x" = "X-L$additional_libdir"; then
130 if test -z "$haveit"; then
131 if test "X$additional_libdir" = "X/usr/local/lib"; then
132 if test -n "$GCC"; then
138 if test -z "$haveit"; then
139 if test -d "$additional_libdir"; then
140 dnl Really add $additional_libdir to $LDFLAGS.
141 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
149 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
150 dnl acl_final_exec_prefix, containing the values to which $prefix and
151 dnl $exec_prefix will expand at the end of the configure script.
152 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
154 dnl Unfortunately, prefix and exec_prefix get only finally determined
155 dnl at the end of configure.
156 if test "X$prefix" = "XNONE"; then
157 acl_final_prefix="$ac_default_prefix"
159 acl_final_prefix="$prefix"
161 if test "X$exec_prefix" = "XNONE"; then
162 acl_final_exec_prefix='${prefix}'
164 acl_final_exec_prefix="$exec_prefix"
166 acl_save_prefix="$prefix"
167 prefix="$acl_final_prefix"
168 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
169 prefix="$acl_save_prefix"
172 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
173 dnl variables prefix and exec_prefix bound to the values they will have
174 dnl at the end of the configure script.
175 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
177 acl_save_prefix="$prefix"
178 prefix="$acl_final_prefix"
179 acl_save_exec_prefix="$exec_prefix"
180 exec_prefix="$acl_final_exec_prefix"
182 exec_prefix="$acl_save_exec_prefix"
183 prefix="$acl_save_prefix"
186 # lib-link.m4 serial 4 (gettext-0.12)
187 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
188 dnl This file is free software, distributed under the terms of the GNU
189 dnl General Public License. As a special exception to the GNU General
190 dnl Public License, this file may be distributed as part of a program
191 dnl that contains a configuration script generated by Autoconf, under
192 dnl the same distribution terms as the rest of that program.
194 dnl From Bruno Haible.
196 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
197 dnl the libraries corresponding to explicit and implicit dependencies.
198 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
199 dnl augments the CPPFLAGS variable.
200 AC_DEFUN([AC_LIB_LINKFLAGS],
202 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
203 AC_REQUIRE([AC_LIB_RPATH])
204 define([Name],[translit([$1],[./-], [___])])
205 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
206 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
207 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
208 AC_LIB_LINKFLAGS_BODY([$1], [$2])
209 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
210 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
211 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
213 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
214 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
215 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
216 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
218 AC_SUBST([LTLIB]NAME)
219 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
220 dnl results of this search when this library appears as a dependency.
226 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
227 dnl searches for libname and the libraries corresponding to explicit and
228 dnl implicit dependencies, together with the specified include files and
229 dnl the ability to compile and link the specified testcode. If found, it
230 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
231 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
232 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
233 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
234 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
236 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
237 AC_REQUIRE([AC_LIB_RPATH])
238 define([Name],[translit([$1],[./-], [___])])
239 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
240 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
242 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
244 AC_LIB_LINKFLAGS_BODY([$1], [$2])
246 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
247 dnl because if the user has installed lib[]Name and not disabled its use
248 dnl via --without-lib[]Name-prefix, he wants to use it.
249 ac_save_CPPFLAGS="$CPPFLAGS"
250 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
252 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
254 LIBS="$LIBS $LIB[]NAME"
255 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
258 if test "$ac_cv_lib[]Name" = yes; then
260 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
261 AC_MSG_CHECKING([how to link with lib[]$1])
262 AC_MSG_RESULT([$LIB[]NAME])
265 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
266 dnl $INC[]NAME either.
267 CPPFLAGS="$ac_save_CPPFLAGS"
271 AC_SUBST([HAVE_LIB]NAME)
273 AC_SUBST([LTLIB]NAME)
278 dnl Determine the platform dependent parameters needed to use rpath:
279 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
280 dnl hardcode_direct, hardcode_minus_L.
281 AC_DEFUN([AC_LIB_RPATH],
283 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
284 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
285 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
286 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
287 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
288 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
289 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
295 libext="$acl_cv_libext"
296 shlibext="$acl_cv_shlibext"
297 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
298 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
299 hardcode_direct="$acl_cv_hardcode_direct"
300 hardcode_minus_L="$acl_cv_hardcode_minus_L"
301 dnl Determine whether the user wants rpath handling at all.
303 [ --disable-rpath do not hardcode runtime library paths],
307 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
308 dnl the libraries corresponding to explicit and implicit dependencies.
309 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
310 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
312 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
313 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
314 dnl By default, look in $includedir and $libdir.
316 AC_LIB_WITH_FINAL_PREFIX([
317 eval additional_includedir=\"$includedir\"
318 eval additional_libdir=\"$libdir\"
320 AC_LIB_ARG_WITH([lib$1-prefix],
321 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
322 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
324 if test "X$withval" = "Xno"; then
327 if test "X$withval" = "X"; then
328 AC_LIB_WITH_FINAL_PREFIX([
329 eval additional_includedir=\"$includedir\"
330 eval additional_libdir=\"$libdir\"
333 additional_includedir="$withval/include"
334 additional_libdir="$withval/lib"
338 dnl Search the library and its dependencies in $additional_libdir and
339 dnl $LDFLAGS. Using breadth-first-seach.
345 names_already_handled=
346 names_next_round='$1 $2'
347 while test -n "$names_next_round"; do
348 names_this_round="$names_next_round"
350 for name in $names_this_round; do
352 for n in $names_already_handled; do
353 if test "$n" = "$name"; then
358 if test -z "$already_handled"; then
359 names_already_handled="$names_already_handled $name"
360 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
361 dnl or AC_LIB_HAVE_LINKFLAGS call.
362 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
363 eval value=\"\$HAVE_LIB$uppername\"
364 if test -n "$value"; then
365 if test "$value" = yes; then
366 eval value=\"\$LIB$uppername\"
367 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
368 eval value=\"\$LTLIB$uppername\"
369 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
371 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
372 dnl that this library doesn't exist. So just drop it.
376 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
377 dnl and the already constructed $LIBNAME/$LTLIBNAME.
382 if test $use_additional = yes; then
383 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
384 found_dir="$additional_libdir"
385 found_so="$additional_libdir/lib$name.$shlibext"
386 if test -f "$additional_libdir/lib$name.la"; then
387 found_la="$additional_libdir/lib$name.la"
390 if test -f "$additional_libdir/lib$name.$libext"; then
391 found_dir="$additional_libdir"
392 found_a="$additional_libdir/lib$name.$libext"
393 if test -f "$additional_libdir/lib$name.la"; then
394 found_la="$additional_libdir/lib$name.la"
399 if test "X$found_dir" = "X"; then
400 for x in $LDFLAGS $LTLIB[]NAME; do
401 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
404 dir=`echo "X$x" | sed -e 's/^X-L//'`
405 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
407 found_so="$dir/lib$name.$shlibext"
408 if test -f "$dir/lib$name.la"; then
409 found_la="$dir/lib$name.la"
412 if test -f "$dir/lib$name.$libext"; then
414 found_a="$dir/lib$name.$libext"
415 if test -f "$dir/lib$name.la"; then
416 found_la="$dir/lib$name.la"
422 if test "X$found_dir" != "X"; then
427 if test "X$found_dir" != "X"; then
428 dnl Found the library.
429 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
430 if test "X$found_so" != "X"; then
431 dnl Linking with a shared library. We attempt to hardcode its
432 dnl directory into the executable's runpath, unless it's the
433 dnl standard /usr/lib.
434 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
435 dnl No hardcoding is needed.
436 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
438 dnl Use an explicit option to hardcode DIR into the resulting
440 dnl Potentially add DIR to ltrpathdirs.
441 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
443 for x in $ltrpathdirs; do
444 if test "X$x" = "X$found_dir"; then
449 if test -z "$haveit"; then
450 ltrpathdirs="$ltrpathdirs $found_dir"
452 dnl The hardcoding into $LIBNAME is system dependent.
453 if test "$hardcode_direct" = yes; then
454 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
455 dnl resulting binary.
456 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
458 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
459 dnl Use an explicit option to hardcode DIR into the resulting
461 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
462 dnl Potentially add DIR to rpathdirs.
463 dnl The rpathdirs will be appended to $LIBNAME at the end.
465 for x in $rpathdirs; do
466 if test "X$x" = "X$found_dir"; then
471 if test -z "$haveit"; then
472 rpathdirs="$rpathdirs $found_dir"
475 dnl Rely on "-L$found_dir".
476 dnl But don't add it if it's already contained in the LDFLAGS
477 dnl or the already constructed $LIBNAME
479 for x in $LDFLAGS $LIB[]NAME; do
480 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
481 if test "X$x" = "X-L$found_dir"; then
486 if test -z "$haveit"; then
487 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
489 if test "$hardcode_minus_L" != no; then
490 dnl FIXME: Not sure whether we should use
491 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
493 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
495 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
496 dnl here, because this doesn't fit in flags passed to the
497 dnl compiler. So give up. No hardcoding. This affects only
498 dnl very old systems.
499 dnl FIXME: Not sure whether we should use
500 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
502 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
508 if test "X$found_a" != "X"; then
509 dnl Linking with a static library.
510 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
512 dnl We shouldn't come here, but anyway it's good to have a
514 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
517 dnl Assume the include files are nearby.
518 additional_includedir=
521 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
522 additional_includedir="$basedir/include"
525 if test "X$additional_includedir" != "X"; then
526 dnl Potentially add $additional_includedir to $INCNAME.
528 dnl 1. if it's the standard /usr/include,
529 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
530 dnl 3. if it's already present in $CPPFLAGS or the already
531 dnl constructed $INCNAME,
532 dnl 4. if it doesn't exist as a directory.
533 if test "X$additional_includedir" != "X/usr/include"; then
535 if test "X$additional_includedir" = "X/usr/local/include"; then
536 if test -n "$GCC"; then
542 if test -z "$haveit"; then
543 for x in $CPPFLAGS $INC[]NAME; do
544 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
545 if test "X$x" = "X-I$additional_includedir"; then
550 if test -z "$haveit"; then
551 if test -d "$additional_includedir"; then
552 dnl Really add $additional_includedir to $INCNAME.
553 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
559 dnl Look for dependencies.
560 if test -n "$found_la"; then
561 dnl Read the .la file. It defines the variables
562 dnl dlname, library_names, old_library, dependency_libs, current,
563 dnl age, revision, installed, dlopen, dlpreopen, libdir.
564 save_libdir="$libdir"
566 */* | *\\*) . "$found_la" ;;
567 *) . "./$found_la" ;;
569 libdir="$save_libdir"
570 dnl We use only dependency_libs.
571 for dep in $dependency_libs; do
574 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
575 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
577 dnl 1. if it's the standard /usr/lib,
578 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
579 dnl 3. if it's already present in $LDFLAGS or the already
580 dnl constructed $LIBNAME,
581 dnl 4. if it doesn't exist as a directory.
582 if test "X$additional_libdir" != "X/usr/lib"; then
584 if test "X$additional_libdir" = "X/usr/local/lib"; then
585 if test -n "$GCC"; then
591 if test -z "$haveit"; then
593 for x in $LDFLAGS $LIB[]NAME; do
594 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
595 if test "X$x" = "X-L$additional_libdir"; then
600 if test -z "$haveit"; then
601 if test -d "$additional_libdir"; then
602 dnl Really add $additional_libdir to $LIBNAME.
603 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
607 for x in $LDFLAGS $LTLIB[]NAME; do
608 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
609 if test "X$x" = "X-L$additional_libdir"; then
614 if test -z "$haveit"; then
615 if test -d "$additional_libdir"; then
616 dnl Really add $additional_libdir to $LTLIBNAME.
617 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
624 dir=`echo "X$dep" | sed -e 's/^X-R//'`
625 if test "$enable_rpath" != no; then
626 dnl Potentially add DIR to rpathdirs.
627 dnl The rpathdirs will be appended to $LIBNAME at the end.
629 for x in $rpathdirs; do
630 if test "X$x" = "X$dir"; then
635 if test -z "$haveit"; then
636 rpathdirs="$rpathdirs $dir"
638 dnl Potentially add DIR to ltrpathdirs.
639 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
641 for x in $ltrpathdirs; do
642 if test "X$x" = "X$dir"; then
647 if test -z "$haveit"; then
648 ltrpathdirs="$ltrpathdirs $dir"
653 dnl Handle this in the next round.
654 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
657 dnl Handle this in the next round. Throw away the .la's
658 dnl directory; it is already contained in a preceding -L
660 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
663 dnl Most likely an immediate library name.
664 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
665 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
671 dnl Didn't find the library; assume it is in the system directories
672 dnl known to the linker and runtime loader. (All the system
673 dnl directories known to the linker should also be known to the
674 dnl runtime loader, otherwise the system is severely misconfigured.)
675 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
676 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
682 if test "X$rpathdirs" != "X"; then
683 if test -n "$hardcode_libdir_separator"; then
684 dnl Weird platform: only the last -rpath option counts, the user must
685 dnl pass all path elements in one option. We can arrange that for a
686 dnl single library, but not when more than one $LIBNAMEs are used.
688 for found_dir in $rpathdirs; do
689 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
691 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
692 acl_save_libdir="$libdir"
694 eval flag=\"$hardcode_libdir_flag_spec\"
695 libdir="$acl_save_libdir"
696 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
698 dnl The -rpath options are cumulative.
699 for found_dir in $rpathdirs; do
700 acl_save_libdir="$libdir"
702 eval flag=\"$hardcode_libdir_flag_spec\"
703 libdir="$acl_save_libdir"
704 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
708 if test "X$ltrpathdirs" != "X"; then
709 dnl When using libtool, the option that works for both libraries and
710 dnl executables is -R. The -R options are cumulative.
711 for found_dir in $ltrpathdirs; do
712 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
717 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
718 dnl unless already present in VAR.
719 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
720 dnl contains two or three consecutive elements that belong together.
721 AC_DEFUN([AC_LIB_APPENDTOVAR],
723 for element in [$2]; do
726 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
727 if test "X$x" = "X$element"; then
732 if test -z "$haveit"; then
733 [$1]="${[$1]}${[$1]:+ }$element"
738 # lib-ld.m4 serial 3 (gettext-0.13)
739 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
740 dnl This file is free software, distributed under the terms of the GNU
741 dnl General Public License. As a special exception to the GNU General
742 dnl Public License, this file may be distributed as part of a program
743 dnl that contains a configuration script generated by Autoconf, under
744 dnl the same distribution terms as the rest of that program.
746 dnl Subroutines of libtool.m4,
747 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
750 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
751 AC_DEFUN([AC_LIB_PROG_LD_GNU],
752 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
753 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
754 case `$LD -v 2>&1 </dev/null` in
755 *GNU* | *'with BFD'*)
756 acl_cv_prog_gnu_ld=yes ;;
758 acl_cv_prog_gnu_ld=no ;;
760 with_gnu_ld=$acl_cv_prog_gnu_ld
763 dnl From libtool-1.4. Sets the variable LD.
764 AC_DEFUN([AC_LIB_PROG_LD],
766 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
767 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
768 AC_REQUIRE([AC_PROG_CC])dnl
769 AC_REQUIRE([AC_CANONICAL_HOST])dnl
770 # Prepare PATH_SEPARATOR.
771 # The user is always right.
772 if test "${PATH_SEPARATOR+set}" != set; then
773 echo "#! /bin/sh" >conf$$.sh
774 echo "exit 0" >>conf$$.sh
776 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
784 if test "$GCC" = yes; then
785 # Check if gcc -print-prog-name=ld gives a path.
786 AC_MSG_CHECKING([for ld used by GCC])
789 # gcc leaves a trailing carriage return which upsets mingw
790 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
792 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
795 # Accept absolute paths.
796 [[\\/]* | [A-Za-z]:[\\/]*)]
797 [re_direlt='/[^/][^/]*/\.\./']
798 # Canonicalize the path of ld
799 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
800 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
801 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
803 test -z "$LD" && LD="$ac_prog"
806 # If it fails, then pretend we aren't using GCC.
810 # If it is relative, then search for the first ld in PATH.
814 elif test "$with_gnu_ld" = yes; then
815 AC_MSG_CHECKING([for GNU ld])
817 AC_MSG_CHECKING([for non-GNU ld])
819 AC_CACHE_VAL(acl_cv_path_LD,
820 [if test -z "$LD"; then
821 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
822 for ac_dir in $PATH; do
823 test -z "$ac_dir" && ac_dir=.
824 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
825 acl_cv_path_LD="$ac_dir/$ac_prog"
826 # Check to see if the program is GNU ld. I'd rather use --version,
827 # but apparently some GNU ld's only accept -v.
828 # Break only if it was the GNU/non-GNU ld that we prefer.
829 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
830 *GNU* | *'with BFD'*)
831 test "$with_gnu_ld" != no && break ;;
833 test "$with_gnu_ld" != yes && break ;;
839 acl_cv_path_LD="$LD" # Let the user override the test with a path.
842 if test -n "$LD"; then
847 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
851 # isc-posix.m4 serial 2 (gettext-0.11.2)
852 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
853 dnl This file is free software, distributed under the terms of the GNU
854 dnl General Public License. As a special exception to the GNU General
855 dnl Public License, this file may be distributed as part of a program
856 dnl that contains a configuration script generated by Autoconf, under
857 dnl the same distribution terms as the rest of that program.
859 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
861 # This test replaces the one in autoconf.
862 # Currently this macro should have the same name as the autoconf macro
863 # because gettext's gettext.m4 (distributed in the automake package)
864 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
865 # give these diagnostics:
866 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
867 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
869 undefine([AC_ISC_POSIX])
871 AC_DEFUN([AC_ISC_POSIX],
873 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
874 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
878 # Do all the work for Automake. This macro actually does too much --
879 # some checks are only needed if your package does certain things.
880 # But this isn't really a big deal.
885 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
887 AC_DEFUN([AM_INIT_AUTOMAKE],
888 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
889 AC_REQUIRE([AC_PROG_INSTALL])
894 dnl test to see if srcdir already configured
895 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
896 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
899 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
900 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
901 AC_REQUIRE([AM_SANITY_CHECK])
902 AC_REQUIRE([AC_ARG_PROGRAM])
903 dnl FIXME This is truly gross.
904 missing_dir=`cd $ac_aux_dir && pwd`
905 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
906 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
907 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
908 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
909 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
910 AC_REQUIRE([AC_PROG_MAKE_SET])])
912 # Copyright 2002 Free Software Foundation, Inc.
914 # This program is free software; you can redistribute it and/or modify
915 # it under the terms of the GNU General Public License as published by
916 # the Free Software Foundation; either version 2, or (at your option)
919 # This program is distributed in the hope that it will be useful,
920 # but WITHOUT ANY WARRANTY; without even the implied warranty of
921 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
922 # GNU General Public License for more details.
924 # You should have received a copy of the GNU General Public License
925 # along with this program; if not, write to the Free Software
926 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
928 # AM_AUTOMAKE_VERSION(VERSION)
929 # ----------------------------
930 # Automake X.Y traces this macro to ensure aclocal.m4 has been
931 # generated from the m4 files accompanying Automake X.Y.
932 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
934 # AM_SET_CURRENT_AUTOMAKE_VERSION
935 # -------------------------------
936 # Call AM_AUTOMAKE_VERSION so it can be traced.
937 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
938 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
939 [AM_AUTOMAKE_VERSION([1.4-p6])])
942 # Check to make sure that the build environment is sane.
945 AC_DEFUN([AM_SANITY_CHECK],
946 [AC_MSG_CHECKING([whether build environment is sane])
949 echo timestamp > conftestfile
950 # Do `set' in a subshell so we don't clobber the current shell's
951 # arguments. Must try -L first in case configure is actually a
952 # symlink; some systems play weird games with the mod time of symlinks
953 # (eg FreeBSD returns the mod time of the symlink's containing
956 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
957 if test "[$]*" = "X"; then
959 set X `ls -t $srcdir/configure conftestfile`
961 if test "[$]*" != "X $srcdir/configure conftestfile" \
962 && test "[$]*" != "X conftestfile $srcdir/configure"; then
964 # If neither matched, then we have a broken ls. This can happen
965 # if, for instance, CONFIG_SHELL is bash and it inherits a
966 # broken ls alias from the environment. This has actually
967 # happened. Such a system could not be considered "sane".
968 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
969 alias in your environment])
972 test "[$]2" = conftestfile
978 AC_MSG_ERROR([newly created file is older than distributed files!
979 Check your system clock])
984 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
985 dnl The program must properly implement --version.
986 AC_DEFUN([AM_MISSING_PROG],
987 [AC_MSG_CHECKING(for working $2)
988 # Run test in a subshell; some versions of sh will print an error if
989 # an executable is not found, even if stderr is redirected.
990 # Redirect stdin to placate older versions of autoconf. Sigh.
991 if ($2 --version) < /dev/null > /dev/null 2>&1; then
996 AC_MSG_RESULT(missing)
1000 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1002 AC_DEFUN([AM_CONFIG_HEADER],
1004 AC_CONFIG_HEADER([$1])
1005 dnl When config.status generates a header, we must update the stamp-h file.
1006 dnl This file resides in the same directory as the config header
1007 dnl that is generated. We must strip everything past the first ":",
1008 dnl and everything past the last "/".
1009 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1010 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1011 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1013 for am_file in <<$1>>; do
1014 case " <<$>>CONFIG_HEADERS " in
1015 *" <<$>>am_file "*<<)>>
1016 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1019 am_indx=`expr "<<$>>am_indx" + 1`
1025 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
1026 AC_DEFUN([AM_PROG_LEX],
1027 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
1028 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
1032 # Add --enable-maintainer-mode option to configure.
1037 AC_DEFUN([AM_MAINTAINER_MODE],
1038 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1039 dnl maintainer-mode is disabled by default
1040 AC_ARG_ENABLE(maintainer-mode,
1041 [ --enable-maintainer-mode enable make rules and dependencies not useful
1042 (and sometimes confusing) to the casual installer],
1043 USE_MAINTAINER_MODE=$enableval,
1044 USE_MAINTAINER_MODE=no)
1045 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1046 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1047 MAINT=$MAINTAINER_MODE_TRUE
1052 # Define a conditional.
1054 AC_DEFUN([AM_CONDITIONAL],