summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in1
-rw-r--r--lib/mkmf.rb25
-rw-r--r--win32/Makefile.sub3
3 files changed, 26 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index 5f4fd0af8c..f4651324fe 100644
--- a/configure.in
+++ b/configure.in
@@ -2786,6 +2786,7 @@ AC_SUBST(LDSHAREDXX)dnl
AC_SUBST(DLEXT)dnl
AC_SUBST(DLEXT2)dnl
AC_SUBST(LIBEXT)dnl
+AC_SUBST(ASMEXT, S)dnl
STATIC=
: ${PATHFLAG=''}
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 2a83189e30..cb66d88ccc 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2358,20 +2358,28 @@ site-install-rb: install-rb
return unless target
mfile.puts SRC_EXT.collect {|e| ".path.#{e} = $(VPATH)"} if $nmake == ?b
- mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
+ mfile.print ".SUFFIXES: .#{(SRC_EXT + [$OBJEXT, $ASMEXT]).compact.join(' .')}\n"
mfile.print "\n"
compile_command = "\n\t$(ECHO) compiling $(<#{rsep})\n\t$(Q) %s\n\n"
+ command = compile_command % COMPILE_CXX
+ asm_command = compile_command.sub(/compiling/, 'translating') % ASSEMBLE_CXX
CXX_EXT.each do |e|
each_compile_rules do |rule|
mfile.printf(rule, e, $OBJEXT)
- mfile.printf(compile_command, COMPILE_CXX)
+ mfile.print(command)
+ mfile.printf(rule, e, $ASMEXT)
+ mfile.print(asm_command)
end
end
+ command = compile_command % COMPILE_C
+ asm_command = compile_command.sub(/compiling/, 'translating') % ASSEMBLE_C
C_EXT.each do |e|
each_compile_rules do |rule|
mfile.printf(rule, e, $OBJEXT)
- mfile.printf(compile_command, COMPILE_C)
+ mfile.print(command)
+ mfile.printf(rule, e, $ASMEXT)
+ mfile.print(asm_command)
end
end
@@ -2444,6 +2452,7 @@ site-install-rb: install-rb
$LIBEXT = config['LIBEXT'].dup
$OBJEXT = config["OBJEXT"].dup
$EXEEXT = config["EXEEXT"].dup
+ $ASMEXT = config_string('ASMEXT', &:dup) || 'S'
$LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
$LIBRUBYARG = ""
$LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']
@@ -2592,6 +2601,16 @@ MESSAGE
COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
##
+ # Command which will translate C files to assembler sources in the generated Makefile
+
+ ASSEMBLE_C = config_string('ASSEMBLE_C') || COMPILE_C.sub(/(?<=\s)-c(?=\s)/, '-S')
+
+ ##
+ # Command which will translate C++ files to assembler sources in the generated Makefile
+
+ ASSEMBLE_CXX = config_string('ASSEMBLE_CXX') || COMPILE_CXX.sub(/(?<=\s)-c(?=\s)/, '-S')
+
+ ##
# Command which will compile a program in order to test linking a library
TRY_LINK = config_string('TRY_LINK') ||
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 1d515233e0..d2c1f8f5bb 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -829,6 +829,7 @@ s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
s,@EXEEXT@,.exe,;t t
s,@EXECUTABLE_EXTS@,$(EXECUTABLE_EXTS),;t t
s,@OBJEXT@,$(OBJEXT),;t t
+s,@ASMEXT@,$(ASMEXT),;t t
s,@XCFLAGS@,$(XCFLAGS),;t t
s,@XLDFLAGS@,$(XLDFLAGS),;t t
s,@DLDFLAGS@,$(DLDFLAGS) $$(LIBPATH),;t t
@@ -880,6 +881,8 @@ 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_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) $$(COUTFLAG)$$(@) -c -Tp$$(<:\=/),;t t
+s,@ASSEMBLE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -Fa$$(@) -c -Tc$$(<:\=/),;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
s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t