Patchwork [1/1] gtk+3: set proper FLAGS for native

login
register
mail settings
Submitter Robert Yang
Date March 30, 2014, 10:30 a.m.
Message ID <f54eb96dbc54cf4fce2cfee8e865a1e6cc41c905.1396175372.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/69641/
State New
Headers show

Comments

Robert Yang - March 30, 2014, 10:30 a.m.
The target gtk+3 does a native build in its "native" directory, we need
set proper FLAGS for it, otherwise, there might be build failures.

[YOCTO #6070]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 .../gtk+/gtk+3/fix-flags-for-native.patch          |   40 ++++++++++++++++++++
 meta/recipes-gnome/gtk+/gtk+3_3.10.7.bb            |    4 +-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-gnome/gtk+/gtk+3/fix-flags-for-native.patch
Ross Burton - March 31, 2014, 2:07 p.m.
On 30 March 2014 11:30, Robert Yang <liezhi.yang@windriver.com> wrote:
>++CFLAGS = @CFLAGS_FOR_BUILD@
>++CPPFLAGS = @CPPFLAGS_FOR_BUILD@
>++LDFLAGS = @LDFLAGS_FOR_BUILD@

So the problem is that the environment is providing a CFLAGS variable
that automake is then using for native builds alongside
CFLAGS_FOR_BUILD.  Instead of replicating the variables, which this
will do, would it be better to unset CFLAGS/CPPFLAGS/LDFLAGS in this
makefile so the environment variables are not used? (as makefile
assignments override environment assignments).

Ross

Patch

diff --git a/meta/recipes-gnome/gtk+/gtk+3/fix-flags-for-native.patch b/meta/recipes-gnome/gtk+/gtk+3/fix-flags-for-native.patch
new file mode 100644
index 0000000..800f52c
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3/fix-flags-for-native.patch
@@ -0,0 +1,40 @@ 
+From 5e16904f94b5f5961f8f6e75716e6d7d228de119 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 28 Mar 2014 03:10:12 +0000
+Subject: [PATCH] gtk/native/Makefile.am: set proper FLAGS for native
+
+This Makefile.am has set:
+CC = @CC_FOR_BUILD@
+It shoudl also set:
+CFLAGS = @CFLAGS_FOR_BUILD@
+
+Otherwise there might be build failures when doing cross build, for example,
+several CFLAGS are special to arm or mips, and the native gcc can't recognize
+them.
+
+The similar to CPPFLAGS and LDFLAGS.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ gtk/native/Makefile.am | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/gtk/native/Makefile.am b/gtk/native/Makefile.am
+index 64899e9..a1c814a 100644
+--- a/gtk/native/Makefile.am
++++ b/gtk/native/Makefile.am
+@@ -3,6 +3,9 @@ AM_CFLAGS = @CFLAGS_FOR_BUILD@
+ CPP = @CPP_FOR_BUILD@
+ AM_CPPFLAGS = @CPPFLAGS_FOR_BUILD@
+ AM_LDFLAGS = @LDFLAGS_FOR_BUILD@
++CFLAGS = @CFLAGS_FOR_BUILD@
++CPPFLAGS = @CPPFLAGS_FOR_BUILD@
++LDFLAGS = @LDFLAGS_FOR_BUILD@
+ 
+ if CROSS_COMPILING
+ if !USE_EXTERNAL_ICON_CACHE
+-- 
+1.8.3.4
+
diff --git a/meta/recipes-gnome/gtk+/gtk+3_3.10.7.bb b/meta/recipes-gnome/gtk+/gtk+3_3.10.7.bb
index 9f8c6ab..d0174f6 100644
--- a/meta/recipes-gnome/gtk+/gtk+3_3.10.7.bb
+++ b/meta/recipes-gnome/gtk+/gtk+3_3.10.7.bb
@@ -4,7 +4,9 @@  MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
 
 SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
            file://hardcoded_libtool.patch \
-           file://fix-build-when-wayland-backend-enabled.patch"
+           file://fix-build-when-wayland-backend-enabled.patch \
+           file://fix-flags-for-native.patch \
+          "
 
 SRC_URI[md5sum] = "18a81944a8506231529a76bf2b68372b"
 SRC_URI[sha256sum] = "b7e9de15385031cff43897e7e59f6692eaabf500f36eef80e6b9d6486ad49427"