1 # generated automatically by aclocal 1.9.5 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
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
14 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
16 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2 of the License, or
21 # (at your option) any later version.
23 # This program is distributed in the hope that it will be useful, but
24 # WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 # General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 # As a special exception to the GNU General Public License, if you
33 # distribute this file as part of a program that contains a
34 # configuration script generated by Autoconf, you may include it under
35 # the same distribution terms that you use for the rest of that program.
37 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
38 # ----------------------------------
39 AC_DEFUN([PKG_PROG_PKG_CONFIG],
40 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
41 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
42 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
43 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
44 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
46 if test -n "$PKG_CONFIG"; then
47 _pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
48 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
49 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
57 ])# PKG_PROG_PKG_CONFIG
59 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
61 # Check to see whether a particular set of modules exists. Similar
62 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
65 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
66 # this or PKG_CHECK_MODULES is called, or make sure to call
67 # PKG_CHECK_EXISTS manually
68 # --------------------------------------------------------------
69 AC_DEFUN([PKG_CHECK_EXISTS],
70 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
71 if test -n "$PKG_CONFIG" && \
72 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
73 m4_ifval([$2], [$2], [:])
79 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80 # ---------------------------------------------
81 m4_define([_PKG_CONFIG],
82 [if test -n "$PKG_CONFIG"; then
83 PKG_CHECK_EXISTS([$3],
84 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
91 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
92 # [ACTION-IF-NOT-FOUND])
95 # Note that if there is a possibility the first call to
96 # PKG_CHECK_MODULES might not happen, you should be sure to include an
97 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
100 # --------------------------------------------------------------
101 AC_DEFUN([PKG_CHECK_MODULES],
102 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
103 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
104 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
107 AC_MSG_CHECKING([for $1])
109 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
110 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
112 if test $pkg_failed = yes; then
113 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
114 # Put the nasty error message in config.log where it belongs
115 echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
117 ifelse([$4], , [AC_MSG_ERROR(dnl
118 [Package requirements ($2) were not met.
119 Consider adjusting the PKG_CONFIG_PATH environment variable if you
120 installed software in a non-standard prefix.
122 Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
123 to avoid the need to call pkg-config. See the pkg-config man page for
126 elif test $pkg_failed = untried; then
127 ifelse([$4], , [AC_MSG_FAILURE(dnl
128 [The pkg-config script could not be found or is too old. Make sure it
129 is in your PATH or set the PKG_CONFIG environment variable to the full
132 Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
133 to avoid the need to call pkg-config. See the pkg-config man page for
136 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
139 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
140 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
142 ifelse([$3], , :, [$3])
144 ])# PKG_CHECK_MODULES
146 # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
148 # This file is free software; the Free Software Foundation
149 # gives unlimited permission to copy and/or distribute it,
150 # with or without modifications, as long as this notice is preserved.
152 # AM_AUTOMAKE_VERSION(VERSION)
153 # ----------------------------
154 # Automake X.Y traces this macro to ensure aclocal.m4 has been
155 # generated from the m4 files accompanying Automake X.Y.
156 AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
158 # AM_SET_CURRENT_AUTOMAKE_VERSION
159 # -------------------------------
160 # Call AM_AUTOMAKE_VERSION so it can be traced.
161 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
162 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
163 [AM_AUTOMAKE_VERSION([1.9.5])])
165 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
167 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
169 # This file is free software; the Free Software Foundation
170 # gives unlimited permission to copy and/or distribute it,
171 # with or without modifications, as long as this notice is preserved.
173 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
174 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
175 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
177 # Of course, Automake must honor this variable whenever it calls a
178 # tool from the auxiliary directory. The problem is that $srcdir (and
179 # therefore $ac_aux_dir as well) can be either absolute or relative,
180 # depending on how configure is run. This is pretty annoying, since
181 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
182 # source directory, any form will work fine, but in subdirectories a
183 # relative path needs to be adjusted first.
185 # $ac_aux_dir/missing
186 # fails when called from a subdirectory if $ac_aux_dir is relative
187 # $top_srcdir/$ac_aux_dir/missing
188 # fails if $ac_aux_dir is absolute,
189 # fails when called from a subdirectory in a VPATH build with
190 # a relative $ac_aux_dir
192 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
193 # are both prefixed by $srcdir. In an in-source build this is usually
194 # harmless because $srcdir is `.', but things will broke when you
195 # start a VPATH build or use an absolute $srcdir.
197 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
198 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
199 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
200 # and then we would define $MISSING as
201 # MISSING="\${SHELL} $am_aux_dir/missing"
202 # This will work as long as MISSING is not called from configure, because
203 # unfortunately $(top_srcdir) has no meaning in configure.
204 # However there are other variables, like CC, which are often used in
205 # configure, and could therefore not use this "fixed" $ac_aux_dir.
207 # Another solution, used here, is to always expand $ac_aux_dir to an
208 # absolute PATH. The drawback is that using absolute paths prevent a
209 # configured tree to be moved without reconfiguration.
211 AC_DEFUN([AM_AUX_DIR_EXPAND],
212 [dnl Rely on autoconf to set up CDPATH properly.
214 # expand $ac_aux_dir to an absolute path
215 am_aux_dir=`cd $ac_aux_dir && pwd`
218 # AM_CONDITIONAL -*- Autoconf -*-
220 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
221 # Free Software Foundation, Inc.
223 # This file is free software; the Free Software Foundation
224 # gives unlimited permission to copy and/or distribute it,
225 # with or without modifications, as long as this notice is preserved.
229 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
230 # -------------------------------------
231 # Define a conditional.
232 AC_DEFUN([AM_CONDITIONAL],
234 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
235 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
245 AC_CONFIG_COMMANDS_PRE(
246 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
247 AC_MSG_ERROR([[conditional "$1" was never defined.
248 Usually this means the macro was only invoked conditionally.]])
252 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
253 # Free Software Foundation, Inc.
255 # This file is free software; the Free Software Foundation
256 # gives unlimited permission to copy and/or distribute it,
257 # with or without modifications, as long as this notice is preserved.
261 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
262 # written in clear, in which case automake, when reading aclocal.m4,
263 # will think it sees a *use*, and therefore will trigger all it's
264 # C support machinery. Also note that it means that autoscan, seeing
265 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
268 # _AM_DEPENDENCIES(NAME)
269 # ----------------------
270 # See how the compiler implements dependency checking.
271 # NAME is "CC", "CXX", "GCJ", or "OBJC".
272 # We try a few techniques and use that to set a single cache variable.
274 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
275 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
276 # dependency, and given that the user is not expected to run this macro,
277 # just rely on AC_PROG_CC.
278 AC_DEFUN([_AM_DEPENDENCIES],
279 [AC_REQUIRE([AM_SET_DEPDIR])dnl
280 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
281 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
282 AC_REQUIRE([AM_DEP_TRACK])dnl
284 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
285 [$1], CXX, [depcc="$CXX" am_compiler_list=],
286 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
287 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
288 [depcc="$$1" am_compiler_list=])
290 AC_CACHE_CHECK([dependency style of $depcc],
291 [am_cv_$1_dependencies_compiler_type],
292 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
293 # We make a subdir and do the tests there. Otherwise we can end up
294 # making bogus files that we don't know about and never remove. For
295 # instance it was reported that on HP-UX the gcc test will end up
296 # making a dummy file named `D' -- because `-MD' means `put the output
299 # Copy depcomp to subdir because otherwise we won't find it if we're
300 # using a relative directory.
301 cp "$am_depcomp" conftest.dir
303 # We will build objects and dependencies in a subdirectory because
304 # it helps to detect inapplicable dependency modes. For instance
305 # both Tru64's cc and ICC support -MD to output dependencies as a
306 # side effect of compilation, but ICC will put the dependencies in
307 # the current directory while Tru64 will put them in the object
311 am_cv_$1_dependencies_compiler_type=none
312 if test "$am_compiler_list" = ""; then
313 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
315 for depmode in $am_compiler_list; do
316 # Setup a source with many dependencies, because some compilers
317 # like to wrap large dependency lists on column 80 (with \), and
318 # we should not choose a depcomp mode which is confused by this.
320 # We need to recreate these files for each test, as the compiler may
321 # overwrite some of them when testing with obscure command lines.
322 # This happens at least with the AIX C compiler.
324 for i in 1 2 3 4 5 6; do
325 echo '#include "conftst'$i'.h"' >> sub/conftest.c
326 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
327 # Solaris 8's {/usr,}/bin/sh.
328 touch sub/conftst$i.h
330 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
334 # after this tag, mechanisms are not by side-effect, so they'll
335 # only be used when explicitly requested
336 if test "x$enable_dependency_tracking" = xyes; then
344 # We check with `-c' and `-o' for the sake of the "dashmstdout"
345 # mode. It turns out that the SunPro C++ compiler does not properly
346 # handle `-M -o', and we need to detect this.
347 if depmode=$depmode \
348 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
349 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
350 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
351 >/dev/null 2>conftest.err &&
352 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
353 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
354 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
355 # icc doesn't choke on unknown options, it will just issue warnings
356 # or remarks (even with -Werror). So we grep stderr for any message
357 # that says an option was ignored or not supported.
358 # When given -MP, icc 7.0 and 7.1 complain thusly:
359 # icc: Command line warning: ignoring option '-M'; no argument required
360 # The diagnosis changed in icc 8.0:
361 # icc: Command line remark: option '-MP' not supported
362 if (grep 'ignoring option' conftest.err ||
363 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
364 am_cv_$1_dependencies_compiler_type=$depmode
373 am_cv_$1_dependencies_compiler_type=none
376 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
377 AM_CONDITIONAL([am__fastdep$1], [
378 test "x$enable_dependency_tracking" != xno \
379 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
385 # Choose a directory name for dependency files.
386 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
387 AC_DEFUN([AM_SET_DEPDIR],
388 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
389 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
395 AC_DEFUN([AM_DEP_TRACK],
396 [AC_ARG_ENABLE(dependency-tracking,
397 [ --disable-dependency-tracking speeds up one-time build
398 --enable-dependency-tracking do not reject slow dependency extractors])
399 if test "x$enable_dependency_tracking" != xno; then
400 am_depcomp="$ac_aux_dir/depcomp"
403 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
404 AC_SUBST([AMDEPBACKSLASH])
407 # Generate code to set up dependency tracking. -*- Autoconf -*-
409 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
410 # Free Software Foundation, Inc.
412 # This file is free software; the Free Software Foundation
413 # gives unlimited permission to copy and/or distribute it,
414 # with or without modifications, as long as this notice is preserved.
418 # _AM_OUTPUT_DEPENDENCY_COMMANDS
419 # ------------------------------
420 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
421 [for mf in $CONFIG_FILES; do
422 # Strip MF so we end up with the name of the file.
423 mf=`echo "$mf" | sed -e 's/:.*$//'`
424 # Check whether this is an Automake generated Makefile or not.
425 # We used to match only the files named `Makefile.in', but
426 # some people rename them; so instead we look at the file content.
427 # Grep'ing the first line is not enough: some people post-process
428 # each Makefile.in and add a new line on top of each file to say so.
429 # So let's grep whole file.
430 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
431 dirpart=`AS_DIRNAME("$mf")`
435 # Extract the definition of DEPDIR, am__include, and am__quote
436 # from the Makefile without running `make'.
437 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
438 test -z "$DEPDIR" && continue
439 am__include=`sed -n 's/^am__include = //p' < "$mf"`
440 test -z "am__include" && continue
441 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
442 # When using ansi2knr, U may be empty or an underscore; expand it
443 U=`sed -n 's/^U = //p' < "$mf"`
444 # Find all dependency output files, they are included files with
445 # $(DEPDIR) in their names. We invoke sed twice because it is the
446 # simplest approach to changing $(DEPDIR) to its actual value in the
448 for file in `sed -n "
449 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
450 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
451 # Make sure the directory exists.
452 test -f "$dirpart/$file" && continue
453 fdir=`AS_DIRNAME(["$file"])`
454 AS_MKDIR_P([$dirpart/$fdir])
455 # echo "creating $dirpart/$file"
456 echo '# dummy' > "$dirpart/$file"
459 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
462 # AM_OUTPUT_DEPENDENCY_COMMANDS
463 # -----------------------------
464 # This macro should only be invoked once -- use via AC_REQUIRE.
466 # This code is only required when automatic dependency tracking
467 # is enabled. FIXME. This creates each `.P' file that we will
468 # need in order to bootstrap the dependency handling code.
469 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
470 [AC_CONFIG_COMMANDS([depfiles],
471 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
472 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
475 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
476 # Free Software Foundation, Inc.
478 # This file is free software; the Free Software Foundation
479 # gives unlimited permission to copy and/or distribute it,
480 # with or without modifications, as long as this notice is preserved.
484 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
485 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
487 # Do all the work for Automake. -*- Autoconf -*-
489 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
490 # Free Software Foundation, Inc.
492 # This file is free software; the Free Software Foundation
493 # gives unlimited permission to copy and/or distribute it,
494 # with or without modifications, as long as this notice is preserved.
498 # This macro actually does too much. Some checks are only needed if
499 # your package does certain things. But this isn't really a big deal.
501 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
502 # AM_INIT_AUTOMAKE([OPTIONS])
503 # -----------------------------------------------
504 # The call with PACKAGE and VERSION arguments is the old style
505 # call (pre autoconf-2.50), which is being phased out. PACKAGE
506 # and VERSION should now be passed to AC_INIT and removed from
507 # the call to AM_INIT_AUTOMAKE.
508 # We support both call styles for the transition. After
509 # the next Automake release, Autoconf can make the AC_INIT
510 # arguments mandatory, and then we can depend on a new Autoconf
511 # release and drop the old call support.
512 AC_DEFUN([AM_INIT_AUTOMAKE],
513 [AC_PREREQ([2.58])dnl
514 dnl Autoconf wants to disallow AM_ names. We explicitly allow
515 dnl the ones we care about.
516 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
517 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
518 AC_REQUIRE([AC_PROG_INSTALL])dnl
519 # test to see if srcdir already configured
520 if test "`cd $srcdir && pwd`" != "`pwd`" &&
521 test -f $srcdir/config.status; then
522 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
525 # test whether we have cygpath
526 if test -z "$CYGPATH_W"; then
527 if (cygpath --version) >/dev/null 2>/dev/null; then
528 CYGPATH_W='cygpath -w'
533 AC_SUBST([CYGPATH_W])
535 # Define the identity of the package.
536 dnl Distinguish between old-style and new-style calls.
538 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
539 AC_SUBST([PACKAGE], [$1])dnl
540 AC_SUBST([VERSION], [$2])],
541 [_AM_SET_OPTIONS([$1])dnl
542 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
543 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
545 _AM_IF_OPTION([no-define],,
546 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
547 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
549 # Some tools Automake needs.
550 AC_REQUIRE([AM_SANITY_CHECK])dnl
551 AC_REQUIRE([AC_ARG_PROGRAM])dnl
552 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
553 AM_MISSING_PROG(AUTOCONF, autoconf)
554 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
555 AM_MISSING_PROG(AUTOHEADER, autoheader)
556 AM_MISSING_PROG(MAKEINFO, makeinfo)
558 AM_PROG_INSTALL_STRIP
559 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
560 # We need awk for the "check" target. The system "awk" is bad on
562 AC_REQUIRE([AC_PROG_AWK])dnl
563 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
564 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
565 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
566 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
567 [_AM_PROG_TAR([v7])])])
568 _AM_IF_OPTION([no-dependencies],,
569 [AC_PROVIDE_IFELSE([AC_PROG_CC],
570 [_AM_DEPENDENCIES(CC)],
571 [define([AC_PROG_CC],
572 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
573 AC_PROVIDE_IFELSE([AC_PROG_CXX],
574 [_AM_DEPENDENCIES(CXX)],
575 [define([AC_PROG_CXX],
576 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
581 # When config.status generates a header, we must update the stamp-h file.
582 # This file resides in the same directory as the config header
583 # that is generated. The stamp files are numbered to have different names.
585 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
586 # loop where config.status creates the headers, so we can generate
587 # our stamp files there.
588 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
589 [# Compute $1's index in $config_headers.
591 for _am_header in $config_headers :; do
596 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
599 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
601 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
603 # This file is free software; the Free Software Foundation
604 # gives unlimited permission to copy and/or distribute it,
605 # with or without modifications, as long as this notice is preserved.
609 # Define $install_sh.
610 AC_DEFUN([AM_PROG_INSTALL_SH],
611 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
612 install_sh=${install_sh-"$am_aux_dir/install-sh"}
613 AC_SUBST(install_sh)])
615 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
617 # This file is free software; the Free Software Foundation
618 # gives unlimited permission to copy and/or distribute it,
619 # with or without modifications, as long as this notice is preserved.
623 # Check whether the underlying file-system supports filenames
624 # with a leading dot. For instance MS-DOS doesn't.
625 AC_DEFUN([AM_SET_LEADING_DOT],
626 [rm -rf .tst 2>/dev/null
627 mkdir .tst 2>/dev/null
628 if test -d .tst; then
633 rmdir .tst 2>/dev/null
634 AC_SUBST([am__leading_dot])])
636 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
639 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
640 # Free Software Foundation, Inc.
642 # This file is free software; the Free Software Foundation
643 # gives unlimited permission to copy and/or distribute it,
644 # with or without modifications, as long as this notice is preserved.
648 AC_DEFUN([AM_MAINTAINER_MODE],
649 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
650 dnl maintainer-mode is disabled by default
651 AC_ARG_ENABLE(maintainer-mode,
652 [ --enable-maintainer-mode enable make rules and dependencies not useful
653 (and sometimes confusing) to the casual installer],
654 USE_MAINTAINER_MODE=$enableval,
655 USE_MAINTAINER_MODE=no)
656 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
657 AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
658 MAINT=$MAINTAINER_MODE_TRUE
663 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
665 # Check to see how 'make' treats includes. -*- Autoconf -*-
667 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
669 # This file is free software; the Free Software Foundation
670 # gives unlimited permission to copy and/or distribute it,
671 # with or without modifications, as long as this notice is preserved.
677 # Check to see how make treats includes.
678 AC_DEFUN([AM_MAKE_INCLUDE],
679 [am_make=${MAKE-make}
680 cat > confinc << 'END'
685 # If we don't find an include directive, just comment out the code.
686 AC_MSG_CHECKING([for style of include used by $am_make])
690 # First try GNU make style include.
691 echo "include confinc" > confmf
692 # We grep out `Entering directory' and `Leaving directory'
693 # messages which can occur if `w' ends up in MAKEFLAGS.
694 # In particular we don't look at `^make:' because GNU make might
695 # be invoked under some other name (usually "gmake"), in which
696 # case it prints its new name instead of `make'.
697 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
702 # Now try BSD make style include.
703 if test "$am__include" = "#"; then
704 echo '.include "confinc"' > confmf
705 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
711 AC_SUBST([am__include])
712 AC_SUBST([am__quote])
713 AC_MSG_RESULT([$_am_result])
717 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
719 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
720 # Free Software Foundation, Inc.
722 # This file is free software; the Free Software Foundation
723 # gives unlimited permission to copy and/or distribute it,
724 # with or without modifications, as long as this notice is preserved.
728 # AM_MISSING_PROG(NAME, PROGRAM)
729 # ------------------------------
730 AC_DEFUN([AM_MISSING_PROG],
731 [AC_REQUIRE([AM_MISSING_HAS_RUN])
732 $1=${$1-"${am_missing_run}$2"}
738 # Define MISSING if not defined so far and test if it supports --run.
739 # If it does, set am_missing_run to use it, otherwise, to nothing.
740 AC_DEFUN([AM_MISSING_HAS_RUN],
741 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
742 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
743 # Use eval to expand $SHELL
744 if eval "$MISSING --run true"; then
745 am_missing_run="$MISSING --run "
748 AC_MSG_WARN([`missing' script is too old or missing])
752 # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
754 # This file is free software; the Free Software Foundation
755 # gives unlimited permission to copy and/or distribute it,
756 # with or without modifications, as long as this notice is preserved.
760 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
762 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
763 # created by `make install' are always world readable, even if the
764 # installer happens to have an overly restrictive umask (e.g. 077).
765 # This was a mistake. There are at least two reasons why we must not
767 # - it causes special bits like SGID to be ignored,
768 # - it may be too restrictive (some setups expect 775 directories).
770 # Do not use -m 0755 and let people choose whatever they expect by
773 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
774 # Some implementations (such as Solaris 8's) are not thread-safe: if a
775 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
776 # concurrently, both version can detect that a/ is missing, but only
777 # one can create it and the other will error out. Consequently we
778 # restrict ourselves to GNU make (using the --version option ensures
780 AC_DEFUN([AM_PROG_MKDIR_P],
781 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
782 # We used to keeping the `.' as first argument, in order to
783 # allow $(mkdir_p) to be used without argument. As in
784 # $(mkdir_p) $(somedir)
785 # where $(somedir) is conditionally defined. However this is wrong
787 # 1. if the package is installed by a user who cannot write `.'
788 # make install will fail,
789 # 2. the above comment should most certainly read
790 # $(mkdir_p) $(DESTDIR)$(somedir)
791 # so it does not work when $(somedir) is undefined and
793 # To support the latter case, we have to write
794 # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
795 # so the `.' trick is pointless.
796 mkdir_p='mkdir -p --'
798 # On NextStep and OpenStep, the `mkdir' command does not
799 # recognize any option. It will interpret all options as
800 # directories to create, and then abort because `.' already
802 for d in ./-p ./--version;
804 test -d $d && rmdir $d
806 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
807 if test -f "$ac_aux_dir/mkinstalldirs"; then
808 mkdir_p='$(mkinstalldirs)'
810 mkdir_p='$(install_sh) -d'
813 AC_SUBST([mkdir_p])])
815 # Helper functions for option handling. -*- Autoconf -*-
817 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
819 # This file is free software; the Free Software Foundation
820 # gives unlimited permission to copy and/or distribute it,
821 # with or without modifications, as long as this notice is preserved.
825 # _AM_MANGLE_OPTION(NAME)
826 # -----------------------
827 AC_DEFUN([_AM_MANGLE_OPTION],
828 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
830 # _AM_SET_OPTION(NAME)
831 # ------------------------------
832 # Set option NAME. Presently that only means defining a flag for this option.
833 AC_DEFUN([_AM_SET_OPTION],
834 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
836 # _AM_SET_OPTIONS(OPTIONS)
837 # ----------------------------------
838 # OPTIONS is a space-separated list of Automake options.
839 AC_DEFUN([_AM_SET_OPTIONS],
840 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
842 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
843 # -------------------------------------------
844 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
845 AC_DEFUN([_AM_IF_OPTION],
846 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
848 # Check to make sure that the build environment is sane. -*- Autoconf -*-
850 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
851 # Free Software Foundation, Inc.
853 # This file is free software; the Free Software Foundation
854 # gives unlimited permission to copy and/or distribute it,
855 # with or without modifications, as long as this notice is preserved.
861 AC_DEFUN([AM_SANITY_CHECK],
862 [AC_MSG_CHECKING([whether build environment is sane])
865 echo timestamp > conftest.file
866 # Do `set' in a subshell so we don't clobber the current shell's
867 # arguments. Must try -L first in case configure is actually a
868 # symlink; some systems play weird games with the mod time of symlinks
869 # (eg FreeBSD returns the mod time of the symlink's containing
872 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
873 if test "$[*]" = "X"; then
875 set X `ls -t $srcdir/configure conftest.file`
878 if test "$[*]" != "X $srcdir/configure conftest.file" \
879 && test "$[*]" != "X conftest.file $srcdir/configure"; then
881 # If neither matched, then we have a broken ls. This can happen
882 # if, for instance, CONFIG_SHELL is bash and it inherits a
883 # broken ls alias from the environment. This has actually
884 # happened. Such a system could not be considered "sane".
885 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
886 alias in your environment])
889 test "$[2]" = conftest.file
895 AC_MSG_ERROR([newly created file is older than distributed files!
896 Check your system clock])
900 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
902 # This file is free software; the Free Software Foundation
903 # gives unlimited permission to copy and/or distribute it,
904 # with or without modifications, as long as this notice is preserved.
906 # AM_PROG_INSTALL_STRIP
907 # ---------------------
908 # One issue with vendor `install' (even GNU) is that you can't
909 # specify the program used to strip binaries. This is especially
910 # annoying in cross-compiling environments, where the build's strip
911 # is unlikely to handle the host's binaries.
912 # Fortunately install-sh will honor a STRIPPROG variable, so we
913 # always use install-sh in `make install-strip', and initialize
914 # STRIPPROG with the value of the STRIP variable (set by the user).
915 AC_DEFUN([AM_PROG_INSTALL_STRIP],
916 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
917 # Installed binaries are usually stripped using `strip' when the user
918 # run `make install-strip'. However `strip' might not be the right
919 # tool to use in cross-compilation environments, therefore Automake
920 # will honor the `STRIP' environment variable to overrule this program.
921 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
922 if test "$cross_compiling" != no; then
923 AC_CHECK_TOOL([STRIP], [strip], :)
925 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
926 AC_SUBST([INSTALL_STRIP_PROGRAM])])
928 # Check how to create a tarball. -*- Autoconf -*-
930 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
932 # This file is free software; the Free Software Foundation
933 # gives unlimited permission to copy and/or distribute it,
934 # with or without modifications, as long as this notice is preserved.
938 # _AM_PROG_TAR(FORMAT)
939 # --------------------
940 # Check how to create a tarball in format FORMAT.
941 # FORMAT should be one of `v7', `ustar', or `pax'.
943 # Substitute a variable $(am__tar) that is a command
944 # writing to stdout a FORMAT-tarball containing the directory
946 # tardir=directory && $(am__tar) > result.tar
948 # Substitute a variable $(am__untar) that extract such
949 # a tarball read from stdin.
950 # $(am__untar) < result.tar
951 AC_DEFUN([_AM_PROG_TAR],
952 [# Always define AMTAR for backward compatibility.
953 AM_MISSING_PROG([AMTAR], [tar])
955 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
956 [m4_case([$1], [ustar],, [pax],,
957 [m4_fatal([Unknown tar format])])
958 AC_MSG_CHECKING([how to create a $1 tar archive])
959 # Loop over all known methods to create a tar archive until one works.
960 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
961 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
962 # Do not fold the above two line into one, because Tru64 sh and
963 # Solaris sh will not grok spaces in the rhs of `-'.
964 for _am_tool in $_am_tools
968 for _am_tar in tar gnutar gtar;
970 AM_RUN_LOG([$_am_tar --version]) && break
972 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
973 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
974 am__untar="$_am_tar -xf -"
977 # Must skip GNU tar: if it does not support --format= it doesn't create
978 # ustar tarball either.
979 (tar --version) >/dev/null 2>&1 && continue
980 am__tar='tar chf - "$$tardir"'
981 am__tar_='tar chf - "$tardir"'
985 am__tar='pax -L -x $1 -w "$$tardir"'
986 am__tar_='pax -L -x $1 -w "$tardir"'
990 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
991 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
992 am__untar='cpio -i -H $1 -d'
1001 # If the value was cached, stop now. We just wanted to have am__tar
1002 # and am__untar set.
1003 test -n "${am_cv_prog_tar_$1}" && break
1005 # tar/untar a dummy directory, and stop if the command works
1008 echo GrepMe > conftest.dir/file
1009 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1011 if test -s conftest.tar; then
1012 AM_RUN_LOG([$am__untar <conftest.tar])
1013 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1018 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1019 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1021 AC_SUBST([am__untar])