The installed headers are supposed not to change between ABIs. If they
do, we need to do something special about them or everything is going to
end up real bad.
Therefore, do a checksum of headers installed in /usr/include after each ABI's
src_install() and die if they don't match.
---
gx86/eclass/autotools-multilib.eclass | 36 ++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/gx86/eclass/autotools-multilib.eclass
b/gx86/eclass/autotools-multilib.eclass
index 90f7bee..4cd5242 100644
--- a/gx86/eclass/autotools-multilib.eclass
+++ b/gx86/eclass/autotools-multilib.eclass
@@ -120,5 +120,39 @@ autotools-multilib_src_test() {
}
autotools-multilib_src_install() {
- autotools-multilib_foreach_abi autotools-utils_src_install
+ autotools-multilib_secure_install() {
+ autotools-utils_src_install
+
+ # Make sure all headers are the same for each ABI.
+ autotools-multilib_cksum() {
+ find "${ED}"usr/include -type f \
+ -exec cksum {} + | sort -k2
+ }
+
+ local cksum=$(autotools-multilib_cksum)
+ local cksum_file=${T}/.autotools-multilib_cksum
+
+ if [[ -f ${cksum_file} ]]; then
+ local cksum_prev=$(< "${cksum_file}")
+
+ if [[ ${cksum} != ${cksum_prev} ]]; then
+ echo "${cksum}" > "${cksum_file}.new"
+
+ eerror "Header files have changed between ABIs."
+
+ if type -p diff &>/dev/null; then
+ eerror "$(diff -du "${cksum_file}"
"${cksum_file}.new")"
+ else
+ eerror "Old checksums in: ${cksum_file}"
+ eerror "New checksums in:
${cksum_file}.new"
+ fi
+
+ die "Header checksum mismatch, aborting."
+ fi
+ else
+ echo "${cksum}" > "${cksum_file}"
+ fi
+ }
+
+ autotools-multilib_foreach_abi autotools-multilib_secure_install
}
--
1.8.1.1