aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2009-11-20 06:05:10 +0000
committerDan Nicolaescu2009-11-20 06:05:10 +0000
commit7a2efa6f088dee91feb2c095f81cf9c2030c2e97 (patch)
tree1ab2d0dd5239c29fa3eea17b13187badeb850be0
parent9717f1199f337920aeeb66417233c28d5f978f79 (diff)
downloademacs-7a2efa6f088dee91feb2c095f81cf9c2030c2e97.tar.gz
emacs-7a2efa6f088dee91feb2c095f81cf9c2030c2e97.zip
Use -Wdeclaration-after-statement if available.
-rw-r--r--ChangeLog4
-rwxr-xr-xconfigure56
-rw-r--r--configure.in13
3 files changed, 73 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b96dc43e9d..4e213edee13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12009-11-20 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * configure.in: Use -Wdeclaration-after-statement if available.
4
12009-11-17 Jan Djärv <jan.h.d@swipnet.se> 52009-11-17 Jan Djärv <jan.h.d@swipnet.se>
2 6
3 * configure.in: New option: --with(out)-gconf. 7 * configure.in: New option: --with(out)-gconf.
diff --git a/configure b/configure
index 3f1b2bcde69..c698db5e762 100755
--- a/configure
+++ b/configure
@@ -4896,6 +4896,62 @@ CFLAGS="$SAVE_CFLAGS"
4896unset has_option 4896unset has_option
4897unset SAVE_CFLAGS 4897unset SAVE_CFLAGS
4898 4898
4899### Use -Wdeclaration-after-statement if the compiler supports it
4900{ $as_echo "$as_me:$LINENO: checking whether gcc understands -Wdeclaration-after-statement" >&5
4901$as_echo_n "checking whether gcc understands -Wdeclaration-after-statement... " >&6; }
4902SAVE_CFLAGS="$CFLAGS"
4903CFLAGS="$CFLAGS -Wdeclaration-after-statement"
4904cat >conftest.$ac_ext <<_ACEOF
4905/* confdefs.h. */
4906_ACEOF
4907cat confdefs.h >>conftest.$ac_ext
4908cat >>conftest.$ac_ext <<_ACEOF
4909/* end confdefs.h. */
4910
4911int
4912main ()
4913{
4914
4915 ;
4916 return 0;
4917}
4918_ACEOF
4919rm -f conftest.$ac_objext
4920if { (ac_try="$ac_compile"
4921case "(($ac_try" in
4922 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4923 *) ac_try_echo=$ac_try;;
4924esac
4925eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4926$as_echo "$ac_try_echo") >&5
4927 (eval "$ac_compile") 2>conftest.er1
4928 ac_status=$?
4929 grep -v '^ *+' conftest.er1 >conftest.err
4930 rm -f conftest.er1
4931 cat conftest.err >&5
4932 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4933 (exit $ac_status); } && {
4934 test -z "$ac_c_werror_flag" ||
4935 test ! -s conftest.err
4936 } && test -s conftest.$ac_objext; then
4937 has_option=yes
4938else
4939 $as_echo "$as_me: failed program was:" >&5
4940sed 's/^/| /' conftest.$ac_ext >&5
4941
4942 has_option=no
4943fi
4944
4945rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4946if test $has_option = yes; then
4947 C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH"
4948fi
4949{ $as_echo "$as_me:$LINENO: result: $has_option" >&5
4950$as_echo "$has_option" >&6; }
4951CFLAGS="$SAVE_CFLAGS"
4952unset has_option
4953unset SAVE_CFLAGS
4954
4899#### Some other nice autoconf tests. 4955#### Some other nice autoconf tests.
4900 4956
4901{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 4957{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
diff --git a/configure.in b/configure.in
index d469cb13d44..a4abbe04d29 100644
--- a/configure.in
+++ b/configure.in
@@ -757,6 +757,19 @@ CFLAGS="$SAVE_CFLAGS"
757unset has_option 757unset has_option
758unset SAVE_CFLAGS 758unset SAVE_CFLAGS
759 759
760### Use -Wdeclaration-after-statement if the compiler supports it
761AC_MSG_CHECKING([whether gcc understands -Wdeclaration-after-statement])
762SAVE_CFLAGS="$CFLAGS"
763CFLAGS="$CFLAGS -Wdeclaration-after-statement"
764AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
765if test $has_option = yes; then
766 C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH"
767fi
768AC_MSG_RESULT($has_option)
769CFLAGS="$SAVE_CFLAGS"
770unset has_option
771unset SAVE_CFLAGS
772
760#### Some other nice autoconf tests. 773#### Some other nice autoconf tests.
761 774
762dnl checks for programs 775dnl checks for programs