improved detection of -lz
This commit is contained in:
+2
-5
@@ -125,11 +125,8 @@ zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) zstdcli.c fileio.c
|
|||||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT)
|
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT)
|
||||||
|
|
||||||
gzstd: clean_decomp_o
|
gzstd: clean_decomp_o
|
||||||
ifeq ($(shell ld -lz 2>/dev/null && echo -n true),true)
|
echo "int main(){}" | $(CC) -o have_zlib -x c - -lz && echo found zlib || echo did not found zlib
|
||||||
CPPFLAGS=-DZSTD_GZDECOMPRESS LDFLAGS="-lz" $(MAKE) zstd
|
if [ -s have_zlib ]; then echo building gzstd && rm have_zlib$(EXT) && CPPFLAGS=-DZSTD_GZDECOMPRESS LDFLAGS="-lz" $(MAKE) zstd; else echo building plain zstd && $(MAKE) zstd; fi
|
||||||
else
|
|
||||||
$(MAKE) zstd
|
|
||||||
endif
|
|
||||||
|
|
||||||
generate_res:
|
generate_res:
|
||||||
windres\generate_res.bat
|
windres\generate_res.bat
|
||||||
|
|||||||
+2
-1
@@ -726,6 +726,7 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* dstFileName, const ch
|
|||||||
}
|
}
|
||||||
readSomething = 1; /* there is at least >= 4 bytes in srcFile */
|
readSomething = 1; /* there is at least >= 4 bytes in srcFile */
|
||||||
if (sizeCheck != toRead) { DISPLAY("zstd: %s: unknown header \n", srcFileName); fclose(srcFile); return 1; } /* srcFileName is empty */
|
if (sizeCheck != toRead) { DISPLAY("zstd: %s: unknown header \n", srcFileName); fclose(srcFile); return 1; } /* srcFileName is empty */
|
||||||
|
printf("buf[0]=%d buf[1]=%d toRead=%d\n", buf[0], buf[1], (int)toRead);
|
||||||
if (buf[0] == 31 && buf[1] == 139) { /* gz header */
|
if (buf[0] == 31 && buf[1] == 139) { /* gz header */
|
||||||
#ifdef ZSTD_GZDECOMPRESS
|
#ifdef ZSTD_GZDECOMPRESS
|
||||||
unsigned long long const result = FIO_decompressGzFrame(ress, srcFile, srcFileName, toRead);
|
unsigned long long const result = FIO_decompressGzFrame(ress, srcFile, srcFileName, toRead);
|
||||||
@@ -841,7 +842,7 @@ int FIO_decompressMultipleFilenames(const char** srcNamesTable, unsigned nbFiles
|
|||||||
}
|
}
|
||||||
if (sfnSize <= suffixSize || strcmp(suffixPtr, suffix) != 0) {
|
if (sfnSize <= suffixSize || strcmp(suffixPtr, suffix) != 0) {
|
||||||
if (sfnSize <= gzipSuffixSize || strcmp(gzipSuffixPtr, GZ_EXTENSION) != 0) {
|
if (sfnSize <= gzipSuffixSize || strcmp(gzipSuffixPtr, GZ_EXTENSION) != 0) {
|
||||||
DISPLAYLEVEL(1, "zstd: %s: unknown suffix (%4s expected) -- ignored \n", srcFileName, suffix);
|
DISPLAYLEVEL(1, "zstd: %s: unknown suffix (%s/%s expected) -- ignored \n", srcFileName, suffix, GZ_EXTENSION);
|
||||||
skippedFiles++;
|
skippedFiles++;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user