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 | |
parent | fbacb71b385958db8196f041b632e16ab555891d (diff) | |
download | ruby-37c8b685558aef2f081689e3ed9c419703a8af56.tar.gz |
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
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | lib/mkmf.rb | 4 |
3 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,11 @@ +Mon Jul 9 13:28:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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] + Sun Jul 8 07:36:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * parse.y (shadowing_lvar_gen, warn_unused_var): no warnings for diff --git a/configure.in b/configure.in index 32aa05364a..2131ac02e8 100644 --- a/configure.in +++ b/configure.in @@ -2294,7 +2294,7 @@ if test "$with_dln_a_out" != yes; then rb_cv_dlopen=yes], [aix*], [ : ${LDSHARED='$(CC)'} LDSHARED="$LDSHARED ${linker_flag}-G" - DLDFLAGS='-eInit_$(TARGET)' + DLDFLAGS='-e$(TARGET_ENTRY)' XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl" XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}" : ${ARCHFILE="ruby.imp"} @@ -2306,7 +2306,7 @@ if test "$with_dln_a_out" != yes; then [beos*], [ AS_CASE(["$target_cpu"], [powerpc*], [ : ${LDSHARED='$(LD) -xms'} - DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o' + DLDFLAGS="$DLDFLAGS "'-export $(TARGET_ENTRY) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o' LDFLAGS="$LDFLAGS -L/boot/home/config/lib -lbe -lroot" ], [i586*], [ @@ -2319,7 +2319,7 @@ if test "$with_dln_a_out" != yes; then [haiku*], [ AS_CASE(["$target_cpu"], [powerpc*], [ : ${LDSHARED='$(LD) -xms'} - DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o' + DLDFLAGS="$DLDFLAGS "'-export $(TARGET_ENTRY) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o' ], [i586*], [ : ${LDSHARED='$(LD) -shared'} 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?} |