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
@ -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.
|
* 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.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
when 'cygwin'
|
||||||
|
if CONFIG['target_os'] != 'cygwin'
|
||||||
|
def mkintpath(path)
|
||||||
|
IO.popen(["cygpath", "-u", path], &:read).chomp
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
unless method_defined?(:mkintpath)
|
unless method_defined?(:mkintpath)
|
||||||
@ -1729,14 +1735,6 @@ SRC
|
|||||||
def configuration(srcdir)
|
def configuration(srcdir)
|
||||||
mk = []
|
mk = []
|
||||||
vpath = $VPATH.dup
|
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
|
CONFIG["hdrdir"] ||= $hdrdir
|
||||||
mk << %{
|
mk << %{
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
@ -1759,12 +1757,13 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
|
|||||||
if $extmk
|
if $extmk
|
||||||
mk << "RUBYLIB =\n""RUBYOPT = -\n"
|
mk << "RUBYLIB =\n""RUBYOPT = -\n"
|
||||||
end
|
end
|
||||||
if destdir = CONFIG["prefix"][$dest_prefix_pattern, 1]
|
prefix = mkintpath(CONFIG["prefix"])
|
||||||
|
if destdir = prefix[$dest_prefix_pattern, 1]
|
||||||
mk << "\nDESTDIR = #{destdir}\n"
|
mk << "\nDESTDIR = #{destdir}\n"
|
||||||
end
|
end
|
||||||
|
mk << "prefix = #{with_destdir(prefix)}\n"
|
||||||
CONFIG.each do |key, var|
|
CONFIG.each do |key, var|
|
||||||
next unless /prefix$/ =~ key
|
mk << "#{key} = #{with_destdir(mkintpath(var))}\n" if /.prefix$/ =~ key
|
||||||
mk << "#{key} = #{with_destdir(var)}\n"
|
|
||||||
end
|
end
|
||||||
CONFIG.each do |key, var|
|
CONFIG.each do |key, var|
|
||||||
next if /^abs_/ =~ key
|
next if /^abs_/ =~ key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user