# Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 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. # _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. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} 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]) AM_RUN_LOG([cat conftest.dir/file]) 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
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
internal | Folder | 0755 |
|
|
amversion.m4 | File | 1.58 KB | 0644 |
|
ar-lib.m4 | File | 1.98 KB | 0644 |
|
as.m4 | File | 767 B | 0644 |
|
auxdir.m4 | File | 2.37 KB | 0644 |
|
cond-if.m4 | File | 1.01 KB | 0644 |
|
cond.m4 | File | 1.01 KB | 0644 |
|
depend.m4 | File | 7.11 KB | 0644 |
|
depout.m4 | File | 2.93 KB | 0644 |
|
dmalloc.m4 | File | 906 B | 0644 |
|
extra-recurs.m4 | File | 738 B | 0644 |
|
gcj.m4 | File | 649 B | 0644 |
|
init.m4 | File | 5.78 KB | 0644 |
|
install-sh.m4 | File | 677 B | 0644 |
|
lead-dot.m4 | File | 641 B | 0644 |
|
lex.m4 | File | 689 B | 0644 |
|
lispdir.m4 | File | 2.1 KB | 0644 |
|
maintainer.m4 | File | 1.62 KB | 0644 |
|
make.m4 | File | 1.3 KB | 0644 |
|
minuso.m4 | File | 1.25 KB | 0644 |
|
missing.m4 | File | 1.13 KB | 0644 |
|
mkdirp.m4 | File | 1.32 KB | 0644 |
|
obsolete.m4 | File | 1008 B | 0644 |
|
options.m4 | File | 1.06 KB | 0644 |
|
python.m4 | File | 8.87 KB | 0644 |
|
runlog.m4 | File | 718 B | 0644 |
|
sanity.m4 | File | 2.58 KB | 0644 |
|
silent.m4 | File | 1.87 KB | 0644 |
|
strip.m4 | File | 1.36 KB | 0644 |
|
substnot.m4 | File | 675 B | 0644 |
|
tar.m4 | File | 4.37 KB | 0644 |
|
upc.m4 | File | 836 B | 0644 |
|
vala.m4 | File | 1.62 KB | 0644 |
|