Got it to compile with Chicken 6
This commit is contained in:
parent
1adc99feaf
commit
db4376635f
|
@ -1,7 +1,3 @@
|
|||
*.swp
|
||||
*.c
|
||||
*.o
|
||||
*.so
|
||||
META-INF
|
||||
*.rkt
|
||||
test/main
|
||||
*.link
|
||||
compile-r7rs
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
FROM debian:stable
|
||||
RUN apt-get update && apt-get install -y build-essential make wget
|
||||
RUN wget https://ziglang.org/builds/zig-linux-x86_64-0.15.0-dev.300+9e21ba12d.tar.xz && tar -xf *.tar.xz
|
||||
RUN ls -1
|
|
@ -4,312 +4,16 @@ pipeline {
|
|||
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
|
||||
}
|
||||
stages {
|
||||
stage("Chibi") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/chibi'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
stage("Build") {
|
||||
agent dockerfile
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=chibi-scheme test'
|
||||
}
|
||||
sh 'make'
|
||||
}
|
||||
}
|
||||
stage("Chicken interpreter") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/chicken'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
stage("Build exe") {
|
||||
agent dockerfile
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=csi test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Chicken compiler") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/chicken'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=csc test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Cyclone interpreter") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/cyclone'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=cyclone test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Foment") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/foment'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=foment test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Gambit interpreter") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/gambit'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=gsi test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Gambit compiler") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/gambit'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=gsc test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Gauche") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/gauche'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=gosh test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Gerbil interpreter") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/gerbil'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=gxi test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Gerbil compiler") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/gerbil'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=gxc test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Guile") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/guile'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=guile test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Kawa") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/kawa'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=kawa test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Larceny") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/larceny'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=larceny test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Loko") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/loko'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=loko test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Mit-scheme") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/mit-scheme'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=mit-scheme test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Mosh") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/mosh'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=mosh test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Picrin") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/picrin'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=picrin test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Racket") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/racket'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=racket test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Racket.exe") {
|
||||
agent {
|
||||
docker {
|
||||
image 'schemers/racket'
|
||||
reuseNode true
|
||||
args '--user=root'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCC=racket test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Sagittarius") {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCHEME=sagittarius test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Skint") {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCHEME=skint test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Snow-chibi") {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCHEME=snow-chibi test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("STklos") {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCHEME=stklos test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("tr7") {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCHEME=tr7 test'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Ypsilon") {
|
||||
steps {
|
||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
||||
sh 'make SCHEME=ypsilon test'
|
||||
}
|
||||
sh 'make build-exe'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
36
Makefile
36
Makefile
|
@ -1,27 +1,25 @@
|
|||
.PHONY: test
|
||||
|
||||
PREFIX=/usr/local
|
||||
CC=gcc
|
||||
|
||||
build:
|
||||
@echo "No need to build, just run make install"
|
||||
${CC} -o compile-r7rs \
|
||||
-Os \
|
||||
-fomit-frame-pointer \
|
||||
-DHAVE_CHICKEN_CONFIG_H \
|
||||
src/compile-r7rs.c \
|
||||
chicken/src/*.c \
|
||||
-lm \
|
||||
-Ichicken/include
|
||||
|
||||
c-files: src
|
||||
csc -t compile-r7rs.scm -optimize-level 3 -output-file src/compile-r7rs.c
|
||||
|
||||
src:
|
||||
mkdir -p src
|
||||
|
||||
install:
|
||||
mkdir -p ${PREFIX}/bin
|
||||
install compile-r7rs ${PREFIX}/bin/compile-r7rs
|
||||
|
||||
shellcheck:
|
||||
shellcheck compile-r7rs
|
||||
|
||||
test:
|
||||
@cd test && ../compile-r7rs -I . -I ./libs -I ./libs2 main.scm
|
||||
|
||||
clean:
|
||||
find . -name "*.c*" -delete
|
||||
find . -name "*.o*" -delete
|
||||
find . -name "*.so*" -delete
|
||||
find . -name "*.rkt*" -delete
|
||||
find . -name "*.import.scm" -delete
|
||||
find . -name "*.link" -delete
|
||||
find . -name "*.class" -delete
|
||||
find . -name "META-INF" -exec rm -rf {} \;
|
||||
find . -not -name "kawa.jar" -name "*.jar" -delete
|
||||
rm -rf test/main
|
||||
rm -rf src
|
||||
|
|
|
@ -0,0 +1,179 @@
|
|||
/* GENERATED */
|
||||
#define HAVE_DIRENT_H 1
|
||||
#define HAVE_DLFCN_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_LONG_LONG 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SIGSETJMP 1
|
||||
#define HAVE_SIGPROCMASK 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOQ 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_UNSIGNED_LONG_LONG 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_ERRNO_H 1
|
||||
#define HAVE_SYSEXITS_H 1
|
||||
#define C_STACK_GROWS_DOWNWARD 1
|
||||
#define C_USE_STD_FEATURE_MACROS
|
||||
#define C_CHICKEN_PROGRAM "chicken"
|
||||
#ifndef C_INSTALL_CC
|
||||
# define C_INSTALL_CC "gcc"
|
||||
#endif
|
||||
#ifndef C_INSTALL_CXX
|
||||
# define C_INSTALL_CXX "g++"
|
||||
#endif
|
||||
#ifndef C_INSTALL_POSTINSTALL_PROGRAM
|
||||
# define C_INSTALL_POSTINSTALL_PROGRAM "true"
|
||||
#endif
|
||||
#ifndef C_INSTALL_RC_COMPILER
|
||||
# define C_INSTALL_RC_COMPILER ""
|
||||
#endif
|
||||
#ifndef C_INSTALL_CFLAGS
|
||||
# define C_INSTALL_CFLAGS "-fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer"
|
||||
#endif
|
||||
#ifndef C_INSTALL_LDFLAGS
|
||||
# define C_INSTALL_LDFLAGS " "
|
||||
#endif
|
||||
#ifndef C_INSTALL_PREFIX
|
||||
# define C_INSTALL_PREFIX "/usr/local"
|
||||
#endif
|
||||
#ifndef C_INSTALL_SHARE_HOME
|
||||
# define C_INSTALL_SHARE_HOME "/usr/local/share/chicken"
|
||||
#endif
|
||||
#ifndef C_INSTALL_BIN_HOME
|
||||
# define C_INSTALL_BIN_HOME "/usr/local/bin"
|
||||
#endif
|
||||
#ifndef C_INSTALL_EGG_HOME
|
||||
# define C_INSTALL_EGG_HOME "/usr/local/lib/chicken/12"
|
||||
#endif
|
||||
#ifndef C_INSTALL_LIB_HOME
|
||||
# define C_INSTALL_LIB_HOME "/usr/local/lib"
|
||||
#endif
|
||||
#ifndef C_INSTALL_LIB_NAME
|
||||
# define C_INSTALL_LIB_NAME "chicken"
|
||||
#endif
|
||||
#ifndef C_INSTALL_STATIC_LIB_HOME
|
||||
# define C_INSTALL_STATIC_LIB_HOME "/usr/local/lib"
|
||||
#endif
|
||||
#ifndef C_INSTALL_INCLUDE_HOME
|
||||
# define C_INSTALL_INCLUDE_HOME "/usr/local/include/chicken"
|
||||
#endif
|
||||
#ifndef C_INSTALL_MORE_LIBS
|
||||
# define C_INSTALL_MORE_LIBS "-lm -ldl"
|
||||
#endif
|
||||
#ifndef C_INSTALL_MORE_STATIC_LIBS
|
||||
# define C_INSTALL_MORE_STATIC_LIBS "-lm -ldl"
|
||||
#endif
|
||||
#ifndef C_STACK_GROWS_DOWNWARD
|
||||
# define C_STACK_GROWS_DOWNWARD 1
|
||||
#endif
|
||||
#ifndef C_TARGET_MORE_LIBS
|
||||
# define C_TARGET_MORE_LIBS "-lm -ldl"
|
||||
#endif
|
||||
#ifndef C_TARGET_MORE_STATIC_LIBS
|
||||
# define C_TARGET_MORE_STATIC_LIBS "-lm -ldl"
|
||||
#endif
|
||||
#ifndef C_TARGET_CC
|
||||
# define C_TARGET_CC "gcc"
|
||||
#endif
|
||||
#ifndef C_TARGET_CXX
|
||||
# define C_TARGET_CXX "g++"
|
||||
#endif
|
||||
#ifndef C_TARGET_RC_COMPILER
|
||||
# define C_TARGET_RC_COMPILER ""
|
||||
#endif
|
||||
#ifndef C_TARGET_LIBRARIAN
|
||||
# define C_TARGET_LIBRARIAN "ar"
|
||||
#endif
|
||||
#ifndef C_TARGET_INSTALL_PROGRAM
|
||||
# define C_TARGET_INSTALL_PROGRAM "install"
|
||||
#endif
|
||||
#ifndef C_TARGET_CFLAGS
|
||||
# define C_TARGET_CFLAGS "-fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer"
|
||||
#endif
|
||||
#ifndef C_TARGET_LIBRARIAN_FLAGS
|
||||
# define C_TARGET_LIBRARIAN_FLAGS "cru"
|
||||
#endif
|
||||
#ifndef C_TARGET_LDFLAGS
|
||||
# define C_TARGET_LDFLAGS " "
|
||||
#endif
|
||||
#ifndef C_TARGET_INSTALL_PROGRAM_EXECUTABLE_OPTIONS
|
||||
# define C_TARGET_INSTALL_PROGRAM_EXECUTABLE_OPTIONS "-m 755"
|
||||
#endif
|
||||
#ifndef C_TARGET_INSTALL_PROGRAM_FILE_OPTIONS
|
||||
# define C_TARGET_INSTALL_PROGRAM_FILE_OPTIONS "-m 644"
|
||||
#endif
|
||||
#ifndef C_TARGET_FEATURES
|
||||
# define C_TARGET_FEATURES ""
|
||||
#endif
|
||||
#ifndef C_CROSS_CHICKEN
|
||||
# define C_CROSS_CHICKEN 0
|
||||
#endif
|
||||
#ifndef C_TARGET_PREFIX
|
||||
# define C_TARGET_PREFIX "/usr/local"
|
||||
#endif
|
||||
#ifndef C_TARGET_BIN_HOME
|
||||
# define C_TARGET_BIN_HOME "/usr/local/bin"
|
||||
#endif
|
||||
#ifndef C_TARGET_LIB_HOME
|
||||
# define C_TARGET_LIB_HOME "/usr/local/lib"
|
||||
#endif
|
||||
#ifndef C_TARGET_LIB_NAME
|
||||
# define C_TARGET_LIB_NAME "chicken"
|
||||
#endif
|
||||
#ifndef C_TARGET_RUN_LIB_HOME
|
||||
# define C_TARGET_RUN_LIB_HOME "/usr/local/lib"
|
||||
#endif
|
||||
#ifndef C_TARGET_SHARE_HOME
|
||||
# define C_TARGET_SHARE_HOME "/usr/local/share/chicken"
|
||||
#endif
|
||||
#ifndef C_TARGET_INCLUDE_HOME
|
||||
# define C_TARGET_INCLUDE_HOME "/usr/local/include/chicken"
|
||||
#endif
|
||||
#ifndef C_TARGET_STATIC_LIB_HOME
|
||||
# define C_TARGET_STATIC_LIB_HOME "/usr/local/lib"
|
||||
#endif
|
||||
#ifndef C_CHICKEN_PROGRAM
|
||||
# define C_CHICKEN_PROGRAM "chicken"
|
||||
#endif
|
||||
#ifndef C_CSC_PROGRAM
|
||||
# define C_CSC_PROGRAM "csc"
|
||||
#endif
|
||||
#ifndef C_CSI_PROGRAM
|
||||
# define C_CSI_PROGRAM "csi"
|
||||
#endif
|
||||
#ifndef C_CHICKEN_DO_PROGRAM
|
||||
# define C_CHICKEN_DO_PROGRAM "chicken-do"
|
||||
#endif
|
||||
#ifndef C_CHICKEN_INSTALL_PROGRAM
|
||||
# define C_CHICKEN_INSTALL_PROGRAM "chicken-install"
|
||||
#endif
|
||||
#ifndef C_CHICKEN_UNINSTALL_PROGRAM
|
||||
# define C_CHICKEN_UNINSTALL_PROGRAM "chicken-uninstall"
|
||||
#endif
|
||||
#ifndef C_CHICKEN_STATUS_PROGRAM
|
||||
# define C_CHICKEN_STATUS_PROGRAM "chicken-status"
|
||||
#endif
|
||||
#ifndef C_WINDOWS_SHELL
|
||||
# define C_WINDOWS_SHELL 0
|
||||
#endif
|
||||
#ifndef C_BINARY_VERSION
|
||||
# define C_BINARY_VERSION 12
|
||||
#endif
|
||||
#ifndef C_USES_SONAME
|
||||
# define C_USES_SONAME 1
|
||||
#endif
|
||||
/* END OF FILE */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,81 @@
|
|||
/* Generated from build-version.scm by the CHICKEN compiler
|
||||
http://www.call-cc.org
|
||||
Version 6.0.0pre1 ((HEAD detached at 6.0.0pre1)) (rev 05be15d4)
|
||||
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
|
||||
command line: build-version.scm -optimize-level 2 -include-path . -include-path ./ -inline -ignore-repository -feature chicken-bootstrap -no-warnings -specialize -consult-types-file ./types.db -explicit-use -no-trace -output-file build-version.c
|
||||
unit: build-version
|
||||
*/
|
||||
#include "chicken.h"
|
||||
|
||||
static C_PTABLE_ENTRY *create_ptable(void);
|
||||
|
||||
static C_word lf[7];
|
||||
static double C_possibly_force_alignment;
|
||||
static C_char li0[] C_aligned={C_lihdr(0,0,10),40,116,111,112,108,101,118,101,108,41,0,0,0,0,0,0};
|
||||
|
||||
|
||||
C_noret_decl(C_build_2dversion_toplevel)
|
||||
C_extern void C_ccall C_build_2dversion_toplevel(C_word c,C_word *av) C_noret;
|
||||
|
||||
/* toplevel */
|
||||
static int toplevel_initialized=0;
|
||||
|
||||
void C_ccall C_build_2dversion_toplevel(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word t4;
|
||||
C_word t5;
|
||||
C_word t6;
|
||||
C_word *a;
|
||||
if(toplevel_initialized) {C_kontinue(t1,C_SCHEME_UNDEFINED);}
|
||||
else C_toplevel_entry(C_text("build-version"));
|
||||
C_check_nursery_minimum(C_calculate_demand(8,c,1));
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(8,c,1)))){
|
||||
C_save_and_reclaim((void*)C_build_2dversion_toplevel,c,av);}
|
||||
toplevel_initialized=1;
|
||||
if(C_unlikely(!C_demand_2(28))){
|
||||
C_save(t1);
|
||||
C_rereclaim2(28*sizeof(C_word),1);
|
||||
t1=C_restore;}
|
||||
a=C_alloc(8);
|
||||
C_initialize_lf(lf,7);
|
||||
lf[0]=C_h_intern(&lf[0],13, C_text("build-version"));
|
||||
lf[1]=C_h_intern(&lf[1],14, C_text("##sys#build-id"));
|
||||
lf[2]=C_decode_literal(C_heaptop,C_text("\376\002\000\000\011\060\065\142\145\061\065\144\064\000"));
|
||||
lf[3]=C_h_intern(&lf[3],18, C_text("##sys#build-branch"));
|
||||
lf[4]=C_decode_literal(C_heaptop,C_text("\376\002\000\000\035\050\110\105\101\104\040\144\145\164\141\143\150\145\144\040\141\164\040\066\056\060\056\060\160\162\145\061\051\000"));
|
||||
lf[5]=C_h_intern(&lf[5],19, C_text("##sys#build-version"));
|
||||
lf[6]=C_decode_literal(C_heaptop,C_text("\376\002\000\000\012\066\056\060\056\060\160\162\145\061\000"));
|
||||
C_register_lf2(lf,7,create_ptable());{}
|
||||
t2=C_a_i_provide(&a,1,lf[0]);
|
||||
t3=C_mutate((C_word*)lf[1]+1 /* (set! ##sys#build-id ...) */,lf[2]);
|
||||
t4=C_mutate((C_word*)lf[3]+1 /* (set! ##sys#build-branch ...) */,lf[4]);
|
||||
t5=C_mutate((C_word*)lf[5]+1 /* (set! ##sys#build-version ...) */,lf[6]);
|
||||
t6=t1;{
|
||||
C_word *av2=av;
|
||||
av2[0]=t6;
|
||||
av2[1]=C_SCHEME_UNDEFINED;
|
||||
((C_proc)(void*)(*((C_word*)t6+1)))(2,av2);}}
|
||||
|
||||
#ifdef C_ENABLE_PTABLES
|
||||
static C_PTABLE_ENTRY ptable[2] = {
|
||||
{C_text("toplevel:build_2dversion_2escm"),(void*)C_build_2dversion_toplevel},
|
||||
{NULL,NULL}};
|
||||
#endif
|
||||
|
||||
static C_PTABLE_ENTRY *create_ptable(void){
|
||||
#ifdef C_ENABLE_PTABLES
|
||||
return ptable;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
o|safe globals: (##sys#build-version ##sys#build-branch ##sys#build-id)
|
||||
o|removed binding forms: 3
|
||||
*/
|
||||
/* end of file */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
287
compile-r7rs
287
compile-r7rs
|
@ -1,287 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
if [ ! "$COMPILE_R7RS_DEBUG" = "" ]; then set -x; fi
|
||||
|
||||
if [ "$CC" = "" ]
|
||||
then
|
||||
CC=gcc
|
||||
fi
|
||||
|
||||
output="a.out"
|
||||
libdirs=""
|
||||
|
||||
while getopts "I:A:o:" flag
|
||||
do
|
||||
case "$flag" in
|
||||
o) output="$OPTARG";;
|
||||
A) libdirs="$libdirs $OPTARG";;
|
||||
I) libdirs="$OPTARG $libdirs";;
|
||||
*) echo "Invalid flag: $flag" && exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
for main; do true; done # Get the last argument
|
||||
if [ ! "" = "$main" ]; then output="${main%.*}"; fi
|
||||
|
||||
#tmpdir="$HOME/.cache/compile-r7rs/$(md5sum $main)/"
|
||||
tmpdir="$HOME/.cache/compile-r7rs/test"
|
||||
|
||||
if [ ! "$COMPILE_R7RS_DEBUG" = "" ]; then echo "SCMC: $SCMC"; fi
|
||||
|
||||
case "$SCMC" in
|
||||
chibi-scheme)
|
||||
paths="-I $tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -I $tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="chibi-scheme $paths"
|
||||
;;
|
||||
csi)
|
||||
paths="-I $tmpdir/*"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -I $tmpdir/${dir#./}/*"
|
||||
done
|
||||
scm_cmd="csi -b -R r7rs $paths -script"
|
||||
;;
|
||||
csc)
|
||||
if [ "$CSC_FLAGS" = "" ]
|
||||
then
|
||||
CSC_FLAGS=""
|
||||
fi
|
||||
set -eu
|
||||
paths="-I $tmpdir"
|
||||
objects=""
|
||||
units="r7rs,scheme.base,scheme.case-lambda,scheme.char,scheme.complex,scheme.cxr,scheme.eval,scheme.file,scheme.inexact,scheme.lazy,scheme.load,scheme.process-context,scheme.read,scheme.repl,scheme.time,scheme.write,scheme.r5rs"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -I $tmpdir/${dir#./}"
|
||||
findtmp="$(mktemp)"
|
||||
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||
while IFS= read -r lib
|
||||
do
|
||||
unit0=$(cd "$dir" && find . -name "$(basename "$lib")")
|
||||
unit1=$(echo "${unit0#\./}" | sed 's/\//\./g')
|
||||
unit=${unit1%.sld}
|
||||
echo "Compiling $lib as unit $unit"
|
||||
# CSC_FLAGS need to expand with spaces
|
||||
# shellcheck disable=SC2086
|
||||
csc -X r7rs -R r7rs -cc "$CC" $CSC_FLAGS -c -J -unit "$unit" -uses "$units" "${lib}" -o "$unit.o"
|
||||
units="$units,$unit"
|
||||
objects="$objects ${lib%.sld}.o"
|
||||
done < "$findtmp"
|
||||
done
|
||||
output="${main%.scm}"
|
||||
# CSC_FLAGS need to expand with spaces
|
||||
# shellcheck disable=SC2086
|
||||
csc -X r7rs -R r7rs -cc "$CC" $CSC_FLAGS -static -o "$output" -uses "$units" "$main"
|
||||
test -f "$output" && chmod +x "$output"
|
||||
exit 0
|
||||
;;
|
||||
icyc)
|
||||
paths="-I $tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -I $tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="icyc $paths -s"
|
||||
;;
|
||||
gsi)
|
||||
paths="${tmpdir%/}/" # / is needed
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths $tmpdir/${dir#./}/" # / is needed
|
||||
done
|
||||
scm_cmd="gsi -:s $paths"
|
||||
;;
|
||||
gosh)
|
||||
paths="-I $tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -I $tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="gosh -r7 $paths"
|
||||
;;
|
||||
gxi) # FIXME
|
||||
paths=""
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths :module $tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="gxi --lang r7rs"
|
||||
;;
|
||||
gxc) # FIXME
|
||||
echo "(prelude: :scheme/r7rs)" > gerbil.pkg
|
||||
paths=""
|
||||
libs=""
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths ${dir#./}"
|
||||
findtmp="$(mktemp)"
|
||||
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||
while IFS= read -r lib
|
||||
do
|
||||
libs="$libs $lib"
|
||||
done < "$findtmp"
|
||||
done
|
||||
gxc -o "$output" -static "$libs" "$main"
|
||||
rm -rf gerbil.pkg
|
||||
exit
|
||||
;;
|
||||
guile)
|
||||
paths="-L $tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -L $tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="guile --r7rs $paths"
|
||||
;;
|
||||
kawa)
|
||||
jar xf kawa.jar
|
||||
paths=""
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths $dir"
|
||||
findtmp="$(mktemp)"
|
||||
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||
while IFS= read -r lib
|
||||
do
|
||||
kawa -C "$lib"
|
||||
done < "$findtmp"
|
||||
done
|
||||
{
|
||||
echo "Main-Class: main"
|
||||
echo "Class-Path: . gnu kawa $paths"
|
||||
} > /tmp/compile-r7rs-MANIFEST.mf
|
||||
kawa --main -C "$main"
|
||||
classfiles=$(find .- name "*.class")
|
||||
jar cvfm "$output.jar" /tmp/compile-r7rs-MANIFEST.mf kawa gnu "$classfiles"
|
||||
rm -rf gnu kawa
|
||||
rm -rf META-INF
|
||||
exit
|
||||
;;
|
||||
mosh)
|
||||
paths="$tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths:$tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="mosh --loadpath=$paths"
|
||||
;;
|
||||
racket)
|
||||
paths=""
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$PWD/${dir#./}:$paths"
|
||||
findtmp="$(mktemp)"
|
||||
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||
while IFS= read -r lib
|
||||
do
|
||||
{
|
||||
echo "#lang r7rs"
|
||||
echo "(import (scheme base))"
|
||||
echo "(include \"$(basename "$lib")\")"
|
||||
} > "${lib%.sld}.rkt"
|
||||
done < "$findtmp"
|
||||
done
|
||||
|
||||
{
|
||||
echo "#lang r7rs"
|
||||
cat "$main"
|
||||
} > "${main%.scm}.rkt"
|
||||
PLTCOLLECTS="$paths" raco exe --orig-exe -o "$output" ++lang r7rs "${main%.scm}.rkt"
|
||||
exit
|
||||
;;
|
||||
racket.exe)
|
||||
paths="$(winepath --windows $PWD);$(winepath --windows $HOME/.wine/drive_c/Program\ Files/Racket/collects)"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths;$(winepath --windows "$PWD"/"${dir#./}")"
|
||||
findtmp="$(mktemp)"
|
||||
find "$dir" ! -name "$(printf "*\n*")" -name '*.sld' > "$findtmp"
|
||||
while IFS= read -r lib
|
||||
do
|
||||
{
|
||||
echo "#lang r7rs"
|
||||
echo "(import (scheme base))"
|
||||
echo "(include \"$(basename "$lib")\")"
|
||||
} > "${lib%.sld}.rkt"
|
||||
done < "$findtmp"
|
||||
done
|
||||
|
||||
{
|
||||
echo "#lang r7rs"
|
||||
cat "$main"
|
||||
} > "${main%.scm}.rkt"
|
||||
set -x
|
||||
WINEPATH="$HOME/.wine/drive_c/Program Files/Racket" \
|
||||
PLTCOLLECTS="$paths" \
|
||||
wine raco.exe exe --orig-exe --embed-dlls -o "$output.exe" ++lang r7rs "${main%.scm}.rkt"
|
||||
exit
|
||||
;;
|
||||
sash)
|
||||
paths="-L $tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -L $tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="sash -r7 $paths"
|
||||
;;
|
||||
stklos)
|
||||
paths="-I $tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths -I $tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="stklos $paths"
|
||||
;;
|
||||
skint)
|
||||
paths="-I ${tmpdir%/}/"
|
||||
for dir in $libdirs
|
||||
do
|
||||
dir1=${dir#./}
|
||||
paths="$paths -I $tmpdir/${dir1%/}/" # / is needed
|
||||
done
|
||||
scm_cmd="skint $paths"
|
||||
;;
|
||||
tr7i)
|
||||
paths="$tmpdir"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths:$tmpdir/${dir%./}/" # / is needed
|
||||
done
|
||||
scm_cmd="TR7_LIB_PATH=\"$paths:$TR7_LIB_PATH\" tr7i"
|
||||
;;
|
||||
ypsilon)
|
||||
paths="$tmpdir/"
|
||||
for dir in $libdirs
|
||||
do
|
||||
paths="$paths:$tmpdir/${dir#./}"
|
||||
done
|
||||
scm_cmd="ypsilon --r7rs $paths --top-level-program"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported SCMC (SCheMe Compiler) implementation or environment value not set."
|
||||
exit 1
|
||||
esac
|
||||
|
||||
command="$scm_cmd $tmpdir/$main"
|
||||
rm -rf "$output"
|
||||
{
|
||||
echo "#!/bin/sh"
|
||||
echo "mkdir -p $tmpdir"
|
||||
echo "CURDIR=\$PWD"
|
||||
echo "cd $tmpdir"
|
||||
echo "{"
|
||||
shar -M --quiet-unshar --no-check-existing --no-timestamp "$main" "$(find "$libdirs" -name "*.scm" -o -name "*.sld" -o -name "*.rkt")" | grep -v "exit 0"
|
||||
echo "} > /dev/null"
|
||||
echo "cd \$CURDIR"
|
||||
echo "$command \"\$@\""
|
||||
} > "$output"
|
||||
|
||||
chmod +x "$output"
|
||||
echo "Command: $command"
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
(import (scheme base)
|
||||
(scheme write)
|
||||
(scheme process-context))
|
||||
|
||||
(define scheme (get-environment-variable "SCHEME"))
|
||||
(when (not scheme)
|
||||
(error "Environment variable SCHEME not set."))
|
||||
|
||||
(define interpreters '(chibi))
|
||||
(define compilers '(chicken))
|
||||
(define implementations (append interpreters compilers))
|
||||
|
||||
(define is-interpreter? (if (member (string->symbol scheme) interpreters) #t #f))
|
||||
(define is-compiler? (if (member (string->symbol scheme) compilers) #t #f))
|
||||
|
||||
(when (not (member (string->symbol scheme) implementations))
|
||||
(error "Unsupported scheme implementation" scheme))
|
||||
|
|
@ -0,0 +1,418 @@
|
|||
/* Generated from compile-r7rs.scm by the CHICKEN compiler
|
||||
http://www.call-cc.org
|
||||
Version 6.0.0pre1 ((HEAD detached at 6.0.0pre1)) (rev 05be15d4)
|
||||
linux-unix-gnu-x86-64 [ 64bit dload ptables ]
|
||||
command line: compile-r7rs.scm -output-file src/compile-r7rs.c -optimize-level 3
|
||||
uses: eval r7lib library
|
||||
*/
|
||||
#include "chicken.h"
|
||||
|
||||
static C_PTABLE_ENTRY *create_ptable(void);
|
||||
C_noret_decl(C_eval_toplevel)
|
||||
C_extern void C_ccall C_eval_toplevel(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(C_r7lib_toplevel)
|
||||
C_extern void C_ccall C_r7lib_toplevel(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(C_library_toplevel)
|
||||
C_extern void C_ccall C_library_toplevel(C_word c,C_word *av) C_noret;
|
||||
|
||||
static C_word lf[16];
|
||||
static double C_possibly_force_alignment;
|
||||
static C_char li0[] C_aligned={C_lihdr(0,0,10),40,116,111,112,108,101,118,101,108,41,0,0,0,0,0,0};
|
||||
|
||||
|
||||
C_noret_decl(f209)
|
||||
static void C_ccall f209(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_145)
|
||||
static void C_ccall f_145(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_148)
|
||||
static void C_ccall f_148(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_151)
|
||||
static void C_ccall f_151(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_155)
|
||||
static void C_ccall f_155(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_161)
|
||||
static void C_ccall f_161(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_172)
|
||||
static void C_ccall f_172(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_178)
|
||||
static void C_ccall f_178(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_192)
|
||||
static void C_ccall f_192(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_199)
|
||||
static void C_ccall f_199(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(f_206)
|
||||
static void C_ccall f_206(C_word c,C_word *av) C_noret;
|
||||
C_noret_decl(C_toplevel)
|
||||
C_extern void C_ccall C_toplevel(C_word c,C_word *av) C_noret;
|
||||
|
||||
/* f209 in k190 in k197 in k204 in k159 in k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f209(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(0,c,1)))){
|
||||
C_save_and_reclaim((void *)f209,c,av);}
|
||||
t2=t1;{
|
||||
C_word *av2=av;
|
||||
av2[0]=t2;
|
||||
av2[1]=((C_word*)t0)[2];
|
||||
((C_proc)(void*)(*((C_word*)t2+1)))(2,av2);}}
|
||||
|
||||
/* k143 */
|
||||
static void C_ccall f_145(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,2)))){
|
||||
C_save_and_reclaim((void *)f_145,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_148,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);{
|
||||
C_word *av2=av;
|
||||
av2[0]=C_SCHEME_UNDEFINED;
|
||||
av2[1]=t2;
|
||||
C_eval_toplevel(2,av2);}}
|
||||
|
||||
/* k146 in k143 */
|
||||
static void C_ccall f_148(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,2)))){
|
||||
C_save_and_reclaim((void *)f_148,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_151,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);{
|
||||
C_word *av2=av;
|
||||
av2[0]=C_SCHEME_UNDEFINED;
|
||||
av2[1]=t2;
|
||||
C_r7lib_toplevel(2,av2);}}
|
||||
|
||||
/* k149 in k146 in k143 */
|
||||
static void C_ccall f_151(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,2)))){
|
||||
C_save_and_reclaim((void *)f_151,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_155,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);
|
||||
C_trace(C_text("compile-r7rs.scm:5: chicken.process-context#get-environment-variable"));
|
||||
t3=C_fast_retrieve(lf[14]);{
|
||||
C_word *av2;
|
||||
if(c >= 3) {
|
||||
av2=av;
|
||||
} else {
|
||||
av2=C_alloc(3);
|
||||
}
|
||||
av2[0]=t3;
|
||||
av2[1]=t2;
|
||||
av2[2]=lf[15];
|
||||
((C_proc)(void*)(*((C_word*)t3+1)))(3,av2);}}
|
||||
|
||||
/* k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f_155(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word t4;
|
||||
C_word t5;
|
||||
C_word t6;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,3)))){
|
||||
C_save_and_reclaim((void *)f_155,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=C_mutate((C_word*)lf[0]+1 /* (set! scheme ...) */,t1);
|
||||
t3=C_mutate((C_word*)lf[1]+1 /* (set! interpreters ...) */,lf[2]);
|
||||
t4=C_mutate((C_word*)lf[3]+1 /* (set! compilers ...) */,lf[4]);
|
||||
t5=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_161,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);
|
||||
C_trace(C_text("compile-r7rs.scm:9: scheme#append"));
|
||||
t6=*((C_word*)lf[13]+1);{
|
||||
C_word *av2;
|
||||
if(c >= 4) {
|
||||
av2=av;
|
||||
} else {
|
||||
av2=C_alloc(4);
|
||||
}
|
||||
av2[0]=t6;
|
||||
av2[1]=t5;
|
||||
av2[2]=C_fast_retrieve(lf[1]);
|
||||
av2[3]=C_fast_retrieve(lf[3]);
|
||||
((C_proc)(void*)(*((C_word*)t6+1)))(4,av2);}}
|
||||
|
||||
/* k159 in k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f_161(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word t4;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,2)))){
|
||||
C_save_and_reclaim((void *)f_161,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=C_mutate((C_word*)lf[5]+1 /* (set! implementations ...) */,t1);
|
||||
t3=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_206,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);
|
||||
C_trace(C_text("compile-r7rs.scm:11: scheme#string->symbol"));
|
||||
t4=*((C_word*)lf[12]+1);{
|
||||
C_word *av2;
|
||||
if(c >= 3) {
|
||||
av2=av;
|
||||
} else {
|
||||
av2=C_alloc(3);
|
||||
}
|
||||
av2[0]=t4;
|
||||
av2[1]=t3;
|
||||
av2[2]=C_fast_retrieve(lf[0]);
|
||||
((C_proc)(void*)(*((C_word*)t4+1)))(3,av2);}}
|
||||
|
||||
/* k170 in k197 in k204 in k159 in k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f_172(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,2)))){
|
||||
C_save_and_reclaim((void *)f_172,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_178,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);
|
||||
C_trace(C_text("chicken.base#implicit-exit-handler"));
|
||||
t3=C_fast_retrieve(lf[8]);{
|
||||
C_word *av2=av;
|
||||
av2[0]=t3;
|
||||
av2[1]=t2;
|
||||
((C_proc)(void*)(*((C_word*)t3+1)))(2,av2);}}
|
||||
|
||||
/* k176 in k170 in k197 in k204 in k159 in k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f_178(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(0,c,1)))){
|
||||
C_save_and_reclaim((void *)f_178,c,av);}
|
||||
t2=t1;{
|
||||
C_word *av2=av;
|
||||
av2[0]=t2;
|
||||
av2[1]=((C_word*)t0)[2];
|
||||
((C_proc)(void*)(*((C_word*)t2+1)))(2,av2);}}
|
||||
|
||||
/* k190 in k197 in k204 in k159 in k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f_192(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word t4;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,3)))){
|
||||
C_save_and_reclaim((void *)f_192,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=C_i_member(t1,C_fast_retrieve(lf[9]));
|
||||
if(C_truep(C_i_not(t2))){
|
||||
C_trace(C_text("compile-r7rs.scm:15: chicken.base#error"));
|
||||
t3=*((C_word*)lf[10]+1);{
|
||||
C_word *av2;
|
||||
if(c >= 4) {
|
||||
av2=av;
|
||||
} else {
|
||||
av2=C_alloc(4);
|
||||
}
|
||||
av2[0]=t3;
|
||||
av2[1]=((C_word*)t0)[2];
|
||||
av2[2]=lf[11];
|
||||
av2[3]=C_fast_retrieve(lf[0]);
|
||||
((C_proc)(void*)(*((C_word*)t3+1)))(4,av2);}}
|
||||
else{
|
||||
t3=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f209,a[2]=((C_word*)t0)[3],tmp=(C_word)a,a+=3,tmp);
|
||||
C_trace(C_text("chicken.base#implicit-exit-handler"));
|
||||
t4=C_fast_retrieve(lf[8]);{
|
||||
C_word *av2=av;
|
||||
av2[0]=t4;
|
||||
av2[1]=t3;
|
||||
((C_proc)(void*)(*((C_word*)t4+1)))(2,av2);}}}
|
||||
|
||||
/* k197 in k204 in k159 in k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f_199(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word t4;
|
||||
C_word t5;
|
||||
C_word t6;
|
||||
C_word t7;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(7,c,2)))){
|
||||
C_save_and_reclaim((void *)f_199,c,av);}
|
||||
a=C_alloc(7);
|
||||
t2=C_i_member(t1,C_fast_retrieve(lf[1]));
|
||||
t3=(C_truep(t2)?C_SCHEME_TRUE:C_SCHEME_FALSE);
|
||||
t4=C_set_block_item(lf[7] /* is-compiler? */,0,t3);
|
||||
t5=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_172,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);
|
||||
t6=(*a=C_CLOSURE_TYPE|3,a[1]=(C_word)f_192,a[2]=t5,a[3]=((C_word*)t0)[2],tmp=(C_word)a,a+=4,tmp);
|
||||
C_trace(C_text("compile-r7rs.scm:14: scheme#string->symbol"));
|
||||
t7=*((C_word*)lf[12]+1);{
|
||||
C_word *av2;
|
||||
if(c >= 3) {
|
||||
av2=av;
|
||||
} else {
|
||||
av2=C_alloc(3);
|
||||
}
|
||||
av2[0]=t7;
|
||||
av2[1]=t6;
|
||||
av2[2]=C_fast_retrieve(lf[0]);
|
||||
((C_proc)(void*)(*((C_word*)t7+1)))(3,av2);}}
|
||||
|
||||
/* k204 in k159 in k153 in k149 in k146 in k143 */
|
||||
static void C_ccall f_206(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word t4;
|
||||
C_word t5;
|
||||
C_word t6;
|
||||
C_word *a;
|
||||
C_check_for_interrupt;
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,2)))){
|
||||
C_save_and_reclaim((void *)f_206,c,av);}
|
||||
a=C_alloc(3);
|
||||
t2=C_i_member(t1,C_fast_retrieve(lf[1]));
|
||||
t3=(C_truep(t2)?C_SCHEME_TRUE:C_SCHEME_FALSE);
|
||||
t4=C_set_block_item(lf[6] /* is-interpreter? */,0,t3);
|
||||
t5=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_199,a[2]=((C_word*)t0)[2],tmp=(C_word)a,a+=3,tmp);
|
||||
C_trace(C_text("compile-r7rs.scm:12: scheme#string->symbol"));
|
||||
t6=*((C_word*)lf[12]+1);{
|
||||
C_word *av2;
|
||||
if(c >= 3) {
|
||||
av2=av;
|
||||
} else {
|
||||
av2=C_alloc(3);
|
||||
}
|
||||
av2[0]=t6;
|
||||
av2[1]=t5;
|
||||
av2[2]=C_fast_retrieve(lf[0]);
|
||||
((C_proc)(void*)(*((C_word*)t6+1)))(3,av2);}}
|
||||
|
||||
/* toplevel */
|
||||
static int toplevel_initialized=0;
|
||||
C_main_entry_point
|
||||
|
||||
void C_ccall C_toplevel(C_word c,C_word *av){
|
||||
C_word tmp;
|
||||
C_word t0=av[0];
|
||||
C_word t1=av[1];
|
||||
C_word t2;
|
||||
C_word t3;
|
||||
C_word *a;
|
||||
if(toplevel_initialized) {C_kontinue(t1,C_SCHEME_UNDEFINED);}
|
||||
else C_toplevel_entry(C_text("toplevel"));
|
||||
C_check_nursery_minimum(C_calculate_demand(3,c,2));
|
||||
if(C_unlikely(!C_demand(C_calculate_demand(3,c,2)))){
|
||||
C_save_and_reclaim((void*)C_toplevel,c,av);}
|
||||
toplevel_initialized=1;
|
||||
if(C_unlikely(!C_demand_2(104))){
|
||||
C_save(t1);
|
||||
C_rereclaim2(104*sizeof(C_word),1);
|
||||
t1=C_restore;}
|
||||
a=C_alloc(3);
|
||||
C_initialize_lf(lf,16);
|
||||
lf[0]=C_h_intern(&lf[0],6, C_text("scheme"));
|
||||
lf[1]=C_h_intern(&lf[1],12, C_text("interpreters"));
|
||||
lf[2]=C_decode_literal(C_heaptop,C_text("\376\003\000\000\002\376\001\000\000\005\001\143\150\151\142\151\376\377\016"));
|
||||
lf[3]=C_h_intern(&lf[3],9, C_text("compilers"));
|
||||
lf[4]=C_decode_literal(C_heaptop,C_text("\376\003\000\000\002\376\001\000\000\007\001\143\150\151\143\153\145\156\376\377\016"));
|
||||
lf[5]=C_h_intern(&lf[5],15, C_text("implementations"));
|
||||
lf[6]=C_h_intern(&lf[6],15, C_text("is-interpreter?"));
|
||||
lf[7]=C_h_intern(&lf[7],12, C_text("is-compiler?"));
|
||||
lf[8]=C_h_intern(&lf[8],34, C_text("chicken.base#implicit-exit-handler"));
|
||||
lf[9]=C_h_intern(&lf[9],14, C_text("implementation"));
|
||||
lf[10]=C_h_intern(&lf[10],18, C_text("chicken.base#error"));
|
||||
lf[11]=C_decode_literal(C_heaptop,C_text("\376\002\000\000\042\125\156\163\165\160\160\157\162\164\145\144\040\163\143\150\145\155\145\040\151\155\160\154\145\155\145\156\164\141\164\151\157\156\000"));
|
||||
lf[12]=C_h_intern(&lf[12],21, C_text("scheme#string->symbol"));
|
||||
lf[13]=C_h_intern(&lf[13],13, C_text("scheme#append"));
|
||||
lf[14]=C_h_intern(&lf[14],48, C_text("chicken.process-context#get-environment-variable"));
|
||||
lf[15]=C_decode_literal(C_heaptop,C_text("\376\002\000\000\007\123\103\110\105\115\105\000"));
|
||||
C_register_lf2(lf,16,create_ptable());{}
|
||||
t2=(*a=C_CLOSURE_TYPE|2,a[1]=(C_word)f_145,a[2]=t1,tmp=(C_word)a,a+=3,tmp);{
|
||||
C_word *av2=av;
|
||||
av2[0]=C_SCHEME_UNDEFINED;
|
||||
av2[1]=t2;
|
||||
C_library_toplevel(2,av2);}}
|
||||
|
||||
#ifdef C_ENABLE_PTABLES
|
||||
static C_PTABLE_ENTRY ptable[13] = {
|
||||
{C_text("f209:compile_2dr7rs_2escm"),(void*)f209},
|
||||
{C_text("f_145:compile_2dr7rs_2escm"),(void*)f_145},
|
||||
{C_text("f_148:compile_2dr7rs_2escm"),(void*)f_148},
|
||||
{C_text("f_151:compile_2dr7rs_2escm"),(void*)f_151},
|
||||
{C_text("f_155:compile_2dr7rs_2escm"),(void*)f_155},
|
||||
{C_text("f_161:compile_2dr7rs_2escm"),(void*)f_161},
|
||||
{C_text("f_172:compile_2dr7rs_2escm"),(void*)f_172},
|
||||
{C_text("f_178:compile_2dr7rs_2escm"),(void*)f_178},
|
||||
{C_text("f_192:compile_2dr7rs_2escm"),(void*)f_192},
|
||||
{C_text("f_199:compile_2dr7rs_2escm"),(void*)f_199},
|
||||
{C_text("f_206:compile_2dr7rs_2escm"),(void*)f_206},
|
||||
{C_text("toplevel:compile_2dr7rs_2escm"),(void*)C_toplevel},
|
||||
{NULL,NULL}};
|
||||
#endif
|
||||
|
||||
static C_PTABLE_ENTRY *create_ptable(void){
|
||||
#ifdef C_ENABLE_PTABLES
|
||||
return ptable;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
(o e)|safe calls: 12
|
||||
(o e)|assignments to immediate values: 2
|
||||
o|replaced variables: 6
|
||||
o|removed binding forms: 12
|
||||
o|removed binding forms: 6
|
||||
o|inlining procedure: k170
|
||||
o|removed binding forms: 1
|
||||
o|simplifications: ((if . 2) (##core#call . 4))
|
||||
o| call simplifications:
|
||||
o| scheme#member 3
|
||||
o| scheme#not
|
||||
o|contracted procedure: k200
|
||||
o|contracted procedure: k163
|
||||
o|contracted procedure: k193
|
||||
o|contracted procedure: k167
|
||||
o|contracted procedure: k186
|
||||
o|contracted procedure: k179
|
||||
o|simplifications: ((let . 1))
|
||||
o|removed binding forms: 6
|
||||
*/
|
||||
/* end of file */
|
BIN
test/kawa.jar
BIN
test/kawa.jar
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
(define hello "Hello")
|
|
@ -1,6 +0,0 @@
|
|||
(define-library
|
||||
(libs hello)
|
||||
(import (scheme base)
|
||||
(scheme write))
|
||||
(export hello)
|
||||
(include "hello.scm"))
|
|
@ -1 +0,0 @@
|
|||
(define world "world.")
|
|
@ -1,6 +0,0 @@
|
|||
(define-library
|
||||
(libs2 world)
|
||||
(import (scheme base)
|
||||
(scheme write))
|
||||
(export world)
|
||||
(include "world.scm"))
|
|
@ -1,13 +0,0 @@
|
|||
(import (scheme base)
|
||||
(scheme write)
|
||||
(scheme process-context)
|
||||
(libs hello)
|
||||
(libs2 world))
|
||||
|
||||
|
||||
(display hello)
|
||||
(display " ")
|
||||
(display world)
|
||||
(newline)
|
||||
|
||||
(exit 0)
|
Loading…
Reference in New Issue