summaryrefslogtreecommitdiff
path: root/cygwin
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-09 22:20:12 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-09 22:20:12 (GMT)
commit536e266e58e6fda550e781d7a88317fdfe149cfa (patch)
tree5f8b7d80d8817989496ab5eb36cd1c64815de0be /cygwin
parent5ddcc93a3f9ffaeed5a78aa0fa7a847880102600 (diff)
* cygwin/GNUmakefile.in (scriptbin): make executable file from
scripts with stub. * ruby.c (load_file_internal): assume xflag for exe file as well as no-shebang file. * tool/rbinstall.rb: install script programs. * win32/mkexports.rb (Exports#initialize): alias ruby_sysinit for stub. * win32/stub.c: stub for scripts. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cygwin')
-rw-r--r--cygwin/GNUmakefile.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 025f460..0400546 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -31,9 +31,16 @@ SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
RUBYDEF = $(DLL_BASE_NAME).def
+STUBPROGRAM = rubystub$(EXEEXT)
+SCRIPTPROGRAMS = $(addsuffix $(EXEEXT),$(notdir $(wildcard $(srcdir)/bin/*)))
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
+stub: $(STUBPROGRAM)
+scriptbin: $(SCRIPTPROGRAMS)
+
+%$(EXEEXT): bin/% $(STUBPROGRAM)
+ { cat $(STUBPROGRAM); echo; sed -e '1{' -e '/^#!.*ruby/!i\' -e '#!/bin/ruby' -e '}' $<; } > $@
$(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
$(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
@@ -52,6 +59,10 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
@rm -f $@
$(PURIFY) $(CC) -mwindows -e _mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
+$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ stub.@OBJEXT@
+ @rm -f $@
+ $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) \
+ stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
$(DLLWRAP) \