fix glib2 compile
[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); 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 );
67 $(call libtool_disable_rpath)
68 $(MAKE) -C $(PKG_BUILD_DIR) all
69 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
70 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" 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 Build/UninstallDev
84 rm -rf $(STAGING_DIR)/usr/include/glib-2.0 \
85 $(STAGING_DIR)/usr/lib/glib-2.0 \
86 $(STAGING_DIR)/usr/lib/libg{lib,module,module-no-export,object,thread}-2.0.{a,so*} \
87 $(STAGING_DIR)/usr/lib/pkgconfig/g{lib,module,module-no-export,object,thread}-2.0.pc
88 endef
89
90
91 define Package/glib2/install
92 $(INSTALL_DIR) $(1)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg*-2.0.so* $(1)/usr/lib/
94 endef
95
96
97 $(eval $(call BuildPackage,glib2))
98