summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-02-17 13:21:04 -0500
committerMike Frysinger <vapier@gentoo.org>2016-02-17 13:42:26 -0500
commitc2d28f8122e1b55523aa94e657d05ee1be89fcfb (patch)
tree8d4061306c587b88d0aa67fa9cad1856c077937f
parentdev-libs/ustr: unify emake calls (diff)
downloadgentoo-c2d28f8122e1b55523aa94e657d05ee1be89fcfb.tar.gz
gentoo-c2d28f8122e1b55523aa94e657d05ee1be89fcfb.tar.bz2
gentoo-c2d28f8122e1b55523aa94e657d05ee1be89fcfb.zip
dev-libs/ustr: add a configure stage for cross-compiling
The build system likes to compile & run programs to figure out host features. This fails when cross-compiling and such, so add a func to do all with compile tests.
-rw-r--r--dev-libs/ustr/ustr-1.0.4-r7.ebuild20
1 files changed, 20 insertions, 0 deletions
diff --git a/dev-libs/ustr/ustr-1.0.4-r7.ebuild b/dev-libs/ustr/ustr-1.0.4-r7.ebuild
index eaf650bd1c20..0c7387c16ecc 100644
--- a/dev-libs/ustr/ustr-1.0.4-r7.ebuild
+++ b/dev-libs/ustr/ustr-1.0.4-r7.ebuild
@@ -41,6 +41,26 @@ _emake() {
"$@"
}
+multilib_src_configure() {
+ # The included configure tests require execution.
+
+ # We require vsnprintf everywhere as it's in POSIX.
+ printf '#!/bin/sh\necho 0\n' > autoconf_vsnprintf
+ chmod a+rx autoconf_vsnprintf
+
+ # Always use stdint.h as it's in POSIX.
+ sed -i '/have_stdint_h=0/s:=0:=1:' Makefile || die
+
+ # Figure out the size of size_t.
+ printf '#include <sys/types.h>\nint main() { char buf[sizeof(size_t) - 8]; }\n' > sizet_test.c
+ $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -c sizet_test.c 2>/dev/null
+ printf '#!/bin/sh\necho %s\n' $(( $? == 0 )) > autoconf_64b
+ chmod a+rx autoconf_64b
+
+ # Generate the config file now to avoid bad makefile deps.
+ _emake ustr-import
+}
+
multilib_src_compile() {
_emake all-shared
}