summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xtool/update-deps23
2 files changed, 21 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ca3e89ae75c..7c2a2a1c9e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Dec 19 22:33:13 2014 Tanaka Akira <akr@fsij.org>
+
+ * tool/update-deps: Use $(hdrdir) if possible.
+
Fri Dec 19 22:10:00 2014 Kenta Murata <mrkn@cookpad.com>
* ext/bigdecimal/depend: Fix dependencies to make bigdecimal
diff --git a/tool/update-deps b/tool/update-deps
index 7710d4ae1b5..2e7a7e7cc54 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)"