improved detection of clang / gcc-4.2 requirements, fix #1671