From c611b6d0cc50af72847ddb7c1d0f31aa3b18da25 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 17 Dec 2007 17:30:57 +0000 Subject: [PATCH] * configure.in (BUILTIN_ENCS): removed. * common.mk (enc.mk): pass BUILTIN_ENCS from command line. * enc/depend: ditto. * enc/make_encmake.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ common.mk | 2 +- configure.in | 3 --- enc/depend | 2 +- enc/make_encmake.rb | 9 ++++++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1252c37811..03c46b6211 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Dec 18 02:30:56 2007 Nobuyoshi Nakada + + * configure.in (BUILTIN_ENCS): removed. + + * common.mk (enc.mk): pass BUILTIN_ENCS from command line. + + * enc/depend: ditto. + + * enc/make_encmake.rb: ditto. + Tue Dec 18 01:46:48 2007 Yukihiro Matsumoto * sprintf.c (rb_str_format): need to clear output buffer to avoid diff --git a/common.mk b/common.mk index 48afbf7b00..4a94e9d123 100644 --- a/common.mk +++ b/common.mk @@ -344,7 +344,7 @@ encs: enc.mk enc.mk: miniruby$(EXEEXT) $(srcdir)/enc/make_encmake.rb \ $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend $(srcdir)/lib/mkmf.rb - $(MINIRUBY) $(srcdir)/enc/make_encmake.rb $@ + $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" $@ .PRECIOUS: $(MKFILES) diff --git a/configure.in b/configure.in index a89ef89d65..2ac140e334 100644 --- a/configure.in +++ b/configure.in @@ -1738,11 +1738,8 @@ tr -d '\015' < largefile.h > confdefs.h BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[ ]*=/{' \ -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \ -e '}' "${srcdir}/enc/Makefile.in"`"] -BUILTIN_ENCS="`echo $BUILTIN_ENCS`" BUILTIN_ENCOBJS= for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS `basename $e .c`"'.$(OBJEXT)'; done - -AC_SUBST(BUILTIN_ENCS) AC_SUBST(BUILTIN_ENCOBJS) AC_CONFIG_FILES($FIRSTMAKEFILE) diff --git a/enc/depend b/enc/depend index 8fc836daff..b115a8a426 100644 --- a/enc/depend +++ b/enc/depend @@ -1,4 +1,4 @@ -! encs = (Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - CONFIG["BUILTIN_ENCS"].split).each {|e| e.chomp!(".c")} +! encs = (Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS).each {|e| e.chomp!(".c")} VPATH = <% %w[$(arch_hdrdir)/ruby $(hdrdir)/ruby $(top_srcdir) $(srcdir)].join(CONFIG["PATH_SEPARATOR"]) %> diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb index 593f8ba626..c20920168c 100644 --- a/enc/make_encmake.rb +++ b/enc/make_encmake.rb @@ -7,6 +7,13 @@ $:.unshift(".") require 'mkmf' require 'tool/serb' +if /--builtin-encs=/ =~ ARGV[0] + BUILTIN_ENCS = $'.split.each {|e| e.sub!(/(?:\.\w+)?\z/, '.c')} + ARGV.shift +else + BUILTIN_ENCS = [] +end + mkin = File.read(File.join($srcdir, "Makefile.in")) mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]} if File.exist?(depend = File.join($srcdir, "depend")) @@ -14,6 +21,6 @@ if File.exist?(depend = File.join($srcdir, "depend")) eval(serb(File.read(depend), 'tmp')) mkin << "\n#### depend ####\n\n" << depend_rules(tmp).join end -open(ARGV[0], 'w') {|f| +open(ARGV[0], 'wb') {|f| f.puts mkin }