From e07ce68e7f38851af647625592825aff199e02ad Mon Sep 17 00:00:00 2001 From: orbea Date: Wed, 27 Dec 2017 00:32:25 -0800 Subject: [PATCH] Makefile.common: Clean up zlib check. --- Makefile.common | 38 +++++++++++++++----------------------- qb/config.libs.sh | 6 +++++- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Makefile.common b/Makefile.common index 44179f2dcc..bcc4f6466b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1366,14 +1366,27 @@ endif ifeq ($(HAVE_ZLIB), 1) OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file_zlib.o \ $(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.o - OBJ += $(ZLIB_OBJS) DEFINES += -DHAVE_ZLIB HAVE_COMPRESSION = 1 ifeq ($(HAVE_BUILTINZLIB), 1) + OBJ += $(DEPS_DIR)/libz/adler32.o \ + $(DEPS_DIR)/libz/compress.o \ + $(DEPS_DIR)/libz/crc32.o \ + $(DEPS_DIR)/libz/deflate.o \ + $(DEPS_DIR)/libz/gzclose.o \ + $(DEPS_DIR)/libz/gzlib.o \ + $(DEPS_DIR)/libz/gzread.o \ + $(DEPS_DIR)/libz/gzwrite.o \ + $(DEPS_DIR)/libz/inffast.o \ + $(DEPS_DIR)/libz/inflate.o \ + $(DEPS_DIR)/libz/inftrees.o \ + $(DEPS_DIR)/libz/trees.o \ + $(DEPS_DIR)/libz/uncompr.o \ + $(DEPS_DIR)/libz/zutil.o INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/include/compat DEFINES += -DWANT_ZLIB else - LIBS += -lz + LIBS += $(ZLIB_LIBS) endif endif @@ -1412,27 +1425,6 @@ ifdef HAVE_COMPRESSION DEFINES += -DHAVE_COMPRESSION endif -ifeq ($(HAVE_BUILTINZLIB),1) - OBJ += $(DEPS_DIR)/libz/adler32.o \ - $(DEPS_DIR)/libz/compress.o \ - $(DEPS_DIR)/libz/crc32.o \ - $(DEPS_DIR)/libz/deflate.o \ - $(DEPS_DIR)/libz/gzclose.o \ - $(DEPS_DIR)/libz/gzlib.o \ - $(DEPS_DIR)/libz/gzread.o \ - $(DEPS_DIR)/libz/gzwrite.o \ - $(DEPS_DIR)/libz/inffast.o \ - $(DEPS_DIR)/libz/inflate.o \ - $(DEPS_DIR)/libz/inftrees.o \ - $(DEPS_DIR)/libz/trees.o \ - $(DEPS_DIR)/libz/uncompr.o \ - $(DEPS_DIR)/libz/zutil.o -else -ifeq ($(HAVE_ZLIB), 1) -OBJ += $(ZLIB_OBJS) -endif -endif - ifeq ($(HAVE_7ZIP), 1) ifeq ($(HAVE_ZLIB), 1) ifeq ($(HAVE_FLAC), 1) diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 307e57aa76..fccfcbba50 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -311,7 +311,11 @@ if [ "$HAVE_OPENGL" != 'no' ] && [ "$HAVE_OPENGLES" != 'yes' ]; then fi fi -if [ "$HAVE_ZLIB" != 'no' ]; then +if [ "$HAVE_ZLIB" = 'no' ]; then + HAVE_BUILTINZLIB=no +elif [ "$HAVE_BUILTINZLIB" = 'yes' ]; then + HAVE_ZLIB=yes +else check_pkgconf ZLIB zlib check_val '' ZLIB '-lz' fi