ruby-changes:43565
From: usa <ko1@a...>
Date: Tue, 12 Jul 2016 01:30:08 +0900 (JST)
Subject: [ruby-changes:43565] usa:r55638 (trunk): * configure.in, lib/mkmf.rb, win32/Makefile.sub (CSRCFLAG): make the
usa 2016-07-12 01:30:03 +0900 (Tue, 12 Jul 2016) New Revision: 55638 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55638 Log: * configure.in, lib/mkmf.rb, win32/Makefile.sub (CSRCFLAG): make the compiler option replacable in Makefile. * win32/Makefile.sub (OUTFLAG, COUTFLAG): ditto. * win32/Makeile.sub, win32/setup.mak (CC): should not append `-nologo` option forcely. Modified files: trunk/ChangeLog trunk/configure.in trunk/lib/mkmf.rb trunk/win32/Makefile.sub trunk/win32/setup.mak Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 55637) +++ lib/mkmf.rb (revision 55638) @@ -250,6 +250,7 @@ module MakeMakefile https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L250 OUTFLAG = CONFIG['OUTFLAG'] COUTFLAG = CONFIG['COUTFLAG'] + CSRCFLAG = CONFIG['CSRCFLAG'] CPPOUTFILE = config_string('CPPOUTFILE') {|str| str.sub(/\bconftest\b/, CONFTEST)} def rm_f(*files) @@ -1965,6 +1966,7 @@ LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1966 empty = OUTFLAG = #{OUTFLAG}$(empty) COUTFLAG = #{COUTFLAG}$(empty) +CSRCFLAG = #{CSRCFLAG}$(empty) RUBY_EXTCONF_H = #{$extconf_h} cflags = #{CONFIG['cflags']} @@ -2656,12 +2658,12 @@ MESSAGE https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2658 ## # Command which will compile C files in the generated Makefile - COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<' + COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<' ## # Command which will compile C++ files in the generated Makefile - COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<' + COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<' ## # Command which will translate C files to assembler sources in the generated Makefile Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 55637) +++ win32/Makefile.sub (revision 55638) @@ -65,7 +65,7 @@ iconinc=-I$(icondirs: = -I) https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L65 .SUFFIXES: .def .lib !if !defined(CC) -CC = cl +CC = cl -nologo !endif !if !defined(CPP) || "$(CPP)" == "cl" CPP = $(CC) -E @@ -200,8 +200,15 @@ DOCTARGETS = nodoc https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L200 ! endif !endif +!if !defined(OUTFLAG) OUTFLAG = -Fe +!endif +!if !defined(COUTFLAG) COUTFLAG = -Fo +!endif +!if !defined(CSRCFLAG) +CSRCFLAG = -Tc +!endif !if !defined(RUNTIMEFLAG) RUNTIMEFLAG = -MD !endif @@ -256,7 +263,6 @@ MISSING = $(MISSING) explicit_bzero.obj https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L263 DLNOBJ = dln.obj ARFLAGS = -machine:$(MACHINE) -out: -CC = $(CC) -nologo LD = $(CC) LDSHARED = $(LD) -LD XCFLAGS = -DRUBY_EXPORT -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(srcdir)/missing $(XCFLAGS) @@ -906,6 +912,7 @@ s,@ENABLE_SHARED@,yes,;t t https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L912 s,@BASERUBY@,$(BASERUBY),;t t s,@OUTFLAG@,$(OUTFLAG),;t t s,@COUTFLAG@,$(COUTFLAG),;t t +s,@CSRCFLAG@,$(CSRCFLAG),;t t s,@CPPOUTFILE@,-P,;t t s,@LIBPATHFLAG@, -libpath:%s,;t t s,@RPATHFLAG@,,;t t @@ -916,9 +923,9 @@ s,@LINK_SO@,@if exist $$(@).manifest $$( https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L923 s,@LINK_SO@,@if exist $$(@).manifest $(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t s,@LINK_SO@,@if exist $$(@).manifest $$(RM) $$(@:/=\).manifest,;t t !endif -s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c -Tc$$(<:\=/),;t t +s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c $$(CSRCFLAG)$$(<:\=/),;t t s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c -Tp$$(<:\=/),;t t -s,@ASSEMBLE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -Fa$$(@) -c -Tc$$(<:\=/),;t t +s,@ASSEMBLE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -Fa$$(@) -c $$(CSRCFLAG)$$(<:\=/),;t t s,@ASSEMBLE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -Fa$$(@) -c -Tp$$(<:\=/),;t t s,@COMPILE_RULES@,{$$(*VPATH*)}.%s.%s: .%s.%s:,;t t s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t @@ -1087,48 +1094,48 @@ $(ruby_pc): $(RBCONFIG) https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1094 {$(srcdir)/enc/trans}.c.obj: $(ECHO) compiling $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/) {$(srcdir)/enc}.c.obj: $(ECHO) compiling $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/) {$(srcdir)/missing}.c.obj: $(ECHO) compiling $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/) {$(win_srcdir)}.c.obj: $(ECHO) compiling $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/) {$(srcdir)}.c{}.obj: $(ECHO) compiling $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/) .c.obj: $(ECHO) compiling $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(<:\=/) {$(srcdir)/missing}.c.asm: $(ECHO) translating $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/) {$(win_srcdir)}.c.asm: $(ECHO) translating $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/) {$(srcdir)}.c{}.asm: $(ECHO) translating $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/) .c.asm: $(ECHO) translating $(<:\=/) - $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c -Tc$(<:\=/) + $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -Fa$@ -c $(CSRCFLAG)$(<:\=/) {$(srcdir)/missing}.c.i: $(ECHO) preprocessing $(<:\=/) - $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Tc$(<:\=/) > $@ + $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P $(CSRCFLAG)$(<:\=/) > $@ {$(win_srcdir)}.c.i: $(ECHO) preprocessing $(<:\=/) - $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Tc$(<:\=/) + $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P $(CSRCFLAG)$(<:\=/) {$(srcdir)}.c{}.i: $(ECHO) preprocessing $(<:\=/) - $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Tc$(<:\=/) + $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P $(CSRCFLAG)$(<:\=/) .c.i: $(ECHO) preprocessing $(<:\=/) - $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P -Tc$(<:\=/) + $(Q) $(CC) $(XCFLAGS) $(CPPFLAGS) -P $(CSRCFLAG)$(<:\=/) .rc.res: $(ECHO) compiling $(<:\=/) Index: win32/setup.mak =================================================================== --- win32/setup.mak (revision 55637) +++ win32/setup.mak (revision 55638) @@ -212,13 +212,14 @@ MACHINE = x86 https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L212 # RUBY_INSTALL_NAME = ruby # RUBY_SO_NAME = $$(RT)-$$(RUBY_INSTALL_NAME)$$(MAJOR)$$(MINOR) -# CFLAGS = -nologo -MD $$(DEBUGFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) -# CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)/missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\" +# CFLAGS = $$(RUNTIMEFLAG) $$(DEBUGFLAGS) $$(WARNFLAGS) $$(OPTFLAGS) $$(PROCESSOR_FLAG) $$(COMPILERFLAG) +# CPPFLAGS = # STACK = 0x2000000 # LDFLAGS = $$(CFLAGS) -Fm # XLDFLAGS = # RFLAGS = -r # EXTLIBS = +CC = cl -nologo $(BANG)include $$(srcdir)/win32/Makefile.sub << Index: configure.in =================================================================== --- configure.in (revision 55637) +++ configure.in (revision 55638) @@ -524,8 +524,10 @@ RUBY_CPPOUTFILE https://github.com/ruby/ruby/blob/trunk/configure.in#L524 : ${OUTFLAG='-o '} : ${COUTFLAG=${OUTFLAG}} +: ${CSRCFLAG=''} AC_SUBST(OUTFLAG) AC_SUBST(COUTFLAG) +AC_SUBST(CSRCFLAG) cc_version= for option in --version -v -V -qversion; do Index: ChangeLog =================================================================== --- ChangeLog (revision 55637) +++ ChangeLog (revision 55638) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jul 12 01:25:09 2016 NAKAMURA Usaku <usa@r...> + + * configure.in, lib/mkmf.rb, win32/Makefile.sub (CSRCFLAG): make the + compiler option replacable in Makefile. + + * win32/Makefile.sub (OUTFLAG, COUTFLAG): ditto. + + * win32/Makeile.sub, win32/setup.mak (CC): should not append `-nologo` + option forcely. + Mon Jul 11 18:05:40 2016 Martin Duerst <duerst@i...> * enc/iso_8859_1.c: Moved test for lowercase characters without -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/