Move libreoffice workaround out of `clang.conf`
It seems that clang.conf is for those using clang system-wide.
Consider this situation, one uses gcc system-wide and only uses clang for some packages, e.g. libreoffice. If he enables clang USE of ltoize to get the workaround of libreoffice, some other workarounds he doesn't need will also be applied, which could cause problems, e.g. #773 .
Since libreoffice workaround in clang.conf checks if clang is used, moving it out of clang.conf will solve this problem with no side effects.
What do you think about this? @telans
I don't really have an interest in any of this anymore, sorry. Feel free to pull everything and re-do it, I guess. I appreciate you asking for my input
That is a good idea. Here's an updated line for libreoffice:
>=app-office/libreoffice-7.1.2.2 "( FlagSetUseNonGNU || has clang ${IUSE//+} && use clang ) && USE_NONGNU=1 && NOLDADD=1 && FlagSubAllFlags *flto*"
USE_NONGNU=1 needed to be added because $CC wasn't set the typical way.
I believe we could get rid of needing a separate clang.conf entirely if we test for which compiler is being used.
In ../bashrc.d/10-flag.sh, the function FlagSetUseNonGNU checks the build environment's CC and CXX.
FlagSetUseNonGNU() {
case $CC$CXX in
*clang*)
return 0;;
esac
return 1
}
Test if FlagSetUseNonGNU is true, or if the use flag clang is enabled, then do whatever.
Example:
dev-lang/python "( FlagSetUseNonGNU || has clang ${IUSE//+} && use clang ) && FlagSubAllFlags *flto*"
This would allow someone who compiles with GCC still use -flto and disables it for clang.