summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/gtk+/gtk+3
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-01-09 16:48:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-10 23:49:41 +0000
commit5371d96686718b98e6f006c083b5d1177cb1196b (patch)
treed75a07f8a25543f9b94834948837c0c0f8f1cf24 /meta/recipes-gnome/gtk+/gtk+3
parent2a311dd992265fefe3022903714e86703e9fd595 (diff)
downloadpoky-5371d96686718b98e6f006c083b5d1177cb1196b.tar.gz
gtk+3: add 3.4.4
Mostly taken from meta-gnome, with some changes. Instead of depending on gtk+-native, depend on just gdk-pixbuf-native and build the tool required for the host directly. This saves building the entire GTK+ stack natively just for one tool. Append a version suffix and use update-alternatives on gtk-update-icon-cache as with GTK+ 2. (From OE-Core rev: 16c0556808029a0f6a3f91a726b14626e9489498) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-gnome/gtk+/gtk+3')
-rw-r--r--meta/recipes-gnome/gtk+/gtk+3/cross.patch284
1 files changed, 284 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gtk+/gtk+3/cross.patch b/meta/recipes-gnome/gtk+/gtk+3/cross.patch
new file mode 100644
index 0000000000..7b2a1583b6
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3/cross.patch
@@ -0,0 +1,284 @@
1Upstream-Status: Submitted [#691301]
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 2ce72e5d53e84a2eba8c3f2cb6af25ffffc46ea9 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@intel.com>
6Date: Mon, 7 Jan 2013 12:49:27 +0000
7Subject: [PATCH] build: support cross-compilation by natively building
8 gtk-update-icon-cache
9
10When cross-compiling, instead of depending on a natively built GTK+ (which means
11building Glib, ATK, Pango, gdk-pixbuf, libX11...) for gtk-update-icon-cache,
12find the host compiler and gdk-pixbuf, and build another gtk-update-icon-cache
13with that.
14
15This uses AX_PROG_CC_FOR_BUILD from autostars to find the host compiler, and
16assumes that you'd set PKG_CONFIG_FOR_BUILD to a host pkg-config binary.
17
18https://bugzilla.gnome.org/show_bug.cgi?id=691301
19---
20 configure.ac | 25 +++++++--
21 gtk/Makefile.am | 12 ++++-
22 gtk/native/Makefile.am | 12 +++++
23 m4/ax_prog_cc_for_build.m4 | 125 ++++++++++++++++++++++++++++++++++++++++++++
24 4 files changed, 168 insertions(+), 6 deletions(-)
25 create mode 100644 gtk/native/Makefile.am
26 create mode 100644 m4/ax_prog_cc_for_build.m4
27
28diff --git a/configure.ac b/configure.ac
29index 0069a9f..35b5f27 100644
30--- a/configure.ac
31+++ b/configure.ac
32@@ -29,6 +29,9 @@ AC_CONFIG_SRCDIR([gdk/gdktypes.h])
33 AC_CONFIG_MACRO_DIR([m4])
34 AC_CONFIG_AUX_DIR([build-aux])
35
36+AC_CANONICAL_HOST
37+AC_CANONICAL_TARGET
38+
39 # Define a string for the earliest version that this release has
40 # backwards binary compatibility with for all interfaces a module
41 # might. Unless we add module-only API with lower stability
42@@ -123,6 +126,7 @@ AC_SUBST([GAIL_LT_CURRENT_MINUS_AGE],[gail_lt_current_minus_age])
43
44 # Checks for programs.
45 AC_PROG_CC
46+AX_PROG_CC_FOR_BUILD
47 AC_PROG_CC_C_O
48 AC_PROG_CC_STDC
49 AC_PROG_MKDIR_P
50@@ -135,8 +139,6 @@ AC_SUBST(GETTEXT_PACKAGE)
51 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
52 [The prefix for our gettext translation domains.])
53
54-AC_CANONICAL_HOST
55-
56 MATH_LIB=-lm
57 AC_MSG_CHECKING([for native Win32])
58 LIB_EXE_MACHINE_FLAG=X86
59@@ -868,14 +870,28 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
60
61 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
62
63-if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
64+if test "x$enable_gtk2_dependency" = xyes; then
65 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
66 if test x$GTK_UPDATE_ICON_CACHE = xno; then
67 REBUILD_PNGS=#
68 fi
69+elif test "x$cross_compiling" = xyes; then
70+ # If no GTK+2 dependency and cross compiling, we need to find a host gdk-pixbuf.
71+ # pkg.m4 blocks all variable starting with PKG, so allow this one
72+ m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
73+ AC_MSG_CHECKING([for native gdk-pixbuf])
74+ if AC_RUN_LOG([$PKG_CONFIG_FOR_BUILD --exists --print-errors gdk-pixbuf-2.0]); then
75+ AC_MSG_RESULT([yes])
76+ else
77+ AC_MSG_ERROR([native gdk-pixbuf not found])
78+ fi
79+ NATIVE_GDKPIXBUF_CFLAGS=`$PKG_CONFIG_FOR_BUILD --cflags gdk-pixbuf-2.0`
80+ NATIVE_GDKPIXBUF_LIBS=`$PKG_CONFIG_FOR_BUILD --libs gdk-pixbuf-2.0`
81+ AC_SUBST(NATIVE_GDKPIXBUF_CFLAGS)
82+ AC_SUBST(NATIVE_GDKPIXBUF_LIBS)
83 fi
84
85-AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
86+AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$enable_gtk2_dependency" = xyes])
87
88 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
89
90@@ -1742,6 +1758,7 @@ gtk/makefile.msc
91 gtk/gtkversion.h
92 gtk/gtk-win32.rc
93 gtk/a11y/Makefile
94+gtk/native/Makefile
95 gtk/tests/Makefile
96 libgail-util/Makefile
97 modules/Makefile
98diff --git a/gtk/Makefile.am b/gtk/Makefile.am
99index e763ca8..6b1ec65 100644
100--- a/gtk/Makefile.am
101+++ b/gtk/Makefile.am
102@@ -16,7 +16,7 @@ else
103 GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
104 endif
105
106-SUBDIRS = a11y . tests
107+SUBDIRS = a11y native . tests
108
109 if HAVE_PAPI_CUPS
110 GTK_PRINT_BACKENDS=file,papi,cups
111@@ -1569,12 +1569,20 @@ stamp-icons: $(STOCK_ICONS)
112 if USE_EXTERNAL_ICON_CACHE
113 gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE)
114 else
115+if CROSS_COMPILING
116+gtk_update_icon_cache_program = ./native/native-update-icon-cache
117+else
118 gtk_update_icon_cache_program = ./gtk-update-icon-cache
119 endif
120+endif
121
122 gtkbuiltincache.h: @REBUILD@ stamp-icons
123 if !USE_EXTERNAL_ICON_CACHE
124- $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
125+if CROSS_COMPILING
126+ $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) -C native/
127+else
128+ $(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
129+endif
130 endif
131 $(AM_V_GEN) $(gtk_update_icon_cache_program) --quiet --force --ignore-theme-index \
132 --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
133diff --git a/gtk/native/Makefile.am b/gtk/native/Makefile.am
134new file mode 100644
135index 0000000..4f029f6
136--- /dev/null
137+++ b/gtk/native/Makefile.am
138@@ -0,0 +1,12 @@
139+CC = @CC_FOR_BUILD@
140+CFLAGS = @CFLAGS_FOR_BUILD@
141+CPP = @CPP_FOR_BUILD@
142+CPPFLAGS = @CPPFLAGS_FOR_BUILD@
143+LDFLAGS = @LDFLAGS_FOR_BUILD@
144+
145+if CROSS_COMPILING
146+noinst_PROGRAMS = native-update-icon-cache
147+native_update_icon_cache_CFLAGS = $(NATIVE_GDKPIXBUF_CFLAGS)
148+native_update_icon_cache_LDADD = $(NATIVE_GDKPIXBUF_LIBS)
149+native_update_icon_cache_SOURCES = $(srcdir)/../updateiconcache.c
150+endif
151diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4
152new file mode 100644
153index 0000000..96cd98a
154--- /dev/null
155+++ b/m4/ax_prog_cc_for_build.m4
156@@ -0,0 +1,125 @@
157+# ===========================================================================
158+# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
159+# ===========================================================================
160+#
161+# SYNOPSIS
162+#
163+# AX_PROG_CC_FOR_BUILD
164+#
165+# DESCRIPTION
166+#
167+# This macro searches for a C compiler that generates native executables,
168+# that is a C compiler that surely is not a cross-compiler. This can be
169+# useful if you have to generate source code at compile-time like for
170+# example GCC does.
171+#
172+# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
173+# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
174+# The value of these variables can be overridden by the user by specifying
175+# a compiler with an environment variable (like you do for standard CC).
176+#
177+# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
178+# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
179+# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
180+# substituted in the Makefile.
181+#
182+# LICENSE
183+#
184+# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
185+#
186+# Copying and distribution of this file, with or without modification, are
187+# permitted in any medium without royalty provided the copyright notice
188+# and this notice are preserved. This file is offered as-is, without any
189+# warranty.
190+
191+#serial 7
192+
193+AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
194+AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
195+AC_REQUIRE([AC_PROG_CC])dnl
196+AC_REQUIRE([AC_PROG_CPP])dnl
197+AC_REQUIRE([AC_EXEEXT])dnl
198+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
199+
200+dnl Use the standard macros, but make them use other variable names
201+dnl
202+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
203+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
204+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
205+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
206+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
207+pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
208+pushdef([ac_cv_objext], ac_cv_build_objext)dnl
209+pushdef([ac_exeext], ac_build_exeext)dnl
210+pushdef([ac_objext], ac_build_objext)dnl
211+pushdef([CC], CC_FOR_BUILD)dnl
212+pushdef([CPP], CPP_FOR_BUILD)dnl
213+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
214+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
215+pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
216+pushdef([host], build)dnl
217+pushdef([host_alias], build_alias)dnl
218+pushdef([host_cpu], build_cpu)dnl
219+pushdef([host_vendor], build_vendor)dnl
220+pushdef([host_os], build_os)dnl
221+pushdef([ac_cv_host], ac_cv_build)dnl
222+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
223+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
224+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
225+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
226+pushdef([ac_cpp], ac_build_cpp)dnl
227+pushdef([ac_compile], ac_build_compile)dnl
228+pushdef([ac_link], ac_build_link)dnl
229+
230+save_cross_compiling=$cross_compiling
231+save_ac_tool_prefix=$ac_tool_prefix
232+cross_compiling=no
233+ac_tool_prefix=
234+
235+AC_PROG_CC
236+AC_PROG_CPP
237+AC_EXEEXT
238+
239+ac_tool_prefix=$save_ac_tool_prefix
240+cross_compiling=$save_cross_compiling
241+
242+dnl Restore the old definitions
243+dnl
244+popdef([ac_link])dnl
245+popdef([ac_compile])dnl
246+popdef([ac_cpp])dnl
247+popdef([ac_cv_host_os])dnl
248+popdef([ac_cv_host_vendor])dnl
249+popdef([ac_cv_host_cpu])dnl
250+popdef([ac_cv_host_alias])dnl
251+popdef([ac_cv_host])dnl
252+popdef([host_os])dnl
253+popdef([host_vendor])dnl
254+popdef([host_cpu])dnl
255+popdef([host_alias])dnl
256+popdef([host])dnl
257+popdef([LDFLAGS])dnl
258+popdef([CPPFLAGS])dnl
259+popdef([CFLAGS])dnl
260+popdef([CPP])dnl
261+popdef([CC])dnl
262+popdef([ac_objext])dnl
263+popdef([ac_exeext])dnl
264+popdef([ac_cv_objext])dnl
265+popdef([ac_cv_exeext])dnl
266+popdef([ac_cv_prog_cc_g])dnl
267+popdef([ac_cv_prog_cc_cross])dnl
268+popdef([ac_cv_prog_cc_works])dnl
269+popdef([ac_cv_prog_gcc])dnl
270+popdef([ac_cv_prog_CPP])dnl
271+
272+dnl Finally, set Makefile variables
273+dnl
274+BUILD_EXEEXT=$ac_build_exeext
275+BUILD_OBJEXT=$ac_build_objext
276+AC_SUBST(BUILD_EXEEXT)dnl
277+AC_SUBST(BUILD_OBJEXT)dnl
278+AC_SUBST([CFLAGS_FOR_BUILD])dnl
279+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
280+AC_SUBST([LDFLAGS_FOR_BUILD])dnl
281+])
282--
2831.7.10.4
284