aclocal.m4 334 KB
Newer Older
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9001
9002
9003
9004
9005
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
 AC_SUBST([PACKAGE], [$1])dnl
 AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9006
9007
9008
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl

_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl

# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
9024
9025
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9026
9027
9028
9029
9030
9031
9032
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target.  The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9033
9034
	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
			     [_AM_PROG_TAR([v7])])])
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9035
9036
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
9037
9038
9039
		  [_AM_DEPENDENCIES(CC)],
		  [define([AC_PROG_CC],
			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9040
AC_PROVIDE_IFELSE([AC_PROG_CXX],
9041
9042
9043
		  [_AM_DEPENDENCIES(CXX)],
		  [define([AC_PROG_CXX],
			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9044
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
9045
9046
9047
		  [_AM_DEPENDENCIES(OBJC)],
		  [define([AC_PROG_OBJC],
			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9048
])
9049
9050
9051
9052
9053
9054
9055
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9056
9057
])

9058
9059
9060
9061
9062
9063
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073

# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated.  The stamp files are numbered to have different names.

# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9074
_am_arg=$1
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9075
9076
9077
_am_stamp_count=1
for _am_header in $config_headers :; do
  case $_am_header in
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9078
    $_am_arg | $_am_arg:* )
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9079
9080
9081
9082
9083
      break ;;
    * )
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  esac
done
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9084
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9085

9086
# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9087
9088
9089
9090
9091
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9092
9093
9094
9095
9096
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9097
9098
9099
9100
9101
9102
9103
9104
if test x"${install_sh}" != xset; then
  case $am_aux_dir in
  *\ * | *\	*)
    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  *)
    install_sh="\${SHELL} $am_aux_dir/install-sh"
  esac
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9105
9106
AC_SUBST(install_sh)])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9107
9108
9109
9110
9111
# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9112

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9113
# serial 2
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127

# Check whether the underlying file-system supports filenames
# with a leading dot.  For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
  am__leading_dot=.
else
  am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9128
# Check to see how 'make' treats includes.	            -*- Autoconf -*-
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9129

9130
# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9131
9132
9133
9134
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9135

9136
# serial 4
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9137
9138
9139
9140
9141
9142
9143
9144

# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
9145
	@echo this is the am__doit target
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9146
9147
9148
9149
9150
9151
9152
9153
9154
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
9155
9156
9157
9158
9159
9160
9161
9162
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
  am__include=include
  am__quote=
  _am_result=GNU
  ;;
esac
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9163
9164
9165
# Now try BSD make style include.
if test "$am__include" = "#"; then
   echo '.include "confinc"' > confmf
9166
9167
9168
9169
9170
9171
9172
   case `$am_make -s -f confmf 2> /dev/null` in #(
   *the\ am__doit\ target*)
     am__include=.include
     am__quote="\""
     _am_result=BSD
     ;;
   esac
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9173
9174
9175
9176
9177
9178
9179
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9180
# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9181

9182
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9183
9184
9185
9186
9187
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9188

9189
# serial 6
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204

# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])


# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9205
AC_REQUIRE_AUX_FILE([missing])dnl
9206
9207
9208
9209
9210
9211
9212
9213
if test x"${MISSING+set}" != xset; then
  case $am_aux_dir in
  *\ * | *\	*)
    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  *)
    MISSING="\${SHELL} $am_aux_dir/missing" ;;
  esac
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9214
9215
9216
9217
9218
9219
9220
9221
9222
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
  am_missing_run="$MISSING --run "
else
  am_missing_run=
  AC_MSG_WARN([`missing' script is too old or missing])
fi
])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9223
# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9224
9225
9226
9227
9228
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9229
9230
# AM_PROG_MKDIR_P
# ---------------
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9231
# Check for `mkdir -p'.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9232
AC_DEFUN([AM_PROG_MKDIR_P],
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
  [[\\/$]]* | ?:[[\\/]]*) ;;
  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9248

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9249
# Helper functions for option handling.                     -*- Autoconf -*-
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9250

9251
# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9252
9253
9254
9255
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9256

9257
# serial 4
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273

# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])

# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME.  Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])

# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
9274
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9275
9276
9277
9278
9279
9280
9281

# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9282
# Check to make sure that the build environment is sane.    -*- Autoconf -*-
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9283

9284
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9285
9286
9287
9288
9289
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9290

9291
# serial 5
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9292
9293
9294
9295
9296
9297
9298
9299

# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
# Reject unsafe characters in $srcdir or the absolute working directory
# name.  Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
  *[[\\\"\#\$\&\'\`$am_lf]]*)
    AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
esac

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9313
9314
9315
9316
9317
9318
# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
9319
   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9320
9321
   if test "$[*]" = "X"; then
      # -L didn't work.
9322
      set X `ls -t "$srcdir/configure" conftest.file`
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
   fi
   rm -f conftest.file
   if test "$[*]" != "X $srcdir/configure conftest.file" \
      && test "$[*]" != "X conftest.file $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
alias in your environment])
   fi

   test "$[2]" = conftest.file
   )
then
   # Ok.
   :
else
   AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9347
9348
9349
9350
9351
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9352

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9353
9354
# AM_PROG_INSTALL_STRIP
# ---------------------
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries.  This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'.  However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
  AC_CHECK_TOOL([STRIP], [strip], :)
fi
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9372
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9373
9374
AC_SUBST([INSTALL_STRIP_PROGRAM])])

9375
# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9376
9377
9378
9379
9380
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

9381
9382
# serial 2

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9383
9384
9385
9386
9387
9388
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])

9389
9390
9391
9392
9393
# AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9394
9395
# Check how to create a tarball.                            -*- Autoconf -*-

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9396
9397
9398
9399
9400
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9401

Emmanuel Bertin's avatar
Emmanuel Bertin committed
9402
# serial 2
Emmanuel Bertin's avatar
Emmanuel Bertin committed
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489

# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
#     tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
#     $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
     [m4_case([$1], [ustar],, [pax],,
              [m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
  case $_am_tool in
  gnutar)
    for _am_tar in tar gnutar gtar;
    do
      AM_RUN_LOG([$_am_tar --version]) && break
    done
    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
    am__untar="$_am_tar -xf -"
    ;;
  plaintar)
    # Must skip GNU tar: if it does not support --format= it doesn't create
    # ustar tarball either.
    (tar --version) >/dev/null 2>&1 && continue
    am__tar='tar chf - "$$tardir"'
    am__tar_='tar chf - "$tardir"'
    am__untar='tar xf -'
    ;;
  pax)
    am__tar='pax -L -x $1 -w "$$tardir"'
    am__tar_='pax -L -x $1 -w "$tardir"'
    am__untar='pax -r'
    ;;
  cpio)
    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
    am__untar='cpio -i -H $1 -d'
    ;;
  none)
    am__tar=false
    am__tar_=false
    am__untar=false
    ;;
  esac

  # If the value was cached, stop now.  We just wanted to have am__tar
  # and am__untar set.
  test -n "${am_cv_prog_tar_$1}" && break

  # tar/untar a dummy directory, and stop if the command works
  rm -rf conftest.dir
  mkdir conftest.dir
  echo GrepMe > conftest.dir/file
  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  rm -rf conftest.dir
  if test -s conftest.tar; then
    AM_RUN_LOG([$am__untar <conftest.tar])
    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  fi
done
rm -rf conftest.dir

AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
For faster browsing, not all history is shown. View entire blame