glib2: clean up makefile, use libtool fixup, fix libiconv usage, convert to host...
[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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=glib2
11 PKG_VERSION:=2.20.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=glib-$(PKG_VERSION).tar.bz2
15 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
16 PKG_SOURCE_URL:=@GNOME/glib/2.20
17 PKG_MD5SUM:=05188e560dbd8bddd568e24ce10dd003
18
19 PKG_FIXUP = libtool
20 PKG_BUILD_DEPENDS := glib2/host
21
22 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
23
24 include $(INCLUDE_DIR)/host-build.mk
25 include $(INCLUDE_DIR)/package.mk
26
27 PKG_INSTALL:=1
28
29 define Package/glib2
30 SECTION:=libs
31 CATEGORY:=Libraries
32 DEPENDS:=+libiconv +libintl
33 TITLE:=glib 2.0
34 URL:=http://www.gtk.org/
35 endef
36
37 define Package/glib2/description
38 The GLib library of C routines
39 endef
40
41 TARGET_CFLAGS+= \
42 $(FPIC) \
43 -I$(STAGING_DIR)/usr/lib/libiconv/include \
44 -I$(STAGING_DIR)/usr/lib/libintl/include
45
46 TARGET_LDFLAGS+= \
47 -L$(STAGING_DIR)/usr/lib/libiconv/lib \
48 -L$(STAGING_DIR)/usr/lib/libintl/lib
49
50 define Build/Configure
51 $(call Build/Configure/Default, \
52 --enable-shared \
53 --enable-static \
54 --enable-debug=no \
55 --with-libiconv=gnu \
56 , \
57 glib_cv_stack_grows=no \
58 glib_cv_uscore=no \
59 ac_cv_path_GLIB_GENMARSHAL=$(STAGING_DIR_HOST)/bin/glib-genmarshal \
60 ac_cv_func_mmap_fixed_mapped=yes \
61 );
62 endef
63
64 define Build/InstallDev
65 $(INSTALL_DIR) $(1)/usr/include
66 $(CP) \
67 $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
68 $(1)/usr/include/
69 $(CP) \
70 $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
71 $(1)/usr/include/
72
73 $(INSTALL_DIR) $(1)/usr/lib
74 $(CP) \
75 $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
76 $(1)/usr/lib/
77
78 $(CP) \
79 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
80 $(1)/usr/lib/
81
82 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
83 $(INSTALL_DATA) \
84 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
85 $(1)/usr/lib/pkgconfig
86
87 $(INSTALL_DIR) $(2)/share/aclocal/
88 $(INSTALL_DATA) \
89 $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
90 $(2)/share/aclocal/
91 endef
92
93 define Package/glib2/install
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(CP) \
96 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
97 $(1)/usr/lib/
98 endef
99
100 $(eval $(call HostBuild))
101 $(eval $(call BuildPackage,glib2))