root/branches/volker_dev/aclocal.m4

Revision 724, 70.9 kB (checked in by michael, 2 years ago)

switch from CVS to SVN

Line 
1# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005  Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# iconv.m4 serial AM4 (gettext-0.11.3)
15dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
16dnl This file is free software; the Free Software Foundation
17dnl gives unlimited permission to copy and/or distribute it,
18dnl with or without modifications, as long as this notice is preserved.
19
20dnl From Bruno Haible.
21
22AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
23[
24  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
25  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
26  AC_REQUIRE([AC_LIB_RPATH])
27
28  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
29  dnl accordingly.
30  AC_LIB_LINKFLAGS_BODY([iconv])
31])
32
33AC_DEFUN([AM_ICONV_LINK],
34[
35  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
36  dnl those with the standalone portable GNU libiconv installed).
37
38  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
39  dnl accordingly.
40  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
41
42  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
43  dnl because if the user has installed libiconv and not disabled its use
44  dnl via --without-libiconv-prefix, he wants to use it. The first
45  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
46  am_save_CPPFLAGS="$CPPFLAGS"
47  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
48
49  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
50    am_cv_func_iconv="no, consider installing GNU libiconv"
51    am_cv_lib_iconv=no
52    AC_TRY_LINK([#include <stdlib.h>
53#include <iconv.h>],
54      [iconv_t cd = iconv_open("","");
55       iconv(cd,NULL,NULL,NULL,NULL);
56       iconv_close(cd);],
57      am_cv_func_iconv=yes)
58    if test "$am_cv_func_iconv" != yes; then
59      am_save_LIBS="$LIBS"
60      LIBS="$LIBS $LIBICONV"
61      AC_TRY_LINK([#include <stdlib.h>
62#include <iconv.h>],
63        [iconv_t cd = iconv_open("","");
64         iconv(cd,NULL,NULL,NULL,NULL);
65         iconv_close(cd);],
66        am_cv_lib_iconv=yes
67        am_cv_func_iconv=yes)
68      LIBS="$am_save_LIBS"
69    fi
70  ])
71  if test "$am_cv_func_iconv" = yes; then
72    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
73  fi
74  if test "$am_cv_lib_iconv" = yes; then
75    AC_MSG_CHECKING([how to link with libiconv])
76    AC_MSG_RESULT([$LIBICONV])
77  else
78    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
79    dnl either.
80    CPPFLAGS="$am_save_CPPFLAGS"
81    LIBICONV=
82    LTLIBICONV=
83  fi
84  AC_SUBST(LIBICONV)
85  AC_SUBST(LTLIBICONV)
86])
87
88AC_DEFUN([AM_ICONV],
89[
90  AM_ICONV_LINK
91  if test "$am_cv_func_iconv" = yes; then
92    AC_MSG_CHECKING([for iconv declaration])
93    AC_CACHE_VAL(am_cv_proto_iconv, [
94      AC_TRY_COMPILE([
95#include <stdlib.h>
96#include <iconv.h>
97extern
98#ifdef __cplusplus
99"C"
100#endif
101#if defined(__STDC__) || defined(__cplusplus)
102size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
103#else
104size_t iconv();
105#endif
106], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
107      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
108    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
109    AC_MSG_RESULT([$]{ac_t:-
110         }[$]am_cv_proto_iconv)
111    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
112      [Define as const if the declaration of iconv() needs const.])
113  fi
114])
115
116# lib-ld.m4 serial 3 (gettext-0.13)
117dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
118dnl This file is free software; the Free Software Foundation
119dnl gives unlimited permission to copy and/or distribute it,
120dnl with or without modifications, as long as this notice is preserved.
121
122dnl Subroutines of libtool.m4,
123dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
124dnl with libtool.m4.
125
126dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
127AC_DEFUN([AC_LIB_PROG_LD_GNU],
128[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
129[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
130case `$LD -v 2>&1 </dev/null` in
131*GNU* | *'with BFD'*)
132  acl_cv_prog_gnu_ld=yes ;;
133*)
134  acl_cv_prog_gnu_ld=no ;;
135esac])
136with_gnu_ld=$acl_cv_prog_gnu_ld
137])
138
139dnl From libtool-1.4. Sets the variable LD.
140AC_DEFUN([AC_LIB_PROG_LD],
141[AC_ARG_WITH(gnu-ld,
142[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
143test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
144AC_REQUIRE([AC_PROG_CC])dnl
145AC_REQUIRE([AC_CANONICAL_HOST])dnl
146# Prepare PATH_SEPARATOR.
147# The user is always right.
148if test "${PATH_SEPARATOR+set}" != set; then
149  echo "#! /bin/sh" >conf$$.sh
150  echo  "exit 0"   >>conf$$.sh
151  chmod +x conf$$.sh
152  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
153    PATH_SEPARATOR=';'
154  else
155    PATH_SEPARATOR=:
156  fi
157  rm -f conf$$.sh
158fi
159ac_prog=ld
160if test "$GCC" = yes; then
161  # Check if gcc -print-prog-name=ld gives a path.
162  AC_MSG_CHECKING([for ld used by GCC])
163  case $host in
164  *-*-mingw*)
165    # gcc leaves a trailing carriage return which upsets mingw
166    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
167  *)
168    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
169  esac
170  case $ac_prog in
171    # Accept absolute paths.
172    [[\\/]* | [A-Za-z]:[\\/]*)]
173      [re_direlt='/[^/][^/]*/\.\./']
174      # Canonicalize the path of ld
175      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
176      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
177  ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
178      done
179      test -z "$LD" && LD="$ac_prog"
180      ;;
181  "")
182    # If it fails, then pretend we aren't using GCC.
183    ac_prog=ld
184    ;;
185  *)
186    # If it is relative, then search for the first ld in PATH.
187    with_gnu_ld=unknown
188    ;;
189  esac
190elif test "$with_gnu_ld" = yes; then
191  AC_MSG_CHECKING([for GNU ld])
192else
193  AC_MSG_CHECKING([for non-GNU ld])
194fi
195AC_CACHE_VAL(acl_cv_path_LD,
196[if test -z "$LD"; then
197  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
198  for ac_dir in $PATH; do
199    test -z "$ac_dir" && ac_dir=.
200    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
201      acl_cv_path_LD="$ac_dir/$ac_prog"
202      # Check to see if the program is GNU ld.  I'd rather use --version,
203      # but apparently some GNU ld's only accept -v.
204      # Break only if it was the GNU/non-GNU ld that we prefer.
205      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
206      *GNU* | *'with BFD'*)
207  test "$with_gnu_ld" != no && break ;;
208      *)
209  test "$with_gnu_ld" != yes && break ;;
210      esac
211    fi
212  done
213  IFS="$ac_save_ifs"
214else
215  acl_cv_path_LD="$LD" # Let the user override the test with a path.
216fi])
217LD="$acl_cv_path_LD"
218if test -n "$LD"; then
219  AC_MSG_RESULT($LD)
220else
221  AC_MSG_RESULT(no)
222fi
223test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
224AC_LIB_PROG_LD_GNU
225])
226
227# lib-link.m4 serial 9 (gettext-0.16)
228dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
229dnl This file is free software; the Free Software Foundation
230dnl gives unlimited permission to copy and/or distribute it,
231dnl with or without modifications, as long as this notice is preserved.
232
233dnl From Bruno Haible.
234
235AC_PREREQ(2.50)
236
237dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
238dnl the libraries corresponding to explicit and implicit dependencies.
239dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
240dnl augments the CPPFLAGS variable.
241AC_DEFUN([AC_LIB_LINKFLAGS],
242[
243  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
244  AC_REQUIRE([AC_LIB_RPATH])
245  define([Name],[translit([$1],[./-], [___])])
246  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
247                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
248  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
249    AC_LIB_LINKFLAGS_BODY([$1], [$2])
250    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
251    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
252    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
253  ])
254  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
255  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
256  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
257  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
258  AC_SUBST([LIB]NAME)
259  AC_SUBST([LTLIB]NAME)
260  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
261  dnl results of this search when this library appears as a dependency.
262  HAVE_LIB[]NAME=yes
263  undefine([Name])
264  undefine([NAME])
265])
266
267dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
268dnl searches for libname and the libraries corresponding to explicit and
269dnl implicit dependencies, together with the specified include files and
270dnl the ability to compile and link the specified testcode. If found, it
271dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
272dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
273dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
274dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
275AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
276[
277  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
278  AC_REQUIRE([AC_LIB_RPATH])
279  define([Name],[translit([$1],[./-], [___])])
280  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
281                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
282
283  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
284  dnl accordingly.
285  AC_LIB_LINKFLAGS_BODY([$1], [$2])
286
287  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
288  dnl because if the user has installed lib[]Name and not disabled its use
289  dnl via --without-lib[]Name-prefix, he wants to use it.
290  ac_save_CPPFLAGS="$CPPFLAGS"
291  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
292
293  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
294    ac_save_LIBS="$LIBS"
295    LIBS="$LIBS $LIB[]NAME"
296    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
297    LIBS="$ac_save_LIBS"
298  ])
299  if test "$ac_cv_lib[]Name" = yes; then
300    HAVE_LIB[]NAME=yes
301    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
302    AC_MSG_CHECKING([how to link with lib[]$1])
303    AC_MSG_RESULT([$LIB[]NAME])
304  else
305    HAVE_LIB[]NAME=no
306    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
307    dnl $INC[]NAME either.
308    CPPFLAGS="$ac_save_CPPFLAGS"
309    LIB[]NAME=
310    LTLIB[]NAME=
311  fi
312  AC_SUBST([HAVE_LIB]NAME)
313  AC_SUBST([LIB]NAME)
314  AC_SUBST([LTLIB]NAME)
315  undefine([Name])
316  undefine([NAME])
317])
318
319dnl Determine the platform dependent parameters needed to use rpath:
320dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
321dnl hardcode_direct, hardcode_minus_L.
322AC_DEFUN([AC_LIB_RPATH],
323[
324  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
325  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
326  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
327  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
328  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
329  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
330  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
331    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
332    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
333    . ./conftest.sh
334    rm -f ./conftest.sh
335    acl_cv_rpath=done
336  ])
337  wl="$acl_cv_wl"
338  libext="$acl_cv_libext"
339  shlibext="$acl_cv_shlibext"
340  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
341  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
342  hardcode_direct="$acl_cv_hardcode_direct"
343  hardcode_minus_L="$acl_cv_hardcode_minus_L"
344  dnl Determine whether the user wants rpath handling at all.
345  AC_ARG_ENABLE(rpath,
346    [  --disable-rpath         do not hardcode runtime library paths],
347    :, enable_rpath=yes)
348])
349
350dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
351dnl the libraries corresponding to explicit and implicit dependencies.
352dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
353AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
354[
355  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
356  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
357                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
358  dnl By default, look in $includedir and $libdir.
359  use_additional=yes
360  AC_LIB_WITH_FINAL_PREFIX([
361    eval additional_includedir=\"$includedir\"
362    eval additional_libdir=\"$libdir\"
363  ])
364  AC_LIB_ARG_WITH([lib$1-prefix],
365[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
366  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
367[
368    if test "X$withval" = "Xno"; then
369      use_additional=no
370    else
371      if test "X$withval" = "X"; then
372        AC_LIB_WITH_FINAL_PREFIX([
373          eval additional_includedir=\"$includedir\"
374          eval additional_libdir=\"$libdir\"
375        ])
376      else
377        additional_includedir="$withval/include"
378        additional_libdir="$withval/$acl_libdirstem"
379      fi
380    fi
381])
382  dnl Search the library and its dependencies in $additional_libdir and
383  dnl $LDFLAGS. Using breadth-first-seach.
384  LIB[]NAME=
385  LTLIB[]NAME=
386  INC[]NAME=
387  rpathdirs=
388  ltrpathdirs=
389  names_already_handled=
390  names_next_round='$1 $2'
391  while test -n "$names_next_round"; do
392    names_this_round="$names_next_round"
393    names_next_round=
394    for name in $names_this_round; do
395      already_handled=
396      for n in $names_already_handled; do
397        if test "$n" = "$name"; then
398          already_handled=yes
399          break
400        fi
401      done
402      if test -z "$already_handled"; then
403        names_already_handled="$names_already_handled $name"
404        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
405        dnl or AC_LIB_HAVE_LINKFLAGS call.
406        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
407        eval value=\"\$HAVE_LIB$uppername\"
408        if test -n "$value"; then
409          if test "$value" = yes; then
410            eval value=\"\$LIB$uppername\"
411            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
412            eval value=\"\$LTLIB$uppername\"
413            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
414          else
415            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
416            dnl that this library doesn't exist. So just drop it.
417            :
418          fi
419        else
420          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
421          dnl and the already constructed $LIBNAME/$LTLIBNAME.
422          found_dir=
423          found_la=
424          found_so=
425          found_a=
426          if test $use_additional = yes; then
427            if test -n "$shlibext" \
428               && { test -f "$additional_libdir/lib$name.$shlibext" \
429                    || { test "$shlibext" = dll \
430                         && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
431              found_dir="$additional_libdir"
432              if test -f "$additional_libdir/lib$name.$shlibext"; then
433                found_so="$additional_libdir/lib$name.$shlibext"
434              else
435                found_so="$additional_libdir/lib$name.dll.a"
436              fi
437              if test -f "$additional_libdir/lib$name.la"; then
438                found_la="$additional_libdir/lib$name.la"
439              fi
440            else
441              if test -f "$additional_libdir/lib$name.$libext"; then
442                found_dir="$additional_libdir"
443                found_a="$additional_libdir/lib$name.$libext"
444                if test -f "$additional_libdir/lib$name.la"; then
445                  found_la="$additional_libdir/lib$name.la"
446                fi
447              fi
448            fi
449          fi
450          if test "X$found_dir" = "X"; then
451            for x in $LDFLAGS $LTLIB[]NAME; do
452              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
453              case "$x" in
454                -L*)
455                  dir=`echo "X$x" | sed -e 's/^X-L//'`
456                  if test -n "$shlibext" \
457                     && { test -f "$dir/lib$name.$shlibext" \
458                          || { test "$shlibext" = dll \
459                               && test -f "$dir/lib$name.dll.a"; }; }; then
460                    found_dir="$dir"
461                    if test -f "$dir/lib$name.$shlibext"; then
462                      found_so="$dir/lib$name.$shlibext"
463                    else
464                      found_so="$dir/lib$name.dll.a"
465                    fi
466                    if test -f "$dir/lib$name.la"; then
467                      found_la="$dir/lib$name.la"
468                    fi
469                  else
470                    if test -f "$dir/lib$name.$libext"; then
471                      found_dir="$dir"
472                      found_a="$dir/lib$name.$libext"
473                      if test -f "$dir/lib$name.la"; then
474                        found_la="$dir/lib$name.la"
475                      fi
476                    fi
477                  fi
478                  ;;
479              esac
480              if test "X$found_dir" != "X"; then
481                break
482              fi
483            done
484          fi
485          if test "X$found_dir" != "X"; then
486            dnl Found the library.
487            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
488            if test "X$found_so" != "X"; then
489              dnl Linking with a shared library. We attempt to hardcode its
490              dnl directory into the executable's runpath, unless it's the
491              dnl standard /usr/lib.
492              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
493                dnl No hardcoding is needed.
494                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
495              else
496                dnl Use an explicit option to hardcode DIR into the resulting
497                dnl binary.
498                dnl Potentially add DIR to ltrpathdirs.
499                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
500                haveit=
501                for x in $ltrpathdirs; do
502                  if test "X$x" = "X$found_dir"; then
503                    haveit=yes
504                    break
505                  fi
506                done
507                if test -z "$haveit"; then
508                  ltrpathdirs="$ltrpathdirs $found_dir"
509                fi
510                dnl The hardcoding into $LIBNAME is system dependent.
511                if test "$hardcode_direct" = yes; then
512                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
513                  dnl resulting binary.
514                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
515                else
516                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
517                    dnl Use an explicit option to hardcode DIR into the resulting
518                    dnl binary.
519                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
520                    dnl Potentially add DIR to rpathdirs.
521                    dnl The rpathdirs will be appended to $LIBNAME at the end.
522                    haveit=
523                    for x in $rpathdirs; do
524                      if test "X$x" = "X$found_dir"; then
525                        haveit=yes
526                        break
527                      fi
528                    done
529                    if test -z "$haveit"; then
530                      rpathdirs="$rpathdirs $found_dir"
531                    fi
532                  else
533                    dnl Rely on "-L$found_dir".
534                    dnl But don't add it if it's already contained in the LDFLAGS
535                    dnl or the already constructed $LIBNAME
536                    haveit=
537                    for x in $LDFLAGS $LIB[]NAME; do
538                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
539                      if test "X$x" = "X-L$found_dir"; then
540                        haveit=yes
541                        break
542                      fi
543                    done
544                    if test -z "$haveit"; then
545                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
546                    fi
547                    if test "$hardcode_minus_L" != no; then
548                      dnl FIXME: Not sure whether we should use
549                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
550                      dnl here.
551                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
552                    else
553                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
554                      dnl here, because this doesn't fit in flags passed to the
555                      dnl compiler. So give up. No hardcoding. This affects only
556                      dnl very old systems.
557                      dnl FIXME: Not sure whether we should use
558                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
559                      dnl here.
560                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
561                    fi
562                  fi
563                fi
564              fi
565            else
566              if test "X$found_a" != "X"; then
567                dnl Linking with a static library.
568                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
569              else
570                dnl We shouldn't come here, but anyway it's good to have a
571                dnl fallback.
572                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
573              fi
574            fi
575            dnl Assume the include files are nearby.
576            additional_includedir=
577            case "$found_dir" in
578              */$acl_libdirstem | */$acl_libdirstem/)
579                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
580                additional_includedir="$basedir/include"
581                ;;
582            esac
583            if test "X$additional_includedir" != "X"; then
584              dnl Potentially add $additional_includedir to $INCNAME.
585              dnl But don't add it
586              dnl   1. if it's the standard /usr/include,
587              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
588              dnl   3. if it's already present in $CPPFLAGS or the already
589              dnl      constructed $INCNAME,
590              dnl   4. if it doesn't exist as a directory.
591              if test "X$additional_includedir" != "X/usr/include"; then
592                haveit=
593                if test "X$additional_includedir" = "X/usr/local/include"; then
594                  if test -n "$GCC"; then
595                    case $host_os in
596                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
597                    esac
598                  fi
599                fi
600                if test -z "$haveit"; then
601                  for x in $CPPFLAGS $INC[]NAME; do
602                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
603                    if test "X$x" = "X-I$additional_includedir"; then
604                      haveit=yes
605                      break
606                    fi
607                  done
608                  if test -z "$haveit"; then
609                    if test -d "$additional_includedir"; then
610                      dnl Really add $additional_includedir to $INCNAME.
611                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
612                    fi
613                  fi
614                fi
615              fi
616            fi
617            dnl Look for dependencies.
618            if test -n "$found_la"; then
619              dnl Read the .la file. It defines the variables
620              dnl dlname, library_names, old_library, dependency_libs, current,
621              dnl age, revision, installed, dlopen, dlpreopen, libdir.
622              save_libdir="$libdir"
623              case "$found_la" in
624                */* | *\\*) . "$found_la" ;;
625                *) . "./$found_la" ;;
626              esac
627              libdir="$save_libdir"
628              dnl We use only dependency_libs.
629              for dep in $dependency_libs; do
630                case "$dep" in
631                  -L*)
632                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
633                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
634                    dnl But don't add it
635                    dnl   1. if it's the standard /usr/lib,
636                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
637                    dnl   3. if it's already present in $LDFLAGS or the already
638                    dnl      constructed $LIBNAME,
639                    dnl   4. if it doesn't exist as a directory.
640                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
641                      haveit=
642                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
643                        if test -n "$GCC"; then
644                          case $host_os in
645                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
646                          esac
647                        fi
648                      fi
649                      if test -z "$haveit"; then
650                        haveit=
651                        for x in $LDFLAGS $LIB[]NAME; do
652                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
653                          if test "X$x" = "X-L$additional_libdir"; then
654                            haveit=yes
655                            break
656                          fi
657                        done
658                        if test -z "$haveit"; then
659                          if test -d "$additional_libdir"; then
660                            dnl Really add $additional_libdir to $LIBNAME.
661                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
662                          fi
663                        fi
664                        haveit=
665                        for x in $LDFLAGS $LTLIB[]NAME; do
666                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
667                          if test "X$x" = "X-L$additional_libdir"; then
668                            haveit=yes
669                            break
670                          fi
671                        done
672                        if test -z "$haveit"; then
673                          if test -d "$additional_libdir"; then
674                            dnl Really add $additional_libdir to $LTLIBNAME.
675                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
676                          fi
677                        fi
678                      fi
679                    fi
680                    ;;
681                  -R*)
682                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
683                    if test "$enable_rpath" != no; then
684                      dnl Potentially add DIR to rpathdirs.
685                      dnl The rpathdirs will be appended to $LIBNAME at the end.
686                      haveit=
687                      for x in $rpathdirs; do
688                        if test "X$x" = "X$dir"; then
689                          haveit=yes
690                          break
691                        fi
692                      done
693                      if test -z "$haveit"; then
694                        rpathdirs="$rpathdirs $dir"
695                      fi
696                      dnl Potentially add DIR to ltrpathdirs.
697                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
698                      haveit=
699                      for x in $ltrpathdirs; do
700                        if test "X$x" = "X$dir"; then
701                          haveit=yes
702                          break
703                        fi
704                      done
705                      if test -z "$haveit"; then
706                        ltrpathdirs="$ltrpathdirs $dir"
707                      fi
708                    fi
709                    ;;
710                  -l*)
711                    dnl Handle this in the next round.
712                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
713                    ;;
714                  *.la)
715                    dnl Handle this in the next round. Throw away the .la's
716                    dnl directory; it is already contained in a preceding -L
717                    dnl option.
718                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
719                    ;;
720                  *)
721                    dnl Most likely an immediate library name.
722                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
723                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
724                    ;;
725                esac
726              done
727            fi
728          else
729            dnl Didn't find the library; assume it is in the system directories
730            dnl known to the linker and runtime loader. (All the system
731            dnl directories known to the linker should also be known to the
732            dnl runtime loader, otherwise the system is severely misconfigured.)
733            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
734            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
735          fi
736        fi
737      fi
738    done
739  done
740  if test "X$rpathdirs" != "X"; then
741    if test -n "$hardcode_libdir_separator"; then
742      dnl Weird platform: only the last -rpath option counts, the user must
743      dnl pass all path elements in one option. We can arrange that for a
744      dnl single library, but not when more than one $LIBNAMEs are used.
745      alldirs=
746      for found_dir in $rpathdirs; do
747        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
748      done
749      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
750      acl_save_libdir="$libdir"
751      libdir="$alldirs"
752      eval flag=\"$hardcode_libdir_flag_spec\"
753      libdir="$acl_save_libdir"
754      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
755    else
756      dnl The -rpath options are cumulative.
757      for found_dir in $rpathdirs; do
758        acl_save_libdir="$libdir"
759        libdir="$found_dir"
760        eval flag=\"$hardcode_libdir_flag_spec\"
761        libdir="$acl_save_libdir"
762        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
763      done
764    fi
765  fi
766  if test "X$ltrpathdirs" != "X"; then
767    dnl When using libtool, the option that works for both libraries and
768    dnl executables is -R. The -R options are cumulative.
769    for found_dir in $ltrpathdirs; do
770      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
771    done
772  fi
773])
774
775dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
776dnl unless already present in VAR.
777dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
778dnl contains two or three consecutive elements that belong together.
779AC_DEFUN([AC_LIB_APPENDTOVAR],
780[
781  for element in [$2]; do
782    haveit=
783    for x in $[$1]; do
784      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
785      if test "X$x" = "X$element"; then
786        haveit=yes
787        break
788      fi
789    done
790    if test -z "$haveit"; then
791      [$1]="${[$1]}${[$1]:+ }$element"
792    fi
793  done
794])
795
796dnl For those cases where a variable contains several -L and -l options
797dnl referring to unknown libraries and directories, this macro determines the
798dnl necessary additional linker options for the runtime path.
799dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
800dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
801dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
802dnl otherwise linking without libtool is assumed.
803AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
804[
805  AC_REQUIRE([AC_LIB_RPATH])
806  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
807  $1=
808  if test "$enable_rpath" != no; then
809    if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
810      dnl Use an explicit option to hardcode directories into the resulting
811      dnl binary.
812      rpathdirs=
813      next=
814      for opt in $2; do
815        if test -n "$next"; then
816          dir="$next"
817          dnl No need to hardcode the standard /usr/lib.
818          if test "X$dir" != "X/usr/$acl_libdirstem"; then
819            rpathdirs="$rpathdirs $dir"
820          fi
821          next=
822        else
823          case $opt in
824            -L) next=yes ;;
825            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
826                 dnl No need to hardcode the standard /usr/lib.
827                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
828                   rpathdirs="$rpathdirs $dir"
829                 fi
830                 next= ;;
831            *) next= ;;
832          esac
833        fi
834      done
835      if test "X$rpathdirs" != "X"; then
836        if test -n ""$3""; then
837          dnl libtool is used for linking. Use -R options.
838          for dir in $rpathdirs; do
839            $1="${$1}${$1:+ }-R$dir"
840          done
841        else
842          dnl The linker is used for linking directly.
843          if test -n "$hardcode_libdir_separator"; then
844            dnl Weird platform: only the last -rpath option counts, the user
845            dnl must pass all path elements in one option.
846            alldirs=
847            for dir in $rpathdirs; do
848              alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
849            done
850            acl_save_libdir="$libdir"
851            libdir="$alldirs"
852            eval flag=\"$hardcode_libdir_flag_spec\"
853            libdir="$acl_save_libdir"
854            $1="$flag"
855          else
856            dnl The -rpath options are cumulative.
857            for dir in $rpathdirs; do
858              acl_save_libdir="$libdir"
859              libdir="$dir"
860              eval flag=\"$hardcode_libdir_flag_spec\"
861              libdir="$acl_save_libdir"
862              $1="${$1}${$1:+ }$flag"
863            done
864          fi
865        fi
866      fi
867    fi
868  fi
869  AC_SUBST([$1])
870])
871
872# lib-prefix.m4 serial 5 (gettext-0.15)
873dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
874dnl This file is free software; the Free Software Foundation
875dnl gives unlimited permission to copy and/or distribute it,
876dnl with or without modifications, as long as this notice is preserved.
877
878dnl From Bruno Haible.
879
880dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
881dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
882dnl require excessive bracketing.
883ifdef([AC_HELP_STRING],
884[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
885[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
886
887dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
888dnl to access previously installed libraries. The basic assumption is that
889dnl a user will want packages to use other packages he previously installed
890dnl with the same --prefix option.
891dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
892dnl libraries, but is otherwise very convenient.
893AC_DEFUN([AC_LIB_PREFIX],
894[
895  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
896  AC_REQUIRE([AC_PROG_CC])
897  AC_REQUIRE([AC_CANONICAL_HOST])
898  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
899  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
900  dnl By default, look in $includedir and $libdir.
901  use_additional=yes
902  AC_LIB_WITH_FINAL_PREFIX([
903    eval additional_includedir=\"$includedir\"
904    eval additional_libdir=\"$libdir\"
905  ])
906  AC_LIB_ARG_WITH([lib-prefix],
907[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
908  --without-lib-prefix    don't search for libraries in includedir and libdir],
909[
910    if test "X$withval" = "Xno"; then
911      use_additional=no
912    else
913      if test "X$withval" = "X"; then
914        AC_LIB_WITH_FINAL_PREFIX([
915          eval additional_includedir=\"$includedir\"
916          eval additional_libdir=\"$libdir\"
917        ])
918      else
919        additional_includedir="$withval/include"
920        additional_libdir="$withval/$acl_libdirstem"
921      fi
922    fi
923])
924  if test $use_additional = yes; then
925    dnl Potentially add $additional_includedir to $CPPFLAGS.
926    dnl But don't add it
927    dnl   1. if it's the standard /usr/include,
928    dnl   2. if it's already present in $CPPFLAGS,
929    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
930    dnl   4. if it doesn't exist as a directory.
931    if test "X$additional_includedir" != "X/usr/include"; then
932      haveit=
933      for x in $CPPFLAGS; do
934        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
935        if test "X$x" = "X-I$additional_includedir"; then
936          haveit=yes
937          break
938        fi
939      done
940      if test -z "$haveit"; then
941        if test "X$additional_includedir" = "X/usr/local/include"; then
942          if test -n "$GCC"; then
943            case $host_os in
944              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
945            esac
946          fi
947        fi
948        if test -z "$haveit"; then
949          if test -d "$additional_includedir"; then
950            dnl Really add $additional_includedir to $CPPFLAGS.
951            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
952          fi
953        fi
954      fi
955    fi
956    dnl Potentially add $additional_libdir to $LDFLAGS.
957    dnl But don't add it
958    dnl   1. if it's the standard /usr/lib,
959    dnl   2. if it's already present in $LDFLAGS,
960    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
961    dnl   4. if it doesn't exist as a directory.
962    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
963      haveit=
964      for x in $LDFLAGS; do
965        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
966        if test "X$x" = "X-L$additional_libdir"; then
967          haveit=yes
968          break
969        fi
970      done
971      if test -z "$haveit"; then
972        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
973          if test -n "$GCC"; then
974            case $host_os in
975              linux*) haveit=yes;;
976            esac
977          fi
978        fi
979        if test -z "$haveit"; then
980          if test -d "$additional_libdir"; then
981            dnl Really add $additional_libdir to $LDFLAGS.
982            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
983          fi
984        fi
985      fi
986    fi
987  fi
988])
989
990dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
991dnl acl_final_exec_prefix, containing the values to which $prefix and
992dnl $exec_prefix will expand at the end of the configure script.
993AC_DEFUN([AC_LIB_PREPARE_PREFIX],
994[
995  dnl Unfortunately, prefix and exec_prefix get only finally determined
996  dnl at the end of configure.
997  if test "X$prefix" = "XNONE"; then
998    acl_final_prefix="$ac_default_prefix"
999  else
1000    acl_final_prefix="$prefix"
1001  fi