1 # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # Autoconf include file defining macros related to compile-time warnings.
16 # Copyright 2004, 2005 Free Software Foundation, Inc.
18 #This file is part of GCC.
20 #GCC is free software; you can redistribute it and/or modify it under
21 #the terms of the GNU General Public License as published by the Free
22 #Software Foundation; either version 2, or (at your option) any later
25 #GCC is distributed in the hope that it will be useful, but WITHOUT
26 #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
27 #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
30 #You should have received a copy of the GNU General Public License
31 #along with GCC; see the file COPYING. If not, write to the Free
32 #Software Foundation, 59 Temple Place - Suite 330, Boston, MA
35 # ACX_PROG_CC_WARNING_OPTS([-Wfoo -Wbar -Wbaz])
36 # Sets @WARN_CFLAGS@ to the subset of the given options which the
38 AC_DEFUN([ACX_PROG_CC_WARNING_OPTS],
39 [AC_REQUIRE([AC_PROG_CC])dnl
40 AC_SUBST([WARN_CFLAGS])dnl
44 AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
45 AC_CACHE_CHECK([whether $CC supports $option], acx_Woption,
47 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
48 [AS_VAR_SET(acx_Woption, yes)],
49 [AS_VAR_SET(acx_Woption, no)])
51 AS_IF([test AS_VAR_GET(acx_Woption) = yes],
52 [WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option"])
53 AS_VAR_POPDEF([acx_Woption])dnl
56 ])# ACX_PROG_CC_WARNING_OPTS
58 # ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long ...])
59 # Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler is GCC
60 # and accepts all of those options simultaneously, otherwise to nothing.
61 AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
62 [AC_REQUIRE([AC_PROG_CC])dnl
63 AC_SUBST([WARN_PEDANTIC])dnl
64 AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl
66 AS_IF([test $GCC = yes],
67 [AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
68 [save_CFLAGS="$CFLAGS"
70 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
71 [AS_VAR_SET(acx_Pedantic, yes)],
72 [AS_VAR_SET(acx_Pedantic, no)])
73 CFLAGS="$save_CFLAGS"])
74 AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
75 [WARN_PEDANTIC="-pedantic $1"])
77 AS_VAR_POPDEF([acx_Pedantic])dnl
78 ])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
80 # ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z])
81 # sets WERROR to "-Werror" if the compiler is GCC >=x.y.z, or if
82 # --enable-werror-always was given on the command line, otherwise
84 # If the argument is the word "manual" instead of a version number,
85 # then WERROR will be set to -Werror only if --enable-werror-always
86 # appeared on the configure command line.
87 AC_DEFUN([ACX_PROG_CC_WARNINGS_ARE_ERRORS],
88 [AC_REQUIRE([AC_PROG_CC])dnl
91 AC_ARG_ENABLE(werror-always,
92 AS_HELP_STRING([--enable-werror-always],
93 [enable -Werror despite compiler version]),
94 [], [enable_werror_always=no])
95 AS_IF([test $enable_werror_always = yes],
98 [AS_VAR_PUSHDEF([acx_GCCvers], [acx_cv_prog_cc_gcc_$1_or_newer])dnl
99 AC_CACHE_CHECK([whether $CC is GCC >=$1], acx_GCCvers,
100 [set fnord `echo $1 | tr '.' ' '`
103 [#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ \
104 < [$]1 * 10000 + [$]2 * 100 + [$]3
107 [AS_VAR_SET(acx_GCCvers, yes)],
108 [AS_VAR_SET(acx_GCCvers, no)])])
109 AS_IF([test AS_VAR_GET(acx_GCCvers) = yes],
111 AS_VAR_POPDEF([acx_GCCvers])]))
112 ])# ACX_PROG_CC_WARNINGS_ARE_ERRORS
114 # Autoconf M4 include file defining utility macros for complex Canadian
118 dnl # _GCC_TOPLEV_NONCANONICAL_BUILD
119 dnl # $build_alias or canonical $build if blank.
120 dnl # Used when we would use $build_alias, but empty is not OK.
121 AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_BUILD],
122 [AC_REQUIRE([AC_CANONICAL_BUILD]) []dnl
123 case ${build_alias} in
124 "") build_noncanonical=${build} ;;
125 *) build_noncanonical=${build_alias} ;;
127 ]) []dnl # _GCC_TOPLEV_NONCANONICAL_BUILD
130 dnl # _GCC_TOPLEV_NONCANONICAL_HOST
131 dnl # $host_alias, or $build_noncanonical if blank.
132 dnl # Used when we would use $host_alias, but empty is not OK.
133 AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_HOST],
134 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
135 case ${host_alias} in
136 "") host_noncanonical=${build_noncanonical} ;;
137 *) host_noncanonical=${host_alias} ;;
139 ]) []dnl # _GCC_TOPLEV_NONCANONICAL_HOST
142 dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
143 dnl # $target_alias or $host_noncanonical if blank.
144 dnl # Used when we would use $target_alias, but empty is not OK.
145 AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_TARGET],
146 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
147 case ${target_alias} in
148 "") target_noncanonical=${host_noncanonical} ;;
149 *) target_noncanonical=${target_alias} ;;
151 ]) []dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
154 dnl # ACX_NONCANONICAL_BUILD
155 dnl # Like underscored version, but AC_SUBST's.
156 AC_DEFUN([ACX_NONCANONICAL_BUILD],
157 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
158 AC_SUBST(build_noncanonical)
159 ]) []dnl # ACX_NONCANONICAL_BUILD
162 dnl # ACX_NONCANONICAL_HOST
163 dnl # Like underscored version, but AC_SUBST's.
164 AC_DEFUN([ACX_NONCANONICAL_HOST],
165 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
166 AC_SUBST(host_noncanonical)
167 ]) []dnl # ACX_NONCANONICAL_HOST
170 dnl # ACX_NONCANONICAL_TARGET
171 dnl # Like underscored version, but AC_SUBST's.
172 AC_DEFUN([ACX_NONCANONICAL_TARGET],
173 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl
174 AC_SUBST(target_noncanonical)
175 ]) []dnl # ACX_NONCANONICAL_TARGET
178 dnl # GCC_TOPLEV_SUBDIRS
179 dnl # GCC & friends build 'build', 'host', and 'target' tools. These must
180 dnl # be separated into three well-known subdirectories of the build directory:
181 dnl # build_subdir, host_subdir, and target_subdir. The values are determined
182 dnl # here so that they can (theoretically) be changed in the future. They
183 dnl # were previously reproduced across many different files.
185 dnl # This logic really amounts to very little with autoconf 2.13; it will
186 dnl # amount to a lot more with autoconf 2.5x.
187 AC_DEFUN([GCC_TOPLEV_SUBDIRS],
188 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl
189 AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
190 # Prefix 'build-' so this never conflicts with target_subdir.
191 build_subdir="build-${build_noncanonical}"
192 # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
193 if ( test $srcdir = . && test -d gcc ) \
194 || test -d $srcdir/../host-${host_noncanonical}; then
195 host_subdir="host-${host_noncanonical}"
200 target_subdir=${target_noncanonical}
201 AC_SUBST([build_subdir]) []dnl
202 AC_SUBST([host_subdir]) []dnl
203 AC_SUBST([target_subdir]) []dnl
204 ]) []dnl # GCC_TOPLEV_SUBDIRS
207 # _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM
209 # These demand that AC_CANONICAL_SYSTEM be called beforehand.
210 AC_DEFUN([_NCN_TOOL_PREFIXES],
212 test -n "$host_alias" && ncn_tool_prefix=$host_alias-
213 ncn_target_tool_prefix=
214 test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
215 ]) []dnl # _NCN_TOOL_PREFIXES
217 # NCN_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
218 # Like AC_CHECK_TOOL, but tries a prefix of the target, not the host.
219 # Code is pretty much lifted from autoconf2.53.
221 AC_DEFUN([NCN_CHECK_TARGET_TOOL],
222 [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
223 if test -n "$ncn_target_tool_prefix"; then
224 AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}$2],
225 [${ncn_target_tool_prefix}$2], , [$4])
227 if test -z "$ac_cv_prog_$1" ; then
229 AC_CHECK_PROG([ncn_cv_$1], [$2], [$2], [$3], [$4])
234 ]) []dnl # NCN_CHECK_TARGET_TOOL
237 # NCN_STRICT_CHECK_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
238 # Like AC_CHECK_TOOL, but requires the prefix if build!=host.
240 AC_DEFUN([NCN_STRICT_CHECK_TOOL],
241 [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
242 if test -n "$ncn_tool_prefix"; then
243 AC_CHECK_PROG([$1], [${ncn_tool_prefix}$2],
244 [${ncn_tool_prefix}$2], , [$4])
246 if test -z "$ac_cv_prog_$1" ; then
247 if test $build = $host ; then
249 AC_CHECK_PROG([ncn_cv_$1], [$2], [$2], [ifelse([$3],[],[$2],[$3])], [$4])
252 $1="ifelse([$3],[],[${ncn_tool_prefix}$2],[$3])"
257 ]) []dnl # NCN_STRICT_CHECK_TOOL
260 # NCN_STRICT_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
261 # Like NCN_CHECK_TARGET_TOOL, but requires the prefix if build!=target.
263 AC_DEFUN([NCN_STRICT_CHECK_TARGET_TOOL],
264 [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
265 if test -n "$ncn_target_tool_prefix"; then
266 AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}$2],
267 [${ncn_target_tool_prefix}$2], , [$4])
269 if test -z "$ac_cv_prog_$1" ; then
270 if test $build = $target ; then
272 AC_CHECK_PROG([ncn_cv_$1], [$2], [$2], [ifelse([$3],[],[$2],[$3])], [$4])
275 $1="ifelse([$3],[],[${ncn_target_tool_prefix}$2],[$3])"
280 ]) []dnl # NCN_STRICT_CHECK_TARGET_TOOL
283 # Used for autoconf 2.5x to force AC_PREPROC_IFELSE to reject code which
284 # triggers warnings from the preprocessor. Will be in autoconf 2.58.
285 # For now, using this also overrides header checks to use only the
286 # preprocessor (matches 2.13 behavior; matching 2.58's behavior is a
287 # bit harder from here).
288 # Eventually autoconf will default to checking headers with the compiler
289 # instead, and we'll have to do this differently.
291 AC_DEFUN([AC_PROG_CPP_WERROR],
292 [AC_REQUIRE([AC_PROG_CPP])dnl
293 m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD]))
294 ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR
297 # We require the gnatbind program, and a compiler driver that
298 # understands Ada. We use the user's CC setting, already found.
300 # Sets the shell variable have_gnat to yes or no as appropriate, and
301 # substitutes GNATBIND.
302 AC_DEFUN([ACX_PROG_GNAT],
303 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
304 AC_REQUIRE([AC_PROG_CC])
305 AC_CHECK_TOOL(GNATBIND, gnatbind, no)
306 AC_CACHE_CHECK([whether compiler driver understands Ada],
307 acx_cv_cc_gcc_supports_ada,
308 [cat >conftest.adb <<EOF
309 procedure conftest is begin null; end conftest;
311 acx_cv_cc_gcc_supports_ada=no
312 # There is a bug in old released versions of GCC which causes the
313 # driver to exit successfully when the appropriate language module
314 # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
315 # Therefore we must check for the error message as well as an
317 # Other compilers, like HP Tru64 UNIX cc, exit successfully when
318 # given a .adb file, but produce no object file. So we must check
319 # if an object file was really produced to guard against this.
320 errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
321 if test x"$errors" = x && test -f conftest.$ac_objext; then
322 acx_cv_cc_gcc_supports_ada=yes
326 if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
333 dnl 'make compare' can be significantly faster, if cmp itself can
334 dnl skip bytes instead of using tail. The test being performed is
335 dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
336 dnl but we need to sink errors and handle broken shells. We also test
337 dnl for the parameter format "cmp file1 file2 skip1 skip2" which is
338 dnl accepted by cmp on some systems.
339 AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL],
340 [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip,
343 gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
344 if cmp t1 t2 2 2 > /dev/null 2>&1; then
345 if cmp t1 t2 1 1 > /dev/null 2>&1; then
348 gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
351 if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
352 if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
355 gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
360 do_compare="$gcc_cv_prog_cmp_skip"
364 dnl See whether we can include both string.h and strings.h.
365 AC_DEFUN([ACX_HEADER_STRING],
366 [AC_CACHE_CHECK([whether string.h and strings.h may both be included],
367 gcc_cv_header_string,
368 [AC_TRY_COMPILE([#include <string.h>
369 #include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
370 if test $gcc_cv_header_string = yes; then
371 AC_DEFINE(STRING_WITH_STRINGS, 1, [Define if you can safely include both <string.h> and <strings.h>.])
375 dnl See if stdbool.h properly defines bool and true/false.
376 dnl Check whether _Bool is built-in.
377 AC_DEFUN([ACX_HEADER_STDBOOL],
378 [AC_CACHE_CHECK([for working stdbool.h],
379 ac_cv_header_stdbool_h,
380 [AC_TRY_COMPILE([#include <stdbool.h>],
382 ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
383 if test $ac_cv_header_stdbool_h = yes; then
384 AC_DEFINE(HAVE_STDBOOL_H, 1,
385 [Define if you have a working <stdbool.h> header file.])
387 AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
390 gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
392 if test $gcc_cv_c__bool = yes; then
393 AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
397 dnl See if hard links work and if not, try to substitute $1 or simple copy.
398 AC_DEFUN([ACX_PROG_LN],
399 [AC_MSG_CHECKING(whether ln works)
400 AC_CACHE_VAL(acx_cv_prog_LN,
401 [rm -f conftestdata_t
403 if ln conftestdata_f conftestdata_t 2>/dev/null
409 rm -f conftestdata_f conftestdata_t
411 if test $acx_cv_prog_LN = no; then
412 LN="ifelse([$1],,cp,[$1])"
413 AC_MSG_RESULT([no, using $LN])
422 # codeset.m4 serial AM1 (gettext-0.10.40)
423 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
424 dnl This file is free software, distributed under the terms of the GNU
425 dnl General Public License. As a special exception to the GNU General
426 dnl Public License, this file may be distributed as part of a program
427 dnl that contains a configuration script generated by Autoconf, under
428 dnl the same distribution terms as the rest of that program.
430 dnl From Bruno Haible.
432 AC_DEFUN([AM_LANGINFO_CODESET],
434 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
435 [AC_TRY_LINK([#include <langinfo.h>],
436 [char* cs = nl_langinfo(CODESET);],
437 am_cv_langinfo_codeset=yes,
438 am_cv_langinfo_codeset=no)
440 if test $am_cv_langinfo_codeset = yes; then
441 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
442 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
446 # intl sister-directory configuration rules.
449 # The idea behind this macro is that there's no need to repeat all the
450 # autoconf probes done by the intl directory - it's already done them
451 # for us. In fact, there's no need even to look at the cache for the
452 # answers. All we need to do is nab a few pieces of information.
453 # The intl directory is set up to make this easy, by generating a
454 # small file which can be sourced as a shell script; then we produce
455 # the necessary substitutions and definitions for this directory.
457 AC_DEFUN([ZW_GNU_GETTEXT_SISTER_DIR],
458 [# If we haven't got the data from the intl directory,
459 # assume NLS is disabled.
460 USE_NLS=no AC_SUBST(USE_NLS)
461 LIBINTL= AC_SUBST(LIBINTL)
462 LIBINTL_DEP= AC_SUBST(LIBINTL_DEP)
463 INCINTL= AC_SUBST(INCINTL)
464 XGETTEXT= AC_SUBST(XGETTEXT)
465 GMSGFMT= AC_SUBST(GMSGFMT)
466 POSUB= AC_SUBST(POSUB)
467 if test -f ../intl/config.intl; then
468 . ../intl/config.intl
470 AC_MSG_CHECKING([whether NLS is requested])
471 if test x"$USE_NLS" != xyes; then
475 AC_DEFINE(ENABLE_NLS, 1,
476 [Define to 1 if translation of program messages to the
477 user's native language is requested.])
479 AC_MSG_CHECKING(for catalogs to be installed)
480 # Look for .po and .gmo files in the source directory.
481 CATALOGS= AC_SUBST(CATALOGS)
483 for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
484 # If there aren't any .gmo files the shell will give us the
485 # literal string "../path/to/srcdir/po/*.gmo" which has to be
490 # The quadruple backslash is collapsed to a double backslash
491 # by the backticks, then collapsed again by the double quotes,
492 # leaving us with one backslash in the sed expression (right
493 # before the dot that mustn't act as a wildcard).
494 cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"`
495 lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"`
496 # The user is allowed to set LINGUAS to a list of languages to
497 # install catalogs for. If it's empty that means "all of them."
498 if test "x$LINGUAS" = x; then
499 CATALOGS="$CATALOGS $cat"
500 XLINGUAS="$XLINGUAS $lang"
502 case "$LINGUAS" in *$lang*)
503 CATALOGS="$CATALOGS $cat"
504 XLINGUAS="$XLINGUAS $lang"
510 AC_MSG_RESULT($LINGUAS)
513 # iconv.m4 serial AM4 (gettext-0.11.3)
514 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
515 dnl This file is free software, distributed under the terms of the GNU
516 dnl General Public License. As a special exception to the GNU General
517 dnl Public License, this file may be distributed as part of a program
518 dnl that contains a configuration script generated by Autoconf, under
519 dnl the same distribution terms as the rest of that program.
521 dnl From Bruno Haible.
523 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
525 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
526 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
527 AC_REQUIRE([AC_LIB_RPATH])
529 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
531 AC_LIB_LINKFLAGS_BODY([iconv])
534 AC_DEFUN([AM_ICONV_LINK],
536 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
537 dnl those with the standalone portable GNU libiconv installed).
539 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
541 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
543 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
544 dnl because if the user has installed libiconv and not disabled its use
545 dnl via --without-libiconv-prefix, he wants to use it. The first
546 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
547 am_save_CPPFLAGS="$CPPFLAGS"
548 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
550 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
551 am_cv_func_iconv="no, consider installing GNU libiconv"
553 AC_TRY_LINK([#include <stdlib.h>
555 [iconv_t cd = iconv_open("","");
556 iconv(cd,NULL,NULL,NULL,NULL);
558 am_cv_func_iconv=yes)
559 if test "$am_cv_func_iconv" != yes; then
561 LIBS="$LIBS $LIBICONV"
562 AC_TRY_LINK([#include <stdlib.h>
564 [iconv_t cd = iconv_open("","");
565 iconv(cd,NULL,NULL,NULL,NULL);
568 am_cv_func_iconv=yes)
572 if test "$am_cv_func_iconv" = yes; then
573 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
575 if test "$am_cv_lib_iconv" = yes; then
576 AC_MSG_CHECKING([how to link with libiconv])
577 AC_MSG_RESULT([$LIBICONV])
579 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
581 CPPFLAGS="$am_save_CPPFLAGS"
592 if test "$am_cv_func_iconv" = yes; then
593 AC_MSG_CHECKING([for iconv declaration])
594 AC_CACHE_VAL(am_cv_proto_iconv, [
602 #if defined(__STDC__) || defined(__cplusplus)
603 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
607 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
608 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
609 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
610 AC_MSG_RESULT([$]{ac_t:-
611 }[$]am_cv_proto_iconv)
612 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
613 [Define as const if the declaration of iconv() needs const.])
617 # lib-prefix.m4 serial 2 (gettext-0.12)
618 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
619 dnl This file is free software, distributed under the terms of the GNU
620 dnl General Public License. As a special exception to the GNU General
621 dnl Public License, this file may be distributed as part of a program
622 dnl that contains a configuration script generated by Autoconf, under
623 dnl the same distribution terms as the rest of that program.
625 dnl From Bruno Haible.
627 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
628 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
629 dnl require excessive bracketing.
630 ifdef([AC_HELP_STRING],
631 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
632 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
634 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
635 dnl to access previously installed libraries. The basic assumption is that
636 dnl a user will want packages to use other packages he previously installed
637 dnl with the same --prefix option.
638 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
639 dnl libraries, but is otherwise very convenient.
640 AC_DEFUN([AC_LIB_PREFIX],
642 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
643 AC_REQUIRE([AC_PROG_CC])
644 AC_REQUIRE([AC_CANONICAL_HOST])
645 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
646 dnl By default, look in $includedir and $libdir.
648 AC_LIB_WITH_FINAL_PREFIX([
649 eval additional_includedir=\"$includedir\"
650 eval additional_libdir=\"$libdir\"
652 AC_LIB_ARG_WITH([lib-prefix],
653 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
654 --without-lib-prefix don't search for libraries in includedir and libdir],
656 if test "X$withval" = "Xno"; then
659 if test "X$withval" = "X"; then
660 AC_LIB_WITH_FINAL_PREFIX([
661 eval additional_includedir=\"$includedir\"
662 eval additional_libdir=\"$libdir\"
665 additional_includedir="$withval/include"
666 additional_libdir="$withval/lib"
670 if test $use_additional = yes; then
671 dnl Potentially add $additional_includedir to $CPPFLAGS.
673 dnl 1. if it's the standard /usr/include,
674 dnl 2. if it's already present in $CPPFLAGS,
675 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
676 dnl 4. if it doesn't exist as a directory.
677 if test "X$additional_includedir" != "X/usr/include"; then
679 for x in $CPPFLAGS; do
680 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
681 if test "X$x" = "X-I$additional_includedir"; then
686 if test -z "$haveit"; then
687 if test "X$additional_includedir" = "X/usr/local/include"; then
688 if test -n "$GCC"; then
694 if test -z "$haveit"; then
695 if test -d "$additional_includedir"; then
696 dnl Really add $additional_includedir to $CPPFLAGS.
697 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
702 dnl Potentially add $additional_libdir to $LDFLAGS.
704 dnl 1. if it's the standard /usr/lib,
705 dnl 2. if it's already present in $LDFLAGS,
706 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
707 dnl 4. if it doesn't exist as a directory.
708 if test "X$additional_libdir" != "X/usr/lib"; then
710 for x in $LDFLAGS; do
711 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
712 if test "X$x" = "X-L$additional_libdir"; then
717 if test -z "$haveit"; then
718 if test "X$additional_libdir" = "X/usr/local/lib"; then
719 if test -n "$GCC"; then
725 if test -z "$haveit"; then
726 if test -d "$additional_libdir"; then
727 dnl Really add $additional_libdir to $LDFLAGS.
728 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
736 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
737 dnl acl_final_exec_prefix, containing the values to which $prefix and
738 dnl $exec_prefix will expand at the end of the configure script.
739 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
741 dnl Unfortunately, prefix and exec_prefix get only finally determined
742 dnl at the end of configure.
743 if test "X$prefix" = "XNONE"; then
744 acl_final_prefix="$ac_default_prefix"
746 acl_final_prefix="$prefix"
748 if test "X$exec_prefix" = "XNONE"; then
749 acl_final_exec_prefix='${prefix}'
751 acl_final_exec_prefix="$exec_prefix"
753 acl_save_prefix="$prefix"
754 prefix="$acl_final_prefix"
755 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
756 prefix="$acl_save_prefix"
759 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
760 dnl variables prefix and exec_prefix bound to the values they will have
761 dnl at the end of the configure script.
762 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
764 acl_save_prefix="$prefix"
765 prefix="$acl_final_prefix"
766 acl_save_exec_prefix="$exec_prefix"
767 exec_prefix="$acl_final_exec_prefix"
769 exec_prefix="$acl_save_exec_prefix"
770 prefix="$acl_save_prefix"
773 # lib-link.m4 serial 4 (gettext-0.12)
774 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
775 dnl This file is free software, distributed under the terms of the GNU
776 dnl General Public License. As a special exception to the GNU General
777 dnl Public License, this file may be distributed as part of a program
778 dnl that contains a configuration script generated by Autoconf, under
779 dnl the same distribution terms as the rest of that program.
781 dnl From Bruno Haible.
783 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
784 dnl the libraries corresponding to explicit and implicit dependencies.
785 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
786 dnl augments the CPPFLAGS variable.
787 AC_DEFUN([AC_LIB_LINKFLAGS],
789 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
790 AC_REQUIRE([AC_LIB_RPATH])
791 define([Name],[translit([$1],[./-], [___])])
792 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
793 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
794 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
795 AC_LIB_LINKFLAGS_BODY([$1], [$2])
796 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
797 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
798 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
800 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
801 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
802 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
803 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
805 AC_SUBST([LTLIB]NAME)
806 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
807 dnl results of this search when this library appears as a dependency.
813 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
814 dnl searches for libname and the libraries corresponding to explicit and
815 dnl implicit dependencies, together with the specified include files and
816 dnl the ability to compile and link the specified testcode. If found, it
817 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
818 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
819 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
820 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
821 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
823 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
824 AC_REQUIRE([AC_LIB_RPATH])
825 define([Name],[translit([$1],[./-], [___])])
826 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
827 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
829 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
831 AC_LIB_LINKFLAGS_BODY([$1], [$2])
833 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
834 dnl because if the user has installed lib[]Name and not disabled its use
835 dnl via --without-lib[]Name-prefix, he wants to use it.
836 ac_save_CPPFLAGS="$CPPFLAGS"
837 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
839 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
841 LIBS="$LIBS $LIB[]NAME"
842 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
845 if test "$ac_cv_lib[]Name" = yes; then
847 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
848 AC_MSG_CHECKING([how to link with lib[]$1])
849 AC_MSG_RESULT([$LIB[]NAME])
852 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
853 dnl $INC[]NAME either.
854 CPPFLAGS="$ac_save_CPPFLAGS"
858 AC_SUBST([HAVE_LIB]NAME)
860 AC_SUBST([LTLIB]NAME)
865 dnl Determine the platform dependent parameters needed to use rpath:
866 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
867 dnl hardcode_direct, hardcode_minus_L.
868 AC_DEFUN([AC_LIB_RPATH],
870 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
871 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
872 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
873 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
874 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
875 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
876 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
882 libext="$acl_cv_libext"
883 shlibext="$acl_cv_shlibext"
884 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
885 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
886 hardcode_direct="$acl_cv_hardcode_direct"
887 hardcode_minus_L="$acl_cv_hardcode_minus_L"
888 dnl Determine whether the user wants rpath handling at all.
890 [ --disable-rpath do not hardcode runtime library paths],
894 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
895 dnl the libraries corresponding to explicit and implicit dependencies.
896 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
897 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
899 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
900 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
901 dnl By default, look in $includedir and $libdir.
903 AC_LIB_WITH_FINAL_PREFIX([
904 eval additional_includedir=\"$includedir\"
905 eval additional_libdir=\"$libdir\"
907 AC_LIB_ARG_WITH([lib$1-prefix],
908 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
909 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
911 if test "X$withval" = "Xno"; then
914 if test "X$withval" = "X"; then
915 AC_LIB_WITH_FINAL_PREFIX([
916 eval additional_includedir=\"$includedir\"
917 eval additional_libdir=\"$libdir\"
920 additional_includedir="$withval/include"
921 additional_libdir="$withval/lib"
925 dnl Search the library and its dependencies in $additional_libdir and
926 dnl $LDFLAGS. Using breadth-first-seach.
932 names_already_handled=
933 names_next_round='$1 $2'
934 while test -n "$names_next_round"; do
935 names_this_round="$names_next_round"
937 for name in $names_this_round; do
939 for n in $names_already_handled; do
940 if test "$n" = "$name"; then
945 if test -z "$already_handled"; then
946 names_already_handled="$names_already_handled $name"
947 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
948 dnl or AC_LIB_HAVE_LINKFLAGS call.
949 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
950 eval value=\"\$HAVE_LIB$uppername\"
951 if test -n "$value"; then
952 if test "$value" = yes; then
953 eval value=\"\$LIB$uppername\"
954 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
955 eval value=\"\$LTLIB$uppername\"
956 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
958 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
959 dnl that this library doesn't exist. So just drop it.
963 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
964 dnl and the already constructed $LIBNAME/$LTLIBNAME.
969 if test $use_additional = yes; then
970 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
971 found_dir="$additional_libdir"
972 found_so="$additional_libdir/lib$name.$shlibext"
973 if test -f "$additional_libdir/lib$name.la"; then
974 found_la="$additional_libdir/lib$name.la"
977 if test -f "$additional_libdir/lib$name.$libext"; then
978 found_dir="$additional_libdir"
979 found_a="$additional_libdir/lib$name.$libext"
980 if test -f "$additional_libdir/lib$name.la"; then
981 found_la="$additional_libdir/lib$name.la"
986 if test "X$found_dir" = "X"; then
987 for x in $LDFLAGS $LTLIB[]NAME; do
988 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
991 dir=`echo "X$x" | sed -e 's/^X-L//'`
992 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
994 found_so="$dir/lib$name.$shlibext"
995 if test -f "$dir/lib$name.la"; then
996 found_la="$dir/lib$name.la"
999 if test -f "$dir/lib$name.$libext"; then
1001 found_a="$dir/lib$name.$libext"
1002 if test -f "$dir/lib$name.la"; then
1003 found_la="$dir/lib$name.la"
1009 if test "X$found_dir" != "X"; then
1014 if test "X$found_dir" != "X"; then
1015 dnl Found the library.
1016 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1017 if test "X$found_so" != "X"; then
1018 dnl Linking with a shared library. We attempt to hardcode its
1019 dnl directory into the executable's runpath, unless it's the
1020 dnl standard /usr/lib.
1021 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1022 dnl No hardcoding is needed.
1023 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1025 dnl Use an explicit option to hardcode DIR into the resulting
1027 dnl Potentially add DIR to ltrpathdirs.
1028 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1030 for x in $ltrpathdirs; do
1031 if test "X$x" = "X$found_dir"; then
1036 if test -z "$haveit"; then
1037 ltrpathdirs="$ltrpathdirs $found_dir"
1039 dnl The hardcoding into $LIBNAME is system dependent.
1040 if test "$hardcode_direct" = yes; then
1041 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1042 dnl resulting binary.
1043 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1045 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1046 dnl Use an explicit option to hardcode DIR into the resulting
1048 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1049 dnl Potentially add DIR to rpathdirs.
1050 dnl The rpathdirs will be appended to $LIBNAME at the end.
1052 for x in $rpathdirs; do
1053 if test "X$x" = "X$found_dir"; then
1058 if test -z "$haveit"; then
1059 rpathdirs="$rpathdirs $found_dir"
1062 dnl Rely on "-L$found_dir".
1063 dnl But don't add it if it's already contained in the LDFLAGS
1064 dnl or the already constructed $LIBNAME
1066 for x in $LDFLAGS $LIB[]NAME; do
1067 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1068 if test "X$x" = "X-L$found_dir"; then
1073 if test -z "$haveit"; then
1074 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1076 if test "$hardcode_minus_L" != no; then
1077 dnl FIXME: Not sure whether we should use
1078 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1080 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1082 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1083 dnl here, because this doesn't fit in flags passed to the
1084 dnl compiler. So give up. No hardcoding. This affects only
1085 dnl very old systems.
1086 dnl FIXME: Not sure whether we should use
1087 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1089 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1095 if test "X$found_a" != "X"; then
1096 dnl Linking with a static library.
1097 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1099 dnl We shouldn't come here, but anyway it's good to have a
1101 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1104 dnl Assume the include files are nearby.
1105 additional_includedir=
1106 case "$found_dir" in
1108 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1109 additional_includedir="$basedir/include"
1112 if test "X$additional_includedir" != "X"; then
1113 dnl Potentially add $additional_includedir to $INCNAME.
1114 dnl But don't add it
1115 dnl 1. if it's the standard /usr/include,
1116 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1117 dnl 3. if it's already present in $CPPFLAGS or the already
1118 dnl constructed $INCNAME,
1119 dnl 4. if it doesn't exist as a directory.
1120 if test "X$additional_includedir" != "X/usr/include"; then
1122 if test "X$additional_includedir" = "X/usr/local/include"; then
1123 if test -n "$GCC"; then
1125 linux*) haveit=yes;;
1129 if test -z "$haveit"; then
1130 for x in $CPPFLAGS $INC[]NAME; do
1131 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1132 if test "X$x" = "X-I$additional_includedir"; then
1137 if test -z "$haveit"; then
1138 if test -d "$additional_includedir"; then
1139 dnl Really add $additional_includedir to $INCNAME.
1140 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1146 dnl Look for dependencies.
1147 if test -n "$found_la"; then
1148 dnl Read the .la file. It defines the variables
1149 dnl dlname, library_names, old_library, dependency_libs, current,
1150 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1151 save_libdir="$libdir"
1153 */* | *\\*) . "$found_la" ;;
1154 *) . "./$found_la" ;;
1156 libdir="$save_libdir"
1157 dnl We use only dependency_libs.
1158 for dep in $dependency_libs; do
1161 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1162 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1163 dnl But don't add it
1164 dnl 1. if it's the standard /usr/lib,
1165 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1166 dnl 3. if it's already present in $LDFLAGS or the already
1167 dnl constructed $LIBNAME,
1168 dnl 4. if it doesn't exist as a directory.
1169 if test "X$additional_libdir" != "X/usr/lib"; then
1171 if test "X$additional_libdir" = "X/usr/local/lib"; then
1172 if test -n "$GCC"; then
1174 linux*) haveit=yes;;
1178 if test -z "$haveit"; then
1180 for x in $LDFLAGS $LIB[]NAME; do
1181 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1182 if test "X$x" = "X-L$additional_libdir"; then
1187 if test -z "$haveit"; then
1188 if test -d "$additional_libdir"; then
1189 dnl Really add $additional_libdir to $LIBNAME.
1190 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1194 for x in $LDFLAGS $LTLIB[]NAME; do
1195 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1196 if test "X$x" = "X-L$additional_libdir"; then
1201 if test -z "$haveit"; then
1202 if test -d "$additional_libdir"; then
1203 dnl Really add $additional_libdir to $LTLIBNAME.
1204 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1211 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1212 if test "$enable_rpath" != no; then
1213 dnl Potentially add DIR to rpathdirs.
1214 dnl The rpathdirs will be appended to $LIBNAME at the end.
1216 for x in $rpathdirs; do
1217 if test "X$x" = "X$dir"; then
1222 if test -z "$haveit"; then
1223 rpathdirs="$rpathdirs $dir"
1225 dnl Potentially add DIR to ltrpathdirs.
1226 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1228 for x in $ltrpathdirs; do
1229 if test "X$x" = "X$dir"; then
1234 if test -z "$haveit"; then
1235 ltrpathdirs="$ltrpathdirs $dir"
1240 dnl Handle this in the next round.
1241 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1244 dnl Handle this in the next round. Throw away the .la's
1245 dnl directory; it is already contained in a preceding -L
1247 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1250 dnl Most likely an immediate library name.
1251 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1252 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1258 dnl Didn't find the library; assume it is in the system directories
1259 dnl known to the linker and runtime loader. (All the system
1260 dnl directories known to the linker should also be known to the
1261 dnl runtime loader, otherwise the system is severely misconfigured.)
1262 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1263 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1269 if test "X$rpathdirs" != "X"; then
1270 if test -n "$hardcode_libdir_separator"; then
1271 dnl Weird platform: only the last -rpath option counts, the user must
1272 dnl pass all path elements in one option. We can arrange that for a
1273 dnl single library, but not when more than one $LIBNAMEs are used.
1275 for found_dir in $rpathdirs; do
1276 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1278 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1279 acl_save_libdir="$libdir"
1281 eval flag=\"$hardcode_libdir_flag_spec\"
1282 libdir="$acl_save_libdir"
1283 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1285 dnl The -rpath options are cumulative.
1286 for found_dir in $rpathdirs; do
1287 acl_save_libdir="$libdir"
1289 eval flag=\"$hardcode_libdir_flag_spec\"
1290 libdir="$acl_save_libdir"
1291 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1295 if test "X$ltrpathdirs" != "X"; then
1296 dnl When using libtool, the option that works for both libraries and
1297 dnl executables is -R. The -R options are cumulative.
1298 for found_dir in $ltrpathdirs; do
1299 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1304 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1305 dnl unless already present in VAR.
1306 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1307 dnl contains two or three consecutive elements that belong together.
1308 AC_DEFUN([AC_LIB_APPENDTOVAR],
1310 for element in [$2]; do
1313 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1314 if test "X$x" = "X$element"; then
1319 if test -z "$haveit"; then
1320 [$1]="${[$1]}${[$1]:+ }$element"
1325 # lib-ld.m4 serial 2 (gettext-0.12)
1326 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1327 dnl This file is free software, distributed under the terms of the GNU
1328 dnl General Public License. As a special exception to the GNU General
1329 dnl Public License, this file may be distributed as part of a program
1330 dnl that contains a configuration script generated by Autoconf, under
1331 dnl the same distribution terms as the rest of that program.
1333 dnl Subroutines of libtool.m4,
1334 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1335 dnl with libtool.m4.
1337 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1338 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1339 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1340 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1341 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1342 acl_cv_prog_gnu_ld=yes
1344 acl_cv_prog_gnu_ld=no
1346 with_gnu_ld=$acl_cv_prog_gnu_ld
1349 dnl From libtool-1.4. Sets the variable LD.
1350 AC_DEFUN([AC_LIB_PROG_LD],
1351 [AC_ARG_WITH(gnu-ld,
1352 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1353 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1354 AC_REQUIRE([AC_PROG_CC])dnl
1355 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1356 # Prepare PATH_SEPARATOR.
1357 # The user is always right.
1358 if test "${PATH_SEPARATOR+set}" != set; then
1359 echo "#! /bin/sh" >conf$$.sh
1360 echo "exit 0" >>conf$$.sh
1362 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1370 if test "$GCC" = yes; then
1371 # Check if gcc -print-prog-name=ld gives a path.
1372 AC_MSG_CHECKING([for ld used by GCC])
1375 # gcc leaves a trailing carriage return which upsets mingw
1376 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1378 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1381 # Accept absolute paths.
1382 [[\\/]* | [A-Za-z]:[\\/]*)]
1383 [re_direlt='/[^/][^/]*/\.\./']
1384 # Canonicalize the path of ld
1385 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1386 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1387 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1389 test -z "$LD" && LD="$ac_prog"
1392 # If it fails, then pretend we aren't using GCC.
1396 # If it is relative, then search for the first ld in PATH.
1400 elif test "$with_gnu_ld" = yes; then
1401 AC_MSG_CHECKING([for GNU ld])
1403 AC_MSG_CHECKING([for non-GNU ld])
1405 AC_CACHE_VAL(acl_cv_path_LD,
1406 [if test -z "$LD"; then
1407 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1408 for ac_dir in $PATH; do
1409 test -z "$ac_dir" && ac_dir=.
1410 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1411 acl_cv_path_LD="$ac_dir/$ac_prog"
1412 # Check to see if the program is GNU ld. I'd rather use --version,
1413 # but apparently some GNU ld's only accept -v.
1414 # Break only if it was the GNU/non-GNU ld that we prefer.
1415 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1416 test "$with_gnu_ld" != no && break
1418 test "$with_gnu_ld" != yes && break
1424 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1426 LD="$acl_cv_path_LD"
1427 if test -n "$LD"; then
1432 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])