From 6979ca5c02d202597cf516cab889babbb9f74acc Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Thu, 26 Jan 2017 17:51:31 +0100
Subject: [PATCH 07/32] Fix linking against shared/static libpng

Change-Id: Ic7a0ec9544059b8e647a5d0186f1b88c00911dcf
---
 src/gui/configure.json | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gui/configure.json b/src/gui/configure.json
index 95e8955b510..bc3eae90872 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -399,8 +399,10 @@
                 { "type": "pkgConfig", "args": "libpng" },
                 { "libs": "-llibpng16", "condition": "config.msvc" },
                 { "libs": "-llibpng", "condition": "config.msvc" },
-                { "libs": "-lpng16", "condition": "!config.msvc" },
-                { "libs": "-lpng", "condition": "!config.msvc" },
+                { "libs": "-lpng16 -lz", "condition": "!config.msvc && !features.shared" },
+                { "libs": "-lpng -lz", "condition": "!config.msvc && !features.shared" },
+                { "libs": "-lpng16", "condition": "!config.msvc && features.shared" },
+                { "libs": "-lpng", "condition": "!config.msvc && features.shared" },
                 { "libs": "-s USE_LIBPNG=1", "condition": "config.wasm" }
             ],
             "use": [
-- 
2.44.0

