add libgd
[openwrt.git] / openwrt / package / libgd / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := gd
6 PKG_VERSION := 2.0.33
7 PKG_RELEASE := 1
8 PKG_MD5SUM := be0a6d326cd8567e736fbc75df0a5c45
9
10 PKG_SOURCE_SITE := http://www.boutell.com/gd/http
11 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
13 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
14 PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
15 PKG_CAT := zcat
16 PKG_IPK_DIR := $(PKG_BUILD_DIR)/ipkg
17
18 $(DL_DIR)/$(PKG_SOURCE_FILE):
19 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
20
21 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE_FILE)
22 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
23 $(PATCH) $(PKG_BUILD_DIR) ./patches
24 touch $(PKG_BUILD_DIR)/.unpacked
25
26 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
27 (cd $(PKG_BUILD_DIR) ; \
28 $(TARGET_CONFIGURE_OPTS) \
29 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
30 LIBPNG12_CONFIG="$(STAGING_DIR)/usr/bin/libpng12-config" \
31 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
32 sys_lib_dlsearch_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
33 sys_lib_search_path_spec="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" \
34 ./configure \
35 --target=$(GNU_TARGET_NAME) \
36 --host=$(GNU_TARGET_NAME) \
37 --build=$(GNU_HOST_NAME) \
38 --prefix="$(STAGING_DIR)/usr" \
39 --exec-prefix=/usr \
40 --bindir=/usr/bin \
41 --sbindir=/usr/sbin \
42 --libexecdir=/usr/lib \
43 --datadir=/usr/share \
44 --infodir=/usr/share/info \
45 --mandir=/usr/share/man \
46 --localstatedir=/var \
47 --sysconfdir=/etc \
48 --disable-rpath \
49 --without-x \
50 --with-png=$(STAGING_DIR)/usr \
51 $(DISABLE_NLS) \
52 )
53 touch $(PKG_BUILD_DIR)/.configured
54
55 $(PKG_BUILD_DIR)/.libs/libgd.so: $(PKG_BUILD_DIR)/.configured
56 $(MAKE) -C $(PKG_BUILD_DIR) \
57 CC=$(TARGET_CC) \
58 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib" \
59 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
60 libdir="$(STAGING_DIR)/usr/lib" \
61 all
62
63 $(STAGING_DIR)/usr/lib/libgd.so: $(PKG_BUILD_DIR)/.libs/libgd.so
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 DESTDIR="$(STAGING_DIR)" \
66 install
67 rm -f $(STAGING_DIR)/usr/lib/libgd*.la
68
69 $(PKG_IPK): $(PKG_BUILD_DIR)/.libs/libgd.so
70 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) libgd.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
71 mkdir -p $(PKG_IPK_DIR)/usr/lib
72 cp -a $(PKG_BUILD_DIR)/.libs/*.so* $(PKG_IPK_DIR)/usr/lib/
73 $(STRIP) $(PKG_IPK_DIR)/usr/lib/*
74 find $(PKG_IPK_DIR) -name CVS | xargs rm -rf
75 mkdir -p $(PACKAGE_DIR)
76 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
77
78 $(IPKG_STATE_DIR)/info/libgd.list: $(PKG_IPK)
79 $(IPKG) install $(PKG_IPK)
80
81 source: $(DL_DIR)/$(PKG_SOURCE)
82 prepare: $(PKG_BUILD_DIR)/.unpacked
83 compile: $(STAGING_DIR)/usr/lib/libgd.so $(PKG_IPK)
84 install: $(IPKG_STATE_DIR)/info/libgd.list
85
86 clean:
87 rm -rf $(PKG_BUILD_DIR)
88 rm -f $(STAGING_DIR)/usr/bin/libgd*
89 rm -f $(STAGING_DIR)/usr/lib/libgd*
90 rm -f $(PKG_IPK)
This page took 0.042633 seconds and 5 git commands to generate.