--- gtkglext-1.2.0-r1.ebuild.orig 2013-04-10 22:31:33.000000000 +0200 +++ gtkglext-1.2.0-r1.ebuild 2013-05-08 00:58:33.000000000 +0200 @@ -43,4 +43,16 @@ gdk/x11/Makefile.am gdk/x11/Makefile.in \ gtk/Makefile.am gtk/Makefile.in \ || die "sed failed" + + if [[ "$CFLAGS $CXXFLAGS $LDFLAGS" =~ flto ]]; then + einfo "LTO enabled compiler flags detected, patching configure.." + + #diff -ur configure <(sed -e \ + # '/symcode=..[A-Z]*/,/esac/ {/linux.)/,/;;/ {/symcode=/ {x;N;N;x;N;G}}}' \ + # configure) + + # fix libtool test program, decomment above to see changes + sed -e '/symcode=..[A-Z]*/,/esac/ {/linux.)/,/;;/ {/symcode=/ {x;N;N;x;N;G}}}' \ + -i configure || die "failed to sed -i configure" + fi }