Update glib2 to 2.18.1
[openwrt/svn-archive/archive.git] / libs / glib2 / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=glib2
12 PKG_VERSION:=2.18.1
13 PKG_RELEASE:=3
14
15 PKG_SOURCE:=glib-$(PKG_VERSION).tar.bz2
16 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
17 PKG_SOURCE_URL:=@GNOME/glib/2.18
18 PKG_MD5SUM:=51a9a33f49a4896d4d95d8e980666b9e
19 PKG_FIXUP:=libtool
20
21 include $(INCLUDE_DIR)/package.mk
22
23 PKG_INSTALL=1
24
25 define Package/glib2
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+libiconv +libintl
29 TITLE:=glib 2.0
30 URL:=http://www.gtk.org/
31 endef
32
33 define Package/glib2/description
34 The GLib library of C routines
35 endef
36
37 TARGET_CFLAGS+= \
38 $(FPIC) \
39 -I$(STAGING_DIR)/usr/lib/libiconv/include \
40 -I$(STAGING_DIR)/usr/lib/libintl/include
41
42 TARGET_LDFLAGS+= \
43 -L$(STAGING_DIR)/usr/lib/libiconv/lib \
44 -L$(STAGING_DIR)/usr/lib/libintl/lib
45
46 define Build/Configure
47 mkdir -p $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)
48 ( cd $(PKG_BUILD_DIR); CONFIG_SITE= \
49 ./configure \
50 --target=$(GNU_HOST_NAME) \
51 --host=$(GNU_HOST_NAME) \
52 --build=$(GNU_HOST_NAME) \
53 --prefix=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME) \
54 --disable-shared \
55 --enable-static \
56 --enable-debug=no \
57 );
58 $(MAKE) -C $(PKG_BUILD_DIR) install clean
59
60 $(call Build/Configure/Default, \
61 --enable-shared \
62 --enable-static \
63 --enable-debug=no \
64 , \
65 glib_cv_stack_grows=no \
66 glib_cv_uscore=no \
67 ac_cv_path_GLIB_GENMARSHAL=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/glib-genmarshal \
68 ac_cv_func_mmap_fixed_mapped=yes \
69 );
70 endef
71
72 define Build/InstallDev
73 $(INSTALL_DIR) $(1)/usr/include
74 $(CP) \
75 $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
76 $(1)/usr/include/
77 $(CP) \
78 $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
79 $(1)/usr/include/
80
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) \
83 $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
84 $(1)/usr/lib/
85
86 $(INSTALL_DATA) \
87 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,la} \
88 $(1)/usr/lib/
89
90 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
91 $(INSTALL_DATA) \
92 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
93 $(1)/usr/lib/pkgconfig
94 $(SED) \
95 "s,=\(glib-genmarshal\|gobject-query\|glib-mkenums\),=$(STAGING_DIR_HOST)/bin/\1,g" \
96 $(1)/usr/lib/pkgconfig/glib-2.0.pc
97
98 $(INSTALL_DIR) $(2)/share/aclocal/
99 $(INSTALL_DATA) \
100 $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
101 $(2)/share/aclocal/
102
103 $(INSTALL_DIR) $(2)/bin
104 $(INSTALL_BIN) \
105 $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/* \
106 $(2)/bin
107 endef
108
109 define Package/glib2/install
110 $(INSTALL_DIR) $(1)/usr/lib
111 $(INSTALL_DATA) \
112 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
113 $(1)/usr/lib/
114 endef
115
116
117 $(eval $(call BuildPackage,glib2))