--- wxGTK-2.8.12.1.ebuild.orig 2013-05-08 02:40:40.000000000 +0200 +++ wxGTK-2.8.12.1.ebuild 2013-05-08 03:41:32.000000000 +0200 @@ -72,9 +72,29 @@ epatch "${FILESDIR}"/${PN}-2.8.7-mmedia.patch # Bug #174874 epatch "${FILESDIR}"/${PN}-2.8.10.1-odbc-defines.patch # Bug #310923 sed \ + -e '/^SEARCH_INCLUDE="/,/"/cSEARCH_INCLUDE="/usr/include"' \ -e "s:/usr:${EPREFIX}/usr:g" \ - -e '/SEARCH_INCLUDE="\\/,/"/cSEARCH_INCLUDE="'${EPREFIX}'/usr/include"' \ -i configure || die "sed on configure failed" + + if [[ "$CFLAGS $CXXFLAGS $LDFLAGS" =~ (-flto|-O4) ]]; then + epatch "${FILESDIR}"/${PN}-2.8.12.1-setconcurrency-backport.patch + + # wxGTK:2.8 does not like eauto{,re}conf, bakefile/m4 version mismatch + # so we do not patch *.in / *.ac for this build + ebegin "LTO enabled compiler flags detected, patching configure" + cp configure{,.before.sed} + sed -e '/^for ac_func in thr_/ s:thr:pthread:' \ + -e '/^char *(.f) *() *=/ s:():() __attribute__((used)):' \ + -i configure &>/dev/null + eend $? || die "sed on configure failed" + + # decomment to see changes to configure + #diff -ur configure{.before.sed,} + rm -f configure.before.sed + fi + + # epatch_user source with portage patches applied + epatch_user } src_configure() {