configure.ac: do not overwrite -std=
Set -std=gnu99 only when no such compiler flag(s) are set in any compiler-related environment variables. This enables users to specify something more modern, say, -std=c11. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8183cd2f1d
commit
88a7271de4
@ -626,6 +626,9 @@ AS_IF([test "$GCC" = yes], [
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
# ANSI (no XCFLAGS because this is C only)
|
# ANSI (no XCFLAGS because this is C only)
|
||||||
|
rb_tmp_std_check=`echo $CC $CFLAGS $optflags $warnflags $debugflags | fgrep std= | tr -d '\015'`
|
||||||
|
AS_IF([test "x$rb_tmp_std_check" = "x"],
|
||||||
|
[
|
||||||
for ansi_options in -std=gnu99; do
|
for ansi_options in -std=gnu99; do
|
||||||
RUBY_TRY_CFLAGS(${ansi_options}, [
|
RUBY_TRY_CFLAGS(${ansi_options}, [
|
||||||
RUBY_APPEND_OPTIONS(warnflags, ${ansi_options})
|
RUBY_APPEND_OPTIONS(warnflags, ${ansi_options})
|
||||||
@ -633,6 +636,7 @@ AS_IF([test "$GCC" = yes], [
|
|||||||
], [ansi_options=])
|
], [ansi_options=])
|
||||||
test "x${ansi_options}" = x || break
|
test "x${ansi_options}" = x || break
|
||||||
done
|
done
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
# suppress annoying -Wstrict-overflow warnings
|
# suppress annoying -Wstrict-overflow warnings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user