diff options
-rw-r--r-- | lib/mkmf.rb | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 4ced064a8b..547a28577e 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -680,16 +680,6 @@ MSG try_compile(MAIN_DOES_NOTHING, flags, {:werror => true}.update(opts)) end - def append_cflags(flags, *opts) - Array(flags).each do |flag| - if checking_for("whether #{flag} is accepted as CFLAGS") { - try_cflags(flag, *opts) - } - $CFLAGS << " " << flag - end - end - end - def with_ldflags(flags) ldflags = $LDFLAGS $LDFLAGS = flags.dup @@ -1024,6 +1014,21 @@ SRC # :startdoc: + # Check whether each given C compiler flag is acceptable and append it + # to <tt>$CFLAGS</tt> if so. + # + # [+flags+] a C compiler flag as a +String+ or an +Array+ of them + # + def append_cflags(flags, *opts) + Array(flags).each do |flag| + if checking_for("whether #{flag} is accepted as CFLAGS") { + try_cflags(flag, *opts) + } + $CFLAGS << " " << flag + end + end + end + # Returns whether or not +macro+ is defined either in the common header # files or within any +headers+ you provide. # |