diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-16 05:39:06 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-16 05:39:06 +0000 |
commit | 3fa3f9abb9a187a12089c2c5a650a62dbd82a3dd (patch) | |
tree | 5a7f6c9f348469863b60010b02375c06b6704951 /Makefile.in | |
parent | 0923ae5ed1711d699ef2923c2223163646634a66 (diff) | |
download | ruby-3fa3f9abb9a187a12089c2c5a650a62dbd82a3dd.tar.gz |
Supports static linking of extensions and encodings again.
Fixes --with-static-linked-ext.
Patch by Google Inc. [ruby-core:45073].
* Makefile.in (ENCOBJS, EXTOBJS): New variables to specify static
linked libraries. Also reintroduces extinit.o, introduces encinit.o
introduces encinit.o
* common.mk: Builds static libraries rather than shared objects if
specified.
* configure.in (LD): new substitution.
Avoids PIE if s
* enc/depend: Supports static linked libraries
(libencs, libenc, libtrans): New target.
* enc/encinit.c.erb: new template to generate the initialization of
statically linked encodings.
* enc/make_encmake.rb (--module): new flag to specify whether static
or dynamic.
* transcode_data.h (TRANS_INIT): New macro to get rid of the name
collision of encoding initializers and transcoder initializers.
* ext/extmk.rb: Fixes the behavior on $extstatic is true.
* lib/mkmf.rb (clean-static): new target to clean up static linked
libraries.
* ruby.c (process_options): New initializes statically linked
encodings here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in index bae0ce103c..721dc2ae03 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,6 +16,7 @@ PLATFORM_DIR = @PLATFORM_DIR@ CC = @CC@ CPP = @CPP@ +LD = @LD@ YACC = bison PURIFY = AUTOCONF = autoconf @@ -70,6 +71,8 @@ DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG) SOLIBS = @SOLIBS@ MAINLIBS = @MAINLIBS@ ARCHMINIOBJS = @MINIOBJS@ +ENCOBJS = @ENCOBJS@ +EXTOBJS = @EXTOBJS@ BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@ BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@ BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@ @@ -175,7 +178,7 @@ miniruby$(EXEEXT): $(PROGRAM): @$(RM) $@ $(ECHO) linking $@ - $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@ + $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(ENCOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@ $(Q) $(POSTLINK) # We must `rm' the library each time this rule is invoked because "updating" a @@ -186,8 +189,9 @@ $(LIBRUBY_A): $(ECHO) linking static-library $@ $(Q) $(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT) @-$(RANLIB) $@ 2> /dev/null || true + $(ECHO) verifying static-library $@ @$(PURIFY) $(CC) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT) $(LDFLAGS) - @$(RM) conftest$(EXEEXT) + @$(RM) conftset$(EXEEXT) conftest.c $(LIBRUBY_SO): @-$(PRE_LIBRUBY_UPDATE) @@ -311,7 +315,8 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd $(Q) $(CPP) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@ clean-local:: - $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output + $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \ + enc/encinit.c enc/encinit.$(OBJEXT) -$(Q)$(RM) $(pkgconfig_DATA) distclean-local:: @@ -335,8 +340,10 @@ clean-ext distclean-ext realclean-ext:: $(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \ esac; \ done + -$(Q)$(RM) ext/extinit.$(OBJEXT) distclean-ext realclean-ext:: + -$(Q)$(RM) ext/extinit.c -$(Q)$(RMDIR) ext 2> /dev/null || true clean-extout: @@ -362,6 +369,8 @@ ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP) $(ECHO) compiling $@ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c +enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP) + up:: @$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP) |