1 # generated automatically by aclocal 1.9.1 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
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 # codeset.m4 serial AM1 (gettext-0.10.40)
15 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
16 dnl This file is free software, distributed under the terms of the GNU
17 dnl General Public License. As a special exception to the GNU General
18 dnl Public License, this file may be distributed as part of a program
19 dnl that contains a configuration script generated by Autoconf, under
20 dnl the same distribution terms as the rest of that program.
22 dnl From Bruno Haible.
24 AC_DEFUN([AM_LANGINFO_CODESET],
26 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
27 [AC_TRY_LINK([#include <langinfo.h>],
28 [char* cs = nl_langinfo(CODESET);],
29 am_cv_langinfo_codeset=yes,
30 am_cv_langinfo_codeset=no)
32 if test $am_cv_langinfo_codeset = yes; then
33 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
34 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
38 # iconv.m4 serial AM4 (gettext-0.11.3)
39 dnl Copyright (C) 2000-2002 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 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
50 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
51 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
52 AC_REQUIRE([AC_LIB_RPATH])
54 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
56 AC_LIB_LINKFLAGS_BODY([iconv])
59 AC_DEFUN([AM_ICONV_LINK],
61 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
62 dnl those with the standalone portable GNU libiconv installed).
64 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
66 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
68 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
69 dnl because if the user has installed libiconv and not disabled its use
70 dnl via --without-libiconv-prefix, he wants to use it. The first
71 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
72 am_save_CPPFLAGS="$CPPFLAGS"
73 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
75 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
76 am_cv_func_iconv="no, consider installing GNU libiconv"
78 AC_TRY_LINK([#include <stdlib.h>
80 [iconv_t cd = iconv_open("","");
81 iconv(cd,NULL,NULL,NULL,NULL);
84 if test "$am_cv_func_iconv" != yes; then
86 LIBS="$LIBS $LIBICONV"
87 AC_TRY_LINK([#include <stdlib.h>
89 [iconv_t cd = iconv_open("","");
90 iconv(cd,NULL,NULL,NULL,NULL);
97 if test "$am_cv_func_iconv" = yes; then
98 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
100 if test "$am_cv_lib_iconv" = yes; then
101 AC_MSG_CHECKING([how to link with libiconv])
102 AC_MSG_RESULT([$LIBICONV])
104 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
106 CPPFLAGS="$am_save_CPPFLAGS"
117 if test "$am_cv_func_iconv" = yes; then
118 AC_MSG_CHECKING([for iconv declaration])
119 AC_CACHE_VAL(am_cv_proto_iconv, [
127 #if defined(__STDC__) || defined(__cplusplus)
128 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
132 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
133 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);"])
134 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
135 AC_MSG_RESULT([$]{ac_t:-
136 }[$]am_cv_proto_iconv)
137 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
138 [Define as const if the declaration of iconv() needs const.])
142 # lib-ld.m4 serial 3 (gettext-0.13)
143 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
144 dnl This file is free software, distributed under the terms of the GNU
145 dnl General Public License. As a special exception to the GNU General
146 dnl Public License, this file may be distributed as part of a program
147 dnl that contains a configuration script generated by Autoconf, under
148 dnl the same distribution terms as the rest of that program.
150 dnl Subroutines of libtool.m4,
151 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
154 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
155 AC_DEFUN([AC_LIB_PROG_LD_GNU],
156 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
157 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
158 case `$LD -v 2>&1 </dev/null` in
159 *GNU* | *'with BFD'*)
160 acl_cv_prog_gnu_ld=yes ;;
162 acl_cv_prog_gnu_ld=no ;;
164 with_gnu_ld=$acl_cv_prog_gnu_ld
167 dnl From libtool-1.4. Sets the variable LD.
168 AC_DEFUN([AC_LIB_PROG_LD],
170 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
171 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
172 AC_REQUIRE([AC_PROG_CC])dnl
173 AC_REQUIRE([AC_CANONICAL_HOST])dnl
174 # Prepare PATH_SEPARATOR.
175 # The user is always right.
176 if test "${PATH_SEPARATOR+set}" != set; then
177 echo "#! /bin/sh" >conf$$.sh
178 echo "exit 0" >>conf$$.sh
180 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
188 if test "$GCC" = yes; then
189 # Check if gcc -print-prog-name=ld gives a path.
190 AC_MSG_CHECKING([for ld used by GCC])
193 # gcc leaves a trailing carriage return which upsets mingw
194 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
196 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
199 # Accept absolute paths.
200 [[\\/]* | [A-Za-z]:[\\/]*)]
201 [re_direlt='/[^/][^/]*/\.\./']
202 # Canonicalize the path of ld
203 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
204 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
205 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
207 test -z "$LD" && LD="$ac_prog"
210 # If it fails, then pretend we aren't using GCC.
214 # If it is relative, then search for the first ld in PATH.
218 elif test "$with_gnu_ld" = yes; then
219 AC_MSG_CHECKING([for GNU ld])
221 AC_MSG_CHECKING([for non-GNU ld])
223 AC_CACHE_VAL(acl_cv_path_LD,
224 [if test -z "$LD"; then
225 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
226 for ac_dir in $PATH; do
227 test -z "$ac_dir" && ac_dir=.
228 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
229 acl_cv_path_LD="$ac_dir/$ac_prog"
230 # Check to see if the program is GNU ld. I'd rather use --version,
231 # but apparently some GNU ld's only accept -v.
232 # Break only if it was the GNU/non-GNU ld that we prefer.
233 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
234 *GNU* | *'with BFD'*)
235 test "$with_gnu_ld" != no && break ;;
237 test "$with_gnu_ld" != yes && break ;;
243 acl_cv_path_LD="$LD" # Let the user override the test with a path.
246 if test -n "$LD"; then
251 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
255 # lib-link.m4 serial 4 (gettext-0.12)
256 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
257 dnl This file is free software, distributed under the terms of the GNU
258 dnl General Public License. As a special exception to the GNU General
259 dnl Public License, this file may be distributed as part of a program
260 dnl that contains a configuration script generated by Autoconf, under
261 dnl the same distribution terms as the rest of that program.
263 dnl From Bruno Haible.
265 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
266 dnl the libraries corresponding to explicit and implicit dependencies.
267 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
268 dnl augments the CPPFLAGS variable.
269 AC_DEFUN([AC_LIB_LINKFLAGS],
271 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
272 AC_REQUIRE([AC_LIB_RPATH])
273 define([Name],[translit([$1],[./-], [___])])
274 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
275 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
276 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
277 AC_LIB_LINKFLAGS_BODY([$1], [$2])
278 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
279 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
280 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
282 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
283 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
284 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
285 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
287 AC_SUBST([LTLIB]NAME)
288 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
289 dnl results of this search when this library appears as a dependency.
295 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
296 dnl searches for libname and the libraries corresponding to explicit and
297 dnl implicit dependencies, together with the specified include files and
298 dnl the ability to compile and link the specified testcode. If found, it
299 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
300 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
301 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
302 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
303 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
305 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
306 AC_REQUIRE([AC_LIB_RPATH])
307 define([Name],[translit([$1],[./-], [___])])
308 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
309 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
311 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
313 AC_LIB_LINKFLAGS_BODY([$1], [$2])
315 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
316 dnl because if the user has installed lib[]Name and not disabled its use
317 dnl via --without-lib[]Name-prefix, he wants to use it.
318 ac_save_CPPFLAGS="$CPPFLAGS"
319 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
321 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
323 LIBS="$LIBS $LIB[]NAME"
324 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
327 if test "$ac_cv_lib[]Name" = yes; then
329 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
330 AC_MSG_CHECKING([how to link with lib[]$1])
331 AC_MSG_RESULT([$LIB[]NAME])
334 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
335 dnl $INC[]NAME either.
336 CPPFLAGS="$ac_save_CPPFLAGS"
340 AC_SUBST([HAVE_LIB]NAME)
342 AC_SUBST([LTLIB]NAME)
347 dnl Determine the platform dependent parameters needed to use rpath:
348 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
349 dnl hardcode_direct, hardcode_minus_L.
350 AC_DEFUN([AC_LIB_RPATH],
352 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
353 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
354 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
355 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
356 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
357 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
358 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
364 libext="$acl_cv_libext"
365 shlibext="$acl_cv_shlibext"
366 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
367 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
368 hardcode_direct="$acl_cv_hardcode_direct"
369 hardcode_minus_L="$acl_cv_hardcode_minus_L"
370 dnl Determine whether the user wants rpath handling at all.
372 [ --disable-rpath do not hardcode runtime library paths],
376 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
377 dnl the libraries corresponding to explicit and implicit dependencies.
378 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
379 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
381 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
382 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
383 dnl By default, look in $includedir and $libdir.
385 AC_LIB_WITH_FINAL_PREFIX([
386 eval additional_includedir=\"$includedir\"
387 eval additional_libdir=\"$libdir\"
389 AC_LIB_ARG_WITH([lib$1-prefix],
390 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
391 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
393 if test "X$withval" = "Xno"; then
396 if test "X$withval" = "X"; then
397 AC_LIB_WITH_FINAL_PREFIX([
398 eval additional_includedir=\"$includedir\"
399 eval additional_libdir=\"$libdir\"
402 additional_includedir="$withval/include"
403 additional_libdir="$withval/lib"
407 dnl Search the library and its dependencies in $additional_libdir and
408 dnl $LDFLAGS. Using breadth-first-seach.
414 names_already_handled=
415 names_next_round='$1 $2'
416 while test -n "$names_next_round"; do
417 names_this_round="$names_next_round"
419 for name in $names_this_round; do
421 for n in $names_already_handled; do
422 if test "$n" = "$name"; then
427 if test -z "$already_handled"; then
428 names_already_handled="$names_already_handled $name"
429 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
430 dnl or AC_LIB_HAVE_LINKFLAGS call.
431 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
432 eval value=\"\$HAVE_LIB$uppername\"
433 if test -n "$value"; then
434 if test "$value" = yes; then
435 eval value=\"\$LIB$uppername\"
436 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
437 eval value=\"\$LTLIB$uppername\"
438 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
440 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
441 dnl that this library doesn't exist. So just drop it.
445 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
446 dnl and the already constructed $LIBNAME/$LTLIBNAME.
451 if test $use_additional = yes; then
452 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
453 found_dir="$additional_libdir"
454 found_so="$additional_libdir/lib$name.$shlibext"
455 if test -f "$additional_libdir/lib$name.la"; then
456 found_la="$additional_libdir/lib$name.la"
459 if test -f "$additional_libdir/lib$name.$libext"; then
460 found_dir="$additional_libdir"
461 found_a="$additional_libdir/lib$name.$libext"
462 if test -f "$additional_libdir/lib$name.la"; then
463 found_la="$additional_libdir/lib$name.la"
468 if test "X$found_dir" = "X"; then
469 for x in $LDFLAGS $LTLIB[]NAME; do
470 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
473 dir=`echo "X$x" | sed -e 's/^X-L//'`
474 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
476 found_so="$dir/lib$name.$shlibext"
477 if test -f "$dir/lib$name.la"; then
478 found_la="$dir/lib$name.la"
481 if test -f "$dir/lib$name.$libext"; then
483 found_a="$dir/lib$name.$libext"
484 if test -f "$dir/lib$name.la"; then
485 found_la="$dir/lib$name.la"
491 if test "X$found_dir" != "X"; then
496 if test "X$found_dir" != "X"; then
497 dnl Found the library.
498 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
499 if test "X$found_so" != "X"; then
500 dnl Linking with a shared library. We attempt to hardcode its
501 dnl directory into the executable's runpath, unless it's the
502 dnl standard /usr/lib.
503 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
504 dnl No hardcoding is needed.
505 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
507 dnl Use an explicit option to hardcode DIR into the resulting
509 dnl Potentially add DIR to ltrpathdirs.
510 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
512 for x in $ltrpathdirs; do
513 if test "X$x" = "X$found_dir"; then
518 if test -z "$haveit"; then
519 ltrpathdirs="$ltrpathdirs $found_dir"
521 dnl The hardcoding into $LIBNAME is system dependent.
522 if test "$hardcode_direct" = yes; then
523 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
524 dnl resulting binary.
525 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
527 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
528 dnl Use an explicit option to hardcode DIR into the resulting
530 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
531 dnl Potentially add DIR to rpathdirs.
532 dnl The rpathdirs will be appended to $LIBNAME at the end.
534 for x in $rpathdirs; do
535 if test "X$x" = "X$found_dir"; then
540 if test -z "$haveit"; then
541 rpathdirs="$rpathdirs $found_dir"
544 dnl Rely on "-L$found_dir".
545 dnl But don't add it if it's already contained in the LDFLAGS
546 dnl or the already constructed $LIBNAME
548 for x in $LDFLAGS $LIB[]NAME; do
549 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
550 if test "X$x" = "X-L$found_dir"; then
555 if test -z "$haveit"; then
556 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
558 if test "$hardcode_minus_L" != no; then
559 dnl FIXME: Not sure whether we should use
560 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
562 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
564 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
565 dnl here, because this doesn't fit in flags passed to the
566 dnl compiler. So give up. No hardcoding. This affects only
567 dnl very old systems.
568 dnl FIXME: Not sure whether we should use
569 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
571 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
577 if test "X$found_a" != "X"; then
578 dnl Linking with a static library.
579 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
581 dnl We shouldn't come here, but anyway it's good to have a
583 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
586 dnl Assume the include files are nearby.
587 additional_includedir=
590 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
591 additional_includedir="$basedir/include"
594 if test "X$additional_includedir" != "X"; then
595 dnl Potentially add $additional_includedir to $INCNAME.
597 dnl 1. if it's the standard /usr/include,
598 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
599 dnl 3. if it's already present in $CPPFLAGS or the already
600 dnl constructed $INCNAME,
601 dnl 4. if it doesn't exist as a directory.
602 if test "X$additional_includedir" != "X/usr/include"; then
604 if test "X$additional_includedir" = "X/usr/local/include"; then
605 if test -n "$GCC"; then
611 if test -z "$haveit"; then
612 for x in $CPPFLAGS $INC[]NAME; do
613 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
614 if test "X$x" = "X-I$additional_includedir"; then
619 if test -z "$haveit"; then
620 if test -d "$additional_includedir"; then
621 dnl Really add $additional_includedir to $INCNAME.
622 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
628 dnl Look for dependencies.
629 if test -n "$found_la"; then
630 dnl Read the .la file. It defines the variables
631 dnl dlname, library_names, old_library, dependency_libs, current,
632 dnl age, revision, installed, dlopen, dlpreopen, libdir.
633 save_libdir="$libdir"
635 */* | *\\*) . "$found_la" ;;
636 *) . "./$found_la" ;;
638 libdir="$save_libdir"
639 dnl We use only dependency_libs.
640 for dep in $dependency_libs; do
643 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
644 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
646 dnl 1. if it's the standard /usr/lib,
647 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
648 dnl 3. if it's already present in $LDFLAGS or the already
649 dnl constructed $LIBNAME,
650 dnl 4. if it doesn't exist as a directory.
651 if test "X$additional_libdir" != "X/usr/lib"; then
653 if test "X$additional_libdir" = "X/usr/local/lib"; then
654 if test -n "$GCC"; then
660 if test -z "$haveit"; then
662 for x in $LDFLAGS $LIB[]NAME; do
663 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
664 if test "X$x" = "X-L$additional_libdir"; then
669 if test -z "$haveit"; then
670 if test -d "$additional_libdir"; then
671 dnl Really add $additional_libdir to $LIBNAME.
672 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
676 for x in $LDFLAGS $LTLIB[]NAME; do
677 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
678 if test "X$x" = "X-L$additional_libdir"; then
683 if test -z "$haveit"; then
684 if test -d "$additional_libdir"; then
685 dnl Really add $additional_libdir to $LTLIBNAME.
686 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
693 dir=`echo "X$dep" | sed -e 's/^X-R//'`
694 if test "$enable_rpath" != no; then
695 dnl Potentially add DIR to rpathdirs.
696 dnl The rpathdirs will be appended to $LIBNAME at the end.
698 for x in $rpathdirs; do
699 if test "X$x" = "X$dir"; then
704 if test -z "$haveit"; then
705 rpathdirs="$rpathdirs $dir"
707 dnl Potentially add DIR to ltrpathdirs.
708 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
710 for x in $ltrpathdirs; do
711 if test "X$x" = "X$dir"; then
716 if test -z "$haveit"; then
717 ltrpathdirs="$ltrpathdirs $dir"
722 dnl Handle this in the next round.
723 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
726 dnl Handle this in the next round. Throw away the .la's
727 dnl directory; it is already contained in a preceding -L
729 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
732 dnl Most likely an immediate library name.
733 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
734 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
740 dnl Didn't find the library; assume it is in the system directories
741 dnl known to the linker and runtime loader. (All the system
742 dnl directories known to the linker should also be known to the
743 dnl runtime loader, otherwise the system is severely misconfigured.)
744 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
745 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
751 if test "X$rpathdirs" != "X"; then
752 if test -n "$hardcode_libdir_separator"; then
753 dnl Weird platform: only the last -rpath option counts, the user must
754 dnl pass all path elements in one option. We can arrange that for a
755 dnl single library, but not when more than one $LIBNAMEs are used.
757 for found_dir in $rpathdirs; do
758 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
760 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
761 acl_save_libdir="$libdir"
763 eval flag=\"$hardcode_libdir_flag_spec\"
764 libdir="$acl_save_libdir"
765 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
767 dnl The -rpath options are cumulative.
768 for found_dir in $rpathdirs; do
769 acl_save_libdir="$libdir"
771 eval flag=\"$hardcode_libdir_flag_spec\"
772 libdir="$acl_save_libdir"
773 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
777 if test "X$ltrpathdirs" != "X"; then
778 dnl When using libtool, the option that works for both libraries and
779 dnl executables is -R. The -R options are cumulative.
780 for found_dir in $ltrpathdirs; do
781 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
786 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
787 dnl unless already present in VAR.
788 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
789 dnl contains two or three consecutive elements that belong together.
790 AC_DEFUN([AC_LIB_APPENDTOVAR],
792 for element in [$2]; do
795 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
796 if test "X$x" = "X$element"; then
801 if test -z "$haveit"; then
802 [$1]="${[$1]}${[$1]:+ }$element"
807 # lib-prefix.m4 serial 3 (gettext-0.13)
808 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
809 dnl This file is free software, distributed under the terms of the GNU
810 dnl General Public License. As a special exception to the GNU General
811 dnl Public License, this file may be distributed as part of a program
812 dnl that contains a configuration script generated by Autoconf, under
813 dnl the same distribution terms as the rest of that program.
815 dnl From Bruno Haible.
817 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
818 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
819 dnl require excessive bracketing.
820 ifdef([AC_HELP_STRING],
821 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
822 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
824 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
825 dnl to access previously installed libraries. The basic assumption is that
826 dnl a user will want packages to use other packages he previously installed
827 dnl with the same --prefix option.
828 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
829 dnl libraries, but is otherwise very convenient.
830 AC_DEFUN([AC_LIB_PREFIX],
832 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
833 AC_REQUIRE([AC_PROG_CC])
834 AC_REQUIRE([AC_CANONICAL_HOST])
835 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
836 dnl By default, look in $includedir and $libdir.
838 AC_LIB_WITH_FINAL_PREFIX([
839 eval additional_includedir=\"$includedir\"
840 eval additional_libdir=\"$libdir\"
842 AC_LIB_ARG_WITH([lib-prefix],
843 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
844 --without-lib-prefix don't search for libraries in includedir and libdir],
846 if test "X$withval" = "Xno"; then
849 if test "X$withval" = "X"; then
850 AC_LIB_WITH_FINAL_PREFIX([
851 eval additional_includedir=\"$includedir\"
852 eval additional_libdir=\"$libdir\"
855 additional_includedir="$withval/include"
856 additional_libdir="$withval/lib"
860 if test $use_additional = yes; then
861 dnl Potentially add $additional_includedir to $CPPFLAGS.
863 dnl 1. if it's the standard /usr/include,
864 dnl 2. if it's already present in $CPPFLAGS,
865 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
866 dnl 4. if it doesn't exist as a directory.
867 if test "X$additional_includedir" != "X/usr/include"; then
869 for x in $CPPFLAGS; do
870 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
871 if test "X$x" = "X-I$additional_includedir"; then
876 if test -z "$haveit"; then
877 if test "X$additional_includedir" = "X/usr/local/include"; then
878 if test -n "$GCC"; then
884 if test -z "$haveit"; then
885 if test -d "$additional_includedir"; then
886 dnl Really add $additional_includedir to $CPPFLAGS.
887 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
892 dnl Potentially add $additional_libdir to $LDFLAGS.
894 dnl 1. if it's the standard /usr/lib,
895 dnl 2. if it's already present in $LDFLAGS,
896 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
897 dnl 4. if it doesn't exist as a directory.
898 if test "X$additional_libdir" != "X/usr/lib"; then
900 for x in $LDFLAGS; do
901 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
902 if test "X$x" = "X-L$additional_libdir"; then
907 if test -z "$haveit"; then
908 if test "X$additional_libdir" = "X/usr/local/lib"; then
909 if test -n "$GCC"; then
915 if test -z "$haveit"; then
916 if test -d "$additional_libdir"; then
917 dnl Really add $additional_libdir to $LDFLAGS.
918 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
926 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
927 dnl acl_final_exec_prefix, containing the values to which $prefix and
928 dnl $exec_prefix will expand at the end of the configure script.
929 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
931 dnl Unfortunately, prefix and exec_prefix get only finally determined
932 dnl at the end of configure.
933 if test "X$prefix" = "XNONE"; then
934 acl_final_prefix="$ac_default_prefix"
936 acl_final_prefix="$prefix"
938 if test "X$exec_prefix" = "XNONE"; then
939 acl_final_exec_prefix='${prefix}'
941 acl_final_exec_prefix="$exec_prefix"
943 acl_save_prefix="$prefix"
944 prefix="$acl_final_prefix"
945 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
946 prefix="$acl_save_prefix"
949 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
950 dnl variables prefix and exec_prefix bound to the values they will have
951 dnl at the end of the configure script.
952 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
954 acl_save_prefix="$prefix"
955 prefix="$acl_final_prefix"
956 acl_save_exec_prefix="$exec_prefix"
957 exec_prefix="$acl_final_exec_prefix"
959 exec_prefix="$acl_save_exec_prefix"
960 prefix="$acl_save_prefix"
963 m4_include([../config/acx.m4])
964 m4_include([../config/gettext.m4])