Skip to contentSkip to conversation

pseudo: use bbnote/bbwarn instead of echo

PATCH New Ross Burton 1 participant 2 messages Sep 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 pseudo: use bbnote/bbwarn instead of echo

In the future bbnote/bbwarn will be integrated into bitbake's logging, so use those functions instead of echo directly.

---
 meta/recipes-devtools/pseudo/pseudo.inc |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
meta/recipes-devtools/pseudo/pseudo.inc +6 -6
index a4b7aaf..a287629 100644
@@ -56,15 +56,15 @@ maybe_make32() {
 	fi
 	if $make32; then
 		if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then
-			echo >&2 "WARNING: Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
-			echo >&2 "If the build fails, install 32-bit developer packages."
-			echo >&2 "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
+			bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
+			bbwarn "If the build fails, install 32-bit developer packages."
+			bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
 		else
-			echo "Attempting to build 32-bit libpseudo.so for ${PN}."
+			bbnote "Attempting to build 32-bit libpseudo.so for ${PN}."
 		fi
 	else
-		echo "Building/installing only 64-bit libpseudo.so for ${PN}."
-		echo "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."
+		bbnote "Building/installing only 64-bit libpseudo.so for ${PN}."
+		bbnote "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."
 	fi
 }
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 pseudo: warn twice if the 32-bit toolchain appears broken

Putting a warning at the top of do_compile is useful but not everyone reads the file from beginning to end, so use a trap to put the message at the bottom too.

[ YOCTO #4919 ]

---
 meta/recipes-devtools/pseudo/pseudo.inc |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
meta/recipes-devtools/pseudo/pseudo.inc +10 -3
index a287629..0471cd6 100644
@@ -56,9 +56,7 @@ maybe_make32() {
 	fi
 	if $make32; then
 		if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then
-			bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
-			bbwarn "If the build fails, install 32-bit developer packages."
-			bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
+			warn_32bit_missing
 		else
 			bbnote "Attempting to build 32-bit libpseudo.so for ${PN}."
 		fi
@@ -68,6 +66,12 @@ maybe_make32() {
 	fi
 }
 
+warn_32bit_missing() {
+	bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
+	bbwarn "If the build fails, install 32-bit developer packages."
+	bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
+}
+
 # Two below are the same
 # If necessary compile for the alternative machine arch.  This is only 
 # necessary in a native build.
@@ -83,7 +87,10 @@ do_compile_prepend_class-native () {
 		make ${MAKEOPTS} distclean || :
 
 		./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+		save_traps=$(trap)
+		trap 'warn_32bit_missing' 0
 		oe_runmake ${MAKEOPTS} libpseudo
+		eval "$save_traps"
 		# prevent it from removing the lib, but remove everything else
 		make 'LIB=foo' ${MAKEOPTS} distclean 
 	fi
Signature · 1 line
1.7.10.4