]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed zlib detection with MinGW
authorPrzemyslaw Skibinski <inikep@gmail.com>
Wed, 8 Feb 2017 13:32:49 +0000 (14:32 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Wed, 8 Feb 2017 13:32:49 +0000 (14:32 +0100)
programs/Makefile

index ae798c2a6572351bacfa3763cdcfb63ceb90af31..b189224f3a348fe0890248e1f287185da78beb9e 100644 (file)
@@ -67,7 +67,10 @@ endif
 
 # zlib detection
 VOID = /dev/null
-HAVE_ZLIB := $(shell echo "\#include <zlib.h>\nint main(){}" | $(CC) -o $(VOID) -x c - -lz 2> $(VOID) && echo 1 || echo 0)
+HAVE_ZLIB := $(shell echo -e "\#include <zlib.h>\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: