fix zlib build on machines where LDFLAGS gets set to something broken
[openwrt.git] / openwrt / package / zlib / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=zlib
6 PKG_VERSION:=1.2.2
7 PKG_RELEASE:=2
8 PKG_MD5SUM:=1b8aab042d40979e456194c468fd72c5
9
10 PKG_SOURCE_URL:=@SF/zlib
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
12 PKG_CAT:=bzcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 include $(TOPDIR)/package/rules.mk
18
19 $(eval $(call PKG_template,ZLIB,zlib,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20
21 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
22 (cd $(PKG_BUILD_DIR); \
23 $(TARGET_CONFIGURE_OPTS) \
24 LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \
25 ./configure \
26 --prefix=/usr \
27 --shared \
28 );
29 touch $@
30
31 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
32 $(MAKE) -C $(PKG_BUILD_DIR) \
33 $(TARGET_CONFIGURE_OPTS) \
34 CFLAGS="$(TARGET_CFLAGS) $(CFLAGS_LARGEFILE)" \
35 libz.a libz.so
36 mkdir -p $(PKG_INSTALL_DIR)
37 $(MAKE) -C $(PKG_BUILD_DIR) \
38 DESTDIR="$(PKG_INSTALL_DIR)" \
39 install
40 touch $@
41
42 $(IPKG_ZLIB):
43 install -m0755 -d $(IDIR_ZLIB)/usr/lib
44 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libz.so.* $(IDIR_ZLIB)/usr/lib/
45 $(RSTRIP) $(IDIR_ZLIB)
46 $(IPKG_BUILD) $(IDIR_ZLIB) $(PACKAGE_DIR)
47
48 $(STAGING_DIR)/usr/lib/libz.so: $(PKG_BUILD_DIR)/.built
49 mkdir -p $(STAGING_DIR)/usr/include
50 cp -fpR $(PKG_INSTALL_DIR)/usr/include/*.h $(STAGING_DIR)/usr/include
51 mkdir -p $(STAGING_DIR)/usr/lib
52 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR)/usr/lib
53 touch $(STAGING_DIR)/usr/lib/libz.so
54
55 install-dev: $(STAGING_DIR)/usr/lib/libz.so
56
57 uninstall-dev:
58 rm -rf $(STAGING_DIR)/usr/include/zconf.h
59 rm -rf $(STAGING_DIR)/usr/include/zlib.h
60 rm -rf $(STAGING_DIR)/usr/lib/libz.*
61
62 compile: install-dev
63 clean: uninstall-dev
This page took 0.04809 seconds and 5 git commands to generate.