diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo/pseudo.inc')
| -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 |
