1 # generated automatically by aclocal 1.8.5 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4 # 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_default([$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 if test -n "$$1"; then
86 PKG_CHECK_EXISTS([$3],
87 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
95 # _PKG_SHORT_ERRORS_SUPPORTED
96 # -----------------------------
97 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
98 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
99 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
100 _pkg_short_errors_supported=yes
102 _pkg_short_errors_supported=no
104 ])# _PKG_SHORT_ERRORS_SUPPORTED
107 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
108 # [ACTION-IF-NOT-FOUND])
111 # Note that if there is a possibility the first call to
112 # PKG_CHECK_MODULES might not happen, you should be sure to include an
113 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
116 # --------------------------------------------------------------
117 AC_DEFUN([PKG_CHECK_MODULES],
118 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
119 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
120 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
123 AC_MSG_CHECKING([for $1])
125 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
126 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
128 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
129 and $1[]_LIBS to avoid the need to call pkg-config.
130 See the pkg-config man page for more details.])
132 if test $pkg_failed = yes; then
133 _PKG_SHORT_ERRORS_SUPPORTED
134 if test $_pkg_short_errors_supported = yes; then
135 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
137 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
139 # Put the nasty error message in config.log where it belongs
140 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
142 ifelse([$4], , [AC_MSG_ERROR(dnl
143 [Package requirements ($2) were not met:
147 Consider adjusting the PKG_CONFIG_PATH environment variable if you
148 installed software in a non-standard prefix.
154 elif test $pkg_failed = untried; then
155 ifelse([$4], , [AC_MSG_FAILURE(dnl
156 [The pkg-config script could not be found or is too old. Make sure it
157 is in your PATH or set the PKG_CONFIG environment variable to the full
162 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
165 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
166 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
168 ifelse([$3], , :, [$3])
170 ])# PKG_CHECK_MODULES
173 # Copyright (C) 2002, 2003 Free Software Foundation, Inc.
174 # Generated from amversion.in; do not edit by hand.
176 # This program is free software; you can redistribute it and/or modify
177 # it under the terms of the GNU General Public License as published by
178 # the Free Software Foundation; either version 2, or (at your option)
181 # This program is distributed in the hope that it will be useful,
182 # but WITHOUT ANY WARRANTY; without even the implied warranty of
183 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
184 # GNU General Public License for more details.
186 # You should have received a copy of the GNU General Public License
187 # along with this program; if not, write to the Free Software
188 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
190 # AM_AUTOMAKE_VERSION(VERSION)
191 # ----------------------------
192 # Automake X.Y traces this macro to ensure aclocal.m4 has been
193 # generated from the m4 files accompanying Automake X.Y.
194 AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"])
196 # AM_SET_CURRENT_AUTOMAKE_VERSION
197 # -------------------------------
198 # Call AM_AUTOMAKE_VERSION so it can be traced.
199 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
200 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
201 [AM_AUTOMAKE_VERSION([1.8.5])])
205 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
207 # This program is free software; you can redistribute it and/or modify
208 # it under the terms of the GNU General Public License as published by
209 # the Free Software Foundation; either version 2, or (at your option)
212 # This program is distributed in the hope that it will be useful,
213 # but WITHOUT ANY WARRANTY; without even the implied warranty of
214 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
215 # GNU General Public License for more details.
217 # You should have received a copy of the GNU General Public License
218 # along with this program; if not, write to the Free Software
219 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
222 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
223 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
224 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
226 # Of course, Automake must honor this variable whenever it calls a
227 # tool from the auxiliary directory. The problem is that $srcdir (and
228 # therefore $ac_aux_dir as well) can be either absolute or relative,
229 # depending on how configure is run. This is pretty annoying, since
230 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
231 # source directory, any form will work fine, but in subdirectories a
232 # relative path needs to be adjusted first.
234 # $ac_aux_dir/missing
235 # fails when called from a subdirectory if $ac_aux_dir is relative
236 # $top_srcdir/$ac_aux_dir/missing
237 # fails if $ac_aux_dir is absolute,
238 # fails when called from a subdirectory in a VPATH build with
239 # a relative $ac_aux_dir
241 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
242 # are both prefixed by $srcdir. In an in-source build this is usually
243 # harmless because $srcdir is `.', but things will broke when you
244 # start a VPATH build or use an absolute $srcdir.
246 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
247 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
248 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
249 # and then we would define $MISSING as
250 # MISSING="\${SHELL} $am_aux_dir/missing"
251 # This will work as long as MISSING is not called from configure, because
252 # unfortunately $(top_srcdir) has no meaning in configure.
253 # However there are other variables, like CC, which are often used in
254 # configure, and could therefore not use this "fixed" $ac_aux_dir.
256 # Another solution, used here, is to always expand $ac_aux_dir to an
257 # absolute PATH. The drawback is that using absolute paths prevent a
258 # configured tree to be moved without reconfiguration.
260 AC_DEFUN([AM_AUX_DIR_EXPAND],
261 [dnl Rely on autoconf to set up CDPATH properly.
263 # expand $ac_aux_dir to an absolute path
264 am_aux_dir=`cd $ac_aux_dir && pwd`
267 # AM_CONDITIONAL -*- Autoconf -*-
269 # Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
271 # This program is free software; you can redistribute it and/or modify
272 # it under the terms of the GNU General Public License as published by
273 # the Free Software Foundation; either version 2, or (at your option)
276 # This program is distributed in the hope that it will be useful,
277 # but WITHOUT ANY WARRANTY; without even the implied warranty of
278 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
279 # GNU General Public License for more details.
281 # You should have received a copy of the GNU General Public License
282 # along with this program; if not, write to the Free Software
283 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
288 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
289 # -------------------------------------
290 # Define a conditional.
291 AC_DEFUN([AM_CONDITIONAL],
293 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
294 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
304 AC_CONFIG_COMMANDS_PRE(
305 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
306 AC_MSG_ERROR([conditional "$1" was never defined.
307 Usually this means the macro was only invoked conditionally.])
310 # serial 7 -*- Autoconf -*-
312 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
313 # Free Software Foundation, Inc.
315 # This program is free software; you can redistribute it and/or modify
316 # it under the terms of the GNU General Public License as published by
317 # the Free Software Foundation; either version 2, or (at your option)
320 # This program is distributed in the hope that it will be useful,
321 # but WITHOUT ANY WARRANTY; without even the implied warranty of
322 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
323 # GNU General Public License for more details.
325 # You should have received a copy of the GNU General Public License
326 # along with this program; if not, write to the Free Software
327 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
331 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
332 # written in clear, in which case automake, when reading aclocal.m4,
333 # will think it sees a *use*, and therefore will trigger all it's
334 # C support machinery. Also note that it means that autoscan, seeing
335 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
339 # _AM_DEPENDENCIES(NAME)
340 # ----------------------
341 # See how the compiler implements dependency checking.
342 # NAME is "CC", "CXX", "GCJ", or "OBJC".
343 # We try a few techniques and use that to set a single cache variable.
345 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
346 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
347 # dependency, and given that the user is not expected to run this macro,
348 # just rely on AC_PROG_CC.
349 AC_DEFUN([_AM_DEPENDENCIES],
350 [AC_REQUIRE([AM_SET_DEPDIR])dnl
351 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
352 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
353 AC_REQUIRE([AM_DEP_TRACK])dnl
355 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
356 [$1], CXX, [depcc="$CXX" am_compiler_list=],
357 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
358 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
359 [depcc="$$1" am_compiler_list=])
361 AC_CACHE_CHECK([dependency style of $depcc],
362 [am_cv_$1_dependencies_compiler_type],
363 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
364 # We make a subdir and do the tests there. Otherwise we can end up
365 # making bogus files that we don't know about and never remove. For
366 # instance it was reported that on HP-UX the gcc test will end up
367 # making a dummy file named `D' -- because `-MD' means `put the output
370 # Copy depcomp to subdir because otherwise we won't find it if we're
371 # using a relative directory.
372 cp "$am_depcomp" conftest.dir
374 # We will build objects and dependencies in a subdirectory because
375 # it helps to detect inapplicable dependency modes. For instance
376 # both Tru64's cc and ICC support -MD to output dependencies as a
377 # side effect of compilation, but ICC will put the dependencies in
378 # the current directory while Tru64 will put them in the object
382 am_cv_$1_dependencies_compiler_type=none
383 if test "$am_compiler_list" = ""; then
384 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
386 for depmode in $am_compiler_list; do
387 # Setup a source with many dependencies, because some compilers
388 # like to wrap large dependency lists on column 80 (with \), and
389 # we should not choose a depcomp mode which is confused by this.
391 # We need to recreate these files for each test, as the compiler may
392 # overwrite some of them when testing with obscure command lines.
393 # This happens at least with the AIX C compiler.
395 for i in 1 2 3 4 5 6; do
396 echo '#include "conftst'$i'.h"' >> sub/conftest.c
397 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
398 # Solaris 8's {/usr,}/bin/sh.
399 touch sub/conftst$i.h
401 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
405 # after this tag, mechanisms are not by side-effect, so they'll
406 # only be used when explicitly requested
407 if test "x$enable_dependency_tracking" = xyes; then
415 # We check with `-c' and `-o' for the sake of the "dashmstdout"
416 # mode. It turns out that the SunPro C++ compiler does not properly
417 # handle `-M -o', and we need to detect this.
418 if depmode=$depmode \
419 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
420 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
421 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
422 >/dev/null 2>conftest.err &&
423 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
424 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
425 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
426 # icc doesn't choke on unknown options, it will just issue warnings
427 # or remarks (even with -Werror). So we grep stderr for any message
428 # that says an option was ignored or not supported.
429 # When given -MP, icc 7.0 and 7.1 complain thusly:
430 # icc: Command line warning: ignoring option '-M'; no argument required
431 # The diagnosis changed in icc 8.0:
432 # icc: Command line remark: option '-MP' not supported
433 if (grep 'ignoring option' conftest.err ||
434 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
435 am_cv_$1_dependencies_compiler_type=$depmode
444 am_cv_$1_dependencies_compiler_type=none
447 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
448 AM_CONDITIONAL([am__fastdep$1], [
449 test "x$enable_dependency_tracking" != xno \
450 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
456 # Choose a directory name for dependency files.
457 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
458 AC_DEFUN([AM_SET_DEPDIR],
459 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
460 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
466 AC_DEFUN([AM_DEP_TRACK],
467 [AC_ARG_ENABLE(dependency-tracking,
468 [ --disable-dependency-tracking speeds up one-time build
469 --enable-dependency-tracking do not reject slow dependency extractors])
470 if test "x$enable_dependency_tracking" != xno; then
471 am_depcomp="$ac_aux_dir/depcomp"
474 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
475 AC_SUBST([AMDEPBACKSLASH])
478 # Generate code to set up dependency tracking. -*- Autoconf -*-
480 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
482 # This program is free software; you can redistribute it and/or modify
483 # it under the terms of the GNU General Public License as published by
484 # the Free Software Foundation; either version 2, or (at your option)
487 # This program is distributed in the hope that it will be useful,
488 # but WITHOUT ANY WARRANTY; without even the implied warranty of
489 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
490 # GNU General Public License for more details.
492 # You should have received a copy of the GNU General Public License
493 # along with this program; if not, write to the Free Software
494 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
499 # _AM_OUTPUT_DEPENDENCY_COMMANDS
500 # ------------------------------
501 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
502 [for mf in $CONFIG_FILES; do
503 # Strip MF so we end up with the name of the file.
504 mf=`echo "$mf" | sed -e 's/:.*$//'`
505 # Check whether this is an Automake generated Makefile or not.
506 # We used to match only the files named `Makefile.in', but
507 # some people rename them; so instead we look at the file content.
508 # Grep'ing the first line is not enough: some people post-process
509 # each Makefile.in and add a new line on top of each file to say so.
510 # So let's grep whole file.
511 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
512 dirpart=`AS_DIRNAME("$mf")`
516 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
517 # Extract the definition of DEP_FILES from the Makefile without
519 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
520 test -z "$DEPDIR" && continue
521 # When using ansi2knr, U may be empty or an underscore; expand it
522 U=`sed -n 's/^U = //p' < "$mf"`
523 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
524 # We invoke sed twice because it is the simplest approach to
525 # changing $(DEPDIR) to its actual value in the expansion.
526 for file in `sed -n '
527 /^DEP_FILES = .*\\\\$/ {
536 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
537 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
538 # Make sure the directory exists.
539 test -f "$dirpart/$file" && continue
540 fdir=`AS_DIRNAME(["$file"])`
541 AS_MKDIR_P([$dirpart/$fdir])
542 # echo "creating $dirpart/$file"
543 echo '# dummy' > "$dirpart/$file"
546 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
549 # AM_OUTPUT_DEPENDENCY_COMMANDS
550 # -----------------------------
551 # This macro should only be invoked once -- use via AC_REQUIRE.
553 # This code is only required when automatic dependency tracking
554 # is enabled. FIXME. This creates each `.P' file that we will
555 # need in order to bootstrap the dependency handling code.
556 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
557 [AC_CONFIG_COMMANDS([depfiles],
558 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
559 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
562 # Do all the work for Automake. -*- Autoconf -*-
564 # This macro actually does too much some checks are only needed if
565 # your package does certain things. But this isn't really a big deal.
567 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
568 # Free Software Foundation, Inc.
570 # This program is free software; you can redistribute it and/or modify
571 # it under the terms of the GNU General Public License as published by
572 # the Free Software Foundation; either version 2, or (at your option)
575 # This program is distributed in the hope that it will be useful,
576 # but WITHOUT ANY WARRANTY; without even the implied warranty of
577 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
578 # GNU General Public License for more details.
580 # You should have received a copy of the GNU General Public License
581 # along with this program; if not, write to the Free Software
582 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
587 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
588 # AM_INIT_AUTOMAKE([OPTIONS])
589 # -----------------------------------------------
590 # The call with PACKAGE and VERSION arguments is the old style
591 # call (pre autoconf-2.50), which is being phased out. PACKAGE
592 # and VERSION should now be passed to AC_INIT and removed from
593 # the call to AM_INIT_AUTOMAKE.
594 # We support both call styles for the transition. After
595 # the next Automake release, Autoconf can make the AC_INIT
596 # arguments mandatory, and then we can depend on a new Autoconf
597 # release and drop the old call support.
598 AC_DEFUN([AM_INIT_AUTOMAKE],
599 [AC_PREREQ([2.58])dnl
600 dnl Autoconf wants to disallow AM_ names. We explicitly allow
601 dnl the ones we care about.
602 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
603 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
604 AC_REQUIRE([AC_PROG_INSTALL])dnl
605 # test to see if srcdir already configured
606 if test "`cd $srcdir && pwd`" != "`pwd`" &&
607 test -f $srcdir/config.status; then
608 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
611 # test whether we have cygpath
612 if test -z "$CYGPATH_W"; then
613 if (cygpath --version) >/dev/null 2>/dev/null; then
614 CYGPATH_W='cygpath -w'
619 AC_SUBST([CYGPATH_W])
621 # Define the identity of the package.
622 dnl Distinguish between old-style and new-style calls.
624 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
625 AC_SUBST([PACKAGE], [$1])dnl
626 AC_SUBST([VERSION], [$2])],
627 [_AM_SET_OPTIONS([$1])dnl
628 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
629 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
631 _AM_IF_OPTION([no-define],,
632 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
633 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
635 # Some tools Automake needs.
636 AC_REQUIRE([AM_SANITY_CHECK])dnl
637 AC_REQUIRE([AC_ARG_PROGRAM])dnl
638 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
639 AM_MISSING_PROG(AUTOCONF, autoconf)
640 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
641 AM_MISSING_PROG(AUTOHEADER, autoheader)
642 AM_MISSING_PROG(MAKEINFO, makeinfo)
643 AM_MISSING_PROG(AMTAR, tar)
645 AM_PROG_INSTALL_STRIP
646 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
647 # We need awk for the "check" target. The system "awk" is bad on
649 AC_REQUIRE([AC_PROG_AWK])dnl
650 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
651 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
653 _AM_IF_OPTION([no-dependencies],,
654 [AC_PROVIDE_IFELSE([AC_PROG_CC],
655 [_AM_DEPENDENCIES(CC)],
656 [define([AC_PROG_CC],
657 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
658 AC_PROVIDE_IFELSE([AC_PROG_CXX],
659 [_AM_DEPENDENCIES(CXX)],
660 [define([AC_PROG_CXX],
661 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
666 # When config.status generates a header, we must update the stamp-h file.
667 # This file resides in the same directory as the config header
668 # that is generated. The stamp files are numbered to have different names.
670 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
671 # loop where config.status creates the headers, so we can generate
672 # our stamp files there.
673 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
674 [# Compute $1's index in $config_headers.
676 for _am_header in $config_headers :; do
681 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
684 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
688 # Define $install_sh.
690 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
692 # This program is free software; you can redistribute it and/or modify
693 # it under the terms of the GNU General Public License as published by
694 # the Free Software Foundation; either version 2, or (at your option)
697 # This program is distributed in the hope that it will be useful,
698 # but WITHOUT ANY WARRANTY; without even the implied warranty of
699 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
700 # GNU General Public License for more details.
702 # You should have received a copy of the GNU General Public License
703 # along with this program; if not, write to the Free Software
704 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
707 AC_DEFUN([AM_PROG_INSTALL_SH],
708 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
709 install_sh=${install_sh-"$am_aux_dir/install-sh"}
710 AC_SUBST(install_sh)])
713 # Copyright (C) 2003 Free Software Foundation, Inc.
715 # This program is free software; you can redistribute it and/or modify
716 # it under the terms of the GNU General Public License as published by
717 # the Free Software Foundation; either version 2, or (at your option)
720 # This program is distributed in the hope that it will be useful,
721 # but WITHOUT ANY WARRANTY; without even the implied warranty of
722 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
723 # GNU General Public License for more details.
725 # You should have received a copy of the GNU General Public License
726 # along with this program; if not, write to the Free Software
727 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
732 # Check whether the underlying file-system supports filenames
733 # with a leading dot. For instance MS-DOS doesn't.
734 AC_DEFUN([AM_SET_LEADING_DOT],
735 [rm -rf .tst 2>/dev/null
736 mkdir .tst 2>/dev/null
737 if test -d .tst; then
742 rmdir .tst 2>/dev/null
743 AC_SUBST([am__leading_dot])])
745 # Check to see how 'make' treats includes. -*- Autoconf -*-
747 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
749 # This program is free software; you can redistribute it and/or modify
750 # it under the terms of the GNU General Public License as published by
751 # the Free Software Foundation; either version 2, or (at your option)
754 # This program is distributed in the hope that it will be useful,
755 # but WITHOUT ANY WARRANTY; without even the implied warranty of
756 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
757 # GNU General Public License for more details.
759 # You should have received a copy of the GNU General Public License
760 # along with this program; if not, write to the Free Software
761 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
768 # Check to see how make treats includes.
769 AC_DEFUN([AM_MAKE_INCLUDE],
770 [am_make=${MAKE-make}
771 cat > confinc << 'END'
776 # If we don't find an include directive, just comment out the code.
777 AC_MSG_CHECKING([for style of include used by $am_make])
781 # First try GNU make style include.
782 echo "include confinc" > confmf
783 # We grep out `Entering directory' and `Leaving directory'
784 # messages which can occur if `w' ends up in MAKEFLAGS.
785 # In particular we don't look at `^make:' because GNU make might
786 # be invoked under some other name (usually "gmake"), in which
787 # case it prints its new name instead of `make'.
788 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
793 # Now try BSD make style include.
794 if test "$am__include" = "#"; then
795 echo '.include "confinc"' > confmf
796 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
802 AC_SUBST([am__include])
803 AC_SUBST([am__quote])
804 AC_MSG_RESULT([$_am_result])
811 # Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
813 # This program is free software; you can redistribute it and/or modify
814 # it under the terms of the GNU General Public License as published by
815 # the Free Software Foundation; either version 2, or (at your option)
818 # This program is distributed in the hope that it will be useful,
819 # but WITHOUT ANY WARRANTY; without even the implied warranty of
820 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
821 # GNU General Public License for more details.
823 # You should have received a copy of the GNU General Public License
824 # along with this program; if not, write to the Free Software
825 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
830 # AM_MISSING_PROG(NAME, PROGRAM)
831 # ------------------------------
832 AC_DEFUN([AM_MISSING_PROG],
833 [AC_REQUIRE([AM_MISSING_HAS_RUN])
834 $1=${$1-"${am_missing_run}$2"}
840 # Define MISSING if not defined so far and test if it supports --run.
841 # If it does, set am_missing_run to use it, otherwise, to nothing.
842 AC_DEFUN([AM_MISSING_HAS_RUN],
843 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
844 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
845 # Use eval to expand $SHELL
846 if eval "$MISSING --run true"; then
847 am_missing_run="$MISSING --run "
850 AC_MSG_WARN([`missing' script is too old or missing])
856 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
858 # Copyright (C) 2003, 2004 Free Software Foundation, Inc.
860 # This program is free software; you can redistribute it and/or modify
861 # it under the terms of the GNU General Public License as published by
862 # the Free Software Foundation; either version 2, or (at your option)
865 # This program is distributed in the hope that it will be useful,
866 # but WITHOUT ANY WARRANTY; without even the implied warranty of
867 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
868 # GNU General Public License for more details.
870 # You should have received a copy of the GNU General Public License
871 # along with this program; if not, write to the Free Software
872 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
875 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
876 # created by `make install' are always world readable, even if the
877 # installer happens to have an overly restrictive umask (e.g. 077).
878 # This was a mistake. There are at least two reasons why we must not
880 # - it causes special bits like SGID to be ignored,
881 # - it may be too restrictive (some setups expect 775 directories).
883 # Do not use -m 0755 and let people choose whatever they expect by
886 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
887 # Some implementations (such as Solaris 8's) are not thread-safe: if a
888 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
889 # concurrently, both version can detect that a/ is missing, but only
890 # one can create it and the other will error out. Consequently we
891 # restrict ourselves to GNU make (using the --version option ensures
893 AC_DEFUN([AM_PROG_MKDIR_P],
894 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
895 # Keeping the `.' argument allows $(mkdir_p) to be used without
896 # argument. Indeed, we sometimes output rules like
897 # $(mkdir_p) $(somedir)
898 # where $(somedir) is conditionally defined.
899 # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
900 # expensive solution, as it forces Make to start a sub-shell.)
901 mkdir_p='mkdir -p -- .'
903 # On NextStep and OpenStep, the `mkdir' command does not
904 # recognize any option. It will interpret all options as
905 # directories to create, and then abort because `.' already
907 for d in ./-p ./--version;
909 test -d $d && rmdir $d
911 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
912 if test -f "$ac_aux_dir/mkinstalldirs"; then
913 mkdir_p='$(mkinstalldirs)'
915 mkdir_p='$(install_sh) -d'
918 AC_SUBST([mkdir_p])])
920 # Helper functions for option handling. -*- Autoconf -*-
922 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
924 # This program is free software; you can redistribute it and/or modify
925 # it under the terms of the GNU General Public License as published by
926 # the Free Software Foundation; either version 2, or (at your option)
929 # This program is distributed in the hope that it will be useful,
930 # but WITHOUT ANY WARRANTY; without even the implied warranty of
931 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
932 # GNU General Public License for more details.
934 # You should have received a copy of the GNU General Public License
935 # along with this program; if not, write to the Free Software
936 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
941 # _AM_MANGLE_OPTION(NAME)
942 # -----------------------
943 AC_DEFUN([_AM_MANGLE_OPTION],
944 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
946 # _AM_SET_OPTION(NAME)
947 # ------------------------------
948 # Set option NAME. Presently that only means defining a flag for this option.
949 AC_DEFUN([_AM_SET_OPTION],
950 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
952 # _AM_SET_OPTIONS(OPTIONS)
953 # ----------------------------------
954 # OPTIONS is a space-separated list of Automake options.
955 AC_DEFUN([_AM_SET_OPTIONS],
956 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
958 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
959 # -------------------------------------------
960 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
961 AC_DEFUN([_AM_IF_OPTION],
962 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
965 # Check to make sure that the build environment is sane.
968 # Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
970 # This program is free software; you can redistribute it and/or modify
971 # it under the terms of the GNU General Public License as published by
972 # the Free Software Foundation; either version 2, or (at your option)
975 # This program is distributed in the hope that it will be useful,
976 # but WITHOUT ANY WARRANTY; without even the implied warranty of
977 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
978 # GNU General Public License for more details.
980 # You should have received a copy of the GNU General Public License
981 # along with this program; if not, write to the Free Software
982 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
989 AC_DEFUN([AM_SANITY_CHECK],
990 [AC_MSG_CHECKING([whether build environment is sane])
993 echo timestamp > conftest.file
994 # Do `set' in a subshell so we don't clobber the current shell's
995 # arguments. Must try -L first in case configure is actually a
996 # symlink; some systems play weird games with the mod time of symlinks
997 # (eg FreeBSD returns the mod time of the symlink's containing
1000 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1001 if test "$[*]" = "X"; then
1003 set X `ls -t $srcdir/configure conftest.file`
1006 if test "$[*]" != "X $srcdir/configure conftest.file" \
1007 && test "$[*]" != "X conftest.file $srcdir/configure"; then
1009 # If neither matched, then we have a broken ls. This can happen
1010 # if, for instance, CONFIG_SHELL is bash and it inherits a
1011 # broken ls alias from the environment. This has actually
1012 # happened. Such a system could not be considered "sane".
1013 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1014 alias in your environment])
1017 test "$[2]" = conftest.file
1023 AC_MSG_ERROR([newly created file is older than distributed files!
1024 Check your system clock])
1026 AC_MSG_RESULT(yes)])
1028 # AM_PROG_INSTALL_STRIP
1030 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
1032 # This program is free software; you can redistribute it and/or modify
1033 # it under the terms of the GNU General Public License as published by
1034 # the Free Software Foundation; either version 2, or (at your option)
1035 # any later version.
1037 # This program is distributed in the hope that it will be useful,
1038 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1039 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1040 # GNU General Public License for more details.
1042 # You should have received a copy of the GNU General Public License
1043 # along with this program; if not, write to the Free Software
1044 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1047 # One issue with vendor `install' (even GNU) is that you can't
1048 # specify the program used to strip binaries. This is especially
1049 # annoying in cross-compiling environments, where the build's strip
1050 # is unlikely to handle the host's binaries.
1051 # Fortunately install-sh will honor a STRIPPROG variable, so we
1052 # always use install-sh in `make install-strip', and initialize
1053 # STRIPPROG with the value of the STRIP variable (set by the user).
1054 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1055 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1056 # Installed binaries are usually stripped using `strip' when the user
1057 # run `make install-strip'. However `strip' might not be the right
1058 # tool to use in cross-compilation environments, therefore Automake
1059 # will honor the `STRIP' environment variable to overrule this program.
1060 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1061 if test "$cross_compiling" != no; then
1062 AC_CHECK_TOOL([STRIP], [strip], :)
1064 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
1065 AC_SUBST([INSTALL_STRIP_PROGRAM])])