summaryrefslogtreecommitdiff
path: root/ext/extmk.rb.in
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-09 07:41:44 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-09 07:41:44 +0000
commita5c0e5a382d577b900c9a49fa09547dbf602e16c (patch)
tree30c1de7503dcad76dccfe713f2a7894277cf0150 /ext/extmk.rb.in
parent53a2b14909a271e54c1e5d771075be608e37fb15 (diff)
* ext/extmk.rb.in: Use -F and -T for mswin32 because cl.exe doesn't support -o officially and cl.exe considers that *.cc and *.cxx are OBJs.
* lib/mkmf.rb: ditto. * win32/Makefile.sub: Use del instead of rm. All these changes are derived from Nobuyoshi Nakada's patch. Thanks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb.in')
-rw-r--r--ext/extmk.rb.in50
1 files changed, 30 insertions, 20 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 388edd0..a88a9ea 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -68,7 +68,12 @@ if RUBY_PLATFORM == "m68k-human"
else
CFLAGS = "@CFLAGS@"
end
-LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
+if /mswin32/ =~ RUBY_PLATFORM
+ OUTFLAG = '-Fe'
+else
+ OUTFLAG = '-o '
+end
+LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c"
$log = open('extmk.log', 'w')
@@ -496,44 +501,49 @@ EOS
install_rb(mfile, $srcdir)
mfile.printf "\n"
- unless /nmake/i =~ $make
- unless /mswin32/ =~ RUBY_PLATFORM
- src = '$<'
+ unless /mswin32/ =~ RUBY_PLATFORM
+ src = '$<'
+ copt = cxxopt = ''
+ else
+ if /nmake/i =~ $make
+ src = '$(<:\\=/)'
else
src = '$(subst /,\\\\,$<)'
end
+ copt = '-Tc'
+ cxxopt = '-Tp'
+ end
+ unless /nmake/i =~ $make
mfile.puts "
.cc.@OBJEXT@:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src}
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
.cpp.@OBJEXT@:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src}
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
.cxx.@OBJEXT@:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src}
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
.C.@OBJEXT@:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{src}
-
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
.c.@OBJEXT@:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c #{src}
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src}
"
else
mfile.print "
{$(srcdir)}.c{}.@OBJEXT@:
- $(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+ $(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src}
.c.@OBJEXT@:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
-
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c #{copt}#{src}
{$(srcdir)}.cc{}.@OBJEXT@:
- $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+ $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
.cc.@OBJEXT@:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
{$(srcdir)}.cpp{}.@OBJEXT@:
- $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+ $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
.cpp.@OBJEXT@:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
{$(srcdir)}.cxx{}.@OBJEXT@:
- $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+ $(CXX) -I. -I$(<D) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
.cxx.@OBJEXT@:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<:/=\\)
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c #{cxxopt}#{src}
"
end
@@ -559,7 +569,7 @@ $(DLLIB): $(OBJS)
mfile.print "\tenv LIB='$(subst /,\\\\,$(LIBPATH));$(LIB)' \\\n"
end
end
- mfile.print "\t$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n"
+ mfile.print "\t$(LDSHARED) $(DLDFLAGS) #{OUTFLAG}$(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n"
elsif RUBY_PLATFORM == "m68k-human"
mfile.printf "\
$(DLLIB): $(OBJS)