User: james
Date: 06/07/07 22:07:54
Modified: xemacs ChangeLog configure.ac configure
Log:
Add -Wdeclaration-after-statement support.
<m3irmuujmj.fsf_-_(a)jerrypc.cs.usu.edu>
Revision Changes Path
1.508 +6 -0 XEmacs/xemacs/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/ChangeLog,v
retrieving revision 1.507
retrieving revision 1.508
diff -u -p -r1.507 -r1.508
--- ChangeLog 2006/06/29 14:51:59 1.507
+++ ChangeLog 2006/07/07 20:07:44 1.508
@@ -1,3 +1,9 @@
+2006-06-20 Jerry James <james(a)xemacs.org>
+
+ * configure.ac: When gcc is used, capture the values of __GNUC__
+ and __GNUC_MINOR__. Use them to conditionally add warning flags
+ that are not supported by all versions of gcc.
+
2006-06-23 Stephen J. Turnbull <stephen(a)xemacs.org>
* configure.ac (Build Makefile.in's from Makefile.in.in's):
1.45 +12 -11 XEmacs/xemacs/configure.ac
Index: configure.ac
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.ac,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -p -r1.44 -r1.45
--- configure.ac 2006/06/29 14:52:00 1.44
+++ configure.ac 2006/07/07 20:07:45 1.45
@@ -1883,15 +1883,13 @@ CFLAGS="$xe_save_CFLAGS"
dnl Determine GCC version.
if test "$GCC" = "yes"; then
AC_RUN_IFELSE([AC_LANG_SOURCE([int main () {
-#if __GNUC__ >= 3
-return 11;
-#else
-return 0;
-#endif
-}])], [:],
-[case "$?" in
- 11) echo "You appear to be using GCC version 3 or above."; __GCC3=yes ;;
-esac])
+return __GNUC__;
+}])], [:], [__GCC="$?"])
+AC_RUN_IFELSE([AC_LANG_SOURCE([int main () {
+return __GNUC_MINOR__;
+}])], [:], [__GCC_MINOR="$?"])
+__GCC_VERSION=$__GCC"."$__GCC_MINOR
+echo "You appear to be using GCC version" $__GCC_VERSION
fi
dnl Support for using a different compiler for xemacs itself.
@@ -2311,7 +2309,7 @@ if test "$cflags_warning_specified" = "n
dnl Warnings about char subscripts are pretty pointless, though,
dnl and we use them in various places.
with_cflags_warning="$with_cflags_warning -Wsign-compare
-Wno-char-subscripts"
- test "$__GCC3" = "yes" &&
with_cflags_warning="$with_cflags_warning -Wpacked"
+ test "$__GCC" -ge 3 &&
with_cflags_warning="$with_cflags_warning -Wpacked"
dnl glibc is intentionally not `-Wpointer-arith'-clean.
dnl Ulrich Drepper has rejected patches to fix the glibc header files.
test "$have_glibc" != "yes" && \
@@ -2327,8 +2325,11 @@ if test "$cflags_warning_specified" = "n
dnl some very ugly code changes.
if test "$with_xemacs_compiler" = "g++"; then
xe_cflags_warning="$with_cflags_warning -Weffc++"
- elif test "$__GCC3" = "yes"; then
+ elif test "$__GCC" -ge 3; then
xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
+ if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
+ with_cflags_warning="$with_cflags_warning
-Wdeclaration-after-statement"
+ fi
fi
with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
with_cflags_warning="$with_cflags_warning -Wmissing-prototypes
-Wstrict-prototypes"
1.283 +54 -10 XEmacs/xemacs/configure
Index: configure
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure,v
retrieving revision 1.282
retrieving revision 1.283
diff -u -p -r1.282 -r1.283
--- configure 2006/06/06 00:18:29 1.282
+++ configure 2006/07/07 20:07:45 1.283
@@ -8324,11 +8324,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int main () {
-#if __GNUC__ >= 3
-return 11;
-#else
-return 0;
-#endif
+return __GNUC__;
}
_ACEOF
rm -f conftest$ac_exeext
@@ -8349,13 +8345,52 @@ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
-case "$?" in
- 11) echo "You appear to be using GCC version 3 or above."; __GCC3=yes ;;
-esac
+__GCC="$?"
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext
conftest.$ac_ext
fi
+if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int main () {
+return __GNUC_MINOR__;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+:
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+__GCC_MINOR="$?"
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext
conftest.$ac_ext
fi
+__GCC_VERSION=$__GCC"."$__GCC_MINOR
+echo "You appear to be using GCC version" $__GCC_VERSION
+fi
@@ -9209,13 +9244,16 @@ if test "$cflags_warning_specified" = "n
with_cflags_warning="-Wall -Wno-switch -Wundef"
with_cflags_warning="$with_cflags_warning -Wsign-compare
-Wno-char-subscripts"
- test "$__GCC3" = "yes" &&
with_cflags_warning="$with_cflags_warning -Wpacked"
+ test "$__GCC" -ge 3 &&
with_cflags_warning="$with_cflags_warning -Wpacked"
test "$have_glibc" != "yes" && \
with_cflags_warning="$with_cflags_warning -Wpointer-arith"
if test "$with_xemacs_compiler" =
"g++"; then
xe_cflags_warning="$with_cflags_warning -Weffc++"
- elif test "$__GCC3" = "yes"; then
+ elif test "$__GCC" -ge 3; then
xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
+ if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
+ with_cflags_warning="$with_cflags_warning
-Wdeclaration-after-statement"
+ fi
fi
with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
with_cflags_warning="$with_cflags_warning -Wmissing-prototypes
-Wstrict-prototypes"
@@ -39695,6 +39733,12 @@ test -n "$prefix" &&
test -n "$exec_prefix" &&
exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e
's,\([^/]\)/*$,\1,'`
+
+if test -r $srcdir/src/depend; then :;
+else
+ echo "creating $srcdir/src/depend"
+ perl $srcdir/src/make-src-depend > $srcdir/src/depend
+fi
for file in $internal_makefile_list; do
case $file in
Show replies by date