dbus ChangeLog,1.1061,1.1062 configure.in,1.161,1.162

John Palmieri johnp at kemper.freedesktop.org
Tue Aug 8 08:37:02 PDT 2006


Update of /cvs/dbus/dbus
In directory kemper:/tmp/cvs-serv29686

Modified Files:
	ChangeLog configure.in 
Log Message:
* confifure.in: add a GCC flag check for -Wdeclaration-after-statement
  so we still compile on older gcc (patch from Frederic Peters
  <fpeters at 0d dot be>


Index: ChangeLog
===================================================================
RCS file: /cvs/dbus/dbus/ChangeLog,v
retrieving revision 1.1061
retrieving revision 1.1062
diff -u -d -r1.1061 -r1.1062
--- ChangeLog	4 Aug 2006 16:15:16 -0000	1.1061
+++ ChangeLog	8 Aug 2006 15:36:59 -0000	1.1062
@@ -1,3 +1,9 @@
+2006-08-08  John (J5) Palmieri  <johnp at redhat.com>
+
+	* confifure.in: add a GCC flag check for -Wdeclaration-after-statement
+	so we still compile on older gcc (patch from Frederic Peters 
+	<fpeters at 0d dot be>
+
 2006-08-04  Havoc Pennington  <hp at redhat.com>
 
 	* configure.in: add -Wdeclaration-after-statement

Index: configure.in
===================================================================
RCS file: /cvs/dbus/dbus/configure.in,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- configure.in	4 Aug 2006 16:15:16 -0000	1.161
+++ configure.in	8 Aug 2006 15:36:59 -0000	1.162
@@ -91,6 +91,20 @@
 
 #### gcc warning flags
 
+cc_supports_flag() {
+  AC_MSG_CHECKING(whether $CC supports "$@")
+  Cfile=/tmp/foo${$}
+  touch ${Cfile}.c
+  $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
+  rc=$?
+  rm -f ${Cfile}.c ${Cfile}.o
+  case $rc in
+    0) AC_MSG_RESULT(yes);;
+    *) AC_MSG_RESULT(no);;
+  esac
+  return $rc
+}
+
 if test "x$GCC" = "xyes"; then
   changequote(,)dnl
   case " $CFLAGS " in
@@ -140,7 +154,10 @@
 
   case " $CFLAGS " in
   *[\ \	]-Wdeclaration-after-statement[\ \	]*) ;;
-  *) CFLAGS="$CFLAGS -Wdeclaration-after-statement" ;;
+  *) if cc_supports_flag -Wdeclaration-after-statement; then
+        CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+     fi
+     ;;
   esac
 
   if test "x$enable_ansi" = "xyes"; then



More information about the dbus-commit mailing list