summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/README.md8
-rw-r--r--lib/dll/example/Makefile (renamed from lib/dll/fullbench-dll/Makefile)12
-rw-r--r--lib/dll/example/README.md (renamed from lib/dll/README.md)38
-rw-r--r--lib/dll/example/fullbench-dll.sln (renamed from lib/dll/fullbench-dll/fullbench-dll.sln)0
-rw-r--r--lib/dll/example/fullbench-dll.vcxproj (renamed from lib/dll/fullbench-dll/fullbench-dll.vcxproj)0
5 files changed, 40 insertions, 18 deletions
diff --git a/lib/README.md b/lib/README.md
index 430be1f..18793d4 100644
--- a/lib/README.md
+++ b/lib/README.md
@@ -42,12 +42,16 @@ It must be used with static linking ***only***.
DLL can be created using MinGW+MSYS with the `make liblz4` command.
This command creates `dll\liblz4.dll` and the import library `dll\liblz4.lib`.
-To compile a project the import library has to be added to linking options.
+The import library is only required with Visual C++.
+The header files `lz4.h`, `lz4hc.h`, `lz4frame.h` and the dynamic library
+`dll\liblz4.dll` are required to compile a project using gcc/MinGW.
+The dynamic library has to be added to linking options.
It means that if a project that uses LZ4 consists of a single `test-dll.c`
file it should be compiled with "liblz4.lib". For example:
```
- gcc $(CFLAGS) test-dll.c -o test-dll liblz4.lib
+ gcc $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\liblz4.dll
```
+The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
#### Miscellaneous
diff --git a/lib/dll/fullbench-dll/Makefile b/lib/dll/example/Makefile
index 32e13fc..e987956 100644
--- a/lib/dll/fullbench-dll/Makefile
+++ b/lib/dll/example/Makefile
@@ -24,7 +24,9 @@
# ##########################################################################
VOID := /dev/null
-LZ4DIR := ./include
+LZ4DIR := ../include
+LIBDIR := ../static
+DLLDIR := ../dll
CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make
CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum \
@@ -50,11 +52,11 @@ default: all
all: fullbench-dll fullbench-lib
-fullbench-lib: fullbench/fullbench.c fullbench/xxhash.c
- $(CC) $(FLAGS) $^ -o $@$(EXT) static/liblz4_static.lib
+fullbench-lib: fullbench.c xxhash.c
+ $(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4_static.lib
-fullbench-dll: fullbench/fullbench.c fullbench/xxhash.c
- $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 dll/liblz4.lib
+fullbench-dll: fullbench.c xxhash.c
+ $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(DLLDIR)/liblz4.dll
clean:
@$(RM) fullbench-dll$(EXT) fullbench-lib$(EXT) \
diff --git a/lib/dll/README.md b/lib/dll/example/README.md
index 779b8ae..4908663 100644
--- a/lib/dll/README.md
+++ b/lib/dll/example/README.md
@@ -1,38 +1,54 @@
-The static and dynamic LZ4 libraries
+LZ4 Windows binary package
====================================
#### The package contents
-- `dll\liblz4.dll` : The DLL of LZ4 library
-- `dll\liblz4.lib` : The import library of LZ4 library
-- `include\` : Header files required with LZ4 library
-- `fullbench\` : The example of usage of LZ4 library
+- `lz4.exe` : Command Line Utility, supporting gzip-like arguments
+- `dll\liblz4.dll` : The DLL of LZ4 library
+- `dll\liblz4.lib` : The import library of LZ4 library for Visual C++
+- `example\` : The example of usage of LZ4 library
+- `include\` : Header files required with LZ4 library
- `static\liblz4_static.lib` : The static LZ4 library
+#### Usage of Command Line Interface
+
+Command Line Interface (CLI) supports gzip-like arguments.
+By default CLI takes an input file and compresses it to an output file:
+```
+ Usage: lz4 [arg] [input] [output]
+```
+The full list of commands for CLI can be obtained with `-h` or `-H`. The ratio can
+be improved with commands from `-3` to `-16` but higher levels also have slower
+compression. CLI includes in-memory compression benchmark module with compression
+levels starting from `-b` and ending with `-e` with iteration time of `-i` seconds.
+CLI supports aggregation of parameters i.e. `-b1`, `-e18`, and `-i1` can be joined
+into `-b1e18i1`.
+
+
#### The example of usage of static and dynamic LZ4 libraries with gcc/MinGW
-Use `make` to build `fullbench-dll` and `fullbench-lib`.
+Use `cd example` and `make` to build `fullbench-dll` and `fullbench-lib`.
`fullbench-dll` uses a dynamic LZ4 library from the `dll` directory.
`fullbench-lib` uses a static LZ4 library from the `lib` directory.
#### Using LZ4 DLL with gcc/MinGW
-The header files from `include\` and the import library `dll\liblz4.lib`
+The header files from `include\` and the dynamic library `dll\liblz4.dll`
are required to compile a project using gcc/MinGW.
-The import library has to be added to linking options.
+The dynamic library has to be added to linking options.
It means that if a project that uses LZ4 consists of a single `test-dll.c`
-file it should be compiled with "liblz4.lib". For example:
+file it should be compiled with "liblz4.dll". For example:
```
- gcc $(CFLAGS) -Iinclude/ test-dll.c -o test-dll dll\liblz4.lib
+ gcc $(CFLAGS) -Iinclude\ test-dll.c -o test-dll dll\liblz4.dll
```
The compiled executable will require LZ4 DLL which is available at `dll\liblz4.dll`.
#### The example of usage of static and dynamic LZ4 libraries with Visual C++
-Open `fullbench\fullbench-dll.sln` to compile `fullbench-dll` that uses a
+Open `example\fullbench-dll.sln` to compile `fullbench-dll` that uses a
dynamic LZ4 library from the `dll` directory. The solution works with Visual C++
2010 or newer. When one will open the solution with Visual C++ newer than 2010
then the solution will upgraded to the current version.
diff --git a/lib/dll/fullbench-dll/fullbench-dll.sln b/lib/dll/example/fullbench-dll.sln
index 72e302e..72e302e 100644
--- a/lib/dll/fullbench-dll/fullbench-dll.sln
+++ b/lib/dll/example/fullbench-dll.sln
diff --git a/lib/dll/fullbench-dll/fullbench-dll.vcxproj b/lib/dll/example/fullbench-dll.vcxproj
index cdb5534..cdb5534 100644
--- a/lib/dll/fullbench-dll/fullbench-dll.vcxproj
+++ b/lib/dll/example/fullbench-dll.vcxproj