summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-11 16:30:03 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-11 16:30:03 +0000
commit5e1ee25ad88ea9e89966a9156a8b7d3353f81de2 (patch)
treee269d84b4790c5e77d11b1a97ca46c8f7b60d84c
parent90985c411919bbc4ca197d400fb3e47f9195a389 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--configure.in2
-rw-r--r--lib/mkmf.rb6
-rw-r--r--win32/Makefile.sub43
-rw-r--r--win32/setup.mak5
5 files changed, 44 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index d8c5901bc2b..1232a33a885 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Jul 12 01:25:09 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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@it.aoyama.ac.jp>
* enc/iso_8859_1.c: Moved test for lowercase characters without
diff --git a/configure.in b/configure.in
index 580e5d11ba1..da0fc549975 100644
--- a/configure.in
+++ b/configure.in
@@ -524,8 +524,10 @@ RUBY_CPPOUTFILE
: ${OUTFLAG='-o '}
: ${COUTFLAG=${OUTFLAG}}
+: ${CSRCFLAG=''}
AC_SUBST(OUTFLAG)
AC_SUBST(COUTFLAG)
+AC_SUBST(CSRCFLAG)
cc_version=
for option in --version -v -V -qversion; do
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 3e517614dcf..d00ebd669ab 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -250,6 +250,7 @@ module MakeMakefile
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
empty =
OUTFLAG = #{OUTFLAG}$(empty)
COUTFLAG = #{COUTFLAG}$(empty)
+CSRCFLAG = #{CSRCFLAG}$(empty)
RUBY_EXTCONF_H = #{$extconf_h}
cflags = #{CONFIG['cflags']}
@@ -2656,12 +2658,12 @@ MESSAGE
##
# 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
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index d2f89eea5fa..c8692888ad3 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -65,7 +65,7 @@ iconinc=-I$(icondirs: = -I)
.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
! 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
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
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 $$(RUBY) -run -e wait_writable -- -n 10 $$(
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)
{$(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 $(<:\=/)
diff --git a/win32/setup.mak b/win32/setup.mak
index b023f8df918..78683fedda0 100644
--- a/win32/setup.mak
+++ b/win32/setup.mak
@@ -212,13 +212,14 @@ MACHINE = x86
# 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
<<