Separate miniruby from dmyext.c
This commit is contained in:
parent
04729fe68d
commit
01c7e16c0c
@ -78,7 +78,7 @@ NORMALMAINOBJ = main.$(OBJEXT)
|
|||||||
MAINOBJ = $(NORMALMAINOBJ)
|
MAINOBJ = $(NORMALMAINOBJ)
|
||||||
DLDOBJS = $(INITOBJS)
|
DLDOBJS = $(INITOBJS)
|
||||||
EXTSOLIBS =
|
EXTSOLIBS =
|
||||||
MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT)
|
MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT)
|
||||||
ENC_MK = enc.mk
|
ENC_MK = enc.mk
|
||||||
MAKE_ENC = -f $(ENC_MK) V="$(V)" UNICODE_HDR_DIR="$(UNICODE_HDR_DIR)" \
|
MAKE_ENC = -f $(ENC_MK) V="$(V)" UNICODE_HDR_DIR="$(UNICODE_HDR_DIR)" \
|
||||||
RUBY="$(BOOTSTRAPRUBY)" MINIRUBY="$(BOOTSTRAPRUBY)" $(mflags)
|
RUBY="$(BOOTSTRAPRUBY)" MINIRUBY="$(BOOTSTRAPRUBY)" $(mflags)
|
||||||
@ -412,7 +412,7 @@ programs: $(PROGRAM) $(WPROGRAM) $(arch)-fake.rb
|
|||||||
|
|
||||||
$(PREP): $(MKFILES)
|
$(PREP): $(MKFILES)
|
||||||
|
|
||||||
miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE)
|
miniruby$(EXEEXT): config.status $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(ARCHFILE)
|
||||||
|
|
||||||
objs: $(ALLOBJS)
|
objs: $(ALLOBJS)
|
||||||
|
|
||||||
|
17
dmyenc.c
17
dmyenc.c
@ -1,7 +1,16 @@
|
|||||||
// This file is used only by ruby.
|
// This file is used by dynamically-linked ruby, which has no
|
||||||
// miniruby does not use this Init_enc. Instead, "miniinit.c" provides Init_enc, which defines only the builtin encodings.
|
// statically-linked encodings other than the builtin encodings.
|
||||||
// Dynamically-linked ruby uses this Init_enc, which requires "enc/encdb.so" to load the builtin encodings and set up the optional encodings.
|
//
|
||||||
// Statically-linked ruby does not use this Init_enc. Instead, "enc/encinit.c" (which is a generated file) defines Init_enc, which activates the encodings.
|
// - miniruby does not use this Init_enc. Instead, "miniinit.c"
|
||||||
|
// provides Init_enc, which defines only the builtin encodings.
|
||||||
|
//
|
||||||
|
// - Dynamically-linked ruby uses this Init_enc, which requires
|
||||||
|
// "enc/encdb.so" to load the builtin encodings and set up the
|
||||||
|
// optional encodings.
|
||||||
|
//
|
||||||
|
// - Statically-linked ruby does not use this Init_enc. Instead,
|
||||||
|
// "enc/encinit.c" (which is a generated file) defines Init_enc,
|
||||||
|
// which activates the encodings.
|
||||||
|
|
||||||
#define require(name) ruby_require_internal(name, (unsigned int)sizeof(name)-1)
|
#define require(name) ruby_require_internal(name, (unsigned int)sizeof(name)-1)
|
||||||
int ruby_require_internal(const char *, int);
|
int ruby_require_internal(const char *, int);
|
||||||
|
17
dmyext.c
17
dmyext.c
@ -1,7 +1,16 @@
|
|||||||
// This file is used by dynamically-linked ruby and miniruby.
|
// This file is used by dynamically-linked ruby, which has no
|
||||||
// miniruby uses this Init_ext, which does nothing. It does not support require'ing extension libraries.
|
// statically-linked extension libraries.
|
||||||
// Dynamically-linked ruby uses this Init_ext, which does nothing. It loads extension libraries by dlopen, etc.
|
//
|
||||||
// Statically-linked ruby does not use this Init_ext. Instead, "ext/extinit.c" (which is a generated file) defines Init_ext, which activates the (statically-linked) extension libraries.
|
// - miniruby does not use this Init_ext. Instead, "miniinit.c"
|
||||||
|
// provides Init_enc, which does nothing too. It does not support
|
||||||
|
// require'ing extension libraries.
|
||||||
|
//
|
||||||
|
// - Dynamically-linked ruby uses this Init_ext, which does
|
||||||
|
// nothing. It loads extension libraries by dlopen, etc.
|
||||||
|
//
|
||||||
|
// - Statically-linked ruby does not use this Init_ext. Instead,
|
||||||
|
// "ext/extinit.c" (which is a generated file) defines Init_ext,
|
||||||
|
// which activates the (statically-linked) extension libraries.
|
||||||
|
|
||||||
void
|
void
|
||||||
Init_ext(void)
|
Init_ext(void)
|
||||||
|
@ -48,6 +48,12 @@ Init_enc(void)
|
|||||||
rb_encdb_alias("ASCII", "US-ASCII");
|
rb_encdb_alias("ASCII", "US-ASCII");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* miniruby does not support dynamic loading. */
|
||||||
|
void
|
||||||
|
Init_ext(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
#include "mini_builtin.c"
|
#include "mini_builtin.c"
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user