Skip to contentSkip to conversation

meson: Update to 0.37.1

PATCH In review Peter Kjellerstedt 2 participants 7 messages Mar 11, 2017 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 meson: Update to 0.37.1

Also make it possible to actually build the native version by avoiding the runtime dependencies.

---
 meta-oe/recipes-devtools/meson/{meson_0.36.0.bb => meson_0.37.1.bb} | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
 rename meta-oe/recipes-devtools/meson/{meson_0.36.0.bb => meson_0.37.1.bb} (71%)
meta-oe/recipes-devtools/meson/meson_0.37.1.bb renamed from meta-oe/recipes-devtools/meson/meson_0.36.0.bb +2 -3
similarity index 71%
rename from meta-oe/recipes-devtools/meson/meson_0.36.0.bb
rename to meta-oe/recipes-devtools/meson/meson_0.37.1.bb
index 9349fcbbc..a83af77b3 100644
@@ -6,13 +6,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
 
 SRC_URI = "git://github.com/mesonbuild/meson.git"
 
-SRCREV = "4e3073f90a7b4f225ce7d89034d61cd978399eba"
-PV = "0.36.0"
+SRCREV = "3d4bfdcb22314ea7db45a5b075f8b2a9c1498aab"
 
 S = "${WORKDIR}/git"
 
 inherit setuptools3
 
-RDEPENDS_${PN} = "ninja python3-core python3-modules"
+RDEPENDS_${PN}_class-target = "ninja python3-core python3-modules"
 
 BBCLASSEXTEND = "native"
Signature · 1 line
2.12.0
#1 lore raw

PATCH 2/5 meson.bbclass: Add support for more standard installation directories

A couple of more standard installation directories are supported with meson 0.37.1, so make sure they are configured.

---
 meta-oe/classes/meson.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta-oe/classes/meson.bbclass +5 -1
index 4be4b1068..1362fd22b 100644
@@ -18,13 +18,17 @@ def noprefix(var, d):
 
 MESONOPTS = " --prefix ${prefix} \
               --bindir ${@noprefix('bindir', d)} \
+              --sbindir ${@noprefix('sbindir', d)} \
               --datadir ${@noprefix('datadir', d)} \
               --libdir ${@noprefix('libdir', d)} \
               --libexecdir ${@noprefix('libexecdir', d)} \
               --includedir ${@noprefix('includedir', d)} \
               --mandir ${@noprefix('mandir', d)} \
+              --infodir ${@noprefix('infodir', d)} \
               --localedir ${@noprefix('localedir', d)} \
-              --sysconfdir ${sysconfdir}"
+              --sysconfdir ${sysconfdir} \
+              --localstatedir ${localstatedir} \
+              --sharedstatedir ${sharedstatedir}"
 
 MESON_C_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 
Signature · 1 line
2.12.0
#2 lore raw

PATCH 3/5 meson.bbclass: Make changes to meson.build files trigger reconfiguration

In reply to Peter Kjellerstedt

When externalsrc.bbclass is used, any changes to meson.build files should trigger do_configure to be re-run.

---
 meta-oe/classes/meson.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/classes/meson.bbclass +2 -0
index 1362fd22b..8da06da7f 100644
@@ -72,6 +72,8 @@ endian = '${MESON_TARGET_ENDIAN}'
 EOF
 }
 
+CONFIGURE_FILES = "meson.build"
+
 meson_do_configure() {
     if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" --cross-file ${WORKDIR}/meson.cross ${EXTRA_OEMESON}; then
         cat ${B}/meson-logs/meson-log.txt
Signature · 1 line
2.12.0
#3 lore raw

PATCH 4/5 meson.bbclass: Support building for native

In reply to Peter Kjellerstedt
---
 meta-oe/classes/meson.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
meta-oe/classes/meson.bbclass +9 -4
index 8da06da7f..e3489dd12 100644
@@ -9,9 +9,11 @@ do_configure[cleandirs] = "${B}"
 # Where the meson.build build configuration is
 MESON_SOURCEPATH = "${S}"
 
-# These variables in the environment override the *native* tools not the cross,
-# so they need to be unexported.
-CC[unexport] = "1"
+# These variables in the environment override the *native* tools, not the cross.
+export CC = "${BUILD_CC}"
+export CXX = "${BUILD_CXX}"
+export LD = "${BUILD_LD}"
+export AR = "${BUILD_AR}"
 
 def noprefix(var, d):
     return d.getVar(var, True).replace(d.getVar('prefix', True) + '/', '', 1)
@@ -37,6 +39,9 @@ MESON_TARGET_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'big',
 
 EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
 
+MESON_CROSS_FILE = ""
+MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+
 def meson_array(var, d):
     return "', '".join(d.getVar(var, True).split()).join(("'", "'"))
 
@@ -75,7 +80,7 @@ EOF
 CONFIGURE_FILES = "meson.build"
 
 meson_do_configure() {
-    if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" --cross-file ${WORKDIR}/meson.cross ${EXTRA_OEMESON}; then
+    if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
         cat ${B}/meson-logs/meson-log.txt
         bbfatal_log meson failed
     fi
Signature · 1 line
2.12.0
#4 lore raw

PATCH 5/5 meson.bbclass: Use the correct C++ compiler when cross compiling

In reply to Peter Kjellerstedt
---
 meta-oe/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/classes/meson.bbclass +1 -1
index e3489dd12..e27ed3906 100644
@@ -52,7 +52,7 @@ do_write_config() {
     cat >${WORKDIR}/meson.cross <<EOF
 [binaries]
 c = '${HOST_PREFIX}gcc'
-cpp = '${HOST_PREFIX}gcc'
+cpp = '${HOST_PREFIX}g++'
 ar = '${HOST_PREFIX}ar'
 ld = '${HOST_PREFIX}ld'
 strip = '${HOST_PREFIX}strip'
Signature · 1 line
2.12.0
#5 lore raw

Re: [PATCH 5/5] meson.bbclass: Use the correct C++ compiler when cross compiling

Quoted 9 lines · Peter Kjellerstedt
---
 meta-oe/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/classes/meson.bbclass +0 -0
index e3489dd12..e27ed3906 100644

meta-oe/classes/meson.bbclass do_write_config() { · line 55

Quoted 5 lines
meta-oe/classes/meson.bbclass +1 -1
@@ -52,7 +52,7 @@ do_write_config() {
     cat >${WORKDIR}/meson.cross <<EOF
 [binaries]
 c = '${HOST_PREFIX}gcc'
-cpp = '${HOST_PREFIX}gcc'
+cpp = '${HOST_PREFIX}g++'

is cpp c preprocssor or c++ compiler ? generally cxx is used for c++ compiler

Quoted 4 lines
meta-oe/classes/meson.bbclass +0 -0
 ar = '${HOST_PREFIX}ar'
 ld = '${HOST_PREFIX}ld'
 strip = '${HOST_PREFIX}strip'
#6 lore raw

Re: [PATCH 5/5] meson.bbclass: Use the correct C++ compiler when cross compiling

Quoted 16 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Khem Raj
Sent: den 11 mars 2017 06:12
To: [email protected]
Subject: Re: [oe] [PATCH 5/5] meson.bbclass: Use the correct C++ compiler when cross compiling

meta-

Quoted 5 lines · Peter Kjellerstedt
---
 meta-oe/classes/meson.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta- renamed from meta-oe/classes/meson.bbclass +0 -0

oe/classes/meson.bbclass

Quoted 12 lines

meta-oe/classes/meson.bbclass do_write_config() { · line 55

Quoted 9 lines

index e3489dd12..e27ed3906 100644

meta-oe/classes/meson.bbclass +1 -1
@@ -52,7 +52,7 @@ do_write_config() {
     cat >${WORKDIR}/meson.cross <<EOF
 [binaries]
 c = '${HOST_PREFIX}gcc'
-cpp = '${HOST_PREFIX}gcc'
+cpp = '${HOST_PREFIX}g++'

is cpp c preprocssor or c++ compiler ? generally cxx is used for c++ compiler

I agree, it is confusing, but in Meson it is actually the C++ compiler.

Quoted 4 lines

meta-oe/classes/meson.bbclass do_write_config() { · line 58

Quoted 4 lines
meta-oe/classes/meson.bbclass +0 -0
 ar = '${HOST_PREFIX}ar'
 ld = '${HOST_PREFIX}ld'
 strip = '${HOST_PREFIX}strip'

//Peter