summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--common.mk6
-rw-r--r--ext/extmk.rb10
3 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a6c290a0fd..02a97a18d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed Nov 16 23:24:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (static-ruby): overridable.
+
+ * ext/extmk.rb (parse_args): force to link extensions statically only
+ if static is given for extstatic.
+
+ * ext/extmk.rb (RUBY, RUBYW): overridable.
+
Tue Nov 15 23:46:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/find.rb (Find::find): should not ignore symbolic links to
diff --git a/common.mk b/common.mk
index 113b64c970..77e8cdb99f 100644
--- a/common.mk
+++ b/common.mk
@@ -4,6 +4,8 @@ dll: $(LIBRUBY_SO);
RUBYOPT =
+STATIC_RUBY = static-ruby
+
EXTCONF = extconf.rb
RBCONFIG = ./.rbconfig.time
@@ -68,9 +70,9 @@ $(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(ARCHFILE)
-static-ruby: $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A)
+$(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
@$(RM) $@
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@
+ $(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
ruby.imp: $(LIBRUBY_A)
@$(NM) -Pgp $(LIBRUBY_A) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 79e44b9e63..ec544f2b4e 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -217,8 +217,7 @@ def parse_args()
if ($extstatic = v) == false
$extstatic = []
elsif v
- $force_static = true
- $extstatic.delete("static")
+ $force_static = true if $extstatic.delete("static")
$extstatic = nil if $extstatic.empty?
end
end
@@ -232,6 +231,7 @@ def parse_args()
$make = v || 'make'
end
opts.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
+ v.grep(/\A([-\w]+)=(.*)/) {$configure_args["--#{$1}"] = $2}
if arg = v.first
arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
end
@@ -326,7 +326,7 @@ end
for dir in ["ext", File::join($top_srcdir, "ext")]
setup = File::join(dir, CONFIG['setup'])
if File.file? setup
- f = open(setup)
+ f = open(setup)
while line = f.gets()
line.chomp!
line.sub!(/#.*$/, '')
@@ -458,9 +458,11 @@ SRC
$mflags.concat(conf)
end
rubies = []
-%w[RUBY RUBYW].each {|r|
+%w[RUBY RUBYW STATIC_RUBY].each {|r|
+ n = r
if r = arg_config("--"+r.downcase) || config_string(r+"_INSTALL_NAME")
rubies << r+EXEEXT
+ $mflags << "#{n}=#{r}"
end
}