~ chicken-core (chicken-5) c5fdd4fe0583d50ad48ae7c7b9bbe494815379c4
commit c5fdd4fe0583d50ad48ae7c7b9bbe494815379c4 Author: Felix <bunny351@gmail.com> AuthorDate: Sun Nov 8 00:34:19 2009 +0100 Commit: Felix <bunny351@gmail.com> CommitDate: Sun Nov 8 00:34:19 2009 +0100 fixes for setup-api procedure 'standard-extension' 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 dd0268aa..b8fc4379 100644 --- a/setup-api.scm +++ b/setup-api.scm @@ -499,18 +499,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"))) '()))))) ;;; InstallationTrap