1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* configure.in (warnflags): use -Wextra only when

-Wno-missing-field-initializers is available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-10-23 05:22:53 +00:00
parent 9a8d0e83c0
commit a56b1bc27b
2 changed files with 27 additions and 12 deletions

View file

@ -1,4 +1,7 @@
Fri Oct 23 14:06:10 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Oct 23 14:22:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (warnflags): use -Wextra only when
-Wno-missing-field-initializers is available.
* configure.in (optflags): removed -fomit-frame-pointer by default.

View file

@ -387,19 +387,31 @@ AC_SUBST(CHDIR)
dnl }
dnl compiler section {
if test "$GCC:${warnflags+set}:no" = yes::no; then
AC_DEFUN(RUBY_TRY_CFLAGS, [
save_CFLAGS="$CFLAGS"
for wflag in -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings \
-Wno-missing-field-initializers -Wshorten-64-to-32; do
CFLAGS="$CFLAGS $wflag"
AC_MSG_CHECKING([whether $wflag is accepted])
CFLAGS="[$]CFLAGS $1"
AC_MSG_CHECKING([whether ]$1[ is accepted])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[warnflags="${warnflags+$warnflags }$wflag"
[$2
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
done
[$3
AC_MSG_RESULT(no)])
CFLAGS="$save_CFLAGS"
unset save_CFLAGS
save_CFLAGS=
])
if test "$GCC:${warnflags+set}:no" = yes::no; then
for wflag in -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings \
-Wno-missing-field-initializers -Wshorten-64-to-32; do
RUBY_TRY_CFLAGS($wflag, [warnflags="${warnflags+$warnflags }$wflag"])
done
case " $warnflags " in
when(*" -Wno-missing-field-initializers "*)
wflag=-Wextra;;
when(*)
wflag=-Wall;;
esac
RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
fi
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""