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:
parent
97c0e2c0cd
commit
d54331b0af
3 changed files with 22 additions and 9 deletions
|
@ -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>
|
||||
|
||||
* win32/Makefile.sub (miniruby): shouldn't link $(EXTOBJS).
|
||||
|
|
|
@ -41,7 +41,7 @@ require 'find'
|
|||
require 'ftools'
|
||||
require 'shellwords'
|
||||
|
||||
$topdir = $hdrdir = File.expand_path(".")
|
||||
$topdir = File.expand_path(".")
|
||||
$top_srcdir = srcdir
|
||||
|
||||
Object.class_eval do remove_method :create_makefile end
|
||||
|
@ -374,6 +374,7 @@ def extmake(target)
|
|||
$CPPFLAGS = CONFIG['CPPFLAGS']
|
||||
$LDFLAGS = ""
|
||||
$LIBPATH = [$libdir]
|
||||
$INCFLAGS = "-I#{$topdir}"
|
||||
|
||||
dir_config("opt")
|
||||
|
||||
|
|
21
lib/mkmf.rb
21
lib/mkmf.rb
|
@ -68,7 +68,7 @@ else
|
|||
STDERR.print "can't find header files for ruby.\n"
|
||||
exit 1
|
||||
end
|
||||
$topdir = $top_srcdir = $hdrdir
|
||||
$topdir = $hdrdir
|
||||
# $hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32|bccwin32/
|
||||
|
||||
CFLAGS = CONFIG["CFLAGS"]
|
||||
|
@ -89,9 +89,9 @@ else
|
|||
CPPOUTFILE = '-o conftest.i'
|
||||
end
|
||||
|
||||
$LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %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"
|
||||
$CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %s %s conftest.c"
|
||||
$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} %s #{CFLAGS} %s %s conftest.c"
|
||||
$CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} %s #{CFLAGS} %s %s %s conftest.c"
|
||||
|
||||
def rm_f(*files)
|
||||
targets = []
|
||||
|
@ -175,7 +175,7 @@ def try_link0(src, opt="")
|
|||
$LIBPATH.each {|d| $LDFLAGS << " -L" + d}
|
||||
end
|
||||
begin
|
||||
xsystem(format($LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
|
||||
xsystem(format($LINK, $INCFLAGS, $CPPFLAGS, $CFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
|
||||
ensure
|
||||
$LDFLAGS = ldflags
|
||||
ENV['LIB'] = ORIG_LIBPATH if /mswin32|bccwin32/ =~ RUBY_PLATFORM
|
||||
|
@ -198,7 +198,7 @@ def try_compile(src, opt="")
|
|||
cfile.print src
|
||||
cfile.close
|
||||
begin
|
||||
xsystem(format($CC, $CPPFLAGS, $CFLAGS, opt))
|
||||
xsystem(format($CC, $INCFLAGS, $CPPFLAGS, $CFLAGS, opt))
|
||||
ensure
|
||||
rm_f "conftest*"
|
||||
end
|
||||
|
@ -209,7 +209,7 @@ def try_cpp(src, opt="")
|
|||
cfile.print src
|
||||
cfile.close
|
||||
begin
|
||||
xsystem(format($CPP, $CPPFLAGS, $CFLAGS, CPPOUTFILE, opt))
|
||||
xsystem(format($CPP, $INCFLAGS, $CPPFLAGS, $CFLAGS, CPPOUTFILE, opt))
|
||||
ensure
|
||||
rm_f "conftest*"
|
||||
end
|
||||
|
@ -220,7 +220,7 @@ def egrep_cpp(pat, src, opt="")
|
|||
cfile.print src
|
||||
cfile.close
|
||||
begin
|
||||
xpopen(format($CPP, $CFLAGS, $CPPFLAGS, '', opt)) do |f|
|
||||
xpopen(format($CPP, $INCFLAGS, $CPPFLAGS, $CFLAGS, '', opt)) do |f|
|
||||
if Regexp === pat
|
||||
puts(" ruby -ne 'print if /#{pat.source}/'")
|
||||
f.grep(pat) {|l|
|
||||
|
@ -335,6 +335,7 @@ def have_library(lib, func="main")
|
|||
return true
|
||||
end
|
||||
r = try_link(<<"SRC", libs)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
int main() { return 0; }
|
||||
|
@ -342,6 +343,7 @@ int t() { #{func}(); return 0; }
|
|||
SRC
|
||||
unless r
|
||||
r = try_link(<<"SRC", libs)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
int main() { return 0; }
|
||||
|
@ -395,6 +397,7 @@ def have_func(func, header=nil)
|
|||
src =
|
||||
if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM
|
||||
r = <<"SRC"
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
SRC
|
||||
|
@ -445,6 +448,7 @@ def have_struct_member(type, member, header=nil)
|
|||
src =
|
||||
if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM
|
||||
r = <<"SRC"
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
SRC
|
||||
|
@ -856,6 +860,7 @@ $CFLAGS = with_config("cflags", arg_config("CFLAGS", ""))
|
|||
$CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", ""))
|
||||
$LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", ""))
|
||||
$LIBPATH = []
|
||||
$INCFLAGS = ""
|
||||
|
||||
dir_config("opt")
|
||||
|
||||
|
|
Loading…
Reference in a new issue