|
From: <sv...@va...> - 2005-10-12 11:27:39
|
Author: tom
Date: 2005-10-12 12:27:33 +0100 (Wed, 12 Oct 2005)
New Revision: 4909
Log:
Only add -Wdeclaration-after-statement if the compiler supports it.
Modified:
trunk/Makefile.core.am
trunk/Makefile.tool-flags.am
trunk/configure.in
Modified: trunk/Makefile.core.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.core.am 2005-10-12 10:51:01 UTC (rev 4908)
+++ trunk/Makefile.core.am 2005-10-12 11:27:33 UTC (rev 4909)
@@ -9,7 +9,7 @@
-DVGO_$(VG_OS)=3D1 \
-DVGP_$(VG_ARCH)_$(VG_OS)=3D1
=20
-BASE_AM_CFLAGS =3D @ARCH_CORE_AM_CFLAGS@ -Wmissing-prototypes -Wdeclarat=
ion-after-statement -Winline -Wall -Wshadow -O -g
+BASE_AM_CFLAGS =3D @ARCH_CORE_AM_CFLAGS@ -Wmissing-prototypes -Winline -=
Wall -Wshadow -O -g
=20
PIC_AM_CFLAGS =3D $(BASE_AM_CFLAGS) -fpic -fno-omit-frame-pointer
=20
Modified: trunk/Makefile.tool-flags.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.tool-flags.am 2005-10-12 10:51:01 UTC (rev 4908)
+++ trunk/Makefile.tool-flags.am 2005-10-12 11:27:33 UTC (rev 4909)
@@ -5,6 +5,6 @@
-DVGP_$(VG_ARCH)_$(VG_OS)=3D1
=20
AM_CPPFLAGS =3D $(add_includes)
-AM_CFLAGS =3D $(WERROR) -Wmissing-prototypes -Wdeclaration-after-stateme=
nt -Winline -Wall -Wshadow -O -g @ARCH_TOOL_AM_CFLAGS@
+AM_CFLAGS =3D $(WERROR) -Wmissing-prototypes -Winline -Wall -Wshadow -O =
-g @ARCH_TOOL_AM_CFLAGS@
AM_CCASFLAGS =3D $(add_includes)
=20
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/configure.in 2005-10-12 10:51:01 UTC (rev 4908)
+++ trunk/configure.in 2005-10-12 11:27:33 UTC (rev 4909)
@@ -418,6 +418,29 @@
fi
=20
=20
+# does this compiler support -Wdeclaration-after-statement ?
+AC_MSG_CHECKING([if gcc accepts -Wdeclaration-after-statement ])
+
+safe_CFLAGS=3D$CFLAGS
+CFLAGS=3D"-Wdeclaration-after-statement"
+
+AC_TRY_COMPILE(, [
+int main () { return 0 ; }
+],
+[
+no_pointer_sign=3Dyes
+AC_MSG_RESULT([yes])
+], [
+no_pointer_sign=3Dno
+AC_MSG_RESULT([no])
+])
+CFLAGS=3D$safe_CFLAGS
+
+if test x$no_pointer_sign =3D xyes; then
+ CFLAGS=3D"$CFLAGS -Wdeclaration-after-statement"
+fi
+
+
# Check for TLS support in the compiler and linker
AC_CACHE_CHECK([for TLS support], vg_cv_tls,
[AC_ARG_ENABLE(tls, [ --enable-tls platform supports=
TLS],
|