mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Install binary executable files to architecture dependent path
This commit is contained in:
parent
104100f554
commit
87c4c6c082
3 changed files with 41 additions and 17 deletions
|
@ -3555,7 +3555,7 @@ AS_CASE("$enable_shared", [yes], [
|
|||
RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,$(LIBRUBY_SONAME)' "$LDFLAGS_OPTDIR"])
|
||||
LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
|
||||
AS_IF([test "$load_relative" = yes], [
|
||||
libprefix="'\$\${ORIGIN}/../${libdir_basename}'"
|
||||
libprefix="'\$\${ORIGIN}/../${multiarch+../../}${libdir_basename}'"
|
||||
LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
|
||||
LIBRUBY_RELATIVE=yes
|
||||
])
|
||||
|
@ -3567,7 +3567,7 @@ AS_CASE("$enable_shared", [yes], [
|
|||
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
|
||||
LIBRUBY_ALIASES=''
|
||||
], [test "$load_relative" = yes], [
|
||||
libprefix="'\$\$ORIGIN/../${libdir_basename}'"
|
||||
libprefix="'\$\$ORIGIN/../${multiarch+../../}${libdir_basename}'"
|
||||
LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
|
||||
LIBRUBY_RELATIVE=yes
|
||||
])
|
||||
|
@ -3591,7 +3591,7 @@ AS_CASE("$enable_shared", [yes], [
|
|||
LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
|
||||
RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ["${linker_flag}-h${linker_flag:+,}"'$(@F)'])
|
||||
AS_IF([test "$load_relative" = yes], [
|
||||
libprefix="'\$\$ORIGIN/../${libdir_basename}'"
|
||||
libprefix="'\$\$ORIGIN/../${multiarch+../../}${libdir_basename}'"
|
||||
LIBRUBY_RPATHFLAGS="-R${libprefix}"
|
||||
LIBRUBY_RELATIVE=yes
|
||||
], [
|
||||
|
@ -3608,7 +3608,7 @@ AS_CASE("$enable_shared", [yes], [
|
|||
LIBRUBY_SONAME='$(LIBRUBY_SO)'
|
||||
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(SOEXT)'
|
||||
AS_IF([test "$load_relative" = yes], [
|
||||
libprefix="@executable_path/../${libdir_basename}"
|
||||
libprefix="@executable_path/../${multiarch+../../}${libdir_basename}"
|
||||
LIBRUBY_RELATIVE=yes
|
||||
])
|
||||
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS -install_name ${libprefix}"'/$(LIBRUBY_SONAME)'
|
||||
|
|
|
@ -34,18 +34,22 @@ vendordir = config["vendordir"]
|
|||
rubylibdir = config["rubylibdir"]
|
||||
rubyarchdir = config["rubyarchdir"]
|
||||
archdir = "#{extout}/#{arch}"
|
||||
[bindir, libdir, archdir].uniq.each do |dir|
|
||||
exedir = libdirname == "archlibdir" ? "#{config["libexecdir"]}/#{arch}/bin" : bindir
|
||||
[exedir, libdir, archdir].uniq.each do |dir|
|
||||
File.directory?(dir) or mkdir_p(dir)
|
||||
end
|
||||
unless exedir == bindir
|
||||
ln_dir_relative(exedir, bindir)
|
||||
end
|
||||
|
||||
exeext = config["EXEEXT"]
|
||||
ruby_install_name = config["ruby_install_name"]
|
||||
rubyw_install_name = config["rubyw_install_name"]
|
||||
goruby_install_name = "go" + ruby_install_name
|
||||
[ruby_install_name, rubyw_install_name, goruby_install_name].map do |ruby|
|
||||
[ruby_install_name, rubyw_install_name, goruby_install_name].each do |ruby|
|
||||
if ruby and !ruby.empty?
|
||||
ruby += exeext
|
||||
ln_relative(ruby, "#{bindir}/#{ruby}", true)
|
||||
ln_relative(ruby, "#{exedir}/#{ruby}", true)
|
||||
end
|
||||
end
|
||||
so = config["LIBRUBY_SO"]
|
||||
|
|
|
@ -28,6 +28,7 @@ begin
|
|||
rescue LoadError
|
||||
$" << "zlib.rb"
|
||||
end
|
||||
require_relative 'lib/path'
|
||||
|
||||
INDENT = " "*36
|
||||
STDOUT.sync = true
|
||||
|
@ -360,6 +361,13 @@ rubyw_install_name = CONFIG["rubyw_install_name"]
|
|||
goruby_install_name = "go" + ruby_install_name
|
||||
|
||||
bindir = CONFIG["bindir", true]
|
||||
if CONFIG["libdirname"] == "archlibdir"
|
||||
libexecdir = MAKEFILE_CONFIG["archlibdir"].dup
|
||||
unless libexecdir.sub!(/\$\(lib\K(?=dir\))/) {"exec"}
|
||||
libexecdir = "$(libexecdir)/$(arch)"
|
||||
end
|
||||
archbindir = RbConfig.expand(libexecdir) + "/bin"
|
||||
end
|
||||
libdir = CONFIG[CONFIG.fetch("libdirname", "libdir"), true]
|
||||
rubyhdrdir = CONFIG["rubyhdrdir", true]
|
||||
archhdrdir = CONFIG["rubyarchhdrdir"] || (rubyhdrdir + "/" + CONFIG['arch'])
|
||||
|
@ -384,22 +392,34 @@ load_relative = CONFIG["LIBRUBY_RELATIVE"] == 'yes'
|
|||
rdoc_noinst = %w[created.rid]
|
||||
|
||||
install?(:local, :arch, :bin, :'bin-arch') do
|
||||
prepare "binary commands", bindir
|
||||
prepare "binary commands", (dest = archbindir || bindir)
|
||||
|
||||
install ruby_install_name+exeext, bindir, :mode => $prog_mode, :strip => $strip
|
||||
def (bins = []).add(name)
|
||||
push(name)
|
||||
name
|
||||
end
|
||||
|
||||
install bins.add(ruby_install_name+exeext), dest, :mode => $prog_mode, :strip => $strip
|
||||
if rubyw_install_name and !rubyw_install_name.empty?
|
||||
install rubyw_install_name+exeext, bindir, :mode => $prog_mode, :strip => $strip
|
||||
install bins.add(rubyw_install_name+exeext), dest, :mode => $prog_mode, :strip => $strip
|
||||
end
|
||||
# emcc produces ruby and ruby.wasm, the first is a JavaScript file of runtime support
|
||||
# to load and execute the second .wasm file. Both are required to execute ruby
|
||||
if RUBY_PLATFORM =~ /emscripten/ and File.exist? ruby_install_name+".wasm"
|
||||
install ruby_install_name+".wasm", bindir, :mode => $prog_mode, :strip => $strip
|
||||
install bins.add(ruby_install_name+".wasm"), dest, :mode => $prog_mode, :strip => $strip
|
||||
end
|
||||
if File.exist? goruby_install_name+exeext
|
||||
install goruby_install_name+exeext, bindir, :mode => $prog_mode, :strip => $strip
|
||||
install bins.add(goruby_install_name+exeext), dest, :mode => $prog_mode, :strip => $strip
|
||||
end
|
||||
if enable_shared and dll != lib
|
||||
install dll, bindir, :mode => $prog_mode, :strip => $strip
|
||||
install bins.add(dll), dest, :mode => $prog_mode, :strip => $strip
|
||||
end
|
||||
if archbindir
|
||||
prepare "binary command links", bindir
|
||||
relpath = Path.relative(archbindir, bindir)
|
||||
bins.each do |f|
|
||||
ln_sf(File.join(relpath, f), File.join(bindir, f))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -690,7 +710,7 @@ end
|
|||
install?(:dbg, :nodefault) do
|
||||
prepare "debugger commands", bindir
|
||||
prepare "debugger scripts", rubylibdir
|
||||
conf = RbConfig::MAKEFILE_CONFIG.merge({"prefix"=>"${prefix#/}"})
|
||||
conf = MAKEFILE_CONFIG.merge({"prefix"=>"${prefix#/}"})
|
||||
Dir.glob(File.join(srcdir, "template/ruby-*db.in")) do |src|
|
||||
cmd = $script_installer.transform(File.basename(src, ".in"))
|
||||
open_for_install(File.join(bindir, cmd), $script_mode) {
|
||||
|
@ -707,9 +727,9 @@ install?(:dbg, :nodefault) do
|
|||
install File.join(srcdir, ".gdbinit"), File.join(rubylibdir, "gdbinit")
|
||||
if $debug_symbols
|
||||
{
|
||||
ruby_install_name => bindir,
|
||||
rubyw_install_name => bindir,
|
||||
goruby_install_name => bindir,
|
||||
ruby_install_name => archbindir || bindir,
|
||||
rubyw_install_name => archbindir || bindir,
|
||||
goruby_install_name => archbindir || bindir,
|
||||
dll => libdir,
|
||||
}.each do |src, dest|
|
||||
next if src.empty?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue