Skip to content

Commit

Permalink
Initial commit -- starting from RScheme 0.7.3.4b7
Browse files Browse the repository at this point in the history
  • Loading branch information
olpc authored and olpc committed Oct 4, 2009
0 parents commit 9328bb9
Show file tree
Hide file tree
Showing 1,630 changed files with 282,377 additions and 0 deletions.
25 changes: 25 additions & 0 deletions COPYING
@@ -0,0 +1,25 @@

RScheme 0.7 Snapshot 3.2

License For Free Use
January 3, 2002

RScheme is free software. It is not public domain -- I retain
copyright to all source code -- but it is free, and you have license
to use it as you desire. This includes utilizing it as a complete
system, adapting it to your purposes, building new applications using
and incorporating it, etc. This free license also includes the
ability to redistribute RScheme unmodified, or to redistribute derived
works. These things and more you can do free of charge.

Also, note that RScheme comes with ABSOLUTELY NO WARRANTY. Because it
is free, and made available for your use with no compensation due, I
cannot warrant it to be suitable to any purpose, to be free of
defects, or to comply with any standard, etc.

Given that, I hope you can enjoy and utilize it. Certainly I do both.


-- Donovan Kolbly RScheme Development Group
d.kolbly@rscheme.org
http://www.rscheme.org/~donovan/
138 changes: 138 additions & 0 deletions INSTALL
@@ -0,0 +1,138 @@
INSTALL

RScheme Install Notes

RScheme 0.7.3.2
===============

Building The Basic System
-------------------------
This distribution of RScheme includes both Scheme source and enough C
code to bootstrap into a fully functional RScheme system.

The instructions in this section should get you up and running RScheme.

The basic steps are

% cd .../rs-0.7.3.2
% make stage1
% cd src
% ./configure
% make all

(Note: The stage1 build starts by running configure. See "Stage1 Options"
below if configure needs help on your system.)

This will get the base system library (librs.a) compiled and
installed, by default in /usr/local/lib/rs/0.7.3.2 (if you do not have
permissions to install in /usr/local/lib, or you want to install it
elsewhere, give the --prefix=PREFIX option to configure, where PREFIX
is the absolute directory name of the place to install RScheme)

The executable "shell" program rs (ie, the normal interactive RScheme
program that comes up with a read-eval-print loop) is installed
in ${PREFIX}/bin/rs. You can either link this executable into
a directory in your path, or add ${PREFIX}/bin to your path.

Building the Off-line Module Compiler
-------------------------------------

If you are doing module development (which includes building the optional
packages as mentioned in the next section), you should also build the
off-line module compiler, `rsc':

src% make rsc

This creates and installs `rsc' into $(PREFIX)/bin/rsc

Building Optional Packages
--------------------------
[Note: Building packages as described here will implicity build
the offline compiler, rsc]

After having installed the base system and basic interactive shell,
you can build and install the optional packages that you wish to use.

The configuration script automatically chooses a default set of
optional packages to be built. Usually, this default set is as
many packages as it expects to work. In this case, you can
use:

% make packages

Alternatively, if you want to build fewer packages, or think one
might work that the configuration script did not include in the
default set, you may override the PACKAGES make variable to supply
the set of packages to build:

% make PACKAGES="fasl syscalls unixm rstore x11" packages

After having compiled all the packages of interest, you should
construct an executable which has all the corresponding code
linked in. If you build the fasl package, this is as simple as:

% make fasl_shell

which implicitly includes all the optional packages that have
been built and installed.

This creates and installs an executable called "fshell" which is a
fast-loading shell (REPL) with the given modules linked into the image
with their corresponding C code.

These are the packages you might find useful:

syscalls (basic system call interfaces)
unixm (unix-specific system call interfaces)
rstore (persistent store)
calendar (date operations)
sets (set operations like 'union' and 'intersection')
x11 (simple Xlib interface; uses libgd for drawing to
in-memory images)
db (Berkeley db interface)
fasl (fasl-loading images)
threads (advanced thread support)

The `fasl' and `rstore' packages have some fairly intense system
dependencies, so they may not work on your system.

Additional modules (that are part of the base system and are not
packages) that you might want to link into your shell are:

debugger (procedure-level tracepoints and breakpoints)

Recompiling from sources
------------------------

As distributed, RScheme has already been compiled from its scheme sources
into C code. However, many intermediate files are stripped out to reduce
the distribution size, so the system actually rebuilds itself at install
time (that is what the "make stage1" step does).

If you feel like tweaking the scheme or C sources (mostly in modules/ and
handc/, respectively), you can do so, and use "make stage1" to rebuild
src/ from those sources.

(Appendix) Stage1 Options
-------------------------

The stage1 build starts with a configuration step; if configure is
unable to determine the type of your system, or requires other flags,
you can set those options via the CONFIG_OPTS makefile flag.

For example, in order to build on Windows NT with the GNU Win32 tools,
use:

% make CONFIG_OPTS="--host=i386-gnuwin32" stage1

(which is not to imply that the WindowsNT build works, but it at
least gets most of the way :-))


For another example, Mac OS X wants:

% make CONFIG_OPTS="--host=ppc-rhapsody" stage1

-- Donovan Kolbly RScheme Development Group
d.kolbly@rscheme.org
http://www.rscheme.org/~donovan/
212 changes: 212 additions & 0 deletions Makefile
@@ -0,0 +1,212 @@
SHELL=/bin/sh

TARGET_DIR=src
SRC_DIR=.
MODULES_DIR=$(TARGET_DIR)/install/resource/modules

#
# can set `RSC_FLAGS=-ccode' to build nearly entire system to C
# instead of bytecodes
#
RSC_FLAGS=-pragma function-definitions-are-const \
-pragma slots-are-sealed

#
# `RSC_FLAGS2=-ccode' can be used to compile just certain modules to C
# (ie: corelib lowscm objsys iolib highscm compiler codegen)
# (by default -- most builds are development builds -- don't even set that)
#
#RSC_FLAGS2=-ccode
RSC_FLAGS2=

RSC=$(TARGET_DIR)/tmp/rsc
RSC_F=$(RSC) $(RSC_FLAGS)

RS=rs

MODULES=$(MODULES_DIR)/primops.mif \
$(MODULES_DIR)/precore.mif \
$(MODULES_DIR)/corelib.mif \
$(MODULES_DIR)/low_scheme.mif \
$(MODULES_DIR)/objsys.mif \
$(MODULES_DIR)/paths.mif \
$(MODULES_DIR)/mathlib.mif \
$(MODULES_DIR)/tables.mif \
$(MODULES_DIR)/earley.mif \
$(MODULES_DIR)/iolib.mif \
$(MODULES_DIR)/high_scheme.mif \
$(MODULES_DIR)/start.mif \
$(MODULES_DIR)/sort.mif \
$(MODULES_DIR)/imageio.mif \
$(MODULES_DIR)/editinp.mif \
$(MODULES_DIR)/mlink.mif \
$(MODULES_DIR)/compiler.mif \
$(MODULES_DIR)/codegen.mif \
$(MODULES_DIR)/repl.mif \
$(MODULES_DIR)/hacks.mif \
$(MODULES_DIR)/regex.mif \
$(MODULES_DIR)/debugger.mif \
$(MODULES_DIR)/threads.mif

base_system:: $(TARGET_DIR) rsc modules base_image configure_script

rsc:: $(TARGET_DIR)/tmp/rsc.img
modules:: $(MODULES)
base_image:: $(TARGET_DIR)/tmp/system.bas
configure_script:: $(TARGET_DIR)/configure

$(TARGET_DIR):
rm -rf $(TARGET_DIR) ; mkdir $(TARGET_DIR)
(cd ${SRC_DIR}/handc ; \
find . \! \( -name CVS -prune \) -print) > .handc.list
cat .handc.list | (cd ${SRC_DIR}/handc ; cpio -oc) \
| (cd ${TARGET_DIR} ; cpio -idc)
if test -d $(TARGET_DIR)/tmp ; then : ; \
else mkdir $(TARGET_DIR)/tmp ; fi

$(TARGET_DIR)/tmp/buildcfg.scm:
RS=$(RS) compiler/mkcfg $(TARGET_DIR) > $(TARGET_DIR)/tmp/buildcfg.scm

$(TARGET_DIR)/tmp/rsc.img: $(TARGET_DIR)/tmp/buildcfg.scm
RS=$(RS) compiler/mkrsc \
./compiler \
$(TARGET_DIR)/tmp \
$(TARGET_DIR)/tmp \
$(TARGET_DIR)/install \
$(TARGET_DIR)/tmp/buildcfg.scm

BCDEFS=$(TARGET_DIR)/install/resource/compiler/bytecode/bcgen.scm


$(MODULES_DIR)/primops.mif $(BCDEFS): $(TARGET_DIR)/tmp/rsc.img
$(RS) -q -image $(TARGET_DIR)/tmp/rsc.img \
-e '(process-defs-file "$(SRC_DIR)/bytcodes/bcdefs.dat")' \
-e "(create-primop-module 'primops)" -exit

#
# linking
#

$(TARGET_DIR)/tmp/system.bas: $(MODULES)
$(RSC) -o $(TARGET_DIR)/tmp/system.bas

#
# autoconf
#

$(TARGET_DIR)/configure: $(SRC_DIR)/handc/configure.in
cd $(TARGET_DIR) ; autoconf

#
# building in stages...
#
# `make ship' after a plain make will construct a tree appropriate
# for distribution packaging such that `make stage1' is required
# after unpacking on the target machine
#

ship::
mv src stage0
cd stage0 ; rm -f tmp/rsc tmp/rsc.img
cd stage0 ; rm -f install/resource/modules/*
rm -rf stage0/pkg

distclean::
rm -rf src .handc.list
-cd stage0 ; $(MAKE) clean
-cd packages/lss ; $(MAKE) clean
-cd packages/rstore ; $(MAKE) clean
-cd packages/general ; $(MAKE) clean
-cd packages/threads/shell ; $(MAKE) clean
xargs rm -rf < cleanfiles

#
# this uses the stage0 C code set up by `ship' to build a
# new src/ directory using an rsc running on top of the
# stage0 tree
#

CONFIG_OPTS=

stage1::
cd stage0 ; ./configure --prefix=`pwd`/install $(CONFIG_OPTS)
cd stage0 ; make
mkdir -p stage0/install/bin
cd stage0 ; make shell
cd stage0 ; ln -fs ../../rshell/rs install/bin/rs
cd stage0 ; ln -fs ../../system.img install/resource/system.img
$(MAKE) RS=`pwd`/stage0/install/bin/rs RSC_FLAGS2=-ccode \
src src/tmp/rsc.img $(MODULES) src/tmp/system.bas
# avoid the autoconf step ; don't want to depend on it
cp -p stage0/configure src/configure

#
# all the modules
#

precore $(MODULES_DIR)/precore.mif: $(BCDEFS)
$(RSC) -precore $(RSC_FLAGS) modules/corelib/precore.mcf

corelib $(MODULES_DIR)/corelib.mif: $(BCDEFS)
$(RSC) -corelib $(RSC_FLAGS) $(RSC_FLAGS2) modules/corelib/corelib.mcf

lowscm $(MODULES_DIR)/low_scheme.mif: $(BCDEFS)
$(RSC) -lowscm $(RSC_FLAGS) $(RSC_FLAGS2) modules/lowscm/lowscm.mcf

objsys $(MODULES_DIR)/objsys.mif: $(BCDEFS)
$(RSC_F) $(RSC_FLAGS2) modules/objsys/objsys.mcf

paths $(MODULES_DIR)/paths.mif: $(BCDEFS)
$(RSC_F) modules/paths/paths.mcf

tables $(MODULES_DIR)/tables.mif: $(BCDEFS)
$(RSC_F) modules/tables/tables.mcf

mathlib $(MODULES_DIR)/mathlib.mif: $(BCDEFS)
$(RSC_F) modules/mathlib/mathlib.mcf

iolib $(MODULES_DIR)/iolib.mif: $(BCDEFS)
$(RSC_F) $(RSC_FLAGS2) modules/iolib/iolib.mcf

highscm $(MODULES_DIR)/high_scheme.mif: $(BCDEFS)
$(RSC_F) $(RSC_FLAGS2) modules/highscm/highscm.mcf

start $(MODULES_DIR)/start.mif: $(BCDEFS)
$(RSC_F) modules/start/start.mcf

sort $(MODULES_DIR)/sort.mif: $(BCDEFS)
$(RSC_F) modules/sort/sort.mcf

imageio $(MODULES_DIR)/imageio.mif: $(BCDEFS)
$(RSC_F) modules/imageio/imageio.mcf

editinp $(MODULES_DIR)/editinp.mif: $(BCDEFS)
$(RSC_F) modules/editinp/editinp.mcf

compiler $(MODULES_DIR)/compiler.mif: $(BCDEFS)
$(RSC_F) $(RSC_FLAGS2) modules/compiler/compiler.mcf

codegen $(MODULES_DIR)/codegen.mif: $(BCDEFS)
$(RSC_F) $(RSC_FLAGS2) modules/codegen/codegen.mcf

mlink $(MODULES_DIR)/mlink.mif: $(BCDEFS)
$(RSC_F) modules/mlink/mlink.mcf

repl $(MODULES_DIR)/repl.mif: $(BCDEFS)
$(RSC_F) modules/repl/repl.mcf

debugger $(MODULES_DIR)/debugger.mif: $(BCDEFS)
$(RSC_F) modules/debugger/debugger.mcf

regex $(MODULES_DIR)/regex.mif: $(BCDEFS)
$(RSC_F) modules/regex/regex.mcf

earley $(MODULES_DIR)/earley.mif: $(BCDEFS)
$(RSC_F) modules/earley/earley.mcf

threads $(MODULES_DIR)/threads.mif: $(BCDEFS)
$(RSC_F) modules/threads/threads.mcf

hacks $(MODULES_DIR)/hacks.mif: $(BCDEFS)
$(RSC_F) modules/hacks/hacks.mcf

0 comments on commit 9328bb9

Please sign in to comment.