1# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008, 2009  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
14m4_ifndef([AC_AUTOCONF_VERSION],
15  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17[m4_warning([this file was generated for autoconf 2.68.
18You have another version of autoconf.  It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22# gpg-error.m4 - autoconf macro to detect libgpg-error.
23# Copyright (C) 2002, 2003, 2004 g10 Code GmbH
24#
25# This file is free software; as a special exception the author gives
26# unlimited permission to copy and/or distribute it, with or without
27# modifications, as long as this notice is preserved.
28#
29# This file is distributed in the hope that it will be useful, but
30# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
31# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
32
33dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
34dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
35dnl Test for libgpg-error and define GPG_ERROR_CFLAGS and GPG_ERROR_LIBS
36dnl
37AC_DEFUN([AM_PATH_GPG_ERROR],
38[ AC_ARG_WITH(gpg-error-prefix,
39            AC_HELP_STRING([--with-gpg-error-prefix=PFX],
40                           [prefix where GPG Error is installed (optional)]),
41     gpg_error_config_prefix="$withval", gpg_error_config_prefix="")
42  if test x$gpg_error_config_prefix != x ; then
43     if test x${GPG_ERROR_CONFIG+set} != xset ; then
44        GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config
45     fi
46  fi
47
48  AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
49  min_gpg_error_version=ifelse([$1], ,0.0,$1)
50  AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
51  ok=no
52  if test "$GPG_ERROR_CONFIG" != "no" ; then
53    req_major=`echo $min_gpg_error_version | \
54               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
55    req_minor=`echo $min_gpg_error_version | \
56               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
57    gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
58    major=`echo $gpg_error_config_version | \
59               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
60    minor=`echo $gpg_error_config_version | \
61               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
62    if test "$major" -gt "$req_major"; then
63        ok=yes
64    else 
65        if test "$major" -eq "$req_major"; then
66            if test "$minor" -ge "$req_minor"; then
67               ok=yes
68            fi
69        fi
70    fi
71  fi
72  if test $ok = yes; then
73    GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
74    GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
75    AC_MSG_RESULT([yes ($gpg_error_config_version)])
76    ifelse([$2], , :, [$2])
77  else
78    GPG_ERROR_CFLAGS=""
79    GPG_ERROR_LIBS=""
80    AC_MSG_RESULT(no)
81    ifelse([$3], , :, [$3])
82  fi
83  AC_SUBST(GPG_ERROR_CFLAGS)
84  AC_SUBST(GPG_ERROR_LIBS)
85])
86
87
88# iconv.m4 serial 11 (gettext-0.18.1)
89dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
90dnl This file is free software; the Free Software Foundation
91dnl gives unlimited permission to copy and/or distribute it,
92dnl with or without modifications, as long as this notice is preserved.
93
94dnl From Bruno Haible.
95
96AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
97[
98  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
99  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
100  AC_REQUIRE([AC_LIB_RPATH])
101
102  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
103  dnl accordingly.
104  AC_LIB_LINKFLAGS_BODY([iconv])
105])
106
107AC_DEFUN([AM_ICONV_LINK],
108[
109  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
110  dnl those with the standalone portable GNU libiconv installed).
111  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
112
113  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
114  dnl accordingly.
115  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
116
117  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
118  dnl because if the user has installed libiconv and not disabled its use
119  dnl via --without-libiconv-prefix, he wants to use it. The first
120  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
121  am_save_CPPFLAGS="$CPPFLAGS"
122  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
123
124  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
125    am_cv_func_iconv="no, consider installing GNU libiconv"
126    am_cv_lib_iconv=no
127    AC_TRY_LINK([#include <stdlib.h>
128#include <iconv.h>],
129      [iconv_t cd = iconv_open("","");
130       iconv(cd,NULL,NULL,NULL,NULL);
131       iconv_close(cd);],
132      [am_cv_func_iconv=yes])
133    if test "$am_cv_func_iconv" != yes; then
134      am_save_LIBS="$LIBS"
135      LIBS="$LIBS $LIBICONV"
136      AC_TRY_LINK([#include <stdlib.h>
137#include <iconv.h>],
138        [iconv_t cd = iconv_open("","");
139         iconv(cd,NULL,NULL,NULL,NULL);
140         iconv_close(cd);],
141        [am_cv_lib_iconv=yes]
142        [am_cv_func_iconv=yes])
143      LIBS="$am_save_LIBS"
144    fi
145  ])
146  if test "$am_cv_func_iconv" = yes; then
147    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
148      dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
149      am_save_LIBS="$LIBS"
150      if test $am_cv_lib_iconv = yes; then
151        LIBS="$LIBS $LIBICONV"
152      fi
153      AC_TRY_RUN([
154#include <iconv.h>
155#include <string.h>
156int main ()
157{
158  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
159     returns.  */
160  {
161    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
162    if (cd_utf8_to_88591 != (iconv_t)(-1))
163      {
164        static const char input[] = "\342\202\254"; /* EURO SIGN */
165        char buf[10];
166        const char *inptr = input;
167        size_t inbytesleft = strlen (input);
168        char *outptr = buf;
169        size_t outbytesleft = sizeof (buf);
170        size_t res = iconv (cd_utf8_to_88591,
171                            (char **) &inptr, &inbytesleft,
172                            &outptr, &outbytesleft);
173        if (res == 0)
174          return 1;
175      }
176  }
177  /* Test against Solaris 10 bug: Failures are not distinguishable from
178     successful returns.  */
179  {
180    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
181    if (cd_ascii_to_88591 != (iconv_t)(-1))
182      {
183        static const char input[] = "\263";
184        char buf[10];
185        const char *inptr = input;
186        size_t inbytesleft = strlen (input);
187        char *outptr = buf;
188        size_t outbytesleft = sizeof (buf);
189        size_t res = iconv (cd_ascii_to_88591,
190                            (char **) &inptr, &inbytesleft,
191                            &outptr, &outbytesleft);
192        if (res == 0)
193          return 1;
194      }
195  }
196#if 0 /* This bug could be worked around by the caller.  */
197  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
198  {
199    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
200    if (cd_88591_to_utf8 != (iconv_t)(-1))
201      {
202        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
203        char buf[50];
204        const char *inptr = input;
205        size_t inbytesleft = strlen (input);
206        char *outptr = buf;
207        size_t outbytesleft = sizeof (buf);
208        size_t res = iconv (cd_88591_to_utf8,
209                            (char **) &inptr, &inbytesleft,
210                            &outptr, &outbytesleft);
211        if ((int)res > 0)
212          return 1;
213      }
214  }
215#endif
216  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
217     provided.  */
218  if (/* Try standardized names.  */
219      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
220      /* Try IRIX, OSF/1 names.  */
221      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
222      /* Try AIX names.  */
223      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
224      /* Try HP-UX names.  */
225      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
226    return 1;
227  return 0;
228}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
229        [case "$host_os" in
230           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
231           *)            am_cv_func_iconv_works="guessing yes" ;;
232         esac])
233      LIBS="$am_save_LIBS"
234    ])
235    case "$am_cv_func_iconv_works" in
236      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
237      *)   am_func_iconv=yes ;;
238    esac
239  else
240    am_func_iconv=no am_cv_lib_iconv=no
241  fi
242  if test "$am_func_iconv" = yes; then
243    AC_DEFINE([HAVE_ICONV], [1],
244      [Define if you have the iconv() function and it works.])
245  fi
246  if test "$am_cv_lib_iconv" = yes; then
247    AC_MSG_CHECKING([how to link with libiconv])
248    AC_MSG_RESULT([$LIBICONV])
249  else
250    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
251    dnl either.
252    CPPFLAGS="$am_save_CPPFLAGS"
253    LIBICONV=
254    LTLIBICONV=
255  fi
256  AC_SUBST([LIBICONV])
257  AC_SUBST([LTLIBICONV])
258])
259
260dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
261dnl avoid warnings like
262dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
263dnl This is tricky because of the way 'aclocal' is implemented:
264dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
265dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
266dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
267dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
268dnl   warnings.
269m4_define([gl_iconv_AC_DEFUN],
270  m4_version_prereq([2.64],
271    [[AC_DEFUN_ONCE(
272        [$1], [$2])]],
273    [[AC_DEFUN(
274        [$1], [$2])]]))
275gl_iconv_AC_DEFUN([AM_ICONV],
276[
277  AM_ICONV_LINK
278  if test "$am_cv_func_iconv" = yes; then
279    AC_MSG_CHECKING([for iconv declaration])
280    AC_CACHE_VAL([am_cv_proto_iconv], [
281      AC_TRY_COMPILE([
282#include <stdlib.h>
283#include <iconv.h>
284extern
285#ifdef __cplusplus
286"C"
287#endif
288#if defined(__STDC__) || defined(__cplusplus)
289size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
290#else
291size_t iconv();
292#endif
293], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
294      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);"])
295    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
296    AC_MSG_RESULT([
297         $am_cv_proto_iconv])
298    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
299      [Define as const if the declaration of iconv() needs const.])
300  fi
301])
302
303# lib-ld.m4 serial 4 (gettext-0.18)
304dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
305dnl This file is free software; the Free Software Foundation
306dnl gives unlimited permission to copy and/or distribute it,
307dnl with or without modifications, as long as this notice is preserved.
308
309dnl Subroutines of libtool.m4,
310dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
311dnl with libtool.m4.
312
313dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
314AC_DEFUN([AC_LIB_PROG_LD_GNU],
315[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
316[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
317case `$LD -v 2>&1 </dev/null` in
318*GNU* | *'with BFD'*)
319  acl_cv_prog_gnu_ld=yes ;;
320*)
321  acl_cv_prog_gnu_ld=no ;;
322esac])
323with_gnu_ld=$acl_cv_prog_gnu_ld
324])
325
326dnl From libtool-1.4. Sets the variable LD.
327AC_DEFUN([AC_LIB_PROG_LD],
328[AC_ARG_WITH([gnu-ld],
329[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
330test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
331AC_REQUIRE([AC_PROG_CC])dnl
332AC_REQUIRE([AC_CANONICAL_HOST])dnl
333# Prepare PATH_SEPARATOR.
334# The user is always right.
335if test "${PATH_SEPARATOR+set}" != set; then
336  echo "#! /bin/sh" >conf$$.sh
337  echo  "exit 0"   >>conf$$.sh
338  chmod +x conf$$.sh
339  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
340    PATH_SEPARATOR=';'
341  else
342    PATH_SEPARATOR=:
343  fi
344  rm -f conf$$.sh
345fi
346ac_prog=ld
347if test "$GCC" = yes; then
348  # Check if gcc -print-prog-name=ld gives a path.
349  AC_MSG_CHECKING([for ld used by GCC])
350  case $host in
351  *-*-mingw*)
352    # gcc leaves a trailing carriage return which upsets mingw
353    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
354  *)
355    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
356  esac
357  case $ac_prog in
358    # Accept absolute paths.
359    [[\\/]* | [A-Za-z]:[\\/]*)]
360      [re_direlt='/[^/][^/]*/\.\./']
361      # Canonicalize the path of ld
362      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
363      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
364        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
365      done
366      test -z "$LD" && LD="$ac_prog"
367      ;;
368  "")
369    # If it fails, then pretend we aren't using GCC.
370    ac_prog=ld
371    ;;
372  *)
373    # If it is relative, then search for the first ld in PATH.
374    with_gnu_ld=unknown
375    ;;
376  esac
377elif test "$with_gnu_ld" = yes; then
378  AC_MSG_CHECKING([for GNU ld])
379else
380  AC_MSG_CHECKING([for non-GNU ld])
381fi
382AC_CACHE_VAL([acl_cv_path_LD],
383[if test -z "$LD"; then
384  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
385  for ac_dir in $PATH; do
386    test -z "$ac_dir" && ac_dir=.
387    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
388      acl_cv_path_LD="$ac_dir/$ac_prog"
389      # Check to see if the program is GNU ld.  I'd rather use --version,
390      # but apparently some GNU ld's only accept -v.
391      # Break only if it was the GNU/non-GNU ld that we prefer.
392      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
393      *GNU* | *'with BFD'*)
394        test "$with_gnu_ld" != no && break ;;
395      *)
396        test "$with_gnu_ld" != yes && break ;;
397      esac
398    fi
399  done
400  IFS="$ac_save_ifs"
401else
402  acl_cv_path_LD="$LD" # Let the user override the test with a path.
403fi])
404LD="$acl_cv_path_LD"
405if test -n "$LD"; then
406  AC_MSG_RESULT([$LD])
407else
408  AC_MSG_RESULT([no])
409fi
410test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
411AC_LIB_PROG_LD_GNU
412])
413
414# lib-link.m4 serial 21 (gettext-0.18)
415dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
416dnl This file is free software; the Free Software Foundation
417dnl gives unlimited permission to copy and/or distribute it,
418dnl with or without modifications, as long as this notice is preserved.
419
420dnl From Bruno Haible.
421
422AC_PREREQ([2.54])
423
424dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
425dnl the libraries corresponding to explicit and implicit dependencies.
426dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
427dnl augments the CPPFLAGS variable.
428dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
429dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
430AC_DEFUN([AC_LIB_LINKFLAGS],
431[
432  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
433  AC_REQUIRE([AC_LIB_RPATH])
434  pushdef([Name],[translit([$1],[./-], [___])])
435  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
436                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
437  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
438    AC_LIB_LINKFLAGS_BODY([$1], [$2])
439    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
440    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
441    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
442    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
443  ])
444  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
445  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
446  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
447  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
448  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
449  AC_SUBST([LIB]NAME)
450  AC_SUBST([LTLIB]NAME)
451  AC_SUBST([LIB]NAME[_PREFIX])
452  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
453  dnl results of this search when this library appears as a dependency.
454  HAVE_LIB[]NAME=yes
455  popdef([NAME])
456  popdef([Name])
457])
458
459dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
460dnl searches for libname and the libraries corresponding to explicit and
461dnl implicit dependencies, together with the specified include files and
462dnl the ability to compile and link the specified testcode. The missing-message
463dnl defaults to 'no' and may contain additional hints for the user.
464dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
465dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
466dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
467dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
468dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
469dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
470AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
471[
472  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
473  AC_REQUIRE([AC_LIB_RPATH])
474  pushdef([Name],[translit([$1],[./-], [___])])
475  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
476                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
477
478  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
479  dnl accordingly.
480  AC_LIB_LINKFLAGS_BODY([$1], [$2])
481
482  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
483  dnl because if the user has installed lib[]Name and not disabled its use
484  dnl via --without-lib[]Name-prefix, he wants to use it.
485  ac_save_CPPFLAGS="$CPPFLAGS"
486  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
487
488  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
489    ac_save_LIBS="$LIBS"
490    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
491    dnl because these -l options might require -L options that are present in
492    dnl LIBS. -l options benefit only from the -L options listed before it.
493    dnl Otherwise, add it to the front of LIBS, because it may be a static
494    dnl library that depends on another static library that is present in LIBS.
495    dnl Static libraries benefit only from the static libraries listed after
496    dnl it.
497    case " $LIB[]NAME" in
498      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
499      *)       LIBS="$LIB[]NAME $LIBS" ;;
500    esac
501    AC_TRY_LINK([$3], [$4],
502      [ac_cv_lib[]Name=yes],
503      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
504    LIBS="$ac_save_LIBS"
505  ])
506  if test "$ac_cv_lib[]Name" = yes; then
507    HAVE_LIB[]NAME=yes
508    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
509    AC_MSG_CHECKING([how to link with lib[]$1])
510    AC_MSG_RESULT([$LIB[]NAME])
511  else
512    HAVE_LIB[]NAME=no
513    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
514    dnl $INC[]NAME either.
515    CPPFLAGS="$ac_save_CPPFLAGS"
516    LIB[]NAME=
517    LTLIB[]NAME=
518    LIB[]NAME[]_PREFIX=
519  fi
520  AC_SUBST([HAVE_LIB]NAME)
521  AC_SUBST([LIB]NAME)
522  AC_SUBST([LTLIB]NAME)
523  AC_SUBST([LIB]NAME[_PREFIX])
524  popdef([NAME])
525  popdef([Name])
526])
527
528dnl Determine the platform dependent parameters needed to use rpath:
529dnl   acl_libext,
530dnl   acl_shlibext,
531dnl   acl_hardcode_libdir_flag_spec,
532dnl   acl_hardcode_libdir_separator,
533dnl   acl_hardcode_direct,
534dnl   acl_hardcode_minus_L.
535AC_DEFUN([AC_LIB_RPATH],
536[
537  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
538  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
539  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
540  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
541  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
542  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
543  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
544    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
545    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
546    . ./conftest.sh
547    rm -f ./conftest.sh
548    acl_cv_rpath=done
549  ])
550  wl="$acl_cv_wl"
551  acl_libext="$acl_cv_libext"
552  acl_shlibext="$acl_cv_shlibext"
553  acl_libname_spec="$acl_cv_libname_spec"
554  acl_library_names_spec="$acl_cv_library_names_spec"
555  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
556  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
557  acl_hardcode_direct="$acl_cv_hardcode_direct"
558  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
559  dnl Determine whether the user wants rpath handling at all.
560  AC_ARG_ENABLE([rpath],
561    [  --disable-rpath         do not hardcode runtime library paths],
562    :, enable_rpath=yes)
563])
564
565dnl AC_LIB_FROMPACKAGE(name, package)
566dnl declares that libname comes from the given package. The configure file
567dnl will then not have a --with-libname-prefix option but a
568dnl --with-package-prefix option. Several libraries can come from the same
569dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
570dnl macro call that searches for libname.
571AC_DEFUN([AC_LIB_FROMPACKAGE],
572[
573  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
574                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
575  define([acl_frompackage_]NAME, [$2])
576  popdef([NAME])
577  pushdef([PACK],[$2])
578  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
579                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
580  define([acl_libsinpackage_]PACKUP,
581    m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
582  popdef([PACKUP])
583  popdef([PACK])
584])
585
586dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
587dnl the libraries corresponding to explicit and implicit dependencies.
588dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
589dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
590dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
591AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
592[
593  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
594  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
595                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
596  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
597  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
598                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
599  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
600  dnl Autoconf >= 2.61 supports dots in --with options.
601  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
602  dnl By default, look in $includedir and $libdir.
603  use_additional=yes
604  AC_LIB_WITH_FINAL_PREFIX([
605    eval additional_includedir=\"$includedir\"
606    eval additional_libdir=\"$libdir\"
607  ])
608  AC_ARG_WITH(P_A_C_K[-prefix],
609[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
610  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
611[
612    if test "X$withval" = "Xno"; then
613      use_additional=no
614    else
615      if test "X$withval" = "X"; then
616        AC_LIB_WITH_FINAL_PREFIX([
617          eval additional_includedir=\"$includedir\"
618          eval additional_libdir=\"$libdir\"
619        ])
620      else
621        additional_includedir="$withval/include"
622        additional_libdir="$withval/$acl_libdirstem"
623        if test "$acl_libdirstem2" != "$acl_libdirstem" \
624           && ! test -d "$withval/$acl_libdirstem"; then
625          additional_libdir="$withval/$acl_libdirstem2"
626        fi
627      fi
628    fi
629])
630  dnl Search the library and its dependencies in $additional_libdir and
631  dnl $LDFLAGS. Using breadth-first-seach.
632  LIB[]NAME=
633  LTLIB[]NAME=
634  INC[]NAME=
635  LIB[]NAME[]_PREFIX=
636  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
637  dnl computed. So it has to be reset here.
638  HAVE_LIB[]NAME=
639  rpathdirs=
640  ltrpathdirs=
641  names_already_handled=
642  names_next_round='$1 $2'
643  while test -n "$names_next_round"; do
644    names_this_round="$names_next_round"
645    names_next_round=
646    for name in $names_this_round; do
647      already_handled=
648      for n in $names_already_handled; do
649        if test "$n" = "$name"; then
650          already_handled=yes
651          break
652        fi
653      done
654      if test -z "$already_handled"; then
655        names_already_handled="$names_already_handled $name"
656        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
657        dnl or AC_LIB_HAVE_LINKFLAGS call.
658        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
659        eval value=\"\$HAVE_LIB$uppername\"
660        if test -n "$value"; then
661          if test "$value" = yes; then
662            eval value=\"\$LIB$uppername\"
663            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
664            eval value=\"\$LTLIB$uppername\"
665            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
666          else
667            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
668            dnl that this library doesn't exist. So just drop it.
669            :
670          fi
671        else
672          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
673          dnl and the already constructed $LIBNAME/$LTLIBNAME.
674          found_dir=
675          found_la=
676          found_so=
677          found_a=
678          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
679          if test -n "$acl_shlibext"; then
680            shrext=".$acl_shlibext"             # typically: shrext=.so
681          else
682            shrext=
683          fi
684          if test $use_additional = yes; then
685            dir="$additional_libdir"
686            dnl The same code as in the loop below:
687            dnl First look for a shared library.
688            if test -n "$acl_shlibext"; then
689              if test -f "$dir/$libname$shrext"; then
690                found_dir="$dir"
691                found_so="$dir/$libname$shrext"
692              else
693                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
694                  ver=`(cd "$dir" && \
695                        for f in "$libname$shrext".*; do echo "$f"; done \
696                        | sed -e "s,^$libname$shrext\\\\.,," \
697                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
698                        | sed 1q ) 2>/dev/null`
699                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
700                    found_dir="$dir"
701                    found_so="$dir/$libname$shrext.$ver"
702                  fi
703                else
704                  eval library_names=\"$acl_library_names_spec\"
705                  for f in $library_names; do
706                    if test -f "$dir/$f"; then
707                      found_dir="$dir"
708                      found_so="$dir/$f"
709                      break
710                    fi
711                  done
712                fi
713              fi
714            fi
715            dnl Then look for a static library.
716            if test "X$found_dir" = "X"; then
717              if test -f "$dir/$libname.$acl_libext"; then
718                found_dir="$dir"
719                found_a="$dir/$libname.$acl_libext"
720              fi
721            fi
722            if test "X$found_dir" != "X"; then
723              if test -f "$dir/$libname.la"; then
724                found_la="$dir/$libname.la"
725              fi
726            fi
727          fi
728          if test "X$found_dir" = "X"; then
729            for x in $LDFLAGS $LTLIB[]NAME; do
730              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
731              case "$x" in
732                -L*)
733                  dir=`echo "X$x" | sed -e 's/^X-L//'`
734                  dnl First look for a shared library.
735                  if test -n "$acl_shlibext"; then
736                    if test -f "$dir/$libname$shrext"; then
737                      found_dir="$dir"
738                      found_so="$dir/$libname$shrext"
739                    else
740                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
741                        ver=`(cd "$dir" && \
742                              for f in "$libname$shrext".*; do echo "$f"; done \
743                              | sed -e "s,^$libname$shrext\\\\.,," \
744                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
745                              | sed 1q ) 2>/dev/null`
746                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
747                          found_dir="$dir"
748                          found_so="$dir/$libname$shrext.$ver"
749                        fi
750                      else
751                        eval library_names=\"$acl_library_names_spec\"
752                        for f in $library_names; do
753                          if test -f "$dir/$f"; then
754                            found_dir="$dir"
755                            found_so="$dir/$f"
756                            break
757                          fi
758                        done
759                      fi
760                    fi
761                  fi
762                  dnl Then look for a static library.
763                  if test "X$found_dir" = "X"; then
764                    if test -f "$dir/$libname.$acl_libext"; then
765                      found_dir="$dir"
766                      found_a="$dir/$libname.$acl_libext"
767                    fi
768                  fi
769                  if test "X$found_dir" != "X"; then
770                    if test -f "$dir/$libname.la"; then
771                      found_la="$dir/$libname.la"
772                    fi
773                  fi
774                  ;;
775              esac
776              if test "X$found_dir" != "X"; then
777                break
778              fi
779            done
780          fi
781          if test "X$found_dir" != "X"; then
782            dnl Found the library.
783            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
784            if test "X$found_so" != "X"; then
785              dnl Linking with a shared library. We attempt to hardcode its
786              dnl directory into the executable's runpath, unless it's the
787              dnl standard /usr/lib.
788              if test "$enable_rpath" = no \
789                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
790                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
791                dnl No hardcoding is needed.
792                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
793              else
794                dnl Use an explicit option to hardcode DIR into the resulting
795                dnl binary.
796                dnl Potentially add DIR to ltrpathdirs.
797                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
798                haveit=
799                for x in $ltrpathdirs; do
800                  if test "X$x" = "X$found_dir"; then
801                    haveit=yes
802                    break
803                  fi
804                done
805                if test -z "$haveit"; then
806                  ltrpathdirs="$ltrpathdirs $found_dir"
807                fi
808                dnl The hardcoding into $LIBNAME is system dependent.
809                if test "$acl_hardcode_direct" = yes; then
810                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
811                  dnl resulting binary.
812                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
813                else
814                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
815                    dnl Use an explicit option to hardcode DIR into the resulting
816                    dnl binary.
817                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
818                    dnl Potentially add DIR to rpathdirs.
819                    dnl The rpathdirs will be appended to $LIBNAME at the end.
820                    haveit=
821                    for x in $rpathdirs; do
822                      if test "X$x" = "X$found_dir"; then
823                        haveit=yes
824                        break
825                      fi
826                    done
827                    if test -z "$haveit"; then
828                      rpathdirs="$rpathdirs $found_dir"
829                    fi
830                  else
831                    dnl Rely on "-L$found_dir".
832                    dnl But don't add it if it's already contained in the LDFLAGS
833                    dnl or the already constructed $LIBNAME
834                    haveit=
835                    for x in $LDFLAGS $LIB[]NAME; do
836                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
837                      if test "X$x" = "X-L$found_dir"; then
838                        haveit=yes
839                        break
840                      fi
841                    done
842                    if test -z "$haveit"; then
843                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
844                    fi
845                    if test "$acl_hardcode_minus_L" != no; then
846                      dnl FIXME: Not sure whether we should use
847                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
848                      dnl here.
849                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
850                    else
851                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
852                      dnl here, because this doesn't fit in flags passed to the
853                      dnl compiler. So give up. No hardcoding. This affects only
854                      dnl very old systems.
855                      dnl FIXME: Not sure whether we should use
856                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
857                      dnl here.
858                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
859                    fi
860                  fi
861                fi
862              fi
863            else
864              if test "X$found_a" != "X"; then
865                dnl Linking with a static library.
866                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
867              else
868                dnl We shouldn't come here, but anyway it's good to have a
869                dnl fallback.
870                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
871              fi
872            fi
873            dnl Assume the include files are nearby.
874            additional_includedir=
875            case "$found_dir" in
876              */$acl_libdirstem | */$acl_libdirstem/)
877                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
878                if test "$name" = '$1'; then
879                  LIB[]NAME[]_PREFIX="$basedir"
880                fi
881                additional_includedir="$basedir/include"
882                ;;
883              */$acl_libdirstem2 | */$acl_libdirstem2/)
884                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
885                if test "$name" = '$1'; then
886                  LIB[]NAME[]_PREFIX="$basedir"
887                fi
888                additional_includedir="$basedir/include"
889                ;;
890            esac
891            if test "X$additional_includedir" != "X"; then
892              dnl Potentially add $additional_includedir to $INCNAME.
893              dnl But don't add it
894              dnl   1. if it's the standard /usr/include,
895              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
896              dnl   3. if it's already present in $CPPFLAGS or the already
897              dnl      constructed $INCNAME,
898              dnl   4. if it doesn't exist as a directory.
899              if test "X$additional_includedir" != "X/usr/include"; then
900                haveit=
901                if test "X$additional_includedir" = "X/usr/local/include"; then
902                  if test -n "$GCC"; then
903                    case $host_os in
904                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
905                    esac
906                  fi
907                fi
908                if test -z "$haveit"; then
909                  for x in $CPPFLAGS $INC[]NAME; do
910                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
911                    if test "X$x" = "X-I$additional_includedir"; then
912                      haveit=yes
913                      break
914                    fi
915                  done
916                  if test -z "$haveit"; then
917                    if test -d "$additional_includedir"; then
918                      dnl Really add $additional_includedir to $INCNAME.
919                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
920                    fi
921                  fi
922                fi
923              fi
924            fi
925            dnl Look for dependencies.
926            if test -n "$found_la"; then
927              dnl Read the .la file. It defines the variables
928              dnl dlname, library_names, old_library, dependency_libs, current,
929              dnl age, revision, installed, dlopen, dlpreopen, libdir.
930              save_libdir="$libdir"
931              case "$found_la" in
932                */* | *\\*) . "$found_la" ;;
933                *) . "./$found_la" ;;
934              esac
935              libdir="$save_libdir"
936              dnl We use only dependency_libs.
937              for dep in $dependency_libs; do
938                case "$dep" in
939                  -L*)
940                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
941                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
942                    dnl But don't add it
943                    dnl   1. if it's the standard /usr/lib,
944                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
945                    dnl   3. if it's already present in $LDFLAGS or the already
946                    dnl      constructed $LIBNAME,
947                    dnl   4. if it doesn't exist as a directory.
948                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
949                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
950                      haveit=
951                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
952                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
953                        if test -n "$GCC"; then
954                          case $host_os in
955                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
956                          esac
957                        fi
958                      fi
959                      if test -z "$haveit"; then
960                        haveit=
961                        for x in $LDFLAGS $LIB[]NAME; do
962                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
963                          if test "X$x" = "X-L$additional_libdir"; then
964                            haveit=yes
965                            break
966                          fi
967                        done
968                        if test -z "$haveit"; then
969                          if test -d "$additional_libdir"; then
970                            dnl Really add $additional_libdir to $LIBNAME.
971                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
972                          fi
973                        fi
974                        haveit=
975                        for x in $LDFLAGS $LTLIB[]NAME; do
976                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
977                          if test "X$x" = "X-L$additional_libdir"; then
978                            haveit=yes
979                            break
980                          fi
981                        done
982                        if test -z "$haveit"; then
983                          if test -d "$additional_libdir"; then
984                            dnl Really add $additional_libdir to $LTLIBNAME.
985                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
986                          fi
987                        fi
988                      fi
989                    fi
990                    ;;
991                  -R*)
992                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
993                    if test "$enable_rpath" != no; then
994                      dnl Potentially add DIR to rpathdirs.
995                      dnl The rpathdirs will be appended to $LIBNAME at the end.
996                      haveit=
997                      for x in $rpathdirs; do
998                        if test "X$x" = "X$dir"; then
999                          haveit=yes
1000                          break
1001                        fi
1002                      done
1003                      if test -z "$haveit"; then
1004                        rpathdirs="$rpathdirs $dir"
1005                      fi
1006                      dnl Potentially add DIR to ltrpathdirs.
1007                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1008                      haveit=
1009                      for x in $ltrpathdirs; do
1010                        if test "X$x" = "X$dir"; then
1011                          haveit=yes
1012                          break
1013                        fi
1014                      done
1015                      if test -z "$haveit"; then
1016                        ltrpathdirs="$ltrpathdirs $dir"
1017                      fi
1018                    fi
1019                    ;;
1020                  -l*)
1021                    dnl Handle this in the next round.
1022                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1023                    ;;
1024                  *.la)
1025                    dnl Handle this in the next round. Throw away the .la's
1026                    dnl directory; it is already contained in a preceding -L
1027                    dnl option.
1028                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1029                    ;;
1030                  *)
1031                    dnl Most likely an immediate library name.
1032                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1033                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1034                    ;;
1035                esac
1036              done
1037            fi
1038          else
1039            dnl Didn't find the library; assume it is in the system directories
1040            dnl known to the linker and runtime loader. (All the system
1041            dnl directories known to the linker should also be known to the
1042            dnl runtime loader, otherwise the system is severely misconfigured.)
1043            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1044            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1045          fi
1046        fi
1047      fi
1048    done
1049  done
1050  if test "X$rpathdirs" != "X"; then
1051    if test -n "$acl_hardcode_libdir_separator"; then
1052      dnl Weird platform: only the last -rpath option counts, the user must
1053      dnl pass all path elements in one option. We can arrange that for a
1054      dnl single library, but not when more than one $LIBNAMEs are used.
1055      alldirs=
1056      for found_dir in $rpathdirs; do
1057        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1058      done
1059      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1060      acl_save_libdir="$libdir"
1061      libdir="$alldirs"
1062      eval flag=\"$acl_hardcode_libdir_flag_spec\"
1063      libdir="$acl_save_libdir"
1064      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1065    else
1066      dnl The -rpath options are cumulative.
1067      for found_dir in $rpathdirs; do
1068        acl_save_libdir="$libdir"
1069        libdir="$found_dir"
1070        eval flag=\"$acl_hardcode_libdir_flag_spec\"
1071        libdir="$acl_save_libdir"
1072        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1073      done
1074    fi
1075  fi
1076  if test "X$ltrpathdirs" != "X"; then
1077    dnl When using libtool, the option that works for both libraries and
1078    dnl executables is -R. The -R options are cumulative.
1079    for found_dir in $ltrpathdirs; do
1080      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1081    done
1082  fi
1083  popdef([P_A_C_K])
1084  popdef([PACKLIBS])
1085  popdef([PACKUP])
1086  popdef([PACK])
1087  popdef([NAME])
1088])
1089
1090dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1091dnl unless already present in VAR.
1092dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1093dnl contains two or three consecutive elements that belong together.
1094AC_DEFUN([AC_LIB_APPENDTOVAR],
1095[
1096  for element in [$2]; do
1097    haveit=
1098    for x in $[$1]; do
1099      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1100      if test "X$x" = "X$element"; then
1101        haveit=yes
1102        break
1103      fi
1104    done
1105    if test -z "$haveit"; then
1106      [$1]="${[$1]}${[$1]:+ }$element"
1107    fi
1108  done
1109])
1110
1111dnl For those cases where a variable contains several -L and -l options
1112dnl referring to unknown libraries and directories, this macro determines the
1113dnl necessary additional linker options for the runtime path.
1114dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1115dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1116dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1117dnl otherwise linking without libtool is assumed.
1118AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1119[
1120  AC_REQUIRE([AC_LIB_RPATH])
1121  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1122  $1=
1123  if test "$enable_rpath" != no; then
1124    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1125      dnl Use an explicit option to hardcode directories into the resulting
1126      dnl binary.
1127      rpathdirs=
1128      next=
1129      for opt in $2; do
1130        if test -n "$next"; then
1131          dir="$next"
1132          dnl No need to hardcode the standard /usr/lib.
1133          if test "X$dir" != "X/usr/$acl_libdirstem" \
1134             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1135            rpathdirs="$rpathdirs $dir"
1136          fi
1137          next=
1138        else
1139          case $opt in
1140            -L) next=yes ;;
1141            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1142                 dnl No need to hardcode the standard /usr/lib.
1143                 if test "X$dir" != "X/usr/$acl_libdirstem" \
1144                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1145                   rpathdirs="$rpathdirs $dir"
1146                 fi
1147                 next= ;;
1148            *) next= ;;
1149          esac
1150        fi
1151      done
1152      if test "X$rpathdirs" != "X"; then
1153        if test -n ""$3""; then
1154          dnl libtool is used for linking. Use -R options.
1155          for dir in $rpathdirs; do
1156            $1="${$1}${$1:+ }-R$dir"
1157          done
1158        else
1159          dnl The linker is used for linking directly.
1160          if test -n "$acl_hardcode_libdir_separator"; then
1161            dnl Weird platform: only the last -rpath option counts, the user
1162            dnl must pass all path elements in one option.
1163            alldirs=
1164            for dir in $rpathdirs; do
1165              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1166            done
1167            acl_save_libdir="$libdir"
1168            libdir="$alldirs"
1169            eval flag=\"$acl_hardcode_libdir_flag_spec\"
1170            libdir="$acl_save_libdir"
1171            $1="$flag"
1172          else
1173            dnl The -rpath options are cumulative.
1174            for dir in $rpathdirs; do
1175              acl_save_libdir="$libdir"
1176              libdir="$dir"
1177              eval flag=\"$acl_hardcode_libdir_flag_spec\"
1178              libdir="$acl_save_libdir"
1179              $1="${$1}${$1:+ }$flag"
1180            done
1181          fi
1182        fi
1183      fi
1184    fi
1185  fi
1186  AC_SUBST([$1])
1187])
1188
1189# lib-prefix.m4 serial 7 (gettext-0.18)
1190dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
1191dnl This file is free software; the Free Software Foundation
1192dnl gives unlimited permission to copy and/or distribute it,
1193dnl with or without modifications, as long as this notice is preserved.
1194
1195dnl From Bruno Haible.
1196
1197dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1198dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1199dnl require excessive bracketing.
1200ifdef([AC_HELP_STRING],
1201[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1202[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1203
1204dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1205dnl to access previously installed libraries. The basic assumption is that
1206dnl a user will want packages to use other packages he previously installed
1207dnl with the same --prefix option.
1208dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1209dnl libraries, but is otherwise very convenient.
1210AC_DEFUN([AC_LIB_PREFIX],
1211[
1212  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1213  AC_REQUIRE([AC_PROG_CC])
1214  AC_REQUIRE([AC_CANONICAL_HOST])
1215  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1216  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1217  dnl By default, look in $includedir and $libdir.
1218  use_additional=yes
1219  AC_LIB_WITH_FINAL_PREFIX([
1220    eval additional_includedir=\"$includedir\"
1221    eval additional_libdir=\"$libdir\"
1222  ])
1223  AC_LIB_ARG_WITH([lib-prefix],
1224[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1225  --without-lib-prefix    don't search for libraries in includedir and libdir],
1226[
1227    if test "X$withval" = "Xno"; then
1228      use_additional=no
1229    else
1230      if test "X$withval" = "X"; then
1231        AC_LIB_WITH_FINAL_PREFIX([
1232          eval additional_includedir=\"$includedir\"
1233          eval additional_libdir=\"$libdir\"
1234        ])
1235      else
1236        additional_includedir="$withval/include"
1237        additional_libdir="$withval/$acl_libdirstem"
1238      fi
1239    fi
1240])
1241  if test $use_additional = yes; then
1242    dnl Potentially add $additional_includedir to $CPPFLAGS.
1243    dnl But don't add it
1244    dnl   1. if it's the standard /usr/include,
1245    dnl   2. if it's already present in $CPPFLAGS,
1246    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1247    dnl   4. if it doesn't exist as a directory.
1248    if test "X$additional_includedir" != "X/usr/include"; then
1249      haveit=
1250      for x in $CPPFLAGS; do
1251        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1252        if test "X$x" = "X-I$additional_includedir"; then
1253          haveit=yes
1254          break
1255        fi
1256      done
1257      if test -z "$haveit"; then
1258        if test "X$additional_includedir" = "X/usr/local/include"; then
1259          if test -n "$GCC"; then
1260            case $host_os in
1261              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1262            esac
1263          fi
1264        fi
1265        if test -z "$haveit"; then
1266          if test -d "$additional_includedir"; then
1267            dnl Really add $additional_includedir to $CPPFLAGS.
1268            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1269          fi
1270        fi
1271      fi
1272    fi
1273    dnl Potentially add $additional_libdir to $LDFLAGS.
1274    dnl But don't add it
1275    dnl   1. if it's the standard /usr/lib,
1276    dnl   2. if it's already present in $LDFLAGS,
1277    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1278    dnl   4. if it doesn't exist as a directory.
1279    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1280      haveit=
1281      for x in $LDFLAGS; do
1282        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1283        if test "X$x" = "X-L$additional_libdir"; then
1284          haveit=yes
1285          break
1286        fi
1287      done
1288      if test -z "$haveit"; then
1289        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1290          if test -n "$GCC"; then
1291            case $host_os in
1292              linux*) haveit=yes;;
1293            esac
1294          fi
1295        fi
1296        if test -z "$haveit"; then
1297          if test -d "$additional_libdir"; then
1298            dnl Really add $additional_libdir to $LDFLAGS.
1299            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1300          fi
1301        fi
1302      fi
1303    fi
1304  fi
1305])
1306
1307dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1308dnl acl_final_exec_prefix, containing the values to which $prefix and
1309dnl $exec_prefix will expand at the end of the configure script.
1310AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1311[
1312  dnl Unfortunately, prefix and exec_prefix get only finally determined
1313  dnl at the end of configure.
1314  if test "X$prefix" = "XNONE"; then
1315    acl_final_prefix="$ac_default_prefix"
1316  else
1317    acl_final_prefix="$prefix"
1318  fi
1319  if test "X$exec_prefix" = "XNONE"; then
1320    acl_final_exec_prefix='${prefix}'
1321  else
1322    acl_final_exec_prefix="$exec_prefix"
1323  fi
1324  acl_save_prefix="$prefix"
1325  prefix="$acl_final_prefix"
1326  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1327  prefix="$acl_save_prefix"
1328])
1329
1330dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1331dnl variables prefix and exec_prefix bound to the values they will have
1332dnl at the end of the configure script.
1333AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1334[
1335  acl_save_prefix="$prefix"
1336  prefix="$acl_final_prefix"
1337  acl_save_exec_prefix="$exec_prefix"
1338  exec_prefix="$acl_final_exec_prefix"
1339  $1
1340  exec_prefix="$acl_save_exec_prefix"
1341  prefix="$acl_save_prefix"
1342])
1343
1344dnl AC_LIB_PREPARE_MULTILIB creates
1345dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1346dnl   "lib" or "lib64" or "lib/64",
1347dnl - a variable acl_libdirstem2, as a secondary possible value for
1348dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1349dnl   "lib/amd64".
1350AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1351[
1352  dnl There is no formal standard regarding lib and lib64.
1353  dnl On glibc systems, the current practice is that on a system supporting
1354  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1355  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1356  dnl the compiler's default mode by looking at the compiler's library search
1357  dnl path. If at least one of its elements ends in /lib64 or points to a
1358  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1359  dnl Otherwise we use the default, namely "lib".
1360  dnl On Solaris systems, the current practice is that on a system supporting
1361  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1362  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1363  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1364  AC_REQUIRE([AC_CANONICAL_HOST])
1365  acl_libdirstem=lib
1366  acl_libdirstem2=
1367  case "$host_os" in
1368    solaris*)
1369      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1370      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1371      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1372      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1373      dnl symlink is missing, so we set acl_libdirstem2 too.
1374      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1375        [AC_EGREP_CPP([sixtyfour bits], [
1376#ifdef _LP64
1377sixtyfour bits
1378#endif
1379           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1380        ])
1381      if test $gl_cv_solaris_64bit = yes; then
1382        acl_libdirstem=lib/64
1383        case "$host_cpu" in
1384          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
1385          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1386        esac
1387      fi
1388      ;;
1389    *)
1390      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1391      if test -n "$searchpath"; then
1392        acl_save_IFS="${IFS= 	}"; IFS=":"
1393        for searchdir in $searchpath; do
1394          if test -d "$searchdir"; then
1395            case "$searchdir" in
1396              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1397              */../ | */.. )
1398                # Better ignore directories of this form. They are misleading.
1399                ;;
1400              *) searchdir=`cd "$searchdir" && pwd`
1401                 case "$searchdir" in
1402                   */lib64 ) acl_libdirstem=lib64 ;;
1403                 esac ;;
1404            esac
1405          fi
1406        done
1407        IFS="$acl_save_IFS"
1408      fi
1409      ;;
1410  esac
1411  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1412])
1413
1414dnl Autoconf macros for libgcrypt
1415dnl       Copyright (C) 2002, 2004 Free Software Foundation, Inc.
1416dnl
1417dnl This file is free software; as a special exception the author gives
1418dnl unlimited permission to copy and/or distribute it, with or without
1419dnl modifications, as long as this notice is preserved.
1420dnl
1421dnl This file is distributed in the hope that it will be useful, but
1422dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
1423dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1424
1425
1426dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
1427dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
1428dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
1429dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
1430dnl with the API version to also check the API compatibility. Example:
1431dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
1432dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1.  Using
1433dnl this features allows to prevent build against newer versions of libgcrypt
1434dnl with a changed API.
1435dnl
1436AC_DEFUN([AM_PATH_LIBGCRYPT],
1437[ AC_ARG_WITH(libgcrypt-prefix,
1438            AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
1439                           [prefix where LIBGCRYPT is installed (optional)]),
1440     libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
1441  if test x$libgcrypt_config_prefix != x ; then
1442     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
1443        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
1444     fi
1445  fi
1446
1447  AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
1448  tmp=ifelse([$1], ,1:1.2.0,$1)
1449  if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
1450     req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
1451     min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
1452  else
1453     req_libgcrypt_api=0
1454     min_libgcrypt_version="$tmp"
1455  fi
1456
1457  AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
1458  ok=no
1459  if test "$LIBGCRYPT_CONFIG" != "no" ; then
1460    req_major=`echo $min_libgcrypt_version | \
1461               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
1462    req_minor=`echo $min_libgcrypt_version | \
1463               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
1464    req_micro=`echo $min_libgcrypt_version | \
1465               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
1466    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
1467    major=`echo $libgcrypt_config_version | \
1468               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
1469    minor=`echo $libgcrypt_config_version | \
1470               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
1471    micro=`echo $libgcrypt_config_version | \
1472               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
1473    if test "$major" -gt "$req_major"; then
1474        ok=yes
1475    else
1476        if test "$major" -eq "$req_major"; then
1477            if test "$minor" -gt "$req_minor"; then
1478               ok=yes
1479            else
1480               if test "$minor" -eq "$req_minor"; then
1481                   if test "$micro" -ge "$req_micro"; then
1482                     ok=yes
1483                   fi
1484               fi
1485            fi
1486        fi
1487    fi
1488  fi
1489  if test $ok = yes; then
1490    AC_MSG_RESULT([yes ($libgcrypt_config_version)])
1491  else
1492    AC_MSG_RESULT(no)
1493  fi
1494  if test $ok = yes; then
1495     # If we have a recent libgcrypt, we should also check that the
1496     # API is compatible
1497     if test "$req_libgcrypt_api" -gt 0 ; then
1498        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
1499        if test "$tmp" -gt 0 ; then
1500           AC_MSG_CHECKING([LIBGCRYPT API version])
1501           if test "$req_libgcrypt_api" -eq "$tmp" ; then
1502             AC_MSG_RESULT([okay])
1503           else
1504             ok=no
1505             AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
1506           fi
1507        fi
1508     fi
1509  fi
1510  if test $ok = yes; then
1511    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
1512    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
1513    ifelse([$2], , :, [$2])
1514    if test x"$host" != x ; then
1515      libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
1516      if test x"$libgcrypt_config_host" != xnone ; then
1517        if test x"$libgcrypt_config_host" != x"$host" ; then
1518  AC_MSG_WARN([[
1519***
1520*** The config script $LIBGCRYPT_CONFIG was
1521*** built for $libgcrypt_config_host and thus may not match the
1522*** used host $host.
1523*** You may want to use the configure option --with-libgcrypt-prefix
1524*** to specify a matching config script.
1525***]])
1526        fi
1527      fi
1528    fi
1529  else
1530    LIBGCRYPT_CFLAGS=""
1531    LIBGCRYPT_LIBS=""
1532    ifelse([$3], , :, [$3])
1533  fi
1534  AC_SUBST(LIBGCRYPT_CFLAGS)
1535  AC_SUBST(LIBGCRYPT_LIBS)
1536])
1537
1538# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1539# serial 1 (pkg-config-0.24)
1540# 
1541# Copyright �� 2004 Scott James Remnant <scott@netsplit.com>.
1542#
1543# This program is free software; you can redistribute it and/or modify
1544# it under the terms of the GNU General Public License as published by
1545# the Free Software Foundation; either version 2 of the License, or
1546# (at your option) any later version.
1547#
1548# This program is distributed in the hope that it will be useful, but
1549# WITHOUT ANY WARRANTY; without even the implied warranty of
1550# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1551# General Public License for more details.
1552#
1553# You should have received a copy of the GNU General Public License
1554# along with this program; if not, write to the Free Software
1555# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1556#
1557# As a special exception to the GNU General Public License, if you
1558# distribute this file as part of a program that contains a
1559# configuration script generated by Autoconf, you may include it under
1560# the same distribution terms that you use for the rest of that program.
1561
1562# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1563# ----------------------------------
1564AC_DEFUN([PKG_PROG_PKG_CONFIG],
1565[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1566m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1567m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1568AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1569AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1570AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1571
1572if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1573	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1574fi
1575if test -n "$PKG_CONFIG"; then
1576	_pkg_min_version=m4_default([$1], [0.9.0])
1577	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1578	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1579		AC_MSG_RESULT([yes])
1580	else
1581		AC_MSG_RESULT([no])
1582		PKG_CONFIG=""
1583	fi
1584fi[]dnl
1585])# PKG_PROG_PKG_CONFIG
1586
1587# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1588#
1589# Check to see whether a particular set of modules exists.  Similar
1590# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1591#
1592# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1593# only at the first occurence in configure.ac, so if the first place
1594# it's called might be skipped (such as if it is within an "if", you
1595# have to call PKG_CHECK_EXISTS manually
1596# --------------------------------------------------------------
1597AC_DEFUN([PKG_CHECK_EXISTS],
1598[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1599if test -n "$PKG_CONFIG" && \
1600    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1601  m4_default([$2], [:])
1602m4_ifvaln([$3], [else
1603  $3])dnl
1604fi])
1605
1606# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1607# ---------------------------------------------
1608m4_define([_PKG_CONFIG],
1609[if test -n "$$1"; then
1610    pkg_cv_[]$1="$$1"
1611 elif test -n "$PKG_CONFIG"; then
1612    PKG_CHECK_EXISTS([$3],
1613                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1614		      test "x$?" != "x0" && pkg_failed=yes ],
1615		     [pkg_failed=yes])
1616 else
1617    pkg_failed=untried
1618fi[]dnl
1619])# _PKG_CONFIG
1620
1621# _PKG_SHORT_ERRORS_SUPPORTED
1622# -----------------------------
1623AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1624[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1625if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1626        _pkg_short_errors_supported=yes
1627else
1628        _pkg_short_errors_supported=no
1629fi[]dnl
1630])# _PKG_SHORT_ERRORS_SUPPORTED
1631
1632
1633# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1634# [ACTION-IF-NOT-FOUND])
1635#
1636#
1637# Note that if there is a possibility the first call to
1638# PKG_CHECK_MODULES might not happen, you should be sure to include an
1639# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1640#
1641#
1642# --------------------------------------------------------------
1643AC_DEFUN([PKG_CHECK_MODULES],
1644[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1645AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1646AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1647
1648pkg_failed=no
1649AC_MSG_CHECKING([for $1])
1650
1651_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1652_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1653
1654m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1655and $1[]_LIBS to avoid the need to call pkg-config.
1656See the pkg-config man page for more details.])
1657
1658if test $pkg_failed = yes; then
1659   	AC_MSG_RESULT([no])
1660        _PKG_SHORT_ERRORS_SUPPORTED
1661        if test $_pkg_short_errors_supported = yes; then
1662	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1663        else 
1664	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1665        fi
1666	# Put the nasty error message in config.log where it belongs
1667	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1668
1669	m4_default([$4], [AC_MSG_ERROR(
1670[Package requirements ($2) were not met:
1671
1672$$1_PKG_ERRORS
1673
1674Consider adjusting the PKG_CONFIG_PATH environment variable if you
1675installed software in a non-standard prefix.
1676
1677_PKG_TEXT])[]dnl
1678        ])
1679elif test $pkg_failed = untried; then
1680     	AC_MSG_RESULT([no])
1681	m4_default([$4], [AC_MSG_FAILURE(
1682[The pkg-config script could not be found or is too old.  Make sure it
1683is in your PATH or set the PKG_CONFIG environment variable to the full
1684path to pkg-config.
1685
1686_PKG_TEXT
1687
1688To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1689        ])
1690else
1691	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1692	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1693        AC_MSG_RESULT([yes])
1694	$3
1695fi[]dnl
1696])# PKG_CHECK_MODULES
1697
1698# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1699#
1700# This file is free software; the Free Software Foundation
1701# gives unlimited permission to copy and/or distribute it,
1702# with or without modifications, as long as this notice is preserved.
1703
1704# AM_AUTOMAKE_VERSION(VERSION)
1705# ----------------------------
1706# Automake X.Y traces this macro to ensure aclocal.m4 has been
1707# generated from the m4 files accompanying Automake X.Y.
1708# (This private macro should not be called outside this file.)
1709AC_DEFUN([AM_AUTOMAKE_VERSION],
1710[am__api_version='1.11'
1711dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1712dnl require some minimum version.  Point them to the right macro.
1713m4_if([$1], [1.11.1], [],
1714      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1715])
1716
1717# _AM_AUTOCONF_VERSION(VERSION)
1718# -----------------------------
1719# aclocal traces this macro to find the Autoconf version.
1720# This is a private macro too.  Using m4_define simplifies
1721# the logic in aclocal, which can simply ignore this definition.
1722m4_define([_AM_AUTOCONF_VERSION], [])
1723
1724# AM_SET_CURRENT_AUTOMAKE_VERSION
1725# -------------------------------
1726# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1727# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1728AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1729[AM_AUTOMAKE_VERSION([1.11.1])dnl
1730m4_ifndef([AC_AUTOCONF_VERSION],
1731  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1732_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1733
1734# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1735
1736# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1737#
1738# This file is free software; the Free Software Foundation
1739# gives unlimited permission to copy and/or distribute it,
1740# with or without modifications, as long as this notice is preserved.
1741
1742# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1743# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1744# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1745#
1746# Of course, Automake must honor this variable whenever it calls a
1747# tool from the auxiliary directory.  The problem is that $srcdir (and
1748# therefore $ac_aux_dir as well) can be either absolute or relative,
1749# depending on how configure is run.  This is pretty annoying, since
1750# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1751# source directory, any form will work fine, but in subdirectories a
1752# relative path needs to be adjusted first.
1753#
1754# $ac_aux_dir/missing
1755#    fails when called from a subdirectory if $ac_aux_dir is relative
1756# $top_srcdir/$ac_aux_dir/missing
1757#    fails if $ac_aux_dir is absolute,
1758#    fails when called from a subdirectory in a VPATH build with
1759#          a relative $ac_aux_dir
1760#
1761# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1762# are both prefixed by $srcdir.  In an in-source build this is usually
1763# harmless because $srcdir is `.', but things will broke when you
1764# start a VPATH build or use an absolute $srcdir.
1765#
1766# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1767# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1768#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1769# and then we would define $MISSING as
1770#   MISSING="\${SHELL} $am_aux_dir/missing"
1771# This will work as long as MISSING is not called from configure, because
1772# unfortunately $(top_srcdir) has no meaning in configure.
1773# However there are other variables, like CC, which are often used in
1774# configure, and could therefore not use this "fixed" $ac_aux_dir.
1775#
1776# Another solution, used here, is to always expand $ac_aux_dir to an
1777# absolute PATH.  The drawback is that using absolute paths prevent a
1778# configured tree to be moved without reconfiguration.
1779
1780AC_DEFUN([AM_AUX_DIR_EXPAND],
1781[dnl Rely on autoconf to set up CDPATH properly.
1782AC_PREREQ([2.50])dnl
1783# expand $ac_aux_dir to an absolute path
1784am_aux_dir=`cd $ac_aux_dir && pwd`
1785])
1786
1787# AM_CONDITIONAL                                            -*- Autoconf -*-
1788
1789# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1790# Free Software Foundation, Inc.
1791#
1792# This file is free software; the Free Software Foundation
1793# gives unlimited permission to copy and/or distribute it,
1794# with or without modifications, as long as this notice is preserved.
1795
1796# serial 9
1797
1798# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1799# -------------------------------------
1800# Define a conditional.
1801AC_DEFUN([AM_CONDITIONAL],
1802[AC_PREREQ(2.52)dnl
1803 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1804	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1805AC_SUBST([$1_TRUE])dnl
1806AC_SUBST([$1_FALSE])dnl
1807_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1808_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1809m4_define([_AM_COND_VALUE_$1], [$2])dnl
1810if $2; then
1811  $1_TRUE=
1812  $1_FALSE='#'
1813else
1814  $1_TRUE='#'
1815  $1_FALSE=
1816fi
1817AC_CONFIG_COMMANDS_PRE(
1818[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1819  AC_MSG_ERROR([[conditional "$1" was never defined.
1820Usually this means the macro was only invoked conditionally.]])
1821fi])])
1822
1823# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1824# Free Software Foundation, Inc.
1825#
1826# This file is free software; the Free Software Foundation
1827# gives unlimited permission to copy and/or distribute it,
1828# with or without modifications, as long as this notice is preserved.
1829
1830# serial 10
1831
1832# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1833# written in clear, in which case automake, when reading aclocal.m4,
1834# will think it sees a *use*, and therefore will trigger all it's
1835# C support machinery.  Also note that it means that autoscan, seeing
1836# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1837
1838
1839# _AM_DEPENDENCIES(NAME)
1840# ----------------------
1841# See how the compiler implements dependency checking.
1842# NAME is "CC", "CXX", "GCJ", or "OBJC".
1843# We try a few techniques and use that to set a single cache variable.
1844#
1845# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1846# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1847# dependency, and given that the user is not expected to run this macro,
1848# just rely on AC_PROG_CC.
1849AC_DEFUN([_AM_DEPENDENCIES],
1850[AC_REQUIRE([AM_SET_DEPDIR])dnl
1851AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1852AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1853AC_REQUIRE([AM_DEP_TRACK])dnl
1854
1855ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1856       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1857       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1858       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1859       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1860                   [depcc="$$1"   am_compiler_list=])
1861
1862AC_CACHE_CHECK([dependency style of $depcc],
1863               [am_cv_$1_dependencies_compiler_type],
1864[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1865  # We make a subdir and do the tests there.  Otherwise we can end up
1866  # making bogus files that we don't know about and never remove.  For
1867  # instance it was reported that on HP-UX the gcc test will end up
1868  # making a dummy file named `D' -- because `-MD' means `put the output
1869  # in D'.
1870  mkdir conftest.dir
1871  # Copy depcomp to subdir because otherwise we won't find it if we're
1872  # using a relative directory.
1873  cp "$am_depcomp" conftest.dir
1874  cd conftest.dir
1875  # We will build objects and dependencies in a subdirectory because
1876  # it helps to detect inapplicable dependency modes.  For instance
1877  # both Tru64's cc and ICC support -MD to output dependencies as a
1878  # side effect of compilation, but ICC will put the dependencies in
1879  # the current directory while Tru64 will put them in the object
1880  # directory.
1881  mkdir sub
1882
1883  am_cv_$1_dependencies_compiler_type=none
1884  if test "$am_compiler_list" = ""; then
1885     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1886  fi
1887  am__universal=false
1888  m4_case([$1], [CC],
1889    [case " $depcc " in #(
1890     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1891     esac],
1892    [CXX],
1893    [case " $depcc " in #(
1894     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1895     esac])
1896
1897  for depmode in $am_compiler_list; do
1898    # Setup a source with many dependencies, because some compilers
1899    # like to wrap large dependency lists on column 80 (with \), and
1900    # we should not choose a depcomp mode which is confused by this.
1901    #
1902    # We need to recreate these files for each test, as the compiler may
1903    # overwrite some of them when testing with obscure command lines.
1904    # This happens at least with the AIX C compiler.
1905    : > sub/conftest.c
1906    for i in 1 2 3 4 5 6; do
1907      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1908      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1909      # Solaris 8's {/usr,}/bin/sh.
1910      touch sub/conftst$i.h
1911    done
1912    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1913
1914    # We check with `-c' and `-o' for the sake of the "dashmstdout"
1915    # mode.  It turns out that the SunPro C++ compiler does not properly
1916    # handle `-M -o', and we need to detect this.  Also, some Intel
1917    # versions had trouble with output in subdirs
1918    am__obj=sub/conftest.${OBJEXT-o}
1919    am__minus_obj="-o $am__obj"
1920    case $depmode in
1921    gcc)
1922      # This depmode causes a compiler race in universal mode.
1923      test "$am__universal" = false || continue
1924      ;;
1925    nosideeffect)
1926      # after this tag, mechanisms are not by side-effect, so they'll
1927      # only be used when explicitly requested
1928      if test "x$enable_dependency_tracking" = xyes; then
1929	continue
1930      else
1931	break
1932      fi
1933      ;;
1934    msvisualcpp | msvcmsys)
1935      # This compiler won't grok `-c -o', but also, the minuso test has
1936      # not run yet.  These depmodes are late enough in the game, and
1937      # so weak that their functioning should not be impacted.
1938      am__obj=conftest.${OBJEXT-o}
1939      am__minus_obj=
1940      ;;
1941    none) break ;;
1942    esac
1943    if depmode=$depmode \
1944       source=sub/conftest.c object=$am__obj \
1945       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1946       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1947         >/dev/null 2>conftest.err &&
1948       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1949       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1950       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1951       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1952      # icc doesn't choke on unknown options, it will just issue warnings
1953      # or remarks (even with -Werror).  So we grep stderr for any message
1954      # that says an option was ignored or not supported.
1955      # When given -MP, icc 7.0 and 7.1 complain thusly:
1956      #   icc: Command line warning: ignoring option '-M'; no argument required
1957      # The diagnosis changed in icc 8.0:
1958      #   icc: Command line remark: option '-MP' not supported
1959      if (grep 'ignoring option' conftest.err ||
1960          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1961        am_cv_$1_dependencies_compiler_type=$depmode
1962        break
1963      fi
1964    fi
1965  done
1966
1967  cd ..
1968  rm -rf conftest.dir
1969else
1970  am_cv_$1_dependencies_compiler_type=none
1971fi
1972])
1973AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1974AM_CONDITIONAL([am__fastdep$1], [
1975  test "x$enable_dependency_tracking" != xno \
1976  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1977])
1978
1979
1980# AM_SET_DEPDIR
1981# -------------
1982# Choose a directory name for dependency files.
1983# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1984AC_DEFUN([AM_SET_DEPDIR],
1985[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1986AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1987])
1988
1989
1990# AM_DEP_TRACK
1991# ------------
1992AC_DEFUN([AM_DEP_TRACK],
1993[AC_ARG_ENABLE(dependency-tracking,
1994[  --disable-dependency-tracking  speeds up one-time build
1995  --enable-dependency-tracking   do not reject slow dependency extractors])
1996if test "x$enable_dependency_tracking" != xno; then
1997  am_depcomp="$ac_aux_dir/depcomp"
1998  AMDEPBACKSLASH='\'
1999fi
2000AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2001AC_SUBST([AMDEPBACKSLASH])dnl
2002_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2003])
2004
2005# Generate code to set up dependency tracking.              -*- Autoconf -*-
2006
2007# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2008# Free Software Foundation, Inc.
2009#
2010# This file is free software; the Free Software Foundation
2011# gives unlimited permission to copy and/or distribute it,
2012# with or without modifications, as long as this notice is preserved.
2013
2014#serial 5
2015
2016# _AM_OUTPUT_DEPENDENCY_COMMANDS
2017# ------------------------------
2018AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2019[{
2020  # Autoconf 2.62 quotes --file arguments for eval, but not when files
2021  # are listed without --file.  Let's play safe and only enable the eval
2022  # if we detect the quoting.
2023  case $CONFIG_FILES in
2024  *\'*) eval set x "$CONFIG_FILES" ;;
2025  *)   set x $CONFIG_FILES ;;
2026  esac
2027  shift
2028  for mf
2029  do
2030    # Strip MF so we end up with the name of the file.
2031    mf=`echo "$mf" | sed -e 's/:.*$//'`
2032    # Check whether this is an Automake generated Makefile or not.
2033    # We used to match only the files named `Makefile.in', but
2034    # some people rename them; so instead we look at the file content.
2035    # Grep'ing the first line is not enough: some people post-process
2036    # each Makefile.in and add a new line on top of each file to say so.
2037    # Grep'ing the whole file is not good either: AIX grep has a line
2038    # limit of 2048, but all sed's we know have understand at least 4000.
2039    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2040      dirpart=`AS_DIRNAME("$mf")`
2041    else
2042      continue
2043    fi
2044    # Extract the definition of DEPDIR, am__include, and am__quote
2045    # from the Makefile without running `make'.
2046    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2047    test -z "$DEPDIR" && continue
2048    am__include=`sed -n 's/^am__include = //p' < "$mf"`
2049    test -z "am__include" && continue
2050    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2051    # When using ansi2knr, U may be empty or an underscore; expand it
2052    U=`sed -n 's/^U = //p' < "$mf"`
2053    # Find all dependency output files, they are included files with
2054    # $(DEPDIR) in their names.  We invoke sed twice because it is the
2055    # simplest approach to changing $(DEPDIR) to its actual value in the
2056    # expansion.
2057    for file in `sed -n "
2058      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2059	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2060      # Make sure the directory exists.
2061      test -f "$dirpart/$file" && continue
2062      fdir=`AS_DIRNAME(["$file"])`
2063      AS_MKDIR_P([$dirpart/$fdir])
2064      # echo "creating $dirpart/$file"
2065      echo '# dummy' > "$dirpart/$file"
2066    done
2067  done
2068}
2069])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2070
2071
2072# AM_OUTPUT_DEPENDENCY_COMMANDS
2073# -----------------------------
2074# This macro should only be invoked once -- use via AC_REQUIRE.
2075#
2076# This code is only required when automatic dependency tracking
2077# is enabled.  FIXME.  This creates each `.P' file that we will
2078# need in order to bootstrap the dependency handling code.
2079AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2080[AC_CONFIG_COMMANDS([depfiles],
2081     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2082     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2083])
2084
2085# Do all the work for Automake.                             -*- Autoconf -*-
2086
2087# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2088# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
2089#
2090# This file is free software; the Free Software Foundation
2091# gives unlimited permission to copy and/or distribute it,
2092# with or without modifications, as long as this notice is preserved.
2093
2094# serial 16
2095
2096# This macro actually does too much.  Some checks are only needed if
2097# your package does certain things.  But this isn't really a big deal.
2098
2099# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2100# AM_INIT_AUTOMAKE([OPTIONS])
2101# -----------------------------------------------
2102# The call with PACKAGE and VERSION arguments is the old style
2103# call (pre autoconf-2.50), which is being phased out.  PACKAGE
2104# and VERSION should now be passed to AC_INIT and removed from
2105# the call to AM_INIT_AUTOMAKE.
2106# We support both call styles for the transition.  After
2107# the next Automake release, Autoconf can make the AC_INIT
2108# arguments mandatory, and then we can depend on a new Autoconf
2109# release and drop the old call support.
2110AC_DEFUN([AM_INIT_AUTOMAKE],
2111[AC_PREREQ([2.62])dnl
2112dnl Autoconf wants to disallow AM_ names.  We explicitly allow
2113dnl the ones we care about.
2114m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2115AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2116AC_REQUIRE([AC_PROG_INSTALL])dnl
2117if test "`cd $srcdir && pwd`" != "`pwd`"; then
2118  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2119  # is not polluted with repeated "-I."
2120  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2121  # test to see if srcdir already configured
2122  if test -f $srcdir/config.status; then
2123    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2124  fi
2125fi
2126
2127# test whether we have cygpath
2128if test -z "$CYGPATH_W"; then
2129  if (cygpath --version) >/dev/null 2>/dev/null; then
2130    CYGPATH_W='cygpath -w'
2131  else
2132    CYGPATH_W=echo
2133  fi
2134fi
2135AC_SUBST([CYGPATH_W])
2136
2137# Define the identity of the package.
2138dnl Distinguish between old-style and new-style calls.
2139m4_ifval([$2],
2140[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2141 AC_SUBST([PACKAGE], [$1])dnl
2142 AC_SUBST([VERSION], [$2])],
2143[_AM_SET_OPTIONS([$1])dnl
2144dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2145m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
2146  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2147 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2148 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2149
2150_AM_IF_OPTION([no-define],,
2151[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2152 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
2153
2154# Some tools Automake needs.
2155AC_REQUIRE([AM_SANITY_CHECK])dnl
2156AC_REQUIRE([AC_ARG_PROGRAM])dnl
2157AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
2158AM_MISSING_PROG(AUTOCONF, autoconf)
2159AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
2160AM_MISSING_PROG(AUTOHEADER, autoheader)
2161AM_MISSING_PROG(MAKEINFO, makeinfo)
2162AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2163AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2164AC_REQUIRE([AM_PROG_MKDIR_P])dnl
2165# We need awk for the "check" target.  The system "awk" is bad on
2166# some platforms.
2167AC_REQUIRE([AC_PROG_AWK])dnl
2168AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2169AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2170_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2171	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2172			     [_AM_PROG_TAR([v7])])])
2173_AM_IF_OPTION([no-dependencies],,
2174[AC_PROVIDE_IFELSE([AC_PROG_CC],
2175		  [_AM_DEPENDENCIES(CC)],
2176		  [define([AC_PROG_CC],
2177			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
2178AC_PROVIDE_IFELSE([AC_PROG_CXX],
2179		  [_AM_DEPENDENCIES(CXX)],
2180		  [define([AC_PROG_CXX],
2181			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
2182AC_PROVIDE_IFELSE([AC_PROG_OBJC],
2183		  [_AM_DEPENDENCIES(OBJC)],
2184		  [define([AC_PROG_OBJC],
2185			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
2186])
2187_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
2188dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
2189dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
2190dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
2191AC_CONFIG_COMMANDS_PRE(dnl
2192[m4_provide_if([_AM_COMPILER_EXEEXT],
2193  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2194])
2195
2196dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2197dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2198dnl mangled by Autoconf and run in a shell conditional statement.
2199m4_define([_AC_COMPILER_EXEEXT],
2200m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2201
2202
2203# When config.status generates a header, we must update the stamp-h file.
2204# This file resides in the same directory as the config header
2205# that is generated.  The stamp files are numbered to have different names.
2206
2207# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2208# loop where config.status creates the headers, so we can generate
2209# our stamp files there.
2210AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2211[# Compute $1's index in $config_headers.
2212_am_arg=$1
2213_am_stamp_count=1
2214for _am_header in $config_headers :; do
2215  case $_am_header in
2216    $_am_arg | $_am_arg:* )
2217      break ;;
2218    * )
2219      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2220  esac
2221done
2222echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2223
2224# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
2225#
2226# This file is free software; the Free Software Foundation
2227# gives unlimited permission to copy and/or distribute it,
2228# with or without modifications, as long as this notice is preserved.
2229
2230# AM_PROG_INSTALL_SH
2231# ------------------
2232# Define $install_sh.
2233AC_DEFUN([AM_PROG_INSTALL_SH],
2234[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2235if test x"${install_sh}" != xset; then
2236  case $am_aux_dir in
2237  *\ * | *\	*)
2238    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2239  *)
2240    install_sh="\${SHELL} $am_aux_dir/install-sh"
2241  esac
2242fi
2243AC_SUBST(install_sh)])
2244
2245# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
2246#
2247# This file is free software; the Free Software Foundation
2248# gives unlimited permission to copy and/or distribute it,
2249# with or without modifications, as long as this notice is preserved.
2250
2251# serial 2
2252
2253# Check whether the underlying file-system supports filenames
2254# with a leading dot.  For instance MS-DOS doesn't.
2255AC_DEFUN([AM_SET_LEADING_DOT],
2256[rm -rf .tst 2>/dev/null
2257mkdir .tst 2>/dev/null
2258if test -d .tst; then
2259  am__leading_dot=.
2260else
2261  am__leading_dot=_
2262fi
2263rmdir .tst 2>/dev/null
2264AC_SUBST([am__leading_dot])])
2265
2266# Check to see how 'make' treats includes.	            -*- Autoconf -*-
2267
2268# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
2269#
2270# This file is free software; the Free Software Foundation
2271# gives unlimited permission to copy and/or distribute it,
2272# with or without modifications, as long as this notice is preserved.
2273
2274# serial 4
2275
2276# AM_MAKE_INCLUDE()
2277# -----------------
2278# Check to see how make treats includes.
2279AC_DEFUN([AM_MAKE_INCLUDE],
2280[am_make=${MAKE-make}
2281cat > confinc << 'END'
2282am__doit:
2283	@echo this is the am__doit target
2284.PHONY: am__doit
2285END
2286# If we don't find an include directive, just comment out the code.
2287AC_MSG_CHECKING([for style of include used by $am_make])
2288am__include="#"
2289am__quote=
2290_am_result=none
2291# First try GNU make style include.
2292echo "include confinc" > confmf
2293# Ignore all kinds of additional output from `make'.
2294case `$am_make -s -f confmf 2> /dev/null` in #(
2295*the\ am__doit\ target*)
2296  am__include=include
2297  am__quote=
2298  _am_result=GNU
2299  ;;
2300esac
2301# Now try BSD make style include.
2302if test "$am__include" = "#"; then
2303   echo '.include "confinc"' > confmf
2304   case `$am_make -s -f confmf 2> /dev/null` in #(
2305   *the\ am__doit\ target*)
2306     am__include=.include
2307     am__quote="\""
2308     _am_result=BSD
2309     ;;
2310   esac
2311fi
2312AC_SUBST([am__include])
2313AC_SUBST([am__quote])
2314AC_MSG_RESULT([$_am_result])
2315rm -f confinc confmf
2316])
2317
2318# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
2319# Free Software Foundation, Inc.
2320#
2321# This file is free software; the Free Software Foundation
2322# gives unlimited permission to copy and/or distribute it,
2323# with or without modifications, as long as this notice is preserved.
2324
2325# serial 6
2326
2327# AM_PROG_CC_C_O
2328# --------------
2329# Like AC_PROG_CC_C_O, but changed for automake.
2330AC_DEFUN([AM_PROG_CC_C_O],
2331[AC_REQUIRE([AC_PROG_CC_C_O])dnl
2332AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2333AC_REQUIRE_AUX_FILE([compile])dnl
2334# FIXME: we rely on the cache variable name because
2335# there is no other way.
2336set dummy $CC
2337am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
2338eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
2339if test "$am_t" != yes; then
2340   # Losing compiler, so override with the script.
2341   # FIXME: It is wrong to rewrite CC.
2342   # But if we don't then we get into trouble of one sort or another.
2343   # A longer-term fix would be to have automake use am__CC in this case,
2344   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2345   CC="$am_aux_dir/compile $CC"
2346fi
2347dnl Make sure AC_PROG_CC is never called again, or it will override our
2348dnl setting of CC.
2349m4_define([AC_PROG_CC],
2350          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
2351])
2352
2353# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2354
2355# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2356# Free Software Foundation, Inc.
2357#
2358# This file is free software; the Free Software Foundation
2359# gives unlimited permission to copy and/or distribute it,
2360# with or without modifications, as long as this notice is preserved.
2361
2362# serial 6
2363
2364# AM_MISSING_PROG(NAME, PROGRAM)
2365# ------------------------------
2366AC_DEFUN([AM_MISSING_PROG],
2367[AC_REQUIRE([AM_MISSING_HAS_RUN])
2368$1=${$1-"${am_missing_run}$2"}
2369AC_SUBST($1)])
2370
2371
2372# AM_MISSING_HAS_RUN
2373# ------------------
2374# Define MISSING if not defined so far and test if it supports --run.
2375# If it does, set am_missing_run to use it, otherwise, to nothing.
2376AC_DEFUN([AM_MISSING_HAS_RUN],
2377[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2378AC_REQUIRE_AUX_FILE([missing])dnl
2379if test x"${MISSING+set}" != xset; then
2380  case $am_aux_dir in
2381  *\ * | *\	*)
2382    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2383  *)
2384    MISSING="\${SHELL} $am_aux_dir/missing" ;;
2385  esac
2386fi
2387# Use eval to expand $SHELL
2388if eval "$MISSING --run true"; then
2389  am_missing_run="$MISSING --run "
2390else
2391  am_missing_run=
2392  AC_MSG_WARN([`missing' script is too old or missing])
2393fi
2394])
2395
2396# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
2397#
2398# This file is free software; the Free Software Foundation
2399# gives unlimited permission to copy and/or distribute it,
2400# with or without modifications, as long as this notice is preserved.
2401
2402# AM_PROG_MKDIR_P
2403# ---------------
2404# Check for `mkdir -p'.
2405AC_DEFUN([AM_PROG_MKDIR_P],
2406[AC_PREREQ([2.60])dnl
2407AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2408dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
2409dnl while keeping a definition of mkdir_p for backward compatibility.
2410dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2411dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2412dnl Makefile.ins that do not define MKDIR_P, so we do our own
2413dnl adjustment using top_builddir (which is defined more often than
2414dnl MKDIR_P).
2415AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2416case $mkdir_p in
2417  [[\\/$]]* | ?:[[\\/]]*) ;;
2418  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2419esac
2420])
2421
2422# Helper functions for option handling.                     -*- Autoconf -*-
2423
2424# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2425#
2426# This file is free software; the Free Software Foundation
2427# gives unlimited permission to copy and/or distribute it,
2428# with or without modifications, as long as this notice is preserved.
2429
2430# serial 4
2431
2432# _AM_MANGLE_OPTION(NAME)
2433# -----------------------
2434AC_DEFUN([_AM_MANGLE_OPTION],
2435[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2436
2437# _AM_SET_OPTION(NAME)
2438# ------------------------------
2439# Set option NAME.  Presently that only means defining a flag for this option.
2440AC_DEFUN([_AM_SET_OPTION],
2441[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2442
2443# _AM_SET_OPTIONS(OPTIONS)
2444# ----------------------------------
2445# OPTIONS is a space-separated list of Automake options.
2446AC_DEFUN([_AM_SET_OPTIONS],
2447[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2448
2449# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2450# -------------------------------------------
2451# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2452AC_DEFUN([_AM_IF_OPTION],
2453[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2454
2455# Check to make sure that the build environment is sane.    -*- Autoconf -*-
2456
2457# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2458# Free Software Foundation, Inc.
2459#
2460# This file is free software; the Free Software Foundation
2461# gives unlimited permission to copy and/or distribute it,
2462# with or without modifications, as long as this notice is preserved.
2463
2464# serial 5
2465
2466# AM_SANITY_CHECK
2467# ---------------
2468AC_DEFUN([AM_SANITY_CHECK],
2469[AC_MSG_CHECKING([whether build environment is sane])
2470# Just in case
2471sleep 1
2472echo timestamp > conftest.file
2473# Reject unsafe characters in $srcdir or the absolute working directory
2474# name.  Accept space and tab only in the latter.
2475am_lf='
2476'
2477case `pwd` in
2478  *[[\\\"\#\$\&\'\`$am_lf]]*)
2479    AC_MSG_ERROR([unsafe absolute working directory name]);;
2480esac
2481case $srcdir in
2482  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
2483    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2484esac
2485
2486# Do `set' in a subshell so we don't clobber the current shell's
2487# arguments.  Must try -L first in case configure is actually a
2488# symlink; some systems play weird games with the mod time of symlinks
2489# (eg FreeBSD returns the mod time of the symlink's containing
2490# directory).
2491if (
2492   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2493   if test "$[*]" = "X"; then
2494      # -L didn't work.
2495      set X `ls -t "$srcdir/configure" conftest.file`
2496   fi
2497   rm -f conftest.file
2498   if test "$[*]" != "X $srcdir/configure conftest.file" \
2499      && test "$[*]" != "X conftest.file $srcdir/configure"; then
2500
2501      # If neither matched, then we have a broken ls.  This can happen
2502      # if, for instance, CONFIG_SHELL is bash and it inherits a
2503      # broken ls alias from the environment.  This has actually
2504      # happened.  Such a system could not be considered "sane".
2505      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2506alias in your environment])
2507   fi
2508
2509   test "$[2]" = conftest.file
2510   )
2511then
2512   # Ok.
2513   :
2514else
2515   AC_MSG_ERROR([newly created file is older than distributed files!
2516Check your system clock])
2517fi
2518AC_MSG_RESULT(yes)])
2519
2520# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
2521#
2522# This file is free software; the Free Software Foundation
2523# gives unlimited permission to copy and/or distribute it,
2524# with or without modifications, as long as this notice is preserved.
2525
2526# AM_PROG_INSTALL_STRIP
2527# ---------------------
2528# One issue with vendor `install' (even GNU) is that you can't
2529# specify the program used to strip binaries.  This is especially
2530# annoying in cross-compiling environments, where the build's strip
2531# is unlikely to handle the host's binaries.
2532# Fortunately install-sh will honor a STRIPPROG variable, so we
2533# always use install-sh in `make install-strip', and initialize
2534# STRIPPROG with the value of the STRIP variable (set by the user).
2535AC_DEFUN([AM_PROG_INSTALL_STRIP],
2536[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2537# Installed binaries are usually stripped using `strip' when the user
2538# run `make install-strip'.  However `strip' might not be the right
2539# tool to use in cross-compilation environments, therefore Automake
2540# will honor the `STRIP' environment variable to overrule this program.
2541dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2542if test "$cross_compiling" != no; then
2543  AC_CHECK_TOOL([STRIP], [strip], :)
2544fi
2545INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2546AC_SUBST([INSTALL_STRIP_PROGRAM])])
2547
2548# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2549#
2550# This file is free software; the Free Software Foundation
2551# gives unlimited permission to copy and/or distribute it,
2552# with or without modifications, as long as this notice is preserved.
2553
2554# serial 2
2555
2556# _AM_SUBST_NOTMAKE(VARIABLE)
2557# ---------------------------
2558# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2559# This macro is traced by Automake.
2560AC_DEFUN([_AM_SUBST_NOTMAKE])
2561
2562# AM_SUBST_NOTMAKE(VARIABLE)
2563# ---------------------------
2564# Public sister of _AM_SUBST_NOTMAKE.
2565AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2566
2567# Check how to create a tarball.                            -*- Autoconf -*-
2568
2569# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2570#
2571# This file is free software; the Free Software Foundation
2572# gives unlimited permission to copy and/or distribute it,
2573# with or without modifications, as long as this notice is preserved.
2574
2575# serial 2
2576
2577# _AM_PROG_TAR(FORMAT)
2578# --------------------
2579# Check how to create a tarball in format FORMAT.
2580# FORMAT should be one of `v7', `ustar', or `pax'.
2581#
2582# Substitute a variable $(am__tar) that is a command
2583# writing to stdout a FORMAT-tarball containing the directory
2584# $tardir.
2585#     tardir=directory && $(am__tar) > result.tar
2586#
2587# Substitute a variable $(am__untar) that extract such
2588# a tarball read from stdin.
2589#     $(am__untar) < result.tar
2590AC_DEFUN([_AM_PROG_TAR],
2591[# Always define AMTAR for backward compatibility.
2592AM_MISSING_PROG([AMTAR], [tar])
2593m4_if([$1], [v7],
2594     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2595     [m4_case([$1], [ustar],, [pax],,
2596              [m4_fatal([Unknown tar format])])
2597AC_MSG_CHECKING([how to create a $1 tar archive])
2598# Loop over all known methods to create a tar archive until one works.
2599_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2600_am_tools=${am_cv_prog_tar_$1-$_am_tools}
2601# Do not fold the above two line into one, because Tru64 sh and
2602# Solaris sh will not grok spaces in the rhs of `-'.
2603for _am_tool in $_am_tools
2604do
2605  case $_am_tool in
2606  gnutar)
2607    for _am_tar in tar gnutar gtar;
2608    do
2609      AM_RUN_LOG([$_am_tar --version]) && break
2610    done
2611    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2612    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2613    am__untar="$_am_tar -xf -"
2614    ;;
2615  plaintar)
2616    # Must skip GNU tar: if it does not support --format= it doesn't create
2617    # ustar tarball either.
2618    (tar --version) >/dev/null 2>&1 && continue
2619    am__tar='tar chf - "$$tardir"'
2620    am__tar_='tar chf - "$tardir"'
2621    am__untar='tar xf -'
2622    ;;
2623  pax)
2624    am__tar='pax -L -x $1 -w "$$tardir"'
2625    am__tar_='pax -L -x $1 -w "$tardir"'
2626    am__untar='pax -r'
2627    ;;
2628  cpio)
2629    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2630    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2631    am__untar='cpio -i -H $1 -d'
2632    ;;
2633  none)
2634    am__tar=false
2635    am__tar_=false
2636    am__untar=false
2637    ;;
2638  esac
2639
2640  # If the value was cached, stop now.  We just wanted to have am__tar
2641  # and am__untar set.
2642  test -n "${am_cv_prog_tar_$1}" && break
2643
2644  # tar/untar a dummy directory, and stop if the command works
2645  rm -rf conftest.dir
2646  mkdir conftest.dir
2647  echo GrepMe > conftest.dir/file
2648  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2649  rm -rf conftest.dir
2650  if test -s conftest.tar; then
2651    AM_RUN_LOG([$am__untar <conftest.tar])
2652    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2653  fi
2654done
2655rm -rf conftest.dir
2656
2657AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2658AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2659AC_SUBST([am__tar])
2660AC_SUBST([am__untar])
2661]) # _AM_PROG_TAR
2662
2663m4_include([m4/libtool.m4])
2664m4_include([m4/libunistring.m4])
2665m4_include([m4/ltoptions.m4])
2666m4_include([m4/ltsugar.m4])
2667m4_include([m4/ltversion.m4])
2668m4_include([m4/lt~obsolete.m4])
2669