libglib2: build host version for build-time binaries
authorPeter Korsgaard <jacmet@sunsite.dk>
Mon, 16 Mar 2009 15:49:03 +0000 (15:49 -0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 16 Mar 2009 15:49:03 +0000 (15:49 -0000)
Build host version of glib in HOST_DIR and use the build-time binaries
from there instead of relying on what is installed on the host.

package/atk/atk.mk
package/cairo/cairo.mk
package/gtk2-engines/gtk2-engines.mk
package/java/jamvm/jamvm.mk
package/libglib2/libglib2-pkgconfig-cc.patch
package/libglib2/libglib2.mk
package/libgtk2/libgtk2.mk
package/metacity/metacity.mk
package/pango/pango.mk
package/webkit/webkit.mk

index 5bd1a0c50438db3e8325a795488892daa8d3758b..ac6f5059df0fc756b7ee3ca92dd9dbeca24bcda5 100644 (file)
@@ -38,8 +38,7 @@ ATK_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes \
                am_cv_func_working_getline=yes gl_cv_func_mkdir_trailing_slash_bug=no \
                gl_cv_func_mkstemp_limitations=no ac_cv_func_working_mktime=yes \
                jm_cv_func_working_re_compile_pattern=yes ac_use_included_regex=no \
-               gl_cv_c_restrict=no ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal \
-               ac_cv_prog_F77=no
+               gl_cv_c_restrict=no ac_cv_prog_F77=no
 
 ifneq ($(BR2_PACKAGE_XSERVER_none),y)
 ATK_CONF_OPT_X = --with-x \
@@ -54,8 +53,6 @@ ATK_CONF_OPT =  --enable-shared \
                --disable-glibtest --enable-explicit-deps=no \
                --disable-debug
 
-ATK_MAKE_OPT = GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal GLIB_MKENUMS=$(HOST_GLIB)/bin/glib-mkenums
-
 ATK_DEPENDENCIES = libglib2 pkgconfig
 
 $(eval $(call AUTOTARGETS,package,atk))
index 0814f9cb3f54ed89de0832cd85f03e0393c9d71a..668f915c66bd12e1cf79291c58e241f89954e801 100644 (file)
@@ -38,9 +38,7 @@ CAIRO_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
                am_getline_needs_run_time_check=no am_cv_func_working_getline=yes \
                gl_cv_func_mkdir_trailing_slash_bug=no gl_cv_func_mkstemp_limitations=no \
                ac_cv_func_working_mktime=yes jm_cv_func_working_re_compile_pattern=yes \
-               ac_use_included_regex=no gl_cv_c_restrict=no \
-               ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal
-
+               ac_use_included_regex=no gl_cv_c_restrict=no
 
 CAIRO_DEPENDENCIES = uclibc pkgconfig fontconfig pixman
 
index 30467a046782574e61194c71321ebab767620b49..6f5af419bbc3765dc5affce50dd797df99fb99db 100644 (file)
@@ -69,7 +69,6 @@ GTK2_ENGINES_BUILD_ENV= \
                jm_cv_func_working_re_compile_pattern=yes \
                ac_use_included_regex=no \
                gl_cv_c_restrict=no \
-               ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal \
                ac_cv_path_CUPS_CONFIG=no
 
 
index 3ea6e2147e4ec41b2b85bf17d335b382cfa0b85c..560be347030341541db3215a432d434c18470ac0 100644 (file)
@@ -39,7 +39,6 @@ JAMVM_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
                gl_cv_func_mkdir_trailing_slash_bug=no gl_cv_func_mkstemp_limitations=no \
                ac_cv_func_working_mktime=yes jm_cv_func_working_re_compile_pattern=yes \
                ac_use_included_regex=no gl_cv_c_restrict=no \
-               ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/glib-genmarshal \
                ac_cv_prog_F77=no ac_cv_prog_CXX=no ac_cv_path_CUPS_CONFIG=no
 
 JAMVM_CONF_OPT = \
index 36a2487b315841a90524a885c26509f9765b9b30..44e236fa3ab0df7b3d98789315841158c2904269 100644 (file)
@@ -1,15 +1,27 @@
---- a/glib-2.0.pc.in   2007-01-16 18:24:39.000000000 -0500
-+++ b/glib-2.0.pc.in   2008-02-09 09:25:28.000000000 -0500
-@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
+glib2: prefix glib binaries in pkgconfig file with BIN_DIR
+
+Make sure the host versions of the glib binaries are used.
+---
+ glib-2.0.pc.in |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+Index: glib-2.18.4/glib-2.0.pc.in
+===================================================================
+--- glib-2.18.4.orig/glib-2.0.pc.in
++++ glib-2.18.4/glib-2.0.pc.in
+@@ -1,11 +1,12 @@
++BIN_DIR=
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
  libdir=@libdir@
  includedir=@includedir@
  
 -glib_genmarshal=glib-genmarshal
 -gobject_query=gobject-query
 -glib_mkenums=glib-mkenums
-+glib_genmarshal=/usr/bin/glib-genmarshal
-+gobject_query=/usr/bin/gobject-query
-+glib_mkenums=/usr/bin/glib-mkenums
++glib_genmarshal=${BIN_DIR}glib-genmarshal
++gobject_query=$(BIN_DIR}gobject-query
++glib_mkenums=${BIN_DIR}glib-mkenums
  
  Name: GLib
  Description: C Utility Library
index 064347819938ae336c18b77ebd5912f9a627c5a3..a8654349dfa171d44e4abf99cb11d21ea6f206c8 100644 (file)
@@ -15,10 +15,6 @@ LIBGLIB2_INSTALL_STAGING = YES
 LIBGLIB2_INSTALL_TARGET = YES
 LIBGLIB2_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) LDFLAGS=-L$(STAGING_DIR)/usr/lib install
 
-# detect install prefix of host glib development stuff
-HOST_GLIB_BIN:=`dirname $(shell which glib-genmarshal || echo /usr/bin/glib-genmarshal)`
-HOST_GLIB:=$(shell dirname $(HOST_GLIB_BIN) || echo /usr)
-
 LIBGLIB2_CONF_ENV =    \
                ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
                glib_cv_uscore=no ac_cv_func_strtod=yes \
@@ -48,14 +44,14 @@ LIBGLIB2_CONF_ENV = \
                gl_cv_func_mkdir_trailing_slash_bug=no gl_cv_func_mkstemp_limitations=no \
                ac_cv_func_working_mktime=yes jm_cv_func_working_re_compile_pattern=yes \
                ac_use_included_regex=no gl_cv_c_restrict=no \
-               ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal ac_cv_prog_F77=no \
+               ac_cv_path_GLIB_GENMARSHAL=$(HOST_DIR)/usr/bin/glib-genmarshal ac_cv_prog_F77=no \
                ac_cv_func_posix_getgrgid_r=no \
                gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no)
 
 LIBGLIB2_CONF_OPT = --enable-shared \
                --enable-static
 
-LIBGLIB2_DEPENDENCIES = uclibc gettext libintl pkgconfig
+LIBGLIB2_DEPENDENCIES = uclibc gettext libintl pkgconfig host-libglib2
 
 ifneq ($(BR2_ENABLE_LOCALE),y)
 LIBGLIB2_DEPENDENCIES+=libiconv
@@ -68,9 +64,51 @@ endif
 
 $(eval $(call AUTOTARGETS,package,libglib2))
 
-# we NEED a host glib-genmarshal
-ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
-ifeq ($(wildcard $(HOST_GLIB)/bin/glib-genmarshal),)
-$(error Host glib-genmarshal not found. Please install glib development package on your host (something like libglib2.0-dev))
-endif
-endif
+$(LIBGLIB2_HOOK_POST_INSTALL): $(LIBGLIB2_TARGET_INSTALL_STAGING)
+       $(SED) 's~^BIN_DIR=.*~BIN_DIR=$(HOST_DIR)/usr/bin/~' \
+               $(STAGING_DIR)/usr/lib/pkgconfig/glib-2.0.pc
+       touch $@
+
+# libglib2 for the host
+LIBGLIB2_HOST_DIR:=$(BUILD_DIR)/libglib2-$(LIBGLIB2_VERSION)-host
+LIBGLIB2_HOST_BINARY:=$(HOST_DIR)/usr/bin/glib-genmarshal
+
+$(LIBGLIB2_HOST_DIR)/.unpacked: $(DL_DIR)/$(LIBGLIB2_SOURCE)
+       mkdir -p $(@D)
+       $(INFLATE$(suffix $(LIBGLIB2_SOURCE))) $< | \
+               $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
+       touch $@
+
+$(LIBGLIB2_HOST_DIR)/.configured: $(LIBGLIB2_HOST_DIR)/.unpacked
+       (cd $(@D); rm -rf config.cache; \
+               $(HOST_CONFIGURE_OPTS) \
+               CFLAGS="$(HOST_CFLAGS)" \
+               LDFLAGS="$(HOST_LDFLAGS)" \
+               $(@D)/configure \
+               --prefix=$(HOST_DIR)/usr \
+               --sysconfdir=$(HOST_DIR)/etc \
+               --enable-shared \
+               --disable-static \
+               --disable-gtk-doc \
+               --enable-debug=no \
+       )
+       touch $@
+
+$(LIBGLIB2_HOST_DIR)/.compiled: $(LIBGLIB2_HOST_DIR)/.configured
+       $(MAKE) -C $(@D)
+       touch $@
+
+$(LIBGLIB2_HOST_BINARY): $(LIBGLIB2_HOST_DIR)/.compiled
+       $(MAKE) -C $(<D) install
+
+host-libglib2: $(LIBGLIB2_HOST_BINARY)
+
+host-libglib2-source: libglib2-source
+
+host-libglib2-clean:
+       rm -f $(addprefix $(LIBGLIB2_HOST_DIR)/,.unpacked .configured .compiled)
+       $(MAKE) -C $(LIBGLIB2_HOST_DIR) uninstall
+       $(MAKE) -C $(LIBGLIB2_HOST_DIR) clean
+
+host-libglib2-dirclean:
+       rm -rf $(LIBGLIB2_HOST_DIR)
index 4fca669781f1afacf385e1255f62987464d6b6bb..adac5a3adc8eca295ab8ab0de517367dd3145968 100644 (file)
@@ -68,9 +68,8 @@ LIBGTK2_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
                ac_cv_func_working_mktime=yes \
                jm_cv_func_working_re_compile_pattern=yes \
                ac_use_included_regex=no gl_cv_c_restrict=no \
-               ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal \
-               ac_cv_path_GTK_UPDATE_ICON_CACHE=$(HOST_GLIB)/bin/gtk-update-icon-cache \
-               ac_cv_path_GDK_PIXBUF_CSOURCE=$(HOST_GLIB)/bin/gdk-pixbuf-csource \
+               ac_cv_path_GTK_UPDATE_ICON_CACHE=/usr/bin/gtk-update-icon-cache \
+               ac_cv_path_GDK_PIXBUF_CSOURCE=/usr/bin/gdk-pixbuf-csource \
                ac_cv_prog_F77=no \
                ac_cv_path_CUPS_CONFIG=no
 
@@ -129,8 +128,6 @@ else
 LIBGTK2_CONF_OPT += --disable-cups
 endif
 
-LIBGTK2_MAKE_OPT = GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal GLIB_MKENUMS=$(HOST_GLIB)/bin/glib-mkenums
-
 $(eval $(call AUTOTARGETS,package,libgtk2))
 
 $(LIBGTK2_HOOK_POST_INSTALL):
index 53138d070c3eb3be49fc3febae8534b2ba9e0e28..357ef73a3289db45babb15e9e7178ef6f297851c 100644 (file)
@@ -95,7 +95,6 @@ $(METACITY_DIR)/.configured: $(METACITY_DIR)/.unpacked
                jm_cv_func_working_re_compile_pattern=yes \
                ac_use_included_regex=no \
                gl_cv_c_restrict=no \
-               ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal \
                --target=$(GNU_TARGET_NAME) \
                --host=$(GNU_TARGET_NAME) \
                --build=$(GNU_HOST_NAME) \
index 9c7862e964d6d9b49e50a83fec72f80443859966..d93922e6518772800b9f92de7638f8fa90358601 100644 (file)
@@ -38,7 +38,7 @@ PANGO_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
                gl_cv_func_mkdir_trailing_slash_bug=no gl_cv_func_mkstemp_limitations=no \
                ac_cv_func_working_mktime=yes jm_cv_func_working_re_compile_pattern=yes \
                ac_use_included_regex=no gl_cv_c_restrict=no \
-               ac_cv_path_GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal ac_cv_path_FREETYPE_CONFIG=$(STAGING_DIR)/usr/bin/freetype-config
+               ac_cv_path_FREETYPE_CONFIG=$(STAGING_DIR)/usr/bin/freetype-config
 
 ifneq ($(BR2_PACKAGE_XSERVER_none),y)
         PANGO_CONF_OPT_X = --with-x \
index 5d58eae06245013557935388338d3cc44e92b223..b070c1d14ed8a8fd93c3c6447398c4f9f0f0856e 100644 (file)
@@ -13,7 +13,5 @@ WEBKIT_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) install
 
 WEBKIT_AUTORECONF = YES
 WEBKIT_DEPENDENCIES = icu curl libxml2 libxslt libgtk2 sqlite
-WEBKIT_MAKE_OPT = GLIB_GENMARSHAL=$(HOST_GLIB)/bin/glib-genmarshal GLIB_MKENUMS=$(HOST_GLIB)/bin/glib-mkenums
 
 $(eval $(call AUTOTARGETS,package,webkit))
-