~ chicken-core (chicken-5) d611cdb4ff734bfaaadfadc57985eee6cf410dd1


commit d611cdb4ff734bfaaadfadc57985eee6cf410dd1
Author:     unknown <felix@.(none)>
AuthorDate: Wed Oct 21 16:06:31 2009 +0200
Commit:     unknown <felix@.(none)>
CommitDate: Wed Oct 21 16:06:31 2009 +0200

    standard-extension has optional static compile flag

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 7c6600d7..f8b4ea3d 100644
--- a/setup-api.scm
+++ b/setup-api.scm
@@ -496,12 +496,13 @@
 
 ;;; Convenience function
 
-(define (standard-extension name version)
+(define (standard-extension name version #!optional (static #f))
   (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
@@ -509,7 +510,7 @@
 	   iname
 	   (make-pathname #f sname "setup"))
      `((version ,version)
-       (static ,(make-pathname #f fname "o"))))))
+       ,@(if static `((static ,(make-pathname #f fname "o"))) '())))))
 
 
 ;;; Installation
Trap