diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2018-11-19 22:31:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 22:31:37 (GMT) |
commit | 1e72459f76f63b33ea52a461871ac041eea8bf67 (patch) | |
tree | 07362ad478a1273fe70f1b85a1f97b0d2e36c059 /lib | |
parent | c910db3a41eb654182f1af86dbe4ecd89d53b58c (diff) | |
parent | e057e942157263ed3f55633daa944a757ceffe9d (diff) | |
download | lz4-1e72459f76f63b33ea52a461871ac041eea8bf67.zip lz4-1e72459f76f63b33ea52a461871ac041eea8bf67.tar.gz lz4-1e72459f76f63b33ea52a461871ac041eea8bf67.tar.bz2 |
Merge pull request #604 from vtorri/dev
Add DLLTOOL variable so that one can override dlltool binary
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile | 4 | ||||
-rw-r--r-- | lib/README.md | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Makefile b/lib/Makefile index f7bd439..f535435 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -54,6 +54,8 @@ DEBUGFLAGS:= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +DLLTOOL ?= dlltool + SRCFILES := $(sort $(wildcard *.c)) @@ -104,7 +106,7 @@ ifeq ($(BUILD_SHARED),yes) # can be disabled on command line @echo compiling dynamic library $(LIBVER) ifneq (,$(filter Windows%,$(OS))) $(Q)$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll/$@.dll - dlltool -D dll/liblz4.dll -d dll/liblz4.def -l dll/liblz4.lib + $(DLLTOOL) -D dll/liblz4.dll -d dll/liblz4.def -l dll/liblz4.lib else $(Q)$(CC) $(FLAGS) -shared $^ -fPIC -fvisibility=hidden $(SONAME_FLAGS) -o $@ @echo creating versioned links diff --git a/lib/README.md b/lib/README.md index 8b3b424..018ce40 100644 --- a/lib/README.md +++ b/lib/README.md @@ -46,6 +46,10 @@ by using build macro `LZ4_PUBLISH_STATIC_FUNCTIONS`. 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 override the `dlltool` command when cross-compiling on Linux, just set the `DLLTOOL` variable. Example of cross compilation on Linux with mingw-w64 64 bits: +``` +make BUILD_STATIC=no CC=x86_64-w64-mingw32-gcc DLLTOOL=x86_64-w64-mingw32-dlltool OS=Windows_NT +``` 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. |