diff options
Diffstat (limited to 'meta/classes/multilib_header.bbclass')
| -rw-r--r-- | meta/classes/multilib_header.bbclass | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/classes/multilib_header.bbclass b/meta/classes/multilib_header.bbclass new file mode 100644 index 0000000000..4d049a82e6 --- /dev/null +++ b/meta/classes/multilib_header.bbclass | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | inherit siteinfo | ||
| 2 | |||
| 3 | # If applicable on the architecture, this routine will rename the header and | ||
| 4 | # add a unique identifier to the name for the ABI/bitsize that is being used. | ||
| 5 | # A wrapper will be generated for the architecture that knows how to call | ||
| 6 | # all of the ABI variants for that given architecture. | ||
| 7 | # | ||
| 8 | oe_multilib_header() { | ||
| 9 | # We use | ||
| 10 | # For ARM: We don't support multilib builds. | ||
| 11 | # For MIPS: "n32" is a special case, which needs to be | ||
| 12 | # distinct from both 64-bit and 32-bit. | ||
| 13 | case ${TARGET_ARCH} in | ||
| 14 | arm*) return | ||
| 15 | ;; | ||
| 16 | mips*) case "${MIPSPKGSFX_ABI}" in | ||
| 17 | "-n32") | ||
| 18 | ident=n32 | ||
| 19 | ;; | ||
| 20 | *) | ||
| 21 | ident=${SITEINFO_BITS} | ||
| 22 | ;; | ||
| 23 | esac | ||
| 24 | ;; | ||
| 25 | *) ident=${SITEINFO_BITS} | ||
| 26 | esac | ||
| 27 | if echo ${TARGET_ARCH} | grep -q arm; then | ||
| 28 | return | ||
| 29 | fi | ||
| 30 | for each_header in "$@" ; do | ||
| 31 | if [ ! -f "${D}/${includedir}/$each_header" ]; then | ||
| 32 | bberror "oe_multilib_header: Unable to find header $each_header." | ||
| 33 | continue | ||
| 34 | fi | ||
| 35 | stem=$(echo $each_header | sed 's#\.h$##') | ||
| 36 | # if mips64/n32 set ident to n32 | ||
| 37 | mv ${D}/${includedir}/$each_header ${D}/${includedir}/${stem}-${ident}.h | ||
| 38 | |||
| 39 | sed -e "s#ENTER_HEADER_FILENAME_HERE#${stem}#g" ${COREBASE}/scripts/multilib_header_wrapper.h > ${D}/${includedir}/$each_header | ||
| 40 | done | ||
| 41 | } | ||
| 42 | |||
| 43 | # Dependencies on arch variables like MIPSPKGSFX_ABI can be problematic. | ||
| 44 | # We don't need multilib headers for native builds so brute force things. | ||
| 45 | oe_multilib_header_class-native () { | ||
| 46 | return | ||
| 47 | } | ||
