714614a7ef9edb56cbcf128e60061fe1e553b9fa
[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 include $(INCLUDE_DIR)/package.mk
22
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
37 define Build/Configure
38 endef
39
40 define Build/Compile
41 mkdir -p $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)
42 ( cd $(PKG_BUILD_DIR); ./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 $(call libtool_disable_rpath)
67 $(MAKE) -C $(PKG_BUILD_DIR) all
68 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
69 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
70 endef
71
72 define Build/InstallDev
73 mkdir -p $(1)/usr/include
74 $(CP) $(PKG_INSTALL_DIR)/usr/include/glib-2.0 $(1)/usr/include/
75 mkdir -p $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 $(1)/usr/lib/
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg{lib,module,object,thread}-2.0.{a,so*} $(1)/usr/lib/
78 mkdir -p $(1)/usr/lib/pkgconfig
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/g{lib,module,module-no-export,object,thread}-2.0.pc $(1)/usr/lib/pkgconfig
80 endef
81
82 define Build/UninstallDev
83 rm -rf $(STAGING_DIR)/usr/include/glib-2.0 \
84 $(STAGING_DIR)/usr/lib/glib-2.0 \
85 $(STAGING_DIR)/usr/lib/libg{lib,module,module-no-export,object,thread}-2.0.{a,so*} \
86 $(STAGING_DIR)/usr/lib/pkgconfig/g{lib,module,module-no-export,object,thread}-2.0.pc
87 endef
88
89
90 define Package/glib2/install
91 $(INSTALL_DIR) $(1)/usr/lib
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg*-2.0.so* $(1)/usr/lib/
93 endef
94
95
96 $(eval $(call BuildPackage,glib2))
97