diff options
Diffstat (limited to 'meta/recipes-devtools')
-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 () { oe_runmake ${MAKEOPTS} } +maybe_make32() { + # We probably don't need to build 32-bit binaries. + make32=false + if [ "${SITEINFO_BITS}" = "64" ]; then + case "${NO32LIBS}" in + 0) make32=true + ;; + 1) make32=false + ;; + *) # If unset, build 32-bit if we think we can. + if [ -e "/usr/include/gnu/stubs-32.h" ]; then + make32=true + fi + ;; + esac + 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." + else + echo "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." + fi +} + # Two below are the same # If necessary compile for the alternative machine arch. This is only # necessary in a native build. do_compile_prepend_class-native () { - if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then + maybe_make32 + if $make32; then # We need the 32-bit libpseudo on a 64-bit machine... - # ... and we really, really, hope that the native host is - # x86, or else --bits may not work. + # Note that this is not well-tested outside of x86/x86_64. # if we're being rebuilt due to a dependency change, we need to make sure # everything is clean before we configure and build -- if we haven't previously @@ -59,10 +89,10 @@ do_compile_prepend_class-native () { } do_compile_prepend_class-nativesdk () { - if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then - # We need the 32-bit libpseudo on a 64-bit machine... - # ... and we really, really, hope that the native host is - # x86, or else --bits may not work. + maybe_make32 + if $make32; then + # We need the 32-bit libpseudo on a 64-bit machine. + # Note that this is not well-tested outside of x86/x86_64. ./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 oe_runmake ${MAKEOPTS} libpseudo # prevent it from removing the lib, but remove everything else @@ -78,14 +108,16 @@ do_install () { # If necessary install for the alternative machine arch. This is only # necessary in a native build. do_install_append_class-native () { - if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then + maybe_make32 + if $make32; then mkdir -p ${D}${prefix}/lib/pseudo/lib cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/. fi } do_install_append_class-nativesdk () { - if [ "${SITEINFO_BITS}" = "64" -a -e "/usr/include/gnu/stubs-32.h" -a "${PN}" = "pseudo-native" -a "${NO32LIBS}" != "1" ]; then + maybe_make32 + if $make32; then mkdir -p ${D}${prefix}/lib/pseudo/lib cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/. fi |