port glib to buildroot-ng
[openwrt/svn-archive/archive.git] / libs / glib / Makefile
1 #
2 # Copyright (C) 2006 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:=glib
12 PKG_VERSION:=1.2.10
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=ftp://ftp.gtk.org/pub/gtk/v1.2 \
18 http://ftp.gwdg.de/pub/misc/grafik/gimp/gtk/v1.2/ \
19 http://ftp.esat.net/mirrors/ftp.gimp.org/pub/gtk/v1.2/ \
20 http://www.mirrorservice.org/sites/ftp.gimp.org/pub/gtk/v1.2/
21 PKG_MD5SUM:=6fe30dad87c77b91b632def29dd69ef9
22 PKG_CAT:=zcat
23
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libglib1
29 SECTION:=libs
30 CATEGORY:=Libraries
31 DEPENDS:=+libpthread
32 TITLE:=The GLib library of C routines
33 DESCRIPTION:=The GLib library of C routines.\\\
34 GLib is a library containing many useful C routines for things such \\\
35 as trees, hashes, and lists.
36 URL:=http://www.gtk.org/
37 endef
38
39 define Build/Configure
40 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
41 glib_cv_sizeof_gmutex=24 \
42 ac_cv_sizeof_char=1 \
43 ac_cv_sizeof_short=2 \
44 ac_cv_sizeof_int=4 \
45 ac_cv_sizeof_long=4 \
46 ac_cv_sizeof_long_long=8 \
47 ac_cv_sizeof_void_p=4 \
48 glib_cv_prog_cc_ansi_proto="no" \
49 glib_cv_has__inline="yes" \
50 glib_cv_has__inline__="yes" \
51 glib_cv_hasinline="yes" \
52 glib_cv_sane_realloc="yes" \
53 glib_cv_va_copy="no" \
54 glib_cv___va_copy="yes" \
55 glib_cv_va_val_copy="yes" \
56 glib_cv_rtldglobal_broken="no" \
57 glib_cv_uscore="no" \
58 ac_cv_func_getpwuid_r="yes" \
59 glib_cv_func_pthread_mutex_trylock_posix="yes" \
60 glib_cv_func_pthread_cond_timedwait_posix="yes" \
61 glib_cv_sizeof_gmutex="24" \
62 glib_cv_byte_contents_gmutex="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" \
63 $(TARGET_CONFIGURE_OPTS) \
64 CFLAGS="$(TARGET_CFLAGS)" \
65 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
66 ./configure \
67 --target=$(GNU_TARGET_NAME) \
68 --host=$(GNU_TARGET_NAME) \
69 --build=$(GNU_HOST_NAME) \
70 --program-prefix="" \
71 --program-suffix="" \
72 --prefix=/usr \
73 --exec-prefix=/usr \
74 --bindir=/usr/bin \
75 --sbindir=/usr/sbin \
76 --libexecdir=/usr/lib \
77 --sysconfdir=/etc \
78 --datadir=/usr/share \
79 --localstatedir=/var \
80 --mandir=/usr/man \
81 --infodir=/usr/info \
82 $(DISABLE_NLS) \
83 $(DISABLE_LARGEFILE) \
84 --enable-shared=yes \
85 --enable-static=yes \
86 );
87 endef
88
89 define Build/Compile
90 rm -rf $(PKG_INSTALL_DIR)
91 mkdir -p $(PKG_INSTALL_DIR)
92 $(MAKE) -C $(PKG_BUILD_DIR) \
93 DESTDIR="$(PKG_INSTALL_DIR)" \
94 install
95 endef
96
97 define Package/libglib1/install
98 install -m0755 -d $(1)/usr/lib
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg{lib,module,thread}-1.2.so.* $(1)/usr/lib/
100 endef
101
102 define Build/InstallDev
103 mkdir -p $(STAGING_DIR)/usr/bin
104 $(CP) $(PKG_INSTALL_DIR)/usr/bin/glib-config $(STAGING_DIR)/usr/bin/
105 mkdir -p $(STAGING_DIR)/usr/include
106 $(CP) $(PKG_INSTALL_DIR)/usr/include/glib-1.2 $(STAGING_DIR)/usr/include/
107 $(CP) $(PKG_BUILD_DIR)/glibconfig-sysdefs.h $(STAGING_DIR)/usr/include/glib-1.2/
108 mkdir -p $(STAGING_DIR)/usr/lib
109 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg{lib,module,thread}.{a,so} $(STAGING_DIR)/usr/lib/
110 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libg{lib,module,thread}-*.so.* $(STAGING_DIR)/usr/lib/
111 $(CP) $(PKG_INSTALL_DIR)/usr/lib/glib $(STAGING_DIR)/usr/lib/
112 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
113 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/g{lib,module,thread}.pc $(STAGING_DIR)/usr/lib/pkgconfig/
114 endef
115
116 define Build/UninstallDev
117 rm -rf \
118 $(STAGING_DIR)/usr/bin/glib-config \
119 $(STAGING_DIR)/usr/include/glib-1.2 \
120 $(STAGING_DIR)/usr/lib/libg{lib,module,thread}.{a,so} \
121 $(STAGING_DIR)/usr/lib/libg{lib,module,thread}-*.so.* \
122 $(STAGING_DIR)/usr/lib/glib \
123 $(STAGING_DIR)/usr/lib/pkgconfig/g{lib,module,thread}.pc
124 endef
125
126 $(eval $(call BuildPackage,libglib1))