blob: efbc24f59b0c018ac4463dc4dc8943db48a6c202 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001inherit 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#
8oe_multilib_header() {
9
10 case ${HOST_OS} in
11 *-musl*)
12 return
13 ;;
14 *)
15 esac
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016 # For MIPS: "n32" is a special case, which needs to be
17 # distinct from both 64-bit and 32-bit.
18 case ${TARGET_ARCH} in
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019 mips*) case "${MIPSPKGSFX_ABI}" in
20 "-n32")
21 ident=n32
22 ;;
23 *)
24 ident=${SITEINFO_BITS}
25 ;;
26 esac
27 ;;
28 *) ident=${SITEINFO_BITS}
29 esac
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030 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.
Patrick Williams213cb262021-08-07 19:21:33 -050045oe_multilib_header:class-native () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046 return
47}
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048
49# Nor do we need multilib headers for nativesdk builds.
Patrick Williams213cb262021-08-07 19:21:33 -050050oe_multilib_header:class-nativesdk () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060051 return
52}