2 ## @brief find Zlib library given ZLIB_DIR, set ZLIB_LINK_FLAG to either STATIC_LINK_FLAG or DYNAMIC_LINK_FLAG
4 ## It check whether Zlib library is installed as static library. If so, link to static library; otherwise, link to shared library.
5 ## Use following command in the Makefile to view the results
7 ## $(info Zlib: ZLIB_LINK_FLAG = $(ZLIB_LINK_FLAG))
12 ## @param ZLIB_DIR given path to Zlib library
13 ## @param ZLIB_LINK_FLAG set linking flag to Zlib
19 # use libz.a to test whether Zlib has static library
20 ifeq ($(ZLIB_LINK_FLAG),)
21 ifeq ($(wildcard $(ZLIB_DIR)/lib/libz.a),)
22 ZLIB_LINK_FLAG = -Wl,-rpath,$(ZLIB_DIR)/lib $(DYNAMIC_LINK_FLAG)
24 ZLIB_LINK_FLAG = -L $(ZLIB_DIR)/lib $(STATIC_LINK_FLAG)
28 ifeq ($(ZLIB_INCLUDE_FLAG),)
29 ZLIB_INCLUDE_FLAG = -I $(ZLIB_DIR)/include