b8d0de87b25cadef36b478e433b45050b821c744
[packages.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.20.0
13 PKG_RELEASE:=1
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.20
18 PKG_MD5SUM:=05188e560dbd8bddd568e24ce10dd003
19
20 include $(INCLUDE_DIR)/package.mk
21
22 PKG_INSTALL=1
23
24 define Package/glib2
25   SECTION:=libs
26   CATEGORY:=Libraries
27   DEPENDS:=+libiconv +libintl
28   TITLE:=glib 2.0
29   URL:=http://www.gtk.org/
30 endef
31
32 define Package/glib2/description
33   The GLib library of C routines
34 endef
35
36 TARGET_CFLAGS+= \
37         $(FPIC) \
38         -I$(STAGING_DIR)/usr/lib/libiconv/include \
39         -I$(STAGING_DIR)/usr/lib/libintl/include
40
41 TARGET_LDFLAGS+= \
42         -L$(STAGING_DIR)/usr/lib/libiconv/lib \
43         -L$(STAGING_DIR)/usr/lib/libintl/lib
44
45 Hooks/InstallDev/Post += libtool_fixup_libdir
46
47 define Build/Configure
48         mkdir -p $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)
49         ( cd $(PKG_BUILD_DIR); CONFIG_SITE= \
50                 ./configure \
51                 --target=$(GNU_HOST_NAME) \
52                 --host=$(GNU_HOST_NAME) \
53                 --build=$(GNU_HOST_NAME) \
54                 --prefix=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME) \
55                 --disable-shared \
56                 --enable-static \
57                 --enable-debug=no \
58         );
59         $(MAKE) -C $(PKG_BUILD_DIR) install clean
60
61         $(call Build/Configure/Default, \
62                 --enable-shared \
63                 --enable-static \
64                 --enable-debug=no \
65                 , \
66                 glib_cv_stack_grows=no \
67                 glib_cv_uscore=no \
68                 ac_cv_path_GLIB_GENMARSHAL=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/glib-genmarshal \
69                 ac_cv_func_mmap_fixed_mapped=yes \
70         );
71 endef
72
73 define Build/InstallDev
74         $(INSTALL_DIR) $(1)/usr/include
75         $(CP) \
76                 $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
77                 $(1)/usr/include/
78         $(CP) \
79                 $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
80                 $(1)/usr/include/
81
82         $(INSTALL_DIR) $(1)/usr/lib
83         $(CP) \
84                 $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
85                 $(1)/usr/lib/
86
87         $(CP) \
88                 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
89                 $(1)/usr/lib/
90
91         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
92         $(INSTALL_DATA) \
93                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
94                 $(1)/usr/lib/pkgconfig
95
96         $(INSTALL_DIR) $(2)/share/aclocal/
97         $(INSTALL_DATA) \
98                 $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4  \
99                 $(2)/share/aclocal/
100
101         $(INSTALL_DIR) $(2)/bin
102         $(INSTALL_BIN) \
103                 $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/* \
104                 $(2)/bin
105 endef
106
107 define Package/glib2/install
108         $(INSTALL_DIR) $(1)/usr/lib
109         $(CP) \
110                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
111                 $(1)/usr/lib/
112 endef
113
114
115 $(eval $(call BuildPackage,glib2))