assimp: fix bfin compile
[buildroot-gz.git] / package / zlib / zlib.mk
blobaec9daf6feaf9b7a01fd281c008ec41d26d9b2a9
1 ################################################################################
3 # zlib
5 ################################################################################
7 ZLIB_VERSION = 1.2.8
8 ZLIB_SOURCE = zlib-$(ZLIB_VERSION).tar.xz
9 ZLIB_SITE = http://downloads.sourceforge.net/project/libpng/zlib/$(ZLIB_VERSION)
10 ZLIB_LICENSE = zlib license
11 ZLIB_LICENSE_FILES = README
12 ZLIB_INSTALL_STAGING = YES
14 # It is not possible to build only a shared version of zlib, so we build both
15 # shared and static, unless we only want the static libs, and we eventually
16 # selectively remove what we do not want
17 ifeq ($(BR2_STATIC_LIBS),y)
18 ZLIB_PIC =
19 ZLIB_SHARED = --static
20 else
21 ZLIB_PIC = -fPIC
22 ZLIB_SHARED = --shared
23 endif
25 define ZLIB_CONFIGURE_CMDS
26 (cd $(@D); rm -rf config.cache; \
27 $(TARGET_CONFIGURE_ARGS) \
28 $(TARGET_CONFIGURE_OPTS) \
29 CFLAGS="$(TARGET_CFLAGS) $(ZLIB_PIC)" \
30 ./configure \
31 $(ZLIB_SHARED) \
32 --prefix=/usr \
34 endef
36 define HOST_ZLIB_CONFIGURE_CMDS
37 (cd $(@D); rm -rf config.cache; \
38 $(HOST_CONFIGURE_ARGS) \
39 $(HOST_CONFIGURE_OPTS) \
40 ./configure \
41 --prefix="$(HOST_DIR)/usr" \
42 --sysconfdir="$(HOST_DIR)/etc" \
44 endef
46 define ZLIB_BUILD_CMDS
47 $(MAKE1) -C $(@D)
48 endef
50 define HOST_ZLIB_BUILD_CMDS
51 $(MAKE1) -C $(@D)
52 endef
54 define ZLIB_INSTALL_STAGING_CMDS
55 $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) LDCONFIG=true install
56 endef
58 define ZLIB_INSTALL_TARGET_CMDS
59 $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) LDCONFIG=true install
60 endef
62 # We don't care removing the .a from target, since it not used at link
63 # time to build other packages, and it is anyway removed later before
64 # assembling the filesystem images anyway.
65 ifeq ($(BR2_SHARED_LIBS),y)
66 define ZLIB_RM_STATIC_STAGING
67 rm -f $(STAGING_DIR)/usr/lib/libz.a
68 endef
69 ZLIB_POST_INSTALL_STAGING_HOOKS += ZLIB_RM_STATIC_STAGING
70 endif
72 define HOST_ZLIB_INSTALL_CMDS
73 $(MAKE1) -C $(@D) LDCONFIG=true install
74 endef
76 $(eval $(generic-package))
77 $(eval $(host-generic-package))