diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-10 17:29:18 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-10 17:30:53 +0300 |
commit | a7e9b6a17b2c111f4afa5ae35e3a206483366693 (patch) | |
tree | bd9e7c85b8464b5e81d9ce8ee4f6230625e7c36c /acinclude.m4 | |
parent | f0ceef8596838d725205e0b2aa7fd39da48fa34d (diff) | |
download | tar-a7e9b6a17b2c111f4afa5ae35e3a206483366693.tar.gz |
Allow installers to specify alternative program names for compression programs.
This adds --with-gzip, --with-bzip2 etc. switches to the configure, so that
one can do, e.g. ./configure --with-bzip2=lbzip2 and have lbzip2 executed
whenever user calls `tar --bzip2'.
* acinclude.m4: New file.
* configure.ac: Add TAR_COMPR_PROGRAM invocations for
the supported compressors.
* src/buffer.c (magic): Use *_COMPRESSOR defines instead
of hardcoded program names.
* src/suffix.c (compression_suffixes): Likewise.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 00000000..fff919af --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,26 @@ +dnl Special Autoconf macros for GNU Tar -*- autoconf -*- +dnl Copyright (C) 2009 Free Software Foundation, Inc. +dnl +dnl GNU tar is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl GNU tar is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with GNU tar. If not, see <http://www.gnu.org/licenses/>. + +AC_DEFUN([TAR_COMPR_PROGRAM],[ + m4_pushdef([tar_compr_define],translit($1,[a-z+-],[A-ZX_])[_PROGRAM]) + m4_pushdef([tar_compr_var],[tar_cv_compressor_]translit($1,[+-],[x_])) + AC_ARG_WITH([--with-]$1, + AC_HELP_STRING([--with-]$1[=PROG], + [use PROG as ]$1[ compressor program]), + [tar_compr_var=${withvar}], + [tar_compr_var=m4_if($2,,$1,$2)]) + AC_DEFINE_UNQUOTED(tar_compr_define, "$tar_compr_var", + [Define to the program name of ]$1[ compressor program])]) |