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:
parent
9a8d0e83c0
commit
a56b1bc27b
2 changed files with 27 additions and 12 deletions
|
@ -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.
|
||||
|
||||
|
|
34
configure.in
34
configure.in
|
@ -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])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[warnflags="${warnflags+$warnflags }$wflag"
|
||||
AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(no)])
|
||||
done
|
||||
CFLAGS="[$]CFLAGS $1"
|
||||
AC_MSG_CHECKING([whether ]$1[ is accepted])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||
[$2
|
||||
AC_MSG_RESULT(yes)],
|
||||
[$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\""
|
||||
|
|
Loading…
Reference in a new issue