* Makefile.in, {win32,bcc32}/Makefile.sub: add new target:
what-where, no-install. * mkconfig.rb: add const: CROSS_COMPILING. * ext/extmk.rb: no-install support. add MAKEDIRS macro. * lib/mkmf.rb: add !ifdef .. !endif for Borland make. * process.c: improve DJGPP support. system "ls", "-l". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b8ad2fa064
commit
86c90aea36
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
Tue Dec 31 21:13:51 2002 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
|
* Makefile.in, {win32,bcc32}/Makefile.sub: add new target:
|
||||||
|
what-where, no-install.
|
||||||
|
|
||||||
|
* mkconfig.rb: add const: CROSS_COMPILING.
|
||||||
|
|
||||||
|
* ext/extmk.rb: no-install support. add MAKEDIRS macro.
|
||||||
|
|
||||||
|
* lib/mkmf.rb: add !ifdef .. !endif for Borland make.
|
||||||
|
|
||||||
|
* process.c: improve DJGPP support. system "ls", "-l".
|
||||||
|
|
||||||
Tue Dec 31 20:16:37 2002 Akinori MUSHA <knu@iDaemons.org>
|
Tue Dec 31 20:16:37 2002 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/socket/addrinfo.h (NI_MAXHOST): Define NI_MAXHOST and
|
* ext/socket/addrinfo.h (NI_MAXHOST): Define NI_MAXHOST and
|
||||||
|
@ -129,6 +129,10 @@ install: rbconfig.rb
|
|||||||
$(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
|
$(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
|
||||||
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
|
what-where no-install: rbconfig.rb
|
||||||
|
$(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) -n" $(DESTDIR)
|
||||||
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) -n DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
clean-ext:
|
clean-ext:
|
||||||
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)" clean 2> /dev/null || true
|
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)" clean 2> /dev/null || true
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ OBJS = array.obj \
|
|||||||
|
|
||||||
all: miniruby$(EXEEXT) rbconfig.rb \
|
all: miniruby$(EXEEXT) rbconfig.rb \
|
||||||
$(LIBRUBY) $(MISCLIBS)
|
$(LIBRUBY) $(MISCLIBS)
|
||||||
@.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb --extstatic=$(EXTSTATIC) --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)"
|
.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb --extstatic=$(EXTSTATIC) --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)"
|
||||||
|
|
||||||
ruby: $(PROGRAM)
|
ruby: $(PROGRAM)
|
||||||
rubyw: $(WPROGRAM)
|
rubyw: $(WPROGRAM)
|
||||||
@ -410,6 +410,10 @@ install: rbconfig.rb
|
|||||||
$(MINIRUBY) $(srcdir)instruby.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
|
$(MINIRUBY) $(srcdir)instruby.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
|
||||||
$(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
$(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
|
what-where no-install: rbconfig.rb
|
||||||
|
$(MINIRUBY) $(srcdir)instruby.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) -n" $(DESTDIR)
|
||||||
|
$(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) -n DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
clean: clean-ext clean-local
|
clean: clean-ext clean-local
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
|
29
ext/extmk.rb
29
ext/extmk.rb
@ -8,6 +8,8 @@ $clean = nil
|
|||||||
$nodynamic = nil
|
$nodynamic = nil
|
||||||
$extinit = nil
|
$extinit = nil
|
||||||
$extobjs = nil
|
$extobjs = nil
|
||||||
|
$ignore = nil
|
||||||
|
$message = nil
|
||||||
|
|
||||||
$extlist = []
|
$extlist = []
|
||||||
|
|
||||||
@ -26,6 +28,13 @@ $topdir = File.expand_path(".")
|
|||||||
$top_srcdir = srcdir
|
$top_srcdir = srcdir
|
||||||
$hdrdir = $top_srcdir
|
$hdrdir = $top_srcdir
|
||||||
|
|
||||||
|
$quote =
|
||||||
|
/mswin|bccwin|mingw|human|os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
|
||||||
|
|
||||||
|
def sysquote(x)
|
||||||
|
$quote ? x.quote : x
|
||||||
|
end
|
||||||
|
|
||||||
def extmake(target)
|
def extmake(target)
|
||||||
print "#{$message} #{target}\n"
|
print "#{$message} #{target}\n"
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
@ -73,7 +82,7 @@ def extmake(target)
|
|||||||
if $static
|
if $static
|
||||||
$extlist.push [$static, $target, File.basename($target)]
|
$extlist.push [$static, $target, File.basename($target)]
|
||||||
end
|
end
|
||||||
unless system($make, *$mflags)
|
unless system($make, *sysquote($mflags))
|
||||||
$ignore or $continue or return false
|
$ignore or $continue or return false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -105,7 +114,7 @@ getopts('', 'extstatic', 'make:', 'make-flags:')
|
|||||||
$force_static = $OPT['extstatic'] == 'static'
|
$force_static = $OPT['extstatic'] == 'static'
|
||||||
$make = $OPT['make'] || $make
|
$make = $OPT['make'] || $make
|
||||||
$mflags = Shellwords.shellwords($OPT['make-flags'] || "")
|
$mflags = Shellwords.shellwords($OPT['make-flags'] || "")
|
||||||
$mflags[0].sub!(/^(?=\w+)$/, "-") unless $mflags.empty?
|
$mflags[0].sub!(/^[^-]/, '-\&') unless $mflags.empty?
|
||||||
$make, *$mflags[0, 0] = Shellwords.shellwords($make)
|
$make, *$mflags[0, 0] = Shellwords.shellwords($make)
|
||||||
|
|
||||||
mflags = $mflags.grep(/^-([^-].*)/) {$1}.join
|
mflags = $mflags.grep(/^-([^-].*)/) {$1}.join
|
||||||
@ -122,8 +131,9 @@ unless $message
|
|||||||
$ignore ||= true
|
$ignore ||= true
|
||||||
when "install"
|
when "install"
|
||||||
$ignore ||= true
|
$ignore ||= true
|
||||||
$mflags.unshift("INSTALL_PROG=install -m 0755",
|
$mflags.unshift("INSTALL_PROG=install -c -m 0755",
|
||||||
"INSTALL_DATA=install -m 0644") if $dryrun
|
"INSTALL_DATA=install -c -m 0644",
|
||||||
|
"MAKEDIRS=mkdir -p") if $dryrun
|
||||||
end
|
end
|
||||||
$message.sub!(/e?$/, "ing")
|
$message.sub!(/e?$/, "ing")
|
||||||
else
|
else
|
||||||
@ -132,7 +142,7 @@ unless $message
|
|||||||
end
|
end
|
||||||
|
|
||||||
EXEEXT = CONFIG['EXEEXT']
|
EXEEXT = CONFIG['EXEEXT']
|
||||||
if defined? CROSS_COMPILING
|
if CROSS_COMPILING
|
||||||
$ruby = CONFIG['MINIRUBY']
|
$ruby = CONFIG['MINIRUBY']
|
||||||
elsif $nmake
|
elsif $nmake
|
||||||
$ruby = '$(topdir:/=\\)\\miniruby' + EXEEXT
|
$ruby = '$(topdir:/=\\)\\miniruby' + EXEEXT
|
||||||
@ -226,9 +236,12 @@ Dir.chdir ".."
|
|||||||
puts "making #{rubies.join(', ')}"
|
puts "making #{rubies.join(', ')}"
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
$mflags.concat(rubies)
|
$mflags.concat(rubies)
|
||||||
host = (defined?(CROSS_COMPILING) ? CROSS_COMPILING : RUBY_PLATFORM)
|
|
||||||
/mswin|bccwin|mingw|djgpp|human|os2|macos/ =~ host or exec($make, *$mflags)
|
if $quote
|
||||||
system($make, *$mflags.quote) or exit($?.exitstatus)
|
system($make, *$mflags.quote) or exit($?.exitstatus)
|
||||||
|
else
|
||||||
|
exec($make, *$mflags)
|
||||||
|
end
|
||||||
|
|
||||||
#Local variables:
|
#Local variables:
|
||||||
# mode: ruby
|
# mode: ruby
|
||||||
|
12
lib/mkmf.rb
12
lib/mkmf.rb
@ -585,6 +585,16 @@ INSTALL_DATA = $(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)
|
|||||||
#### End of system configuration section. ####
|
#### End of system configuration section. ####
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if $nmake == ?b
|
||||||
|
mk.each do |x|
|
||||||
|
x.gsub!(/^(MAKEDIRS|INSTALL_(?:PROG|DATA))+\s*=.*\n/) do
|
||||||
|
"!ifndef " + $1 + "\n" +
|
||||||
|
$& +
|
||||||
|
"!endif\n"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
mk
|
||||||
end
|
end
|
||||||
|
|
||||||
def dummy_makefile(srcdir)
|
def dummy_makefile(srcdir)
|
||||||
@ -792,7 +802,7 @@ def init_mkmf(config = CONFIG)
|
|||||||
$objs = nil
|
$objs = nil
|
||||||
$libs = ""
|
$libs = ""
|
||||||
if $enable_shared or Config.expand(config["LIBRUBY"].dup) != Config.expand(config["LIBRUBY_A"].dup)
|
if $enable_shared or Config.expand(config["LIBRUBY"].dup) != Config.expand(config["LIBRUBY_A"].dup)
|
||||||
$LIBPATH.unshift("$(libdir)") unless $extmk or defined? CROSS_COMPILING
|
$LIBPATH.unshift("$(libdir)") unless $extmk or CROSS_COMPILING
|
||||||
$LIBRUBYARG = config['LIBRUBYARG']
|
$LIBRUBYARG = config['LIBRUBYARG']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -127,6 +127,7 @@ print <<EOS
|
|||||||
Config::expand(val)
|
Config::expand(val)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
CROSS_COMPILING = nil unless defined? CROSS_COMPILING
|
||||||
EOS
|
EOS
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
$stdout.reopen($orgout)
|
$stdout.reopen($orgout)
|
||||||
|
73
process.c
73
process.c
@ -20,6 +20,9 @@
|
|||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __DJGPP__
|
||||||
|
#include <process.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -574,7 +577,7 @@ rb_proc_exec(str)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__human68k__)
|
#if defined(__human68k__) || defined(__DJGPP__)
|
||||||
static int
|
static int
|
||||||
proc_spawn_v(argv, prog)
|
proc_spawn_v(argv, prog)
|
||||||
char **argv;
|
char **argv;
|
||||||
@ -583,16 +586,14 @@ proc_spawn_v(argv, prog)
|
|||||||
char *extension;
|
char *extension;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (prog) {
|
if (!prog)
|
||||||
security(prog);
|
prog = argv[0];
|
||||||
}
|
security(prog);
|
||||||
else {
|
prog = dln_find_exe(prog, 0);
|
||||||
security(argv[0]);
|
if (!prog)
|
||||||
prog = dln_find_exe(argv[0], 0);
|
return -1;
|
||||||
if (!prog)
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#if defined(__human68k__)
|
||||||
if ((extension = strrchr(prog, '.')) != NULL && strcasecmp(extension, ".bat") == 0) {
|
if ((extension = strrchr(prog, '.')) != NULL && strcasecmp(extension, ".bat") == 0) {
|
||||||
char **new_argv;
|
char **new_argv;
|
||||||
char *p;
|
char *p;
|
||||||
@ -615,8 +616,13 @@ proc_spawn_v(argv, prog)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
before_exec();
|
before_exec();
|
||||||
|
#if defined(_WIN32)
|
||||||
|
status = do_aspawn(prog, argv);
|
||||||
|
#else
|
||||||
status = spawnv(P_WAIT, prog, argv);
|
status = spawnv(P_WAIT, prog, argv);
|
||||||
|
#endif
|
||||||
after_exec();
|
after_exec();
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -632,16 +638,18 @@ proc_spawn_n(argc, argv, prog)
|
|||||||
|
|
||||||
args = ALLOCA_N(char*, argc + 1);
|
args = ALLOCA_N(char*, argc + 1);
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
SafeStr(argv[i]);
|
SafeStringValue(argv[i]);
|
||||||
args[i] = RSTRING(argv[i])->ptr;
|
args[i] = RSTRING(argv[i])->ptr;
|
||||||
}
|
}
|
||||||
SafeStringValue(prog);
|
if (prog)
|
||||||
|
SafeStringValue(prog);
|
||||||
args[i] = (char*) 0;
|
args[i] = (char*) 0;
|
||||||
if (args[0])
|
if (args[0])
|
||||||
return proc_spawn_v(args, RSTRING(prog)->ptr);
|
return proc_spawn_v(args, prog ? RSTRING(prog)->ptr : 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(_WIN32)
|
||||||
static int
|
static int
|
||||||
proc_spawn(sv)
|
proc_spawn(sv)
|
||||||
VALUE sv;
|
VALUE sv;
|
||||||
@ -672,7 +680,8 @@ proc_spawn(sv)
|
|||||||
}
|
}
|
||||||
return argv[0] ? proc_spawn_v(argv, 0) : -1;
|
return argv[0] ? proc_spawn_v(argv, 0) : -1;
|
||||||
}
|
}
|
||||||
#endif /* __human68k__ */
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_f_exec(argc, argv)
|
rb_f_exec(argc, argv)
|
||||||
@ -830,34 +839,10 @@ rb_f_system(argc, argv)
|
|||||||
|
|
||||||
if (status == 0) return Qtrue;
|
if (status == 0) return Qtrue;
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
#elif defined(DJGPP)
|
#elif defined(__human68k__) || defined(__DJGPP__)
|
||||||
VALUE cmd;
|
volatile VALUE prog = 0;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (argc == 0) {
|
|
||||||
rb_last_status = Qnil;
|
|
||||||
rb_raise(rb_eArgError, "wrong number of arguments");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TYPE(argv[0]) == T_ARRAY) {
|
|
||||||
if (RARRAY(argv[0])->len != 2) {
|
|
||||||
rb_raise(rb_eArgError, "wrong first argument");
|
|
||||||
}
|
|
||||||
argv[0] = RARRAY(argv[0])->ptr[0];
|
|
||||||
}
|
|
||||||
cmd = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
|
|
||||||
|
|
||||||
SafeStringValue(cmd);
|
|
||||||
status = system(RSTRING(cmd)->ptr);
|
|
||||||
last_status_set((status & 0xff) << 8, 0);
|
|
||||||
|
|
||||||
if (status == 0) return Qtrue;
|
|
||||||
return Qfalse;
|
|
||||||
#elif defined(__human68k__)
|
|
||||||
VALUE prog = 0;
|
|
||||||
int status;
|
|
||||||
|
|
||||||
fflush(stdin);
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
@ -874,12 +859,20 @@ rb_f_system(argc, argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argc == 1 && prog == 0) {
|
if (argc == 1 && prog == 0) {
|
||||||
|
#if defined(_WIN32)
|
||||||
|
status = do_spawn(RSTRING(argv[0])->ptr);
|
||||||
|
#else
|
||||||
status = proc_spawn(argv[0]);
|
status = proc_spawn(argv[0]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
status = proc_spawn_n(argc, argv, prog);
|
status = proc_spawn_n(argc, argv, prog);
|
||||||
}
|
}
|
||||||
|
#if defined(_WIN32)
|
||||||
|
last_status_set(status, 0);
|
||||||
|
#else
|
||||||
last_status_set(status == -1 ? 127 : status, 0);
|
last_status_set(status == -1 ? 127 : status, 0);
|
||||||
|
#endif
|
||||||
return status == 0 ? Qtrue : Qfalse;
|
return status == 0 ? Qtrue : Qfalse;
|
||||||
#elif defined(__VMS)
|
#elif defined(__VMS)
|
||||||
VALUE cmd;
|
VALUE cmd;
|
||||||
|
@ -410,6 +410,10 @@ install: rbconfig.rb
|
|||||||
$(MINIRUBY) $(srcdir)/instruby.rb --make-flags "$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
|
$(MINIRUBY) $(srcdir)/instruby.rb --make-flags "$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
|
||||||
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
|
what-where no-install: rbconfig.rb
|
||||||
|
$(MINIRUBY) $(srcdir)/instruby.rb --make-flags "$(MFLAGS)$(MAKEFLAGS) -n" $(DESTDIR)
|
||||||
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) -n DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
clean: clean-ext clean-local
|
clean: clean-ext clean-local
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user