4c7cd3d7cd8fcca8e2ab71341a2eb09b3cd19fd6
[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.16.5
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=glib-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@GNOME/glib/2.16
17 PKG_MD5SUM:=039f02d47d4071322a3f00abf031e5d9
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 TARGET_CFLAGS += $(FPIC)
39
40 define Build/Configure
41 mkdir -p $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)
42 ( cd $(PKG_BUILD_DIR); CONFIG_SITE= \
43 ./configure \
44 --target=$(GNU_HOST_NAME) \
45 --host=$(GNU_HOST_NAME) \
46 --build=$(GNU_HOST_NAME) \
47 --prefix=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME) \
48 --disable-shared \
49 --enable-static \
50 --enable-debug=no \
51 );
52 $(MAKE) -C $(PKG_BUILD_DIR) install clean
53
54 $(call Build/Configure/Default, \
55 --enable-shared \
56 --enable-static \
57 --enable-debug=no \
58 , \
59 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libiconv/include" \
60 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libintl/include" \
61 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
62 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libintl/lib" \
63 glib_cv_stack_grows=no \
64 glib_cv_uscore=no \
65 ac_cv_path_GLIB_GENMARSHAL=$(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/glib-genmarshal \
66 ac_cv_func_mmap_fixed_mapped=yes \
67 );
68 endef
69
70 TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/lib
71 define Build/Compile
72 $(MAKE) -C $(PKG_BUILD_DIR)
73 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
74 endef
75
76 define Build/InstallDev
77 $(INSTALL_DIR) $(1)/usr/include
78 $(CP) $(PKG_INSTALL_DIR)/usr/include/glib-2.0 $(1)/usr/include/
79 $(CP) $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 $(1)/usr/include/
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 $(1)/usr/lib/
82 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libg{io,lib,module,object,thread}-2.0.{a,so*,la} $(1)/usr/lib/
83 $(SED) "s, /usr/lib/, $(STAGING_DIR)/usr/lib/,g" $(1)/usr/lib/*.la
84
85 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
86 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/g{io,io-unix,lib,module,module-no-export,object,thread}-2.0.pc $(1)/usr/lib/pkgconfig
87 $(foreach prog,glib-genmarshal gobject-query glib-mkenums,$(SED) "s,=$(prog),=$(STAGING_DIR)/host/bin/$(prog),g" $(1)/usr/lib/pkgconfig/glib-2.0.pc)
88
89
90 $(INSTALL_DIR) $(1)/share/aclocal/
91 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 $(STAGING_DIR_HOST)/share/aclocal/
92
93 $(INSTALL_DIR) $(1)/host/bin
94 $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/$(GNU_HOST_NAME)/bin/* $(1)/host/bin
95 endef
96
97 define Package/glib2/install
98 $(INSTALL_DIR) $(1)/usr/lib
99 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libg*-2.0.so* $(1)/usr/lib/
100 endef
101
102
103 $(eval $(call BuildPackage,glib2))
104