summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Makefile.in6
-rw-r--r--array.c6
-rw-r--r--bignum.c2
-rw-r--r--blockinlining.c4
-rw-r--r--class.c8
-rw-r--r--common.mk170
-rw-r--r--compar.c2
-rw-r--r--compile.c4
-rw-r--r--configure.in27
-rw-r--r--cont.c2
-rw-r--r--cygwin/GNUmakefile.in2
-rw-r--r--debug.c2
-rw-r--r--debug.h4
-rw-r--r--dir.c4
-rw-r--r--dln.c6
-rw-r--r--enum.c6
-rw-r--r--enumerator.c2
-rw-r--r--error.c4
-rw-r--r--eval_intern.h10
-rw-r--r--ext/bigdecimal/bigdecimal.c3
-rw-r--r--ext/digest/extconf.rb2
-rw-r--r--ext/dl/cptr.c7
-rw-r--r--ext/dl/dl.c5
-rw-r--r--ext/dl/extconf.rb4
-rw-r--r--ext/extmk.rb24
-rw-r--r--ext/iconv/iconv.c6
-rw-r--r--ext/json/ext/generator/generator.c4
-rw-r--r--ext/json/ext/parser/parser.c8
-rw-r--r--ext/json/ext/parser/parser.rl8
-rw-r--r--ext/openssl/extconf.rb2
-rw-r--r--ext/probeprofiler/extconf.rb2
-rw-r--r--ext/probeprofiler/probeprofiler.c2
-rw-r--r--ext/pty/pty.c16
-rw-r--r--ext/racc/cparse/cparse.c6
-rw-r--r--ext/racc/cparse/extconf.rb1
-rw-r--r--ext/readline/readline.c8
-rw-r--r--ext/ripper/depend8
-rw-r--r--ext/ripper/extconf.rb6
-rw-r--r--ext/sdbm/_sdbm.c2
-rw-r--r--ext/socket/depend8
-rw-r--r--ext/socket/getaddrinfo.c2
-rw-r--r--ext/socket/getnameinfo.c2
-rw-r--r--ext/socket/socket.c8
-rw-r--r--ext/stringio/depend4
-rw-r--r--ext/strscan/depend3
-rw-r--r--ext/strscan/strscan.c4
-rw-r--r--ext/syck/bytecode.c2
-rw-r--r--ext/syck/emitter.c2
-rw-r--r--ext/syck/handler.c2
-rw-r--r--ext/syck/implicit.c2
-rw-r--r--ext/syck/node.c2
-rw-r--r--ext/syck/rubyext.c2
-rw-r--r--ext/syck/syck.c2
-rw-r--r--ext/syck/syck.h2
-rw-r--r--ext/syck/token.c2
-rw-r--r--ext/syck/yaml2byte.c2
-rw-r--r--ext/syslog/syslog.c4
-rw-r--r--ext/tk/extconf.rb2
-rw-r--r--ext/tk/stubs.c2
-rw-r--r--ext/tk/tcltklib.c5
-rw-r--r--ext/tk/tkutil/extconf.rb1
-rw-r--r--ext/tk/tkutil/tkutil.c9
-rw-r--r--ext/win32ole/win32ole.c15
-rw-r--r--file.c8
-rw-r--r--gc.c10
-rw-r--r--hash.c8
-rw-r--r--include/ruby.h1
-rw-r--r--include/ruby/defines.h (renamed from defines.h)21
-rw-r--r--include/ruby/intern.h (renamed from intern.h)16
-rw-r--r--include/ruby/io.h (renamed from rubyio.h)19
-rw-r--r--include/ruby/missing.h (renamed from missing.h)20
-rw-r--r--include/ruby/node.h (renamed from node.h)12
-rw-r--r--include/ruby/oniguruma.h (renamed from oniguruma.h)6
-rw-r--r--include/ruby/re.h (renamed from re.h)21
-rw-r--r--include/ruby/regex.h (renamed from regex.h)26
-rw-r--r--include/ruby/ruby.h (renamed from ruby.h)10
-rw-r--r--include/ruby/signal.h (renamed from rubysig.h)19
-rw-r--r--include/ruby/st.h (renamed from st.h)19
-rw-r--r--include/ruby/util.h (renamed from util.h)20
-rw-r--r--include/ruby/win32.h (renamed from win32/win32.h)16
-rw-r--r--include/rubyio.h1
-rw-r--r--include/rubysig.h1
-rw-r--r--inits.c2
-rwxr-xr-xinstruby.rb31
-rw-r--r--io.c8
-rw-r--r--iseq.c4
-rw-r--r--lib/mkmf.rb66
-rw-r--r--main.c2
-rw-r--r--marshal.c8
-rw-r--r--math.c2
-rw-r--r--missing/flock.c2
-rw-r--r--missing/strftime.c2
-rw-r--r--numeric.c2
-rw-r--r--object.c11
-rw-r--r--pack.c2
-rw-r--r--parse.y12
-rw-r--r--prec.c2
-rw-r--r--process.c6
-rw-r--r--random.c2
-rw-r--r--range.c2
-rw-r--r--re.c4
-rw-r--r--regenc.h4
-rw-r--r--regint.h6
-rw-r--r--regparse.c2
-rw-r--r--ruby.c8
-rw-r--r--signal.c6
-rw-r--r--sprintf.c4
-rw-r--r--st.c9
-rw-r--r--string.c4
-rw-r--r--struct.c2
-rw-r--r--time.c2
-rw-r--r--unicode.c2
-rw-r--r--util.c4
-rw-r--r--variable.c8
-rw-r--r--version.c2
-rw-r--r--version.h6
-rw-r--r--vm.c6
-rw-r--r--vm_dump.c4
-rw-r--r--win32/Makefile.sub43
-rwxr-xr-xwin32/mkexports.rb4
-rw-r--r--win32/win32.c6
-rw-r--r--yarvcore.c4
-rw-r--r--yarvcore.h8
124 files changed, 647 insertions, 409 deletions
diff --git a/ChangeLog b/ChangeLog
index 91f9424351..29db0239b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Jun 10 12:07:41 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby: moved public headers.
+
Sun Jun 10 10:42:04 2007 Tanaka Akira <akr@fsij.org>
* lib/securerandom.rb: renamed from lib/secrand.rb.
diff --git a/Makefile.in b/Makefile.in
index 4dba2db716..506fcbeb44 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -4,7 +4,7 @@ NULLCMD = :
#### Start of system configuration section. ####
srcdir = @srcdir@
-VPATH = $(srcdir):$(srcdir)/missing
+hdrdir = $(srcdir)/include
CC = @CC@
YACC = bison
@@ -32,11 +32,13 @@ RDOCTARGET = @RDOCTARGET@
EXTOUT = @EXTOUT@
RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
+arch_hdrdir = $(EXTOUT)/include/$(arch)
+VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/missing
empty =
OUTFLAG = @OUTFLAG@$(empty)
CFLAGS = @CFLAGS@ @ARCH_FLAG@
-XCFLAGS = -I. -I$(srcdir) @XCFLAGS@
+XCFLAGS = -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) @XCFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
EXTLDFLAGS =
diff --git a/array.c b/array.c
index dc52e8f84c..a713e390ab 100644
--- a/array.c
+++ b/array.c
@@ -12,9 +12,9 @@
**********************************************************************/
-#include "ruby.h"
-#include "util.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/util.h"
+#include "ruby/st.h"
VALUE rb_cArray;
diff --git a/bignum.c b/bignum.c
index b24259e4d2..d24e8ae702 100644
--- a/bignum.c
+++ b/bignum.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <math.h>
#include <float.h>
diff --git a/blockinlining.c b/blockinlining.c
index b6563bd81c..9913b035d6 100644
--- a/blockinlining.c
+++ b/blockinlining.c
@@ -9,8 +9,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "node.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
#include "yarvcore.h"
VALUE yarv_new_iseqval(VALUE node, VALUE name, VALUE file,
diff --git a/class.c b/class.c
index d38d64e628..f881e690e4 100644
--- a/class.c
+++ b/class.c
@@ -10,10 +10,10 @@
**********************************************************************/
-#include "ruby.h"
-#include "rubysig.h"
-#include "node.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
+#include "ruby/node.h"
+#include "ruby/st.h"
#include <ctype.h>
extern st_table *rb_class_tbl;
diff --git a/common.mk b/common.mk
index 444e857419..4a81708540 100644
--- a/common.mk
+++ b/common.mk
@@ -370,218 +370,218 @@ win32.$(OBJEXT): {$(VPATH)}win32.c
###
-array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h config.h \
+array.$(OBJEXT): {$(VPATH)}array.c {$(VPATH)}ruby.h {$(VPATH)}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)}oniguruma.h {$(VPATH)}config.h
+bignum.$(OBJEXT): {$(VPATH)}bignum.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h config.h \
+class.$(OBJEXT): {$(VPATH)}class.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}node.h {$(VPATH)}st.h
-compar.$(OBJEXT): {$(VPATH)}compar.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}signal.h {$(VPATH)}node.h {$(VPATH)}st.h
+compar.$(OBJEXT): {$(VPATH)}compar.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-dir.$(OBJEXT): {$(VPATH)}dir.c {$(VPATH)}ruby.h config.h \
+dir.$(OBJEXT): {$(VPATH)}dir.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}util.h
-dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}ruby.h config.h \
+dln.$(OBJEXT): {$(VPATH)}dln.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}dln.h
dmydln.$(OBJEXT): {$(VPATH)}dmydln.c {$(VPATH)}dln.c {$(VPATH)}ruby.h \
- config.h {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
+ {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}dln.h
dmyext.$(OBJEXT): {$(VPATH)}dmyext.c
-enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h config.h \
+enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}util.h
-enumerator.$(OBJEXT): {$(VPATH)}enumerator.c {$(VPATH)}ruby.h config.h \
+enumerator.$(OBJEXT): {$(VPATH)}enumerator.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h config.h \
+error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}st.h {$(VPATH)}vm_opts.h {$(VPATH)}rubysig.h \
+ {$(VPATH)}st.h {$(VPATH)}vm_opts.h {$(VPATH)}signal.h \
{$(VPATH)}yarvcore.h {$(VPATH)}node.h {$(VPATH)}debug.h \
{$(VPATH)}thread_$(THREAD_MODEL).h
euc_jp.$(OBJEXT): {$(VPATH)}euc_jp.c {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h config.h
+ {$(VPATH)}oniguruma.h {$(VPATH)}config.h
eval.$(OBJEXT): {$(VPATH)}eval.c {$(VPATH)}eval_error.h {$(VPATH)}eval_intern.h \
{$(VPATH)}eval_method.h {$(VPATH)}eval_safe.h {$(VPATH)}eval_jump.h \
- {$(VPATH)}ruby.h config.h {$(VPATH)}yarvcore.h \
+ {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}yarvcore.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}rubysig.h \
+ {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}signal.h \
{$(VPATH)}st.h {$(VPATH)}dln.h {$(VPATH)}debug.h \
{$(VPATH)}vm_opts.h {$(VPATH)}thread_$(THREAD_MODEL).h
eval_load.$(OBJEXT): {$(VPATH)}eval_load.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}yarvcore.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}dln.h {$(VPATH)}debug.h \
+ {$(VPATH)}signal.h {$(VPATH)}st.h {$(VPATH)}dln.h {$(VPATH)}debug.h \
{$(VPATH)}vm_opts.h {$(VPATH)}thread_$(THREAD_MODEL).h
-file.$(OBJEXT): {$(VPATH)}file.c {$(VPATH)}ruby.h config.h \
+file.$(OBJEXT): {$(VPATH)}file.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h \
+ {$(VPATH)}io.h {$(VPATH)}signal.h {$(VPATH)}util.h \
{$(VPATH)}dln.h
-gc.$(OBJEXT): {$(VPATH)}gc.c {$(VPATH)}ruby.h config.h \
+gc.$(OBJEXT): {$(VPATH)}gc.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}node.h \
+ {$(VPATH)}signal.h {$(VPATH)}st.h {$(VPATH)}node.h \
{$(VPATH)}re.h {$(VPATH)}regex.h {$(VPATH)}oniguruma.h \
{$(VPATH)}yarvcore.h {$(VPATH)}debug.h {$(VPATH)}vm_opts.h \
{$(VPATH)}thread_$(THREAD_MODEL).h
-hash.$(OBJEXT): {$(VPATH)}hash.c {$(VPATH)}ruby.h config.h \
+hash.$(OBJEXT): {$(VPATH)}hash.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}rubysig.h
-inits.$(OBJEXT): {$(VPATH)}inits.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}signal.h
+inits.$(OBJEXT): {$(VPATH)}inits.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-io.$(OBJEXT): {$(VPATH)}io.c {$(VPATH)}ruby.h config.h \
+io.$(OBJEXT): {$(VPATH)}io.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}rubysig.h {$(VPATH)}util.h
-main.$(OBJEXT): {$(VPATH)}main.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}io.h {$(VPATH)}signal.h {$(VPATH)}util.h
+main.$(OBJEXT): {$(VPATH)}main.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-marshal.$(OBJEXT): {$(VPATH)}marshal.c {$(VPATH)}ruby.h config.h \
+marshal.$(OBJEXT): {$(VPATH)}marshal.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubyio.h {$(VPATH)}st.h {$(VPATH)}util.h
-math.$(OBJEXT): {$(VPATH)}math.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}io.h {$(VPATH)}st.h {$(VPATH)}util.h
+math.$(OBJEXT): {$(VPATH)}math.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-numeric.$(OBJEXT): {$(VPATH)}numeric.c {$(VPATH)}ruby.h config.h \
+numeric.$(OBJEXT): {$(VPATH)}numeric.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h \
{$(VPATH)}missing.h
-object.$(OBJEXT): {$(VPATH)}object.c {$(VPATH)}ruby.h config.h \
+object.$(OBJEXT): {$(VPATH)}object.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}st.h {$(VPATH)}util.h {$(VPATH)}debug.h
-pack.$(OBJEXT): {$(VPATH)}pack.c {$(VPATH)}ruby.h config.h \
+pack.$(OBJEXT): {$(VPATH)}pack.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-parse.$(OBJEXT): {$(VPATH)}parse.c {$(VPATH)}ruby.h config.h \
+parse.$(OBJEXT): {$(VPATH)}parse.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}st.h {$(VPATH)}oniguruma.h \
{$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c
-prec.$(OBJEXT): {$(VPATH)}prec.c {$(VPATH)}ruby.h config.h \
+prec.$(OBJEXT): {$(VPATH)}prec.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}ruby.h config.h {$(VPATH)}yarvcore.h \
+ {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}yarvcore.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}gc.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}dln.h \
+ {$(VPATH)}signal.h {$(VPATH)}st.h {$(VPATH)}dln.h \
{$(VPATH)}debug.h {$(VPATH)}vm_opts.h \
{$(VPATH)}thread_$(THREAD_MODEL).h
-process.$(OBJEXT): {$(VPATH)}process.c {$(VPATH)}ruby.h config.h \
+process.$(OBJEXT): {$(VPATH)}process.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}yarvcore.h
-random.$(OBJEXT): {$(VPATH)}random.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}signal.h {$(VPATH)}st.h {$(VPATH)}yarvcore.h
+random.$(OBJEXT): {$(VPATH)}random.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-range.$(OBJEXT): {$(VPATH)}range.c {$(VPATH)}ruby.h config.h \
+range.$(OBJEXT): {$(VPATH)}range.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
-re.$(OBJEXT): {$(VPATH)}re.c {$(VPATH)}ruby.h config.h \
+re.$(OBJEXT): {$(VPATH)}re.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}oniguruma.h {$(VPATH)}re.h {$(VPATH)}regex.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}rubysig.h
-regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}signal.h
+regcomp.$(OBJEXT): {$(VPATH)}regcomp.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}oniguruma.h {$(VPATH)}regint.h {$(VPATH)}regparse.h \
- {$(VPATH)}regenc.h {$(VPATH)}rubysig.h
+ {$(VPATH)}regenc.h {$(VPATH)}signal.h
regenc.$(OBJEXT): {$(VPATH)}regenc.c {$(VPATH)}regint.h \
{$(VPATH)}regenc.h {$(VPATH)}oniguruma.h {$(VPATH)}ruby.h \
{$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}rubysig.h
+ {$(VPATH)}signal.h
regerror.$(OBJEXT): {$(VPATH)}regerror.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h config.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h {$(VPATH)}config.h \
{$(VPATH)}ruby.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}rubysig.h
+ {$(VPATH)}intern.h {$(VPATH)}signal.h
regexec.$(OBJEXT): {$(VPATH)}regexec.c {$(VPATH)}regint.h \
- {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h config.h \
+ {$(VPATH)}regenc.h {$(VPATH)}oniguruma.h {$(VPATH)}config.h \
{$(VPATH)}ruby.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}rubysig.h
+ {$(VPATH)}intern.h {$(VPATH)}signal.h
regparse.$(OBJEXT): {$(VPATH)}regparse.c {$(VPATH)}oniguruma.h \
- {$(VPATH)}regint.h {$(VPATH)}regparse.h {$(VPATH)}regenc.h config.h \
+ {$(VPATH)}regint.h {$(VPATH)}regparse.h {$(VPATH)}regenc.h {$(VPATH)}config.h \
{$(VPATH)}ruby.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}rubysig.h
+ {$(VPATH)}intern.h {$(VPATH)}signal.h
regsyntax.$(OBJEXT): {$(VPATH)}regsyntax.c {$(VPATH)}oniguruma.h \
- {$(VPATH)}regint.h {$(VPATH)}regenc.h config.h \
+ {$(VPATH)}regint.h {$(VPATH)}regenc.h {$(VPATH)}config.h \
{$(VPATH)}ruby.h {$(VPATH)}defines.h {$(VPATH)}missing.h
-ruby.$(OBJEXT): {$(VPATH)}ruby.c {$(VPATH)}ruby.h config.h \
+ruby.$(OBJEXT): {$(VPATH)}ruby.c {$(VPATH)}ruby.h {$(VPATH)}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 \
+signal.$(OBJEXT): {$(VPATH)}signal.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
- {$(VPATH)}rubysig.h {$(VPATH)}yarvcore.h {$(VPATH)}node.h \
+ {$(VPATH)}signal.h {$(VPATH)}yarvcore.h {$(VPATH)}node.h \
{$(VPATH)}debug.h {$(VPATH)}vm_opts.h \
{$(VPATH)}thread_$(THREAD_MODEL).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)}oniguruma.h {$(VPATH)}config.h
+sprintf.$(OBJEXT): {$(VPATH)}sprintf.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}re.h {$(VPATH)}regex.h {$(VPATH)}oniguruma.h \
{$(VPATH)}missing/vsnprintf.c
-st.$(OBJEXT): {$(VPATH)}st.c config.h {$(VPATH)}st.h {$(VPATH)}defines.h
-string.$(OBJEXT): {$(VPATH)}string.c {$(VPATH)}ruby.h config.h \
+st.$(OBJEXT): {$(VPATH)}st.c {$(VPATH)}config.h {$(VPATH)}st.h {$(VPATH)}defines.h
+string.$(OBJEXT): {$(VPATH)}string.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}re.h {$(VPATH)}regex.h
-struct.$(OBJEXT): {$(VPATH)}struct.c {$(VPATH)}ruby.h config.h \
+struct.$(OBJEXT): {$(VPATH)}struct.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
{$(VPATH)}thread_win32.h {$(VPATH)}thread_pthread.h \
{$(VPATH)}thread_win32.ci {$(VPATH)}thread_pthread.ci \
- {$(VPATH)}ruby.h {$(VPATH)}yarvcore.h config.h \
+ {$(VPATH)}ruby.h {$(VPATH)}yarvcore.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}util.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}dln.h
+ {$(VPATH)}signal.h {$(VPATH)}st.h {$(VPATH)}dln.h
cont.$(OBJEXT): {$(VPATH)}cont.c {$(VPATH)}eval_intern.h \
- {$(VPATH)}ruby.h {$(VPATH)}yarvcore.h config.h \
+ {$(VPATH)}ruby.h {$(VPATH)}yarvcore.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}util.h \
- {$(VPATH)}rubysig.h {$(VPATH)}st.h {$(VPATH)}dln.h
-time.$(OBJEXT): {$(VPATH)}time.c {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}signal.h {$(VPATH)}st.h {$(VPATH)}dln.h
+time.$(OBJEXT): {$(VPATH)}time.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h
unicode.$(OBJEXT): {$(VPATH)}unicode.c {$(VPATH)}regenc.h \
- {$(VPATH)}oniguruma.h config.h
+ {$(VPATH)}oniguruma.h {$(VPATH)}config.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)}oniguruma.h {$(VPATH)}config.h
+util.$(OBJEXT): {$(VPATH)}util.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}util.h
-variable.$(OBJEXT): {$(VPATH)}variable.c {$(VPATH)}ruby.h config.h \
+variable.$(OBJEXT): {$(VPATH)}variable.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}node.h {$(VPATH)}st.h {$(VPATH)}util.h
-version.$(OBJEXT): {$(VPATH)}version.c {$(VPATH)}ruby.h config.h \
+version.$(OBJEXT): {$(VPATH)}version.c {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \
{$(VPATH)}version.h
compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}yarvcore.h \
- {$(VPATH)}compile.h {$(VPATH)}debug.h {$(VPATH)}ruby.h config.h \
+ {$(VPATH)}compile.h {$(VPATH)}debug.h {$(VPATH)}ruby.h {$(VPATH)}config.h \
{$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
- {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}rubysig.h \
+ {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}signal.h \
{$(VPATH)}insns.inc {$(VPATH)}insns_info.inc {$(VPATH)}optinsn.inc \
{$(VPATH)}opt_sc.inc {$(VPATH)}optunifs.inc {$(VPATH)}vm_opts.h \
{$(VPATH)}thread_$(THREAD_MODEL).h
iseq.$(OBJEXT): {$(VPATH)}iseq.c {$(VPATH)}yarvcore.h {$(VPATH)}debug.h \
{$(VPATH)}ruby.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
- {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}rubysig.h \
- {$(VPATH)}gc.h {$(VPATH)}vm_opts.h config.h {$(VPATH)}node.h \
+ {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}signal.h \
+ {$(VPATH)}gc.h {$(VPATH)}vm_opts.h {$(VPATH)}config.h {$(VPATH)}node.h \
{$(VPATH)}thread_$(THREAD_MODEL).h\
{$(VPATH)}insns.inc {$(VPATH)}insns_info.inc
vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}vm.h {$(VPATH)}insnhelper.h \
- {$(VPATH)}yarvcore.h {$(VPATH)}debug.h {$(VPATH)}ruby.h config.h\
- {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}rubysig.h {$(VPATH)}dln.h \
+ {$(VPATH)}yarvcore.h {$(VPATH)}debug.h {$(VPATH)}ruby.h {$(VPATH)}config.h\
+ {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}signal.h {$(VPATH)}dln.h \
{$(VPATH)}vm_evalbody.ci {$(VPATH)}call_cfunc.ci \
{$(VPATH)}insns.inc {$(VPATH)}vm.inc {$(VPATH)}vmtc.inc \
{$(VPATH)}vm_macro.inc {$(VPATH)}vm_opts.h {$(VPATH)}eval_intern.h \
{$(VPATH)}defines.h {$(VPATH)}missing.h {$(VPATH)}intern.h \
{$(VPATH)}gc.h {$(VPATH)}thread_$(THREAD_MODEL).h
vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c {$(VPATH)}yarvcore.h {$(VPATH)}vm.h \
- {$(VPATH)}ruby.h config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
+ {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h {$(VPATH)}missing.h \
{$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}debug.h \
- {$(VPATH)}rubysig.h {$(VPATH)}vm_opts.h {$(VPATH)}thread_$(THREAD_MODEL).h
+ {$(VPATH)}signal.h {$(VPATH)}vm_opts.h {$(VPATH)}thread_$(THREAD_MODEL).h
yarvcore.$(OBJEXT): {$(VPATH)}yarvcore.c {$(VPATH)}yarvcore.h \
- {$(VPATH)}debug.h {$(VPATH)}ruby.h config.h {$(VPATH)}defines.h \
+ {$(VPATH)}debug.h {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
{$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h \
- {$(VPATH)}rubysig.h {$(VPATH)}node.h {$(VPATH)}gc.h {$(VPATH)}vm_opts.h \
+ {$(VPATH)}signal.h {$(VPATH)}node.h {$(VPATH)}gc.h {$(VPATH)}vm_opts.h \
{$(VPATH)}thread_$(THREAD_MODEL).h
debug.$(OBJEXT): {$(VPATH)}debug.h {$(VPATH)}ruby.h {$(VPATH)}defines.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h config.h \
+ {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}config.h \
{$(VPATH)}st.h
blockinlining.$(OBJEXT): {$(VPATH)}blockinlining.c \
{$(VPATH)}ruby.h {$(VPATH)}defines.h \
- {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h config.h \
- {$(VPATH)}node.h {$(VPATH)}yarvcore.h {$(VPATH)}rubysig.h \
+ {$(VPATH)}missing.h {$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}config.h \
+ {$(VPATH)}node.h {$(VPATH)}yarvcore.h {$(VPATH)}signal.h \
{$(VPATH)}debug.h {$(VPATH)}vm_opts.h \
{$(VPATH)}thread_$(THREAD_MODEL).h
diff --git a/compar.c b/compar.c
index 80c4c70ca6..7802567070 100644
--- a/compar.c
+++ b/compar.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
VALUE rb_mComparable;
diff --git a/compile.c b/compile.c
index 3195a2cd7c..3ce622fde9 100644
--- a/compile.c
+++ b/compile.c
@@ -10,8 +10,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "node.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
#include "yarvcore.h"
#include "compile.h"
diff --git a/configure.in b/configure.in
index 2232649263..f8f3b3d627 100644
--- a/configure.in
+++ b/configure.in
@@ -216,10 +216,11 @@ AC_MINIX
AC_SUBST(RM, ['rm -f'])
AC_SUBST(CP, ['cp'])
if $as_mkdir_p; then
- AC_SUBST(MAKEDIRS, ['mkdir -p'])
+ MAKEDIRS='mkdir -p'
else
- AC_SUBST(MAKEDIRS, ['install -d'])
+ MAKEDIRS='install -d'
fi
+AC_SUBST(MAKEDIRS)
dnl check for large file stuff
AC_SYS_LARGEFILE
@@ -1271,7 +1272,7 @@ fi
AC_SUBST(MINIRUBY)
AC_SUBST(PREP)
AC_SUBST(RUNRUBY)
-AC_SUBST(EXTOUT, [${EXTOUT-.ext}])
+AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
FIRSTMAKEFILE=""
LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
@@ -1607,6 +1608,19 @@ if test "$search_path" != ""; then
AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
fi
+AC_ARG_WITH(rubyhdrdir,
+ [ --with-ruby-hdrdir=DIR core headers in DIR [INCLUDEDIR]],
+ [rubyhdrdir=$withval],
+ [rubyhdrdir='${includedir}/ruby-${MAJOR}.${MINOR}'])
+
+AC_ARG_WITH(sitehdrdir,
+ [ --with-site-hdrdir=DIR core headers in DIR [INCLUDEDIR]],
+ [sitehdrdir=$withval],
+ [sitehdrdir='${rubyhdrdir}/site_ruby'])
+
+AC_SUBST(rubyhdrdir)dnl
+AC_SUBST(sitehdrdir)dnl
+
AC_ARG_WITH(mantype,
[ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
[
@@ -1646,11 +1660,14 @@ AC_ARG_WITH(baseruby,
])
AC_SUBST(BASERUBY)
-if test -f config.h && tr -d '\015' < confdefs.h | cmp -s config.h -; then
+arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
+$MAKEDIRS "${arch_hdrdir}"
+config_h="${arch_hdrdir}/config.h"
+if test -f "${config_h}" && tr -d '\015' < confdefs.h | cmp -s "${config_h}" -; then
echo "config.h unchanged"
else
echo "creating config.h"
- tr -d '\015' < confdefs.h > config.h
+ tr -d '\015' < confdefs.h > "${config_h}"
fi
: > confdefs.h
diff --git a/cont.c b/cont.c
index 97a805d0ab..58149979ca 100644
--- a/cont.c
+++ b/cont.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "yarvcore.h"
#include "gc.h"
#include "eval_intern.h"
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index c9283d84b1..719dae7e5e 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -61,7 +61,7 @@ $(RUBY_EXP): $(LIBRUBY_A)
GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
-$(OBJS) $(MAINOBJ): win32/win32.h
+$(OBJS) $(MAINOBJ): win32.h
$(LIBRUBY_SO): $(RUBYDEF)
diff --git a/debug.c b/debug.c
index 683f4ec074..ec28be3eb8 100644
--- a/debug.c
+++ b/debug.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "debug.h"
void
diff --git a/debug.h b/debug.h
index b25fa6ddce..66ea10883f 100644
--- a/debug.h
+++ b/debug.h
@@ -13,8 +13,8 @@
#ifndef _DEBUG_H_INCLUDED_
#define _DEBUG_H_INCLUDED_
-#include <ruby.h>
-#include <node.h>
+#include "ruby/ruby.h"
+#include "ruby/node.h"
#define dpv(h,v) ruby_debug_value(-1, 0, h, v)
#define dp(v) ruby_debug_value(-1, 0, "", v)
diff --git a/dir.c b/dir.c
index d0af804479..ecffc37f9e 100644
--- a/dir.c
+++ b/dir.c
@@ -12,7 +12,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -61,7 +61,7 @@ char *strchr(char*,char);
#include <ctype.h>
-#include "util.h"
+#include "ruby/util.h"
#if !defined HAVE_LSTAT && !defined lstat
#define lstat stat
diff --git a/dln.c b/dln.c
index 3dce788c31..1e953990d9 100644
--- a/dln.c
+++ b/dln.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "dln.h"
#ifdef HAVE_STDLIB_H
@@ -182,8 +182,8 @@ static int dln_init_p = 0;
#define INVALID_OBJECT(h) (N_MAGIC(h) != OMAGIC)
-#include "util.h"
-#include "st.h"
+#include "ruby/util.h"
+#include "ruby/st.h"
static st_table *sym_tbl;
static st_table *undef_tbl;
diff --git a/enum.c b/enum.c
index f4c649550a..c251141dd9 100644
--- a/enum.c
+++ b/enum.c
@@ -10,9 +10,9 @@
**********************************************************************/
-#include "ruby.h"
-#include "node.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
+#include "ruby/util.h"
VALUE rb_mEnumerable;
static ID id_each, id_eqq, id_cmp;
diff --git a/enumerator.c b/enumerator.c
index 83cdff9c58..d3bb173476 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -12,7 +12,7 @@
************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
/*
* Document-class: Enumerable::Enumerator
diff --git a/error.c b/error.c
index c50668a69c..283e9c856f 100644
--- a/error.c
+++ b/error.c
@@ -10,8 +10,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/st.h"
#include "yarvcore.h"
#include <stdio.h>
diff --git a/eval_intern.h b/eval_intern.h
index 3c67ddc2f0..f17f829f17 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -6,10 +6,10 @@
(GET_THREAD()->passed_block = \
GC_GUARDED_PTR_REF((rb_block_t *)GET_THREAD()->cfp->lfp[0]))
-#include "ruby.h"
-#include "node.h"
-#include "util.h"
-#include "rubysig.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
+#include "ruby/util.h"
+#include "ruby/signal.h"
#include "yarvcore.h"
#ifdef HAVE_STDLIB_H
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <setjmp.h>
-#include "st.h"
+#include "ruby/st.h"
#include "dln.h"
#ifdef __APPLE__
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index a4b769e8cf..c9e7ceb2e4 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -13,7 +13,7 @@
*
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -22,7 +22,6 @@
#include <float.h>
#include <math.h>
#include "math.h"
-#include "version.h"
/* #define ENABLE_NUMERIC_STRING */
diff --git a/ext/digest/extconf.rb b/ext/digest/extconf.rb
index cf9127ecc0..a20ca8d68f 100644
--- a/ext/digest/extconf.rb
+++ b/ext/digest/extconf.rb
@@ -4,7 +4,7 @@
require "mkmf"
$INSTALLFILES = {
- "digest.h" => "$(RUBYARCHDIR)"
+ "digest.h" => "$(HDRDIR)"
}
create_makefile("digest")
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
index abfd9e8d1c..74a233b527 100644
--- a/ext/dl/cptr.c
+++ b/ext/dl/cptr.c
@@ -2,10 +2,9 @@
* $Id$
*/
-#include <ruby.h>
-#include <rubyio.h>
+#include <ruby/ruby.h>
+#include <ruby/io.h>
#include <ctype.h>
-#include <version.h> /* for ruby version code */
#include "dl.h"
VALUE rb_cDLCPtr;
@@ -421,7 +420,7 @@ rb_dlptr_s_to_ptr(VALUE self, VALUE val)
rb_io_t *fptr;
FILE *fp;
GetOpenFile(val, fptr);
-#if RUBY_VERSION_CODE >= 190
+#if HAVE_RB_IO_STDIO_FILE
fp = rb_io_stdio_file(fptr);
#else
fp = fptr->f;
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 015e76f09e..e4bd4d41e9 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -1,6 +1,5 @@
-#include <ruby.h>
-#include <rubyio.h>
-#include <version.h>
+#include <ruby/ruby.h>
+#include <ruby/io.h>
#include <ctype.h>
#include "dl.h"
diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb
index 99419b2d7d..8bac1e83fb 100644
--- a/ext/dl/extconf.rb
+++ b/ext/dl/extconf.rb
@@ -5,7 +5,7 @@ if( RbConfig::CONFIG['CC'] =~ /gcc/ )
end
$INSTALLFILES = [
- ["dl.h", "$(archdir)$(target_prefix)", ""],
+ ["dl.h", "$(HDRDIR)"],
]
$distcleanfiles << "callback.h"
@@ -26,5 +26,7 @@ else
end
if( check )
+ have_func("rb_io_stdio_file", "ruby/ruby.h")
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
create_makefile("dl")
end
diff --git a/ext/extmk.rb b/ext/extmk.rb
index a932a14414..d4be9fc538 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -112,10 +112,12 @@ def extmake(target)
Dir.chdir target
top_srcdir = $top_srcdir
topdir = $topdir
+ hdrdir = $hdrdir
mk_srcdir = CONFIG["srcdir"]
mk_topdir = CONFIG["topdir"]
prefix = "../" * (target.count("/")+1)
- $hdrdir = $top_srcdir = relative_from(top_srcdir, prefix)
+ $top_srcdir = relative_from(top_srcdir, prefix)
+ $hdrdir = relative_from(hdrdir, prefix)
$topdir = prefix + $topdir
$target = target
$mdir = target
@@ -130,8 +132,8 @@ def extmake(target)
RbConfig::CONFIG["hdrdir"] = $hdrdir
RbConfig::CONFIG["srcdir"] = $srcdir
RbConfig::CONFIG["topdir"] = $topdir
- CONFIG["hdrdir"] = ($hdrdir == top_srcdir) ? top_srcdir : "$(topdir)"+top_srcdir[2..-1]
- CONFIG["srcdir"] = "$(hdrdir)/ext/#{$mdir}"
+ CONFIG["hdrdir"] = ($hdrdir == top_srcdir) ? top_srcdir : "$(top_srcdir)/include"
+ CONFIG["srcdir"] = "$(top_srcdir)/ext/#{$mdir}"
CONFIG["topdir"] = $topdir
begin
$extconf_h = nil
@@ -200,8 +202,9 @@ def extmake(target)
CONFIG["srcdir"] = mk_srcdir
CONFIG["topdir"] = mk_topdir
CONFIG.delete("hdrdir")
- $hdrdir = $top_srcdir = top_srcdir
+ $top_srcdir = top_srcdir
$topdir = topdir
+ $hdrdir = hdrdir
Dir.chdir dir
end
begin
@@ -284,6 +287,7 @@ def parse_args()
$continue = $mflags.set?(?k)
if $extout
$extout = '$(topdir)/'+$extout
+ RbConfig::CONFIG["extout"] = CONFIG["extout"] = $extout
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
$mflags << "extout=#$extout" << "extout_prefix=#$extout_prefix"
end
@@ -322,10 +326,10 @@ elsif sep = config_string('BUILD_FILE_SEPARATOR')
else
$ruby = '$(topdir)/miniruby' + EXEEXT
end
-$ruby << " -I'$(topdir)' -I'$(hdrdir)/lib'"
+$ruby << " -I'$(topdir)' -I'$(top_srcdir)/lib'"
$ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
-$ruby << " -I'$(hdrdir)/ext' -rpurelib.rb"
-$config_h = '$(topdir)/config.h'
+$ruby << " -I'$(top_srcdir)/ext' -rpurelib.rb"
+$config_h = '$(arch_hdrdir)/ruby/config.h'
ENV["RUBYLIB"] = "-"
ENV["RUBYOPT"] = "-rpurelib.rb"
@@ -404,12 +408,14 @@ dir = Dir.pwd
FileUtils::makedirs('ext')
Dir::chdir('ext')
-$hdrdir = $top_srcdir = relative_from(srcdir, $topdir = "..")
+hdrdir = $hdrdir
+$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
exts.each do |d|
extmake(d) or abort
end
-$hdrdir = $top_srcdir = srcdir
+$top_srcdir = srcdir
$topdir = "."
+$hdrdir = hdrdir
extinit = Struct.new(:c, :o) {
def initialize(src)
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 27a4cf102e..b6bc0a11a5 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -14,12 +14,12 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <errno.h>
#include <iconv.h>
#include <assert.h>
-#include "st.h"
-#include "intern.h"
+#include "ruby/st.h"
+#include "ruby/intern.h"
/*
* Document-class: Iconv
diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c
index 60e09355f0..07e348aa12 100644
--- a/ext/json/ext/generator/generator.c
+++ b/ext/json/ext/generator/generator.c
@@ -1,8 +1,8 @@
/* vim: set cin et sw=4 ts=4: */
#include <string.h>
-#include "ruby.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/st.h"
#include "unicode.h"
static VALUE mJSON, mExt, mGenerator, cState, mGeneratorMethods, mObject,
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c
index 7448e5fb7a..3b84110374 100644
--- a/ext/json/ext/parser/parser.c
+++ b/ext/json/ext/parser/parser.c
@@ -1,9 +1,9 @@
#line 1 "parser.rl"
-/* vim: set cin et sw=4 ts=4: */
+/* -*-c-*- vim: set cin et sw=4 ts=4: */
-#include "ruby.h"
-#include "re.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
+#include "ruby/st.h"
#include "unicode.h"
#define EVIL 0x666
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl
index 9ce8c6fc24..9e2a5015eb 100644
--- a/ext/json/ext/parser/parser.rl
+++ b/ext/json/ext/parser/parser.rl
@@ -1,8 +1,8 @@
-/* vim: set cin et sw=4 ts=4: */
+/* -*-c-*- vim: set cin et sw=4 ts=4: */
-#include "ruby.h"
-#include "re.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
+#include "ruby/st.h"
#include "unicode.h"
#define EVIL 0x666
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index bc3f4fd2ed..9356853e1d 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -19,6 +19,8 @@ require "mkmf"
dir_config("openssl")
dir_config("kerberos")
+$defs << "-DRUBY_VERSION_CODE=#{RUBY_VERSION.gsub(/\D/, '')}"
+
message "=== OpenSSL for Ruby configurator ===\n"
##
diff --git a/ext/probeprofiler/extconf.rb b/ext/probeprofiler/extconf.rb
index 31cfc85c06..da94e654d9 100644
--- a/ext/probeprofiler/extconf.rb
+++ b/ext/probeprofiler/extconf.rb
@@ -1,2 +1,4 @@
require 'mkmf'
+$VPATH << "$(top_srcdir)"
+$INCFLAGS << " -I$(top_srcdir)"
create_makefile("probeprofiler")
diff --git a/ext/probeprofiler/probeprofiler.c b/ext/probeprofiler/probeprofiler.c
index 9ffb203673..fba4d85f46 100644
--- a/ext/probeprofiler/probeprofiler.c
+++ b/ext/probeprofiler/probeprofiler.c
@@ -1,4 +1,4 @@
-#include <ruby.h>
+#include <ruby/ruby.h>
#include <yarvcore.h>
static void
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 5847aff2bd..d89cc7d457 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include "ruby/config.h"
#ifdef RUBY_EXTCONF_H
#include RUBY_EXTCONF_H
#endif
@@ -25,9 +25,9 @@
#endif
#include <ctype.h>
-#include "ruby.h"
-#include "rubyio.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/util.h"
#include <signal.h>
#ifdef HAVE_SYS_STROPTS_H
@@ -192,7 +192,7 @@ pty_exec(VALUE v)
static void
establishShell(int argc, VALUE *argv, struct pty_info *info)
{
- int i,master,slave;
+ int master,slave;
rb_pid_t pid;
char *p,*getenv();
struct passwd *pwent;
@@ -240,9 +240,9 @@ establishShell(int argc, VALUE *argv, struct pty_info *info)
# else /* SETGRP_VOID */
if (setpgrp(0, getpid()) == -1)
rb_sys_fail("setpgrp()");
- if ((i = open("/dev/tty", O_RDONLY)) < 0)
- rb_sys_fail("/dev/tty");
- else {
+ {
+ int i = open("/dev/tty", O_RDONLY);
+ if (i < 0) rb_sys_fail("/dev/tty");
if (ioctl(i, TIOCNOTTY, (char *)0))
perror("ioctl(TIOCNOTTY)");
close(i);
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index e52d0da807..d085158f11 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -11,8 +11,7 @@
*/
-#include "ruby.h"
-#include "version.h"
+#include "ruby/ruby.h"
/* -----------------------------------------------------------------------
Important Constants
@@ -65,9 +64,6 @@ static ID id_d_e_pop;
#ifndef LONG2NUM
# define LONG2NUM(i) INT2NUM(i)
#endif
-#if RUBY_VERSION_CODE >= 190
-# define HAVE_RB_BLOCK_CALL 1
-#endif
static ID value_to_id _((VALUE v));
static inline long num_to_long _((VALUE n));
diff --git a/ext/racc/cparse/extconf.rb b/ext/racc/cparse/extconf.rb
index dd953a7e15..3710f6f7e7 100644
--- a/ext/racc/cparse/extconf.rb
+++ b/ext/racc/cparse/extconf.rb
@@ -1,4 +1,5 @@
# $Id$
require 'mkmf'
+have_func('rb_block_call', 'ruby/ruby.h')
create_makefile 'racc/cparse'
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 12837b5ac2..169a196166 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -5,7 +5,7 @@
#include RUBY_EXTCONF_H
#endif
-#include "config.h"
+#include "ruby/config.h"
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
@@ -20,9 +20,9 @@
#include <editline/readline.h>
#endif
-#include "ruby.h"
-#include "rubyio.h"
-#include "rubysig.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/signal.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/ext/ripper/depend b/ext/ripper/depend
index bd0f8010cf..f74f7f0fee 100644
--- a/ext/ripper/depend
+++ b/ext/ripper/depend
@@ -1,11 +1,11 @@
GEN = $(srcdir)/tools/generate.rb
-SRC1 = $(hdrdir)/parse.y
+SRC1 = $(top_srcdir)/parse.y
SRC2 = $(srcdir)/eventids2.c
BISON = bison
src: ripper.c eventids1.c eventids2table.c
-ripper.o: ripper.c $(topdir)/lex.c eventids1.c $(srcdir)/eventids2.c eventids2table.c
+ripper.o: ripper.c lex.c eventids1.c eventids2.c eventids2table.c
.y.c:
$(BISON) -t -v -o$@ $<
@@ -13,8 +13,8 @@ ripper.o: ripper.c $(topdir)/lex.c eventids1.c $(srcdir)/eventids2.c eventids2ta
all: check
static: check
-ripper.y: $(srcdir)/tools/preproc.rb $(hdrdir)/parse.y
- $(RUBY) $(srcdir)/tools/preproc.rb $(hdrdir)/parse.y --output=$@
+ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y
+ $(RUBY) $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y --output=$@
check: $(GEN) $(SRC1) $(SRC2)
$(RUBY) $(GEN) --mode=check --ids1src=$(SRC1) --ids2src=$(SRC2)
diff --git a/ext/ripper/extconf.rb b/ext/ripper/extconf.rb
index 6b44073300..a41a6af2d8 100644
--- a/ext/ripper/extconf.rb
+++ b/ext/ripper/extconf.rb
@@ -12,8 +12,10 @@ def main
end
$objs = %w(ripper.o)
$cleanfiles.concat %w(ripper.y ripper.c ripper.E ripper.output eventids1.c eventids2table.c)
- $CPPFLAGS += ' -DRIPPER'
- $CPPFLAGS += ' -DRIPPER_DEBUG' if $debug
+ $defs << '-DRIPPER'
+ $defs << '-DRIPPER_DEBUG' if $debug
+ $VPATH << '$(topdir)' << '$(top_srcdir)'
+ $INCFLAGS << ' -I$(topdir) -I$(top_srcdir)'
create_makefile 'ripper'
end
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index f9a5888624..7fdeb0dbd0 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -12,7 +12,7 @@
#endif
#include "sdbm.h"
-#include "config.h"
+#include "ruby/config.h"
/*
* sdbm - ndbm work-alike hashed database library
diff --git a/ext/socket/depend b/ext/socket/depend
index 77d5b66559..7577a6929a 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,6 +1,8 @@
-socket.o: socket.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h $(hdrdir)/rubyio.h $(hdrdir)/rubysig.h sockport.h constants.h
-getnameinfo.o: getnameinfo.c $(topdir)/config.h addrinfo.h sockport.h
-getaddrinfo.o: getaddrinfo.c $(topdir)/config.h addrinfo.h sockport.h
+socket.o: socket.c $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
+ $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/io.h $(hdrdir)/ruby/signal.h \
+ sockport.h constants.h
+getnameinfo.o: getnameinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
+getaddrinfo.o: getaddrinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
constants.h: $(srcdir)/mkconstants.rb
@echo "generating constants.h"
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 49fdf9b597..d97012a3c5 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -38,7 +38,7 @@
* - PF_UNSPEC case would be handled in getipnodebyname() with the AI_ALL flag.
*/
-#include "config.h"
+#include "ruby/config.h"
#include <sys/types.h>
#ifndef _WIN32
#include <sys/param.h>
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 91e18e916f..dcfdc6b35a 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -34,7 +34,7 @@
* but INRIA implementation returns EAI_xxx defined for getaddrinfo().
*/
-#include "config.h"
+#include "ruby/config.h"
#include <sys/types.h>
#ifndef _WIN32
#if defined(__BEOS__)
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index a69baac7bb..aee4b21567 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -10,10 +10,10 @@
************************************************/
-#include "ruby.h"
-#include "rubyio.h"
-#include "rubysig.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/signal.h"
+#include "ruby/util.h"
#include <stdio.h>
#include <sys/types.h>
diff --git a/ext/stringio/depend b/ext/stringio/depend
index cc9eae3f55..a052c73de7 100644
--- a/ext/stringio/depend
+++ b/ext/stringio/depend
@@ -1,2 +1,2 @@
-stringio.o: stringio.c $(hdrdir)/ruby.h $(topdir)/config.h \
- $(hdrdir)/defines.h $(hdrdir)/intern.h $(hdrdir)/rubyio.h
+stringio.o: stringio.c $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
+ $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/io.h
diff --git a/ext/strscan/depend b/ext/strscan/depend
index 2a4255e916..76f6e0b18b 100644
--- a/ext/strscan/depend
+++ b/ext/strscan/depend
@@ -1,3 +1,2 @@
strscan.o: strscan.c $(hdrdir)/ruby.h $(hdrdir)/re.h $(hdrdir)/regex.h \
- $(hdrdir)/regint.h $(hdrdir)/oniguruma.h $(topdir)/config.h \
- $(hdrdir)/defines.h
+ $(hdrdir)/oniguruma.h $(topdir)/config.h $(hdrdir)/defines.h
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index f991a13ac4..63a0f1185e 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -8,8 +8,8 @@
the Ruby License. For details, see the file COPYING.
*/
-#include "ruby.h"
-#include "re.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
#define STRSCAN_VERSION "0.7.0"
diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c
index 567aaf52a8..314ef229fe 100644
--- a/ext/syck/bytecode.c
+++ b/ext/syck/bytecode.c
@@ -8,7 +8,7 @@
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#include "gram.h"
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
index d3704f867b..03bdaa2dd7 100644
--- a/ext/syck/emitter.c
+++ b/ext/syck/emitter.c
@@ -9,7 +9,7 @@
* All Base64 code from Ruby's pack.c.
* Ruby is Copyright (C) 1993-2003 Yukihiro Matsumoto
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <stdio.h>
#include <string.h>
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
index b04c4e3c0e..3ff1a4e440 100644
--- a/ext/syck/handler.c
+++ b/ext/syck/handler.c
@@ -7,7 +7,7 @@
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
SYMID
diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c
index cfd5d7b3e6..df32d9194b 100644
--- a/ext/syck/implicit.c
+++ b/ext/syck/implicit.c
@@ -9,7 +9,7 @@
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#define YYCTYPE char
diff --git a/ext/syck/node.c b/ext/syck/node.c
index 47bce64900..99cc9c7515 100644
--- a/ext/syck/node.c
+++ b/ext/syck/node.c
@@ -7,7 +7,7 @@
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
/*
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index 1966a2d334..9a41c18e8f 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -8,7 +8,7 @@
* Copyright (C) 2003-2005 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#include <sys/types.h>
#include <time.h>
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index bab7ee5dc6..20aaecc9f0 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -6,7 +6,7 @@
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <stdio.h>
#include <string.h>
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
index 8d878a4359..0fdff8e380 100644
--- a/ext/syck/syck.h
+++ b/ext/syck/syck.h
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <ctype.h>
-#include "st.h"
+#include "ruby/st.h"
#if defined(__cplusplus)
extern "C" {
diff --git a/ext/syck/token.c b/ext/syck/token.c
index 3c6cd1a9cf..0517ffc400 100644
--- a/ext/syck/token.c
+++ b/ext/syck/token.c
@@ -8,7 +8,7 @@
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#include "gram.h"
diff --git a/ext/syck/yaml2byte.c b/ext/syck/yaml2byte.c
index bcc428e1cd..fd5caadd85 100644
--- a/ext/syck/yaml2byte.c
+++ b/ext/syck/yaml2byte.c
@@ -9,7 +9,7 @@
* WARNING WARNING WARNING --- THIS IS *NOT JUST* PLAYING
* ANYMORE! -- WHY HAS EMBRACED THIS AS THE REAL THING!
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <syck.h>
#include <assert.h>
#define YAMLBYTE_UTF8
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index d4945ae7b4..4ac645969d 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -7,8 +7,8 @@
* $Id$
*/
-#include "ruby.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/util.h"
#include <syslog.h>
/* Syslog class */
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 5ed86a8b76..123899043a 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -307,6 +307,8 @@ if tcltk_framework ||
$INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
# create
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
+ $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
create_makefile("tcltklib")
end
end
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 426505f3ae..d0aaf61f31 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -1,5 +1,5 @@
#include "stubs.h"
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <tcl.h>
#include <tk.h>
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 498944d453..4f779c731e 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -6,9 +6,8 @@
#define TCLTKLIB_RELEASE_DATE "2006-12-01"
-#include "ruby.h"
-#include "rubysig.h"
-#include "version.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
#undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */
#include <stdio.h>
#ifdef HAVE_STDARG_PROTOTYPES
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb
index dd00d5d535..51f775619c 100644
--- a/ext/tk/tkutil/extconf.rb
+++ b/ext/tk/tkutil/extconf.rb
@@ -7,5 +7,6 @@ end
if has_tk
require 'mkmf'
+ have_func("rb_obj_instance_exec", "ruby.h")
create_makefile('tkutil')
end
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 0b2597ec1a..25c4af742d 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -10,10 +10,9 @@
#define TKUTIL_RELEASE_DATE "2006-04-06"
-#include "ruby.h"
-#include "rubysig.h"
-#include "version.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
+#include "ruby/st.h"
static VALUE cMethod;
@@ -59,7 +58,7 @@ tk_s_new(argc, argv, klass)
VALUE obj = rb_class_new_instance(argc, argv, klass);
if (rb_block_given_p()) {
-#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR <= 8 /* ruby 1.8.x */
+#ifndef HAVE_RB_OBJ_INSTANCE_EXEC
rb_obj_instance_eval(0, 0, obj);
#else
rb_obj_instance_exec(1, &obj, obj);
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index c63401a7c8..5b31898318 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -16,8 +16,8 @@
modified for win32ole (ruby) by Masaki.Suketa <masaki.suketa@nifty.ne.jp>
*/
-#include "ruby.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/st.h"
#include <ctype.h>
#include <windows.h>
#include <ocidl.h>
@@ -1076,8 +1076,8 @@ ole_set_safe_array(long n, SAFEARRAY *psa, long *pid, long *pub, VALUE val, long
val1 = ole_ary_m_entry(val, pid);
p = val2variant_ptr(val1, &var, vt);
if (is_all_index_under(pid, pub, dim) == Qtrue) {
- if (V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL ||
- V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL) {
+ if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
+ (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
rb_raise(eWIN32OLERuntimeError, "argument does not have IDispatch or IUnknown Interface");
}
hr = SafeArrayPutElement(psa, pid, p);
@@ -2669,7 +2669,7 @@ fole_s_set_locale(VALUE self, VALUE vlcid)
cWIN32OLE_lcid = lcid;
break;
default:
- rb_raise(eWIN32OLERuntimeError, "not installed locale: %d", lcid);
+ rb_raise(eWIN32OLERuntimeError, "not installed locale: %u", (unsigned int)lcid);
}
}
return Qnil;
@@ -7827,7 +7827,6 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
{
struct olevariantdata *pvar;
SAFEARRAY *psa;
- VALUE val = Qnil;
VARIANT var;
VARTYPE vt;
long *pid;
@@ -7849,8 +7848,8 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
VariantInit(&var);
vt = (V_VT(&(pvar->var)) & ~VT_ARRAY);
p = val2variant_ptr(argv[argc-1], &var, vt);
- if (V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL ||
- V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL) {
+ if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
+ (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
rb_raise(eWIN32OLERuntimeError, "argument does not have IDispatch or IUnknown Interface");
}
hr = SafeArrayPutElement(psa, pid, p);
diff --git a/file.c b/file.c
index 54822a85a9..ed682a0b80 100644
--- a/file.c
+++ b/file.c
@@ -16,10 +16,10 @@
#include "missing/file.h"
#endif
-#include "ruby.h"
-#include "rubyio.h"
-#include "rubysig.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/signal.h"
+#include "ruby/util.h"
#include "dln.h"
#ifdef HAVE_UNISTD_H
diff --git a/gc.c b/gc.c
index 91340475e1..4ea96efe20 100644
--- a/gc.c
+++ b/gc.c
@@ -12,11 +12,11 @@
**********************************************************************/
-#include "ruby.h"
-#include "rubysig.h"
-#include "st.h"
-#include "node.h"
-#include "re.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
+#include "ruby/st.h"
+#include "ruby/node.h"
+#include "ruby/re.h"
#include "yarvcore.h"
#include "gc.h"
#include <stdio.h>
diff --git a/hash.c b/hash.c
index 5f578fa299..3f27a0c633 100644
--- a/hash.c
+++ b/hash.c
@@ -12,10 +12,10 @@
**********************************************************************/
-#include "ruby.h"
-#include "st.h"
-#include "util.h"
-#include "rubysig.h"
+#include "ruby/ruby.h"
+#include "ruby/st.h"
+#include "ruby/util.h"
+#include "ruby/signal.h"
#ifdef __APPLE__
#include <crt_externs.h>
diff --git a/include/ruby.h b/include/ruby.h
new file mode 100644
index 0000000000..b1fb46c897
--- /dev/null
+++ b/include/ruby.h
@@ -0,0 +1 @@
+#include <ruby/ruby.h>
diff --git a/defines.h b/include/ruby/defines.h
index 1f5a0054f1..81f2ef45ed 100644
--- a/defines.h
+++ b/include/ruby/defines.h
@@ -7,8 +7,16 @@
created at: Wed May 18 00:21:44 JST 1994
************************************************/
-#ifndef DEFINES_H
-#define DEFINES_H
+
+#ifndef RUBY_DEFINES_H
+#define RUBY_DEFINES_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
#define RUBY
@@ -185,7 +193,7 @@ void xfree(void*);
#endif /* NeXT */
#ifdef _WIN32
-#include "win32/win32.h"
+#include "ruby/win32.h"
#endif
#if defined(__VMS)
@@ -266,4 +274,11 @@ void rb_ia64_flushrs(void);
#define RUBY_PLATFORM "unknown-unknown"
#endif
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
#endif
+
+#endif /* RUBY_DEFINES_H */
diff --git a/intern.h b/include/ruby/intern.h
index e230ac5ce6..a74bd8ed23 100644
--- a/intern.h
+++ b/include/ruby/intern.h
@@ -15,12 +15,19 @@
#ifndef RUBY_INTERN_H
#define RUBY_INTERN_H 1
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
#ifdef HAVE_STDARG_PROTOTYPES
# include <stdarg.h>
#else
# include <varargs.h>
#endif
-#include <st.h>
+#include <ruby/st.h>
/*
* Functions and variables that are used by more than one source file of
@@ -610,4 +617,11 @@ void Init_stack(VALUE*);
void rb_frame_pop(void);
NORETURN(void rb_thread_start_1(void));
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
#endif /* RUBY_INTERN_H */
diff --git a/rubyio.h b/include/ruby/io.h
index 14d2039183..6d22de8df1 100644
--- a/rubyio.h
+++ b/include/ruby/io.h
@@ -10,8 +10,15 @@
**********************************************************************/
-#ifndef RUBYIO_H
-#define RUBYIO_H
+#ifndef RUBY_IO_H
+#define RUBY_IO_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
#include <stdio.h>
#include <errno.h>
@@ -108,4 +115,12 @@ DEPRECATED(int rb_getc(FILE*));
DEPRECATED(long rb_io_fread(char *, long, FILE *));
DEPRECATED(long rb_io_fwrite(const char *, long, FILE *));
DEPRECATED(int rb_read_pending(FILE*));
+
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
#endif
+
+#endif /* RUBY_IO_H */
diff --git a/missing.h b/include/ruby/missing.h
index 81fdfecf72..007c546617 100644
--- a/missing.h
+++ b/include/ruby/missing.h
@@ -9,8 +9,15 @@
************************************************/
-#ifndef MISSING_H
-#define MISSING_H
+#ifndef RUBY_MISSING_H
+#define RUBY_MISSING_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
@@ -145,4 +152,11 @@ extern size_t strlcpy(char *, const char*, size_t);
extern size_t strlcat(char *, const char*, size_t);
#endif
-#endif /* MISSING_H */
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBY_MISSING_H */
diff --git a/node.h b/include/ruby/node.h
index bc9a5923d0..a477c9d555 100644
--- a/node.h
+++ b/include/ruby/node.h
@@ -10,11 +10,14 @@
**********************************************************************/
-#ifndef NODE_H
-#define NODE_H
+#ifndef RUBY_NODE_H
+#define RUBY_NODE_H 1
#if defined(__cplusplus)
extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
#endif
enum node_type {
@@ -388,7 +391,10 @@ VALUE rb_gvar_set(struct global_entry *, VALUE);
VALUE rb_gvar_defined(struct global_entry *);
#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
} /* extern "C" { */
#endif
-#endif
+#endif /* RUBY_NODE_H */
diff --git a/oniguruma.h b/include/ruby/oniguruma.h
index 97c581dfd6..a615426e39 100644
--- a/oniguruma.h
+++ b/include/ruby/oniguruma.h
@@ -31,6 +31,9 @@
#ifdef __cplusplus
extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
#endif
#define ONIGURUMA
@@ -804,6 +807,9 @@ ONIG_EXTERN
const char* onig_copyright P_((void));
#ifdef __cplusplus
+#if 0
+{ /* satisfy cc-mode */
+#endif
}
#endif
diff --git a/re.h b/include/ruby/re.h
index ab66352288..ae6e0357b6 100644
--- a/re.h
+++ b/include/ruby/re.h
@@ -10,13 +10,20 @@
**********************************************************************/
-#ifndef RE_H
-#define RE_H
+#ifndef RUBY_RE_H
+#define RUBY_RE_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
#include <sys/types.h>
#include <stdio.h>
-#include "regex.h"
+#include "ruby/regex.h"
typedef struct re_pattern_buffer Regexp;
@@ -40,4 +47,12 @@ RUBY_EXTERN int ruby_ignorecase;
int rb_reg_mbclen2(unsigned int, VALUE);
#define mbclen2(c,re) rb_reg_mbclen2((c),(re))
+
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
#endif
+
+#endif /* RUBY_RE_H */
diff --git a/regex.h b/include/ruby/regex.h
index d2877937ca..118c37c480 100644
--- a/regex.h
+++ b/include/ruby/regex.h
@@ -9,10 +9,21 @@
**********************************************************************/
-#ifndef REGEX_H
-#define REGEX_H
-
+#ifndef ONIGURUMA_REGEX_H
+#define ONIGURUMA_REGEX_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
+#ifdef RUBY
+#include "ruby/oniguruma.h"
+#else
#include "oniguruma.h"
+#endif
#ifndef ONIG_RUBY_M17N
@@ -25,4 +36,11 @@ ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
#endif /* ifndef ONIG_RUBY_M17N */
-#endif /* !REGEX_H */
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* ONIGURUMA_REGEX_H */
diff --git a/ruby.h b/include/ruby/ruby.h
index c54d445e58..69aadf14c4 100644
--- a/ruby.h
+++ b/include/ruby/ruby.h
@@ -12,7 +12,7 @@
**********************************************************************/
#ifndef RUBY_H
-#define RUBY_H
+#define RUBY_H 1
#if defined(__cplusplus)
extern "C" {
@@ -21,7 +21,7 @@ extern "C" {
#endif
#endif
-#include "config.h"
+#include "ruby/config.h"
#ifdef RUBY_EXTCONF_H
#include RUBY_EXTCONF_H
#endif
@@ -805,8 +805,8 @@ rb_special_const_p(VALUE obj)
return Qfalse;
}
-#include "missing.h"
-#include "intern.h"
+#include "ruby/missing.h"
+#include "ruby/intern.h"
#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
/* hook for external modules */
@@ -823,4 +823,4 @@ static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
} /* extern "C" { */
#endif
-#endif /* ifndef RUBY_H */
+#endif /* RUBY_H */
diff --git a/rubysig.h b/include/ruby/signal.h
index 2df03e415c..29ffcd9f11 100644
--- a/rubysig.h
+++ b/include/ruby/signal.h
@@ -11,7 +11,15 @@
**********************************************************************/
#ifndef RUBYSIG_H
-#define RUBYSIG_H
+#define RUBYSIG_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
#include <errno.h>
#ifdef _WIN32
@@ -75,4 +83,11 @@ void rb_trap_restore_mask(void);
RUBY_EXTERN int rb_thread_critical;
void rb_thread_schedule(void);
-#endif /* ifndef RUBYSIG_H */
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBYSIG_H */
diff --git a/st.h b/include/ruby/st.h
index 45609ddeb1..d6d4479b3e 100644
--- a/st.h
+++ b/include/ruby/st.h
@@ -2,9 +2,15 @@
/* @(#) st.h 5.1 89/12/14 */
-#ifndef ST_INCLUDED
+#ifndef RUBY_ST_H
+#define RUBY_ST_H 1
-#define ST_INCLUDED
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
#if SIZEOF_LONG == SIZEOF_VOIDP
typedef unsigned long st_data_t;
@@ -63,4 +69,11 @@ st_table *st_copy(st_table *);
int st_numcmp(long, long);
int st_numhash(long);
-#endif /* ST_INCLUDED */
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBY_ST_H */
diff --git a/util.h b/include/ruby/util.h
index b95a98ecae..8437872479 100644
--- a/util.h
+++ b/include/ruby/util.h
@@ -10,8 +10,15 @@
**********************************************************************/
-#ifndef UTIL_H
-#define UTIL_H
+#ifndef RUBY_UTIL_H
+#define RUBY_UTIL_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
#ifndef _
#ifdef __cplusplus
@@ -64,4 +71,11 @@ double ruby_strtod(const char *, char **);
#undef strtod
#define strtod(s,e) ruby_strtod(s,e)
-#endif /* UTIL_H */
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
+#endif
+
+#endif /* RUBY_UTIL_H */
diff --git a/win32/win32.h b/include/ruby/win32.h
index 281dbc2998..450cb32853 100644
--- a/win32/win32.h
+++ b/include/ruby/win32.h
@@ -1,5 +1,12 @@
#ifndef RUBY_WIN32_H
-#define RUBY_WIN32_H
+#define RUBY_WIN32_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
/*
* Copyright (c) 1993, Intergraph Corporation
@@ -527,4 +534,11 @@ in asynchronous_func_t.
typedef DWORD (*asynchronous_func_t)(DWORD self, int argc, DWORD* argv);
DWORD rb_w32_asynchronize(asynchronous_func_t func, DWORD self, int argc, DWORD* argv, DWORD intrval);
+#if defined(__cplusplus)
+#if 0
+{ /* satisfy cc-mode */
+#endif
+} /* extern "C" { */
#endif
+
+#endif /* RUBY_WIN32_H */
diff --git a/include/rubyio.h b/include/rubyio.h
new file mode 100644
index 0000000000..f385058c44
--- /dev/null
+++ b/include/rubyio.h
@@ -0,0 +1 @@
+#include <ruby/io.h>
diff --git a/include/rubysig.h b/include/rubysig.h
new file mode 100644
index 0000000000..cc8cdb2f6d
--- /dev/null
+++ b/include/rubysig.h
@@ -0,0 +1 @@
+#include <ruby/signal.h>
diff --git a/inits.c b/inits.c
index e6b7572399..ef94f993e7 100644
--- a/inits.c
+++ b/inits.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
void Init_Array(void);
void Init_Bignum(void);
diff --git a/instruby.rb b/instruby.rb
index 8327d8c570..52f81af4d5 100755
--- a/instruby.rb
+++ b/instruby.rb
@@ -127,7 +127,14 @@ def install_recursive(srcdir, dest, options = {})
subpath = srcdir.size..-1
Dir.glob("#{srcdir}/**/*", File::FNM_DOTMATCH) do |src|
next if /\A\.{1,2}\z/ =~ (base = File.basename(src))
- next if noinst and File.fnmatch?(noinst, File.basename(src))
+ if noinst
+ base = File.basename(src)
+ if Array === noinst
+ next if noinst.any? {|n| File.fnmatch?(n, base)}
+ else
+ next if File.fnmatch?(noinst, base)
+ end
+ end
d = dest + src[subpath]
if File.directory?(src)
makedirs(d)
@@ -158,6 +165,8 @@ rubyw_install_name = CONFIG["rubyw_install_name"]
version = CONFIG["ruby_version"]
bindir = CONFIG["bindir"]
libdir = CONFIG["libdir"]
+archhdrdir = rubyhdrdir = CONFIG["rubyhdrdir"]
+archhdrdir += "/" + CONFIG["arch"]
rubylibdir = CONFIG["rubylibdir"]
archlibdir = CONFIG["archdir"]
sitelibdir = CONFIG["sitelibdir"]
@@ -172,7 +181,7 @@ arc = CONFIG["LIBRUBY_A"]
install?(:local, :arch, :bin) do
puts "installing binary commands"
- makedirs [bindir, libdir, archlibdir]
+ makedirs [bindir, libdir, archlibdir, archhdrdir]
install ruby_install_name+exeext, bindir, :mode => 0755
if rubyw_install_name and !rubyw_install_name.empty?
@@ -183,7 +192,6 @@ install?(:local, :arch, :bin) do
end
install lib, libdir, :mode => 0755 unless lib == arc
install arc, libdir, :mode => 0644
- install "config.h", archlibdir, :mode => 0644
install "rbconfig.rb", archlibdir, :mode => 0644
if CONFIG["ARCHFILE"]
for file in CONFIG["ARCHFILE"].split
@@ -207,11 +215,13 @@ if $extout
noinst = nil
end
install_recursive("#{extout}/#{CONFIG['arch']}", archlibdir, :no_install => noinst)
+ install_recursive("#{extout}/include/#{CONFIG['arch']}", archhdrdir)
end
install?(:ext, :comm, :'ext-comm') do
puts "installing extension scripts"
makedirs [rubylibdir, sitelibdir]
install_recursive("#{extout}/common", rubylibdir)
+ install_recursive("#{extout}/include", rubyhdrdir)
end
end
@@ -297,16 +307,13 @@ install?(:local, :arch, :lib) do
puts "installing headers"
Dir.chdir(srcdir)
- makedirs [archlibdir]
- for f in Dir["*.h"]
- install f, archlibdir, :mode => 0644
- end
-
- if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
- win32libdir = File.join(archlibdir, "win32")
- makedirs win32libdir
- install "win32/win32.h", win32libdir, :mode => 0644
+ makedirs [rubyhdrdir]
+ noinst = []
+ unless RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
+ noinst << "win32.h"
end
+ noinst = nil if noinst.empty?
+ install_recursive("include", rubyhdrdir, :no_install => noinst)
end
install?(:local, :comm, :man) do
diff --git a/io.c b/io.c
index 84c6b87cfa..cda216789b 100644
--- a/io.c
+++ b/io.c
@@ -12,9 +12,9 @@
**********************************************************************/
-#include "ruby.h"
-#include "rubyio.h"
-#include "rubysig.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/signal.h"
#include <ctype.h>
#include <errno.h>
@@ -87,7 +87,7 @@ extern void Init_File(void);
#include <net/socket.h>
#endif
-#include "util.h"
+#include "ruby/util.h"
#ifndef O_ACCMODE
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
diff --git a/iseq.c b/iseq.c
index f8a7e8a545..8fe442316c 100644
--- a/iseq.c
+++ b/iseq.c
@@ -10,8 +10,8 @@
**********************************************************************/
-#include <ruby.h>
-#include <node.h>
+#include "ruby/ruby.h"
+#include "ruby/node.h"
#include "yarvcore.h"
#include "insns.inc"
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 797388f591..54299fe696 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -73,11 +73,13 @@ end
INSTALL_DIRS = [
[dir_re('commondir'), "$(RUBYCOMMONDIR)"],
- [dir_re("sitedir"), "$(RUBYCOMMONDIR)"],
+ [dir_re('sitedir'), "$(RUBYCOMMONDIR)"],
[dir_re('rubylibdir'), "$(RUBYLIBDIR)"],
[dir_re('archdir'), "$(RUBYARCHDIR)"],
[dir_re('sitelibdir'), "$(RUBYLIBDIR)"],
- [dir_re('sitearchdir'), "$(RUBYARCHDIR)"]
+ [dir_re('sitearchdir'), "$(RUBYARCHDIR)"],
+ [dir_re('rubyhdrdir'), "$(RUBYHDRDIR)"],
+ [dir_re('sitehdrdir'), "$(SITEHDRDIR)"],
]
def install_dirs(target_prefix = nil)
@@ -86,6 +88,8 @@ def install_dirs(target_prefix = nil)
['RUBYCOMMONDIR', '$(extout)/common'],
['RUBYLIBDIR', '$(RUBYCOMMONDIR)$(target_prefix)'],
['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
+ ['HDRDIR', '$(extout)/include/ruby$(target_prefix)'],
+ ['ARCHHDRDIR', '$(extout)/include/$(arch)/ruby$(target_prefix)'],
['extout', "#$extout"],
['extout_prefix', "#$extout_prefix"],
]
@@ -94,12 +98,16 @@ def install_dirs(target_prefix = nil)
['RUBYCOMMONDIR', '$(rubylibdir)'],
['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
+ ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
+ ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
]
else
- dirs = [
+n dirs = [
['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
+ ['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
+ ['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
]
end
dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
@@ -114,11 +122,13 @@ end
topdir = File.dirname(libdir = File.dirname(__FILE__))
extdir = File.expand_path("ext", topdir)
$extmk = File.expand_path($0)[0, extdir.size+1] == extdir+"/"
-if not $extmk and File.exist?(RbConfig::CONFIG["archdir"] + "/ruby.h")
- $hdrdir = $topdir = RbConfig::CONFIG["archdir"]
-elsif File.exist?(($top_srcdir ||= topdir) + "/ruby.h") and
- File.exist?(($topdir ||= RbConfig::CONFIG["topdir"]) + "/config.h")
- $hdrdir = $top_srcdir
+if not $extmk and File.exist?(($hdrdir = RbConfig::CONFIG["rubyhdrdir"]) + "/ruby/ruby.h")
+ $topdir = $hdrdir
+ $arch_hdrdir = $hdrdir + "/$(arch)"
+elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir) + "/include") + "/ruby.h") and
+ File.exist?("#{CONFIG["EXTOUT"]}/include/#{CONFIG["arch"]}/ruby/config.h")
+ $topdir ||= RbConfig::CONFIG["topdir"]
+ $arch_hdrdir = "$(extout)/include/$(arch)"
else
abort "can't find header files for ruby."
end
@@ -126,11 +136,11 @@ end
OUTFLAG = CONFIG['OUTFLAG']
CPPOUTFILE = CONFIG['CPPOUTFILE']
-CONFTEST_C = "conftest.c"
+CONFTEST_C = "conftest.c".freeze
class String
def quote
- /\s/ =~ self ? "\"#{self}\"" : self
+ /\s/ =~ self ? "\"#{self}\"" : "#{self}"
end
end
class Array
@@ -269,8 +279,10 @@ def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH)
RbConfig::expand(TRY_LINK.dup,
CONFIG.merge('hdrdir' => $hdrdir.quote,
'src' => CONFTEST_C,
- 'INCFLAGS' => $INCFLAGS,
- 'CPPFLAGS' => $CPPFLAGS,
+ 'arch_hdrdir' => "#$arch_hdrdir",
+ 'top_srcdir' => $top_srcdir.quote,
+ 'INCFLAGS' => "#$INCFLAGS",
+ 'CPPFLAGS' => "#$CPPFLAGS",
'CFLAGS' => "#$CFLAGS",
'ARCH_FLAG' => "#$ARCH_FLAG",
'LDFLAGS' => "#$LDFLAGS #{ldflags}",
@@ -281,12 +293,16 @@ end
def cc_command(opt="")
RbConfig::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}",
- CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote))
+ CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
+ 'arch_hdrdir' => "#$arch_hdrdir",
+ 'top_srcdir' => $top_srcdir.quote))
end
def cpp_command(outfile, opt="")
RbConfig::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
- CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote))
+ CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
+ 'arch_hdrdir' => "#$arch_hdrdir",
+ 'top_srcdir' => $top_srcdir.quote))
end
def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
@@ -1037,12 +1053,12 @@ end
def configuration(srcdir)
mk = []
- vpath = %w[$(srcdir) $(topdir) $(hdrdir)]
+ vpath = $VPATH.dup
if !CROSS_COMPILING
case CONFIG['build_os']
when 'cygwin'
if CONFIG['target_os'] != 'cygwin'
- vpath.each {|p| p.sub!(/.*/, '$(shell cygpath -u \&)')}
+ vpath = vpath.map {|p| p.sub(/.*/, '$(shell cygpath -u \&)')}
end
when 'msdosdjgpp', 'mingw32'
CONFIG['PATH_SEPARATOR'] = ';'
@@ -1053,10 +1069,15 @@ def configuration(srcdir)
SHELL = /bin/sh
#### Start of system configuration section. ####
-
+#{
+if $extmk
+ "top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/")
+end
+}
srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {CONFIG[$1||$2]}.quote}
topdir = #{($extmk ? CONFIG["topdir"] : $topdir).quote}
-hdrdir = #{$extmk ? CONFIG["hdrdir"].quote : '$(topdir)'}
+hdrdir = #{CONFIG["hdrdir"].quote}
+arch_hdrdir = #{$arch_hdrdir}
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
if $extmk
@@ -1071,7 +1092,8 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
end
CONFIG.each do |key, var|
next if /^abs_/ =~ key
- next unless /^(?:src|top|hdr|(.*))dir$/ =~ key and $1
+ next if /^(?:src|top|hdr)dir$/ =~ key
+ next unless /dir$/ =~ key
mk << "#{key} = #{with_destdir(var)}\n"
end
if !$extmk and !$configure_args.has_key?('--ruby') and
@@ -1397,7 +1419,8 @@ site-install-rb: install-rb
end
while line = dfile.gets()
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
- line.gsub!(/\$\(hdrdir\)\/config.h/, $config_h) if $config_h
+ line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h) if $config_h
+ line.gsub!(%r"\$\(hdrdir\)/(?!ruby/)", '\&ruby/')
if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line
(cont ||= []) << line
next
@@ -1442,7 +1465,7 @@ def init_mkmf(config = CONFIG)
$ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
$CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup
$LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", config["LDFLAGS"])).dup
- $INCFLAGS = "-I$(topdir) -I$(hdrdir) -I$(srcdir)"
+ $INCFLAGS = "-I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)"
$DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
$LIBEXT = config['LIBEXT'].dup
$OBJEXT = config["OBJEXT"].dup
@@ -1454,6 +1477,7 @@ def init_mkmf(config = CONFIG)
$DEFLIBPATH.unshift(".")
$LIBPATH = []
$INSTALLFILES = nil
+ $VPATH = %w[$(srcdir) $(arch_hdrdir)/ruby $(hdrdir)/ruby]
$objs = nil
$srcs = nil
diff --git a/main.c b/main.c
index 48ec4e08de..80a155fb0c 100644
--- a/main.c
+++ b/main.c
@@ -11,7 +11,7 @@
**********************************************************************/
#undef RUBY_EXPORT
-#include "ruby.h"
+#include "ruby/ruby.h"
#if defined(__MACOS__) && defined(__MWERKS__)
#include <console.h>
diff --git a/marshal.c b/marshal.c
index 96ed62723f..c6c512bdb0 100644
--- a/marshal.c
+++ b/marshal.c
@@ -10,10 +10,10 @@
**********************************************************************/
-#include "ruby.h"
-#include "rubyio.h"
-#include "st.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/st.h"
+#include "ruby/util.h"
#include <math.h>
#ifdef HAVE_FLOAT_H
diff --git a/math.c b/math.c
index bd02849002..d0c2eee487 100644
--- a/math.c
+++ b/math.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <math.h>
#include <errno.h>
diff --git a/missing/flock.c b/missing/flock.c
index 2219d176d1..b02f8bf832 100644
--- a/missing/flock.c
+++ b/missing/flock.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include "ruby/config.h"
#if defined _WIN32
#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H
diff --git a/missing/strftime.c b/missing/strftime.c
index 5522226ec1..ba6785233a 100644
--- a/missing/strftime.c
+++ b/missing/strftime.c
@@ -45,7 +45,7 @@
* January 1996
*/
-#include "config.h"
+#include "ruby/config.h"
#ifndef GAWK
#include <stdio.h>
diff --git a/numeric.c b/numeric.c
index ceaba65fee..4c702d097e 100644
--- a/numeric.c
+++ b/numeric.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <ctype.h>
#include <math.h>
#include <stdio.h>
diff --git a/object.c b/object.c
index 573f75a3dd..6264b163c9 100644
--- a/object.c
+++ b/object.c
@@ -12,9 +12,10 @@
**********************************************************************/
-#include "ruby.h"
-#include "st.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/st.h"
+#include "ruby/util.h"
+#include "debug.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
@@ -384,7 +385,7 @@ rb_obj_is_instance_of(VALUE obj, VALUE c)
* b.kind_of? C #=> false
* b.kind_of? M #=> true
*/
-#include "debug.h"
+
VALUE
rb_obj_is_kind_of(VALUE obj, VALUE c)
{
@@ -1675,7 +1676,7 @@ rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
* fred.instance_variable_get(:@a) #=> "cat"
* fred.instance_variable_get("@b") #=> 99
*/
-#include "debug.h"
+
static VALUE
rb_obj_ivar_get(VALUE obj, VALUE iv)
{
diff --git a/pack.c b/pack.c
index 767bead448..726048fae0 100644
--- a/pack.c
+++ b/pack.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <sys/types.h>
#include <ctype.h>
diff --git a/parse.y b/parse.y
index 0990ba68c8..14a081a066 100644
--- a/parse.y
+++ b/parse.y
@@ -16,10 +16,10 @@
#define YYERROR_VERBOSE 1
#define YYSTACK_USE_ALLOCA 0
-#include "ruby.h"
-#include "intern.h"
-#include "node.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/intern.h"
+#include "ruby/node.h"
+#include "ruby/st.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
@@ -4544,8 +4544,8 @@ ripper_dispatch_delayed_token(struct parser_params *parser, int t)
}
#endif /* RIPPER */
-#include "regex.h"
-#include "util.h"
+#include "ruby/regex.h"
+#include "ruby/util.h"
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
since ours (we hope) works properly with all combinations of
diff --git a/prec.c b/prec.c
index 80396dfdef..981dcbc85c 100644
--- a/prec.c
+++ b/prec.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
VALUE rb_mPrecision;
diff --git a/process.c b/process.c
index c6caf5f7f2..c0376f1666 100644
--- a/process.c
+++ b/process.c
@@ -12,8 +12,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "rubysig.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
#include "yarvcore.h"
#include <stdio.h>
@@ -50,7 +50,7 @@ struct timeval rb_time_interval(VALUE);
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
-#include "st.h"
+#include "ruby/st.h"
#ifdef __EMX__
#undef HAVE_GETPGRP
diff --git a/random.c b/random.c
index 8dad78a274..d37995baff 100644
--- a/random.c
+++ b/random.c
@@ -176,7 +176,7 @@ genrand_real(void)
/* These real versions are due to Isaku Wada, 2002/01/09 added */
-#include "ruby.h"
+#include "ruby/ruby.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/range.c b/range.c
index e010778e0d..ec866de8eb 100644
--- a/range.c
+++ b/range.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
VALUE rb_cRange;
static ID id_cmp, id_succ, id_beg, id_end, id_excl;
diff --git a/re.c b/re.c
index 07d8fd5db3..5398e29946 100644
--- a/re.c
+++ b/re.c
@@ -9,8 +9,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "re.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
#include "regint.h"
#include <ctype.h>
diff --git a/regenc.h b/regenc.h
index b1d6f22818..882971ceb6 100644
--- a/regenc.h
+++ b/regenc.h
@@ -29,12 +29,12 @@
* SUCH DAMAGE.
*/
#ifndef REGINT_H
-#include "config.h"
+#include "ruby/config.h"
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
#undef ONIG_ESCAPE_UCHAR_COLLISION
#endif
#endif
-#include "oniguruma.h"
+#include "ruby/oniguruma.h"
typedef struct {
OnigCodePoint from;
diff --git a/regint.h b/regint.h
index f76469f371..4a6fc46337 100644
--- a/regint.h
+++ b/regint.h
@@ -80,9 +80,9 @@
/* */
/* escape other system UChar definition */
-#ifndef DEFINES_H
-#include "config.h"
-#include "defines.h"
+#ifndef RUBY_DEFINES_H
+#include "ruby/config.h"
+#include "ruby/defines.h"
#endif
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
#undef ONIG_ESCAPE_UCHAR_COLLISION
diff --git a/regparse.c b/regparse.c
index a255644b34..1d669212d5 100644
--- a/regparse.c
+++ b/regparse.c
@@ -302,7 +302,7 @@ typedef struct {
#ifdef USE_ST_HASH_TABLE
-#include "st.h"
+#include "ruby/st.h"
typedef struct {
unsigned char* s;
diff --git a/ruby.c b/ruby.c
index 61ba65baa9..fb9c5595d8 100644
--- a/ruby.c
+++ b/ruby.c
@@ -17,11 +17,11 @@
#endif
#ifdef _WIN32_WCE
#include <winsock.h>
-#include "wince.h"
+#include "ruby/wince.h"
#endif
-#include "ruby.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
#include "dln.h"
-#include "node.h"
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
@@ -40,7 +40,7 @@
# define MAXPATHLEN 1024
#endif
-#include "util.h"
+#include "ruby/util.h"
#ifndef HAVE_STDLIB_H
char *getenv();
diff --git a/signal.c b/signal.c
index ca96d22895..e785b6fb96 100644
--- a/signal.c
+++ b/signal.c
@@ -12,9 +12,9 @@
**********************************************************************/
-#include "ruby.h"
-#include "rubysig.h"
-#include "node.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
+#include "ruby/node.h"
#include "yarvcore.h"
#include <signal.h>
#include <stdio.h>
diff --git a/sprintf.c b/sprintf.c
index 41661f1134..5aeb03875a 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -12,8 +12,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "re.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
#include <ctype.h>
#include <math.h>
#include <stdarg.h>
diff --git a/st.c b/st.c
index 451d0c0d10..880989aa34 100644
--- a/st.c
+++ b/st.c
@@ -2,19 +2,20 @@
/* static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; */
-#include "config.h"
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>
-#include "defines.h"
#ifdef NOT_RUBY
#include "regint.h"
-#endif
-
#include "st.h"
+#else
+#include "ruby/config.h"
+#include "ruby/defines.h"
+#include "ruby/st.h"
+#endif
typedef struct st_table_entry st_table_entry;
diff --git a/string.c b/string.c
index 77f334abfc..f5717b9231 100644
--- a/string.c
+++ b/string.c
@@ -12,8 +12,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "re.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
#define BEG(no) regs->beg[no]
#define END(no) regs->end[no]
diff --git a/struct.c b/struct.c
index 188910be48..dba4026362 100644
--- a/struct.c
+++ b/struct.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
VALUE rb_cStruct;
diff --git a/time.c b/time.c
index 5a806ecab4..21d8bbd45d 100644
--- a/time.c
+++ b/time.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <sys/types.h>
#include <time.h>
diff --git a/unicode.c b/unicode.c
index c81f73006f..a85b3212af 100644
--- a/unicode.c
+++ b/unicode.c
@@ -10787,7 +10787,7 @@ onigenc_utf16_32_get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
return onigenc_unicode_ctype_code_range(ctype, ranges);
}
-#include "st.h"
+#include "ruby/st.h"
#define PROPERTY_NAME_MAX_SIZE 20
diff --git a/util.c b/util.c
index e9e53ed4b3..b309598517 100644
--- a/util.c
+++ b/util.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <ctype.h>
#include <stdio.h>
@@ -22,7 +22,7 @@
#include "missing/file.h"
#endif
-#include "util.h"
+#include "ruby/util.h"
unsigned long
ruby_scan_oct(const char *start, int len, int *retlen)
diff --git a/variable.c b/variable.c
index af29934ae8..09593834a3 100644
--- a/variable.c
+++ b/variable.c
@@ -12,10 +12,10 @@
**********************************************************************/
-#include "ruby.h"
-#include "node.h"
-#include "st.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
+#include "ruby/st.h"
+#include "ruby/util.h"
void rb_vm_change_state(void);
st_table *rb_global_tbl;
diff --git a/version.c b/version.c
index 794f621595..8db37ecd3d 100644
--- a/version.c
+++ b/version.c
@@ -10,7 +10,7 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "version.h"
#include <stdio.h>
diff --git a/version.h b/version.h
index c27ab92bcd..f8d4d76648 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-06-08"
+#define RUBY_RELEASE_DATE "2007-06-10"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070608
+#define RUBY_RELEASE_CODE 20070610
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 8
+#define RUBY_RELEASE_DAY 10
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];
diff --git a/vm.c b/vm.c
index 603d4d0743..94d3034dbf 100644
--- a/vm.c
+++ b/vm.c
@@ -9,9 +9,9 @@
**********************************************************************/
-#include "ruby.h"
-#include "node.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
+#include "ruby/st.h"
#include "gc.h"
#include "yarvcore.h"
diff --git a/vm_dump.c b/vm_dump.c
index f5baefbd7a..815a03e38c 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -10,8 +10,8 @@
**********************************************************************/
-#include <ruby.h>
-#include <node.h>
+#include "ruby/ruby.h"
+#include "ruby/node.h"
#include "yarvcore.h"
#include "vm.h"
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index b27866adb3..88bf4f8958 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -34,7 +34,6 @@ iconinc=-I$(icondirs: = -I)
!endif
###############
-VPATH = $(srcdir);$(srcdir)/missing;$(srcdir)/win32
.SUFFIXES: .y .def .lib
!if !defined(CC)
@@ -92,6 +91,8 @@ OS = mswin32
!error RT not defined. Retry from configure pass.
!endif
+arch = $(ARCH)-$(OS)
+
!ifndef RUBY_SO_NAME
RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
!endif
@@ -150,7 +151,7 @@ ARFLAGS = -machine:$(MACHINE) -out:
CC = $(CC) -nologo
LD = $(CC)
LDSHARED = $(LD) -LD
-XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing
+XCFLAGS = -DRUBY_EXPORT -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(srcdir)/missing
!if $(MSC_VER) >= 1400
# Prevents VC++ 2005 (cl ver 14) warnings
CPPFLAGS = $(CPPFLAGS) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
@@ -199,6 +200,10 @@ INSTALLED_LIST= .installed.list
WINMAINOBJ = winmain.$(OBJEXT)
MINIOBJS = dmydln.$(OBJEXT)
+arch_hdrdir = $(EXTOUT)/include/$(arch)
+hdrdir = $(srcdir)/include
+VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/missing;$(srcdir)/win32
+
all: $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
ruby: $(PROGRAM)
@@ -210,6 +215,7 @@ $(MKFILES): $(srcdir)/win32/Makefile.sub $(srcdir)/win32/configure.bat $(srcdir)
$(COMSPEC) /C $(srcdir:/=\)\win32\configure.bat $(configure_args)
@echo $(MKFILES) should be updated, re-run $(MAKE).
+RUBY_CONFIG_H = $(arch_hdrdir)/ruby/config.h
CONFIG_H = ./.config.h.time
config: config.status
@@ -218,9 +224,15 @@ config.status: $(CONFIG_H)
$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
@echo Creating config.h
- @$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat config.h <<
+!if !exist("$(arch_hdrdir)")
+ @md $(arch_hdrdir:/=\)
+!endif
+!if !exist("$(arch_hdrdir)/ruby")
+ @md $(arch_hdrdir:/=\)\ruby
+!endif
+ @$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat $(RUBY_CONFIG_H:/=\) <<
#if _MSC_VER != $(MSC_VER)
-#error MSC version unmatch
+#error MSC version unmatch: _MSC_VER: $(MSC_VER) is expected.
#endif
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
@@ -329,25 +341,24 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
#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)"
-#define RUBY_PLATFORM "$(ARCH)-$(OS)"
+#define RUBY_PLATFORM "$(arch)"
#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)"
<<
@exit > $(@:/=\)
-#!if exist(config.h)
+#!if exist($(RUBY_CONFIG_H))
#! if exist(config_h.bak)
-# @del config_h.bak
+# @del $(RUBY_CONFIG_H:.h=_h).bak
#! endif
-# @ren config.h config_h.bak
+# @copy $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak
#!endif
-# @ren config_h~ config.h
-#!if exist(config.h)
+#!if exist($(RUBY_CONFIG_H))
# @echo NMAKE will abort if config.h is changed, then restart NMAKE.
-# @fc.exe config.h config_h.bak > nul
-# @echo config.h unchanged.
-# @del config.h
-# @ren config_h.bak config.h
+# @fc.exe $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak > nul
+# @echo $(RUBY_CONFIG_H) unchanged.
+# @del $(RUBY_CONFIG_H)
+# @ren $(RUBY_CONFIG_H:.h=_h).bak $(RUBY_CONFIG_H)
#!endif
config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
@@ -456,7 +467,7 @@ s,@LINK_SO@,@$$(RM) $$(@:/=\).manifest,;t t
s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t
s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t
s,@COMPILE_RULES@,{$$(hdrdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(srcdir)}.%s{}.%s: .%s.%s:,;t t
-s,@RULE_SUBST@,{.;$$(srcdir);$$(topdir);$$(hdrdir)}%s,;t t
+s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t
s,@COMMON_LIBS@,m,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN,;t t
@@ -557,7 +568,7 @@ lex.c: {$(srcdir)}lex.c.blt
sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $@
@del y.tab.c
-$(OBJS): {$(srcdir)}win32/win32.h
+$(OBJS): {$(hdrdir)/ruby}win32.h
dir.$(OBJEXT) win32.$(OBJEXT): {$(srcdir)}win32/dir.h
diff --git a/win32/mkexports.rb b/win32/mkexports.rb
index 2fe867eb1b..7ef12cdffd 100755
--- a/win32/mkexports.rb
+++ b/win32/mkexports.rb
@@ -40,7 +40,7 @@ class Exports
syms[internal] = export
winapis[$1] = internal if /^_?(rb_w32_\w+)(?:@\d+)?$/ =~ internal
end
- win32h = File.join(File.dirname(__FILE__), "win32.h")
+ win32h = File.join(File.dirname(File.dirname(__FILE__)), "include/ruby/win32.h")
IO.foreach(win32h) do |line|
if /^#define (\w+)\((.*?)\)\s+(?:\(void\))?(rb_w32_\w+)\((.*?)\)\s*$/ =~ line and
$2.delete(" ") == $4.delete(" ")
@@ -80,7 +80,7 @@ end
class Exports::Mswin < Exports
def each_export(objs)
- noprefix = ($arch and /^sh/ !~ $arch)
+ noprefix = ($arch ||= nil and /^sh/ !~ $arch)
objs = objs.collect {|s| s.tr('/', '\\')}
filetype = nil
IO.popen(%w"dumpbin -symbols -exports" + objs) do |f|
diff --git a/win32/win32.c b/win32/win32.c
index fef6e49d37..9824f1019a 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -10,8 +10,8 @@
*
*/
-#include "ruby.h"
-#include "rubysig.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
#include "dln.h"
#include <fcntl.h>
#include <process.h>
@@ -30,7 +30,7 @@
#ifdef __MINGW32__
#include <mswsock.h>
#endif
-#include "win32.h"
+#include "ruby/win32.h"
#include "win32/dir.h"
#ifdef _WIN32_WCE
#include "wince.h"
diff --git a/yarvcore.c b/yarvcore.c
index 6c4f83294c..f9525e104b 100644
--- a/yarvcore.c
+++ b/yarvcore.c
@@ -10,8 +10,8 @@
**********************************************************************/
-#include "ruby.h"
-#include "node.h"
+#include "ruby/ruby.h"
+#include "ruby/node.h"
#include "yarvcore.h"
#include "gc.h"
diff --git a/yarvcore.h b/yarvcore.h
index bb4cfcf086..1c7007ad42 100644
--- a/yarvcore.h
+++ b/yarvcore.h
@@ -17,10 +17,10 @@
#include <setjmp.h>
-#include "ruby.h"
-#include "rubysig.h"
-#include "st.h"
-#include "node.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
+#include "ruby/st.h"
+#include "ruby/node.h"
#include "debug.h"
#include "vm_opts.h"