diff options
author | Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> | 2019-02-14 05:35:45 +0100 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2019-02-14 13:26:10 +0100 |
commit | 68b03f76599d145f0fe00ba9da0a45fb2c193fca (patch) | |
tree | ad76193fe66263a570c2856cb8a5943ae225e469 /media-libs/giflib | |
parent | dev-perl/TAP-Parser-SourceHandler-pgTAP: Bump to 3.340.0 (diff) | |
download | gentoo-68b03f76599d145f0fe00ba9da0a45fb2c193fca.tar.gz gentoo-68b03f76599d145f0fe00ba9da0a45fb2c193fca.tar.bz2 gentoo-68b03f76599d145f0fe00ba9da0a45fb2c193fca.zip |
media-libs/giflib: Use reallocarray() if available.
Closes: https://bugs.gentoo.org/677956
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'media-libs/giflib')
-rw-r--r-- | media-libs/giflib/giflib-5.1.6-r1.ebuild (renamed from media-libs/giflib/giflib-5.1.6.ebuild) | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media-libs/giflib/giflib-5.1.6.ebuild b/media-libs/giflib/giflib-5.1.6-r1.ebuild index decea553a76e..2569ad2ddb96 100644 --- a/media-libs/giflib/giflib-5.1.6.ebuild +++ b/media-libs/giflib/giflib-5.1.6-r1.ebuild @@ -26,6 +26,13 @@ src_prepare() { } multilib_src_compile() { + # Use reallocarray() from libc if available. + if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -D_GNU_SOURCE -o "${T}/reallocarray_test" -x c - <<< $'#include <stdlib.h>\nint main() {void *p = reallocarray(NULL, 0, 0);}' 2> /dev/null; then + local -x CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE -DHAVE_REALLOCARRAY" + sed -e "s/ openbsd-reallocarray\.c//" -i Makefile || die + rm openbsd-reallocarray.c || die + fi + emake \ CC="$(tc-getCC)" \ CFLAGS="${CFLAGS} -std=gnu99 -fPIC -Wno-format-truncation" \ |