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(../config/accross.m4)
14 sinclude(../config/acx.m4)
16 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
17 AC_DEFUN([BFD_BINARY_FOPEN],
18 [AC_REQUIRE([AC_CANONICAL_TARGET])
21 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
23 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
26 dnl Get a default for CC_FOR_BUILD to put into Makefile.
27 AC_DEFUN([BFD_CC_FOR_BUILD],
28 [# Put a plausible default for CC_FOR_BUILD in Makefile.
29 if test -z "$CC_FOR_BUILD"; then
30 if test "x$cross_compiling" = "xno"; then
36 AC_SUBST(CC_FOR_BUILD)
37 # Also set EXEEXT_FOR_BUILD.
38 if test "x$cross_compiling" = "xno"; then
39 EXEEXT_FOR_BUILD='$(EXEEXT)'
41 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
43 echo 'int main () { return 0; }' > conftest.c
45 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
46 for file in conftest.*; do
48 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
49 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
53 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
55 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
57 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
59 dnl See whether we need a declaration for a function.
60 AC_DEFUN([BFD_NEED_DECLARATION],
61 [AC_MSG_CHECKING([whether $1 must be declared])
62 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
78 [char *(*pfn) = (char *(*)) $1],
79 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
80 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
81 if test $bfd_cv_decl_needed_$1 = yes; then
82 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
83 [Define if $1 is not declared in system header files.])
87 dnl Check for existence of a type $1 in sys/procfs.h
89 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
90 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
91 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
94 #include <sys/procfs.h>],
96 bfd_cv_have_sys_procfs_type_$1=yes,
97 bfd_cv_have_sys_procfs_type_$1=no
99 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
100 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
101 [Define if <sys/procfs.h> has $1.])
103 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
107 dnl Check for existence of member $2 in type $1 in sys/procfs.h
109 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
110 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
111 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
114 #include <sys/procfs.h>],
115 [$1 avar; void* aref = (void*) &avar.$2],
116 bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
117 bfd_cv_have_sys_procfs_type_member_$1_$2=no
119 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
120 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
121 [Define if <sys/procfs.h> has $1.$2.])
123 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
126 sinclude(../libtool.m4)
127 dnl The lines below arrange for aclocal not to bring libtool.m4
128 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
129 dnl to add a definition of LIBTOOL to Makefile.in.
131 AC_DEFUN([AM_PROG_LIBTOOL],)
132 AC_DEFUN([AM_DISABLE_SHARED],)
136 sinclude(../gettext.m4)
138 AC_DEFUN([CY_WITH_NLS],)
142 AC_DEFUN([AM_INSTALL_LIBBFD],
143 [AC_MSG_CHECKING([whether to install libbfd])
144 AC_ARG_ENABLE(install-libbfd,
145 [ --enable-install-libbfd controls installation of libbfd and related headers],
146 install_libbfd_p=$enableval,
147 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
152 AC_MSG_RESULT($install_libbfd_p)
153 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
154 # Need _noncanonical variables for this.
155 ACX_HOST_NONCANONICAL
156 ACX_TARGET_NONCANONICAL
157 # libbfd.a is a host library containing target dependent code
158 bfdlibdir='$(libdir)'
159 bfdincludedir='$(includedir)'
160 if test "${host}" != "${target}"; then
161 bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
162 bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
165 AC_SUBST(bfdincludedir)
169 # lib-prefix.m4 serial 3 (gettext-0.13)
170 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
171 dnl This file is free software, distributed under the terms of the GNU
172 dnl General Public License. As a special exception to the GNU General
173 dnl Public License, this file may be distributed as part of a program
174 dnl that contains a configuration script generated by Autoconf, under
175 dnl the same distribution terms as the rest of that program.
177 dnl From Bruno Haible.
179 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
180 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
181 dnl require excessive bracketing.
182 ifdef([AC_HELP_STRING],
183 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
184 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
186 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
187 dnl to access previously installed libraries. The basic assumption is that
188 dnl a user will want packages to use other packages he previously installed
189 dnl with the same --prefix option.
190 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
191 dnl libraries, but is otherwise very convenient.
192 AC_DEFUN([AC_LIB_PREFIX],
194 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
195 AC_REQUIRE([AC_PROG_CC])
196 AC_REQUIRE([AC_CANONICAL_HOST])
197 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
198 dnl By default, look in $includedir and $libdir.
200 AC_LIB_WITH_FINAL_PREFIX([
201 eval additional_includedir=\"$includedir\"
202 eval additional_libdir=\"$libdir\"
204 AC_LIB_ARG_WITH([lib-prefix],
205 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
206 --without-lib-prefix don't search for libraries in includedir and libdir],
208 if test "X$withval" = "Xno"; then
211 if test "X$withval" = "X"; then
212 AC_LIB_WITH_FINAL_PREFIX([
213 eval additional_includedir=\"$includedir\"
214 eval additional_libdir=\"$libdir\"
217 additional_includedir="$withval/include"
218 additional_libdir="$withval/lib"
222 if test $use_additional = yes; then
223 dnl Potentially add $additional_includedir to $CPPFLAGS.
225 dnl 1. if it's the standard /usr/include,
226 dnl 2. if it's already present in $CPPFLAGS,
227 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
228 dnl 4. if it doesn't exist as a directory.
229 if test "X$additional_includedir" != "X/usr/include"; then
231 for x in $CPPFLAGS; do
232 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
233 if test "X$x" = "X-I$additional_includedir"; then
238 if test -z "$haveit"; then
239 if test "X$additional_includedir" = "X/usr/local/include"; then
240 if test -n "$GCC"; then
246 if test -z "$haveit"; then
247 if test -d "$additional_includedir"; then
248 dnl Really add $additional_includedir to $CPPFLAGS.
249 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
254 dnl Potentially add $additional_libdir to $LDFLAGS.
256 dnl 1. if it's the standard /usr/lib,
257 dnl 2. if it's already present in $LDFLAGS,
258 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
259 dnl 4. if it doesn't exist as a directory.
260 if test "X$additional_libdir" != "X/usr/lib"; then
262 for x in $LDFLAGS; do
263 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
264 if test "X$x" = "X-L$additional_libdir"; then
269 if test -z "$haveit"; then
270 if test "X$additional_libdir" = "X/usr/local/lib"; then
271 if test -n "$GCC"; then
277 if test -z "$haveit"; then
278 if test -d "$additional_libdir"; then
279 dnl Really add $additional_libdir to $LDFLAGS.
280 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
288 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
289 dnl acl_final_exec_prefix, containing the values to which $prefix and
290 dnl $exec_prefix will expand at the end of the configure script.
291 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
293 dnl Unfortunately, prefix and exec_prefix get only finally determined
294 dnl at the end of configure.
295 if test "X$prefix" = "XNONE"; then
296 acl_final_prefix="$ac_default_prefix"
298 acl_final_prefix="$prefix"
300 if test "X$exec_prefix" = "XNONE"; then
301 acl_final_exec_prefix='${prefix}'
303 acl_final_exec_prefix="$exec_prefix"
305 acl_save_prefix="$prefix"
306 prefix="$acl_final_prefix"
307 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
308 prefix="$acl_save_prefix"
311 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
312 dnl variables prefix and exec_prefix bound to the values they will have
313 dnl at the end of the configure script.
314 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
316 acl_save_prefix="$prefix"
317 prefix="$acl_final_prefix"
318 acl_save_exec_prefix="$exec_prefix"
319 exec_prefix="$acl_final_exec_prefix"
321 exec_prefix="$acl_save_exec_prefix"
322 prefix="$acl_save_prefix"
325 # lib-link.m4 serial 4 (gettext-0.12)
326 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
327 dnl This file is free software, distributed under the terms of the GNU
328 dnl General Public License. As a special exception to the GNU General
329 dnl Public License, this file may be distributed as part of a program
330 dnl that contains a configuration script generated by Autoconf, under
331 dnl the same distribution terms as the rest of that program.
333 dnl From Bruno Haible.
335 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
336 dnl the libraries corresponding to explicit and implicit dependencies.
337 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
338 dnl augments the CPPFLAGS variable.
339 AC_DEFUN([AC_LIB_LINKFLAGS],
341 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
342 AC_REQUIRE([AC_LIB_RPATH])
343 define([Name],[translit([$1],[./-], [___])])
344 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
345 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
346 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
347 AC_LIB_LINKFLAGS_BODY([$1], [$2])
348 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
349 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
350 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
352 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
353 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
354 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
355 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
357 AC_SUBST([LTLIB]NAME)
358 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
359 dnl results of this search when this library appears as a dependency.
365 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
366 dnl searches for libname and the libraries corresponding to explicit and
367 dnl implicit dependencies, together with the specified include files and
368 dnl the ability to compile and link the specified testcode. If found, it
369 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
370 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
371 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
372 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
373 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
375 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
376 AC_REQUIRE([AC_LIB_RPATH])
377 define([Name],[translit([$1],[./-], [___])])
378 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
379 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
381 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
383 AC_LIB_LINKFLAGS_BODY([$1], [$2])
385 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
386 dnl because if the user has installed lib[]Name and not disabled its use
387 dnl via --without-lib[]Name-prefix, he wants to use it.
388 ac_save_CPPFLAGS="$CPPFLAGS"
389 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
391 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
393 LIBS="$LIBS $LIB[]NAME"
394 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
397 if test "$ac_cv_lib[]Name" = yes; then
399 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
400 AC_MSG_CHECKING([how to link with lib[]$1])
401 AC_MSG_RESULT([$LIB[]NAME])
404 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
405 dnl $INC[]NAME either.
406 CPPFLAGS="$ac_save_CPPFLAGS"
410 AC_SUBST([HAVE_LIB]NAME)
412 AC_SUBST([LTLIB]NAME)
417 dnl Determine the platform dependent parameters needed to use rpath:
418 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
419 dnl hardcode_direct, hardcode_minus_L.
420 AC_DEFUN([AC_LIB_RPATH],
422 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
423 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
424 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
425 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
426 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
427 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
428 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
434 libext="$acl_cv_libext"
435 shlibext="$acl_cv_shlibext"
436 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
437 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
438 hardcode_direct="$acl_cv_hardcode_direct"
439 hardcode_minus_L="$acl_cv_hardcode_minus_L"
440 dnl Determine whether the user wants rpath handling at all.
442 [ --disable-rpath do not hardcode runtime library paths],
446 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
447 dnl the libraries corresponding to explicit and implicit dependencies.
448 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
449 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
451 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
452 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
453 dnl By default, look in $includedir and $libdir.
455 AC_LIB_WITH_FINAL_PREFIX([
456 eval additional_includedir=\"$includedir\"
457 eval additional_libdir=\"$libdir\"
459 AC_LIB_ARG_WITH([lib$1-prefix],
460 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
461 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
463 if test "X$withval" = "Xno"; then
466 if test "X$withval" = "X"; then
467 AC_LIB_WITH_FINAL_PREFIX([
468 eval additional_includedir=\"$includedir\"
469 eval additional_libdir=\"$libdir\"
472 additional_includedir="$withval/include"
473 additional_libdir="$withval/lib"
477 dnl Search the library and its dependencies in $additional_libdir and
478 dnl $LDFLAGS. Using breadth-first-seach.
484 names_already_handled=
485 names_next_round='$1 $2'
486 while test -n "$names_next_round"; do
487 names_this_round="$names_next_round"
489 for name in $names_this_round; do
491 for n in $names_already_handled; do
492 if test "$n" = "$name"; then
497 if test -z "$already_handled"; then
498 names_already_handled="$names_already_handled $name"
499 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
500 dnl or AC_LIB_HAVE_LINKFLAGS call.
501 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
502 eval value=\"\$HAVE_LIB$uppername\"
503 if test -n "$value"; then
504 if test "$value" = yes; then
505 eval value=\"\$LIB$uppername\"
506 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
507 eval value=\"\$LTLIB$uppername\"
508 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
510 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
511 dnl that this library doesn't exist. So just drop it.
515 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
516 dnl and the already constructed $LIBNAME/$LTLIBNAME.
521 if test $use_additional = yes; then
522 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
523 found_dir="$additional_libdir"
524 found_so="$additional_libdir/lib$name.$shlibext"
525 if test -f "$additional_libdir/lib$name.la"; then
526 found_la="$additional_libdir/lib$name.la"
529 if test -f "$additional_libdir/lib$name.$libext"; then
530 found_dir="$additional_libdir"
531 found_a="$additional_libdir/lib$name.$libext"
532 if test -f "$additional_libdir/lib$name.la"; then
533 found_la="$additional_libdir/lib$name.la"
538 if test "X$found_dir" = "X"; then
539 for x in $LDFLAGS $LTLIB[]NAME; do
540 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
543 dir=`echo "X$x" | sed -e 's/^X-L//'`
544 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
546 found_so="$dir/lib$name.$shlibext"
547 if test -f "$dir/lib$name.la"; then
548 found_la="$dir/lib$name.la"
551 if test -f "$dir/lib$name.$libext"; then
553 found_a="$dir/lib$name.$libext"
554 if test -f "$dir/lib$name.la"; then
555 found_la="$dir/lib$name.la"
561 if test "X$found_dir" != "X"; then
566 if test "X$found_dir" != "X"; then
567 dnl Found the library.
568 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
569 if test "X$found_so" != "X"; then
570 dnl Linking with a shared library. We attempt to hardcode its
571 dnl directory into the executable's runpath, unless it's the
572 dnl standard /usr/lib.
573 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
574 dnl No hardcoding is needed.
575 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
577 dnl Use an explicit option to hardcode DIR into the resulting
579 dnl Potentially add DIR to ltrpathdirs.
580 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
582 for x in $ltrpathdirs; do
583 if test "X$x" = "X$found_dir"; then
588 if test -z "$haveit"; then
589 ltrpathdirs="$ltrpathdirs $found_dir"
591 dnl The hardcoding into $LIBNAME is system dependent.
592 if test "$hardcode_direct" = yes; then
593 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
594 dnl resulting binary.
595 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
597 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
598 dnl Use an explicit option to hardcode DIR into the resulting
600 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
601 dnl Potentially add DIR to rpathdirs.
602 dnl The rpathdirs will be appended to $LIBNAME at the end.
604 for x in $rpathdirs; do
605 if test "X$x" = "X$found_dir"; then
610 if test -z "$haveit"; then
611 rpathdirs="$rpathdirs $found_dir"
614 dnl Rely on "-L$found_dir".
615 dnl But don't add it if it's already contained in the LDFLAGS
616 dnl or the already constructed $LIBNAME
618 for x in $LDFLAGS $LIB[]NAME; do
619 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
620 if test "X$x" = "X-L$found_dir"; then
625 if test -z "$haveit"; then
626 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
628 if test "$hardcode_minus_L" != no; then
629 dnl FIXME: Not sure whether we should use
630 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
632 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
634 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
635 dnl here, because this doesn't fit in flags passed to the
636 dnl compiler. So give up. No hardcoding. This affects only
637 dnl very old systems.
638 dnl FIXME: Not sure whether we should use
639 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
641 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
647 if test "X$found_a" != "X"; then
648 dnl Linking with a static library.
649 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
651 dnl We shouldn't come here, but anyway it's good to have a
653 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
656 dnl Assume the include files are nearby.
657 additional_includedir=
660 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
661 additional_includedir="$basedir/include"
664 if test "X$additional_includedir" != "X"; then
665 dnl Potentially add $additional_includedir to $INCNAME.
667 dnl 1. if it's the standard /usr/include,
668 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
669 dnl 3. if it's already present in $CPPFLAGS or the already
670 dnl constructed $INCNAME,
671 dnl 4. if it doesn't exist as a directory.
672 if test "X$additional_includedir" != "X/usr/include"; then
674 if test "X$additional_includedir" = "X/usr/local/include"; then
675 if test -n "$GCC"; then
681 if test -z "$haveit"; then
682 for x in $CPPFLAGS $INC[]NAME; do
683 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
684 if test "X$x" = "X-I$additional_includedir"; then
689 if test -z "$haveit"; then
690 if test -d "$additional_includedir"; then
691 dnl Really add $additional_includedir to $INCNAME.
692 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
698 dnl Look for dependencies.
699 if test -n "$found_la"; then
700 dnl Read the .la file. It defines the variables
701 dnl dlname, library_names, old_library, dependency_libs, current,
702 dnl age, revision, installed, dlopen, dlpreopen, libdir.
703 save_libdir="$libdir"
705 */* | *\\*) . "$found_la" ;;
706 *) . "./$found_la" ;;
708 libdir="$save_libdir"
709 dnl We use only dependency_libs.
710 for dep in $dependency_libs; do
713 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
714 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
716 dnl 1. if it's the standard /usr/lib,
717 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
718 dnl 3. if it's already present in $LDFLAGS or the already
719 dnl constructed $LIBNAME,
720 dnl 4. if it doesn't exist as a directory.
721 if test "X$additional_libdir" != "X/usr/lib"; then
723 if test "X$additional_libdir" = "X/usr/local/lib"; then
724 if test -n "$GCC"; then
730 if test -z "$haveit"; then
732 for x in $LDFLAGS $LIB[]NAME; do
733 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
734 if test "X$x" = "X-L$additional_libdir"; then
739 if test -z "$haveit"; then
740 if test -d "$additional_libdir"; then
741 dnl Really add $additional_libdir to $LIBNAME.
742 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
746 for x in $LDFLAGS $LTLIB[]NAME; do
747 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
748 if test "X$x" = "X-L$additional_libdir"; then
753 if test -z "$haveit"; then
754 if test -d "$additional_libdir"; then
755 dnl Really add $additional_libdir to $LTLIBNAME.
756 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
763 dir=`echo "X$dep" | sed -e 's/^X-R//'`
764 if test "$enable_rpath" != no; then
765 dnl Potentially add DIR to rpathdirs.
766 dnl The rpathdirs will be appended to $LIBNAME at the end.
768 for x in $rpathdirs; do
769 if test "X$x" = "X$dir"; then
774 if test -z "$haveit"; then
775 rpathdirs="$rpathdirs $dir"
777 dnl Potentially add DIR to ltrpathdirs.
778 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
780 for x in $ltrpathdirs; do
781 if test "X$x" = "X$dir"; then
786 if test -z "$haveit"; then
787 ltrpathdirs="$ltrpathdirs $dir"
792 dnl Handle this in the next round.
793 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
796 dnl Handle this in the next round. Throw away the .la's
797 dnl directory; it is already contained in a preceding -L
799 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
802 dnl Most likely an immediate library name.
803 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
804 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
810 dnl Didn't find the library; assume it is in the system directories
811 dnl known to the linker and runtime loader. (All the system
812 dnl directories known to the linker should also be known to the
813 dnl runtime loader, otherwise the system is severely misconfigured.)
814 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
815 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
821 if test "X$rpathdirs" != "X"; then
822 if test -n "$hardcode_libdir_separator"; then
823 dnl Weird platform: only the last -rpath option counts, the user must
824 dnl pass all path elements in one option. We can arrange that for a
825 dnl single library, but not when more than one $LIBNAMEs are used.
827 for found_dir in $rpathdirs; do
828 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
830 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
831 acl_save_libdir="$libdir"
833 eval flag=\"$hardcode_libdir_flag_spec\"
834 libdir="$acl_save_libdir"
835 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
837 dnl The -rpath options are cumulative.
838 for found_dir in $rpathdirs; do
839 acl_save_libdir="$libdir"
841 eval flag=\"$hardcode_libdir_flag_spec\"
842 libdir="$acl_save_libdir"
843 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
847 if test "X$ltrpathdirs" != "X"; then
848 dnl When using libtool, the option that works for both libraries and
849 dnl executables is -R. The -R options are cumulative.
850 for found_dir in $ltrpathdirs; do
851 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
856 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
857 dnl unless already present in VAR.
858 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
859 dnl contains two or three consecutive elements that belong together.
860 AC_DEFUN([AC_LIB_APPENDTOVAR],
862 for element in [$2]; do
865 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
866 if test "X$x" = "X$element"; then
871 if test -z "$haveit"; then
872 [$1]="${[$1]}${[$1]:+ }$element"
877 # lib-ld.m4 serial 3 (gettext-0.13)
878 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
879 dnl This file is free software, distributed under the terms of the GNU
880 dnl General Public License. As a special exception to the GNU General
881 dnl Public License, this file may be distributed as part of a program
882 dnl that contains a configuration script generated by Autoconf, under
883 dnl the same distribution terms as the rest of that program.
885 dnl Subroutines of libtool.m4,
886 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
889 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
890 AC_DEFUN([AC_LIB_PROG_LD_GNU],
891 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
892 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
893 case `$LD -v 2>&1 </dev/null` in
894 *GNU* | *'with BFD'*)
895 acl_cv_prog_gnu_ld=yes ;;
897 acl_cv_prog_gnu_ld=no ;;
899 with_gnu_ld=$acl_cv_prog_gnu_ld
902 dnl From libtool-1.4. Sets the variable LD.
903 AC_DEFUN([AC_LIB_PROG_LD],
905 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
906 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
907 AC_REQUIRE([AC_PROG_CC])dnl
908 AC_REQUIRE([AC_CANONICAL_HOST])dnl
909 # Prepare PATH_SEPARATOR.
910 # The user is always right.
911 if test "${PATH_SEPARATOR+set}" != set; then
912 echo "#! /bin/sh" >conf$$.sh
913 echo "exit 0" >>conf$$.sh
915 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
923 if test "$GCC" = yes; then
924 # Check if gcc -print-prog-name=ld gives a path.
925 AC_MSG_CHECKING([for ld used by GCC])
928 # gcc leaves a trailing carriage return which upsets mingw
929 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
931 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
934 # Accept absolute paths.
935 [[\\/]* | [A-Za-z]:[\\/]*)]
936 [re_direlt='/[^/][^/]*/\.\./']
937 # Canonicalize the path of ld
938 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
939 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
940 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
942 test -z "$LD" && LD="$ac_prog"
945 # If it fails, then pretend we aren't using GCC.
949 # If it is relative, then search for the first ld in PATH.
953 elif test "$with_gnu_ld" = yes; then
954 AC_MSG_CHECKING([for GNU ld])
956 AC_MSG_CHECKING([for non-GNU ld])
958 AC_CACHE_VAL(acl_cv_path_LD,
959 [if test -z "$LD"; then
960 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
961 for ac_dir in $PATH; do
962 test -z "$ac_dir" && ac_dir=.
963 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
964 acl_cv_path_LD="$ac_dir/$ac_prog"
965 # Check to see if the program is GNU ld. I'd rather use --version,
966 # but apparently some GNU ld's only accept -v.
967 # Break only if it was the GNU/non-GNU ld that we prefer.
968 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
969 *GNU* | *'with BFD'*)
970 test "$with_gnu_ld" != no && break ;;
972 test "$with_gnu_ld" != yes && break ;;
978 acl_cv_path_LD="$LD" # Let the user override the test with a path.
981 if test -n "$LD"; then
986 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
990 # Define a conditional.
992 AC_DEFUN([AM_CONDITIONAL],
1003 # isc-posix.m4 serial 2 (gettext-0.11.2)
1004 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1005 dnl This file is free software, distributed under the terms of the GNU
1006 dnl General Public License. As a special exception to the GNU General
1007 dnl Public License, this file may be distributed as part of a program
1008 dnl that contains a configuration script generated by Autoconf, under
1009 dnl the same distribution terms as the rest of that program.
1011 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1013 # This test replaces the one in autoconf.
1014 # Currently this macro should have the same name as the autoconf macro
1015 # because gettext's gettext.m4 (distributed in the automake package)
1016 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1017 # give these diagnostics:
1018 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1019 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1021 undefine([AC_ISC_POSIX])
1023 AC_DEFUN([AC_ISC_POSIX],
1025 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1026 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1030 # Do all the work for Automake. This macro actually does too much --
1031 # some checks are only needed if your package does certain things.
1032 # But this isn't really a big deal.
1037 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1039 AC_DEFUN([AM_INIT_AUTOMAKE],
1040 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1041 AC_REQUIRE([AC_PROG_INSTALL])
1046 dnl test to see if srcdir already configured
1047 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1048 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1051 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1052 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1053 AC_REQUIRE([AM_SANITY_CHECK])
1054 AC_REQUIRE([AC_ARG_PROGRAM])
1055 dnl FIXME This is truly gross.
1056 missing_dir=`cd $ac_aux_dir && pwd`
1057 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
1058 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1059 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
1060 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1061 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1062 AC_REQUIRE([AC_PROG_MAKE_SET])])
1064 # Copyright 2002 Free Software Foundation, Inc.
1066 # This program is free software; you can redistribute it and/or modify
1067 # it under the terms of the GNU General Public License as published by
1068 # the Free Software Foundation; either version 2, or (at your option)
1069 # any later version.
1071 # This program is distributed in the hope that it will be useful,
1072 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1073 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1074 # GNU General Public License for more details.
1076 # You should have received a copy of the GNU General Public License
1077 # along with this program; if not, write to the Free Software
1078 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1080 # AM_AUTOMAKE_VERSION(VERSION)
1081 # ----------------------------
1082 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1083 # generated from the m4 files accompanying Automake X.Y.
1084 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
1086 # AM_SET_CURRENT_AUTOMAKE_VERSION
1087 # -------------------------------
1088 # Call AM_AUTOMAKE_VERSION so it can be traced.
1089 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
1090 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1091 [AM_AUTOMAKE_VERSION([1.4-p6])])
1094 # Check to make sure that the build environment is sane.
1097 AC_DEFUN([AM_SANITY_CHECK],
1098 [AC_MSG_CHECKING([whether build environment is sane])
1101 echo timestamp > conftestfile
1102 # Do `set' in a subshell so we don't clobber the current shell's
1103 # arguments. Must try -L first in case configure is actually a
1104 # symlink; some systems play weird games with the mod time of symlinks
1105 # (eg FreeBSD returns the mod time of the symlink's containing
1108 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1109 if test "[$]*" = "X"; then
1111 set X `ls -t $srcdir/configure conftestfile`
1113 if test "[$]*" != "X $srcdir/configure conftestfile" \
1114 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1116 # If neither matched, then we have a broken ls. This can happen
1117 # if, for instance, CONFIG_SHELL is bash and it inherits a
1118 # broken ls alias from the environment. This has actually
1119 # happened. Such a system could not be considered "sane".
1120 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1121 alias in your environment])
1124 test "[$]2" = conftestfile
1130 AC_MSG_ERROR([newly created file is older than distributed files!
1131 Check your system clock])
1134 AC_MSG_RESULT(yes)])
1136 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1137 dnl The program must properly implement --version.
1138 AC_DEFUN([AM_MISSING_PROG],
1139 [AC_MSG_CHECKING(for working $2)
1140 # Run test in a subshell; some versions of sh will print an error if
1141 # an executable is not found, even if stderr is redirected.
1142 # Redirect stdin to placate older versions of autoconf. Sigh.
1143 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1145 AC_MSG_RESULT(found)
1148 AC_MSG_RESULT(missing)
1152 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1154 AC_DEFUN([AM_CONFIG_HEADER],
1156 AC_CONFIG_HEADER([$1])
1157 dnl When config.status generates a header, we must update the stamp-h file.
1158 dnl This file resides in the same directory as the config header
1159 dnl that is generated. We must strip everything past the first ":",
1160 dnl and everything past the last "/".
1161 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1162 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1163 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1165 for am_file in <<$1>>; do
1166 case " <<$>>CONFIG_HEADERS " in
1167 *" <<$>>am_file "*<<)>>
1168 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1171 am_indx=`expr "<<$>>am_indx" + 1`
1175 # Add --enable-maintainer-mode option to configure.
1180 AC_DEFUN([AM_MAINTAINER_MODE],
1181 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1182 dnl maintainer-mode is disabled by default
1183 AC_ARG_ENABLE(maintainer-mode,
1184 [ --enable-maintainer-mode enable make rules and dependencies not useful
1185 (and sometimes confusing) to the casual installer],
1186 USE_MAINTAINER_MODE=$enableval,
1187 USE_MAINTAINER_MODE=no)
1188 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1189 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1190 MAINT=$MAINTAINER_MODE_TRUE