diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-09 04:28:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-09 04:28:40 +0000 |
commit | 37c8b685558aef2f081689e3ed9c419703a8af56 (patch) | |
tree | 2058216c1cfadf50b3ba4df50d65b2a875e0c8e6 /lib/mkmf.rb | |
parent | fbacb71b385958db8196f041b632e16ab555891d (diff) |
mkmf.rb: add TARGET_NAME
* configure.in (DLDFLAGS): use TARGET_ENTRY to specify an entry point
instead of TARGET which may contain non-identifer characters.
* lib/mkmf.rb (create_makefile): add TARGET_NAME which is the first
part consists of only word characters. [ruby-core:46248][Bug #6709]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r-- | lib/mkmf.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index c0f649df8a..2fb0ba0e9f 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2014,7 +2014,7 @@ RULES makedef = %{-pe "$_.sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"} end else - makedef = %{-e "puts 'EXPORTS', '#{EXPORT_PREFIX}' + 'Init_$(TARGET)'.sub(/\\..*\\z/,'')"} + makedef = %{-e "puts 'EXPORTS', '$(TARGET_ENTRY)'"} end if makedef $cleanfiles << '$(DEFFILE)' @@ -2059,6 +2059,8 @@ ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')} OBJS = #{$objs.join(" ")} TARGET = #{target} +TARGET_NAME = #{target && target[/\A\w+/]} +TARGET_ENTRY = #{EXPORT_PREFIX || ''}Init_$(TARGET_NAME) DLLIB = #{dllib} EXTSTATIC = #{$static || ""} STATIC_LIB = #{staticlib unless $static.nil?} |