From: Przemyslaw Skibinski Date: Wed, 8 Feb 2017 13:32:49 +0000 (+0100) Subject: fixed zlib detection with MinGW X-Git-Tag: v1.1.4~1^2~65^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca20edd96024e71011f83e526d831028c877e30f;p=thirdparty%2Fzstd.git fixed zlib detection with MinGW --- diff --git a/programs/Makefile b/programs/Makefile index ae798c2a6..b189224f3 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -67,7 +67,10 @@ endif # zlib detection VOID = /dev/null -HAVE_ZLIB := $(shell echo "\#include \nint main(){}" | $(CC) -o $(VOID) -x c - -lz 2> $(VOID) && echo 1 || echo 0) +HAVE_ZLIB := $(shell echo -e "\#include \nint main(){}" | $(CC) -o have_zlib -x c - -lz 2> $(VOID) && echo 1 || echo 0) +ifeq ($(HAVE_ZLIB), 1) +TEMP := $(shell rm have_zlib$(EXT)) +endif ifeq ($(HAVE_ZLIB), 1) ZLIBCPP = -DZSTD_GZDECOMPRESS ZLIBLD = -lz @@ -152,7 +155,7 @@ clean: @$(RM) $(ZSTDDIR)/decompress/*.o $(ZSTDDIR)/decompress/zstd_decompress.gcda @$(RM) core *.o tmp* result* *.gcda dictionary *.zst \ zstd$(EXT) zstd32$(EXT) zstd-compress$(EXT) zstd-decompress$(EXT) \ - *.gcda default.profraw have_zlib + *.gcda default.profraw have_zlib$(EXT) @echo Cleaning completed clean_decomp_o: