diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-19 01:43:58 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-19 01:43:58 +0000 |
| commit | 54caeb378ee156c882e0996b250daa7cf4faddf3 (patch) | |
| tree | 3193cad3c94dd083043793f0caacd22e8b765557 /lib/mkmf.rb | |
| parent | a47a29e4587ccf9d00ab24a6fe0dd2b928b81f6f (diff) | |
| download | ruby-54caeb378ee156c882e0996b250daa7cf4faddf3.tar.gz ruby-54caeb378ee156c882e0996b250daa7cf4faddf3.tar.xz ruby-54caeb378ee156c882e0996b250daa7cf4faddf3.zip | |
* ext/extmk.rb (extract_makefile): remove no longer existing installed
files.
* lib/mkmf.rb (install_dirs): return installation directory list.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
| -rw-r--r-- | lib/mkmf.rb | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index a6f77e043..23d94c761 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -74,6 +74,32 @@ INSTALL_DIRS = [ [dir_re('sitearchdir'), "$(RUBYARCHDIR)"] ] +def install_dirs(target_prefix = nil) + if $extout + dirs = [ + ['RUBYCOMMONDIR', '$(extout)'], + ['RUBYLIBDIR', '$(extout)$(target_prefix)'], + ['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'], + ['extout', "#$extout"], + ['extout_prefix', "#$extout_prefix"], + ] + elsif $extmk + dirs = [ + ['RUBYCOMMONDIR', '$(rubylibdir)'], + ['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'], + ['RUBYARCHDIR', '$(archdir)$(target_prefix)'], + ] + else + dirs = [ + ['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'], + ['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'], + ['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'], + ] + end + dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")] + dirs +end + def map_dir(dir, map = nil) map ||= INSTALL_DIRS map.inject(dir) {|dir, (orig, new)| dir.gsub(orig, new)} @@ -896,9 +922,6 @@ def create_makefile(target, srcprefix = nil) if target.include?('/') target_prefix, target = File.split(target) - target_prefix[0,0] = '/' - else - target_prefix = "" end srcprefix ||= '$(srcdir)' @@ -961,26 +984,9 @@ OBJS = #{$objs} TARGET = #{target} DLLIB = #{dllib} STATIC_LIB = #{staticlib unless $static.nil?} + } - if $extout - mfile.print %{ -RUBYCOMMONDIR = $(extout) -RUBYLIBDIR = $(extout)$(target_prefix) -RUBYARCHDIR = $(extout)/$(arch)$(target_prefix) -} - elsif $extmk - mfile.print %{ -RUBYCOMMONDIR = $(rubylibdir) -RUBYLIBDIR = $(rubylibdir)$(target_prefix) -RUBYARCHDIR = $(archdir)$(target_prefix) -} - else - mfile.print %{ -RUBYCOMMONDIR = $(sitedir)$(target_prefix) -RUBYLIBDIR = $(sitelibdir)$(target_prefix) -RUBYARCHDIR = $(sitearchdir)$(target_prefix) -} - end + install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]} n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET).' mfile.print %{ TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB) |
