summaryrefslogtreecommitdiff
path: root/enc/depend
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-22 21:51:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-22 21:51:18 +0000
commit15265f8be67d3d35c6748481348f47bbea9a75b5 (patch)
tree15ced240be27475c70a6645645580817ee9df3fe /enc/depend
parent6a64e9e4ac2318cba4f9e70c66cf82885da9f46a (diff)
* enc/depend (link_so): replaces $(TARGET) with basename of the
target. [ruby-talk:330286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/depend')
-rw-r--r--enc/depend11
1 files changed, 9 insertions, 2 deletions
diff --git a/enc/depend b/enc/depend
index f5aa76ef7b..7186179ef0 100644
--- a/enc/depend
+++ b/enc/depend
@@ -1,3 +1,5 @@
+% CONFIG["DLDFLAGS"].sub!(/(\A|\s)(-\S+(?:\s*\w*)?\$\(TARGET\)\S*)/, '\1')
+% dldflags = $2
% enable_shared = CONFIG['ENABLE_SHARED'] == 'yes'
% deffile = (true if /\$\(DEFFILE\)/ =~ CONFIG["LINK_SO"])
% encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS
@@ -103,12 +105,17 @@ $(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.
% obj = "enc/#{e}.$(OBJEXT)"
% df = ("enc/#{e}.def" if deffile)
$(ENCSODIR)/<%=e%>.$(DLEXT): <%=obj%>
+% cmd = link_so.sub(/\$\(OBJS\)/) {obj}
+% base = File.basename(e)
+% cmd.sub!(/(?=\$\(DLDFLAGS\))/) {dldflags.sub(/\$\(TARGET\)/) {base} + " "} if dldflags
% if df
echo> <%=df%> EXPORTS
- echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=File.basename(e)%>
+ echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=base%>
+% cmd.sub!(/\$\(DEFFILE\)/) {df}
+% cmd.gsub!(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}
% end
@$(MAKEDIRS) "$(@D)"
- <%=link_so.sub(/\$\(OBJS\)/) {obj}.sub(/\$\(DEFFILE\)/) {df}.gsub(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}%>
+ <%=cmd%>
% end
% dependencies.each do |e|