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 # m m mm mmm .----------. .---------------------. mmm mm m m
14 # 8 8 88 888 | .--------` | .------------------` 888 88 8 8
15 # 8 8 88 888 | ```````|`V```````| |``||``|`````| 888 88 8 8
16 # 8 8 88 888 `------ | | [] | |``````|| | [] | 888 88 8 8
17 # 8 8 88 888 |`````` | | | ````|```` | | 888 88 8 8
18 # ` ` `` ``` ``````````````> |````````````| |`` ``` `` ` `
19 # ==============` `---`
20 # L A B O R A T O R I E S
22 #This file is part of Hacker Radio Rec.
24 #Hacker Radio Rec is free software: you can redistribute it and/or
25 #modify it under the terms of the GNU General Public License as
26 #published by the Free Software Foundation, either version 3 of
27 #the License or (at your option) any later version.
29 #Hacker Radio Rec is distributed in the hope that it will be
30 #useful, but WITHOUT ANY WARRANTY; without even the implied
31 #warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
32 #See the GNU General Public License for more details.
34 # Copyright (C) 2009, Thea DeSilva
35 # You can find a copy of GNU General Public License in COPYING
46 AC_DEFUN(HRR_CHECK_LIB, [
52 /usr/unsupported/lib \
61 /usr/local/X11R5/lib \
69 /usr/local/X11R6/lib \
73 AC_SEARCH_LIBS($2,$1, HRR_SWLIB=-l$1, HRR_SWLIB="nope")
74 if test "$HRR_SWLIB" = "nope"; then
75 printf "searching for %s..." $1
77 for i in $LIB_SEARCH ; do
78 if test -r $i/lib$1.a; then
84 if test "$HRR_SWLIB" = "nope" ; then
93 LDFLAGS=$LDFLAGS\ $HRR_SWDIR
94 LIBS=$LIBS\ $HRR_SWLIB
100 # 2 - sub directory e.g. SDL/
103 AC_DEFUN(HRR_CHECK_HEAD, [
104 HEADER_SEARCH="/include \
106 /usr/unsupported/include \
112 /usr/openwin/include \
115 /usr/local/X11R5/include \
123 /usr/local/X11R6/include \
124 $HOME/local/include "
127 printf "checking for %s... " $1
129 AC_TRY_CPP([#include <$2$1>], , HRR_INC="nope")
130 if test "$HRR_INC" = "nope"; then
131 for i in $HEADER_SEARCH; do
132 if test -r $i/$2$1; then
133 HRR_INC=\ -I$i\ -I$i/$2
137 if test "$HRR_INC" = "nope"; then
143 CFLAGS=$CFLAGS\ $HRR_INC
144 CPPFLAGS=$CPPFLAGS\ $HRR_INC
149 # lib-prefix.m4 serial 5 (gettext-0.15)
150 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
151 dnl This file is free software; the Free Software Foundation
152 dnl gives unlimited permission to copy and/or distribute it,
153 dnl with or without modifications, as long as this notice is preserved.
155 dnl From Bruno Haible.
157 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
158 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
159 dnl require excessive bracketing.
160 ifdef([AC_HELP_STRING],
161 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
162 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
164 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
165 dnl to access previously installed libraries. The basic assumption is that
166 dnl a user will want packages to use other packages he previously installed
167 dnl with the same --prefix option.
168 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
169 dnl libraries, but is otherwise very convenient.
170 AC_DEFUN([AC_LIB_PREFIX],
172 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
173 AC_REQUIRE([AC_PROG_CC])
174 AC_REQUIRE([AC_CANONICAL_HOST])
175 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
176 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
177 dnl By default, look in $includedir and $libdir.
179 AC_LIB_WITH_FINAL_PREFIX([
180 eval additional_includedir=\"$includedir\"
181 eval additional_libdir=\"$libdir\"
183 AC_LIB_ARG_WITH([lib-prefix],
184 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
185 --without-lib-prefix don't search for libraries in includedir and libdir],
187 if test "X$withval" = "Xno"; then
190 if test "X$withval" = "X"; then
191 AC_LIB_WITH_FINAL_PREFIX([
192 eval additional_includedir=\"$includedir\"
193 eval additional_libdir=\"$libdir\"
196 additional_includedir="$withval/include"
197 additional_libdir="$withval/$acl_libdirstem"
201 if test $use_additional = yes; then
202 dnl Potentially add $additional_includedir to $CPPFLAGS.
204 dnl 1. if it's the standard /usr/include,
205 dnl 2. if it's already present in $CPPFLAGS,
206 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
207 dnl 4. if it doesn't exist as a directory.
208 if test "X$additional_includedir" != "X/usr/include"; then
210 for x in $CPPFLAGS; do
211 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
212 if test "X$x" = "X-I$additional_includedir"; then
217 if test -z "$haveit"; then
218 if test "X$additional_includedir" = "X/usr/local/include"; then
219 if test -n "$GCC"; then
221 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
225 if test -z "$haveit"; then
226 if test -d "$additional_includedir"; then
227 dnl Really add $additional_includedir to $CPPFLAGS.
228 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
233 dnl Potentially add $additional_libdir to $LDFLAGS.
235 dnl 1. if it's the standard /usr/lib,
236 dnl 2. if it's already present in $LDFLAGS,
237 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
238 dnl 4. if it doesn't exist as a directory.
239 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
241 for x in $LDFLAGS; do
242 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
243 if test "X$x" = "X-L$additional_libdir"; then
248 if test -z "$haveit"; then
249 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
250 if test -n "$GCC"; then
256 if test -z "$haveit"; then
257 if test -d "$additional_libdir"; then
258 dnl Really add $additional_libdir to $LDFLAGS.
259 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
267 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
268 dnl acl_final_exec_prefix, containing the values to which $prefix and
269 dnl $exec_prefix will expand at the end of the configure script.
270 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
272 dnl Unfortunately, prefix and exec_prefix get only finally determined
273 dnl at the end of configure.
274 if test "X$prefix" = "XNONE"; then
275 acl_final_prefix="$ac_default_prefix"
277 acl_final_prefix="$prefix"
279 if test "X$exec_prefix" = "XNONE"; then
280 acl_final_exec_prefix='${prefix}'
282 acl_final_exec_prefix="$exec_prefix"
284 acl_save_prefix="$prefix"
285 prefix="$acl_final_prefix"
286 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
287 prefix="$acl_save_prefix"
290 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
291 dnl variables prefix and exec_prefix bound to the values they will have
292 dnl at the end of the configure script.
293 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
295 acl_save_prefix="$prefix"
296 prefix="$acl_final_prefix"
297 acl_save_exec_prefix="$exec_prefix"
298 exec_prefix="$acl_final_exec_prefix"
300 exec_prefix="$acl_save_exec_prefix"
301 prefix="$acl_save_prefix"
304 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
305 dnl the basename of the libdir, either "lib" or "lib64".
306 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
308 dnl There is no formal standard regarding lib and lib64. The current
309 dnl practice is that on a system supporting 32-bit and 64-bit instruction
310 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
311 dnl libraries go under $prefix/lib. We determine the compiler's default
312 dnl mode by looking at the compiler's library search path. If at least
313 dnl of its elements ends in /lib64 or points to a directory whose absolute
314 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
315 dnl default, namely "lib".
317 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
318 if test -n "$searchpath"; then
319 acl_save_IFS="${IFS= }"; IFS=":"
320 for searchdir in $searchpath; do
321 if test -d "$searchdir"; then
323 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
324 *) searchdir=`cd "$searchdir" && pwd`
326 */lib64 ) acl_libdirstem=lib64 ;;
335 # lib-link.m4 serial 13 (gettext-0.17)
336 dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
337 dnl This file is free software; the Free Software Foundation
338 dnl gives unlimited permission to copy and/or distribute it,
339 dnl with or without modifications, as long as this notice is preserved.
341 dnl From Bruno Haible.
345 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
346 dnl the libraries corresponding to explicit and implicit dependencies.
347 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
348 dnl augments the CPPFLAGS variable.
349 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
350 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
351 AC_DEFUN([AC_LIB_LINKFLAGS],
353 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
354 AC_REQUIRE([AC_LIB_RPATH])
355 define([Name],[translit([$1],[./-], [___])])
356 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
357 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
358 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
359 AC_LIB_LINKFLAGS_BODY([$1], [$2])
360 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
361 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
362 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
363 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
365 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
366 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
367 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
368 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
369 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
371 AC_SUBST([LTLIB]NAME)
372 AC_SUBST([LIB]NAME[_PREFIX])
373 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
374 dnl results of this search when this library appears as a dependency.
380 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
381 dnl searches for libname and the libraries corresponding to explicit and
382 dnl implicit dependencies, together with the specified include files and
383 dnl the ability to compile and link the specified testcode. If found, it
384 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
385 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
386 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
387 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
388 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
389 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
390 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
392 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
393 AC_REQUIRE([AC_LIB_RPATH])
394 define([Name],[translit([$1],[./-], [___])])
395 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
396 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
398 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
400 AC_LIB_LINKFLAGS_BODY([$1], [$2])
402 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
403 dnl because if the user has installed lib[]Name and not disabled its use
404 dnl via --without-lib[]Name-prefix, he wants to use it.
405 ac_save_CPPFLAGS="$CPPFLAGS"
406 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
408 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
410 LIBS="$LIBS $LIB[]NAME"
411 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
414 if test "$ac_cv_lib[]Name" = yes; then
416 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
417 AC_MSG_CHECKING([how to link with lib[]$1])
418 AC_MSG_RESULT([$LIB[]NAME])
421 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
422 dnl $INC[]NAME either.
423 CPPFLAGS="$ac_save_CPPFLAGS"
428 AC_SUBST([HAVE_LIB]NAME)
430 AC_SUBST([LTLIB]NAME)
431 AC_SUBST([LIB]NAME[_PREFIX])
436 dnl Determine the platform dependent parameters needed to use rpath:
439 dnl acl_hardcode_libdir_flag_spec,
440 dnl acl_hardcode_libdir_separator,
441 dnl acl_hardcode_direct,
442 dnl acl_hardcode_minus_L.
443 AC_DEFUN([AC_LIB_RPATH],
445 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
446 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
447 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
448 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
449 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
450 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
451 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
452 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
453 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
459 acl_libext="$acl_cv_libext"
460 acl_shlibext="$acl_cv_shlibext"
461 acl_libname_spec="$acl_cv_libname_spec"
462 acl_library_names_spec="$acl_cv_library_names_spec"
463 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
464 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
465 acl_hardcode_direct="$acl_cv_hardcode_direct"
466 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
467 dnl Determine whether the user wants rpath handling at all.
469 [ --disable-rpath do not hardcode runtime library paths],
473 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
474 dnl the libraries corresponding to explicit and implicit dependencies.
475 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
476 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
477 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
478 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
480 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
481 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
482 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
483 dnl Autoconf >= 2.61 supports dots in --with options.
484 define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
485 dnl By default, look in $includedir and $libdir.
487 AC_LIB_WITH_FINAL_PREFIX([
488 eval additional_includedir=\"$includedir\"
489 eval additional_libdir=\"$libdir\"
491 AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
492 [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
493 --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
495 if test "X$withval" = "Xno"; then
498 if test "X$withval" = "X"; then
499 AC_LIB_WITH_FINAL_PREFIX([
500 eval additional_includedir=\"$includedir\"
501 eval additional_libdir=\"$libdir\"
504 additional_includedir="$withval/include"
505 additional_libdir="$withval/$acl_libdirstem"
509 dnl Search the library and its dependencies in $additional_libdir and
510 dnl $LDFLAGS. Using breadth-first-seach.
517 names_already_handled=
518 names_next_round='$1 $2'
519 while test -n "$names_next_round"; do
520 names_this_round="$names_next_round"
522 for name in $names_this_round; do
524 for n in $names_already_handled; do
525 if test "$n" = "$name"; then
530 if test -z "$already_handled"; then
531 names_already_handled="$names_already_handled $name"
532 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
533 dnl or AC_LIB_HAVE_LINKFLAGS call.
534 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
535 eval value=\"\$HAVE_LIB$uppername\"
536 if test -n "$value"; then
537 if test "$value" = yes; then
538 eval value=\"\$LIB$uppername\"
539 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
540 eval value=\"\$LTLIB$uppername\"
541 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
543 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
544 dnl that this library doesn't exist. So just drop it.
548 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
549 dnl and the already constructed $LIBNAME/$LTLIBNAME.
554 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
555 if test -n "$acl_shlibext"; then
556 shrext=".$acl_shlibext" # typically: shrext=.so
560 if test $use_additional = yes; then
561 dir="$additional_libdir"
562 dnl The same code as in the loop below:
563 dnl First look for a shared library.
564 if test -n "$acl_shlibext"; then
565 if test -f "$dir/$libname$shrext"; then
567 found_so="$dir/$libname$shrext"
569 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
571 for f in "$libname$shrext".*; do echo "$f"; done \
572 | sed -e "s,^$libname$shrext\\\\.,," \
573 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
574 | sed 1q ) 2>/dev/null`
575 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
577 found_so="$dir/$libname$shrext.$ver"
580 eval library_names=\"$acl_library_names_spec\"
581 for f in $library_names; do
582 if test -f "$dir/$f"; then
591 dnl Then look for a static library.
592 if test "X$found_dir" = "X"; then
593 if test -f "$dir/$libname.$acl_libext"; then
595 found_a="$dir/$libname.$acl_libext"
598 if test "X$found_dir" != "X"; then
599 if test -f "$dir/$libname.la"; then
600 found_la="$dir/$libname.la"
604 if test "X$found_dir" = "X"; then
605 for x in $LDFLAGS $LTLIB[]NAME; do
606 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
609 dir=`echo "X$x" | sed -e 's/^X-L//'`
610 dnl First look for a shared library.
611 if test -n "$acl_shlibext"; then
612 if test -f "$dir/$libname$shrext"; then
614 found_so="$dir/$libname$shrext"
616 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
618 for f in "$libname$shrext".*; do echo "$f"; done \
619 | sed -e "s,^$libname$shrext\\\\.,," \
620 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
621 | sed 1q ) 2>/dev/null`
622 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
624 found_so="$dir/$libname$shrext.$ver"
627 eval library_names=\"$acl_library_names_spec\"
628 for f in $library_names; do
629 if test -f "$dir/$f"; then
638 dnl Then look for a static library.
639 if test "X$found_dir" = "X"; then
640 if test -f "$dir/$libname.$acl_libext"; then
642 found_a="$dir/$libname.$acl_libext"
645 if test "X$found_dir" != "X"; then
646 if test -f "$dir/$libname.la"; then
647 found_la="$dir/$libname.la"
652 if test "X$found_dir" != "X"; then
657 if test "X$found_dir" != "X"; then
658 dnl Found the library.
659 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
660 if test "X$found_so" != "X"; then
661 dnl Linking with a shared library. We attempt to hardcode its
662 dnl directory into the executable's runpath, unless it's the
663 dnl standard /usr/lib.
664 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
665 dnl No hardcoding is needed.
666 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
668 dnl Use an explicit option to hardcode DIR into the resulting
670 dnl Potentially add DIR to ltrpathdirs.
671 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
673 for x in $ltrpathdirs; do
674 if test "X$x" = "X$found_dir"; then
679 if test -z "$haveit"; then
680 ltrpathdirs="$ltrpathdirs $found_dir"
682 dnl The hardcoding into $LIBNAME is system dependent.
683 if test "$acl_hardcode_direct" = yes; then
684 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
685 dnl resulting binary.
686 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
688 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
689 dnl Use an explicit option to hardcode DIR into the resulting
691 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
692 dnl Potentially add DIR to rpathdirs.
693 dnl The rpathdirs will be appended to $LIBNAME at the end.
695 for x in $rpathdirs; do
696 if test "X$x" = "X$found_dir"; then
701 if test -z "$haveit"; then
702 rpathdirs="$rpathdirs $found_dir"
705 dnl Rely on "-L$found_dir".
706 dnl But don't add it if it's already contained in the LDFLAGS
707 dnl or the already constructed $LIBNAME
709 for x in $LDFLAGS $LIB[]NAME; do
710 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
711 if test "X$x" = "X-L$found_dir"; then
716 if test -z "$haveit"; then
717 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
719 if test "$acl_hardcode_minus_L" != no; then
720 dnl FIXME: Not sure whether we should use
721 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
723 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
725 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
726 dnl here, because this doesn't fit in flags passed to the
727 dnl compiler. So give up. No hardcoding. This affects only
728 dnl very old systems.
729 dnl FIXME: Not sure whether we should use
730 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
732 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
738 if test "X$found_a" != "X"; then
739 dnl Linking with a static library.
740 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
742 dnl We shouldn't come here, but anyway it's good to have a
744 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
747 dnl Assume the include files are nearby.
748 additional_includedir=
750 */$acl_libdirstem | */$acl_libdirstem/)
751 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
752 LIB[]NAME[]_PREFIX="$basedir"
753 additional_includedir="$basedir/include"
756 if test "X$additional_includedir" != "X"; then
757 dnl Potentially add $additional_includedir to $INCNAME.
759 dnl 1. if it's the standard /usr/include,
760 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
761 dnl 3. if it's already present in $CPPFLAGS or the already
762 dnl constructed $INCNAME,
763 dnl 4. if it doesn't exist as a directory.
764 if test "X$additional_includedir" != "X/usr/include"; then
766 if test "X$additional_includedir" = "X/usr/local/include"; then
767 if test -n "$GCC"; then
769 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
773 if test -z "$haveit"; then
774 for x in $CPPFLAGS $INC[]NAME; do
775 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
776 if test "X$x" = "X-I$additional_includedir"; then
781 if test -z "$haveit"; then
782 if test -d "$additional_includedir"; then
783 dnl Really add $additional_includedir to $INCNAME.
784 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
790 dnl Look for dependencies.
791 if test -n "$found_la"; then
792 dnl Read the .la file. It defines the variables
793 dnl dlname, library_names, old_library, dependency_libs, current,
794 dnl age, revision, installed, dlopen, dlpreopen, libdir.
795 save_libdir="$libdir"
797 */* | *\\*) . "$found_la" ;;
798 *) . "./$found_la" ;;
800 libdir="$save_libdir"
801 dnl We use only dependency_libs.
802 for dep in $dependency_libs; do
805 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
806 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
808 dnl 1. if it's the standard /usr/lib,
809 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
810 dnl 3. if it's already present in $LDFLAGS or the already
811 dnl constructed $LIBNAME,
812 dnl 4. if it doesn't exist as a directory.
813 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
815 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
816 if test -n "$GCC"; then
818 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
822 if test -z "$haveit"; then
824 for x in $LDFLAGS $LIB[]NAME; do
825 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
826 if test "X$x" = "X-L$additional_libdir"; then
831 if test -z "$haveit"; then
832 if test -d "$additional_libdir"; then
833 dnl Really add $additional_libdir to $LIBNAME.
834 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
838 for x in $LDFLAGS $LTLIB[]NAME; do
839 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
840 if test "X$x" = "X-L$additional_libdir"; then
845 if test -z "$haveit"; then
846 if test -d "$additional_libdir"; then
847 dnl Really add $additional_libdir to $LTLIBNAME.
848 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
855 dir=`echo "X$dep" | sed -e 's/^X-R//'`
856 if test "$enable_rpath" != no; then
857 dnl Potentially add DIR to rpathdirs.
858 dnl The rpathdirs will be appended to $LIBNAME at the end.
860 for x in $rpathdirs; do
861 if test "X$x" = "X$dir"; then
866 if test -z "$haveit"; then
867 rpathdirs="$rpathdirs $dir"
869 dnl Potentially add DIR to ltrpathdirs.
870 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
872 for x in $ltrpathdirs; do
873 if test "X$x" = "X$dir"; then
878 if test -z "$haveit"; then
879 ltrpathdirs="$ltrpathdirs $dir"
884 dnl Handle this in the next round.
885 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
888 dnl Handle this in the next round. Throw away the .la's
889 dnl directory; it is already contained in a preceding -L
891 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
894 dnl Most likely an immediate library name.
895 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
896 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
902 dnl Didn't find the library; assume it is in the system directories
903 dnl known to the linker and runtime loader. (All the system
904 dnl directories known to the linker should also be known to the
905 dnl runtime loader, otherwise the system is severely misconfigured.)
906 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
907 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
913 if test "X$rpathdirs" != "X"; then
914 if test -n "$acl_hardcode_libdir_separator"; then
915 dnl Weird platform: only the last -rpath option counts, the user must
916 dnl pass all path elements in one option. We can arrange that for a
917 dnl single library, but not when more than one $LIBNAMEs are used.
919 for found_dir in $rpathdirs; do
920 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
922 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
923 acl_save_libdir="$libdir"
925 eval flag=\"$acl_hardcode_libdir_flag_spec\"
926 libdir="$acl_save_libdir"
927 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
929 dnl The -rpath options are cumulative.
930 for found_dir in $rpathdirs; do
931 acl_save_libdir="$libdir"
933 eval flag=\"$acl_hardcode_libdir_flag_spec\"
934 libdir="$acl_save_libdir"
935 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
939 if test "X$ltrpathdirs" != "X"; then
940 dnl When using libtool, the option that works for both libraries and
941 dnl executables is -R. The -R options are cumulative.
942 for found_dir in $ltrpathdirs; do
943 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
948 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
949 dnl unless already present in VAR.
950 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
951 dnl contains two or three consecutive elements that belong together.
952 AC_DEFUN([AC_LIB_APPENDTOVAR],
954 for element in [$2]; do
957 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
958 if test "X$x" = "X$element"; then
963 if test -z "$haveit"; then
964 [$1]="${[$1]}${[$1]:+ }$element"
969 dnl For those cases where a variable contains several -L and -l options
970 dnl referring to unknown libraries and directories, this macro determines the
971 dnl necessary additional linker options for the runtime path.
972 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
973 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
974 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
975 dnl otherwise linking without libtool is assumed.
976 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
978 AC_REQUIRE([AC_LIB_RPATH])
979 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
981 if test "$enable_rpath" != no; then
982 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
983 dnl Use an explicit option to hardcode directories into the resulting
988 if test -n "$next"; then
990 dnl No need to hardcode the standard /usr/lib.
991 if test "X$dir" != "X/usr/$acl_libdirstem"; then
992 rpathdirs="$rpathdirs $dir"
998 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
999 dnl No need to hardcode the standard /usr/lib.
1000 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1001 rpathdirs="$rpathdirs $dir"
1008 if test "X$rpathdirs" != "X"; then
1009 if test -n ""$3""; then
1010 dnl libtool is used for linking. Use -R options.
1011 for dir in $rpathdirs; do
1012 $1="${$1}${$1:+ }-R$dir"
1015 dnl The linker is used for linking directly.
1016 if test -n "$acl_hardcode_libdir_separator"; then
1017 dnl Weird platform: only the last -rpath option counts, the user
1018 dnl must pass all path elements in one option.
1020 for dir in $rpathdirs; do
1021 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1023 acl_save_libdir="$libdir"
1025 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1026 libdir="$acl_save_libdir"
1029 dnl The -rpath options are cumulative.
1030 for dir in $rpathdirs; do
1031 acl_save_libdir="$libdir"
1033 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1034 libdir="$acl_save_libdir"
1035 $1="${$1}${$1:+ }$flag"
1045 # lib-ld.m4 serial 3 (gettext-0.13)
1046 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1047 dnl This file is free software; the Free Software Foundation
1048 dnl gives unlimited permission to copy and/or distribute it,
1049 dnl with or without modifications, as long as this notice is preserved.
1051 dnl Subroutines of libtool.m4,
1052 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1053 dnl with libtool.m4.
1055 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1056 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1057 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1058 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1059 case `$LD -v 2>&1 </dev/null` in
1060 *GNU* | *'with BFD'*)
1061 acl_cv_prog_gnu_ld=yes ;;
1063 acl_cv_prog_gnu_ld=no ;;
1065 with_gnu_ld=$acl_cv_prog_gnu_ld
1068 dnl From libtool-1.4. Sets the variable LD.
1069 AC_DEFUN([AC_LIB_PROG_LD],
1070 [AC_ARG_WITH(gnu-ld,
1071 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1072 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1073 AC_REQUIRE([AC_PROG_CC])dnl
1074 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1075 # Prepare PATH_SEPARATOR.
1076 # The user is always right.
1077 if test "${PATH_SEPARATOR+set}" != set; then
1078 echo "#! /bin/sh" >conf$$.sh
1079 echo "exit 0" >>conf$$.sh
1081 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1089 if test "$GCC" = yes; then
1090 # Check if gcc -print-prog-name=ld gives a path.
1091 AC_MSG_CHECKING([for ld used by GCC])
1094 # gcc leaves a trailing carriage return which upsets mingw
1095 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1097 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1100 # Accept absolute paths.
1101 [[\\/]* | [A-Za-z]:[\\/]*)]
1102 [re_direlt='/[^/][^/]*/\.\./']
1103 # Canonicalize the path of ld
1104 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1105 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1106 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1108 test -z "$LD" && LD="$ac_prog"
1111 # If it fails, then pretend we aren't using GCC.
1115 # If it is relative, then search for the first ld in PATH.
1119 elif test "$with_gnu_ld" = yes; then
1120 AC_MSG_CHECKING([for GNU ld])
1122 AC_MSG_CHECKING([for non-GNU ld])
1124 AC_CACHE_VAL(acl_cv_path_LD,
1125 [if test -z "$LD"; then
1126 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1127 for ac_dir in $PATH; do
1128 test -z "$ac_dir" && ac_dir=.
1129 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1130 acl_cv_path_LD="$ac_dir/$ac_prog"
1131 # Check to see if the program is GNU ld. I'd rather use --version,
1132 # but apparently some GNU ld's only accept -v.
1133 # Break only if it was the GNU/non-GNU ld that we prefer.
1134 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1135 *GNU* | *'with BFD'*)
1136 test "$with_gnu_ld" != no && break ;;
1138 test "$with_gnu_ld" != yes && break ;;
1144 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1146 LD="$acl_cv_path_LD"
1147 if test -n "$LD"; then
1152 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])