summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2013-07-26 07:49:36 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-07-31 06:59:56 +0100
commitb099c7b36e6a61559a6af1b6e6853fecf0e79606 (patch)
tree1964d945cd12c6b09064ef87bf48c387a6566cfb /meta
parentfe378e1d462d2c44b0e73c0d5b8647c3d90d300d (diff)
downloadpoky-b099c7b36e6a61559a6af1b6e6853fecf0e79606.tar.gz
pseudo: Always try to build 32-bit libpseudo when NO32LIBS is set to 0
This is for Yocto bug #4920. The NO32LIBS variable is intended to allow the user to force the creation of a 32-bit libpseudo, for use with things like prebuilt binary toolchains. Unfortunately, the tests for likely compilability (stubs-32.h) were still present, so you would get silent failures. And if you did cause it to try to build, the failures were not particularly clearly explained. So, we: 1. Emit at least a message during configuration saying we're only building 64-bit, if we are. 2. Warn the user for at least one common case where we know builds are likely to fail. 3. If NO32LIBS is 0, we try the compile for sure, and if it fails, we've emitted at least some sort of message up near the top of the compile output that tells you what might be wrong. (From OE-Core rev: 22548b3243dfa2dc9861b0f15530632b37812a8c) Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/pseudo/pseudo.inc50
1 files changed, 41 insertions, 9 deletions
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
index 3baf3af72a..5451aa221d 100644
--- a/meta/recipes-devtools/pseudo/pseudo.inc
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -37,14 +37,44 @@ do_compile () {
37 oe_runmake ${MAKEOPTS} 37 oe_runmake ${MAKEOPTS}
38} 38}
39 39
40maybe_make32() {
41 # We probably don't need to build 32-bit binaries.
42 make32=false
43 if [ "${SITEINFO_BITS}" = "64" ]; then
44 case "${NO32LIBS}" in
45 0) make32=true
46 ;;
47 1) make32=false
48 ;;
49 *) # If unset, build 32-bit if we think we can.
50 if [ -e "/usr/include/gnu/stubs-32.h" ]; then
51 make32=true
52 fi
53 ;;
54 esac
55 fi
56 if $make32; then
57 if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then
58 echo >&2 "WARNING: Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
59 echo >&2 "If the build fails, install 32-bit developer packages."
60 echo >&2 "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
61 else
62 echo "Attempting to build 32-bit libpseudo.so for ${PN}."
63 fi
64 else
65 echo "Building/installing only 64-bit libpseudo.so for ${PN}."
66 echo "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."
67 fi
68}
69
40# Two below are the same 70# Two below are the same
41# If necessary compile for the alternative machine arch. This is only 71# If necessary compile for the alternative machine arch. This is only
42# necessary in a native build. 72# necessary in a native build.
43do_compile_prepend_class-native () { 73do_compile_prepend_class-native () {
44 if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then 74 maybe_make32
75 if $make32; then
45 # We need the 32-bit libpseudo on a 64-bit machine... 76 # We need the 32-bit libpseudo on a 64-bit machine...
46 # ... and we really, really, hope that the native host is 77 # Note that this is not well-tested outside of x86/x86_64.
47 # x86, or else --bits may not work.
48 78
49 # if we're being rebuilt due to a dependency change, we need to make sure 79 # if we're being rebuilt due to a dependency change, we need to make sure
50 # everything is clean before we configure and build -- if we haven't previously 80 # everything is clean before we configure and build -- if we haven't previously
@@ -59,10 +89,10 @@ do_compile_prepend_class-native () {
59} 89}
60 90
61do_compile_prepend_class-nativesdk () { 91do_compile_prepend_class-nativesdk () {
62 if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then 92 maybe_make32
63 # We need the 32-bit libpseudo on a 64-bit machine... 93 if $make32; then
64 # ... and we really, really, hope that the native host is 94 # We need the 32-bit libpseudo on a 64-bit machine.
65 # x86, or else --bits may not work. 95 # Note that this is not well-tested outside of x86/x86_64.
66 ./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 96 ./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
67 oe_runmake ${MAKEOPTS} libpseudo 97 oe_runmake ${MAKEOPTS} libpseudo
68 # prevent it from removing the lib, but remove everything else 98 # prevent it from removing the lib, but remove everything else
@@ -78,14 +108,16 @@ do_install () {
78# If necessary install for the alternative machine arch. This is only 108# If necessary install for the alternative machine arch. This is only
79# necessary in a native build. 109# necessary in a native build.
80do_install_append_class-native () { 110do_install_append_class-native () {
81 if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then 111 maybe_make32
112 if $make32; then
82 mkdir -p ${D}${prefix}/lib/pseudo/lib 113 mkdir -p ${D}${prefix}/lib/pseudo/lib
83 cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/. 114 cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
84 fi 115 fi
85} 116}
86 117
87do_install_append_class-nativesdk () { 118do_install_append_class-nativesdk () {
88 if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then 119 maybe_make32
120 if $make32; then
89 mkdir -p ${D}${prefix}/lib/pseudo/lib 121 mkdir -p ${D}${prefix}/lib/pseudo/lib
90 cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/. 122 cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
91 fi 123 fi