oops, that commit wasn't so clean
[hrr.git] / aclocal.m4
blobaf6cb46c63b7a07a752a9ac8a2cd0f0039b8afe1
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
21 #  
22 #This file is part of Hacker Radio Rec.
23 #  
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
42 # 1 - library
43 # 2 - function
44 # 3 - error
46 AC_DEFUN(HRR_CHECK_LIB, [
47  HRR_SWLIB=""
48  HRR_SWDIR=""
49 LIB_SEARCH="/lib \
50             /lib \
51             /usr/lib \
52             /usr/unsupported/lib \
53             /usr/local/lib \
54             /usr/X386/lib \
55             /usr/lib/X11R4 \
56             /usr/X11R5/lib \
57             /usr/lib/X11R5 \
58             /usr/openwin/lib \
59             /usr/X11/lib \
60             /pub/X11R5/lib \
61             /usr/local/X11R5/lib \
62             /opt/lib \
63             /opt/X11R6/lib \
64             /opt/X11/lib \
65             /usr/X11R6/lib \
66             /usr/lib/X11R6 \
67             /pub/X11R6/lib \
68             /pub/lib \
69             /usr/local/X11R6/lib \
70             $HOME/local/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
79     HRR_SWDIR=-L$i
80     HRR_SWLIB=-l$1
81    fi
82   done
84   if test "$HRR_SWLIB" = "nope" ; then
85    echo "nope"
86    ./errors "$3"
87    exit
88   else
89    echo "found"
90   fi
91  fi
93  LDFLAGS=$LDFLAGS\ $HRR_SWDIR
94  LIBS=$LIBS\ $HRR_SWLIB
99 # 1 - header_file
100 # 2 - sub directory  e.g. SDL/
101 # 3 - error
103 AC_DEFUN(HRR_CHECK_HEAD, [
104 HEADER_SEARCH="/include \
105                /usr/include \
106                /usr/unsupported/include \
107                /usr/local/include \
108                /usr/X386/include \
109                /usr/include/X11R4 \
110                /usr/X11R5/include \
111                /usr/include/X11R5 \
112                /usr/openwin/include \
113                /usr/X11/include \
114                /pub/X11R5/include \
115                /usr/local/X11R5/include \
116                /opt/include \
117                /opt/X11R6/include \
118                /opt/X11/include \
119                /usr/X11R6/include \
120                /usr/include/X11R6 \
121                /pub/X11R6/include \
122                /pub/include \
123                /usr/local/X11R6/include \
124                $HOME/local/include "
127  printf "checking for %s... " $1
128  HRR_INC=""
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
134    fi
135   done
136  fi
137 if test "$HRR_INC" = "nope"; then
138   echo "nope"
139   ./errors "$3"
140   exit;
141 else
142   echo "found"
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.
178   use_additional=yes
179   AC_LIB_WITH_FINAL_PREFIX([
180     eval additional_includedir=\"$includedir\"
181     eval additional_libdir=\"$libdir\"
182   ])
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
188       use_additional=no
189     else
190       if test "X$withval" = "X"; then
191         AC_LIB_WITH_FINAL_PREFIX([
192           eval additional_includedir=\"$includedir\"
193           eval additional_libdir=\"$libdir\"
194         ])
195       else
196         additional_includedir="$withval/include"
197         additional_libdir="$withval/$acl_libdirstem"
198       fi
199     fi
201   if test $use_additional = yes; then
202     dnl Potentially add $additional_includedir to $CPPFLAGS.
203     dnl But don't add it
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
209       haveit=
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
213           haveit=yes
214           break
215         fi
216       done
217       if test -z "$haveit"; then
218         if test "X$additional_includedir" = "X/usr/local/include"; then
219           if test -n "$GCC"; then
220             case $host_os in
221               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
222             esac
223           fi
224         fi
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"
229           fi
230         fi
231       fi
232     fi
233     dnl Potentially add $additional_libdir to $LDFLAGS.
234     dnl But don't add it
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
240       haveit=
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
244           haveit=yes
245           break
246         fi
247       done
248       if test -z "$haveit"; then
249         if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
250           if test -n "$GCC"; then
251             case $host_os in
252               linux*) haveit=yes;;
253             esac
254           fi
255         fi
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"
260           fi
261         fi
262       fi
263     fi
264   fi
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"
276   else
277     acl_final_prefix="$prefix"
278   fi
279   if test "X$exec_prefix" = "XNONE"; then
280     acl_final_exec_prefix='${prefix}'
281   else
282     acl_final_exec_prefix="$exec_prefix"
283   fi
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"
299   $1
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".
316   acl_libdirstem=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
322         case "$searchdir" in
323           */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
324           *) searchdir=`cd "$searchdir" && pwd`
325              case "$searchdir" in
326                */lib64 ) acl_libdirstem=lib64 ;;
327              esac ;;
328         esac
329       fi
330     done
331     IFS="$acl_save_IFS"
332   fi
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.
343 AC_PREREQ(2.54)
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"
364   ])
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)
370   AC_SUBST([LIB]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.
375   HAVE_LIB[]NAME=yes
376   undefine([Name])
377   undefine([NAME])
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
399   dnl accordingly.
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], [
409     ac_save_LIBS="$LIBS"
410     LIBS="$LIBS $LIB[]NAME"
411     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
412     LIBS="$ac_save_LIBS"
413   ])
414   if test "$ac_cv_lib[]Name" = yes; then
415     HAVE_LIB[]NAME=yes
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])
419   else
420     HAVE_LIB[]NAME=no
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"
424     LIB[]NAME=
425     LTLIB[]NAME=
426     LIB[]NAME[]_PREFIX=
427   fi
428   AC_SUBST([HAVE_LIB]NAME)
429   AC_SUBST([LIB]NAME)
430   AC_SUBST([LTLIB]NAME)
431   AC_SUBST([LIB]NAME[_PREFIX])
432   undefine([Name])
433   undefine([NAME])
436 dnl Determine the platform dependent parameters needed to use rpath:
437 dnl   acl_libext,
438 dnl   acl_shlibext,
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
454     . ./conftest.sh
455     rm -f ./conftest.sh
456     acl_cv_rpath=done
457   ])
458   wl="$acl_cv_wl"
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.
468   AC_ARG_ENABLE(rpath,
469     [  --disable-rpath         do not hardcode runtime library paths],
470     :, enable_rpath=yes)
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.
486   use_additional=yes
487   AC_LIB_WITH_FINAL_PREFIX([
488     eval additional_includedir=\"$includedir\"
489     eval additional_libdir=\"$libdir\"
490   ])
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
496       use_additional=no
497     else
498       if test "X$withval" = "X"; then
499         AC_LIB_WITH_FINAL_PREFIX([
500           eval additional_includedir=\"$includedir\"
501           eval additional_libdir=\"$libdir\"
502         ])
503       else
504         additional_includedir="$withval/include"
505         additional_libdir="$withval/$acl_libdirstem"
506       fi
507     fi
509   dnl Search the library and its dependencies in $additional_libdir and
510   dnl $LDFLAGS. Using breadth-first-seach.
511   LIB[]NAME=
512   LTLIB[]NAME=
513   INC[]NAME=
514   LIB[]NAME[]_PREFIX=
515   rpathdirs=
516   ltrpathdirs=
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"
521     names_next_round=
522     for name in $names_this_round; do
523       already_handled=
524       for n in $names_already_handled; do
525         if test "$n" = "$name"; then
526           already_handled=yes
527           break
528         fi
529       done
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"
542           else
543             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
544             dnl that this library doesn't exist. So just drop it.
545             :
546           fi
547         else
548           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
549           dnl and the already constructed $LIBNAME/$LTLIBNAME.
550           found_dir=
551           found_la=
552           found_so=
553           found_a=
554           eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
555           if test -n "$acl_shlibext"; then
556             shrext=".$acl_shlibext"             # typically: shrext=.so
557           else
558             shrext=
559           fi
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
566                 found_dir="$dir"
567                 found_so="$dir/$libname$shrext"
568               else
569                 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
570                   ver=`(cd "$dir" && \
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
576                     found_dir="$dir"
577                     found_so="$dir/$libname$shrext.$ver"
578                   fi
579                 else
580                   eval library_names=\"$acl_library_names_spec\"
581                   for f in $library_names; do
582                     if test -f "$dir/$f"; then
583                       found_dir="$dir"
584                       found_so="$dir/$f"
585                       break
586                     fi
587                   done
588                 fi
589               fi
590             fi
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
594                 found_dir="$dir"
595                 found_a="$dir/$libname.$acl_libext"
596               fi
597             fi
598             if test "X$found_dir" != "X"; then
599               if test -f "$dir/$libname.la"; then
600                 found_la="$dir/$libname.la"
601               fi
602             fi
603           fi
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\"])
607               case "$x" in
608                 -L*)
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
613                       found_dir="$dir"
614                       found_so="$dir/$libname$shrext"
615                     else
616                       if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
617                         ver=`(cd "$dir" && \
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
623                           found_dir="$dir"
624                           found_so="$dir/$libname$shrext.$ver"
625                         fi
626                       else
627                         eval library_names=\"$acl_library_names_spec\"
628                         for f in $library_names; do
629                           if test -f "$dir/$f"; then
630                             found_dir="$dir"
631                             found_so="$dir/$f"
632                             break
633                           fi
634                         done
635                       fi
636                     fi
637                   fi
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
641                       found_dir="$dir"
642                       found_a="$dir/$libname.$acl_libext"
643                     fi
644                   fi
645                   if test "X$found_dir" != "X"; then
646                     if test -f "$dir/$libname.la"; then
647                       found_la="$dir/$libname.la"
648                     fi
649                   fi
650                   ;;
651               esac
652               if test "X$found_dir" != "X"; then
653                 break
654               fi
655             done
656           fi
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"
667               else
668                 dnl Use an explicit option to hardcode DIR into the resulting
669                 dnl binary.
670                 dnl Potentially add DIR to ltrpathdirs.
671                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
672                 haveit=
673                 for x in $ltrpathdirs; do
674                   if test "X$x" = "X$found_dir"; then
675                     haveit=yes
676                     break
677                   fi
678                 done
679                 if test -z "$haveit"; then
680                   ltrpathdirs="$ltrpathdirs $found_dir"
681                 fi
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"
687                 else
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
690                     dnl binary.
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.
694                     haveit=
695                     for x in $rpathdirs; do
696                       if test "X$x" = "X$found_dir"; then
697                         haveit=yes
698                         break
699                       fi
700                     done
701                     if test -z "$haveit"; then
702                       rpathdirs="$rpathdirs $found_dir"
703                     fi
704                   else
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
708                     haveit=
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
712                         haveit=yes
713                         break
714                       fi
715                     done
716                     if test -z "$haveit"; then
717                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
718                     fi
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"
722                       dnl here.
723                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
724                     else
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"
731                       dnl here.
732                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
733                     fi
734                   fi
735                 fi
736               fi
737             else
738               if test "X$found_a" != "X"; then
739                 dnl Linking with a static library.
740                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
741               else
742                 dnl We shouldn't come here, but anyway it's good to have a
743                 dnl fallback.
744                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
745               fi
746             fi
747             dnl Assume the include files are nearby.
748             additional_includedir=
749             case "$found_dir" in
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"
754                 ;;
755             esac
756             if test "X$additional_includedir" != "X"; then
757               dnl Potentially add $additional_includedir to $INCNAME.
758               dnl But don't add it
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
765                 haveit=
766                 if test "X$additional_includedir" = "X/usr/local/include"; then
767                   if test -n "$GCC"; then
768                     case $host_os in
769                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
770                     esac
771                   fi
772                 fi
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
777                       haveit=yes
778                       break
779                     fi
780                   done
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"
785                     fi
786                   fi
787                 fi
788               fi
789             fi
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"
796               case "$found_la" in
797                 */* | *\\*) . "$found_la" ;;
798                 *) . "./$found_la" ;;
799               esac
800               libdir="$save_libdir"
801               dnl We use only dependency_libs.
802               for dep in $dependency_libs; do
803                 case "$dep" in
804                   -L*)
805                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
806                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
807                     dnl But don't add it
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
814                       haveit=
815                       if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
816                         if test -n "$GCC"; then
817                           case $host_os in
818                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
819                           esac
820                         fi
821                       fi
822                       if test -z "$haveit"; then
823                         haveit=
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
827                             haveit=yes
828                             break
829                           fi
830                         done
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"
835                           fi
836                         fi
837                         haveit=
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
841                             haveit=yes
842                             break
843                           fi
844                         done
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"
849                           fi
850                         fi
851                       fi
852                     fi
853                     ;;
854                   -R*)
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.
859                       haveit=
860                       for x in $rpathdirs; do
861                         if test "X$x" = "X$dir"; then
862                           haveit=yes
863                           break
864                         fi
865                       done
866                       if test -z "$haveit"; then
867                         rpathdirs="$rpathdirs $dir"
868                       fi
869                       dnl Potentially add DIR to ltrpathdirs.
870                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
871                       haveit=
872                       for x in $ltrpathdirs; do
873                         if test "X$x" = "X$dir"; then
874                           haveit=yes
875                           break
876                         fi
877                       done
878                       if test -z "$haveit"; then
879                         ltrpathdirs="$ltrpathdirs $dir"
880                       fi
881                     fi
882                     ;;
883                   -l*)
884                     dnl Handle this in the next round.
885                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
886                     ;;
887                   *.la)
888                     dnl Handle this in the next round. Throw away the .la's
889                     dnl directory; it is already contained in a preceding -L
890                     dnl option.
891                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
892                     ;;
893                   *)
894                     dnl Most likely an immediate library name.
895                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
896                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
897                     ;;
898                 esac
899               done
900             fi
901           else
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"
908           fi
909         fi
910       fi
911     done
912   done
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.
918       alldirs=
919       for found_dir in $rpathdirs; do
920         alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
921       done
922       dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
923       acl_save_libdir="$libdir"
924       libdir="$alldirs"
925       eval flag=\"$acl_hardcode_libdir_flag_spec\"
926       libdir="$acl_save_libdir"
927       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
928     else
929       dnl The -rpath options are cumulative.
930       for found_dir in $rpathdirs; do
931         acl_save_libdir="$libdir"
932         libdir="$found_dir"
933         eval flag=\"$acl_hardcode_libdir_flag_spec\"
934         libdir="$acl_save_libdir"
935         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
936       done
937     fi
938   fi
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"
944     done
945   fi
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
955     haveit=
956     for x in $[$1]; do
957       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
958       if test "X$x" = "X$element"; then
959         haveit=yes
960         break
961       fi
962     done
963     if test -z "$haveit"; then
964       [$1]="${[$1]}${[$1]:+ }$element"
965     fi
966   done
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])
980   $1=
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
984       dnl binary.
985       rpathdirs=
986       next=
987       for opt in $2; do
988         if test -n "$next"; then
989           dir="$next"
990           dnl No need to hardcode the standard /usr/lib.
991           if test "X$dir" != "X/usr/$acl_libdirstem"; then
992             rpathdirs="$rpathdirs $dir"
993           fi
994           next=
995         else
996           case $opt in
997             -L) next=yes ;;
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"
1002                  fi
1003                  next= ;;
1004             *) next= ;;
1005           esac
1006         fi
1007       done
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"
1013           done
1014         else
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.
1019             alldirs=
1020             for dir in $rpathdirs; do
1021               alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1022             done
1023             acl_save_libdir="$libdir"
1024             libdir="$alldirs"
1025             eval flag=\"$acl_hardcode_libdir_flag_spec\"
1026             libdir="$acl_save_libdir"
1027             $1="$flag"
1028           else
1029             dnl The -rpath options are cumulative.
1030             for dir in $rpathdirs; do
1031               acl_save_libdir="$libdir"
1032               libdir="$dir"
1033               eval flag=\"$acl_hardcode_libdir_flag_spec\"
1034               libdir="$acl_save_libdir"
1035               $1="${$1}${$1:+ }$flag"
1036             done
1037           fi
1038         fi
1039       fi
1040     fi
1041   fi
1042   AC_SUBST([$1])
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 ;;
1064 esac])
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
1080   chmod +x conf$$.sh
1081   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1082     PATH_SEPARATOR=';'
1083   else
1084     PATH_SEPARATOR=:
1085   fi
1086   rm -f conf$$.sh
1088 ac_prog=ld
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])
1092   case $host in
1093   *-*-mingw*)
1094     # gcc leaves a trailing carriage return which upsets mingw
1095     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1096   *)
1097     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1098   esac
1099   case $ac_prog in
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%/%"`
1107       done
1108       test -z "$LD" && LD="$ac_prog"
1109       ;;
1110   "")
1111     # If it fails, then pretend we aren't using GCC.
1112     ac_prog=ld
1113     ;;
1114   *)
1115     # If it is relative, then search for the first ld in PATH.
1116     with_gnu_ld=unknown
1117     ;;
1118   esac
1119 elif test "$with_gnu_ld" = yes; then
1120   AC_MSG_CHECKING([for GNU ld])
1121 else
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 ;;
1137       *)
1138         test "$with_gnu_ld" != yes && break ;;
1139       esac
1140     fi
1141   done
1142   IFS="$ac_save_ifs"
1143 else
1144   acl_cv_path_LD="$LD" # Let the user override the test with a path.
1145 fi])
1146 LD="$acl_cv_path_LD"
1147 if test -n "$LD"; then
1148   AC_MSG_RESULT($LD)
1149 else
1150   AC_MSG_RESULT(no)
1152 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1153 AC_LIB_PROG_LD_GNU