1
0
Fork 0
This commit is contained in:
retropikzel 2025-12-23 17:30:45 +02:00
parent 23713dbdda
commit 8ebf31bdfb
5 changed files with 43 additions and 8 deletions

View File

@ -60,6 +60,12 @@ build-gauche:
echo "gosh -r7 -I ${PREFIX}/lib/compile-scheme -I ${PREFIX}/lib/compile-scheme/libs ${PREFIX}/lib/compile-scheme/compile-scheme.scm \"\$$@\"" >> compile-scheme
chmod +x compile-scheme
build-gauche.bat:
echo "@echo off" > compile-scheme.bat
echo "; & @echo off & gosh.exe -r7 \"%~f0\" %* & exit /b" > compile-scheme.bat
echo "gosh -r7 -I ${PREFIX}/lib/compile-scheme -I ${PREFIX}/lib/compile-scheme/libs ${PREFIX}/lib/compile-scheme/compile-scheme.scm \"\$$@\"" >> compile-scheme
chmod +x compile-scheme
build-guile:
echo "#!/bin/sh" > compile-scheme
echo "guile --r7rs --auto-compile -I -q -L ${PREFIX}/lib/compile-scheme ${PREFIX}/lib/compile-scheme/compile-scheme.scm \"\$$@\"" >> compile-scheme
@ -94,7 +100,7 @@ install:
install compile-scheme ${PREFIX}/bin/compile-scheme
mkdir -p ${PREFIX}/share/man/man1
cp doc/compile-scheme.1 ${PREFIX}/share/man/man1/
if [ -d /etc/bash_completion.d ]; then cp bash_completion.sh /etc/bash_completion.d/compile-scheme; fi
-if [ -d /etc/bash_completion.d ]; then cp bash_completion.sh /etc/bash_completion.d/compile-scheme; fi
uninstall:
rm -rf ${PREFIX}/lib/compile-scheme

3
compile-scheme.bat Normal file
View File

@ -0,0 +1,3 @@
@echo off
echo "Hello from compile-scheme"

View File

@ -122,19 +122,31 @@
(define compilation-target
(cond
((member "-t" (command-line))
(cadr (member "-t" (command-line))))
((member "--target" (command-line))
(string->symbol (cadr (member "--target" (command-line)))))
(else
(cond-expand (windows 'windows)
(else 'unix)))))
(when debug?
(display "compilation-target: ")
(write compilation-target)
(newline))
(define output-file
(let ((outfile
(cond
((member "-o" (command-line))
(cadr (member "-o" (command-line))))
(input-file (string-cut-from-end input-file 4)))))
outfile))
(if (symbol=? compilation-target 'windows)
(string-append outfile ".bat")
outfile)))
(when debug?
(display "output-file: ")
(write output-file)
(newline))
(define prepend-directories
(letrec ((looper (lambda (rest result)
@ -182,13 +194,13 @@
(apply (cdr (assoc 'command (cdr (assoc scheme data))))
(list
(cond
((symbol=? compilation-target 'windows) "")
((symbol=? compilation-target 'windows) "; & @echo off &")
(else "exec"))
(cond
((symbol=? compilation-target 'windows) "%0%")
((symbol=? compilation-target 'windows) "\"%~f0\"")
(else "\"$0\""))
(cond
((symbol=? compilation-target 'windows) "")
((symbol=? compilation-target 'windows) "%* & exit /b")
(else "\"$@\""))
(if input-file input-file "")
(if output-file output-file "")
@ -246,11 +258,15 @@
(cond
((symbol=? compilation-target 'windows)
(for-each
display
`(,scheme-command ,scheme-program))
#;(for-each
display
`(";dir; start /WAIT " ,scheme-command " && exit"
#\newline
,scheme-program
)))
))
)
(else
(for-each
display

0
configure vendored Executable file → Normal file
View File

10
install.bat Normal file
View File

@ -0,0 +1,10 @@
@echo off
if not exist "%ProgramFiles%\compile-scheme" mkdir "%ProgramFiles%\compile-scheme"
if not exist "%ProgramFiles%\compile-scheme" mkdir "%ProgramFiles%\compile-scheme\libs"
xcopy compile-scheme.bat "%ProgramFiles%\compile-scheme\" /y
xcopy compile-scheme.scm "%ProgramFiles%\compile-scheme\" /y
xcopy libs\implementations.sld "%ProgramFiles%\compile-scheme\libs\" /y
xcopy libs\library-util.sld "%ProgramFiles%\compile-scheme\libs\" /y
xcopy libs\util.sld "%ProgramFiles%\compile-scheme\libs\" /y
setx path "%PATH%;%ProgramFiles%\compile-scheme"