diff options
author | Peter Seebach <peter.seebach@windriver.com> | 2013-07-26 07:49:36 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-12 13:14:20 +0100 |
commit | 9faeea2cfcae4bf34b7e3374afd47e87ead160cc (patch) | |
tree | 7290122a79f9552ea5c4b5f073df360e53d2fbab /meta/recipes-devtools/pseudo | |
parent | ff4e1cd02137272f555649e08267681125d69ba1 (diff) | |
download | poky-9faeea2cfcae4bf34b7e3374afd47e87ead160cc.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 master rev: 22548b3243dfa2dc9861b0f15530632b37812a8c)
(From OE-Core rev: 72efa8bb7fb0dcc098eecc1be55136314270f22a)
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/recipes-devtools/pseudo')
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo.inc | 50 |
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 | ||
40 | maybe_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. |
43 | do_compile_prepend_class-native () { | 73 | do_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 | ||
61 | do_compile_prepend_class-nativesdk () { | 91 | do_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. |
80 | do_install_append_class-native () { | 110 | do_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 | ||
87 | do_install_append_class-nativesdk () { | 118 | do_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 |