1 |
commit: c2d28f8122e1b55523aa94e657d05ee1be89fcfb |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 17 18:21:04 2016 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 17 18:42:26 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2d28f81 |
7 |
|
8 |
dev-libs/ustr: add a configure stage for cross-compiling |
9 |
|
10 |
The build system likes to compile & run programs to figure out host |
11 |
features. This fails when cross-compiling and such, so add a func |
12 |
to do all with compile tests. |
13 |
|
14 |
dev-libs/ustr/ustr-1.0.4-r7.ebuild | 20 ++++++++++++++++++++ |
15 |
1 file changed, 20 insertions(+) |
16 |
|
17 |
diff --git a/dev-libs/ustr/ustr-1.0.4-r7.ebuild b/dev-libs/ustr/ustr-1.0.4-r7.ebuild |
18 |
index eaf650b..0c7387c 100644 |
19 |
--- a/dev-libs/ustr/ustr-1.0.4-r7.ebuild |
20 |
+++ b/dev-libs/ustr/ustr-1.0.4-r7.ebuild |
21 |
@@ -41,6 +41,26 @@ _emake() { |
22 |
"$@" |
23 |
} |
24 |
|
25 |
+multilib_src_configure() { |
26 |
+ # The included configure tests require execution. |
27 |
+ |
28 |
+ # We require vsnprintf everywhere as it's in POSIX. |
29 |
+ printf '#!/bin/sh\necho 0\n' > autoconf_vsnprintf |
30 |
+ chmod a+rx autoconf_vsnprintf |
31 |
+ |
32 |
+ # Always use stdint.h as it's in POSIX. |
33 |
+ sed -i '/have_stdint_h=0/s:=0:=1:' Makefile || die |
34 |
+ |
35 |
+ # Figure out the size of size_t. |
36 |
+ printf '#include <sys/types.h>\nint main() { char buf[sizeof(size_t) - 8]; }\n' > sizet_test.c |
37 |
+ $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -c sizet_test.c 2>/dev/null |
38 |
+ printf '#!/bin/sh\necho %s\n' $(( $? == 0 )) > autoconf_64b |
39 |
+ chmod a+rx autoconf_64b |
40 |
+ |
41 |
+ # Generate the config file now to avoid bad makefile deps. |
42 |
+ _emake ustr-import |
43 |
+} |
44 |
+ |
45 |
multilib_src_compile() { |
46 |
_emake all-shared |
47 |
} |