Project

General

Profile

Backport #1127 » 001-mkmf-mingw-compatible.patch

luislavena (Luis Lavena), 02/08/2009 02:34 AM

View differences:

lib/mkmf.rb (working copy)
s.tr('/', '\\')
end
# Converts native path to format acceptable in Makefile
#
# Internal use only.
#
if !CROSS_COMPILING
case CONFIG['build_os']
when 'mingw32'
def mkintpath(path)
# mingw uses make from msys and it needs special care
# converts from C:\some\path to /C/some/path
path = path.dup
path.tr!('\\', '/')
path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
path
end
end
end
unless defined?(mkintpath)
def mkintpath(path)
path
end
end
def configuration(srcdir)
mk = []
vpath = %w[$(srcdir) $(topdir) $(hdrdir)]
......
if CONFIG['target_os'] != 'cygwin'
vpath.each {|p| p.sub!(/.*/, '$(shell cygpath -u \&)')}
end
when 'msdosdjgpp', 'mingw32'
CONFIG['PATH_SEPARATOR'] = ';'
end
end
mk << %{
......
#### Start of system configuration section. ####
srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {CONFIG[$1||$2]}.quote}
topdir = #{($extmk ? CONFIG["topdir"] : $topdir).quote}
hdrdir = #{$extmk ? CONFIG["hdrdir"].quote : '$(topdir)'}
srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2])}.quote}
topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).quote}
hdrdir = #{mkintpath(CONFIG["hdrdir"]).quote}
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
if $extmk
(4-4/5)