1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/extmk.rb, lib/mkmf.rb ($INCFLAGS): new var for -I$(topdir).

* lib/mkmf.rb: add #define WIN32_LEAN_AND_MEAN to improve compile
  times.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2002-09-10 09:30:50 +00:00
parent 97c0e2c0cd
commit d54331b0af
3 changed files with 22 additions and 9 deletions

View file

@ -1,3 +1,10 @@
Tue Sep 10 18:26:52 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/extmk.rb, lib/mkmf.rb ($INCFLAGS): new var for -I$(topdir).
* lib/mkmf.rb: add #define WIN32_LEAN_AND_MEAN to improve compile
times.
Tue Sep 10 17:16:14 2002 NAKAMURA Usaku <usa@ruby-lang.org> Tue Sep 10 17:16:14 2002 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub (miniruby): shouldn't link $(EXTOBJS). * win32/Makefile.sub (miniruby): shouldn't link $(EXTOBJS).

View file

@ -41,7 +41,7 @@ require 'find'
require 'ftools' require 'ftools'
require 'shellwords' require 'shellwords'
$topdir = $hdrdir = File.expand_path(".") $topdir = File.expand_path(".")
$top_srcdir = srcdir $top_srcdir = srcdir
Object.class_eval do remove_method :create_makefile end Object.class_eval do remove_method :create_makefile end
@ -374,6 +374,7 @@ def extmake(target)
$CPPFLAGS = CONFIG['CPPFLAGS'] $CPPFLAGS = CONFIG['CPPFLAGS']
$LDFLAGS = "" $LDFLAGS = ""
$LIBPATH = [$libdir] $LIBPATH = [$libdir]
$INCFLAGS = "-I#{$topdir}"
dir_config("opt") dir_config("opt")

View file

@ -68,7 +68,7 @@ else
STDERR.print "can't find header files for ruby.\n" STDERR.print "can't find header files for ruby.\n"
exit 1 exit 1
end end
$topdir = $top_srcdir = $hdrdir $topdir = $hdrdir
# $hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32|bccwin32/ # $hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32|bccwin32/
CFLAGS = CONFIG["CFLAGS"] CFLAGS = CONFIG["CFLAGS"]
@ -89,9 +89,9 @@ else
CPPOUTFILE = '-o conftest.i' CPPOUTFILE = '-o conftest.i'
end end
$LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}" $LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest %s -I#{$hdrdir} %s #{CFLAGS} %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
$CC = "#{CONFIG['CC']} -c #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %s conftest.c" $CC = "#{CONFIG['CC']} -c #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} %s #{CFLAGS} %s %s conftest.c"
$CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %s %s conftest.c" $CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} %s #{CFLAGS} %s %s %s conftest.c"
def rm_f(*files) def rm_f(*files)
targets = [] targets = []
@ -175,7 +175,7 @@ def try_link0(src, opt="")
$LIBPATH.each {|d| $LDFLAGS << " -L" + d} $LIBPATH.each {|d| $LDFLAGS << " -L" + d}
end end
begin begin
xsystem(format($LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS)) xsystem(format($LINK, $INCFLAGS, $CPPFLAGS, $CFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
ensure ensure
$LDFLAGS = ldflags $LDFLAGS = ldflags
ENV['LIB'] = ORIG_LIBPATH if /mswin32|bccwin32/ =~ RUBY_PLATFORM ENV['LIB'] = ORIG_LIBPATH if /mswin32|bccwin32/ =~ RUBY_PLATFORM
@ -198,7 +198,7 @@ def try_compile(src, opt="")
cfile.print src cfile.print src
cfile.close cfile.close
begin begin
xsystem(format($CC, $CPPFLAGS, $CFLAGS, opt)) xsystem(format($CC, $INCFLAGS, $CPPFLAGS, $CFLAGS, opt))
ensure ensure
rm_f "conftest*" rm_f "conftest*"
end end
@ -209,7 +209,7 @@ def try_cpp(src, opt="")
cfile.print src cfile.print src
cfile.close cfile.close
begin begin
xsystem(format($CPP, $CPPFLAGS, $CFLAGS, CPPOUTFILE, opt)) xsystem(format($CPP, $INCFLAGS, $CPPFLAGS, $CFLAGS, CPPOUTFILE, opt))
ensure ensure
rm_f "conftest*" rm_f "conftest*"
end end
@ -220,7 +220,7 @@ def egrep_cpp(pat, src, opt="")
cfile.print src cfile.print src
cfile.close cfile.close
begin begin
xpopen(format($CPP, $CFLAGS, $CPPFLAGS, '', opt)) do |f| xpopen(format($CPP, $INCFLAGS, $CPPFLAGS, $CFLAGS, '', opt)) do |f|
if Regexp === pat if Regexp === pat
puts(" ruby -ne 'print if /#{pat.source}/'") puts(" ruby -ne 'print if /#{pat.source}/'")
f.grep(pat) {|l| f.grep(pat) {|l|
@ -335,6 +335,7 @@ def have_library(lib, func="main")
return true return true
end end
r = try_link(<<"SRC", libs) r = try_link(<<"SRC", libs)
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
int main() { return 0; } int main() { return 0; }
@ -342,6 +343,7 @@ int t() { #{func}(); return 0; }
SRC SRC
unless r unless r
r = try_link(<<"SRC", libs) r = try_link(<<"SRC", libs)
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
int main() { return 0; } int main() { return 0; }
@ -395,6 +397,7 @@ def have_func(func, header=nil)
src = src =
if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM
r = <<"SRC" r = <<"SRC"
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
SRC SRC
@ -445,6 +448,7 @@ def have_struct_member(type, member, header=nil)
src = src =
if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM
r = <<"SRC" r = <<"SRC"
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
SRC SRC
@ -856,6 +860,7 @@ $CFLAGS = with_config("cflags", arg_config("CFLAGS", ""))
$CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", "")) $CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", ""))
$LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", "")) $LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", ""))
$LIBPATH = [] $LIBPATH = []
$INCFLAGS = ""
dir_config("opt") dir_config("opt")