mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
mkmf.rb: use internal path
* lib/mkmf.rb (MakeMakefile#configuration): make prefix paths internal to deal with in Makefile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
87fe2bfdcf
commit
de9093ad29
2 changed files with 14 additions and 12 deletions
|
@ -1,4 +1,7 @@
|
|||
Sun Sep 23 21:42:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sun Sep 23 21:44:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/mkmf.rb (MakeMakefile#configuration): make prefix paths
|
||||
internal to deal with in Makefile.
|
||||
|
||||
* lib/mkmf.rb (MakeMakefile#mkintpath): not a global function now.
|
||||
|
||||
|
|
21
lib/mkmf.rb
21
lib/mkmf.rb
|
@ -1718,6 +1718,12 @@ SRC
|
|||
path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
|
||||
path
|
||||
end
|
||||
when 'cygwin'
|
||||
if CONFIG['target_os'] != 'cygwin'
|
||||
def mkintpath(path)
|
||||
IO.popen(["cygpath", "-u", path], &:read).chomp
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
unless method_defined?(:mkintpath)
|
||||
|
@ -1729,14 +1735,6 @@ SRC
|
|||
def configuration(srcdir)
|
||||
mk = []
|
||||
vpath = $VPATH.dup
|
||||
if !CROSS_COMPILING
|
||||
case CONFIG['build_os']
|
||||
when 'cygwin'
|
||||
if CONFIG['target_os'] != 'cygwin'
|
||||
vpath = vpath.map {|p| p.sub(/.*/, '$(shell cygpath -u \&)')}
|
||||
end
|
||||
end
|
||||
end
|
||||
CONFIG["hdrdir"] ||= $hdrdir
|
||||
mk << %{
|
||||
SHELL = /bin/sh
|
||||
|
@ -1759,12 +1757,13 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
|
|||
if $extmk
|
||||
mk << "RUBYLIB =\n""RUBYOPT = -\n"
|
||||
end
|
||||
if destdir = CONFIG["prefix"][$dest_prefix_pattern, 1]
|
||||
prefix = mkintpath(CONFIG["prefix"])
|
||||
if destdir = prefix[$dest_prefix_pattern, 1]
|
||||
mk << "\nDESTDIR = #{destdir}\n"
|
||||
end
|
||||
mk << "prefix = #{with_destdir(prefix)}\n"
|
||||
CONFIG.each do |key, var|
|
||||
next unless /prefix$/ =~ key
|
||||
mk << "#{key} = #{with_destdir(var)}\n"
|
||||
mk << "#{key} = #{with_destdir(mkintpath(var))}\n" if /.prefix$/ =~ key
|
||||
end
|
||||
CONFIG.each do |key, var|
|
||||
next if /^abs_/ =~ key
|
||||
|
|
Loading…
Add table
Reference in a new issue