1
0
Fork 0

Compare commits

..

No commits in common. "6e15d3768ff5ce6b884c6b5ab158bceded9df7fc" and "72393a51aec87d4d759eb8087bf18b2a5e5effd3" have entirely different histories.

4 changed files with 47 additions and 60 deletions

2
.gitignore vendored
View File

@ -15,5 +15,3 @@ README.html
*.import.*
deps
tmp
deb
*.deb

View File

@ -1,6 +1,5 @@
PREFIX=/usr/local
SCHEME=chibi
VERSION=1.0.0
R6RSTMP=tmp/${SCHEME}-r6rs
R7RSTMP=tmp/${SCHEME}-r7rs
DOCKERIMG=${SCHEME}:head
@ -35,14 +34,6 @@ build-chicken:
-uses srfi-170 \
compile-r7rs.scm
deb: build-chicken
mkdir -p deb/bin
cp compile-r7rs deb/bin/
mkdir -p deb/DEBIAN
printf "Package: compile-r7rs\nArchitecture: amd64\nVersion: ${VERSION}\nSection: misc\nMaintainer: Retropikzel <retropikzel@iki.fi>\nDescription: SRFI 138: Compiling Scheme programs to executables - Implementation" \
> deb/DEBIAN/control
dpkg-deb -b deb
# FIXME
#build-gauche:
#echo "#!/bin/sh" > compile-r7rs
@ -51,7 +42,7 @@ deb: build-chicken
build-guile:
echo "#!/bin/sh" > compile-r7rs
echo "guile --r7rs --auto-compile -I -q -L ${PREFIX}/lib/compile-r7rs ${PREFIX}/lib/compile-r7rs/compile-r7rs.scm \"\$$@\"" >> compile-r7rs
echo "guile --r7rs --auto-compile -I -q -L ${PREFIX}/lib/compile-r7rs ${PREFIX}/lib/compile-r7rs/compile-r7rs.scm \"\$$@\" 2> /dev/null" >> compile-r7rs
chmod +x compile-r7rs
# FIXME

View File

@ -176,41 +176,44 @@
result))))))
(looper (command-line) (list))))
;(display "Scheme ")
;(display scheme)
;(newline)
;(display "Type ")
;(display scheme-type)
;(newline)
;(newline)
(display "Scheme ")
(display scheme)
(newline)
(display "Type ")
(display scheme-type)
(newline)
(newline)
; Compile libraries
(when (not (null? library-files))
#;(if single-library-input-file
(if single-library-input-file
(display "Given library file: ")
(display "Found library files: "))
;(display library-files)
;(newline)
(when (assoc 'library-command (cdr (assoc scheme data)))
(display library-files)
(newline)
(cond ((assoc 'library-command (cdr (assoc scheme data)))
(for-each
(lambda (file)
(let* ((library-command (scheme-library-command file)))
;(display "Compiling library ")
;(display file)
;(newline)
(display "Compiling library ")
(display file)
(newline)
(for-each
(lambda (command)
;(display "Running ")
;(write command)
;(newline)
;(display "Exit code ")
(display "Running ")
(write command)
(newline)
(display "Exit code ")
(let ((exit-code (c-system (string->c-utf8 command))))
;(display exit-code)
;(newline)
(display exit-code)
(newline)
(when (not (= exit-code 0))
(exit exit-code))))
library-command)))
library-files)))
library-files))
(else
(display "Implementation has no library build command, skipping library compilation.")
(newline))))
; Create executable file
(when (and (equal? scheme-type 'interpreter) input-file)
@ -221,11 +224,9 @@
(string-append
"#!/bin/sh"
(string #\newline)
"#|"
(string #\newline)
"tmpfile=$(mktemp)"
(string #\newline)
"tail -n+9 \"$0\" > ${tmpfile}"
"tail -n+7 \"$0\" > ${tmpfile}"
(string #\newline)))
((string=? compilation-target "windows")
(string-append
@ -240,18 +241,16 @@
"rm -rf ${tmpfile}"
(string #\newline)
"exit"
(string #\newline)
"|#"
(string #\newline)))
((string=? compilation-target "windows")
""))))
(scheme-program (slurp input-file)))
;(display "Creating startup script ")
;(display output-file)
;(newline)
;(display "Starting with ")
;(display shebang-line)
;(newline)
(display "Creating startup script ")
(display output-file)
(newline)
(display "Starting with ")
(display shebang-line)
(newline)
(with-output-to-file
(if (string=? compilation-target "windows")
(string-append output-file ".bat")
@ -267,21 +266,20 @@
(when (and (equal? scheme-type 'compiler) input-file)
(when (and output-file (file-exists? output-file))
(delete-file output-file))
;(display "Compiling file ")
;(display input-file)
;(newline)
(display "Compiling file ")
(display input-file)
(newline)
(for-each
(lambda (command)
;(display "Running ")
;(write command)
;(newline)
;(display "Exit code ")
(display "Running ")
(write command)
(newline)
(display "Exit code ")
(let ((exit-code (c-system (string->c-utf8 command))))
;(display exit-code)
;(newline)
(display exit-code)
(newline)
(when (not (= exit-code 0))
(exit exit-code))))
scheme-command)
;(newline)
)
(newline))

View File

@ -100,14 +100,14 @@
(define library-dependencies
(lambda (implementation directories path previous-indent indent)
;(for-each (lambda (item) (display " ")) indent)
;(display path)
(for-each (lambda (item) (display " ")) indent)
(display path)
(let ((full-path (search-library-file directories path)))
(if (not (file-exists? full-path))
(begin
;(display #\space)
;(display "not found, ignoring")
;(newline)
(display #\space)
(display "not found, ignoring")
(newline)
(list))
(begin
(newline)