~ chicken-core (chicken-5) 979068fff282f7f161a6b0252a71e6df7271141d
commit 979068fff282f7f161a6b0252a71e6df7271141d
Author: Felix <bunny351@gmail.com>
AuthorDate: Sun Nov 8 00:34:19 2009 +0100
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Fri Nov 20 15:27:45 2009 +0100
fixes for setup-api procedure 'standard-extension'
Signed-off-by: felix <felix@call-with-current-continuation.org>
diff --git a/manual/Extensions b/manual/Extensions
index 4984cfc1..55c3d6f8 100644
--- a/manual/Extensions
+++ b/manual/Extensions
@@ -153,20 +153,20 @@ files in {{FILELIST}} to executable (for installing shell-scripts).
==== standard-extension
- [procedure] (standard-extension ID VERSION)
+ [procedure] (standard-extension ID VERSION [STATIC])
A convenience procedure that combines the compilation and installation of
a simple single-file extension. This is roughly equivalent to:
(compile -s -O2 -d1 ID.scm -j ID)
- (compile -c -O2 -d1 ID.scm -j ID -unit ID)
+ (compile -c -O2 -d1 ID.scm -j ID -unit ID) ; if STATIC is not given or true
(compile -s -O2 -d0 ID.import.scm)
(install-extension
'ID
'("ID.o" "ID.so" "ID.import.so")
'((version 1.0)
- (static "ID.o")))
+ (static "ID.o"))) ; STATIC ...
==== run
diff --git a/setup-api.scm b/setup-api.scm
index 6562dfb2..66526e6e 100644
--- a/setup-api.scm
+++ b/setup-api.scm
@@ -496,18 +496,21 @@
;;; Convenience function
-(define (standard-extension name version)
+(define (standard-extension name version #!optional (static #t))
(let* ((sname (->string name))
(fname (make-pathname #f sname "scm"))
(iname (make-pathname #f sname "import.scm")))
(compile -s -O2 -d1 ,fname -j ,name)
- (compile -c -O2 -d1 ,fname -j ,name -unit ,name)
+ (when static
+ (compile -c -O2 -d1 ,fname -j ,name -unit ,name))
(compile -s -O2 -d0 ,iname)
(install-extension
name
- (list fname (make-pathname #f sname "setup"))
+ (list fname
+ (pathname-replace-extension iname "so")
+ (make-pathname #f sname "setup"))
`((version ,version)
- (static ,(make-pathname #f fname "o"))))))
+ ,@(if static `((static ,(make-pathname #f fname "o"))) '())))))
;;; Installation
Trap