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