[PATCH:macros] XORG_TESTSET_CFLAG: Try to both compile & link with the flags
Gaetan Nadon
memsize at videotron.ca
Thu Dec 1 14:18:06 PST 2011
On Thu, 2011-12-01 at 13:14 -0800, Alan Coopersmith wrote:
> Catches build problems caused by compilers that ignore unknown flags
> at compile time and pass them to the linker at link time, when the
> linker considers unknown flags to be fatal errors.
>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> xorg-macros.m4.in | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> index ed908e2..3fd5348 100644
> --- a/xorg-macros.m4.in
> +++ b/xorg-macros.m4.in
> @@ -1492,7 +1492,7 @@ m4_foreach([flag], m4_cdr($@), [
> CFLAGS="$CFLAGS ]flag["
>
> AC_MSG_CHECKING([if $CC supports ]flag[])
> - AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
> + AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
> [supported=yes], [supported=no])
> AC_MSG_RESULT([$supported])
> CFLAGS="$xorg_testset_save_CFLAGS"
On Linux the same "gcc" command is issued which is expected.
It wouldn't hurt the name some of compilers/linkers combination that are
inconsistent in the treatment of unknown flags.
Reviewed-by: Gaetan Nadon <memsize at videotron.ca>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111201/7c176fa3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111201/7c176fa3/attachment.pgp>
More information about the xorg-devel
mailing list