We're trying to develop an as-portable-as-possible Makefile...
Neither uname
nor uname -v
is definitive in one suite of cases...
which ld
is also unhelpful, as both linkers are present...
I imagine we could just parse output of gcc -v for '--with-ld=/usr/bin/ld', then test the features/version of that linker. But is the best way to do this?
What are 'Best Practices' here? Can gcc be queried more cleanly - from within a Makefile - for its linker options?
The first thing that comes to my mind (tested with GNU make and clearmake):