]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libzlib/libzlib.mk
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / libzlib / libzlib.mk
1 ################################################################################
2 #
3 # libzlib
4 #
5 ################################################################################
6
7 LIBZLIB_VERSION = 1.2.11
8 LIBZLIB_SOURCE = zlib-$(LIBZLIB_VERSION).tar.xz
9 LIBZLIB_SITE = http://www.zlib.net
10 LIBZLIB_LICENSE = Zlib
11 LIBZLIB_LICENSE_FILES = README
12 LIBZLIB_INSTALL_STAGING = YES
13 LIBZLIB_PROVIDES = zlib
14
15 # It is not possible to build only a shared version of zlib, so we build both
16 # shared and static, unless we only want the static libs, and we eventually
17 # selectively remove what we do not want
18 ifeq ($(BR2_STATIC_LIBS),y)
19 LIBZLIB_PIC =
20 LIBZLIB_SHARED = --static
21 else
22 LIBZLIB_PIC = -fPIC
23 LIBZLIB_SHARED = --shared
24 endif
25
26 define LIBZLIB_CONFIGURE_CMDS
27         (cd $(@D); rm -rf config.cache; \
28                 $(TARGET_CONFIGURE_ARGS) \
29                 $(TARGET_CONFIGURE_OPTS) \
30                 CFLAGS="$(TARGET_CFLAGS) $(LIBZLIB_PIC)" \
31                 ./configure \
32                 $(LIBZLIB_SHARED) \
33                 --prefix=/usr \
34         )
35 endef
36
37 define HOST_LIBZLIB_CONFIGURE_CMDS
38         (cd $(@D); rm -rf config.cache; \
39                 $(HOST_CONFIGURE_ARGS) \
40                 $(HOST_CONFIGURE_OPTS) \
41                 ./configure \
42                 --prefix="$(HOST_DIR)" \
43                 --sysconfdir="$(HOST_DIR)/etc" \
44         )
45 endef
46
47 define LIBZLIB_BUILD_CMDS
48         $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)
49 endef
50
51 define HOST_LIBZLIB_BUILD_CMDS
52         $(HOST_MAKE_ENV) $(MAKE1) -C $(@D)
53 endef
54
55 define LIBZLIB_INSTALL_STAGING_CMDS
56         $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) LDCONFIG=true install
57 endef
58
59 define LIBZLIB_INSTALL_TARGET_CMDS
60         $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) LDCONFIG=true install
61 endef
62
63 # We don't care removing the .a from target, since it not used at link
64 # time to build other packages, and it is anyway removed later before
65 # assembling the filesystem images anyway.
66 ifeq ($(BR2_SHARED_LIBS),y)
67 define LIBZLIB_RM_STATIC_STAGING
68         rm -f $(STAGING_DIR)/usr/lib/libz.a
69 endef
70 LIBZLIB_POST_INSTALL_STAGING_HOOKS += LIBZLIB_RM_STATIC_STAGING
71 endif
72
73 define HOST_LIBZLIB_INSTALL_CMDS
74         $(HOST_MAKE_ENV) $(MAKE1) -C $(@D) LDCONFIG=true install
75 endef
76
77 $(eval $(generic-package))
78 $(eval $(host-generic-package))