130cddc1c5d7f8271ffb2e092bad5d081c900095
[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 include $(INCLUDE_DIR)/package.mk
20
21 PKG_INSTALL=1
22
23 define Package/glib2
24 SECTION:=libs
25 CATEGORY:=Libraries
26 DEPENDS:=+libiconv +libintl
27 TITLE:=glib 2.0
28 URL:=http://www.gtk.org/
29 endef
30
31 define Package/glib2/description
32 The GLib library of C routines
33 endef
34
35 TARGET_CFLAGS+= \
36 $(FPIC) \
37 -I$(STAGING_DIR)/usr/lib/libiconv/include \
38 -I$(STAGING_DIR)/usr/lib/libintl/include
39
40 TARGET_LDFLAGS+= \
41 -L$(STAGING_DIR)/usr/lib/libiconv/lib \
42 -L$(STAGING_DIR)/usr/lib/libintl/lib
43
44 Hooks/InstallDev/Post += libtool_fixup_libdir
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 $(CP) \
87 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,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
95 $(INSTALL_DIR) $(2)/share/aclocal/
96 $(INSTALL_DATA) \
97 $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
98 $(2)/share/aclocal/
99
100 $(INSTALL_DIR) $(2)/bin
101 $(INSTALL_BIN) \
102 $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/* \
103 $(2)/bin
104 endef
105
106 define Package/glib2/install
107 $(INSTALL_DIR) $(1)/usr/lib
108 $(CP) \
109 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
110 $(1)/usr/lib/
111 endef
112
113
114 $(eval $(call BuildPackage,glib2))