If $LDFLAGS is set and cups is in $USE then ghostscript-afpl fails to build because if doesn't link agains libcups and libcupsimage and ld exists because of missing symbols. This error affects all ghostscript-afpl ebuilds in portage. WHY: This is because the sed expression in ghostscript-afpl-8.15.ebuild line 76 matches only 'LDFLAGS= $(XLDFLAGS)'. But when LDFLAGS is set the line looks for example like 'LDFLAGS=-Wl,-O1 $(XLDFLAGS)' and the sed expression doesn't match. Thus the binary will not link against the cups libs and ld will fail because of unknown symbols.
Created attachment 41978 [details, diff] ghostscript-afpl patch Here is a patch to fix the sed expression against ghostscript-afpl-8.15.ebuild. But the patch should also work for the other ghostscript-afpl versions. I tested this with ghostscript-afpl-8.15.
finally fixed, sorry for the delay