diff options
| author | Dan Nicolaescu | 2009-11-20 06:05:10 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-11-20 06:05:10 +0000 |
| commit | 7a2efa6f088dee91feb2c095f81cf9c2030c2e97 (patch) | |
| tree | 1ab2d0dd5239c29fa3eea17b13187badeb850be0 /configure | |
| parent | 9717f1199f337920aeeb66417233c28d5f978f79 (diff) | |
| download | emacs-7a2efa6f088dee91feb2c095f81cf9c2030c2e97.tar.gz emacs-7a2efa6f088dee91feb2c095f81cf9c2030c2e97.zip | |
Use -Wdeclaration-after-statement if available.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 56 |
1 files changed, 56 insertions, 0 deletions
| @@ -4896,6 +4896,62 @@ CFLAGS="$SAVE_CFLAGS" | |||
| 4896 | unset has_option | 4896 | unset has_option |
| 4897 | unset SAVE_CFLAGS | 4897 | unset 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; } | ||
| 4902 | SAVE_CFLAGS="$CFLAGS" | ||
| 4903 | CFLAGS="$CFLAGS -Wdeclaration-after-statement" | ||
| 4904 | cat >conftest.$ac_ext <<_ACEOF | ||
| 4905 | /* confdefs.h. */ | ||
| 4906 | _ACEOF | ||
| 4907 | cat confdefs.h >>conftest.$ac_ext | ||
| 4908 | cat >>conftest.$ac_ext <<_ACEOF | ||
| 4909 | /* end confdefs.h. */ | ||
| 4910 | |||
| 4911 | int | ||
| 4912 | main () | ||
| 4913 | { | ||
| 4914 | |||
| 4915 | ; | ||
| 4916 | return 0; | ||
| 4917 | } | ||
| 4918 | _ACEOF | ||
| 4919 | rm -f conftest.$ac_objext | ||
| 4920 | if { (ac_try="$ac_compile" | ||
| 4921 | case "(($ac_try" in | ||
| 4922 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | ||
| 4923 | *) ac_try_echo=$ac_try;; | ||
| 4924 | esac | ||
| 4925 | eval 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 | ||
| 4938 | else | ||
| 4939 | $as_echo "$as_me: failed program was:" >&5 | ||
| 4940 | sed 's/^/| /' conftest.$ac_ext >&5 | ||
| 4941 | |||
| 4942 | has_option=no | ||
| 4943 | fi | ||
| 4944 | |||
| 4945 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||
| 4946 | if test $has_option = yes; then | ||
| 4947 | C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH" | ||
| 4948 | fi | ||
| 4949 | { $as_echo "$as_me:$LINENO: result: $has_option" >&5 | ||
| 4950 | $as_echo "$has_option" >&6; } | ||
| 4951 | CFLAGS="$SAVE_CFLAGS" | ||
| 4952 | unset has_option | ||
| 4953 | unset 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 |