5737b063027d9feeba9a4e4c96d15cb5bac12796
[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.12.12
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=glib-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.gtk.org/pub/glib/2.12/
17 PKG_MD5SUM:=6c6a61e4b08fb4b110ca7953f71c8b5e
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
20
21 PKG_FIXUP = libtool
22
23 include $(INCLUDE_DIR)/package.mk
24
25
26 define Package/glib2
27 SECTION:=libs
28 CATEGORY:=Libraries
29 DEPENDS:=+libiconv +libintl
30 TITLE:=glib 2.0
31 URL:=http://www.gtk.org/
32 endef
33
34 define Package/glib2/description
35 The GLib library of C routines
36 endef
37
38
39 define Build/Configure
40 mkdir -p $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)
41 ( cd $(PKG_BUILD_DIR); CONFIG_SITE= \
42 ./configure \
43 --target=$(GNU_HOST_NAME) \
44 --host=$(GNU_HOST_NAME) \
45 --build=$(GNU_HOST_NAME) \
46 --prefix=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME) \
47 --disable-shared \
48 --enable-static \
49 --enable-debug=no \
50 );
51 $(MAKE) -C $(PKG_BUILD_DIR) install clean
52
53 $(call Build/Configure/Default, \
54 --enable-shared \
55 --enable-static \
56 --enable-debug=no \
57 , \
58 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libiconv/include" \
59 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libintl/include" \
60 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
61 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libintl/lib" \
62 glib_cv_stack_grows=no \
63 glib_cv_uscore=no \
64 ac_cv_path_GLIB_GENMARSHAL=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/glib-genmarshal \
65 );
66 endef
67
68 TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/lib
69 define Build/Compile
70 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
71 endef
72
73 define Build/InstallDev
74 mkdir -p $(1)/usr/include
75 $(CP) $(PKG_INSTALL_DIR)/usr/include/glib-2.0 $(1)/usr/include/
76 mkdir -p $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 $(1)/usr/lib/
78 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg{lib,module,object,thread}-2.0.{a,so*} $(1)/usr/lib/
79 mkdir -p $(1)/usr/lib/pkgconfig
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/g{lib,module,module-no-export,object,thread}-2.0.pc $(1)/usr/lib/pkgconfig
81 endef
82
83 define Package/glib2/install
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg*-2.0.so* $(1)/usr/lib/
86 endef
87
88
89 $(eval $(call BuildPackage,glib2))
90