From 653f0b1399313ecef86d99a2552f40fb9e51b820 Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 17 Apr 2017 00:34:00 +0300 Subject: [PATCH] use system's zlib except for libretro github issue #45 --- Makefile | 4 +++- configure | 6 +++--- pico/cart.c | 3 +-- pico/state.c | 2 +- platform/gizmondo/menu.c | 2 +- platform/gp2x/emu.c | 2 +- platform/psp/menu.c | 2 +- unzip/unzip.c | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index e5206697..3b5a7140 100644 --- a/Makefile +++ b/Makefile @@ -163,10 +163,12 @@ else OBJS += platform/common/mp3_dummy.o endif -ifneq "$(DONT_COMPILE_IN_ZLIB)" "1" +ifeq "$(PLATFORM)" "libretro" # zlib OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o +CFLAGS += -Izlib +endif # unzip OBJS += unzip/unzip.o unzip/unzip_stream.o endif diff --git a/configure b/configure index 9ccd2da9..a25e7c1c 100755 --- a/configure +++ b/configure @@ -241,7 +241,7 @@ check_zlib() #include int main(void) { uncompress(0, 0, 0, 0); } EOF - compile_binary + compile_binary "$@" } check_libpng() @@ -291,8 +291,8 @@ EOF compile_object "$@" } -#MAIN_LDLIBS="$MAIN_LDLIBS -lz" -#check_zlib || fail "please install zlib (libz-dev)" +MAIN_LDLIBS="$MAIN_LDLIBS -lz" +check_zlib -lz || fail "please install zlib (libz-dev)" MAIN_LDLIBS="-lpng $MAIN_LDLIBS" check_libpng || fail "please install libpng (libpng-dev)" diff --git a/pico/cart.c b/pico/cart.c index b35eb533..9dce38d9 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -8,10 +8,9 @@ */ #include "pico_int.h" -#include "../zlib/zlib.h" #include "../cpu/debug.h" #include "../unzip/unzip.h" -#include "../unzip/unzip_stream.h" +#include static int rom_alloc_size; diff --git a/pico/state.c b/pico/state.c index 089957eb..88b8655c 100644 --- a/pico/state.c +++ b/pico/state.c @@ -7,7 +7,7 @@ */ #include "pico_int.h" -#include +#include #include "../cpu/sh2/sh2.h" #include "sound/ym2612.h" diff --git a/platform/gizmondo/menu.c b/platform/gizmondo/menu.c index d4f6bd49..dd6740a3 100644 --- a/platform/gizmondo/menu.c +++ b/platform/gizmondo/menu.c @@ -32,7 +32,7 @@ #include #include -#include +#include #define gizKeyUnkn "???" diff --git a/platform/gp2x/emu.c b/platform/gp2x/emu.c index 8e682f16..c0bc71f4 100644 --- a/platform/gp2x/emu.c +++ b/platform/gp2x/emu.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #ifdef BENCHMARK #define OSD_FPS_X 220 diff --git a/platform/psp/menu.c b/platform/psp/menu.c index 24c6d606..f01f0ae5 100644 --- a/platform/psp/menu.c +++ b/platform/psp/menu.c @@ -33,7 +33,7 @@ #include #include -#include +#include #define pspKeyUnkn "???" diff --git a/unzip/unzip.c b/unzip/unzip.c index ddf59aa6..10291652 100644 --- a/unzip/unzip.c +++ b/unzip/unzip.c @@ -5,7 +5,7 @@ #include #include -#include "zlib/zlib.h" +#include /* public globals */ //int gUnzipQuiet = 0; /* flag controls error messages */ -- 2.39.5