RFC: Example autoconf code for enabling -Wl,--as-needed from upstream configure script
On Saturday 07 August 2010 17:45:02 Samuli Suominen wrote:
> Could use eyepair or two to doublecheck the example code in:
>  http://bugs.gentoo.org/attachment.cgi?id=241779
>  http://bugs.gentoo.org/show_bug.cgi?id=331527
You should use AC_TRY_LINK or something similar to check for toolchain
support. Hardcoding a given set of strings matching the version is generally
not a good way of writing a check; if you check something, check it for real.
Also if you pass -Wl,--as-needed to the compiler that's what you should check
rather than if the supposed linker supports --as-needed; I suppose AC_TRY_LINK
will do that.