comparison configure.ac @ 3494:f5e111f9411d

[xemacs-hg @ 2006-07-07 20:07:44 by james] Add -Wdeclaration-after-statement support. <m3irmuujmj.fsf_-_@jerrypc.cs.usu.edu>
author james
date Fri, 07 Jul 2006 20:07:45 +0000
parents 71532ccbd8e3
children 3cb3c306cce9
comparison
equal deleted inserted replaced
3493:cb20b201d5e6 3494:f5e111f9411d
1881 CFLAGS="$xe_save_CFLAGS" 1881 CFLAGS="$xe_save_CFLAGS"
1882 1882
1883 dnl Determine GCC version. 1883 dnl Determine GCC version.
1884 if test "$GCC" = "yes"; then 1884 if test "$GCC" = "yes"; then
1885 AC_RUN_IFELSE([AC_LANG_SOURCE([int main () { 1885 AC_RUN_IFELSE([AC_LANG_SOURCE([int main () {
1886 #if __GNUC__ >= 3 1886 return __GNUC__;
1887 return 11; 1887 }])], [:], [__GCC="$?"])
1888 #else 1888 AC_RUN_IFELSE([AC_LANG_SOURCE([int main () {
1889 return 0; 1889 return __GNUC_MINOR__;
1890 #endif 1890 }])], [:], [__GCC_MINOR="$?"])
1891 }])], [:], 1891 __GCC_VERSION=$__GCC"."$__GCC_MINOR
1892 [case "$?" in 1892 echo "You appear to be using GCC version" $__GCC_VERSION
1893 11) echo "You appear to be using GCC version 3 or above."; __GCC3=yes ;;
1894 esac])
1895 fi 1893 fi
1896 1894
1897 dnl Support for using a different compiler for xemacs itself. 1895 dnl Support for using a different compiler for xemacs itself.
1898 dnl Useful for building XEmacs with a C++ compiler. 1896 dnl Useful for building XEmacs with a C++ compiler.
1899 dnl For example, `configure --compiler=gcc --xemacs-compiler=g++ 1897 dnl For example, `configure --compiler=gcc --xemacs-compiler=g++
2309 2307
2310 dnl Yuck, bad compares have been worth at least 3 crashes! 2308 dnl Yuck, bad compares have been worth at least 3 crashes!
2311 dnl Warnings about char subscripts are pretty pointless, though, 2309 dnl Warnings about char subscripts are pretty pointless, though,
2312 dnl and we use them in various places. 2310 dnl and we use them in various places.
2313 with_cflags_warning="$with_cflags_warning -Wsign-compare -Wno-char-subscripts" 2311 with_cflags_warning="$with_cflags_warning -Wsign-compare -Wno-char-subscripts"
2314 test "$__GCC3" = "yes" && with_cflags_warning="$with_cflags_warning -Wpacked" 2312 test "$__GCC" -ge 3 && with_cflags_warning="$with_cflags_warning -Wpacked"
2315 dnl glibc is intentionally not `-Wpointer-arith'-clean. 2313 dnl glibc is intentionally not `-Wpointer-arith'-clean.
2316 dnl Ulrich Drepper has rejected patches to fix the glibc header files. 2314 dnl Ulrich Drepper has rejected patches to fix the glibc header files.
2317 test "$have_glibc" != "yes" && \ 2315 test "$have_glibc" != "yes" && \
2318 with_cflags_warning="$with_cflags_warning -Wpointer-arith" 2316 with_cflags_warning="$with_cflags_warning -Wpointer-arith"
2319 dnl Warning flags that may differ for gcc and g++ (xemacs_compiler) 2317 dnl Warning flags that may differ for gcc and g++ (xemacs_compiler)
2325 dnl But gcc warns about -Weffc++ in C compiles. 2323 dnl But gcc warns about -Weffc++ in C compiles.
2326 dnl With g++, there is no effective way to use -Wunused-parameter without 2324 dnl With g++, there is no effective way to use -Wunused-parameter without
2327 dnl some very ugly code changes. 2325 dnl some very ugly code changes.
2328 if test "$with_xemacs_compiler" = "g++"; then 2326 if test "$with_xemacs_compiler" = "g++"; then
2329 xe_cflags_warning="$with_cflags_warning -Weffc++" 2327 xe_cflags_warning="$with_cflags_warning -Weffc++"
2330 elif test "$__GCC3" = "yes"; then 2328 elif test "$__GCC" -ge 3; then
2331 xe_cflags_warning="$with_cflags_warning -Wunused-parameter" 2329 xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
2330 if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
2331 with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement"
2332 fi
2332 fi 2333 fi
2333 with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations" 2334 with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
2334 with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes" 2335 with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes"
2335 dnl **** If more gcc/g++ flags are added, from here on must handle 2336 dnl **** If more gcc/g++ flags are added, from here on must handle
2336 dnl **** with_cflags_warning and xe_cflags_warning in parallel 2337 dnl **** with_cflags_warning and xe_cflags_warning in parallel