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

configure.in: fix static-linked-ext

* configure.in (--with-static-linked-ext): fix for extensions to
  be linked statically.
* Makefile.in, common.mk: use ENCSTATIC for enc directory.
* ext/extmk.rb: supply dependencies of statically linked extension
  libraries.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-07-03 03:40:24 +00:00
parent e0515646b9
commit c2b0992156
6 changed files with 26 additions and 7 deletions

View file

@ -1,3 +1,13 @@
Thu Jul 3 12:40:22 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (--with-static-linked-ext): fix for extensions to
be linked statically.
* Makefile.in, common.mk: use ENCSTATIC for enc directory.
* ext/extmk.rb: supply dependencies of statically linked extension
libraries.
Wed Jul 2 15:45:49 2014 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_heap_lazy_sweep): simplify logic.

View file

@ -137,6 +137,7 @@ PREP = @PREP@
ARCHFILE = @ARCHFILE@
SETUP =
EXTSTATIC = @EXTSTATIC@
ENCSTATIC = @ENCSTATIC@
SET_LC_MESSAGES = env LC_MESSAGES=C
MAKEDIRS = @MKDIR_P@

View file

@ -144,7 +144,7 @@ COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb
all: showflags main docs
main: showflags $(EXTSTATIC:static=lib)encs exts
main: showflags $(ENCSTATIC:static=lib)encs exts
@$(NULLCMD)
.PHONY: showflags
@ -178,7 +178,7 @@ $(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
configure-ext: $(EXTS_MK)
build-ext: $(EXTS_MK)
$(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) $(EXTSTATIC) LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
$(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) libdir="$(libdir)" LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
prog: program wprogram
@ -567,7 +567,7 @@ libtrans trans: {$(VPATH)}transdb.h
$(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
$(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG)
$(ECHO) generating $@
$(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(EXTSTATIC) $@ $(ENCS)
$(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(ENCSTATIC) $@ $(ENCS)
.PRECIOUS: $(MKFILES)

View file

@ -3179,12 +3179,13 @@ EXTSTATIC=
AC_SUBST(EXTSTATIC)dnl
AC_ARG_WITH(static-linked-ext,
AS_HELP_STRING([--with-static-linked-ext], [link external modules statically]),
[AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static])])
if test x"$EXTSTATIC" = xstatic; then
[AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static],[no],[],[EXTSTATIC="$withval"])])
AS_CASE([",$EXTSTATIC,"], [,static,|*,enc,*], [
ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
EXTOBJS='ext/extinit.$(OBJEXT)'
AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
fi
AC_SUBST(ENCSTATIC, static)
])
AC_SUBST(ENCOBJS)
AC_SUBST(EXTOBJS)

View file

@ -716,7 +716,11 @@ if $configure_only and $command_output
mf.puts
mf.puts "#{rubies.join(' ')}: $(extensions:/.=/#{$force_static ? 'static' : 'all'})"
submake = "$(Q)$(MAKE) $(MFLAGS) $(SUBMAKEOPTS)"
mf.puts "all static:\n\t#{submake} #{rubies.join(' ')}\n"
mf.puts "all static: $(EXTOBJS)\n\t#{submake} #{rubies.join(' ')}\n"
$extobjs.each do |tgt|
mf.puts "#{tgt}: #{File.dirname(tgt)}/static"
end
mf.puts "#{rubies.join(' ')}: $(EXTOBJS)"
rubies.each do |tgt|
mf.puts "#{tgt}:\n\t#{submake} $@"
end

View file

@ -360,6 +360,9 @@ COMMON_HEADERS = winsock2.h ws2tcpip.h windows.h
!if "$(EXTSTATIC)" == "static"
ENCOBJS = enc/encinit.$(OBJEXT) enc/libenc.lib enc/libtrans.lib
EXTOBJS = ext/extinit.$(OBJEXT)
! if !defined(ENCSTATIC)
ENCSTATIC = static
! endif
!endif
arch_hdrdir = $(EXTOUT)/include/$(arch)