mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Document MakeMakefile#append_cflags
This method is at least 7 years old and is widely used in the wild. Since we need to support it, let's document it to make it discoverable. Add docs and move it out of the `# :stopdoc:` zone.
This commit is contained in:
parent
3bb70a6924
commit
2304cfa4c0
Notes:
git
2022-04-06 01:58:30 +09:00
1 changed files with 15 additions and 10 deletions
25
lib/mkmf.rb
25
lib/mkmf.rb
|
@ -680,16 +680,6 @@ MSG
|
||||||
try_compile(MAIN_DOES_NOTHING, flags, {:werror => true}.update(opts))
|
try_compile(MAIN_DOES_NOTHING, flags, {:werror => true}.update(opts))
|
||||||
end
|
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)
|
def with_ldflags(flags)
|
||||||
ldflags = $LDFLAGS
|
ldflags = $LDFLAGS
|
||||||
$LDFLAGS = flags.dup
|
$LDFLAGS = flags.dup
|
||||||
|
@ -1024,6 +1014,21 @@ SRC
|
||||||
|
|
||||||
# :startdoc:
|
# :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
|
# Returns whether or not +macro+ is defined either in the common header
|
||||||
# files or within any +headers+ you provide.
|
# files or within any +headers+ you provide.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue