[前][次][番号順一覧][スレッド一覧]

ruby-changes:34585

From: nobu <ko1@a...>
Date: Thu, 3 Jul 2014 12:40:31 +0900 (JST)
Subject: [ruby-changes:34585] nobu:r46666 (trunk): configure.in: fix static-linked-ext

nobu	2014-07-03 12:40:24 +0900 (Thu, 03 Jul 2014)

  New Revision: 46666

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46666

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/common.mk
    trunk/configure.in
    trunk/ext/extmk.rb
    trunk/win32/Makefile.sub
Index: configure.in
===================================================================
--- configure.in	(revision 46665)
+++ configure.in	(revision 46666)
@@ -3179,12 +3179,13 @@ EXTSTATIC= https://github.com/ruby/ruby/blob/trunk/configure.in#L3179
 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)
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46665)
+++ ChangeLog	(revision 46666)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul  3 12:40:22 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@a...>
 
 	* gc.c (gc_heap_lazy_sweep): simplify logic.
Index: common.mk
===================================================================
--- common.mk	(revision 46665)
+++ common.mk	(revision 46666)
@@ -144,7 +144,7 @@ COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir https://github.com/ruby/ruby/blob/trunk/common.mk#L144
 
 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) https://github.com/ruby/ruby/blob/trunk/common.mk#L178
 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 https://github.com/ruby/ruby/blob/trunk/common.mk#L567
 $(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)
 
Index: win32/Makefile.sub
===================================================================
--- win32/Makefile.sub	(revision 46665)
+++ win32/Makefile.sub	(revision 46666)
@@ -360,6 +360,9 @@ COMMON_HEADERS = winsock2.h ws2tcpip.h w https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L360
 !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)
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 46665)
+++ Makefile.in	(revision 46666)
@@ -137,6 +137,7 @@ PREP          = @PREP@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L137
 ARCHFILE      = @ARCHFILE@
 SETUP         =
 EXTSTATIC     = @EXTSTATIC@
+ENCSTATIC     = @ENCSTATIC@
 SET_LC_MESSAGES = env LC_MESSAGES=C
 
 MAKEDIRS      = @MKDIR_P@
Index: ext/extmk.rb
===================================================================
--- ext/extmk.rb	(revision 46665)
+++ ext/extmk.rb	(revision 46666)
@@ -716,7 +716,11 @@ if $configure_only and $command_output https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L716
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]