From 9213bd4562ec1636922d8b420bcd110f4c14e8ec Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 12 Sep 2015 01:20:26 -0400 Subject: [PATCH] sys-fs/xfsprogs: rework static flag handling #551810 The use of -static when linking causes bad rpaths when USE=-static-libs because only dynamic xfs libs are available. But we don't really want to link the programs against the static xfs libs when we have dynamic ones available. --- sys-fs/xfsprogs/xfsprogs-4.2.0.ebuild | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys-fs/xfsprogs/xfsprogs-4.2.0.ebuild b/sys-fs/xfsprogs/xfsprogs-4.2.0.ebuild index 35a490f370b9..45d31297c5c8 100644 --- a/sys-fs/xfsprogs/xfsprogs-4.2.0.ebuild +++ b/sys-fs/xfsprogs/xfsprogs-4.2.0.ebuild @@ -39,15 +39,14 @@ pkg_setup() { src_prepare() { epatch "${FILESDIR}"/${PN}-4.2.0-sharedlibs.patch + # LLDFLAGS is used for programs, so apply -all-static when USE=static is enabled. + # Clear out -static from all flags since we want to link against dynamic xfs libs. sed -i \ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \ + -e "1iLLDFLAGS += $(usex static '-all-static' '')" \ include/builddefs.in || die - sed -i \ - -e '1iLLDFLAGS = -static' \ - {estimate,fsr}/Makefile || die - sed -i \ - -e "/LLDFLAGS/s:-static-libtool-libs:$(use static && echo -all-static):" \ - $(find -name Makefile) || die + find -name Makefile -exec \ + sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} + # libdisk has broken blkid conditional checking sed -i \ -- 2.26.2