[PATCH] Use correct CWARNFLAGS when cross compiling

Jon TURNEY jon.turney at dronecode.org.uk
Mon Jun 8 06:17:06 PDT 2009


Rather than checking the version of some random gcc which happens to be in
the path to determine which warning flags are supported, we should check the
gcc we are going to use for the build

For example, when cross-compiling, if the host gcc is >= 3.4 but the
cross-compiler gcc is not, this will cause unsupported warning flags to be
used

This seems to work, but I don't know enough autofoolery to be sure this is
right...

---
 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 80216e2..bcf8c44 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -442,7 +442,7 @@ if  test "x$GCC" = xyes ; then
     CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
 -Wbad-function-cast"
-    case `gcc -dumpversion` in
+    case `$CC -dumpversion` in
     3.4.* | 4.*)
 	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
 	;;
-- 
1.6.0.6



More information about the xorg-devel mailing list