1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Renamed lzma to xz and lzmadec to xzdec. We create symlinks

lzma, unlzma, and lzcat in "make install" for backwards
compatibility with LZMA Utils 4.32.x; I'm not sure if this
should be the default though.
This commit is contained in:
Lasse Collin 2008-11-19 23:52:24 +02:00
parent e114502b2b
commit 1880a3927b
28 changed files with 53 additions and 55 deletions

View file

@ -709,8 +709,8 @@ AC_CONFIG_FILES([
src/liblzma/subblock/Makefile src/liblzma/subblock/Makefile
src/liblzma/delta/Makefile src/liblzma/delta/Makefile
src/liblzma/simple/Makefile src/liblzma/simple/Makefile
src/lzma/Makefile src/xz/Makefile
src/lzmadec/Makefile src/xzdec/Makefile
src/scripts/Makefile src/scripts/Makefile
tests/Makefile tests/Makefile
debug/Makefile debug/Makefile

View file

@ -1,13 +1,10 @@
# List of source files which contain translatable strings. # List of source files which contain translatable strings.
src/lzma/help.c src/xz/args.c
src/lzma/alloc.c src/xz/hardware.c
src/lzma/args.c src/xz/io.c
src/lzma/error.c src/xz/main.c
src/lzma/io.c src/xz/message.c
src/lzma/list.c src/xz/options.c
src/lzma/main.c src/xz/process.c
src/lzma/options.c src/xz/suffix.c
src/lzma/process.c src/xz/util.c
src/lzma/suffix.c
src/lzma/util.c
lib/getopt.c

View file

@ -12,5 +12,5 @@
## Lesser General Public License for more details. ## Lesser General Public License for more details.
## ##
SUBDIRS = liblzma lzma lzmadec scripts SUBDIRS = liblzma xz xzdec scripts
EXTRA_DIST = common EXTRA_DIST = common

View file

@ -12,9 +12,9 @@
## Lesser General Public License for more details. ## Lesser General Public License for more details.
## ##
bin_PROGRAMS = lzma bin_PROGRAMS = xz
lzma_SOURCES = \ xz_SOURCES = \
args.c \ args.c \
args.h \ args.h \
hardware.c \ hardware.c \
@ -35,38 +35,40 @@ lzma_SOURCES = \
util.c \ util.c \
util.h util.h
## It must be able to find sysdefs.h, lzma_adv.h, and possible xz_CPPFLAGS = \
## replacement headers.
lzma_CPPFLAGS = \
-DLOCALEDIR=\"$(localedir)\" \ -DLOCALEDIR=\"$(localedir)\" \
-I@top_srcdir@/src/common \ -I@top_srcdir@/src/common \
-I@top_srcdir@/src/liblzma/api \ -I@top_srcdir@/src/liblzma/api \
-I@top_builddir@/lib \ -I@top_builddir@/lib \
-I@top_srcdir@/lib -I@top_srcdir@/lib
lzma_CFLAGS = @PTHREAD_CFLAGS@ xz_CFLAGS = @PTHREAD_CFLAGS@
## Always link the command line tool statically against liblzma. It is ## Always link the command line tool statically against liblzma. It is
## faster on x86, because no need for PIC. We also have one dependency less, ## faster on x86, because no need for PIC. We also have one dependency less,
## which allows users to more freely copy the lzma binary to other boxes. ## which allows users to more freely copy the xz binary to other boxes.
lzma_LDFLAGS = -static xz_LDFLAGS = -static
lzma_LDADD = \ xz_LDADD = \
@top_builddir@/src/liblzma/liblzma.la \ @top_builddir@/src/liblzma/liblzma.la \
@LTLIBINTL@ \ @LTLIBINTL@ \
@PTHREAD_LIBS@ @PTHREAD_LIBS@
if COND_GNULIB if COND_GNULIB
lzma_LDADD += @top_builddir@/lib/libgnu.a xz_LDADD += @top_builddir@/lib/libgnu.a
endif endif
## Create symlinks for unlzma and lzcat: ## Create symlinks for unxz and xzcat for convenicen. Create symlinks also
## for lzma, unlzma, and lzcat for compatibility with LZMA Utils 4.32.x.
install-exec-hook: install-exec-hook:
cd $(DESTDIR)$(bindir) && \ cd $(DESTDIR)$(bindir) && \
rm -f unlzma lzcat && \ rm -f unxz xzcat lzma unlzma lzcat && \
$(LN_S) lzma unlzma && \ $(LN_S) xz unxz && \
$(LN_S) lzma lzcat $(LN_S) xz xzcat && \
$(LN_S) xz lzma && \
$(LN_S) xz unlzma && \
$(LN_S) xz lzcat
uninstall-hook: uninstall-hook:
cd $(DESTDIR)$(bindir) && \ cd $(DESTDIR)$(bindir) && \
rm -f unlzma lzcat rm -f unxz xzcat lzma unlzma lzcat

View file

@ -12,18 +12,18 @@
## Lesser General Public License for more details. ## Lesser General Public License for more details.
## ##
bin_PROGRAMS = lzmadec bin_PROGRAMS = xzdec
lzmadec_SOURCES = lzmadec.c xzdec_SOURCES = xzdec.c
lzmadec_CPPFLAGS = \ xzdec_CPPFLAGS = \
-I@top_srcdir@/src/common \ -I@top_srcdir@/src/common \
-I@top_srcdir@/src/liblzma/api \ -I@top_srcdir@/src/liblzma/api \
-I@top_builddir@/lib -I@top_builddir@/lib
lzmadec_LDFLAGS = -static xzdec_LDFLAGS = -static
lzmadec_LDADD = \ xzdec_LDADD = \
@top_builddir@/src/liblzma/liblzma.la \ @top_builddir@/src/liblzma/liblzma.la \
@LTLIBINTL@ @LTLIBINTL@
if COND_GNULIB if COND_GNULIB
lzmadec_LDADD += @top_builddir@/lib/libgnu.a xzdec_LDADD += @top_builddir@/lib/libgnu.a
endif endif

View file

@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file lzmadec.c /// \file xzdec.c
/// \brief Simple single-threaded tool to uncompress .lzma files /// \brief Simple single-threaded tool to uncompress .lzma files
// //
// Copyright (C) 2007 Lasse Collin // Copyright (C) 2007 Lasse Collin
@ -151,7 +151,7 @@ set_default_memlimit(void)
/// \brief Converts a string to size_t /// \brief Converts a string to size_t
/// ///
/// This is rudely copied from src/lzma/util.c and modified a little. :-( /// This is rudely copied from src/xz/util.c and modified a little. :-(
/// ///
static size_t static size_t
str_to_uint64(const char *value) str_to_uint64(const char *value)

View file

@ -24,8 +24,8 @@ if test $? != 42 ; then
exit 77 exit 77
fi fi
test_lzma() { test_xz() {
if $LZMA -c "$@" "$FILE" > tmp_compressed; then if $XZ -c "$@" "$FILE" > tmp_compressed; then
: :
else else
echo "Compressing failed: $* $FILE" echo "Compressing failed: $* $FILE"
@ -33,7 +33,7 @@ test_lzma() {
exit 1 exit 1
fi fi
if $LZMA -cd tmp_compressed > tmp_uncompressed ; then if $XZ -cd tmp_compressed > tmp_uncompressed ; then
: :
else else
echo "Decoding failed: $* $FILE" echo "Decoding failed: $* $FILE"
@ -49,7 +49,7 @@ test_lzma() {
exit 1 exit 1
fi fi
if $LZMADEC tmp_compressed > tmp_uncompressed ; then if $XZDEC tmp_compressed > tmp_uncompressed ; then
: :
else else
echo "Decoding failed: $* $FILE" echo "Decoding failed: $* $FILE"
@ -69,10 +69,9 @@ test_lzma() {
echo . | tr -d '\n\r' echo . | tr -d '\n\r'
} }
# TODO: Remove --format=xz once the command name has been changed. XZ="../src/xz/xz --memory=15MiB --threads=1"
LZMA="../src/lzma/lzma --memory=15Mi --threads=1 --format=xz" XZDEC="../src/xzdec/xzdec --memory=4MiB"
LZMADEC="../src/lzmadec/lzmadec --memory=4Mi" unset XZ_OPT
unset LZMA_OPT
# Create the required input files. # Create the required input files.
if ./create_compress_files ; then if ./create_compress_files ; then
@ -97,11 +96,11 @@ do
echo " $MSG" | tr -d '\n\r' echo " $MSG" | tr -d '\n\r'
# Don't test with empty arguments; it breaks some ancient # Don't test with empty arguments; it breaks some ancient
# proprietary /bin/sh versions due to $@ used in test_lzma(). # proprietary /bin/sh versions due to $@ used in test_xz().
test_lzma -1 test_xz -1
test_lzma -2 test_xz -2
test_lzma -3 test_xz -3
test_lzma -4 test_xz -4
for ARGS in \ for ARGS in \
--subblock \ --subblock \
@ -122,8 +121,8 @@ do
--armthumb \ --armthumb \
--sparc --sparc
do do
test_lzma $ARGS --lzma2=dict=64KiB,nice=32,mode=fast test_xz $ARGS --lzma2=dict=64KiB,nice=32,mode=fast
test_lzma --subblock $ARGS --lzma2=dict=64KiB,nice=32,mode=fast test_xz --subblock $ARGS --lzma2=dict=64KiB,nice=32,mode=fast
done done
echo echo

View file

@ -18,7 +18,7 @@
for I in "$srcdir"/files/good-*.xz for I in "$srcdir"/files/good-*.xz
do do
if ../src/lzmadec/lzmadec "$I" > /dev/null 2> /dev/null ; then if ../src/xzdec/xzdec "$I" > /dev/null 2> /dev/null ; then
: :
else else
echo "Good file failed: $I" echo "Good file failed: $I"
@ -29,7 +29,7 @@ done
for I in "$srcdir"/files/bad-*.xz for I in "$srcdir"/files/bad-*.xz
do do
if ../src/lzmadec/lzmadec "$I" > /dev/null 2> /dev/null ; then if ../src/xzdec/xzdec "$I" > /dev/null 2> /dev/null ; then
echo "Bad file succeeded: $I" echo "Bad file succeeded: $I"
(exit 1) (exit 1)
exit 1 exit 1