mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-config supports MRUBY_LDFLAGS_BEFORE_LIBS in libmruby.flags.mak
This commit is contained in:
@@ -23,7 +23,7 @@ MRuby.each_target do
|
||||
FileUtils.copy "#{File.dirname(__FILE__)}/#{mruby_config}", t.name
|
||||
config = Hash[open("#{build_dir}/lib/libmruby.flags.mak").read.split("\n").map {|x| a = x.split(/\s*=\s*/, 2); [a[0], a[1].gsub('\\"', '"') ]}]
|
||||
IO.write(t.name, File.open(t.name) {|f|
|
||||
f.read.gsub (/echo (MRUBY_CFLAGS|MRUBY_LDFLAGS|MRUBY_LIBS)/) {|x| config[$1].empty? ? '' : "echo #{config[$1]}"}
|
||||
f.read.gsub (/echo (MRUBY_CFLAGS|MRUBY_LIBS|MRUBY_LDFLAGS_BEFORE_LIBS|MRUBY_LDFLAGS)/) {|x| config[$1].empty? ? '' : "echo #{config[$1]}"}
|
||||
})
|
||||
FileUtils.chmod(0755, t.name)
|
||||
end
|
||||
|
||||
@@ -4,12 +4,14 @@ while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--cflags) echo MRUBY_CFLAGS;;
|
||||
--ldflags) echo MRUBY_LDFLAGS;;
|
||||
--ldflags-before-libs) echo MRUBY_LDFLAGS_BEFORE_LIBS;;
|
||||
--libs) echo MRUBY_LIBS;;
|
||||
--help) echo "Usage: mruby-config [switches]"
|
||||
echo " switches:"
|
||||
echo " --cflags print flags passed to compiler"
|
||||
echo " --ldflags print flags passed to linker"
|
||||
echo " --libs print linked libraries"
|
||||
echo " --cflags print flags passed to compiler"
|
||||
echo " --ldflags print flags passed to linker"
|
||||
echo " --ldflags-before-libs print flags passwd to linker before linked libraries"
|
||||
echo " --libs print linked libraries"
|
||||
exit 0;;
|
||||
esac
|
||||
shift
|
||||
|
||||
@@ -5,6 +5,7 @@ shift
|
||||
if "%0" equ "" goto :eof
|
||||
if "%0" equ "--cflags" goto cflags
|
||||
if "%0" equ "--ldflags" goto ldflags
|
||||
if "%0" equ "--ldflags-before-libs" goto ldflagsbeforelibs
|
||||
if "%0" equ "--libs" goto libs
|
||||
if "%0" equ "--help" goto showhelp
|
||||
echo Invalid Option
|
||||
@@ -22,9 +23,14 @@ goto top
|
||||
echo MRUBY_LDFLAGS
|
||||
goto top
|
||||
|
||||
:ldflagsbeforelibs
|
||||
echo MRUBY_LDFLAGS_BEFORE_LIBS
|
||||
goto top
|
||||
|
||||
:showhelp
|
||||
echo Usage: mruby-config [switches]
|
||||
echo switches:
|
||||
echo --cflags print flags passed to compiler
|
||||
echo --ldflags print flags passed to linker
|
||||
echo --libs print linked libraries
|
||||
echo --cflags print flags passed to compiler
|
||||
echo --ldflags print flags passed to linker
|
||||
echo --ldflags-before-libs print flags passwd to linker before linked libraries
|
||||
echo --libs print linked libraries
|
||||
|
||||
Reference in New Issue
Block a user