1
# generated automatically by aclocal 1.9.6 -*- 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_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
172
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
174
# This file is free software; the Free Software Foundation
175
# gives unlimited permission to copy and/or distribute it,
176
# with or without modifications, as long as this notice is preserved.
178
# AM_AUTOMAKE_VERSION(VERSION)
179
# ----------------------------
180
# Automake X.Y traces this macro to ensure aclocal.m4 has been
181
# generated from the m4 files accompanying Automake X.Y.
182
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
184
# AM_SET_CURRENT_AUTOMAKE_VERSION
185
# -------------------------------
186
# Call AM_AUTOMAKE_VERSION so it can be traced.
187
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
188
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
189
[AM_AUTOMAKE_VERSION([1.9.6])])
191
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
193
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
195
# This file is free software; the Free Software Foundation
196
# gives unlimited permission to copy and/or distribute it,
197
# with or without modifications, as long as this notice is preserved.
199
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
200
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
201
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
203
# Of course, Automake must honor this variable whenever it calls a
204
# tool from the auxiliary directory. The problem is that $srcdir (and
205
# therefore $ac_aux_dir as well) can be either absolute or relative,
206
# depending on how configure is run. This is pretty annoying, since
207
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
208
# source directory, any form will work fine, but in subdirectories a
209
# relative path needs to be adjusted first.
211
# $ac_aux_dir/missing
212
# fails when called from a subdirectory if $ac_aux_dir is relative
213
# $top_srcdir/$ac_aux_dir/missing
214
# fails if $ac_aux_dir is absolute,
215
# fails when called from a subdirectory in a VPATH build with
216
# a relative $ac_aux_dir
218
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
219
# are both prefixed by $srcdir. In an in-source build this is usually
220
# harmless because $srcdir is `.', but things will broke when you
221
# start a VPATH build or use an absolute $srcdir.
223
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
224
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
225
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
226
# and then we would define $MISSING as
227
# MISSING="\${SHELL} $am_aux_dir/missing"
228
# This will work as long as MISSING is not called from configure, because
229
# unfortunately $(top_srcdir) has no meaning in configure.
230
# However there are other variables, like CC, which are often used in
231
# configure, and could therefore not use this "fixed" $ac_aux_dir.
233
# Another solution, used here, is to always expand $ac_aux_dir to an
234
# absolute PATH. The drawback is that using absolute paths prevent a
235
# configured tree to be moved without reconfiguration.
237
AC_DEFUN([AM_AUX_DIR_EXPAND],
238
[dnl Rely on autoconf to set up CDPATH properly.
240
# expand $ac_aux_dir to an absolute path
241
am_aux_dir=`cd $ac_aux_dir && pwd`
244
# Do all the work for Automake. -*- Autoconf -*-
246
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
247
# Free Software Foundation, Inc.
249
# This file is free software; the Free Software Foundation
250
# gives unlimited permission to copy and/or distribute it,
251
# with or without modifications, as long as this notice is preserved.
255
# This macro actually does too much. Some checks are only needed if
256
# your package does certain things. But this isn't really a big deal.
258
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
259
# AM_INIT_AUTOMAKE([OPTIONS])
260
# -----------------------------------------------
261
# The call with PACKAGE and VERSION arguments is the old style
262
# call (pre autoconf-2.50), which is being phased out. PACKAGE
263
# and VERSION should now be passed to AC_INIT and removed from
264
# the call to AM_INIT_AUTOMAKE.
265
# We support both call styles for the transition. After
266
# the next Automake release, Autoconf can make the AC_INIT
267
# arguments mandatory, and then we can depend on a new Autoconf
268
# release and drop the old call support.
269
AC_DEFUN([AM_INIT_AUTOMAKE],
270
[AC_PREREQ([2.58])dnl
271
dnl Autoconf wants to disallow AM_ names. We explicitly allow
272
dnl the ones we care about.
273
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
274
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
275
AC_REQUIRE([AC_PROG_INSTALL])dnl
276
# test to see if srcdir already configured
277
if test "`cd $srcdir && pwd`" != "`pwd`" &&
278
test -f $srcdir/config.status; then
279
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
282
# test whether we have cygpath
283
if test -z "$CYGPATH_W"; then
284
if (cygpath --version) >/dev/null 2>/dev/null; then
285
CYGPATH_W='cygpath -w'
290
AC_SUBST([CYGPATH_W])
292
# Define the identity of the package.
293
dnl Distinguish between old-style and new-style calls.
295
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
296
AC_SUBST([PACKAGE], [$1])dnl
297
AC_SUBST([VERSION], [$2])],
298
[_AM_SET_OPTIONS([$1])dnl
299
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
300
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
302
_AM_IF_OPTION([no-define],,
303
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
304
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
306
# Some tools Automake needs.
307
AC_REQUIRE([AM_SANITY_CHECK])dnl
308
AC_REQUIRE([AC_ARG_PROGRAM])dnl
309
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
310
AM_MISSING_PROG(AUTOCONF, autoconf)
311
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
312
AM_MISSING_PROG(AUTOHEADER, autoheader)
313
AM_MISSING_PROG(MAKEINFO, makeinfo)
315
AM_PROG_INSTALL_STRIP
316
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
317
# We need awk for the "check" target. The system "awk" is bad on
319
AC_REQUIRE([AC_PROG_AWK])dnl
320
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
321
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
322
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
323
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
324
[_AM_PROG_TAR([v7])])])
325
_AM_IF_OPTION([no-dependencies],,
326
[AC_PROVIDE_IFELSE([AC_PROG_CC],
327
[_AM_DEPENDENCIES(CC)],
328
[define([AC_PROG_CC],
329
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
330
AC_PROVIDE_IFELSE([AC_PROG_CXX],
331
[_AM_DEPENDENCIES(CXX)],
332
[define([AC_PROG_CXX],
333
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
338
# When config.status generates a header, we must update the stamp-h file.
339
# This file resides in the same directory as the config header
340
# that is generated. The stamp files are numbered to have different names.
342
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
343
# loop where config.status creates the headers, so we can generate
344
# our stamp files there.
345
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
346
[# Compute $1's index in $config_headers.
348
for _am_header in $config_headers :; do
353
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
356
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
358
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
360
# This file is free software; the Free Software Foundation
361
# gives unlimited permission to copy and/or distribute it,
362
# with or without modifications, as long as this notice is preserved.
366
# Define $install_sh.
367
AC_DEFUN([AM_PROG_INSTALL_SH],
368
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
369
install_sh=${install_sh-"$am_aux_dir/install-sh"}
370
AC_SUBST(install_sh)])
372
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
374
# This file is free software; the Free Software Foundation
375
# gives unlimited permission to copy and/or distribute it,
376
# with or without modifications, as long as this notice is preserved.
380
# Check whether the underlying file-system supports filenames
381
# with a leading dot. For instance MS-DOS doesn't.
382
AC_DEFUN([AM_SET_LEADING_DOT],
383
[rm -rf .tst 2>/dev/null
384
mkdir .tst 2>/dev/null
385
if test -d .tst; then
390
rmdir .tst 2>/dev/null
391
AC_SUBST([am__leading_dot])])
393
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
395
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
396
# Free Software Foundation, Inc.
398
# This file is free software; the Free Software Foundation
399
# gives unlimited permission to copy and/or distribute it,
400
# with or without modifications, as long as this notice is preserved.
404
# AM_MISSING_PROG(NAME, PROGRAM)
405
# ------------------------------
406
AC_DEFUN([AM_MISSING_PROG],
407
[AC_REQUIRE([AM_MISSING_HAS_RUN])
408
$1=${$1-"${am_missing_run}$2"}
414
# Define MISSING if not defined so far and test if it supports --run.
415
# If it does, set am_missing_run to use it, otherwise, to nothing.
416
AC_DEFUN([AM_MISSING_HAS_RUN],
417
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
418
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
419
# Use eval to expand $SHELL
420
if eval "$MISSING --run true"; then
421
am_missing_run="$MISSING --run "
424
AC_MSG_WARN([`missing' script is too old or missing])
428
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
430
# This file is free software; the Free Software Foundation
431
# gives unlimited permission to copy and/or distribute it,
432
# with or without modifications, as long as this notice is preserved.
436
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
438
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
439
# created by `make install' are always world readable, even if the
440
# installer happens to have an overly restrictive umask (e.g. 077).
441
# This was a mistake. There are at least two reasons why we must not
443
# - it causes special bits like SGID to be ignored,
444
# - it may be too restrictive (some setups expect 775 directories).
446
# Do not use -m 0755 and let people choose whatever they expect by
449
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
450
# Some implementations (such as Solaris 8's) are not thread-safe: if a
451
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
452
# concurrently, both version can detect that a/ is missing, but only
453
# one can create it and the other will error out. Consequently we
454
# restrict ourselves to GNU make (using the --version option ensures
456
AC_DEFUN([AM_PROG_MKDIR_P],
457
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
458
# We used to keeping the `.' as first argument, in order to
459
# allow $(mkdir_p) to be used without argument. As in
460
# $(mkdir_p) $(somedir)
461
# where $(somedir) is conditionally defined. However this is wrong
463
# 1. if the package is installed by a user who cannot write `.'
464
# make install will fail,
465
# 2. the above comment should most certainly read
466
# $(mkdir_p) $(DESTDIR)$(somedir)
467
# so it does not work when $(somedir) is undefined and
469
# To support the latter case, we have to write
470
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
471
# so the `.' trick is pointless.
472
mkdir_p='mkdir -p --'
474
# On NextStep and OpenStep, the `mkdir' command does not
475
# recognize any option. It will interpret all options as
476
# directories to create, and then abort because `.' already
478
for d in ./-p ./--version;
480
test -d $d && rmdir $d
482
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
483
if test -f "$ac_aux_dir/mkinstalldirs"; then
484
mkdir_p='$(mkinstalldirs)'
486
mkdir_p='$(install_sh) -d'
489
AC_SUBST([mkdir_p])])
491
# Helper functions for option handling. -*- Autoconf -*-
493
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
495
# This file is free software; the Free Software Foundation
496
# gives unlimited permission to copy and/or distribute it,
497
# with or without modifications, as long as this notice is preserved.
501
# _AM_MANGLE_OPTION(NAME)
502
# -----------------------
503
AC_DEFUN([_AM_MANGLE_OPTION],
504
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
506
# _AM_SET_OPTION(NAME)
507
# ------------------------------
508
# Set option NAME. Presently that only means defining a flag for this option.
509
AC_DEFUN([_AM_SET_OPTION],
510
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
512
# _AM_SET_OPTIONS(OPTIONS)
513
# ----------------------------------
514
# OPTIONS is a space-separated list of Automake options.
515
AC_DEFUN([_AM_SET_OPTIONS],
516
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
518
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
519
# -------------------------------------------
520
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
521
AC_DEFUN([_AM_IF_OPTION],
522
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
524
# Check to make sure that the build environment is sane. -*- Autoconf -*-
526
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
527
# Free Software Foundation, Inc.
529
# This file is free software; the Free Software Foundation
530
# gives unlimited permission to copy and/or distribute it,
531
# with or without modifications, as long as this notice is preserved.
537
AC_DEFUN([AM_SANITY_CHECK],
538
[AC_MSG_CHECKING([whether build environment is sane])
541
echo timestamp > conftest.file
542
# Do `set' in a subshell so we don't clobber the current shell's
543
# arguments. Must try -L first in case configure is actually a
544
# symlink; some systems play weird games with the mod time of symlinks
545
# (eg FreeBSD returns the mod time of the symlink's containing
548
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
549
if test "$[*]" = "X"; then
551
set X `ls -t $srcdir/configure conftest.file`
554
if test "$[*]" != "X $srcdir/configure conftest.file" \
555
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
557
# If neither matched, then we have a broken ls. This can happen
558
# if, for instance, CONFIG_SHELL is bash and it inherits a
559
# broken ls alias from the environment. This has actually
560
# happened. Such a system could not be considered "sane".
561
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
562
alias in your environment])
565
test "$[2]" = conftest.file
571
AC_MSG_ERROR([newly created file is older than distributed files!
572
Check your system clock])
576
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
578
# This file is free software; the Free Software Foundation
579
# gives unlimited permission to copy and/or distribute it,
580
# with or without modifications, as long as this notice is preserved.
582
# AM_PROG_INSTALL_STRIP
583
# ---------------------
584
# One issue with vendor `install' (even GNU) is that you can't
585
# specify the program used to strip binaries. This is especially
586
# annoying in cross-compiling environments, where the build's strip
587
# is unlikely to handle the host's binaries.
588
# Fortunately install-sh will honor a STRIPPROG variable, so we
589
# always use install-sh in `make install-strip', and initialize
590
# STRIPPROG with the value of the STRIP variable (set by the user).
591
AC_DEFUN([AM_PROG_INSTALL_STRIP],
592
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
593
# Installed binaries are usually stripped using `strip' when the user
594
# run `make install-strip'. However `strip' might not be the right
595
# tool to use in cross-compilation environments, therefore Automake
596
# will honor the `STRIP' environment variable to overrule this program.
597
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
598
if test "$cross_compiling" != no; then
599
AC_CHECK_TOOL([STRIP], [strip], :)
601
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
602
AC_SUBST([INSTALL_STRIP_PROGRAM])])
604
# Check how to create a tarball. -*- Autoconf -*-
606
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
608
# This file is free software; the Free Software Foundation
609
# gives unlimited permission to copy and/or distribute it,
610
# with or without modifications, as long as this notice is preserved.
614
# _AM_PROG_TAR(FORMAT)
615
# --------------------
616
# Check how to create a tarball in format FORMAT.
617
# FORMAT should be one of `v7', `ustar', or `pax'.
619
# Substitute a variable $(am__tar) that is a command
620
# writing to stdout a FORMAT-tarball containing the directory
622
# tardir=directory && $(am__tar) > result.tar
624
# Substitute a variable $(am__untar) that extract such
625
# a tarball read from stdin.
626
# $(am__untar) < result.tar
627
AC_DEFUN([_AM_PROG_TAR],
628
[# Always define AMTAR for backward compatibility.
629
AM_MISSING_PROG([AMTAR], [tar])
631
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
632
[m4_case([$1], [ustar],, [pax],,
633
[m4_fatal([Unknown tar format])])
634
AC_MSG_CHECKING([how to create a $1 tar archive])
635
# Loop over all known methods to create a tar archive until one works.
636
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
637
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
638
# Do not fold the above two line into one, because Tru64 sh and
639
# Solaris sh will not grok spaces in the rhs of `-'.
640
for _am_tool in $_am_tools
644
for _am_tar in tar gnutar gtar;
646
AM_RUN_LOG([$_am_tar --version]) && break
648
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
649
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
650
am__untar="$_am_tar -xf -"
653
# Must skip GNU tar: if it does not support --format= it doesn't create
654
# ustar tarball either.
655
(tar --version) >/dev/null 2>&1 && continue
656
am__tar='tar chf - "$$tardir"'
657
am__tar_='tar chf - "$tardir"'
661
am__tar='pax -L -x $1 -w "$$tardir"'
662
am__tar_='pax -L -x $1 -w "$tardir"'
666
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
667
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
668
am__untar='cpio -i -H $1 -d'
677
# If the value was cached, stop now. We just wanted to have am__tar
679
test -n "${am_cv_prog_tar_$1}" && break
681
# tar/untar a dummy directory, and stop if the command works
684
echo GrepMe > conftest.dir/file
685
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
687
if test -s conftest.tar; then
688
AM_RUN_LOG([$am__untar <conftest.tar])
689
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
694
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
695
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
697
AC_SUBST([am__untar])