scummvm/scummvm — pull request #321 by fingolfin (2013-04-18 17:59:20+00:00)
Title: CONFIGURE: Do not pass LDFLAGS to compiler when -c is specified

This fixes compatibility issues with clang when using -enable-Werror:
clang generates a warning when being passed both "-c" and linker-only
flags like "-L" or "-l". Combined with -Werror, this causes a spurious
configure failure.

The patch is actually somewhat of a hack -- it only works correctly if "-c" is the *only* parameter passed to cc_check. This is enough to cover the most important (and currently only) affected caller, namely cc_check_define. It is also easy to read and understand. Of course one could try to implement a "full" solution which scans $@ for any entry matching -c, but that seemed like overkilled; and anyway, this simple change sufficiently scratched my itch :-).