From 7317392a38364dcbde3b25c2a55fe93752da9767 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 19 Dec 2014 13:34:37 +0000 Subject: [PATCH] * tool/update-deps: Use $(hdrdir) if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ tool/update-deps | 23 +++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca3e89ae75..7c2a2a1c9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Dec 19 22:33:13 2014 Tanaka Akira + + * tool/update-deps: Use $(hdrdir) if possible. + Fri Dec 19 22:10:00 2014 Kenta Murata * ext/bigdecimal/depend: Fix dependencies to make bigdecimal diff --git a/tool/update-deps b/tool/update-deps index 7710d4ae1b..2e7a7e7cc5 100755 --- a/tool/update-deps +++ b/tool/update-deps @@ -154,13 +154,21 @@ FILES_NEED_VPATH = %w[ # Multiple files with same filename. # It is not good idea to refer them using VPATH. -FILES_SAME_NAME = %w[ - include/ruby.h +# Files in FILES_SAME_NAME_INC is referenced using $(hdrdir). +# Files in FILES_SAME_NAME_TOP is referenced using $(top_srcdir). +# include/ruby.h is referenced using $(top_srcdir) because mkmf.rb replaces +# $(hdrdir)/ruby.h to $(hdrdir)/ruby/ruby.h + +FILES_SAME_NAME_INC = %w[ include/ruby/ruby.h - version.h include/ruby/version.h ] +FILES_SAME_NAME_TOP = %w[ + include/ruby.h + version.h +] + # Other source files exist in the source directory. def in_makefile(target, source) @@ -173,7 +181,8 @@ def in_makefile(target, source) when *FILES_IN_SOURCE_DIRECTORY then source2 = "$(top_srcdir)/#{source}" when *FILES_IN_BUILD_DIRECTORY then source2 = "{$(VPATH)}#{source}" # VPATH is not used now but it may changed in future. when *FILES_NEED_VPATH then source2 = "{$(VPATH)}#{source}" - when *FILES_SAME_NAME then source2 = "$(top_srcdir)/#{source}" + when *FILES_SAME_NAME_INC then source2 = "$(hdrdir)/#{source.sub(%r{\Ainclude/},'')}" + when *FILES_SAME_NAME_TOP then source2 = "$(top_srcdir)/#{source}" when 'thread_pthread.c' then source2 = '{$(VPATH)}thread_$(THREAD_MODEL).c' when 'thread_pthread.h' then source2 = '{$(VPATH)}thread_$(THREAD_MODEL).h' when %r{\A[^/]*\z} then source2 = "{$(VPATH)}#{File.basename source}" @@ -192,7 +201,8 @@ def in_makefile(target, source) when *FILES_IN_SOURCE_DIRECTORY then source2 = "$(top_srcdir)/#{source}" when *FILES_IN_BUILD_DIRECTORY then source2 = source when *FILES_NEED_VPATH then source2 = source - when *FILES_SAME_NAME then source2 = "$(top_srcdir)/#{source}" + when *FILES_SAME_NAME_INC then source2 = "$(hdrdir)/#{source.sub(%r{\Ainclude/},'')}" + when *FILES_SAME_NAME_TOP then source2 = "$(top_srcdir)/#{source}" when %r{\A\.ext/include/[^/]+/ruby/} then source2 = $' when %r{\Ainclude/ruby/} then source2 = $' when %r{\Aenc/} then source2 = source @@ -209,7 +219,8 @@ def in_makefile(target, source) when *FILES_IN_SOURCE_DIRECTORY then source2 = "$(top_srcdir)/#{source}" when *FILES_IN_BUILD_DIRECTORY then source2 = relpath when *FILES_NEED_VPATH then source2 = "{$(VPATH)}#{File.basename source}" - when *FILES_SAME_NAME then source2 = "$(top_srcdir)/#{source}" + when *FILES_SAME_NAME_INC then source2 = "$(hdrdir)/#{source.sub(%r{\Ainclude/},'')}" + when *FILES_SAME_NAME_TOP then source2 = "$(top_srcdir)/#{source}" when %r{\A\.ext/include/[^/]+/ruby/} then source2 = "$(arch_hdrdir)/ruby/#{$'}" when %r{\Ainclude/} then source2 = "$(hdrdir)/#{$'}" when %r{\A#{Regexp.escape File.dirname(target)}/extconf\.h\z} then source2 = "$(RUBY_EXTCONF_H)"