Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FindZlib.mk
Go to the documentation of this file.
1 ## @file FindZlib.mk
2 ## @brief find Zlib library given ZLIB_DIR, set ZLIB_LINK_FLAG to either STATIC_LINK_FLAG or DYNAMIC_LINK_FLAG
3 ##
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
6 ##
7 ## $(info Zlib: ZLIB_LINK_FLAG = $(ZLIB_LINK_FLAG))
8 ##
9 ## @author Yibo Lin
10 ## @date Jan 2017
11 ##
12 ## @param ZLIB_DIR given path to Zlib library
13 ## @param ZLIB_LINK_FLAG set linking flag to Zlib
14 
15 ## @cond
16 
17 #ZLIB_LINK_FLAG =
18 
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)
23 else
24  ZLIB_LINK_FLAG = -L $(ZLIB_DIR)/lib $(STATIC_LINK_FLAG)
25 endif
26 endif
27 
28 ifeq ($(ZLIB_INCLUDE_FLAG),)
29  ZLIB_INCLUDE_FLAG = -I $(ZLIB_DIR)/include
30 endif
31 
32 ## @endcond