diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-23 05:56:01 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-23 05:56:01 +0000 |
| commit | e5269940f34f3df68ddcc0d8b97b37c0006cb746 (patch) | |
| tree | 4c99d9b4851e79438d9d892618ad2811c1f93284 /lib | |
| parent | aa58f2aa399be94deff4547a9a1714e7cfae813b (diff) | |
| download | ruby-e5269940f34f3df68ddcc0d8b97b37c0006cb746.tar.gz ruby-e5269940f34f3df68ddcc0d8b97b37c0006cb746.tar.xz ruby-e5269940f34f3df68ddcc0d8b97b37c0006cb746.zip | |
* lib/mkmf.rb (mkintpath): new function which converts native path
to format acceptable in Makefile.
* lib/mkmf.rb (configuration): convers srcdir, topdir and hdrdir.
a patch by Alexey Borzenkov <snaury AT gmail.com> at
[ruby-core:21448].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mkmf.rb | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 0f6f61d98..9038630e2 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1299,6 +1299,29 @@ def winsep(s) 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 = $VPATH.dup @@ -1318,9 +1341,9 @@ SHELL = /bin/sh #### Start of system configuration section. #### #{"top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/") if $extmk} -srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {CONFIG[$1||$2]}.quote} -topdir = #{($extmk ? CONFIG["topdir"] : $topdir).quote} -hdrdir = #{CONFIG["hdrdir"].quote} +srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2])}.quote} +topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).quote} +hdrdir = #{mkintpath(CONFIG["hdrdir"]).quote} arch_hdrdir = #{$arch_hdrdir} VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])} } |
