Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,

  common.mk, configure.in, ext/extmk.rb, lib/mkmf.rb, instruby.rb,
  runruby.rb: backport extout.  [ruby-dev:25963]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 71d5fc5bb9ded94df993f0d939ff212f64a10d03 1 parent 2d8aea1
@nobu nobu authored
View
7 ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 30 23:44:50 2005 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * Makefile.in, */Makefile.sub, */configure.bat,
+ cygwin/GNUmakefile.in, common.mk, configure.in, ext/extmk.rb,
+ lib/mkmf.rb, instruby.rb, runruby.rb: backport extout.
+ [ruby-dev:25963]
+
Wed Mar 30 17:41:48 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: add TclTkIp#_create_console() method to
View
312 Makefile.in
@@ -10,6 +10,7 @@ YACC = @YACC@
PURIFY =
AUTOCONF = autoconf
@SET_MAKE@
+MKFILES = @MAKEFILES@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -17,10 +18,19 @@ bindir = @bindir@
sbindir = @sbindir@
libdir = @libdir@
libexecdir = @libexecdir@
+datadir = @datadir@
arch = @arch@
sitearch = @sitearch@
sitedir = @sitedir@
+TESTUI = console
+TESTS =
+RDOCTARGET = @RDOCTARGET@
+
+EXTOUT = @EXTOUT@
+RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
+
+OUTFLAG = -o
CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
@@ -39,7 +49,9 @@ RUBY_SO_NAME=@RUBY_SO_NAME@
EXEEXT = @EXEEXT@
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
+RUBYOPT =
MINIRUBY = @MINIRUBY@
+RUNRUBY = @RUNRUBY@
#### End of system configuration section. ####
@@ -55,135 +67,58 @@ LIBRUBYARG = @LIBRUBYARG@
LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
-PREP = @PREP@ @ARCHFILE@
+PREP = @PREP@
+ARCHFILE = @ARCHFILE@
SETUP =
EXTSTATIC = @EXTSTATIC@
+RM = rm -f
+NM = @NM@
+AR = @AR@
+ARFLAGS = rcu
+RANLIB = @RANLIB@
+
+OBJEXT = @OBJEXT@
+
EXTOBJS =
DLDOBJS = $(DMYEXT)
-DMYEXT = dmyext.@OBJEXT@
-
-MAINOBJ = main.@OBJEXT@
-
-OBJS = array.@OBJEXT@ \
- bignum.@OBJEXT@ \
- class.@OBJEXT@ \
- compar.@OBJEXT@ \
- dir.@OBJEXT@ \
- dln.@OBJEXT@ \
- enum.@OBJEXT@ \
- error.@OBJEXT@ \
- eval.@OBJEXT@ \
- file.@OBJEXT@ \
- gc.@OBJEXT@ \
- hash.@OBJEXT@ \
- inits.@OBJEXT@ \
- io.@OBJEXT@ \
- marshal.@OBJEXT@ \
- math.@OBJEXT@ \
- numeric.@OBJEXT@ \
- object.@OBJEXT@ \
- pack.@OBJEXT@ \
- parse.@OBJEXT@ \
- process.@OBJEXT@ \
- prec.@OBJEXT@ \
- random.@OBJEXT@ \
- range.@OBJEXT@ \
- re.@OBJEXT@ \
- regex.@OBJEXT@ \
- ruby.@OBJEXT@ \
- signal.@OBJEXT@ \
- sprintf.@OBJEXT@ \
- st.@OBJEXT@ \
- string.@OBJEXT@ \
- struct.@OBJEXT@ \
- time.@OBJEXT@ \
- util.@OBJEXT@ \
- variable.@OBJEXT@ \
- version.@OBJEXT@ \
- $(MISSING)
+
+MAINOBJ = main.$(OBJEXT)
MANTYPE = @MANTYPE@
-SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
- --make="$(MAKE)" \
- --mflags="$(MFLAGS)" \
- --make-flags="$(MAKEFLAGS)"
+#### End of variables
+
+all:
-all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY)
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="$(EXTSTATIC)" $(SCRIPT_ARGS)
+.DEFAULT: all
-miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(DMYEXT)
- @rm -f $@
- $(PURIFY) $(CC) $(LDFLAGS) $(MAINLIBS) $(MAINOBJ) $(DMYEXT) $(LIBRUBY_A) $(LIBS) -o $@
+# Prevent GNU make v3 from overflowing arg limit on SysV.
+.NOEXPORT:
-$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS) $(SETUP) miniruby$(EXEEXT)
- @rm -f $@
- $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
+miniruby$(EXEEXT):
+ @$(RM) $@
+ $(PURIFY) $(CC) $(MAINOBJ) $(LIBRUBY_A) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(MAINLIBS)
+
+$(PROGRAM):
+ @$(RM) $@
+ $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
# We must `rm' the library each time this rule is invoked because "updating" a
# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
# supported.
-$(LIBRUBY_A): $(OBJS) $(DMYEXT)
- @rm -f $@
- @AR@ rcu $@ $(OBJS) $(DMYEXT)
- @-@RANLIB@ $@ 2> /dev/null || true
+$(LIBRUBY_A):
+ @$(RM) $@
+ $(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
+ @-$(RANLIB) $@ 2> /dev/null || true
-$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) miniruby$(EXEEXT) $(PREP)
- $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) -o $@
+$(LIBRUBY_SO):
+ $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
-ruby.imp: $(LIBRUBY_A)
- @@NM@ -Pgp $(LIBRUBY_A) | awk 'BEGIN{print "#!"}; $$2~/^[BD]$$/{print $$1}' | sort -u -o $@
-# $(MINIRUBY) $< $@
-
-install: install-nodoc @RDOCTARGET@
-
-install-nodoc: rbconfig.rb
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)"
- $(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) install
-
-what-where no-install: rbconfig.rb
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS) --mantype="$(MANTYPE)"
- $(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(SCRIPT_ARGS) install
-
-install-doc:
- @echo Generating RDoc documentation
- $(bindir)/$(PROGRAM) $(srcdir)/bin/rdoc --all --ri-system $(srcdir)
-
-clean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) clean 2> /dev/null || true
-
-clean-local:
- @rm -f $(OBJS) $(MAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES)
- @rm -f ext/extinit.c ext/extinit.@OBJEXT@ dmyext.@OBJEXT@
- @rm -f $(PROGRAM) miniruby$(EXEEXT)
-
-clean: clean-ext clean-local
-
-distclean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) distclean 2> /dev/null || true
-
-distclean-local: clean-local
- @rm -f @MAKEFILES@ config.h rbconfig.rb
- @rm -f ext/config.cache config.cache config.log config.status
- @rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp
-
-distclean: distclean-ext distclean-local
-
-realclean: distclean
- @rm -f parse.c
- @rm -f lex.c
-
-test: miniruby$(EXEEXT) rbconfig.rb $(PROGRAM) PHONY
- @./miniruby$(EXEEXT) $(srcdir)/rubytest.rb
-
-rbconfig.rb: miniruby$(EXEEXT) $(srcdir)/mkconfig.rb config.status $(PREP)
- @$(MINIRUBY) $(srcdir)/mkconfig.rb rbconfig.rb
-
-fake.rb: miniruby$(EXEEXT) Makefile
+fake.rb: Makefile
@echo ' \
class Object; \
CROSS_COMPILING = RUBY_PLATFORM; \
@@ -202,13 +137,7 @@ fake.rb: miniruby$(EXEEXT) Makefile
Makefile: $(srcdir)/Makefile.in
-.PRECIOUS: @MAKEFILES@
-
-.PHONY: test install install-nodoc install-doc
-
-PHONY:
-
-@MAKEFILES@: config.status
+$(MKFILES): config.status $(srcdir)/common.mk
MAKE=$(MAKE) $(SHELL) ./config.status
@{ \
echo "all:; -@rm -f conftest.mk"; \
@@ -224,11 +153,8 @@ config.status: $(srcdir)/configure
$(srcdir)/configure: $(srcdir)/configure.in
cd $(srcdir) && $(AUTOCONF)
-.c.@OBJEXT@:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-
lex.c: keywords
- @-rm -f $@
+ @-$(RM) $@
gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@ || \
cp "$(srcdir)/$@" .
@@ -237,144 +163,14 @@ lex.c: keywords
sed '/^#/s|y\.tab\.c|$@|' y.tab.c > $@
rm -f y.tab.c
-ext/extinit.@OBJEXT@: ext/extinit.c $(SETUP)
- $(CC) $(CFLAGS) $(CPPFLAGS) @OUTFLAG@$@ -c ext/extinit.c
-
-acosh.@OBJEXT@: $(srcdir)/missing/acosh.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/acosh.c
-
-alloca.@OBJEXT@: $(srcdir)/missing/alloca.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/alloca.c
-
-crypt.@OBJEXT@: $(srcdir)/missing/crypt.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/crypt.c
-
-dup2.@OBJEXT@: $(srcdir)/missing/dup2.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dup2.c
-
-fileblocks.@OBJEXT@: $(srcdir)/missing/fileblocks.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/fileblocks.c
-
-finite.@OBJEXT@: $(srcdir)/missing/finite.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/finite.c
-
-flock.@OBJEXT@: $(srcdir)/missing/flock.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/flock.c
-
-isinf.@OBJEXT@: $(srcdir)/missing/isinf.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/isinf.c
-
-isnan.@OBJEXT@: $(srcdir)/missing/isnan.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/isnan.c
-
-fnmatch.@OBJEXT@: $(srcdir)/missing/fnmatch.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/fnmatch.c
-
-memcmp.@OBJEXT@: $(srcdir)/missing/memcmp.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/memcmp.c
-
-memmove.@OBJEXT@: $(srcdir)/missing/memmove.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/memmove.c
-
-mkdir.@OBJEXT@: $(srcdir)/missing/mkdir.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/mkdir.c
-
-vsnprintf.@OBJEXT@: $(srcdir)/missing/vsnprintf.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/vsnprintf.c
-
-strcasecmp.@OBJEXT@: $(srcdir)/missing/strcasecmp.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strcasecmp.c
-
-strncasecmp.@OBJEXT@: $(srcdir)/missing/strncasecmp.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strncasecmp.c
-
-strchr.@OBJEXT@: $(srcdir)/missing/strchr.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strchr.c
-
-strerror.@OBJEXT@: $(srcdir)/missing/strerror.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strerror.c
-
-strftime.@OBJEXT@: $(srcdir)/missing/strftime.c
- $(CC) -I. $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strftime.c
-
-strstr.@OBJEXT@: $(srcdir)/missing/strstr.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strstr.c
-
-strtol.@OBJEXT@: $(srcdir)/missing/strtol.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtol.c
-
-strtoul.@OBJEXT@: $(srcdir)/missing/strtoul.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/strtoul.c
-
-x68.@OBJEXT@: $(srcdir)/missing/x68.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/x68.c
-
-os2.@OBJEXT@: $(srcdir)/missing/os2.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/os2.c
+.c.@OBJEXT@:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-dl_os2.@OBJEXT@: $(srcdir)/missing/dl_os2.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dl_os2.c
+clean-local::
+ @$(RM) ext/extinit.c ext/extinit.$(OBJEXT)
-win32.@OBJEXT@: $(srcdir)/win32/win32.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/win32 -c $(srcdir)/win32/win32.c
+distclean-local::
+ @$(RM) ext/config.cache $(RBCONFIG)
-# Prevent GNU make v3 from overflowing arg limit on SysV.
-.NOEXPORT:
-###
-array.@OBJEXT@: array.c ruby.h config.h defines.h intern.h missing.h \
- util.h st.h
-bignum.@OBJEXT@: bignum.c ruby.h config.h defines.h intern.h missing.h
-class.@OBJEXT@: class.c ruby.h config.h defines.h intern.h missing.h \
- rubysig.h node.h st.h
-compar.@OBJEXT@: compar.c ruby.h config.h defines.h intern.h missing.h
-dir.@OBJEXT@: dir.c ruby.h config.h defines.h intern.h missing.h util.h
-dln.@OBJEXT@: dln.c ruby.h config.h defines.h intern.h missing.h dln.h
-dmyext.@OBJEXT@: dmyext.c
-enum.@OBJEXT@: enum.c ruby.h config.h defines.h intern.h missing.h node.h \
- util.h
-error.@OBJEXT@: error.c ruby.h config.h defines.h intern.h missing.h \
- env.h st.h
-eval.@OBJEXT@: eval.c ruby.h config.h defines.h intern.h missing.h node.h \
- env.h util.h rubysig.h st.h dln.h
-file.@OBJEXT@: file.c ruby.h config.h defines.h intern.h missing.h \
- rubyio.h rubysig.h util.h dln.h
-gc.@OBJEXT@: gc.c ruby.h config.h defines.h intern.h missing.h rubysig.h \
- st.h node.h env.h re.h regex.h
-hash.@OBJEXT@: hash.c ruby.h config.h defines.h intern.h missing.h st.h \
- util.h rubysig.h
-inits.@OBJEXT@: inits.c ruby.h config.h defines.h intern.h missing.h
-io.@OBJEXT@: io.c ruby.h config.h defines.h intern.h missing.h rubyio.h \
- rubysig.h env.h util.h
-main.@OBJEXT@: main.c ruby.h config.h defines.h intern.h missing.h
-marshal.@OBJEXT@: marshal.c ruby.h config.h defines.h intern.h missing.h \
- rubyio.h st.h util.h
-math.@OBJEXT@: math.c ruby.h config.h defines.h intern.h missing.h
-numeric.@OBJEXT@: numeric.c ruby.h config.h defines.h intern.h missing.h
-object.@OBJEXT@: object.c ruby.h config.h defines.h intern.h missing.h \
- st.h util.h
-pack.@OBJEXT@: pack.c ruby.h config.h defines.h intern.h missing.h
-parse.@OBJEXT@: parse.c ruby.h config.h defines.h intern.h missing.h \
- env.h node.h st.h regex.h util.h lex.c
-prec.@OBJEXT@: prec.c ruby.h config.h defines.h intern.h missing.h
-process.@OBJEXT@: process.c ruby.h config.h defines.h intern.h missing.h \
- rubysig.h st.h
-random.@OBJEXT@: random.c ruby.h config.h defines.h intern.h missing.h
-range.@OBJEXT@: range.c ruby.h config.h defines.h intern.h missing.h
-re.@OBJEXT@: re.c ruby.h config.h defines.h intern.h missing.h re.h \
- regex.h
-regex.@OBJEXT@: regex.c config.h regex.h
-ruby.@OBJEXT@: ruby.c ruby.h config.h defines.h intern.h missing.h dln.h \
- node.h util.h
-signal.@OBJEXT@: signal.c ruby.h config.h defines.h intern.h missing.h \
- rubysig.h
-sprintf.@OBJEXT@: sprintf.c ruby.h config.h defines.h intern.h missing.h
-st.@OBJEXT@: st.c config.h st.h
-string.@OBJEXT@: string.c ruby.h config.h defines.h intern.h missing.h \
- re.h regex.h
-struct.@OBJEXT@: struct.c ruby.h config.h defines.h intern.h missing.h
-time.@OBJEXT@: time.c ruby.h config.h defines.h intern.h missing.h
-util.@OBJEXT@: util.c ruby.h config.h defines.h intern.h missing.h util.h
-variable.@OBJEXT@: variable.c ruby.h config.h defines.h intern.h \
- missing.h env.h node.h st.h util.h
-version.@OBJEXT@: version.c ruby.h config.h defines.h intern.h missing.h \
- version.h
+ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
+ $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -o$@ -c ext/extinit.c
View
354 bcc32/Makefile.sub
@@ -1,6 +1,7 @@
# -*- makefile -*-
SHELL = $(COMSPEC)
+MKFILES = Makefile
#### Start of system configuration section. ####
OS = bccwin32
@@ -56,6 +57,7 @@ AR = tlib
PURIFY =
AUTOCONF = autoconf
+RM = $(srcdir:/=\)\win32\rm.bat
!if !defined(PROCESSOR_ARCHITECTURE)
PROCESSOR_ARCHITECTURE = x86
@@ -91,9 +93,26 @@ exec_prefix = $(prefix)
!ifndef libdir
libdir = $(exec_prefix)/lib
!endif
-!ifndef DESTDIR
-DESTDIR = $(prefix)
+!if !defined(datadir)
+datadir = $(prefix)/share
!endif
+!ifndef EXTOUT
+EXTOUT = .ext
+!endif
+!ifndef RIDATADIR
+RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
+!endif
+!ifndef TESTUI
+TESTUI = console
+!endif
+!ifndef TESTS
+TESTS =
+!endif
+!ifndef RDOCTARGET
+RDOCTARGET = install-doc
+!endif
+
+OUTFLAG = -o
!ifndef CFLAGS
CFLAGS = -q -tWR -tWC $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- -wsus -wcpt -wdup -wext -wrng -wrpt -wzdi
!endif
@@ -135,6 +154,7 @@ PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
RUBYDEF = $(RUBY_SO_NAME).def
MINIRUBY = .\miniruby$(EXEEXT)
+RUNRUBY = .\ruby$(EXEEXT) "$(srcdir)runruby.rb" --extout="$(EXTOUT)" --
ORGLIBPATH = $(LIB)
@@ -145,70 +165,46 @@ LIBRUBY_SO = $(RUBY_SO_NAME).dll
LIBRUBY = $(RUBY_SO_NAME).lib
LIBRUBYARG = $(LIBRUBY)
-!ifndef EXTOBJS
-EXTOBJS = dmyext.obj
-!endif
-
-MAINOBJ = main.obj
-WINMAINOBJ = winmain.obj
-
-OBJS = array.obj \
- bignum.obj \
- class.obj \
- compar.obj \
- dir.obj \
- dln.obj \
- enum.obj \
- error.obj \
- eval.obj \
- file.obj \
- gc.obj \
- hash.obj \
- inits.obj \
- io.obj \
- marshal.obj \
- math.obj \
- numeric.obj \
- object.obj \
- pack.obj \
- parse.obj \
- prec.obj \
- process.obj \
- random.obj \
- range.obj \
- re.obj \
- regex.obj \
- ruby.obj \
- signal.obj \
- sprintf.obj \
- st.obj \
- string.obj \
- struct.obj \
- time.obj \
- util.obj \
- variable.obj \
- version.obj \
- $(MISSING)
-
-SCRIPT_ARGS = "--dest-dir=$(DESTDIR)" \
- "--make=$(MAKE)" \
- "--mflags=$(MFLAGS)" \
- "--make-flags=$(MAKEFLAGS)"
-
-all: miniruby$(EXEEXT) rbconfig.rb \
- $(LIBRUBY) $(MISCLIBS)
- .\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb --extstatic=$(EXTSTATIC) $(SCRIPT_ARGS)
+PREP = miniruby$(EXEEXT)
+
+DMYOBJS = dmyext.obj
+OBJEXT = obj
+
+WINMAINOBJ = winmain.$(OBJEXT)
+
+.path.c = .;$(srcdir);$(srcdir)win32;$(srcdir)missing
+.path.h = .;$(srcdir);$(srcdir)win32;$(srcdir)missing
+.path.y = $(srcdir)
+.path. = $(srcdir)
+
+.c.obj:
+ $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
+
+.rc.res:
+ $(RC) $(RFLAGS) -I. -I$(<D). $(iconinc) -I$(srcdir)win32 $(RFLAGS) -fo$@ $(<:/=\)
+
+.y.c:
+ $(YACC) $(YFLAGS) $(<:\=/)
+ sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $(@F)
+ @del y.tab.c
+
+all: $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
-lib: $(LIBRUBY)
-dll: $(LIBRUBY_SO)
-config: config.h config.status
+!include $(srcdir)/common.mk
-config.h:
- @echo Creating $(@:.\=)
- @type > $@ &&|
+PHONY: Makefile
+
+CONFIG_H = ./.config.h.time
+
+config: config.status
+
+config.status: $(CONFIG_H)
+
+$(CONFIG_H): $(MKFILES) $(srcdir)bcc32/Makefile.sub
+ @$(srcdir:/=\)win32\ifchange.bat config.h &&|
\#define HAVE_SYS_TYPES_H 1
\#define HAVE_SYS_STAT_H 1
\#define HAVE_STDLIB_H 1
@@ -274,7 +270,6 @@ config.h:
\#define STACK_GROW_DIRECTION -1
\#define DEFAULT_KCODE KCODE_NONE
\#define DLEXT ".so"
-\#define DLEXT2 ".dll"
\#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR)"
\#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
\#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)"
@@ -282,12 +277,14 @@ config.h:
\#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
\#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
|
+ @exit > $@
-config.status: Makefile $(srcdir)bcc32/Makefile.sub
+config.status: $(MKFILES) $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk
@echo Creating $@
@type > $@ &&|
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
+s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t
s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
@@ -295,7 +292,7 @@ s,@FFLAGS@,$(FFLAGS),;t t
s,@LDFLAGS@,,;t t
s,@LIBS@,$(LIBS),;t t
s,@exec_prefix@,$${prefix},;t t
-s,@prefix@,,;t t
+s,@prefix@,$(prefix),;t t
s,@program_transform_name@,s,,,,;t t
s,@bindir@,$${exec_prefix}/bin,;t t
s,@sbindir@,$${exec_prefix}/sbin,;t t
@@ -345,12 +342,16 @@ s,@STATIC@,$(STATIC),;t t
s,@CCDLFLAGS@,,;t t
s,@LDSHARED@,$(LDSHARED),;t t
s,@DLEXT@,so,;t t
-s,@DLEXT2@,dll,;t t
s,@LIBEXT@,lib,;t t
s,@STRIP@,$(STRIP),;t t
s,@EXTSTATIC@,$(EXTSTATIC),;t t
s,@setup@,Setup,;t t
s,@MINIRUBY@,$(MINIRUBY),;t t
+s,@PREP@,miniruby$(EXEEXT),;t t
+s,@RUNRUBY@,$(RUNRUBY),;t t
+s,@EXTOUT@,$(EXTOUT),;t t
+s,@ARCHFILE@,,;t t
+s,@RDOCTARGET@,,;t t
s,@LIBRUBY_LDSHARED@,$$(LDSHARED),;t t
s,@LIBRUBY_DLDFLAGS@,-Gi $$(DLDFLAGS),;t t
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
@@ -367,7 +368,7 @@ s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t
s,@SOLIBS@,$(SOLIBS),;t t
s,@DLDLIBS@,$(DLDLIBS),;t t
s,@ENABLE_SHARED@,yes,;t t
-s,@OUTFLAG@,-o,;t t
+s,@OUTFLAG@,$(OUTFLAG),;t t
s,@CPPOUTFILE@,,;t t
s,@LIBPATHFLAG@, -L"%s",;t t
s,@RPATHFLAG@,,;t t
@@ -375,8 +376,9 @@ s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE), $$(RESFILE),;t t
s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c $$(<:/=\),;t t
s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -P -c $$(<:/=\),;t t
-s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: .%s.%s:,;t t
-s,@COMMON_LIBS@,m,;t t
+s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(hdrdir)}.%s{}.%s: .%s.%s:,;t t
+s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
+s,@COMMON_LIBS@,m advapi32 avicap32 avifil32 cap comctl32 comdlg32 dlcapi gdi32 glu32 imagehlp imm32 inetmib1 kernel32 loadperf lsapi32 lz32 mapi32 mgmtapi mpr msacm32 msvfw32 nddeapi netapi32 ole32 oleaut32 oledlg olepro32 opengl32 pdh pkpd32 rasapi32 rasdlg rassapi rpcrt4 setupapi shell32 shfolder snmpapi sporder tapi32 url user32 vdmdbg version win32spl winmm wintrust wsock32,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
s,@TRY_LINK@,$$(CC) -oconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(LIBPATH) $$(LDFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS),;t t
@@ -390,9 +392,9 @@ s,@srcdir@,$(srcdir),;t t
s,@top_srcdir@,$(srcdir),;t t
|
-miniruby$(EXEEXT): $(LIBRUBY_A) $(MAINOBJ) dmyext.obj
+miniruby$(EXEEXT):
@echo $(LIBS)
- $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) dmyext.obj,$@,nul,$(LIBRUBY_A) $(LIBS)
+ $(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBY_A) $(LIBS)
$(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res
$(LD) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ),$@,nul,$(LIBRUBYARG) $(LIBS),,$(RUBY_INSTALL_NAME).res
@@ -407,83 +409,14 @@ $(LIBRUBY_A): $(OBJS) dmyext.obj
# $(LIBRUBY): $(LIBRUBY_SO)
# implib $@ $(LIBRUBY_SO)
-$(LIBRUBY_SO) $(LIBRUBY): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
+$(LIBRUBY_SO): $(LIBRUBY_A) $(EXTOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo $(EXTOBJS)
$(LIBRUBY_LDSHARED) $(LIBRUBY_DLDFLAGS) $(EXTOBJS:/=\),$(LIBRUBY_SO),nul,$(LIBRUBY_A) $(LIBS),$(RUBYDEF),$(RUBY_SO_NAME).res
-$(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT)
- $(MINIRUBY) $(srcdir)bcc32/mkexports.rb -output=$@ $(LIBRUBY_A)
-
-install: rbconfig.rb
- $(MINIRUBY) $(srcdir)instruby.rb $(SCRIPT_ARGS)
- $(MINIRUBY) $(srcdir)ext/extmk.rb $(SCRIPT_ARGS) install
-
-what-where no-install: rbconfig.rb
- $(MINIRUBY) $(srcdir)instruby.rb -n $(SCRIPT_ARGS)
- $(MINIRUBY) $(srcdir)ext/extmk.rb -n $(SCRIPT_ARGS) install
-
-clean: clean-ext clean-local
-
-clean-local:
- @if exist $(LIBRUBY_A) del $(LIBRUBY_A)
- @if exist $(MAINOBJ) del $(MAINOBJ)
- @if exist rbconfig.rb del rbconfig.rb
- @if exist ext\extinit.c del ext\extinit.c
- @if exist ext\extinit.obj del ext\extinit.obj
- @if exist ext\vc*.pdb del ext\vc*.pdb
- @if exist *.obj del *.obj
- @if exist *.res del *.res
- @if exist *.tds del *.tds
- @if exist *.il? del *.il?
-
-clean-ext:
- @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(SCRIPT_ARGS) clean
-
-distclean: distclean-ext distclean-local
-
-distclean-local: clean-local
- @if exist Makefile del Makefile
- @if exist config.h del config.h
- @if exist ext\config.cache del ext\config.cache
- @if exist config.cache del config.cache
- @if exist config.log del config.log
- @if exist config.status del config.status
- @if exist *~ del *~
- @if exist *.bak del *.bak
- @if exist *.stackdump del *.stackdump
- @if exist *.core del *.core
- @if exist gmon.out del gmon.out
- @if exist y.tab.c del y.tab.c
- @if exist y.output del y.output
- @if exist *.map del *.map
- @if exist *.pdb del *.pdb
- @if exist *.ilk del *.ilk
- @if exist *.exp del *.exp
- @if exist $(RUBYDEF) del $(RUBYDEF)
- @if exist $(RUBY_INSTALL_NAME).rc del $(RUBY_INSTALL_NAME).rc
- @if exist $(RUBYW_INSTALL_NAME).rc del $(RUBYW_INSTALL_NAME).rc
- @if exist $(RUBY_SO_NAME).rc del $(RUBY_SO_NAME).rc
- @if exist $(PROGRAM) del $(PROGRAM)
- @if exist $(WPROGRAM) del $(WPROGRAM)
- @if exist $(LIBRUBY_SO) del $(LIBRUBY_SO)
- @if exist $(LIBRUBY) del $(LIBRUBY)
- @if exist ext\nul if not exist ext\* rmdir ext
- @if exist miniruby$(EXEEXT) del miniruby$(EXEEXT)
-
-distclean-ext:
- @-$(MINIRUBY) $(srcdir)ext/extmk.rb $(SCRIPT_ARGS) distclean
-
-realclean: distclean
- @if exist parse.c del parse.c
- @if exist lex.c del lex.c
-
-test: miniruby$(EXEEXT) rbconfig.rb $(PROGRAM) NUL
- @$(MINIRUBY) $(srcdir)rubytest.rb
-
-rbconfig.rb: miniruby$(EXEEXT) config.status
- @$(MINIRUBY) $(srcdir)mkconfig.rb -srcdir=$(srcdir) \
- -install_name=$(RUBY_INSTALL_NAME) \
- -so_name=$(RUBY_SO_NAME) rbconfig.rb
+$(LIBRUBY): $(LIBRUBY_SO)
+
+$(RUBYDEF): $(LIBRUBY_A) $(PREP)
+ $(MINIRUBY) $(srcdir)bcc32/mkexports.rb -output=$@ -base=$(RUBY_SO_NAME) $(LIBRUBY_A)
$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
@$(MINIRUBY) $(srcdir)win32/resource.rb \
@@ -492,95 +425,56 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
-so_name=$(RUBY_SO_NAME) \
. $(icondirs) $(srcdir)win32
-#config.status: $(srcdir)configure
-# $(SHELL) .config.status --recheck
-
-.path.c = .;$(srcdir);$(srcdir)win32;$(srcdir)missing
-.path.h = .;$(srcdir);$(srcdir)win32;$(srcdir)missing
-.path.y = $(srcdir)
-
-.c.obj:
- $(CC) $(CFLAGS) $(XCFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
+post-install-ext::
+ $(MINIRUBY) -I$(srcdir)lib -rrbconfig -rfileutils \
+ -e 'FileUtils.rm_f(Dir[File.join(Config::CONFIG["archdir"],"**","*.tds")])'
-.rc.res:
- $(RC) $(RFLAGS) -I. -I$(<D). $(iconinc) -I$(srcdir)win32 $(RFLAGS) -fo$@ $(<:/=\)
-
-.y.c:
- $(YACC) $(YFLAGS) $(<:\=/)
- sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $(@F)
- @del y.tab.c
+clean-local::
+ @$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
+ @$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
-parse.c: parse.y
+distclean-local::
+ @$(RM) ext\config.cache $(RBCONFIG:/=\)
+ @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF)
+ @$(RM) $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
ext/extinit.obj: ext/extinit.c $(SETUP)
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) -o$@ -c ext/extinit.c
-acosh.obj: acosh.c win32.h
-alloca.obj: alloca.c win32.h
-crypt.obj: crypt.c win32.h
-dup2.obj: dup2.c win32.h
-erf.obj: erf.c win32.h
-finite.obj: finite.c win32.h
-flock.obj: flock.c win32.h
-memcmp.obj: memcmp.c win32.h
-memmove.obj: memmove.c win32.h
-mkdir.obj: mkdir.c win32.h
-vsnprintf.obj: vsnprintf.c win32.h
-strcasecmp.obj: strcasecmp.c win32.h
-strncasecmp.obj: strncasecmp.c win32.h
-strchr.obj: strchr.c win32.h
-strdup.obj: strdup.c win32.h
-strerror.obj: strerror.c win32.h
-strftime.obj: strftime.c win32.h
-strstr.obj: strstr.c win32.h
-strtod.obj: strtod.c win32.h
-strtol.obj: strtol.c win32.h
-strtoul.obj: strtoul.c win32.h
-nt.obj: nt.c win32.h
-x68.obj: x68.c win32.h
-os2.obj: os2.c win32.h
-dl_os2.obj: dl_os2.c win32.h
-
-# when I use -I., there is confliction at "OpenFile"
-# so, set . into environment varible "include"
-win32.obj: win32.c win32.h
-
-###
-array.obj: array.c ruby.h config.h defines.h intern.h missing.h util.h st.h win32.h
-bignum.obj: bignum.c ruby.h config.h defines.h intern.h missing.h win32.h
-class.obj: class.c ruby.h config.h defines.h intern.h missing.h rubysig.h node.h st.h win32.h
-compar.obj: compar.c ruby.h config.h defines.h intern.h missing.h win32.h
-dir.obj: dir.c ruby.h config.h defines.h intern.h missing.h util.h win32.h
-dln.obj: dln.c ruby.h config.h defines.h intern.h missing.h dln.h win32.h
-dmyext.obj: dmyext.c
-enum.obj: enum.c ruby.h config.h defines.h intern.h missing.h node.h util.h win32.h
-error.obj: error.c ruby.h config.h defines.h intern.h missing.h env.h st.h win32.h
-eval.obj: eval.c ruby.h config.h defines.h intern.h missing.h node.h env.h util.h rubysig.h st.h dln.h win32.h
-file.obj: file.c ruby.h config.h defines.h intern.h missing.h rubyio.h rubysig.h util.h dln.h win32.h
-gc.obj: gc.c ruby.h config.h defines.h intern.h missing.h rubysig.h st.h node.h env.h re.h regex.h win32.h
-hash.obj: hash.c ruby.h config.h defines.h intern.h missing.h st.h util.h rubysig.h win32.h
-inits.obj: inits.c ruby.h config.h defines.h intern.h missing.h win32.h
-io.obj: io.c ruby.h config.h defines.h intern.h missing.h rubyio.h rubysig.h env.h util.h win32.h
-main.obj: main.c ruby.h config.h defines.h intern.h missing.h win32.h
-marshal.obj: marshal.c ruby.h config.h defines.h intern.h missing.h rubyio.h st.h util.h win32.h
-math.obj: math.c ruby.h config.h defines.h intern.h missing.h win32.h
-numeric.obj: numeric.c ruby.h config.h defines.h intern.h missing.h win32.h
-object.obj: object.c ruby.h config.h defines.h intern.h missing.h st.h util.h win32.h
-pack.obj: pack.c ruby.h config.h defines.h intern.h missing.h win32.h
-parse.obj: parse.c ruby.h config.h defines.h intern.h missing.h env.h node.h st.h regex.h util.h lex.c win32.h
-prec.obj: prec.c ruby.h config.h defines.h intern.h missing.h win32.h
-process.obj: process.c ruby.h config.h defines.h intern.h missing.h rubysig.h st.h win32.h
-random.obj: random.c ruby.h config.h defines.h intern.h missing.h win32.h
-range.obj: range.c ruby.h config.h defines.h intern.h missing.h win32.h
-re.obj: re.c ruby.h config.h defines.h intern.h missing.h re.h regex.h win32.h
-regex.obj: regex.c config.h regex.h win32.h
-ruby.obj: ruby.c ruby.h config.h defines.h intern.h missing.h dln.h node.h util.h win32.h
-signal.obj: signal.c ruby.h config.h defines.h intern.h missing.h rubysig.h win32.h
-sprintf.obj: sprintf.c ruby.h config.h defines.h intern.h missing.h win32.h
-st.obj: st.c config.h st.h
-string.obj: string.c ruby.h config.h defines.h intern.h missing.h re.h regex.h win32.h
-struct.obj: struct.c ruby.h config.h defines.h intern.h missing.h win32.h
-time.obj: time.c ruby.h config.h defines.h intern.h missing.h win32.h
-util.obj: util.c ruby.h config.h defines.h intern.h missing.h util.h win32.h
-variable.obj: variable.c ruby.h config.h defines.h intern.h missing.h env.h node.h st.h util.h win32.h
-version.obj: version.c ruby.h config.h defines.h intern.h missing.h version.h win32.h
+main.$(OBJEXT): win32.h
+array.$(OBJEXT): win32.h
+bignum.$(OBJEXT): win32.h
+class.$(OBJEXT): win32.h
+compar.$(OBJEXT): win32.h
+dir.$(OBJEXT): dir.h win32.h
+dln.$(OBJEXT): win32.h
+enum.$(OBJEXT): win32.h
+error.$(OBJEXT): win32.h
+eval.$(OBJEXT): win32.h
+file.$(OBJEXT): win32.h
+gc.$(OBJEXT): win32.h
+hash.$(OBJEXT): win32.h
+inits.$(OBJEXT): win32.h
+io.$(OBJEXT): win32.h
+marshal.$(OBJEXT): win32.h
+math.$(OBJEXT): win32.h
+numeric.$(OBJEXT): win32.h
+object.$(OBJEXT): win32.h
+pack.$(OBJEXT): win32.h
+parse.$(OBJEXT): win32.h
+process.$(OBJEXT): win32.h
+prec.$(OBJEXT): win32.h
+random.$(OBJEXT): win32.h
+range.$(OBJEXT): win32.h
+re.$(OBJEXT): win32.h
+regex.$(OBJEXT): win32.h
+ruby.$(OBJEXT): win32.h
+signal.$(OBJEXT): win32.h
+sprintf.$(OBJEXT): win32.h
+st.$(OBJEXT): win32.h
+string.$(OBJEXT): win32.h
+struct.$(OBJEXT): win32.h
+time.$(OBJEXT): win32.h
+util.$(OBJEXT): win32.h
+variable.$(OBJEXT): win32.h
+version.$(OBJEXT): win32.h
View
62 bcc32/configure.bat
@@ -8,25 +8,79 @@ echo>> ~tmp~.mak conf = %0
echo>> ~tmp~.mak $(conf:\=/): nul
echo>> ~tmp~.mak @del ~tmp~.mak
echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)setup.mak \
-echo>> ~tmp~.mak bcc32dir="$(@D)" \
:loop
if "%1" == "" goto :end
+if "%1" == "--prefix" goto :prefix
if "%1" == "--srcdir" goto :srcdir
if "%1" == "srcdir" goto :srcdir
if "%1" == "--target" goto :target
if "%1" == "target" goto :target
- echo>> ~tmp~.mak "%1"
+if "%1" == "--with-static-linked-ext" goto :extstatic
+if "%1" == "--program-suffix" goto :suffix
+if "%1" == "--program-name" goto :progname
+if "%1" == "--enable-install-doc" goto :enable-rdoc
+if "%1" == "--disable-install-doc" goto :disable-rdoc
+if "%1" == "-h" goto :help
+if "%1" == "--help" goto :help
+ echo>> ~tmp~.mak "%1" \
shift
goto :loop
:srcdir
- echo>> ~tmp~.mak "srcdir=%2"
+ echo>> ~tmp~.mak -D"srcdir=%2" \
+ shift
+ shift
+goto :loop
+:prefix
+ echo>> ~tmp~.mak -D"prefix=%2" \
+ shift
+ shift
+goto :loop
+:suffix
+ echo>> ~tmp~.mak -D"RUBY_SUFFIX=%2" \
+ shift
+ shift
+goto :loop
+:installname
+ echo>> ~tmp~.mak -D"RUBY_INSTALL_NAME=%2" \
+ shift
+ shift
+goto :loop
+:soname
+ echo>> ~tmp~.mak -D"RUBY_SO_NAME=%2" \
shift
shift
goto :loop
:target
- echo>> ~tmp~.mak %2
+ echo>> ~tmp~.mak "%2" \
shift
shift
goto :loop
+:extstatic
+ echo>> ~tmp~.mak -D"EXTSTATIC=static" \
+ shift
+goto :loop
+:enable-rdoc
+ echo>> ~tmp~.mak -D"RDOCTARGET=install-doc" \
+ shift
+goto :loop
+:disable-rdoc
+ echo>> ~tmp~.mak -D"RDOCTARGET=install-nodoc" \
+ shift
+goto :loop
+:help
+ echo Configuration:
+ echo --help display this help
+ echo --srcdir=DIR find the sources in DIR [configure dir or `..']
+ echo Installation directories:
+ echo --prefix=PREFIX install files in PREFIX [/usr]
+ echo System types:
+ echo --target=TARGET configure for TARGET [i386-bccwin32]
+ echo Optional Package:
+ echo --with-static-linked-ext link external modules statically
+ echo --enable-install-doc install rdoc indexes during install
+ del ~tmp~.mak
+goto :exit
:end
+echo>> ~tmp~.mak bcc32dir="$(@D)"
make -s -f ~tmp~.mak
+:exit
View
29 common.mk
@@ -9,7 +9,6 @@ DMYEXT = dmyext.$(OBJEXT)
MAINOBJ = main.$(OBJEXT)
OBJS = array.$(OBJEXT) \
- ascii.$(OBJEXT) \
bignum.$(OBJEXT) \
class.$(OBJEXT) \
compar.$(OBJEXT) \
@@ -17,7 +16,6 @@ OBJS = array.$(OBJEXT) \
dln.$(OBJEXT) \
enum.$(OBJEXT) \
error.$(OBJEXT) \
- euc_jp.$(OBJEXT) \
eval.$(OBJEXT) \
file.$(OBJEXT) \
gc.$(OBJEXT) \
@@ -35,20 +33,14 @@ OBJS = array.$(OBJEXT) \
random.$(OBJEXT) \
range.$(OBJEXT) \
re.$(OBJEXT) \
- regcomp.$(OBJEXT) \
- regenc.$(OBJEXT) \
- regerror.$(OBJEXT) \
- regexec.$(OBJEXT) \
- regparse.$(OBJEXT) \
+ regex.$(OBJEXT) \
ruby.$(OBJEXT) \
signal.$(OBJEXT) \
- sjis.$(OBJEXT) \
sprintf.$(OBJEXT) \
st.$(OBJEXT) \
string.$(OBJEXT) \
struct.$(OBJEXT) \
time.$(OBJEXT) \
- utf8.$(OBJEXT) \
util.$(OBJEXT) \
variable.$(OBJEXT) \
version.$(OBJEXT) \
@@ -198,8 +190,6 @@ win32.$(OBJEXT): {$(VPATH)}win32.c
array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}util.h {$(VPATH)}st.h
-ascii.$(OBJEXT): {$(VPATH)}ascii.c {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h config.h
bignum.$(OBJEXT): {$(VPATH)}bignum.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h config.h \
@@ -220,8 +210,6 @@ enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h config.h \
error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}env.h {$(VPATH)}st.h
-euc_jp.$(OBJEXT): {$(VPATH)}euc_jp.c {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h
eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}env.h {$(VPATH)}util.h \
@@ -273,24 +261,13 @@ range.$(OBJEXT): {$(VPATH)}range.c {$(VPATH)}ruby.h config.h \
re.$(OBJEXT): {$(VPATH)}re.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}re.h {$(VPATH)}regex.h
-regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}oniguruma.h \
- {$(VPATH)}regint.h {$(VPATH)}regparse.h {$(VPATH)}regenc.h config.h
-regenc.$(OBJEXT): {$(VPATH)}regenc.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h config.h
-regerror.$(OBJEXT): {$(VPATH)}regerror.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h config.h
-regexec.$(OBJEXT): {$(VPATH)}regexec.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h config.h
-regparse.$(OBJEXT): {$(VPATH)}regparse.c {$(VPATH)}oniguruma.h \
- {$(VPATH)}regint.h {$(VPATH)}regparse.h {$(VPATH)}regenc.h config.h
+regex.$(OBJEXT): {$(VPATH)}regex.c config.h {$(VPATH)}regex.h
ruby.$(OBJEXT): {$(VPATH)}ruby.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}dln.h {$(VPATH)}node.h {$(VPATH)}util.h
signal.$(OBJEXT): {$(VPATH)}signal.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}rubysig.h
-sjis.$(OBJEXT): {$(VPATH)}sjis.c {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h config.h
sprintf.$(OBJEXT): {$(VPATH)}sprintf.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
st.$(OBJEXT): {$(VPATH)}st.c config.h {$(VPATH)}st.h
@@ -301,8 +278,6 @@ struct.$(OBJEXT): {$(VPATH)}struct.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
time.$(OBJEXT): {$(VPATH)}time.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-utf8.$(OBJEXT): {$(VPATH)}utf8.c {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h config.h
util.$(OBJEXT): {$(VPATH)}util.c {$(VPATH)}ruby.h config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}util.h
View
30 configure.in
@@ -192,6 +192,15 @@ AC_PROG_MAKE_SET
AC_AIX
AC_MINIX
+AC_SUBST(RM, ['rm -f'])
+AC_SUBST(CP, ['cp -v'])
+AC_SUBST(INSTALL, ['install -vp'])
+if $as_mkdir_p; then
+ AC_SUBST(MAKEDIRS, ['mkdir -p'])
+else
+ AC_SUBST(MAKEDIRS, ['install -d'])
+fi
+
dnl check for large file stuff
AC_SYS_LARGEFILE
@@ -246,7 +255,7 @@ if test "$rb_cv_stdarg" = yes; then
fi
AC_CACHE_CHECK([for noreturn], rb_cv_noreturn,
-[rb_cv_noreturn=no
+[rb_cv_noreturn=x
for mac in "x __attribute__ ((noreturn))" "__declspec(noreturn) x" x; do
AC_TRY_COMPILE(
[#define NORETURN(x) $mac
@@ -830,6 +839,7 @@ if test "$with_dln_a_out" != yes; then
hpux*) DLDFLAGS="$DLDFLAGS -E"
: ${LDSHARED='ld -b'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
+ : ${LIBPATHENV=SHLIB_PATH}
rb_cv_dlopen=yes;;
solaris*) if test "$GCC" = yes; then
: ${LDSHARED='$(CC) -Wl,-G'}
@@ -891,6 +901,7 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes ;;
darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'}
: ${LDFLAGS=""}
+ : ${LIBPATHENV=DYLD_LIBRARY_PATH}
rb_cv_dlopen=yes ;;
aix*) : ${LDSHARED='/usr/ccs/bin/ld'}
XLDFLAGS="$XLDFLAGS -Wl,-bE:ruby.imp"
@@ -899,6 +910,7 @@ if test "$with_dln_a_out" != yes; then
: ${ARCHFILE="ruby.imp"}
TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS) $(CFLAGS)'
TRY_LINK="$TRY_LINK"' $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
+ : ${LIBPATHENV=SHLIB_PATH}
rb_cv_dlopen=yes ;;
human*) : ${DLDFLAGS=''}
@@ -916,6 +928,7 @@ if test "$with_dln_a_out" != yes; then
DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
;;
esac
+ : ${LIBPATHENV=LIBRARY_PATH}
rb_cv_dlopen=yes ;;
nto-qnx*) DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
: ${LDSHARED='ld -Bshareable -x'}
@@ -924,6 +937,7 @@ if test "$with_dln_a_out" != yes; then
cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x02000000"
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-import,--export-all"
+ : ${LIBPATHENV=""}
rb_cv_dlopen=yes ;;
hiuxmpp) : ${LDSHARED='ld -r'} ;;
atheos*) : ${LDSHARED="$CC -shared"}
@@ -945,6 +959,7 @@ fi
AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
+AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
AC_SUBST(TRY_LINK)
dln_a_out_works=no
@@ -1103,12 +1118,16 @@ fi
if test x"$cross_compiling" = xyes; then
test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
PREP=fake.rb
+ RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
else
MINIRUBY='./miniruby$(EXEEXT)'
- PREP=''
+ PREP='miniruby$(EXEEXT)'
+ RUNRUBY='$(MINIRUBY) $(srcdir)/runruby.rb --extout=$(EXTOUT) --'
fi
AC_SUBST(MINIRUBY)
AC_SUBST(PREP)
+AC_SUBST(RUNRUBY)
+AC_SUBST(EXTOUT, [${EXTOUT-.ext}])
FIRSTMAKEFILE=""
LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
@@ -1474,5 +1493,10 @@ else
fi
: > confdefs.h
-AC_CONFIG_FILES([$FIRSTMAKEFILE Makefile])
+AC_CONFIG_FILES($FIRSTMAKEFILE)
+AC_CONFIG_FILES(Makefile, [{
+ echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
+ test "$RUBY_INSTALL_NAME$EXEEXT" = ruby || echo 'ruby: $(PROGRAM);'
+ sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
+} >> Makefile], [RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT])
AC_OUTPUT
View
17 cygwin/GNUmakefile.in
@@ -1,11 +1,14 @@
include Makefile
ENABLE_SHARED=@ENABLE_SHARED@
+DLLWRAP = @DLLWRAP@ --target=@target_os@
ifeq (@target_os@,cygwin)
DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
+ DLLWRAP += -mno-cygwin
+ VPATH += $(srcdir)/win32
endif
ifneq ($(ENABLE_SHARED),yes)
@@ -24,6 +27,10 @@ endif
WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
+RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
+
+ruby: $(PROGRAM)
+rubyw: $(WPROGRAM)
$(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
$(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
@@ -31,7 +38,7 @@ $(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
%.res.@OBJEXT@: %.rc
@WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
-$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc: rbconfig.rb
+$(RCFILES): $(RBCONFIG)
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(DLL_BASE_NAME) \
@@ -44,7 +51,7 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
- @DLLWRAP@ --target=@target_os@ --driver-name=$(CC) \
+ $(DLLWRAP) \
--output-exp=$(RUBY_EXP) \
--export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)
$(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)
@@ -63,3 +70,9 @@ cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR).dll: $(LIBRUBY_A)
@DLLWRAP@ -s --def=rubydll.def -o $@
@rm -f rubydll.def
endif
+
+clean-local::
+ @$(RM) $(RUBY_EXP) $(RCFILES:.rc=.res.@OBJEXT@)
+
+distclean-local::
+ @$(RM) $(RCFILES)
View
258 ext/extmk.rb
@@ -16,6 +16,8 @@
alias $0 $progname
$extlist = []
+$extupdate = false
+$compiled = {}
$:.replace ["."]
require 'rbconfig'
@@ -24,12 +26,11 @@
$:.replace [srcdir, srcdir+"/lib", "."]
-require 'mkmf'
-require 'getopts'
-
$topdir = "."
$top_srcdir = srcdir
-$hdrdir = $top_srcdir
+
+require 'mkmf'
+require 'optparse/shellwords'
def sysquote(x)
@quote ||= /human|os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
@@ -44,6 +45,43 @@ def relative_from(path, base)
end
end
+def extract_makefile(makefile, keep = true)
+ m = File.read(makefile)
+ if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
+ return keep
+ end
+ installrb = {}
+ m.scan(/^install-rb-default:[ \t]*(\S+)\n\1:[ \t]*(\S+)/) {installrb[$2] = $1}
+ oldrb = installrb.keys.sort
+ newrb = install_rb(nil, "").collect {|d, *f| f}.flatten.sort
+ if target_prefix = m[/^target_prefix[ \t]*=[ \t]*\/(.*)/, 1]
+ target = "#{target_prefix}/#{target}"
+ end
+ unless oldrb == newrb
+ if $extout
+ newrb.each {|f| installrb.delete(f)}
+ unless installrb.empty?
+ config = CONFIG.dup
+ install_dirs(target_prefix).each {|var, val| config[var] = val}
+ FileUtils.rm_f(installrb.values.collect {|f| Config.expand(f, config)}, :verbose => true)
+ end
+ end
+ return false
+ end
+ $target = target
+ /^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = nil
+ $preload = Shellwords.shellwords(m[/^preload[ \t]*=[ \t]*(.*)/, 1] || "")
+ $DLDFLAGS += " " + (m[/^DLDFLAGS[ \t]*=[ \t]*(.*)/, 1] || "")
+ if s = m[/^LIBS[ \t]*=[ \t]*(.*)/, 1]
+ s.sub!(/^#{Regexp.quote($LIBRUBYARG)} */, "")
+ s.sub!(/ *#{Regexp.quote($LIBS)}$/, "")
+ $libs = s
+ end
+ $LOCAL_LIBS = m[/^LOCAL_LIBS[ \t]*=[ \t]*(.*)/, 1] || ""
+ $LIBPATH = Shellwords.shellwords(m[/^libpath[ \t]*=[ \t]*(.*)/, 1] || "") - %w[$(libdir) $(topdir)]
+ true
+end
+
def extmake(target)
print "#{$message} #{target}\n"
$stdout.flush
@@ -57,8 +95,7 @@ def extmake(target)
return true if $nodynamic and not $static
end
- init_mkmf
-
+ FileUtils.mkpath target unless File.directory?(target)
begin
dir = Dir.pwd
FileUtils.mkpath target unless File.directory?(target)
@@ -72,18 +109,21 @@ def extmake(target)
$mdir = target
$srcdir = File.join($top_srcdir, "ext", $mdir)
$preload = nil
+ $compiled[target] = false
makefile = "./Makefile"
+ ok = File.exist?(makefile)
unless $ignore
- if $static ||
- !(t = modified?(makefile, MTIMES)) ||
- %W<#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb
- #{$srcdir}/depend>.any? {|f| modified?(f, [t])}
- then
- $defs = []
- Logging::logfile 'mkmf.log'
- Config::CONFIG["srcdir"] = $srcdir
- rm_f makefile
- begin
+ Config::CONFIG["srcdir"] = $srcdir
+ Config::CONFIG["topdir"] = $topdir
+ begin
+ if (!(ok &&= extract_makefile(makefile)) ||
+ !(t = modified?(makefile, MTIMES)) ||
+ %W"#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb #{$srcdir}/depend".any? {|f| modified?(f, [t])})
+ then
+ ok = false
+ init_mkmf
+ Logging::logfile 'mkmf.log'
+ rm_f makefile
if File.exist?($0 = "#{$srcdir}/makefile.rb")
load $0
elsif File.exist?($0 = "#{$srcdir}/extconf.rb")
@@ -91,31 +131,38 @@ def extmake(target)
else
create_makefile(target)
end
- File.exist?(makefile)
- rescue SystemExit
- # ignore
- ensure
- rm_f "conftest*"
- $0 = $PROGRAM_NAME
- Config::CONFIG["srcdir"] = $top_srcdir
+ $extupdate = true
+ ok = File.exist?(makefile)
end
- else
- true
+ rescue SystemExit
+ # ignore
+ ensure
+ rm_f "conftest*"
+ config = $0
+ $0 = $PROGRAM_NAME
+ Config::CONFIG["srcdir"] = $top_srcdir
+ Config::CONFIG["topdir"] = topdir
+ end
+ end
+ ok = yield(ok) if block_given?
+ unless ok
+ open(makefile, "w") do |f|
+ f.print dummy_makefile($srcdir)
end
- else
- File.exist?(makefile)
- end or open(makefile, "w") do |f|
- f.print dummy_makefile($srcdir)
return true
end
args = sysquote($mflags)
if $static
- args += ["static"]
+ args += ["static"] unless $clean
$extlist.push [$static, $target, File.basename($target), $preload]
end
unless system($make, *args)
$ignore or $continue or return false
end
+ $compiled[target] = true
+ if $clean and $clean != true
+ File.unlink(makefile) rescue nil
+ end
if $static
$extflags ||= ""
$extlibs ||= []
@@ -131,24 +178,65 @@ def extmake(target)
$topdir = topdir
Dir.chdir dir
end
+ begin
+ Dir.rmdir target
+ target = File.dirname(target)
+ rescue SystemCallError
+ break
+ end while true
true
end
+def compiled?(target)
+ $compiled[target]
+end
+
def parse_args()
- getopts('n', 'extstatic:', 'dest-dir:',
- 'make:', 'make-flags:', 'mflags:')
-
- $dryrun = $OPT['n']
- $force_static = $OPT['extstatic'] == 'static'
- $destdir = $OPT['dest-dir'] || ''
- $make = $OPT['make'] || $make || 'make'
- mflags = ($OPT['make-flags'] || '').strip
- mflags = ($OPT['mflags'] || '').strip if mflags.empty?
-
- $mflags = Shellwords.shellwords(mflags)
- if arg = $mflags.first
- arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
+ $mflags = []
+
+ opts = nil
+ $optparser ||= OptionParser.new do |opts|
+ opts.on('-n') {$dryrun = true}
+ opts.on('--[no-]extension [EXTS]', Array) do |v|
+ $extension = (v == false ? [] : v)
+ end
+ opts.on('--[no-]extstatic [STATIC]', Array) do |v|
+ if ($extstatic = v) == false
+ $extstatic = []
+ elsif v
+ $force_static = true
+ $extstatic.delete("static")
+ $extstatic = nil if $extstatic.empty?
+ end
+ end
+ opts.on('--dest-dir=DIR') do |v|
+ $destdir = v
+ end
+ opts.on('--extout=DIR') do |v|
+ $extout = (v unless v.empty?)
+ end
+ opts.on('--make=MAKE') do |v|
+ $make = v || 'make'
+ end
+ opts.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
+ if arg = v.first
+ arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
+ end
+ $mflags.concat(v)
+ end
+ opts.on('--message [MESSAGE]', String) do |v|
+ $message = v
+ end
end
+ begin
+ $optparser.parse!(ARGV)
+ rescue OptionParser::InvalidOption => e
+ retry if /^--/ =~ e.args[0]
+ $optparser.warn(e)
+ abort opts.to_s
+ end
+
+ $destdir ||= ''
$make, *rest = Shellwords.shellwords($make)
$mflags.unshift(*rest) unless rest.empty?
@@ -173,24 +261,33 @@ def $mflags.defined?(var)
$destdir = File.expand_path($destdir)
$mflags.defined?("DESTDIR") or $mflags << "DESTDIR=#{$destdir}"
end
+ if $extout
+ $extout = '$(topdir)/'+$extout
+ $extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
+ $mflags << "extout=#$extout" << "extout_prefix=#$extout_prefix"
+ end
end
parse_args()
+if target = ARGV.shift and /^[a-z-]+$/ =~ target
+ $mflags.push(target)
+ target = target.sub(/^(dist|real)(?=(?:clean)?$)/, '')
+ case target
+ when /clean/
+ $ignore ||= true
+ $clean = $1 ? $1[0] : true
+ when /^install\b/
+ $install = true
+ $ignore ||= true
+ $mflags.unshift("INSTALL_PROG=install -c -p -m 0755",
+ "INSTALL_DATA=install -c -p -m 0644",
+ "MAKEDIRS=mkdir -p") if $dryrun
+ end
+end
unless $message
- if $message = ARGV.shift and /^[a-z]+$/ =~ $message
- $mflags.push($message)
- $message = $message.sub(/^(?:dist|real)(?=(?:clean)?$)/, '\1')
- case $message
- when "clean"
- $ignore ||= true
- when "install"
- $ignore ||= true
- $mflags.unshift("INSTALL_PROG=install -c -p -m 0755",
- "INSTALL_DATA=install -c -p -m 0644",
- "MAKEDIRS=mkdir -p") if $dryrun
- end
- $message.sub!(/e?$/, "ing")
+ if target
+ $message = target.sub(/^(\w+)e?\b/, '\1ing').tr('-', ' ')
else
$message = "compiling"
end
@@ -204,13 +301,19 @@ def $mflags.defined?(var)
else
$ruby = '$(topdir)/miniruby' + EXEEXT
end
-$ruby << " -I$(topdir) -I$(hdrdir)/lib"
+$ruby << " -I'$(topdir)' -I'$(hdrdir)/lib'"
$config_h = '$(topdir)/config.h'
MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)}
# get static-link modules
$static_ext = {}
+if $extstatic
+ $extstatic.each do |target|
+ target = target.downcase if /mswin32|bccwin32/ =~ RUBY_PLATFORM
+ $static_ext[target] = $static_ext.size
+ end
+end
for dir in ["ext", File::join($top_srcdir, "ext")]
setup = File::join(dir, CONFIG['setup'])
if File.file? setup
@@ -228,13 +331,34 @@ def $mflags.defined?(var)
next
end
target = target.downcase if /mswin32|bccwin32/ =~ RUBY_PLATFORM
- $static_ext[target] = true
+ $static_ext[target] = $static_ext.size
end
MTIMES << f.mtime
$setup = setup
f.close
break
end
+end unless $extstatic
+
+ext_prefix = "#{$top_srcdir}/ext"
+exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t}
+exts |= $extension if $extension
+exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d|
+ d = File.dirname(d)
+ d.slice!(0, ext_prefix.length + 1)
+ d
+}.sort unless $extension
+
+if $extout
+ Config.expand(extout = "#$extout", Config::CONFIG.merge("topdir"=>$topdir))
+ if $install
+ Config.expand(dest = "#{$destdir}#{$rubylibdir}")
+ FileUtils.cp_r(extout+"/.", dest, :verbose => true, :noop => $dryrun)
+ exit
+ end
+ unless $ignore
+ FileUtils.mkpath(extout)
+ end
end
dir = Dir.pwd
@@ -242,17 +366,19 @@ def $mflags.defined?(var)
Dir::chdir('ext')
$hdrdir = $top_srcdir = relative_from(srcdir, $topdir = "..")
-ext_prefix = "#{$top_srcdir}/ext"
-Dir.glob("#{ext_prefix}/*/**/extconf.rb") do |d|
- d = File.dirname(d)
- d.slice!(0, ext_prefix.length + 1)
- extmake(d) or exit(1)
+exts.each do |d|
+ extmake(d) or abort
end
$hdrdir = $top_srcdir = srcdir
$topdir = "."
if $ignore
+ FileUtils.rm_f(%W"extinit.c extinit.#{$OBJEXT}") if $clean
Dir.chdir ".."
+ if $clean
+ Dir.rmdir('ext') rescue nil
+ FileUtils.rm_rf(extout) if $extout
+ end
exit
end
@@ -305,11 +431,13 @@ def $mflags.defined?(var)
end
rubies = []
%w[RUBY RUBYW].each {|r|
- config_string(r+"_INSTALL_NAME", Config::CONFIG) {|r| rubies << r+EXEEXT}
+ if r = arg_config("--"+r.downcase) || config_string(r+"_INSTALL_NAME")
+ rubies << r+EXEEXT
+ end
}
Dir.chdir ".."
-if $extlist.size > 0
+if !$extlist.empty? and $extupdate
rm_f(Config::CONFIG["LIBRUBY_SO"])
end
puts "making #{rubies.join(', ')}"
View
64 instruby.rb
@@ -7,27 +7,32 @@
$:.unshift File.join(srcdir, "lib")
require 'fileutils'
require 'shellwords'
-require 'getopts'
+require 'optparse'
+require 'optparse/shellwords'
require 'tempfile'
+STDOUT.sync = true
File.umask(0)
def parse_args()
- getopts('n', 'dest-dir:',
- 'make:', 'make-flags:', 'mflags:',
- 'mantype:doc')
-
- $dryrun = $OPT['n']
- $destdir = $OPT['dest-dir'] || ''
- $make = $OPT['make'] || $make || 'make'
- $mantype = $OPT['mantype']
- mflags = ($OPT['make-flags'] || '').strip
- mflags = ($OPT['mflags'] || '').strip if mflags.empty?
-
- $mflags = Shellwords.shellwords(mflags)
- if arg = $mflags.first
- arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
+ $mantype = 'doc'
+ $destdir = nil
+ $make = 'make'
+ $mflags = []
+ $install = []
+ opt = OptionParser.new
+ opt.on('-n') {$dryrun = true}
+ opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
+ opt.on('--make=COMMAND') {|make| $make = make}
+ opt.on('--mantype=MAN') {|man| $mantype = man}
+ opt.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
+ if arg = v.first
+ arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
+ end
+ $mflags.concat(v)
end
+ opt.on('--install=TYPE', [:bin, :lib, :man]) {|ins| $install << ins}
+ opt.parse! rescue abort [$!.message, opt].join("\n")
$make, *rest = Shellwords.shellwords($make)
$mflags.unshift(*rest) unless rest.empty?
@@ -55,6 +60,10 @@ def $mflags.set?(flag)
@fileutils_output = STDOUT
@fileutils_label = ''
+def install?(type)
+ yield if $install.empty? or $install.include?(type)
+end
+
def install(src, dest, options = {})
options[:preserve] = true
super
@@ -99,11 +108,29 @@ def with_destdir(dir)
makedirs [bindir, libdir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir]
+install?(:bin) do
ruby_bin = File.join(bindir, ruby_install_name)
+major = CONFIG["MAJOR"]
+minor = CONFIG["MINOR"]
+teeny = CONFIG["TEENY"]
+os = CONFIG["target_os"]
+suffixes = %W[#{major}#{minor} #{major}#{minor}#{teeny}
+#{major}#{minor}-#{os} #{major}#{minor}#{teeny}-#{os}
+-#{major}.#{minor} -#{major}.#{minor}.#{teeny}
+]
+def suffixes.link(bin)
+ each do |suf|
+ ln(bin+exeext, bin+suf+exeext, force: true)
+ end
+rescue NotImplementedError
+end
+
install ruby_install_name+exeext, ruby_bin+exeext, :mode => 0755
+suffixes.link(ruby_bin)
if rubyw_install_name and !rubyw_install_name.empty?
install rubyw_install_name+exeext, bindir, :mode => 0755
+ suffixes.link(File.join(bindir, rubyw_install_name))
end
install dll, bindir, :mode => 0755 if enable_shared and dll != lib
install lib, libdir, :mode => 0755 unless lib == arc
@@ -121,9 +148,11 @@ def with_destdir(dir)
ln_sf(dll, File.join(libdir, link))
end
end
+end
Dir.chdir srcdir
+install?(:lib) do
ruby_shebang = File.join(CONFIG["bindir"], ruby_install_name)
if File::ALT_SEPARATOR
ruby_bin_dosish = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR)
@@ -176,7 +205,9 @@ def with_destdir(dir)
makedirs dir
install f, dir, :mode => 0644
end
+end
+install?(:bin) do
for f in Dir["*.h"]
install f, archlibdir, :mode => 0644
end
@@ -185,7 +216,9 @@ def with_destdir(dir)
makedirs File.join(archlibdir, "win32")
install "win32/win32.h", File.join(archlibdir, "win32"), :mode => 0644
end
+end
+install?(:man) do
for mdoc in Dir["*.[1-9]"]
next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == '.'}
@@ -212,5 +245,6 @@ def with_destdir(dir)
install w.path, destfile, :mode => 0644
end
end
+end
# vi:set sw=2:
View
261 lib/mkmf.rb
@@ -40,7 +40,6 @@
end
end
-$srcdir = nil
$libdir = CONFIG["libdir"]
$rubylibdir = CONFIG["rubylibdir"]
$archdir = CONFIG["archdir"]
@@ -55,6 +54,8 @@
$human = /human/ =~ RUBY_PLATFORM
$netbsd = /netbsd/ =~ RUBY_PLATFORM
$os2 = /os2/ =~ RUBY_PLATFORM
+$beos = /beos/ =~ RUBY_PLATFORM
+$solaris = /solaris/ =~ RUBY_PLATFORM
def config_string(key, config = CONFIG)
s = config[key] and !s.empty? and block_given? ? yield(s) : s
@@ -73,6 +74,32 @@ def dir_re(dir)
[dir_re('sitearchdir'), "$(RUBYARCHDIR)"]
]
+def install_dirs(target_prefix = nil)
+ if $extout
+ dirs = [
+ ['RUBYCOMMONDIR', '$(extout)'],
+ ['RUBYLIBDIR', '$(extout)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
+ ['extout', "#$extout"],
+ ['extout_prefix', "#$extout_prefix"],
+ ]
+ elsif $extmk
+ dirs = [
+ ['RUBYCOMMONDIR', '$(rubylibdir)'],
+ ['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
+ ]
+ else
+ dirs = [
+ ['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
+ ['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
+ ['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
+ ]
+ end
+ dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
+ dirs
+end
+
def map_dir(dir, map = nil)
map ||= INSTALL_DIRS
map.inject(dir) {|dir, (orig, new)| dir.gsub(orig, new)}
@@ -290,6 +317,30 @@ def cpp_include(header)
end
end
+def with_cppflags(flags)
+ cppflags = $CPPFLAGS
+ $CPPFLAGS = flags
+ ret = yield
+ensure
+ $CPPFLAGS = cppflags unless ret
+end
+
+def with_cflags(flags)
+ cflags = $CFLAGS
+ $CFLAGS = flags
+ ret = yield
+ensure
+ $CFLAGS = cflags unless ret
+end
+
+def with_ldflags(flags)
+ ldflags = $LDFLAGS
+ $LDFLAGS = flags
+ ret = yield
+ensure
+ $LDFLAGS = ldflags unless ret
+end
+
def try_static_assert(expr, headers = nil, opt = "", &b)
headers = cpp_include(headers)
try_compile(<<SRC, opt, &b)
@@ -435,7 +486,7 @@ def install_files(mfile, ifiles, map = nil, srcprefix = nil)
ifiles.each do |files, dir, prefix|
dir = map_dir(dir, map)
prefix = %r|\A#{Regexp.quote(prefix)}/?| if prefix
- if( files[0,2] == "./" )
+ if /\A\.\// =~ files
# install files which are in current working directory.
files = files[2..-1]
len = nil
@@ -576,6 +627,25 @@ def have_header(header, &b)
end
end
+def find_header(header, *paths)
+ checking_for header do
+ if try_cpp(cpp_include(header))
+ true
+ else
+ found = false
+ paths.each do |dir|
+ opt = "-I#{dir}".quote
+ if try_cpp(cpp_include(header), opt)
+ $INCFLAGS << " " << opt
+ found = true
+ break
+ end
+ end
+ found
+ end
+ end
+end
+
def have_struct_member(type, member, header = nil, &b)
checking_for "#{type}.#{member}" do
if try_compile(<<"SRC", &b)
@@ -761,6 +831,13 @@ def winsep(s)
def configuration(srcdir)
mk = []
+ vpath = %w[$(srcdir) $(topdir) $(hdrdir)]
+ if !CROSS_COMPILING && CONFIG['build_os'] == 'cygwin' && CONFIG['target_os'] != 'cygwin'
+ vpath.each {|p| p.sub!(/.*/, '$(shell cygpath -u \&)')}
+ end
+ if !CROSS_COMPILING && CONFIG['build_os'] == 'msdosdjgpp'
+ CONFIG['PATH_SEPARATOR'] = ';'
+ end
mk << %{
SHELL = /bin/sh
@@ -769,7 +846,7 @@ def configuration(srcdir)
srcdir = #{srcdir}
topdir = #{$topdir}
hdrdir = #{$extmk ? $hdrdir : '$(topdir)'}
-VPATH = #{$mingw && CONFIG['build_os'] == 'cygwin' ? '$(shell cygpath -u $(srcdir))' : '$(srcdir)'}
+VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/
if destdir = CONFIG["prefix"].scan(drive)[0] and !destdir.empty?
@@ -806,13 +883,16 @@ def configuration(srcdir)
ruby_version = #{Config::CONFIG['ruby_version']}
ruby = #{$ruby}
RUBY = #{($nmake && !$extmk && !$configure_args.has_key?('--ruby')) ? '$(ruby:/=\)' : '$(ruby)'}
-RM = $(RUBY) -run -e rm -- -f
-MAKEDIRS = $(RUBY) -run -e mkdir -- -p
-INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755
-INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644
+RM = #{config_string('RM') || '$(RUBY) -run -e rm -- -f'}
+MAKEDIRS = #{config_string('MAKEDIRS') || '$(RUBY) -run -e mkdir -- -p'}
+INSTALL = #{config_string('INSTALL') || '$(RUBY) -run -e install -- -vp'}
+INSTALL_PROG = $(INSTALL) -m 0755
+INSTALL_DATA = $(INSTALL) -m 0644
+COPY = #{config_string('COPY') || '$(RUBY) -run -e cp -- -v'}
#### End of system configuration section. ####
+preload = #{$preload.join(" ") if $preload}
}
if $nmake == ?b
mk.each do |x|
@@ -827,7 +907,13 @@ def configuration(srcdir)
end
def dummy_makefile(srcdir)
- configuration(srcdir) << "all install: Makefile\n" << CLEANINGS
+ configuration(srcdir) << <<RULES << CLEANINGS
+CLEANFILES = #{$cleanfiles.join(' ')}
+DISTCLEANFILES = #{$distcleanfiles.join(' ')}
+
+all install static install-so install-rb: Makefile
+
+RULES
end
def create_makefile(target, srcprefix = nil)
@@ -892,12 +978,15 @@ def create_makefile(target, srcprefix = nil)
mfile = open("Makefile", "wb")
mfile.print configuration(srcdir)
mfile.print %{
+libpath = #{$LIBPATH.join(" ")}
LIBPATH = #{libpath}
DEFFILE = #{deffile}
CLEANFILES = #{$cleanfiles.join(' ')}
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
+extout = #{$extout}
+extout_prefix = #{$extout_prefix}
target_prefix = #{target_prefix}
LOCAL_LIBS = #{$LOCAL_LIBS}
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
@@ -905,62 +994,63 @@ def create_makefile(target, srcprefix = nil)
OBJS = #{$objs}
TARGET = #{target}
DLLIB = #{dllib}
-STATIC_LIB = #{staticlib}
-}
- if $extmk
- mfile.print %{
-RUBYCOMMONDIR = $(rubylibdir)
-RUBYLIBDIR = $(rubylibdir)$(target_prefix)
-RUBYARCHDIR = $(archdir)$(target_prefix)
-}
- else
- mfile.print %{
-RUBYCOMMONDIR = $(sitedir)$(target_prefix)
-RUBYLIBDIR = $(sitelibdir)$(target_prefix)
-RUBYARCHDIR = $(sitearchdir)$(target_prefix)
+STATIC_LIB = #{staticlib unless $static.nil?}
+
}
- end
+ install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
+ n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET).'
mfile.print %{
-CLEANLIBS = "$(TARGET).{lib,exp,il?,tds,map}" $(DLLIB)
-CLEANOBJS = "*.{#{$OBJEXT},#{$LIBEXT},s[ol],pdb,bak}"
+TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB)
+CLEANLIBS = #{n}#{CONFIG['DLEXT']} #{n}il? #{n}tds #{n}map
+CLEANOBJS = *.#{$OBJEXT} *.#{$LIBEXT} *.s[ol] *.pdb *.exp *.bak
-all: #{target ? "$(DLLIB)" : "Makefile"}
-static: $(STATIC_LIB)
+all: #{target ? $extout ? "install" : "$(DLLIB)" : "Makefile"}
+static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
}
mfile.print CLEANINGS
dirs = []
- if not $static and target
- dirs << (dir = "$(RUBYARCHDIR)")
- mfile.print("install: #{dir}\n")
+ mfile.print "install: install-so install-rb\n\n"
+ sodir = dir = "$(RUBYARCHDIR)"
+ mfile.print("install-so: #{dir}\n")
+ if target
f = "$(DLLIB)"
dest = "#{dir}/#{f}"
- mfile.print "install: #{dest}\n"
- mfile.print "#{dest}: #{f} #{dir}\n\t@$(INSTALL_PROG) #{f} #{dir}\n"
+ mfile.print "install-so: #{dest}\n"
+ unless $extout
+ mfile.print "#{dest}: #{f}\n\t@$(INSTALL_PROG) #{f} #{dir}\n"
+ end
end
- for i in [[["lib/**/*.rb", "$(RUBYLIBDIR)", "lib"]], $INSTALLFILES]
+ dirs << (dir = "$(RUBYLIBDIR)")
+ mfile.print("install-rb: install-rb-default\n")
+ mfile.print("install-rb-default: #{dir}\n")
+ for sfx, i in [["-default", [["lib/**/*.rb", "$(RUBYLIBDIR)", "lib"]]], ["", $INSTALLFILES]]
files = install_files(mfile, i, nil, srcprefix) or next
for dir, *files in files
unless dirs.include?(dir)
dirs << dir
- mfile.print("install: #{dir}\n")
+ mfile.print "install-rb#{sfx}: #{dir}\n"
end
files.each do |f|
dest = "#{dir}/#{File.basename(f)}"
- mfile.print("install: #{dest}\n")
- mfile.print("#{dest}: #{f} #{dir}\n\t@$(INSTALL_DATA) #{f} #{dir}\n")
+ mfile.print("install-rb#{sfx}: #{dest}\n")
+ mfile.print("#{dest}: #{f}\n\t@$(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} #{dir}\n")
end
end
end
- if dirs.empty?
- mfile.print("install:\n")
- else
- dirs.each {|dir| mfile.print "#{dir}:\n\t@$(MAKEDIRS) #{dir}\n"}
- end
+ dirs.unshift(sodir) if target and !dirs.include?(sodir)
+ dirs.each {|dir| mfile.print "#{dir}:\n\t@$(MAKEDIRS) $@\n"}
+
+ mfile.print <<-SITEINSTALL
- mfile.print "\nsite-install: install\n\n"
+site-install: site-install-so site-install-rb
+site-install-so: install-so
+site-install-rb: install-rb
+
+ SITEINSTALL
return unless target
+ mfile.puts SRC_EXT.collect {|ext| ".path.#{ext} = $(VPATH)"} if $nmake == ?b
mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
mfile.print "\n"
@@ -977,18 +1067,17 @@ def create_makefile(target, srcprefix = nil)
end
end
- if makedef
- mfile.print "$(DLLIB): $(OBJS) $(DEFFILE)\n\t"
- else
- mfile.print "$(DLLIB): $(OBJS)\n\t"
- end
+ mfile.print "$(RUBYARCHDIR)/" if $extout
+ mfile.print "$(DLLIB): ", (makedef ? "$(DEFFILE) " : ""), "$(OBJS)\n\t"
mfile.print "@-$(RM) $@\n\t"
- mfile.print "@-$(RM) $(TARGET).lib\n\t" if $mswin
+ mfile.print "@-$(MAKEDIRS) $(@D)\n\t" if $extout
mfile.print LINK_SO, "\n\n"
- mfile.print "$(STATIC_LIB): $(OBJS)\n\t"
- mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
- if ranlib = config_string('RANLIB')
- mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
+ unless $static.nil?
+ mfile.print "$(STATIC_LIB): $(OBJS)\n\t"
+ mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
+ config_string('RANLIB') do |ranlib|
+ mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
+ end
end
mfile.print "\n\n"
if makedef
@@ -1000,15 +1089,53 @@ def create_makefile(target, srcprefix = nil)
if File.exist?(depend)
open(depend, "r") do |dfile|
mfile.printf "###\n"
+ cont = implicit = nil
+ impconv = proc do
+ COMPILE_RULES.each {|rule| mfile.print(rule % implicit[0], implicit[1])}
+ implicit = nil
+ end
+ ruleconv = proc do |line|
+ if implicit
+ if /\A\t/ =~ line
+ implicit[1] << line
+ next
+ else
+ impconv[]
+ end
+ end
+ if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line)
+ implicit = [[m[1], m[2]], [m.post_match]]
+ next
+ elsif RULE_SUBST and /\A[$\w][^#]*:/ =~ line
+ line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+ end
+ mfile.print line
+ end
while line = dfile.gets()
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
- if $nmake
- line.gsub!(%r"(\s)([^\s\/]+\.(?:#{(SRC_EXT + ['h']).join('|')}))(?=\s|\z)", '\1{.;$(VPATH)}\2')
- end
line.gsub!(/\$\(hdrdir\)\/config.h/, $config_h) if $config_h
- mfile.print line
+ if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line
+ (cont ||= []) << line
+ next
+ elsif cont
+ line = (cont << line).join
+ cont = nil
+ end
+ ruleconv.call(line)
+ end
+ if cont
+ ruleconv.call(cont.join)
+ elsif implicit
+ impconv.call
end
end
+ else
+ headers = %w[ruby.h defines.h]
+ if RULE_SUBST
+ headers.each {|h| h.sub!(/.*/) {|*m| RULE_SUBST % m}}
+ end
+ headers << $config_h if $config_h
+ mfile.print "$(OBJS): ", headers.join(' '), "\n"
end
$makefile_created = true
@@ -1044,14 +1171,17 @@ def init_mkmf(config = CONFIG)
$LOCAL_LIBS = ""
- $cleanfiles = []
- $distcleanfiles = []
+ $cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || []
+ $distcleanfiles = config_string('DISTCLEANFILES') {|s| Shellwords.shellwords(s)} || []
+
+ $extout ||= nil
+ $extout_prefix ||= nil
$arg_config.clear
dir_config("opt")
end
-FailedMassage = <<MESSAGE
+FailedMessage = <<MESSAGE
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
@@ -1062,7 +1192,7 @@ def init_mkmf(config = CONFIG)
def mkmf_failed(path)
unless $makefile_created or File.exist?("Makefile")
opts = $arg_config.collect {|t, n| "\t#{t}#{"=#{n}" if n}\n"}
- abort "*** #{path} failed ***\n" +