mruby-config: add --cc and --ld options.

* `--cc` print compiler name
* `--ld` print linker name
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-04-06 13:10:28 +09:00
parent e19346fd8b
commit 58ab97e300
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -4,7 +4,9 @@ print_help()
{
echo "Usage: mruby-config [switches]"
echo " switches:"
echo " --cc print compiler name"
echo " --cflags print flags passed to compiler"
echo " --ld print linker name"
echo " --ldflags print flags passed to linker"
echo " --ldflags-before-libs print flags passed to linker before linked libraries"
echo " --libs print linked libraries"
@@ -19,7 +21,9 @@ fi
while [ $# -gt 0 ]; do
case $1 in
--cc) echo MRUBY_CC;;
--cflags) echo MRUBY_CFLAGS;;
--ld) echo MRUBY_LD;;
--ldflags) echo MRUBY_LDFLAGS;;
--ldflags-before-libs) echo MRUBY_LDFLAGS_BEFORE_LIBS;;
--libs) echo MRUBY_LIBS;;
+3
View File
@@ -16,6 +16,9 @@ MRuby.each_target do
open(t.name, 'w') do |f|
f.puts "MRUBY_CFLAGS = #{cc.all_flags}"
f.puts "MRUBY_CC = #{cc.command}"
f.puts "MRUBY_LD = #{linker.command}"
libgems = gems.reject{|g| g.bin?}
gem_flags = libgems.map {|g| g.linker.flags }
gem_library_paths = libgems.map {|g| g.linker.library_paths }