From f891c6f7e46de152e107dcef64a514dd97a96200 Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 5 Oct 2002 23:20:15 +0000 Subject: [PATCH] 2002-10-06 Yoshinori K. Okuji * configure.in (falign_loop_flag): New variable. Set to if GCC supports `-falign-*'. If true, use `-falign-jumps', `-falign-loops' and `-falign-functions' instead of `-malign-jumps', `-malign-loops' and `-malign-functions', because `-malign-*' are obsolete in GCC 3.x. Reported by Jeremy Katz. --- ChangeLog | 9 +++++++ configure | 63 ++++++++++++++++++++++++++++++++++++++++--- configure.in | 19 ++++++++++--- docs/grub-install.8 | 2 +- docs/grub-md5-crypt.8 | 2 +- docs/grub.8 | 2 +- docs/mbchk.1 | 2 +- 7 files changed, 89 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf9b96b39..9b59a2515 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-10-06 Yoshinori K. Okuji + + * configure.in (falign_loop_flag): New variable. Set to if GCC + supports `-falign-*'. If true, use `-falign-jumps', + `-falign-loops' and `-falign-functions' instead of + `-malign-jumps', `-malign-loops' and `-malign-functions', + because `-malign-*' are obsolete in GCC 3.x. Reported by Jeremy + Katz. + 2002-09-13 Yoshinori K. Okuji * stage2/serial.c (fill_input_buf): Take a new argument NOWAIT. diff --git a/configure b/configure index 09b0766f8..a49106f36 100644 --- a/configure +++ b/configure @@ -2992,7 +2992,7 @@ if test "${undef_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - saved_CPPFLAGS=$CPPFLAGS + saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-Wundef" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" @@ -3031,14 +3031,71 @@ cat conftest.$ac_ext >&5 undef_flag=no fi rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS=$saved_CPPFLAGS + CPPFLAGS="$saved_CPPFLAGS" fi echo "$as_me:$LINENO: result: $undef_flag" >&5 echo "${ECHO_T}$undef_flag" >&6 +# The options `-falign-*' are supported by gcc 3.0 or later. +# Probably it is sufficient to only check for -falign-loops. +echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6 +if test "${falign_loop_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-falign-loops=1" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (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 + falign_loop_flag=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +falign_loop_flag=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$saved_CPPFLAGS" + +fi +echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 +echo "${ECHO_T}$falign_loop_flag" >&6 + # Force no alignment to save space. -CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" +if test "x$falign_loop_flag" = xyes; then + CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" +else + CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" +fi if test "x$undef_flag" = xyes; then CPPFLAGS="$CPPFLAGS -Wundef" diff --git a/configure.in b/configure.in index db503314d..c33b5a971 100644 --- a/configure.in +++ b/configure.in @@ -102,14 +102,27 @@ CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow" CPPFLAGS="$CPPFLAGS -Wpointer-arith" AC_CACHE_CHECK([whether -Wundef works], undef_flag, [ - saved_CPPFLAGS=$CPPFLAGS + saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-Wundef" AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no) - CPPFLAGS=$saved_CPPFLAGS + CPPFLAGS="$saved_CPPFLAGS" +]) + +# The options `-falign-*' are supported by gcc 3.0 or later. +# Probably it is sufficient to only check for -falign-loops. +AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-falign-loops=1" + AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no]) + CPPFLAGS="$saved_CPPFLAGS" ]) # Force no alignment to save space. -CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" +if test "x$falign_loop_flag" = xyes; then + CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" +else + CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" +fi if test "x$undef_flag" = xyes; then CPPFLAGS="$CPPFLAGS -Wundef" diff --git a/docs/grub-install.8 b/docs/grub-install.8 index 3371dd229..d54b87d33 100644 --- a/docs/grub-install.8 +++ b/docs/grub-install.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB-INSTALL "8" "September 2002" "grub-install (GNU GRUB 0.93)" FSF +.TH GRUB-INSTALL "8" "October 2002" "grub-install (GNU GRUB 0.93)" FSF .SH NAME grub-install \- install GRUB on your drive .SH SYNOPSIS diff --git a/docs/grub-md5-crypt.8 b/docs/grub-md5-crypt.8 index ba7e5a3b8..71ae85630 100644 --- a/docs/grub-md5-crypt.8 +++ b/docs/grub-md5-crypt.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB-MD5-CRYPT "8" "September 2002" "grub-md5-crypt (GNU GRUB )" FSF +.TH GRUB-MD5-CRYPT "8" "October 2002" "grub-md5-crypt (GNU GRUB )" FSF .SH NAME grub-md5-crypt \- Encrypt a password in MD5 format .SH SYNOPSIS diff --git a/docs/grub.8 b/docs/grub.8 index e2d79cd16..4e0b07061 100644 --- a/docs/grub.8 +++ b/docs/grub.8 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH GRUB "8" "September 2002" "grub (GNU GRUB 0.93)" FSF +.TH GRUB "8" "October 2002" "grub (GNU GRUB 0.93)" FSF .SH NAME grub \- the grub shell .SH SYNOPSIS diff --git a/docs/mbchk.1 b/docs/mbchk.1 index 0f2e2bc74..cd9932278 100644 --- a/docs/mbchk.1 +++ b/docs/mbchk.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23. -.TH MBCHK "1" "September 2002" "mbchk (GNU GRUB 0.93)" FSF +.TH MBCHK "1" "October 2002" "mbchk (GNU GRUB 0.93)" FSF .SH NAME mbchk \- check the format of a Multiboot kernel .SH SYNOPSIS