1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2012-07-09 04:28:40 +00:00
parent fbacb71b38
commit 37c8b68555
3 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -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'}

View file

@ -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?}