Author: jow
Date: 2015-09-16 10:44:53 +0200 (Wed, 16 Sep 2015)
New Revision: 46976

Modified:
   trunk/include/prereq-build.mk
Log:
prereq-build: test for static zlib availability

Signed-off-by: Jo-Philipp Wich <[email protected]>

Modified: trunk/include/prereq-build.mk
===================================================================
--- trunk/include/prereq-build.mk       2015-09-16 08:43:58 UTC (rev 46975)
+++ trunk/include/prereq-build.mk       2015-09-16 08:44:53 UTC (rev 46976)
@@ -60,10 +60,16 @@
        echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
                gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
 
+ifeq ($(HOST_OS),Linux)
+  zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic
+else
+  zlib_link_flags := -lz
+endif
+
 $(eval $(call TestHostCommand,zlib, \
-       Please install zlib. (Missing libz.so or zlib.h), \
+       Please install a static zlib. (Missing libz.a or zlib.h), \
        echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' 
| \
-               gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - -lz))
+               gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - 
$(zlib_link_flags)))
 
 $(eval $(call TestHostCommand,libssl, \
        Please install the openssl library (with development headers), \
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to