diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2014-12-01 13:06:30 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2014-12-01 13:06:30 (GMT) |
commit | c0320cb0002eaff0a6cf6360b1b73a64436e2d80 (patch) | |
tree | 074607747503dd878d3b2831b0a10bb16857b8ec | |
parent | 80030c16fff7a8a5dae18cf2b1ab5da508137847 (diff) | |
parent | 9f6826fdc9621935324f35a596d43c145f7b172c (diff) | |
download | lz4-c0320cb0002eaff0a6cf6360b1b73a64436e2d80.zip lz4-c0320cb0002eaff0a6cf6360b1b73a64436e2d80.tar.gz lz4-c0320cb0002eaff0a6cf6360b1b73a64436e2d80.tar.bz2 |
Merge pull request #37 from Cyan4973/newDir
New dir
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | LZ4_Frame_Format.html (renamed from LZ4_Framing_Format.html) | 0 | ||||
-rw-r--r-- | Makefile | 82 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | cmake_unofficial/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/Makefile | 4 | ||||
-rw-r--r-- | lib/LICENSE (renamed from LICENSE) | 0 | ||||
-rw-r--r-- | lib/Makefile | 118 | ||||
-rw-r--r-- | lib/liblz4.pc.in (renamed from liblz4.pc.in) | 0 | ||||
-rw-r--r-- | lib/lz4.c (renamed from lz4.c) | 0 | ||||
-rw-r--r-- | lib/lz4.h (renamed from lz4.h) | 0 | ||||
-rw-r--r-- | lib/lz4frame.c (renamed from lz4frame.c) | 0 | ||||
-rw-r--r-- | lib/lz4frame.h (renamed from lz4frame.h) | 0 | ||||
-rw-r--r-- | lib/lz4hc.c (renamed from lz4hc.c) | 0 | ||||
-rw-r--r-- | lib/lz4hc.h (renamed from lz4hc.h) | 0 | ||||
-rw-r--r-- | lib/xxhash.c (renamed from xxhash.c) | 0 | ||||
-rw-r--r-- | lib/xxhash.h (renamed from xxhash.h) | 0 | ||||
-rw-r--r-- | lz4_block_format.txt (renamed from lz4_format_description.txt) | 0 | ||||
-rw-r--r-- | programs/Makefile | 10 | ||||
-rw-r--r-- | programs/lz4cli.c | 24 |
20 files changed, 157 insertions, 87 deletions
diff --git a/.travis.yml b/.travis.yml index 67bde9b..a8866a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ before_install: - sudo apt-get install -qq valgrind env: - - LZ4_TRAVIS_CI_ENV=liblz4 + - LZ4_TRAVIS_CI_ENV=install - LZ4_TRAVIS_CI_ENV=streaming-examples - LZ4_TRAVIS_CI_ENV=cmake - LZ4_TRAVIS_CI_ENV=dist diff --git a/LZ4_Framing_Format.html b/LZ4_Frame_Format.html index bd1304c..bd1304c 100644 --- a/LZ4_Framing_Format.html +++ b/LZ4_Frame_Format.html @@ -33,10 +33,6 @@ # Version numbers VERSION=125 export RELEASE=r$(VERSION) -LIBVER_MAJOR=`sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` -LIBVER_MINOR=`sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` -LIBVER_PATCH=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` -LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH) DESTDIR?= PREFIX ?= /usr @@ -47,35 +43,20 @@ CFLAGS += -I. -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prot LIBDIR?= $(PREFIX)/lib INCLUDEDIR=$(PREFIX)/include PRGDIR = programs +LZ4DIR = lib DISTRIBNAME=lz4-$(RELEASE).tar.gz - -# OS X linker doesn't support -soname, and use different extension -# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html -ifeq ($(shell uname), Darwin) - SHARED_EXT = dylib - SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT) - SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT) - SONAME_FLAGS = -install_name $(PREFIX)/lib/liblz4.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER) -else - SONAME_FLAGS = -Wl,-soname=liblz4.$(SHARED_EXT).$(LIBVER_MAJOR) - SHARED_EXT = so - SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR) - SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER) -endif - -TEXT = lz4.c lz4.h lz4hc.c lz4hc.h \ - lz4frame.c lz4frame.h xxhash.c xxhash.h \ - liblz4.pc.in Makefile \ - lz4_format_description.txt NEWS LICENSE README.md \ +TEXT = $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4.h $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4hc.h \ + $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4frame.h $(LZ4DIR)/xxhash.c $(LZ4DIR)/xxhash.h \ + $(LZ4DIR)/liblz4.pc.in $(LZ4DIR)/Makefile $(LZ4DIR)/LICENSE \ + Makefile lz4_block_format.txt LZ4_Frame_Format.html NEWS README.md \ cmake_unofficial/CMakeLists.txt \ $(PRGDIR)/fullbench.c $(PRGDIR)/lz4cli.c \ $(PRGDIR)/datagen.c $(PRGDIR)/fuzzer.c \ $(PRGDIR)/lz4io.c $(PRGDIR)/lz4io.h \ $(PRGDIR)/bench.c $(PRGDIR)/bench.h \ $(PRGDIR)/lz4.1 $(PRGDIR)/lz4c.1 $(PRGDIR)/lz4cat.1 \ - $(PRGDIR)/Makefile $(PRGDIR)/COPYING \ - LZ4_Framing_Format.html + $(PRGDIR)/Makefile $(PRGDIR)/COPYING NONTEXT = images/image00.png images/image01.png images/image02.png \ images/image03.png images/image04.png images/image05.png \ images/image06.png @@ -90,27 +71,18 @@ TRAVIS_TARGET=$(LZ4_TRAVIS_CI_ENV) endif -default: liblz4 +default: lz4programs @cd $(PRGDIR); $(MAKE) -e -all: liblz4 lz4programs +all: lz4programs -lz4programs: lz4.c lz4hc.c +lz4programs: @cd $(PRGDIR); $(MAKE) -e all -liblz4: lz4.c lz4hc.c - @echo compiling static library - @$(CC) $(CPPFLAGS) $(CFLAGS) -c $^ - @$(AR) rcs liblz4.a lz4.o lz4hc.o - @echo compiling dynamic library $(LIBVER) - @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) - @echo creating versioned links - @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR) - @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT) - clean: - @rm -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* $(DISTRIBNAME) *.sha1 liblz4.pc + @rm -f $(DISTRIBNAME) *.sha1 @cd $(PRGDIR); $(MAKE) clean + @cd $(LZ4DIR); $(MAKE) clean @cd examples; $(MAKE) clean @echo Cleaning completed @@ -119,38 +91,16 @@ clean: #make install is validated only for Linux, OSX, kFreeBSD and Hurd targets ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU)) -liblz4.pc: liblz4.pc.in Makefile - @echo creating pkgconfig - @sed -e 's|@PREFIX@|$(PREFIX)|' \ - -e 's|@LIBDIR@|$(LIBDIR)|' \ - -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \ - -e 's|@VERSION@|$(VERSION)|' \ - $< >$@ - -install: liblz4 liblz4.pc - @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/ - @install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) - @cp -a liblz4.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR) - @cp -a liblz4.$(SHARED_EXT) $(DESTDIR)$(LIBDIR) - @cp -a liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/ - @install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a - @install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h - @install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h - @echo lz4 static and shared library installed - @cd $(PRGDIR); $(MAKE) -e install +install: + @cd $(LZ4DIR); sudo $(MAKE) -e install + @cd $(PRGDIR); sudo $(MAKE) -e install uninstall: - rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) - rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) - rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/liblz4.pc - [ -x $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) - [ -f $(DESTDIR)$(LIBDIR)/liblz4.a ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.a - [ -f $(DESTDIR)$(INCLUDEDIR)/lz4.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4.h - [ -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h - @echo lz4 libraries successfully uninstalled + @cd $(LZ4DIR); $(MAKE) uninstall @cd $(PRGDIR); $(MAKE) uninstall dist: clean + @install -dD -m 700 lz4-$(RELEASE)/lib/ @install -dD -m 700 lz4-$(RELEASE)/programs/ @install -dD -m 700 lz4-$(RELEASE)/cmake_unofficial/ @install -dD -m 700 lz4-$(RELEASE)/images/ @@ -1,5 +1,7 @@ r125: Changed : endian and alignment code +Changed : directory structure : new "lib" directory +Updated : lz4io, now uses lz4frame Fixed : some alignment warnings under clang r124: diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt index 38d10b1..cacaca1 100644 --- a/cmake_unofficial/CMakeLists.txt +++ b/cmake_unofficial/CMakeLists.txt @@ -23,7 +23,7 @@ if(UNIX AND BUILD_LIBS) endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") endif() -set(LZ4_DIR ../) +set(LZ4_DIR ../lib/) set(PRG_DIR ../programs/) set(LZ4_SRCS_LIB ${LZ4_DIR}lz4.c ${LZ4_DIR}lz4hc.c ${LZ4_DIR}lz4.h ${LZ4_DIR}lz4hc.h) set(LZ4_SRCS ${LZ4_DIR}lz4frame.c ${LZ4_DIR}xxhash.c ${PRG_DIR}bench.c ${PRG_DIR}lz4cli.c ${PRG_DIR}lz4io.c) diff --git a/examples/Makefile b/examples/Makefile index df24ea9..0c4cf13 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -33,10 +33,10 @@ CC := $(CC) CFLAGS ?= -O3 CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wno-missing-braces # Wno-missing-braces required due to GCC <4.8.3 bug -FLAGS = -I.. $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +FLAGS = -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) TESTFILE= Makefile -LZ4DIR=.. +LZ4DIR = ../lib # Minimize test target for Travis CI's Build Matrix diff --git a/lib/Makefile b/lib/Makefile new file mode 100644 index 0000000..f2d585f --- /dev/null +++ b/lib/Makefile @@ -0,0 +1,118 @@ +# ################################################################ +# LZ4 library - Makefile +# Copyright (C) Yann Collet 2011-2014 +# All rights reserved. +# +# BSD license +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# You can contact the author at : +# - LZ4 source repository : http://code.google.com/p/lz4/ +# - LZ4 source mirror : https://github.com/Cyan4973/lz4 +# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c +# ################################################################ + +# Version numbers +RELEASE=r125 +LIBVER_MAJOR=`sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` +LIBVER_MINOR=`sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` +LIBVER_PATCH=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` +LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH) + +DESTDIR?= +PREFIX ?= /usr +CC := $(CC) +CFLAGS ?= -O3 +CFLAGS += -I. -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\" + +LIBDIR?= $(PREFIX)/lib +INCLUDEDIR=$(PREFIX)/include + + +# OS X linker doesn't support -soname, and use different extension +# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html +ifeq ($(shell uname), Darwin) + SHARED_EXT = dylib + SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT) + SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT) + SONAME_FLAGS = -install_name $(PREFIX)/lib/liblz4.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER) +else + SONAME_FLAGS = -Wl,-soname=liblz4.$(SHARED_EXT).$(LIBVER_MAJOR) + SHARED_EXT = so + SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR) + SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER) +endif + +default: liblz4 + @cd $(PRGDIR); $(MAKE) -e + +all: liblz4 + +liblz4: lz4.c lz4hc.c + @echo compiling static library + @$(CC) $(CPPFLAGS) $(CFLAGS) -c $^ + @$(AR) rcs liblz4.a lz4.o lz4hc.o + @echo compiling dynamic library $(LIBVER) + @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) + @echo creating versioned links + @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR) + @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT) + +clean: + @rm -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* liblz4.pc + @echo Cleaning library completed + + +#------------------------------------------------------------------------ +#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU)) + +liblz4.pc: liblz4.pc.in Makefile + @echo creating pkgconfig + @sed -e 's|@PREFIX@|$(PREFIX)|' \ + -e 's|@LIBDIR@|$(LIBDIR)|' \ + -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \ + -e 's|@VERSION@|$(VERSION)|' \ + $< >$@ + +install: liblz4 liblz4.pc + @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/ + @install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) + @cp -a liblz4.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR) + @cp -a liblz4.$(SHARED_EXT) $(DESTDIR)$(LIBDIR) + @cp -a liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/ + @install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a + @install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h + @install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h + @echo lz4 static and shared library installed + +uninstall: + @rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) + @rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) + @rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/liblz4.pc + @[ -x $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) + @[ -f $(DESTDIR)$(LIBDIR)/liblz4.a ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.a + @[ -f $(DESTDIR)$(INCLUDEDIR)/lz4.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4.h + @[ -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h + @echo lz4 libraries successfully uninstalled + +endif diff --git a/liblz4.pc.in b/lib/liblz4.pc.in index 0d05152..0d05152 100644 --- a/liblz4.pc.in +++ b/lib/liblz4.pc.in diff --git a/lz4frame.c b/lib/lz4frame.c index aa46152..aa46152 100644 --- a/lz4frame.c +++ b/lib/lz4frame.c diff --git a/lz4frame.h b/lib/lz4frame.h index a4f5e36..a4f5e36 100644 --- a/lz4frame.h +++ b/lib/lz4frame.h diff --git a/lz4_format_description.txt b/lz4_block_format.txt index 2c424c5..2c424c5 100644 --- a/lz4_format_description.txt +++ b/lz4_block_format.txt diff --git a/programs/Makefile b/programs/Makefile index 9001e2c..eca920b 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -37,11 +37,11 @@ PREFIX ?= /usr CC := $(CC) CFLAGS ?= -O3 CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\" -FLAGS = -I.. $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +FLAGS = -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) BINDIR=$(PREFIX)/bin MANDIR=$(PREFIX)/share/man/man1 -LZ4DIR=.. +LZ4DIR=../lib TEST_FILES = COPYING TEST_TARGETS=test-native @@ -66,13 +66,13 @@ default: lz4 lz4c all: lz4 lz4c lz4c32 fullbench fullbench32 fuzzer fuzzer32 frametest frametest32 datagen lz4: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c - $(CC) $(FLAGS) -DDISABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) + $(CC) $(FLAGS) $^ -o $@$(EXT) lz4c : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c - $(CC) $(FLAGS) $^ -o $@$(EXT) + $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) lz4c32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c - $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) + $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) fullbench : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c $(CC) $(FLAGS) $^ -o $@$(EXT) diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 8a8fc27..351de80 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -32,10 +32,10 @@ //************************************** // Tuning parameters //************************************** -// DISABLE_LZ4C_LEGACY_OPTIONS : +// ENABLE_LZ4C_LEGACY_OPTIONS : // Control the availability of -c0, -c1 and -hc legacy arguments -// Default : Legacy options are enabled -// #define DISABLE_LZ4C_LEGACY_OPTIONS +// Default : Legacy options are disabled +// #define ENABLE_LZ4C_LEGACY_OPTIONS //************************************** @@ -201,14 +201,14 @@ int usage_advanced(void) DISPLAY( "Benchmark arguments :\n"); DISPLAY( " -b : benchmark file(s)\n"); DISPLAY( " -i# : iteration loops [1-9](default : 3), benchmark mode only\n"); -#if !defined(DISABLE_LZ4C_LEGACY_OPTIONS) +#if defined(ENABLE_LZ4C_LEGACY_OPTIONS) DISPLAY( "Legacy arguments :\n"); DISPLAY( " -c0 : fast compression\n"); DISPLAY( " -c1 : high compression\n"); DISPLAY( " -hc : high compression\n"); DISPLAY( " -y : overwrite output without prompting \n"); DISPLAY( " -s : suppress warnings \n"); -#endif // DISABLE_LZ4C_LEGACY_OPTIONS +#endif // ENABLE_LZ4C_LEGACY_OPTIONS EXTENDED_HELP; return 0; } @@ -250,7 +250,7 @@ int usage_longhelp(void) DISPLAY( "%s can be used in 'pure pipe mode', for example :\n", programName); DISPLAY( "3 : compress data stream from 'generator', send result to 'consumer'\n"); DISPLAY( " generator | %s | consumer \n", programName); -#if !defined(DISABLE_LZ4C_LEGACY_OPTIONS) +#if defined(ENABLE_LZ4C_LEGACY_OPTIONS) DISPLAY( "\n"); DISPLAY( "Warning :\n"); DISPLAY( "Legacy arguments take precedence. Therefore : \n"); @@ -259,7 +259,7 @@ int usage_longhelp(void) DISPLAY( "It is not equivalent to :\n"); DISPLAY( " %s -h -c filename\n", programName); DISPLAY( "which would display help text and exit\n"); -#endif // DISABLE_LZ4C_LEGACY_OPTIONS +#endif // ENABLE_LZ4C_LEGACY_OPTIONS return 0; } @@ -288,7 +288,7 @@ int main(int argc, char** argv) legacy_format=0, forceStdout=0, forceCompress=0, - pause=0; + main_pause=0; char* input_filename=0; char* output_filename=0; char* dynNameSpace=0; @@ -325,14 +325,14 @@ int main(int argc, char** argv) { argument ++; -#if !defined(DISABLE_LZ4C_LEGACY_OPTIONS) +#if defined(ENABLE_LZ4C_LEGACY_OPTIONS) // Legacy options (-c0, -c1, -hc, -y, -s) if ((argument[0]=='c') && (argument[1]=='0')) { cLevel=0; argument++; continue; } // -c0 (fast compression) if ((argument[0]=='c') && (argument[1]=='1')) { cLevel=9; argument++; continue; } // -c1 (high compression) if ((argument[0]=='h') && (argument[1]=='c')) { cLevel=9; argument++; continue; } // -hc (high compression) if (*argument=='y') { LZ4IO_setOverwrite(1); continue; } // -y (answer 'yes' to overwrite permission) if (*argument=='s') { displayLevel=1; continue; } // -s (silent mode) -#endif // DISABLE_LZ4C_LEGACY_OPTIONS +#endif // ENABLE_LZ4C_LEGACY_OPTIONS if ((*argument>='0') && (*argument<='9')) { @@ -424,7 +424,7 @@ int main(int argc, char** argv) break; // Pause at the end (hidden option) - case 'p': pause=1; BMK_SetPause(); break; + case 'p': main_pause=1; BMK_SetPause(); break; EXTENDED_ARGUMENTS; @@ -517,7 +517,7 @@ int main(int argc, char** argv) } } - if (pause) waitEnter(); + if (main_pause) waitEnter(); free(dynNameSpace); return 0; } |