summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/multilib_header.bbclass29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/classes/multilib_header.bbclass b/meta/classes/multilib_header.bbclass
new file mode 100644
index 0000000000..867bce4134
--- /dev/null
+++ b/meta/classes/multilib_header.bbclass
@@ -0,0 +1,29 @@
1inherit siteinfo
2
3# If applicable on the architecture, this routine will rename the header and add
4# a unique identifier to the name for the ABI/bitsize that is being used. A wrapper will
5# be generated for the architecture that knows how to call all of the ABI variants for that
6# given architecture.
7#
8# TODO: mips64 n32 is not yet recognized in this code
9# when that is identified the name of the wrapped item should be "n32" and appropriately
10# determined int he if coding...
11#
12oe_multilib_header() {
13 # Do nothing on ARM, only one ABI is supported at once
14 if echo ${TARGET_ARCH} | grep -q arm; then
15 return
16 fi
17 for each_header in "$@" ; do
18 if [ ! -f "${D}/${includedir}/$each_header" ]; then
19 bberror "oe_multilib_header: Unable to find header $each_header."
20 continue
21 fi
22 stem=$(echo $each_header | sed 's#\.h$##')
23 ident=${SITEINFO_BITS}
24 # if mips64/n32 set ident to n32
25 mv ${D}/${includedir}/$each_header ${D}/${includedir}/${stem}-${ident}.h
26
27 sed -e "s#ENTER_HEADER_FILENAME_HERE#${stem}#g" ${COREBASE}/scripts/multilib_header_wrapper.h > ${D}/${includedir}/$each_header
28 done
29}