summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-03 03:40:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-03 03:40:24 +0000
commitc2b0992156ccb65361eddd4c00d3a35593b0aaea (patch)
treed387c358a9facaef306eaba32c3851eb81fbce89
parente0515646b90043918b9fb1f3977e7648a8f1d9bd (diff)
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
-rw-r--r--ChangeLog10
-rw-r--r--Makefile.in1
-rw-r--r--common.mk6
-rw-r--r--configure.in7
-rwxr-xr-xext/extmk.rb6
-rw-r--r--win32/Makefile.sub3
6 files changed, 26 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index bab6083..ef1f77b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/Makefile.in b/Makefile.in
index 9eb05ca..04fb483 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -137,6 +137,7 @@ PREP = @PREP@
ARCHFILE = @ARCHFILE@
SETUP =
EXTSTATIC = @EXTSTATIC@
+ENCSTATIC = @ENCSTATIC@
SET_LC_MESSAGES = env LC_MESSAGES=C
MAKEDIRS = @MKDIR_P@
diff --git a/common.mk b/common.mk
index 5542b55..72c9905 100644
--- a/common.mk
+++ b/common.mk
@@ -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)
diff --git a/configure.in b/configure.in
index cc80aa7..36c58da 100644
--- a/configure.in
+++ b/configure.in
@@ -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)
diff --git a/ext/extmk.rb b/ext/extmk.rb
index b11010f..3a240aa 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -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
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 5f48ed9..e4e14e5 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -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)