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],)
21 AC_DEFUN([AM_DISABLE_SHARED],)
25 dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
27 AC_DEFUN([CY_WITH_NLS],)
31 dnl AM_INSTALL_LIBBFD already included in bfd/acinclude.m4
33 AC_DEFUN([AM_INSTALL_LIBBFD],)
35 AC_SUBST(bfdincludedir)
38 # lib-prefix.m4 serial 3 (gettext-0.13)
39 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
40 dnl This file is free software, distributed under the terms of the GNU
41 dnl General Public License. As a special exception to the GNU General
42 dnl Public License, this file may be distributed as part of a program
43 dnl that contains a configuration script generated by Autoconf, under
44 dnl the same distribution terms as the rest of that program.
46 dnl From Bruno Haible.
48 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
49 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
50 dnl require excessive bracketing.
51 ifdef([AC_HELP_STRING],
52 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
53 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
55 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
56 dnl to access previously installed libraries. The basic assumption is that
57 dnl a user will want packages to use other packages he previously installed
58 dnl with the same --prefix option.
59 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
60 dnl libraries, but is otherwise very convenient.
61 AC_DEFUN([AC_LIB_PREFIX],
63 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
64 AC_REQUIRE([AC_PROG_CC])
65 AC_REQUIRE([AC_CANONICAL_HOST])
66 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
67 dnl By default, look in $includedir and $libdir.
69 AC_LIB_WITH_FINAL_PREFIX([
70 eval additional_includedir=\"$includedir\"
71 eval additional_libdir=\"$libdir\"
73 AC_LIB_ARG_WITH([lib-prefix],
74 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
75 --without-lib-prefix don't search for libraries in includedir and libdir],
77 if test "X$withval" = "Xno"; then
80 if test "X$withval" = "X"; then
81 AC_LIB_WITH_FINAL_PREFIX([
82 eval additional_includedir=\"$includedir\"
83 eval additional_libdir=\"$libdir\"
86 additional_includedir="$withval/include"
87 additional_libdir="$withval/lib"
91 if test $use_additional = yes; then
92 dnl Potentially add $additional_includedir to $CPPFLAGS.
94 dnl 1. if it's the standard /usr/include,
95 dnl 2. if it's already present in $CPPFLAGS,
96 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
97 dnl 4. if it doesn't exist as a directory.
98 if test "X$additional_includedir" != "X/usr/include"; then
100 for x in $CPPFLAGS; do
101 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
102 if test "X$x" = "X-I$additional_includedir"; then
107 if test -z "$haveit"; then
108 if test "X$additional_includedir" = "X/usr/local/include"; then
109 if test -n "$GCC"; then
115 if test -z "$haveit"; then
116 if test -d "$additional_includedir"; then
117 dnl Really add $additional_includedir to $CPPFLAGS.
118 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
123 dnl Potentially add $additional_libdir to $LDFLAGS.
125 dnl 1. if it's the standard /usr/lib,
126 dnl 2. if it's already present in $LDFLAGS,
127 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
128 dnl 4. if it doesn't exist as a directory.
129 if test "X$additional_libdir" != "X/usr/lib"; then
131 for x in $LDFLAGS; do
132 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
133 if test "X$x" = "X-L$additional_libdir"; then
138 if test -z "$haveit"; then
139 if test "X$additional_libdir" = "X/usr/local/lib"; then
140 if test -n "$GCC"; then
146 if test -z "$haveit"; then
147 if test -d "$additional_libdir"; then
148 dnl Really add $additional_libdir to $LDFLAGS.
149 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
157 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
158 dnl acl_final_exec_prefix, containing the values to which $prefix and
159 dnl $exec_prefix will expand at the end of the configure script.
160 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
162 dnl Unfortunately, prefix and exec_prefix get only finally determined
163 dnl at the end of configure.
164 if test "X$prefix" = "XNONE"; then
165 acl_final_prefix="$ac_default_prefix"
167 acl_final_prefix="$prefix"
169 if test "X$exec_prefix" = "XNONE"; then
170 acl_final_exec_prefix='${prefix}'
172 acl_final_exec_prefix="$exec_prefix"
174 acl_save_prefix="$prefix"
175 prefix="$acl_final_prefix"
176 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
177 prefix="$acl_save_prefix"
180 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
181 dnl variables prefix and exec_prefix bound to the values they will have
182 dnl at the end of the configure script.
183 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
185 acl_save_prefix="$prefix"
186 prefix="$acl_final_prefix"
187 acl_save_exec_prefix="$exec_prefix"
188 exec_prefix="$acl_final_exec_prefix"
190 exec_prefix="$acl_save_exec_prefix"
191 prefix="$acl_save_prefix"
194 # lib-link.m4 serial 4 (gettext-0.12)
195 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
196 dnl This file is free software, distributed under the terms of the GNU
197 dnl General Public License. As a special exception to the GNU General
198 dnl Public License, this file may be distributed as part of a program
199 dnl that contains a configuration script generated by Autoconf, under
200 dnl the same distribution terms as the rest of that program.
202 dnl From Bruno Haible.
204 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
205 dnl the libraries corresponding to explicit and implicit dependencies.
206 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
207 dnl augments the CPPFLAGS variable.
208 AC_DEFUN([AC_LIB_LINKFLAGS],
210 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
211 AC_REQUIRE([AC_LIB_RPATH])
212 define([Name],[translit([$1],[./-], [___])])
213 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
214 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
215 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
216 AC_LIB_LINKFLAGS_BODY([$1], [$2])
217 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
218 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
219 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
221 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
222 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
223 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
224 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
226 AC_SUBST([LTLIB]NAME)
227 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
228 dnl results of this search when this library appears as a dependency.
234 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
235 dnl searches for libname and the libraries corresponding to explicit and
236 dnl implicit dependencies, together with the specified include files and
237 dnl the ability to compile and link the specified testcode. If found, it
238 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
239 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
240 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
241 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
242 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
244 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
245 AC_REQUIRE([AC_LIB_RPATH])
246 define([Name],[translit([$1],[./-], [___])])
247 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
248 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
250 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
252 AC_LIB_LINKFLAGS_BODY([$1], [$2])
254 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
255 dnl because if the user has installed lib[]Name and not disabled its use
256 dnl via --without-lib[]Name-prefix, he wants to use it.
257 ac_save_CPPFLAGS="$CPPFLAGS"
258 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
260 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
262 LIBS="$LIBS $LIB[]NAME"
263 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
266 if test "$ac_cv_lib[]Name" = yes; then
268 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
269 AC_MSG_CHECKING([how to link with lib[]$1])
270 AC_MSG_RESULT([$LIB[]NAME])
273 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
274 dnl $INC[]NAME either.
275 CPPFLAGS="$ac_save_CPPFLAGS"
279 AC_SUBST([HAVE_LIB]NAME)
281 AC_SUBST([LTLIB]NAME)
286 dnl Determine the platform dependent parameters needed to use rpath:
287 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
288 dnl hardcode_direct, hardcode_minus_L.
289 AC_DEFUN([AC_LIB_RPATH],
291 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
292 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
293 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
294 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
295 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
296 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
297 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
303 libext="$acl_cv_libext"
304 shlibext="$acl_cv_shlibext"
305 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
306 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
307 hardcode_direct="$acl_cv_hardcode_direct"
308 hardcode_minus_L="$acl_cv_hardcode_minus_L"
309 dnl Determine whether the user wants rpath handling at all.
311 [ --disable-rpath do not hardcode runtime library paths],
315 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
316 dnl the libraries corresponding to explicit and implicit dependencies.
317 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
318 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
320 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
321 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
322 dnl By default, look in $includedir and $libdir.
324 AC_LIB_WITH_FINAL_PREFIX([
325 eval additional_includedir=\"$includedir\"
326 eval additional_libdir=\"$libdir\"
328 AC_LIB_ARG_WITH([lib$1-prefix],
329 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
330 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
332 if test "X$withval" = "Xno"; then
335 if test "X$withval" = "X"; then
336 AC_LIB_WITH_FINAL_PREFIX([
337 eval additional_includedir=\"$includedir\"
338 eval additional_libdir=\"$libdir\"
341 additional_includedir="$withval/include"
342 additional_libdir="$withval/lib"
346 dnl Search the library and its dependencies in $additional_libdir and
347 dnl $LDFLAGS. Using breadth-first-seach.
353 names_already_handled=
354 names_next_round='$1 $2'
355 while test -n "$names_next_round"; do
356 names_this_round="$names_next_round"
358 for name in $names_this_round; do
360 for n in $names_already_handled; do
361 if test "$n" = "$name"; then
366 if test -z "$already_handled"; then
367 names_already_handled="$names_already_handled $name"
368 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
369 dnl or AC_LIB_HAVE_LINKFLAGS call.
370 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
371 eval value=\"\$HAVE_LIB$uppername\"
372 if test -n "$value"; then
373 if test "$value" = yes; then
374 eval value=\"\$LIB$uppername\"
375 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
376 eval value=\"\$LTLIB$uppername\"
377 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
379 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
380 dnl that this library doesn't exist. So just drop it.
384 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
385 dnl and the already constructed $LIBNAME/$LTLIBNAME.
390 if test $use_additional = yes; then
391 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
392 found_dir="$additional_libdir"
393 found_so="$additional_libdir/lib$name.$shlibext"
394 if test -f "$additional_libdir/lib$name.la"; then
395 found_la="$additional_libdir/lib$name.la"
398 if test -f "$additional_libdir/lib$name.$libext"; then
399 found_dir="$additional_libdir"
400 found_a="$additional_libdir/lib$name.$libext"
401 if test -f "$additional_libdir/lib$name.la"; then
402 found_la="$additional_libdir/lib$name.la"
407 if test "X$found_dir" = "X"; then
408 for x in $LDFLAGS $LTLIB[]NAME; do
409 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
412 dir=`echo "X$x" | sed -e 's/^X-L//'`
413 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
415 found_so="$dir/lib$name.$shlibext"
416 if test -f "$dir/lib$name.la"; then
417 found_la="$dir/lib$name.la"
420 if test -f "$dir/lib$name.$libext"; then
422 found_a="$dir/lib$name.$libext"
423 if test -f "$dir/lib$name.la"; then
424 found_la="$dir/lib$name.la"
430 if test "X$found_dir" != "X"; then
435 if test "X$found_dir" != "X"; then
436 dnl Found the library.
437 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
438 if test "X$found_so" != "X"; then
439 dnl Linking with a shared library. We attempt to hardcode its
440 dnl directory into the executable's runpath, unless it's the
441 dnl standard /usr/lib.
442 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
443 dnl No hardcoding is needed.
444 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
446 dnl Use an explicit option to hardcode DIR into the resulting
448 dnl Potentially add DIR to ltrpathdirs.
449 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
451 for x in $ltrpathdirs; do
452 if test "X$x" = "X$found_dir"; then
457 if test -z "$haveit"; then
458 ltrpathdirs="$ltrpathdirs $found_dir"
460 dnl The hardcoding into $LIBNAME is system dependent.
461 if test "$hardcode_direct" = yes; then
462 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
463 dnl resulting binary.
464 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
466 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
467 dnl Use an explicit option to hardcode DIR into the resulting
469 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
470 dnl Potentially add DIR to rpathdirs.
471 dnl The rpathdirs will be appended to $LIBNAME at the end.
473 for x in $rpathdirs; do
474 if test "X$x" = "X$found_dir"; then
479 if test -z "$haveit"; then
480 rpathdirs="$rpathdirs $found_dir"
483 dnl Rely on "-L$found_dir".
484 dnl But don't add it if it's already contained in the LDFLAGS
485 dnl or the already constructed $LIBNAME
487 for x in $LDFLAGS $LIB[]NAME; do
488 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
489 if test "X$x" = "X-L$found_dir"; then
494 if test -z "$haveit"; then
495 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
497 if test "$hardcode_minus_L" != no; then
498 dnl FIXME: Not sure whether we should use
499 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
501 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
503 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
504 dnl here, because this doesn't fit in flags passed to the
505 dnl compiler. So give up. No hardcoding. This affects only
506 dnl very old systems.
507 dnl FIXME: Not sure whether we should use
508 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
510 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
516 if test "X$found_a" != "X"; then
517 dnl Linking with a static library.
518 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
520 dnl We shouldn't come here, but anyway it's good to have a
522 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
525 dnl Assume the include files are nearby.
526 additional_includedir=
529 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
530 additional_includedir="$basedir/include"
533 if test "X$additional_includedir" != "X"; then
534 dnl Potentially add $additional_includedir to $INCNAME.
536 dnl 1. if it's the standard /usr/include,
537 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
538 dnl 3. if it's already present in $CPPFLAGS or the already
539 dnl constructed $INCNAME,
540 dnl 4. if it doesn't exist as a directory.
541 if test "X$additional_includedir" != "X/usr/include"; then
543 if test "X$additional_includedir" = "X/usr/local/include"; then
544 if test -n "$GCC"; then
550 if test -z "$haveit"; then
551 for x in $CPPFLAGS $INC[]NAME; do
552 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
553 if test "X$x" = "X-I$additional_includedir"; then
558 if test -z "$haveit"; then
559 if test -d "$additional_includedir"; then
560 dnl Really add $additional_includedir to $INCNAME.
561 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
567 dnl Look for dependencies.
568 if test -n "$found_la"; then
569 dnl Read the .la file. It defines the variables
570 dnl dlname, library_names, old_library, dependency_libs, current,
571 dnl age, revision, installed, dlopen, dlpreopen, libdir.
572 save_libdir="$libdir"
574 */* | *\\*) . "$found_la" ;;
575 *) . "./$found_la" ;;
577 libdir="$save_libdir"
578 dnl We use only dependency_libs.
579 for dep in $dependency_libs; do
582 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
583 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
585 dnl 1. if it's the standard /usr/lib,
586 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
587 dnl 3. if it's already present in $LDFLAGS or the already
588 dnl constructed $LIBNAME,
589 dnl 4. if it doesn't exist as a directory.
590 if test "X$additional_libdir" != "X/usr/lib"; then
592 if test "X$additional_libdir" = "X/usr/local/lib"; then
593 if test -n "$GCC"; then
599 if test -z "$haveit"; then
601 for x in $LDFLAGS $LIB[]NAME; do
602 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
603 if test "X$x" = "X-L$additional_libdir"; then
608 if test -z "$haveit"; then
609 if test -d "$additional_libdir"; then
610 dnl Really add $additional_libdir to $LIBNAME.
611 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
615 for x in $LDFLAGS $LTLIB[]NAME; do
616 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
617 if test "X$x" = "X-L$additional_libdir"; then
622 if test -z "$haveit"; then
623 if test -d "$additional_libdir"; then
624 dnl Really add $additional_libdir to $LTLIBNAME.
625 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
632 dir=`echo "X$dep" | sed -e 's/^X-R//'`
633 if test "$enable_rpath" != no; then
634 dnl Potentially add DIR to rpathdirs.
635 dnl The rpathdirs will be appended to $LIBNAME at the end.
637 for x in $rpathdirs; do
638 if test "X$x" = "X$dir"; then
643 if test -z "$haveit"; then
644 rpathdirs="$rpathdirs $dir"
646 dnl Potentially add DIR to ltrpathdirs.
647 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
649 for x in $ltrpathdirs; do
650 if test "X$x" = "X$dir"; then
655 if test -z "$haveit"; then
656 ltrpathdirs="$ltrpathdirs $dir"
661 dnl Handle this in the next round.
662 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
665 dnl Handle this in the next round. Throw away the .la's
666 dnl directory; it is already contained in a preceding -L
668 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
671 dnl Most likely an immediate library name.
672 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
673 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
679 dnl Didn't find the library; assume it is in the system directories
680 dnl known to the linker and runtime loader. (All the system
681 dnl directories known to the linker should also be known to the
682 dnl runtime loader, otherwise the system is severely misconfigured.)
683 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
684 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
690 if test "X$rpathdirs" != "X"; then
691 if test -n "$hardcode_libdir_separator"; then
692 dnl Weird platform: only the last -rpath option counts, the user must
693 dnl pass all path elements in one option. We can arrange that for a
694 dnl single library, but not when more than one $LIBNAMEs are used.
696 for found_dir in $rpathdirs; do
697 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
699 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
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"
706 dnl The -rpath options are cumulative.
707 for found_dir in $rpathdirs; do
708 acl_save_libdir="$libdir"
710 eval flag=\"$hardcode_libdir_flag_spec\"
711 libdir="$acl_save_libdir"
712 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
716 if test "X$ltrpathdirs" != "X"; then
717 dnl When using libtool, the option that works for both libraries and
718 dnl executables is -R. The -R options are cumulative.
719 for found_dir in $ltrpathdirs; do
720 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
725 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
726 dnl unless already present in VAR.
727 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
728 dnl contains two or three consecutive elements that belong together.
729 AC_DEFUN([AC_LIB_APPENDTOVAR],
731 for element in [$2]; do
734 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
735 if test "X$x" = "X$element"; then
740 if test -z "$haveit"; then
741 [$1]="${[$1]}${[$1]:+ }$element"
746 # lib-ld.m4 serial 3 (gettext-0.13)
747 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
748 dnl This file is free software, distributed under the terms of the GNU
749 dnl General Public License. As a special exception to the GNU General
750 dnl Public License, this file may be distributed as part of a program
751 dnl that contains a configuration script generated by Autoconf, under
752 dnl the same distribution terms as the rest of that program.
754 dnl Subroutines of libtool.m4,
755 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
758 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
759 AC_DEFUN([AC_LIB_PROG_LD_GNU],
760 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
761 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
762 case `$LD -v 2>&1 </dev/null` in
763 *GNU* | *'with BFD'*)
764 acl_cv_prog_gnu_ld=yes ;;
766 acl_cv_prog_gnu_ld=no ;;
768 with_gnu_ld=$acl_cv_prog_gnu_ld
771 dnl From libtool-1.4. Sets the variable LD.
772 AC_DEFUN([AC_LIB_PROG_LD],
774 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
775 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
776 AC_REQUIRE([AC_PROG_CC])dnl
777 AC_REQUIRE([AC_CANONICAL_HOST])dnl
778 # Prepare PATH_SEPARATOR.
779 # The user is always right.
780 if test "${PATH_SEPARATOR+set}" != set; then
781 echo "#! /bin/sh" >conf$$.sh
782 echo "exit 0" >>conf$$.sh
784 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
792 if test "$GCC" = yes; then
793 # Check if gcc -print-prog-name=ld gives a path.
794 AC_MSG_CHECKING([for ld used by GCC])
797 # gcc leaves a trailing carriage return which upsets mingw
798 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
800 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
803 # Accept absolute paths.
804 [[\\/]* | [A-Za-z]:[\\/]*)]
805 [re_direlt='/[^/][^/]*/\.\./']
806 # Canonicalize the path of ld
807 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
808 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
809 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
811 test -z "$LD" && LD="$ac_prog"
814 # If it fails, then pretend we aren't using GCC.
818 # If it is relative, then search for the first ld in PATH.
822 elif test "$with_gnu_ld" = yes; then
823 AC_MSG_CHECKING([for GNU ld])
825 AC_MSG_CHECKING([for non-GNU ld])
827 AC_CACHE_VAL(acl_cv_path_LD,
828 [if test -z "$LD"; then
829 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
830 for ac_dir in $PATH; do
831 test -z "$ac_dir" && ac_dir=.
832 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
833 acl_cv_path_LD="$ac_dir/$ac_prog"
834 # Check to see if the program is GNU ld. I'd rather use --version,
835 # but apparently some GNU ld's only accept -v.
836 # Break only if it was the GNU/non-GNU ld that we prefer.
837 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
838 *GNU* | *'with BFD'*)
839 test "$with_gnu_ld" != no && break ;;
841 test "$with_gnu_ld" != yes && break ;;
847 acl_cv_path_LD="$LD" # Let the user override the test with a path.
850 if test -n "$LD"; then
855 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
859 # isc-posix.m4 serial 2 (gettext-0.11.2)
860 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
861 dnl This file is free software, distributed under the terms of the GNU
862 dnl General Public License. As a special exception to the GNU General
863 dnl Public License, this file may be distributed as part of a program
864 dnl that contains a configuration script generated by Autoconf, under
865 dnl the same distribution terms as the rest of that program.
867 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
869 # This test replaces the one in autoconf.
870 # Currently this macro should have the same name as the autoconf macro
871 # because gettext's gettext.m4 (distributed in the automake package)
872 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
873 # give these diagnostics:
874 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
875 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
877 undefine([AC_ISC_POSIX])
879 AC_DEFUN([AC_ISC_POSIX],
881 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
882 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
886 # Do all the work for Automake. This macro actually does too much --
887 # some checks are only needed if your package does certain things.
888 # But this isn't really a big deal.
893 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
895 AC_DEFUN([AM_INIT_AUTOMAKE],
896 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
897 AC_REQUIRE([AC_PROG_INSTALL])
902 dnl test to see if srcdir already configured
903 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
904 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
907 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
908 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
909 AC_REQUIRE([AM_SANITY_CHECK])
910 AC_REQUIRE([AC_ARG_PROGRAM])
911 dnl FIXME This is truly gross.
912 missing_dir=`cd $ac_aux_dir && pwd`
913 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
914 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
915 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
916 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
917 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
918 AC_REQUIRE([AC_PROG_MAKE_SET])])
920 # Copyright 2002 Free Software Foundation, Inc.
922 # This program is free software; you can redistribute it and/or modify
923 # it under the terms of the GNU General Public License as published by
924 # the Free Software Foundation; either version 2, or (at your option)
927 # This program is distributed in the hope that it will be useful,
928 # but WITHOUT ANY WARRANTY; without even the implied warranty of
929 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
930 # GNU General Public License for more details.
932 # You should have received a copy of the GNU General Public License
933 # along with this program; if not, write to the Free Software
934 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
936 # AM_AUTOMAKE_VERSION(VERSION)
937 # ----------------------------
938 # Automake X.Y traces this macro to ensure aclocal.m4 has been
939 # generated from the m4 files accompanying Automake X.Y.
940 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
942 # AM_SET_CURRENT_AUTOMAKE_VERSION
943 # -------------------------------
944 # Call AM_AUTOMAKE_VERSION so it can be traced.
945 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
946 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
947 [AM_AUTOMAKE_VERSION([1.4-p6])])
950 # Check to make sure that the build environment is sane.
953 AC_DEFUN([AM_SANITY_CHECK],
954 [AC_MSG_CHECKING([whether build environment is sane])
957 echo timestamp > conftestfile
958 # Do `set' in a subshell so we don't clobber the current shell's
959 # arguments. Must try -L first in case configure is actually a
960 # symlink; some systems play weird games with the mod time of symlinks
961 # (eg FreeBSD returns the mod time of the symlink's containing
964 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
965 if test "[$]*" = "X"; then
967 set X `ls -t $srcdir/configure conftestfile`
969 if test "[$]*" != "X $srcdir/configure conftestfile" \
970 && test "[$]*" != "X conftestfile $srcdir/configure"; then
972 # If neither matched, then we have a broken ls. This can happen
973 # if, for instance, CONFIG_SHELL is bash and it inherits a
974 # broken ls alias from the environment. This has actually
975 # happened. Such a system could not be considered "sane".
976 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
977 alias in your environment])
980 test "[$]2" = conftestfile
986 AC_MSG_ERROR([newly created file is older than distributed files!
987 Check your system clock])
992 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
993 dnl The program must properly implement --version.
994 AC_DEFUN([AM_MISSING_PROG],
995 [AC_MSG_CHECKING(for working $2)
996 # Run test in a subshell; some versions of sh will print an error if
997 # an executable is not found, even if stderr is redirected.
998 # Redirect stdin to placate older versions of autoconf. Sigh.
999 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1001 AC_MSG_RESULT(found)
1004 AC_MSG_RESULT(missing)
1008 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1010 AC_DEFUN([AM_CONFIG_HEADER],
1012 AC_CONFIG_HEADER([$1])
1013 dnl When config.status generates a header, we must update the stamp-h file.
1014 dnl This file resides in the same directory as the config header
1015 dnl that is generated. We must strip everything past the first ":",
1016 dnl and everything past the last "/".
1017 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1018 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1019 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1021 for am_file in <<$1>>; do
1022 case " <<$>>CONFIG_HEADERS " in
1023 *" <<$>>am_file "*<<)>>
1024 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1027 am_indx=`expr "<<$>>am_indx" + 1`
1031 # Add --enable-maintainer-mode option to configure.
1036 AC_DEFUN([AM_MAINTAINER_MODE],
1037 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1038 dnl maintainer-mode is disabled by default
1039 AC_ARG_ENABLE(maintainer-mode,
1040 [ --enable-maintainer-mode enable make rules and dependencies not useful
1041 (and sometimes confusing) to the casual installer],
1042 USE_MAINTAINER_MODE=$enableval,
1043 USE_MAINTAINER_MODE=no)
1044 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1045 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1046 MAINT=$MAINTAINER_MODE_TRUE
1051 # Define a conditional.
1053 AC_DEFUN([AM_CONDITIONAL],