1 |
The installed headers are supposed not to change between ABIs. If they |
2 |
do, we need to do something special about them or everything is going to |
3 |
end up real bad. |
4 |
|
5 |
Therefore, do a checksum of headers installed in /usr/include after each ABI's |
6 |
src_install() and die if they don't match. |
7 |
--- |
8 |
gx86/eclass/autotools-multilib.eclass | 36 ++++++++++++++++++++++++++++++++++- |
9 |
1 file changed, 35 insertions(+), 1 deletion(-) |
10 |
|
11 |
diff --git a/gx86/eclass/autotools-multilib.eclass b/gx86/eclass/autotools-multilib.eclass |
12 |
index 90f7bee..4cd5242 100644 |
13 |
--- a/gx86/eclass/autotools-multilib.eclass |
14 |
+++ b/gx86/eclass/autotools-multilib.eclass |
15 |
@@ -120,5 +120,39 @@ autotools-multilib_src_test() { |
16 |
} |
17 |
|
18 |
autotools-multilib_src_install() { |
19 |
- autotools-multilib_foreach_abi autotools-utils_src_install |
20 |
+ autotools-multilib_secure_install() { |
21 |
+ autotools-utils_src_install |
22 |
+ |
23 |
+ # Make sure all headers are the same for each ABI. |
24 |
+ autotools-multilib_cksum() { |
25 |
+ find "${ED}"usr/include -type f \ |
26 |
+ -exec cksum {} + | sort -k2 |
27 |
+ } |
28 |
+ |
29 |
+ local cksum=$(autotools-multilib_cksum) |
30 |
+ local cksum_file=${T}/.autotools-multilib_cksum |
31 |
+ |
32 |
+ if [[ -f ${cksum_file} ]]; then |
33 |
+ local cksum_prev=$(< "${cksum_file}") |
34 |
+ |
35 |
+ if [[ ${cksum} != ${cksum_prev} ]]; then |
36 |
+ echo "${cksum}" > "${cksum_file}.new" |
37 |
+ |
38 |
+ eerror "Header files have changed between ABIs." |
39 |
+ |
40 |
+ if type -p diff &>/dev/null; then |
41 |
+ eerror "$(diff -du "${cksum_file}" "${cksum_file}.new")" |
42 |
+ else |
43 |
+ eerror "Old checksums in: ${cksum_file}" |
44 |
+ eerror "New checksums in: ${cksum_file}.new" |
45 |
+ fi |
46 |
+ |
47 |
+ die "Header checksum mismatch, aborting." |
48 |
+ fi |
49 |
+ else |
50 |
+ echo "${cksum}" > "${cksum_file}" |
51 |
+ fi |
52 |
+ } |
53 |
+ |
54 |
+ autotools-multilib_foreach_abi autotools-multilib_secure_install |
55 |
} |
56 |
-- |
57 |
1.8.1.1 |