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 AC_DEFUN(AC_CHECK_LIB_LOC,
14 [AC_MSG_CHECKING([for lib$2 in $1])
15 ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
16 AC_CACHE_VAL(ac_cv_lib_loc_$ac_lib_var,
18 LIBS="-L$1 -l$2 $6 $LIBS"
20 [/* We use char because int might match the return type of a gcc2
21 builtin and then its argument prototype would still apply. */
25 eval "ac_cv_lib_loc_$ac_lib_var=yes",
26 eval "ac_cv_lib_loc_$ac_lib_var=no")
29 if eval "test \"`echo '$ac_cv_lib_loc_'$ac_lib_var`\" = yes"; then
32 [LIBS="-L$1 -l$2 $LIBS"
41 # lib-prefix.m4 serial 3 (gettext-0.13)
42 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
43 dnl This file is free software, distributed under the terms of the GNU
44 dnl General Public License. As a special exception to the GNU General
45 dnl Public License, this file may be distributed as part of a program
46 dnl that contains a configuration script generated by Autoconf, under
47 dnl the same distribution terms as the rest of that program.
49 dnl From Bruno Haible.
51 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
52 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
53 dnl require excessive bracketing.
54 ifdef([AC_HELP_STRING],
55 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
56 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
58 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
59 dnl to access previously installed libraries. The basic assumption is that
60 dnl a user will want packages to use other packages he previously installed
61 dnl with the same --prefix option.
62 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
63 dnl libraries, but is otherwise very convenient.
64 AC_DEFUN([AC_LIB_PREFIX],
66 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
67 AC_REQUIRE([AC_PROG_CC])
68 AC_REQUIRE([AC_CANONICAL_HOST])
69 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
70 dnl By default, look in $includedir and $libdir.
72 AC_LIB_WITH_FINAL_PREFIX([
73 eval additional_includedir=\"$includedir\"
74 eval additional_libdir=\"$libdir\"
76 AC_LIB_ARG_WITH([lib-prefix],
77 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
78 --without-lib-prefix don't search for libraries in includedir and libdir],
80 if test "X$withval" = "Xno"; then
83 if test "X$withval" = "X"; then
84 AC_LIB_WITH_FINAL_PREFIX([
85 eval additional_includedir=\"$includedir\"
86 eval additional_libdir=\"$libdir\"
89 additional_includedir="$withval/include"
90 additional_libdir="$withval/lib"
94 if test $use_additional = yes; then
95 dnl Potentially add $additional_includedir to $CPPFLAGS.
97 dnl 1. if it's the standard /usr/include,
98 dnl 2. if it's already present in $CPPFLAGS,
99 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
100 dnl 4. if it doesn't exist as a directory.
101 if test "X$additional_includedir" != "X/usr/include"; then
103 for x in $CPPFLAGS; do
104 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
105 if test "X$x" = "X-I$additional_includedir"; then
110 if test -z "$haveit"; then
111 if test "X$additional_includedir" = "X/usr/local/include"; then
112 if test -n "$GCC"; then
118 if test -z "$haveit"; then
119 if test -d "$additional_includedir"; then
120 dnl Really add $additional_includedir to $CPPFLAGS.
121 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
126 dnl Potentially add $additional_libdir to $LDFLAGS.
128 dnl 1. if it's the standard /usr/lib,
129 dnl 2. if it's already present in $LDFLAGS,
130 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
131 dnl 4. if it doesn't exist as a directory.
132 if test "X$additional_libdir" != "X/usr/lib"; then
134 for x in $LDFLAGS; do
135 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
136 if test "X$x" = "X-L$additional_libdir"; then
141 if test -z "$haveit"; then
142 if test "X$additional_libdir" = "X/usr/local/lib"; then
143 if test -n "$GCC"; then
149 if test -z "$haveit"; then
150 if test -d "$additional_libdir"; then
151 dnl Really add $additional_libdir to $LDFLAGS.
152 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
160 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
161 dnl acl_final_exec_prefix, containing the values to which $prefix and
162 dnl $exec_prefix will expand at the end of the configure script.
163 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
165 dnl Unfortunately, prefix and exec_prefix get only finally determined
166 dnl at the end of configure.
167 if test "X$prefix" = "XNONE"; then
168 acl_final_prefix="$ac_default_prefix"
170 acl_final_prefix="$prefix"
172 if test "X$exec_prefix" = "XNONE"; then
173 acl_final_exec_prefix='${prefix}'
175 acl_final_exec_prefix="$exec_prefix"
177 acl_save_prefix="$prefix"
178 prefix="$acl_final_prefix"
179 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
180 prefix="$acl_save_prefix"
183 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
184 dnl variables prefix and exec_prefix bound to the values they will have
185 dnl at the end of the configure script.
186 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
188 acl_save_prefix="$prefix"
189 prefix="$acl_final_prefix"
190 acl_save_exec_prefix="$exec_prefix"
191 exec_prefix="$acl_final_exec_prefix"
193 exec_prefix="$acl_save_exec_prefix"
194 prefix="$acl_save_prefix"
197 # lib-link.m4 serial 4 (gettext-0.12)
198 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
199 dnl This file is free software, distributed under the terms of the GNU
200 dnl General Public License. As a special exception to the GNU General
201 dnl Public License, this file may be distributed as part of a program
202 dnl that contains a configuration script generated by Autoconf, under
203 dnl the same distribution terms as the rest of that program.
205 dnl From Bruno Haible.
207 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
208 dnl the libraries corresponding to explicit and implicit dependencies.
209 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
210 dnl augments the CPPFLAGS variable.
211 AC_DEFUN([AC_LIB_LINKFLAGS],
213 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
214 AC_REQUIRE([AC_LIB_RPATH])
215 define([Name],[translit([$1],[./-], [___])])
216 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
217 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
218 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
219 AC_LIB_LINKFLAGS_BODY([$1], [$2])
220 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
221 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
222 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
224 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
225 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
226 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
227 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
229 AC_SUBST([LTLIB]NAME)
230 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
231 dnl results of this search when this library appears as a dependency.
237 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
238 dnl searches for libname and the libraries corresponding to explicit and
239 dnl implicit dependencies, together with the specified include files and
240 dnl the ability to compile and link the specified testcode. If found, it
241 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
242 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
243 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
244 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
245 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
247 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
248 AC_REQUIRE([AC_LIB_RPATH])
249 define([Name],[translit([$1],[./-], [___])])
250 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
251 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
253 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
255 AC_LIB_LINKFLAGS_BODY([$1], [$2])
257 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
258 dnl because if the user has installed lib[]Name and not disabled its use
259 dnl via --without-lib[]Name-prefix, he wants to use it.
260 ac_save_CPPFLAGS="$CPPFLAGS"
261 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
263 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
265 LIBS="$LIBS $LIB[]NAME"
266 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
269 if test "$ac_cv_lib[]Name" = yes; then
271 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
272 AC_MSG_CHECKING([how to link with lib[]$1])
273 AC_MSG_RESULT([$LIB[]NAME])
276 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
277 dnl $INC[]NAME either.
278 CPPFLAGS="$ac_save_CPPFLAGS"
282 AC_SUBST([HAVE_LIB]NAME)
284 AC_SUBST([LTLIB]NAME)
289 dnl Determine the platform dependent parameters needed to use rpath:
290 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
291 dnl hardcode_direct, hardcode_minus_L.
292 AC_DEFUN([AC_LIB_RPATH],
294 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
295 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
296 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
297 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
298 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
299 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
300 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
306 libext="$acl_cv_libext"
307 shlibext="$acl_cv_shlibext"
308 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
309 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
310 hardcode_direct="$acl_cv_hardcode_direct"
311 hardcode_minus_L="$acl_cv_hardcode_minus_L"
312 dnl Determine whether the user wants rpath handling at all.
314 [ --disable-rpath do not hardcode runtime library paths],
318 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
319 dnl the libraries corresponding to explicit and implicit dependencies.
320 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
321 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
323 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
324 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
325 dnl By default, look in $includedir and $libdir.
327 AC_LIB_WITH_FINAL_PREFIX([
328 eval additional_includedir=\"$includedir\"
329 eval additional_libdir=\"$libdir\"
331 AC_LIB_ARG_WITH([lib$1-prefix],
332 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
333 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
335 if test "X$withval" = "Xno"; then
338 if test "X$withval" = "X"; then
339 AC_LIB_WITH_FINAL_PREFIX([
340 eval additional_includedir=\"$includedir\"
341 eval additional_libdir=\"$libdir\"
344 additional_includedir="$withval/include"
345 additional_libdir="$withval/lib"
349 dnl Search the library and its dependencies in $additional_libdir and
350 dnl $LDFLAGS. Using breadth-first-seach.
356 names_already_handled=
357 names_next_round='$1 $2'
358 while test -n "$names_next_round"; do
359 names_this_round="$names_next_round"
361 for name in $names_this_round; do
363 for n in $names_already_handled; do
364 if test "$n" = "$name"; then
369 if test -z "$already_handled"; then
370 names_already_handled="$names_already_handled $name"
371 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
372 dnl or AC_LIB_HAVE_LINKFLAGS call.
373 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
374 eval value=\"\$HAVE_LIB$uppername\"
375 if test -n "$value"; then
376 if test "$value" = yes; then
377 eval value=\"\$LIB$uppername\"
378 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
379 eval value=\"\$LTLIB$uppername\"
380 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
382 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
383 dnl that this library doesn't exist. So just drop it.
387 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
388 dnl and the already constructed $LIBNAME/$LTLIBNAME.
393 if test $use_additional = yes; then
394 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
395 found_dir="$additional_libdir"
396 found_so="$additional_libdir/lib$name.$shlibext"
397 if test -f "$additional_libdir/lib$name.la"; then
398 found_la="$additional_libdir/lib$name.la"
401 if test -f "$additional_libdir/lib$name.$libext"; then
402 found_dir="$additional_libdir"
403 found_a="$additional_libdir/lib$name.$libext"
404 if test -f "$additional_libdir/lib$name.la"; then
405 found_la="$additional_libdir/lib$name.la"
410 if test "X$found_dir" = "X"; then
411 for x in $LDFLAGS $LTLIB[]NAME; do
412 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
415 dir=`echo "X$x" | sed -e 's/^X-L//'`
416 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
418 found_so="$dir/lib$name.$shlibext"
419 if test -f "$dir/lib$name.la"; then
420 found_la="$dir/lib$name.la"
423 if test -f "$dir/lib$name.$libext"; then
425 found_a="$dir/lib$name.$libext"
426 if test -f "$dir/lib$name.la"; then
427 found_la="$dir/lib$name.la"
433 if test "X$found_dir" != "X"; then
438 if test "X$found_dir" != "X"; then
439 dnl Found the library.
440 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
441 if test "X$found_so" != "X"; then
442 dnl Linking with a shared library. We attempt to hardcode its
443 dnl directory into the executable's runpath, unless it's the
444 dnl standard /usr/lib.
445 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
446 dnl No hardcoding is needed.
447 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
449 dnl Use an explicit option to hardcode DIR into the resulting
451 dnl Potentially add DIR to ltrpathdirs.
452 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
454 for x in $ltrpathdirs; do
455 if test "X$x" = "X$found_dir"; then
460 if test -z "$haveit"; then
461 ltrpathdirs="$ltrpathdirs $found_dir"
463 dnl The hardcoding into $LIBNAME is system dependent.
464 if test "$hardcode_direct" = yes; then
465 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
466 dnl resulting binary.
467 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
469 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
470 dnl Use an explicit option to hardcode DIR into the resulting
472 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
473 dnl Potentially add DIR to rpathdirs.
474 dnl The rpathdirs will be appended to $LIBNAME at the end.
476 for x in $rpathdirs; do
477 if test "X$x" = "X$found_dir"; then
482 if test -z "$haveit"; then
483 rpathdirs="$rpathdirs $found_dir"
486 dnl Rely on "-L$found_dir".
487 dnl But don't add it if it's already contained in the LDFLAGS
488 dnl or the already constructed $LIBNAME
490 for x in $LDFLAGS $LIB[]NAME; do
491 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
492 if test "X$x" = "X-L$found_dir"; then
497 if test -z "$haveit"; then
498 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
500 if test "$hardcode_minus_L" != no; then
501 dnl FIXME: Not sure whether we should use
502 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
504 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
506 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
507 dnl here, because this doesn't fit in flags passed to the
508 dnl compiler. So give up. No hardcoding. This affects only
509 dnl very old systems.
510 dnl FIXME: Not sure whether we should use
511 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
513 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
519 if test "X$found_a" != "X"; then
520 dnl Linking with a static library.
521 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
523 dnl We shouldn't come here, but anyway it's good to have a
525 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
528 dnl Assume the include files are nearby.
529 additional_includedir=
532 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
533 additional_includedir="$basedir/include"
536 if test "X$additional_includedir" != "X"; then
537 dnl Potentially add $additional_includedir to $INCNAME.
539 dnl 1. if it's the standard /usr/include,
540 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
541 dnl 3. if it's already present in $CPPFLAGS or the already
542 dnl constructed $INCNAME,
543 dnl 4. if it doesn't exist as a directory.
544 if test "X$additional_includedir" != "X/usr/include"; then
546 if test "X$additional_includedir" = "X/usr/local/include"; then
547 if test -n "$GCC"; then
553 if test -z "$haveit"; then
554 for x in $CPPFLAGS $INC[]NAME; do
555 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
556 if test "X$x" = "X-I$additional_includedir"; then
561 if test -z "$haveit"; then
562 if test -d "$additional_includedir"; then
563 dnl Really add $additional_includedir to $INCNAME.
564 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
570 dnl Look for dependencies.
571 if test -n "$found_la"; then
572 dnl Read the .la file. It defines the variables
573 dnl dlname, library_names, old_library, dependency_libs, current,
574 dnl age, revision, installed, dlopen, dlpreopen, libdir.
575 save_libdir="$libdir"
577 */* | *\\*) . "$found_la" ;;
578 *) . "./$found_la" ;;
580 libdir="$save_libdir"
581 dnl We use only dependency_libs.
582 for dep in $dependency_libs; do
585 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
586 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
588 dnl 1. if it's the standard /usr/lib,
589 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
590 dnl 3. if it's already present in $LDFLAGS or the already
591 dnl constructed $LIBNAME,
592 dnl 4. if it doesn't exist as a directory.
593 if test "X$additional_libdir" != "X/usr/lib"; then
595 if test "X$additional_libdir" = "X/usr/local/lib"; then
596 if test -n "$GCC"; then
602 if test -z "$haveit"; then
604 for x in $LDFLAGS $LIB[]NAME; do
605 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
606 if test "X$x" = "X-L$additional_libdir"; then
611 if test -z "$haveit"; then
612 if test -d "$additional_libdir"; then
613 dnl Really add $additional_libdir to $LIBNAME.
614 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
618 for x in $LDFLAGS $LTLIB[]NAME; do
619 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
620 if test "X$x" = "X-L$additional_libdir"; then
625 if test -z "$haveit"; then
626 if test -d "$additional_libdir"; then
627 dnl Really add $additional_libdir to $LTLIBNAME.
628 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
635 dir=`echo "X$dep" | sed -e 's/^X-R//'`
636 if test "$enable_rpath" != no; then
637 dnl Potentially add DIR to rpathdirs.
638 dnl The rpathdirs will be appended to $LIBNAME at the end.
640 for x in $rpathdirs; do
641 if test "X$x" = "X$dir"; then
646 if test -z "$haveit"; then
647 rpathdirs="$rpathdirs $dir"
649 dnl Potentially add DIR to ltrpathdirs.
650 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
652 for x in $ltrpathdirs; do
653 if test "X$x" = "X$dir"; then
658 if test -z "$haveit"; then
659 ltrpathdirs="$ltrpathdirs $dir"
664 dnl Handle this in the next round.
665 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
668 dnl Handle this in the next round. Throw away the .la's
669 dnl directory; it is already contained in a preceding -L
671 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
674 dnl Most likely an immediate library name.
675 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
676 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
682 dnl Didn't find the library; assume it is in the system directories
683 dnl known to the linker and runtime loader. (All the system
684 dnl directories known to the linker should also be known to the
685 dnl runtime loader, otherwise the system is severely misconfigured.)
686 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
687 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
693 if test "X$rpathdirs" != "X"; then
694 if test -n "$hardcode_libdir_separator"; then
695 dnl Weird platform: only the last -rpath option counts, the user must
696 dnl pass all path elements in one option. We can arrange that for a
697 dnl single library, but not when more than one $LIBNAMEs are used.
699 for found_dir in $rpathdirs; do
700 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
702 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
703 acl_save_libdir="$libdir"
705 eval flag=\"$hardcode_libdir_flag_spec\"
706 libdir="$acl_save_libdir"
707 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
709 dnl The -rpath options are cumulative.
710 for found_dir in $rpathdirs; do
711 acl_save_libdir="$libdir"
713 eval flag=\"$hardcode_libdir_flag_spec\"
714 libdir="$acl_save_libdir"
715 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
719 if test "X$ltrpathdirs" != "X"; then
720 dnl When using libtool, the option that works for both libraries and
721 dnl executables is -R. The -R options are cumulative.
722 for found_dir in $ltrpathdirs; do
723 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
728 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
729 dnl unless already present in VAR.
730 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
731 dnl contains two or three consecutive elements that belong together.
732 AC_DEFUN([AC_LIB_APPENDTOVAR],
734 for element in [$2]; do
737 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
738 if test "X$x" = "X$element"; then
743 if test -z "$haveit"; then
744 [$1]="${[$1]}${[$1]:+ }$element"
749 # lib-ld.m4 serial 3 (gettext-0.13)
750 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
751 dnl This file is free software, distributed under the terms of the GNU
752 dnl General Public License. As a special exception to the GNU General
753 dnl Public License, this file may be distributed as part of a program
754 dnl that contains a configuration script generated by Autoconf, under
755 dnl the same distribution terms as the rest of that program.
757 dnl Subroutines of libtool.m4,
758 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
761 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
762 AC_DEFUN([AC_LIB_PROG_LD_GNU],
763 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
764 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
765 case `$LD -v 2>&1 </dev/null` in
766 *GNU* | *'with BFD'*)
767 acl_cv_prog_gnu_ld=yes ;;
769 acl_cv_prog_gnu_ld=no ;;
771 with_gnu_ld=$acl_cv_prog_gnu_ld
774 dnl From libtool-1.4. Sets the variable LD.
775 AC_DEFUN([AC_LIB_PROG_LD],
777 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
778 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
779 AC_REQUIRE([AC_PROG_CC])dnl
780 AC_REQUIRE([AC_CANONICAL_HOST])dnl
781 # Prepare PATH_SEPARATOR.
782 # The user is always right.
783 if test "${PATH_SEPARATOR+set}" != set; then
784 echo "#! /bin/sh" >conf$$.sh
785 echo "exit 0" >>conf$$.sh
787 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
795 if test "$GCC" = yes; then
796 # Check if gcc -print-prog-name=ld gives a path.
797 AC_MSG_CHECKING([for ld used by GCC])
800 # gcc leaves a trailing carriage return which upsets mingw
801 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
803 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
806 # Accept absolute paths.
807 [[\\/]* | [A-Za-z]:[\\/]*)]
808 [re_direlt='/[^/][^/]*/\.\./']
809 # Canonicalize the path of ld
810 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
811 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
812 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
814 test -z "$LD" && LD="$ac_prog"
817 # If it fails, then pretend we aren't using GCC.
821 # If it is relative, then search for the first ld in PATH.
825 elif test "$with_gnu_ld" = yes; then
826 AC_MSG_CHECKING([for GNU ld])
828 AC_MSG_CHECKING([for non-GNU ld])
830 AC_CACHE_VAL(acl_cv_path_LD,
831 [if test -z "$LD"; then
832 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
833 for ac_dir in $PATH; do
834 test -z "$ac_dir" && ac_dir=.
835 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
836 acl_cv_path_LD="$ac_dir/$ac_prog"
837 # Check to see if the program is GNU ld. I'd rather use --version,
838 # but apparently some GNU ld's only accept -v.
839 # Break only if it was the GNU/non-GNU ld that we prefer.
840 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
841 *GNU* | *'with BFD'*)
842 test "$with_gnu_ld" != no && break ;;
844 test "$with_gnu_ld" != yes && break ;;
850 acl_cv_path_LD="$LD" # Let the user override the test with a path.
853 if test -n "$LD"; then
858 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
862 # Like AC_CONFIG_HEADER, but automatically create stamp file.
864 AC_DEFUN([AM_CONFIG_HEADER],
866 AC_CONFIG_HEADER([$1])
867 dnl When config.status generates a header, we must update the stamp-h file.
868 dnl This file resides in the same directory as the config header
869 dnl that is generated. We must strip everything past the first ":",
870 dnl and everything past the last "/".
871 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
872 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
873 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
875 for am_file in <<$1>>; do
876 case " <<$>>CONFIG_HEADERS " in
877 *" <<$>>am_file "*<<)>>
878 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
881 am_indx=`expr "<<$>>am_indx" + 1`
885 # Do all the work for Automake. This macro actually does too much --
886 # some checks are only needed if your package does certain things.
887 # But this isn't really a big deal.
892 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
894 AC_DEFUN([AM_INIT_AUTOMAKE],
895 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
896 AC_REQUIRE([AC_PROG_INSTALL])
901 dnl test to see if srcdir already configured
902 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
903 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
906 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
907 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
908 AC_REQUIRE([AM_SANITY_CHECK])
909 AC_REQUIRE([AC_ARG_PROGRAM])
910 dnl FIXME This is truly gross.
911 missing_dir=`cd $ac_aux_dir && pwd`
912 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
913 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
914 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
915 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
916 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
917 AC_REQUIRE([AC_PROG_MAKE_SET])])
919 # Copyright 2002 Free Software Foundation, Inc.
921 # This program is free software; you can redistribute it and/or modify
922 # it under the terms of the GNU General Public License as published by
923 # the Free Software Foundation; either version 2, or (at your option)
926 # This program is distributed in the hope that it will be useful,
927 # but WITHOUT ANY WARRANTY; without even the implied warranty of
928 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
929 # GNU General Public License for more details.
931 # You should have received a copy of the GNU General Public License
932 # along with this program; if not, write to the Free Software
933 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
935 # AM_AUTOMAKE_VERSION(VERSION)
936 # ----------------------------
937 # Automake X.Y traces this macro to ensure aclocal.m4 has been
938 # generated from the m4 files accompanying Automake X.Y.
939 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
941 # AM_SET_CURRENT_AUTOMAKE_VERSION
942 # -------------------------------
943 # Call AM_AUTOMAKE_VERSION so it can be traced.
944 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
945 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
946 [AM_AUTOMAKE_VERSION([1.4-p6])])
949 # Check to make sure that the build environment is sane.
952 AC_DEFUN([AM_SANITY_CHECK],
953 [AC_MSG_CHECKING([whether build environment is sane])
956 echo timestamp > conftestfile
957 # Do `set' in a subshell so we don't clobber the current shell's
958 # arguments. Must try -L first in case configure is actually a
959 # symlink; some systems play weird games with the mod time of symlinks
960 # (eg FreeBSD returns the mod time of the symlink's containing
963 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
964 if test "[$]*" = "X"; then
966 set X `ls -t $srcdir/configure conftestfile`
968 if test "[$]*" != "X $srcdir/configure conftestfile" \
969 && test "[$]*" != "X conftestfile $srcdir/configure"; then
971 # If neither matched, then we have a broken ls. This can happen
972 # if, for instance, CONFIG_SHELL is bash and it inherits a
973 # broken ls alias from the environment. This has actually
974 # happened. Such a system could not be considered "sane".
975 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
976 alias in your environment])
979 test "[$]2" = conftestfile
985 AC_MSG_ERROR([newly created file is older than distributed files!
986 Check your system clock])
991 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
992 dnl The program must properly implement --version.
993 AC_DEFUN([AM_MISSING_PROG],
994 [AC_MSG_CHECKING(for working $2)
995 # Run test in a subshell; some versions of sh will print an error if
996 # an executable is not found, even if stderr is redirected.
997 # Redirect stdin to placate older versions of autoconf. Sigh.
998 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1000 AC_MSG_RESULT(found)
1003 AC_MSG_RESULT(missing)