diff options
| author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
|---|---|---|
| committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
| commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
| tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/classes/multilib_header.bbclass | |
| download | poky-daisy-140929.tar.gz | |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
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 | } | ||
