summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-20 06:32:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-20 06:32:36 +0000
commit2d03f7274f84ab5abf8825c8e0c339caa659c27a (patch)
tree2b6b103bcb45293472970a8d048db8840e42d475
parente77a0b7b246b4f0fcb751d6897b7c9ba0c277d55 (diff)
* Makefile.in (miniruby): renames and then removes, to get rid of
EPERM on cygwin and mingw. * Makefile.in ($(LIBRUBY_SO)): use wildcard option of objcopy. * configure.in (DLDFLAGS): do not export all symbols. * cygwin/GNUmakefile.in (RUBYDEF): rejects symbols prefixex with Init_. * win32/mkexports.rb (Exports::Mingw): includes all symbols except for prefixed with Init_ as well as mswin32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog15
-rw-r--r--Makefile.in6
-rw-r--r--configure.in3
-rw-r--r--cygwin/GNUmakefile.in19
-rwxr-xr-xwin32/mkexports.rb6
5 files changed, 31 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index ebb317db672..a915a0eb0d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Tue Jan 20 15:32:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (miniruby): renames and then removes, to get rid of
+ EPERM on cygwin and mingw.
+
+ * Makefile.in ($(LIBRUBY_SO)): use wildcard option of objcopy.
+
+ * configure.in (DLDFLAGS): do not export all symbols.
+
+ * cygwin/GNUmakefile.in (RUBYDEF): rejects symbols prefixex with
+ Init_.
+
+ * win32/mkexports.rb (Exports::Mingw): includes all symbols except for
+ prefixed with Init_ as well as mswin32.
+
Tue Jan 20 13:03:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (hash): fixed the tail bytes handling in the aligned
diff --git a/Makefile.in b/Makefile.in
index 5f6316c67a5..4f5101ed34f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -123,7 +123,7 @@ all:
.NOEXPORT:
miniruby$(EXEEXT):
- @$(RM) $@
+ @-if test -f $@; then mv -f $@ $@.old; $(RM) $@.old; fi
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(ARCHFILE) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@@ -141,9 +141,7 @@ $(LIBRUBY_A):
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
- @-test "$(OBJDUMP)" = "" || test "$(OBJCOPY)" = "" || { \
- set dummy `$(OBJDUMP) -t $@ | sed '/^[^ ]* g/!d;s/.* //;/^\(Init_\|vm_\)/!d;s/^/-L /'`; \
- shift; test "$$#" = 0 || $(OBJCOPY) "$$@" $@; }
+ -$(OBJCOPY) -w -L '@EXPORT_PREFIX@Init_*' $@
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
diff --git a/configure.in b/configure.in
index 7a1970b401a..3cd3f4fd7a8 100644
--- a/configure.in
+++ b/configure.in
@@ -1478,7 +1478,7 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes;;
cygwin*|mingw*) : ${LDSHARED="${CC} -shared "'$(if $(filter-out -g -g0,$(debugflags)),,-s)'}
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
- DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import,--export-all"
+ DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
: ${LIBPATHENV=""}
rb_cv_dlopen=yes ;;
hiuxmpp) : ${LDSHARED='ld -r'} ;;
@@ -1871,6 +1871,7 @@ case "$target_os" in
cygwin*)
if test x"$enable_shared" = xyes; then
LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}${TEENY}.dll
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
fi
;;
mingw*)
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 91a5e73c888..9a0601d2640 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -5,7 +5,7 @@ ENABLE_SHARED=@ENABLE_SHARED@
DLLWRAP = @DLLWRAP@ --target=@target_os@
ifeq (@target_os@,cygwin)
- DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
+ DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
@@ -29,7 +29,7 @@ WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
-RUBYDEF = $(RUBY_SO_NAME).def
+RUBYDEF = $(DLL_BASE_NAME).def
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
@@ -63,22 +63,25 @@ GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
$(OBJS) $(MAINOBJ): win32.h
+endif
$(LIBRUBY_SO): $(RUBYDEF)
$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG)
+ifeq (@target_os@,cygwin)
+ @NM@ --extern --defined $(LIBRUBY_A) | \
+ $(MINIRUBY) -n -e 'BEGIN{puts "VERSION $(MAJOR).$(MINOR)","EXPORTS"}' \
+ -e 'puts $$1 if / [CDT] _((?!Init_).*)$$/' > $@
+else
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
+endif
clean-local::
@$(RM) $(RUBYDEF)
-endif
ifeq (@target_os@,cygwin)
-cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A)
- @NM@ --extern --defined $(LIBRUBY_A) | \
- $(MINIRUBY) -ne 'BEGIN{puts "VERSION $(MAJOR).$(MINOR)","EXPORTS"}; puts $$1+"=$(@F)."+$$1 if / [CDT] _(.*)$$/' >rubydll.def
- @DLLWRAP@ -s --def=rubydll.def -o $@
- @rm -f rubydll.def
+cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A) $(RUBYDEF)
+ @DLLWRAP@ -s --def=$(RUBYDEF) -o $@
endif
clean-local::
diff --git a/win32/mkexports.rb b/win32/mkexports.rb
index cd88e968a5e..966b602f974 100755
--- a/win32/mkexports.rb
+++ b/win32/mkexports.rb
@@ -143,15 +143,11 @@ class Exports::Mingw < Exports
def each_export(objs)
objdump(objs) do |l|
- yield $1 if / [[:upper:]] _(.*)$/ =~ l
+ yield $1 if / [[:upper:]] _((?!Init_).*)$/ =~ l
end
yield "strcasecmp", "_stricmp"
yield "strncasecmp", "_strnicmp"
end
-
- def symbols()
- @syms.select {|k, v| v}.sort.collect {|k, v| "#{k}=#{v}"}
- end
end
END {