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

* configure.in (OUTFLAG, CPPOUTFILE): moved from lib/mkmf.rb.

check whether ${CPP} accepts the -o option.
* win32/Makefile.sub (OUTFLAG, CPPOUTFILE): ditto.
* bcc32/Makefile.sub (OUTFLAG, CPPOUTFILE): ditto.
* djgpp/config.sed (OUTFLAG, CPPOUTFILE): ditto.
* lib/mkmf.rb (OUTFLAG, CPPOUTFILE): use CONFIG.
  make easy to understand log.
* mkconfig.rb (val): should not strip.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2002-09-15 12:57:21 +00:00
parent aa904b2050
commit ce296ec7fc
7 changed files with 72 additions and 17 deletions

View file

@ -1,3 +1,19 @@
Sun Sep 15 19:48:55 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (OUTFLAG, CPPOUTFILE): moved from lib/mkmf.rb.
check whether ${CPP} accepts the -o option.
* win32/Makefile.sub (OUTFLAG, CPPOUTFILE): ditto.
* bcc32/Makefile.sub (OUTFLAG, CPPOUTFILE): ditto.
* djgpp/config.sed (OUTFLAG, CPPOUTFILE): ditto.
* lib/mkmf.rb (OUTFLAG, CPPOUTFILE): use CONFIG.
make easy to understand log.
* mkconfig.rb (val): should not strip.
Sat Sep 14 20:13:42 2002 KONISHI Hiromasa <konishih@fd6.so-net.ne.jp> Sat Sep 14 20:13:42 2002 KONISHI Hiromasa <konishih@fd6.so-net.ne.jp>
* error.c(rb_sys_fail): remove case EPIPE on bcc32 . * error.c(rb_sys_fail): remove case EPIPE on bcc32 .

View file

@ -338,6 +338,8 @@ s,@LIBRUBYARG@,$$(RUBY_SO_NAME).lib,;t t
s,@SOLIBS@,$(SOLIBS),;t t s,@SOLIBS@,$(SOLIBS),;t t
s,@DLDLIBS@,$(DLDLIBS),;t t s,@DLDLIBS@,$(DLDLIBS),;t t
s,@ENABLE_SHARED@,yes,;t t s,@ENABLE_SHARED@,yes,;t t
s,@OUTFLAG@,-o,;t t
s,@CPPOUTFILE@,,;t t
s,@arch@,$(ARCH)-$(OS),;t t s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(OS),;t t s,@sitearch@,$(ARCH)-$(OS),;t t
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t

View file

@ -98,6 +98,16 @@ fi
AC_PROG_CC AC_PROG_CC
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
echo 'foo(){}' > conftest.c
if ${CPP} -o conftest.i conftest.c >/dev/null 2>&1; then
CPPOUTFILE='-o conftest.i'
else
CPPOUTFILE='> conftest.i'
fi
AC_SUBST(CPPOUTFILE)
OUTFLAG='-o '
AC_SUBST(OUTFLAG)
AC_PROG_YACC AC_PROG_YACC
AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(AR, ar)

View file

@ -65,6 +65,8 @@ s%@arch@%i386-msdosdjgpp%g
s%@sitedir@%${prefix}/lib/ruby/site_ruby%g s%@sitedir@%${prefix}/lib/ruby/site_ruby%g
s%@configure_args@%%g s%@configure_args@%%g
s%@MINIRUBY@%./miniruby% s%@MINIRUBY@%./miniruby%
s%@OUTFLAG@%-o %
s%@CPPOUTFILE@%-o conftest.i%
s%@archlib@%/lib/ruby/i386-msdosdjgpp% s%@archlib@%/lib/ruby/i386-msdosdjgpp%
;s%|| true%% ;s%|| true%%
;/\/dev\/null/ { ;/\/dev\/null/ {

View file

@ -13,7 +13,7 @@ SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
unless defined? $configure_args unless defined? $configure_args
$configure_args = {} $configure_args = {}
args = CONFIG["configure_args"] args = CONFIG["configure_args"]
if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM and ENV["CONFIGURE_ARGS"] if ENV["CONFIGURE_ARGS"]
args << " " << ENV["CONFIGURE_ARGS"] args << " " << ENV["CONFIGURE_ARGS"]
end end
for arg in Shellwords::shellwords(args) for arg in Shellwords::shellwords(args)
@ -71,7 +71,6 @@ else
exit 1 exit 1
end end
$topdir = $hdrdir $topdir = $hdrdir
# $hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32|bccwin32/
CFLAGS = CONFIG["CFLAGS"] CFLAGS = CONFIG["CFLAGS"]
if RUBY_PLATFORM == "m68k-human" if RUBY_PLATFORM == "m68k-human"
@ -80,21 +79,14 @@ elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody|-darwin/
CFLAGS.gsub!( /-arch\s\w*/, '' ) CFLAGS.gsub!( /-arch\s\w*/, '' )
end end
if /mswin32/ =~ RUBY_PLATFORM OUTFLAG = CONFIG['OUTFLAG']
OUTFLAG = '-Fe' CPPOUTFILE = CONFIG['CPPOUTFILE']
CPPOUTFILE = '-P'
elsif /bccwin32/ =~ RUBY_PLATFORM
OUTFLAG = '-o'
CPPOUTFILE = '-oconftest.i'
else
OUTFLAG = '-o '
CPPOUTFILE = '-o conftest.i'
end
$LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest %s -I#{$hdrdir} %s #{CFLAGS} %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} %s #{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} %s #{CFLAGS} %s %s %s conftest.c" $CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} %s #{CFLAGS} %s %s %s conftest.c"
$INSTALLFILES = nil unless defined? $INSTALLFILES $INSTALLFILES = nil unless defined? $INSTALLFILES
def rm_f(*files) def rm_f(*files)
@ -137,6 +129,11 @@ module Logging
$stdout.reopen(@orgout) $stdout.reopen(@orgout)
end end
def self::message(*s)
@log ||= File::open(@logfile, 'w')
@log.printf(*s)
end
def self::logfile file def self::logfile file
@logfile = file @logfile = file
if @log and not @log.closed? if @log and not @log.closed?
@ -168,6 +165,7 @@ def xpopen command, *mode, &block
end end
def try_link0(src, opt="") def try_link0(src, opt="")
src = "/* begin */\n#{src}/* end */\n"
cfile = open("conftest.c", "w") cfile = open("conftest.c", "w")
cfile.print src cfile.print src
cfile.close cfile.close
@ -183,6 +181,10 @@ def try_link0(src, opt="")
ensure ensure
$LDFLAGS = ldflags $LDFLAGS = ldflags
ENV['LIB'] = ORIG_LIBPATH if /mswin32|bccwin32/ =~ RUBY_PLATFORM ENV['LIB'] = ORIG_LIBPATH if /mswin32|bccwin32/ =~ RUBY_PLATFORM
Logging::message <<"EOM"
checked program was:
#{src}
EOM
end end
end end
@ -198,6 +200,7 @@ def try_link(src, opt="")
end end
def try_compile(src, opt="") def try_compile(src, opt="")
src = "/* begin */\n#{src}/* end */\n"
cfile = open("conftest.c", "w") cfile = open("conftest.c", "w")
cfile.print src cfile.print src
cfile.close cfile.close
@ -205,10 +208,15 @@ def try_compile(src, opt="")
xsystem(format($CC, $INCFLAGS, $CPPFLAGS, $CFLAGS, opt)) xsystem(format($CC, $INCFLAGS, $CPPFLAGS, $CFLAGS, opt))
ensure ensure
rm_f "conftest*" rm_f "conftest*"
Logging::message <<"EOM"
checked program was:
#{src}
EOM
end end
end end
def try_cpp(src, opt="") def try_cpp(src, opt="")
src = "/* begin */\n#{src}/* end */\n"
cfile = open("conftest.c", "w") cfile = open("conftest.c", "w")
cfile.print src cfile.print src
cfile.close cfile.close
@ -216,10 +224,15 @@ def try_cpp(src, opt="")
xsystem(format($CPP, $INCFLAGS, $CPPFLAGS, $CFLAGS, CPPOUTFILE, opt)) xsystem(format($CPP, $INCFLAGS, $CPPFLAGS, $CFLAGS, CPPOUTFILE, opt))
ensure ensure
rm_f "conftest*" rm_f "conftest*"
Logging::message <<"EOM"
checked program was:
#{src}
EOM
end end
end end
def egrep_cpp(pat, src, opt="") def egrep_cpp(pat, src, opt="")
src = "/* begin */\n#{src}/* end */\n"
cfile = open("conftest.c", "w") cfile = open("conftest.c", "w")
cfile.print src cfile.print src
cfile.close cfile.close
@ -245,15 +258,19 @@ def egrep_cpp(pat, src, opt="")
end end
ensure ensure
rm_f "conftest*" rm_f "conftest*"
Logging::message <<"EOM"
checked program was:
#{src}
EOM
end end
end end
def macro_defined?(macro, src, opt="") def macro_defined?(macro, src, opt="")
try_cpp(src + <<EOP, opt) try_cpp(src + <<SRC, opt)
#ifndef #{macro} #ifndef #{macro}
# error # error
#endif #endif
EOP SRC
end end
def try_run(src, opt="") def try_run(src, opt="")
@ -323,13 +340,14 @@ end
def message(*s) def message(*s)
unless $extmk and not $VERBOSE unless $extmk and not $VERBOSE
print(*s) printf(*s)
STDOUT.flush $stdout.flush
end end
end end
def have_library(lib, func="main") def have_library(lib, func="main")
message "checking for #{func}() in -l#{lib}... " message "checking for #{func}() in -l#{lib}... "
Logging::message"checking for #{func}() in -l#{lib}\n"
if func && func != "" if func && func != ""
libs = append_library($libs, lib) libs = append_library($libs, lib)
@ -375,6 +393,7 @@ end
def find_library(lib, func, *paths) def find_library(lib, func, *paths)
message "checking for #{func}() in -l#{lib}... " message "checking for #{func}() in -l#{lib}... "
Logging::message"checking for #{func}() in -l#{lib}\n"
libpath = $LIBPATH libpath = $LIBPATH
libs = append_library($libs, lib) libs = append_library($libs, lib)
@ -396,6 +415,7 @@ end
def have_func(func, header=nil) def have_func(func, header=nil)
message "checking for #{func}()... " message "checking for #{func}()... "
Logging::message"checking for #{func}()\n"
libs = $libs libs = $libs
src = src =
@ -434,6 +454,7 @@ end
def have_header(header) def have_header(header)
message "checking for #{header}... " message "checking for #{header}... "
Logging::message"checking for #{header}\n"
unless try_cpp(<<"SRC") unless try_cpp(<<"SRC")
#include <#{header}> #include <#{header}>
@ -448,6 +469,7 @@ end
def have_struct_member(type, member, header=nil) def have_struct_member(type, member, header=nil)
message "checking for #{type}.#{member}... " message "checking for #{type}.#{member}... "
Logging::message "checking for #{type}.#{member}\n"
src = src =
if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM if /mswin32|bccwin32|mingw/ =~ RUBY_PLATFORM
@ -483,6 +505,7 @@ end
def find_executable(bin, path = nil) def find_executable(bin, path = nil)
message "checking for #{bin}... " message "checking for #{bin}... "
Logging::message "checking for #{bin}\n"
if path.nil? if path.nil?
path = ENV['PATH'].split(Config::CONFIG['PATH_SEPARATOR']) path = ENV['PATH'].split(Config::CONFIG['PATH_SEPARATOR'])

View file

@ -41,7 +41,7 @@ File.foreach "config.status" do |line|
next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name
next if $so_name and /^RUBY_SO_NAME$/ =~ name next if $so_name and /^RUBY_SO_NAME$/ =~ name
v = " CONFIG[\"" + name + "\"] = " + v = " CONFIG[\"" + name + "\"] = " +
val.strip.gsub(/\$\{?(\w+)\}?/) {"$(#{$1})"}.dump + "\n" val.gsub(/\$\{?(\w+)\}?/) {"$(#{$1})"}.dump + "\n"
if fast[name] if fast[name]
v_fast << v v_fast << v
else else

View file

@ -340,6 +340,8 @@ s,@LIBRUBYARG@,$$(RUBY_SO_NAME).lib,;t t
s,@SOLIBS@,$(SOLIBS),;t t s,@SOLIBS@,$(SOLIBS),;t t
s,@DLDLIBS@,$(DLDLIBS),;t t s,@DLDLIBS@,$(DLDLIBS),;t t
s,@ENABLE_SHARED@,yes,;t t s,@ENABLE_SHARED@,yes,;t t
s,@OUTFLAG@,-Fe,;t t
s,@CPPOUTFILE@,-P,;t t
s,@arch@,$(ARCH)-$(OS),;t t s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(RT),;t t s,@sitearch@,$(ARCH)-$(RT),;t t
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t