diff options
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-x | ext/extmk.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index f805338404..7a09be6963 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -594,6 +594,25 @@ exts.each do |d| end end +if @gemname + src_gemlib = File.join($top_srcdir, ext_prefix, @gemname, "lib") + src_gemlib = relative_from(src_gemlib, ([".."]*ext_prefix.count("/")).join("/")) + gemlib = "#{@gemname}/lib" + if File.directory?(src_gemlib) + if File.exist?(gemlib) + puts "using #{gemlib}" + else + begin + File.symlink(relative_from(src_gemlib, ".."), gemlib) + puts "linked #{gemlib}" + rescue NotImplementedError, Errno::EPERM + FileUtils.cp_r(src_gemlib, gemlib) + puts "copied #{gemlib}" + end + end + end +end + $top_srcdir = srcdir $topdir = "." $hdrdir = hdrdir |