Changeset 13545 in project
- Timestamp:
- 03/07/09 02:14:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release/4/box/trunk/box.setup
r13512 r13545 1 1 ;;;; box.setup 2 2 3 ;;; 3 ;;; Release 4 Only! 4 4 5 5 (required-chicken-version 4.0) 6 6 7 ;; 7 ;;; Extension Information 8 9 (define *extension-name* 'box) 10 (define *extension-version* (extension-version "2.0.0")) 11 12 (let ([extnam (symbol->string *extension-name*)]) 13 (unless (string=? extnam (extension-name)) 14 (warning "expecting extension-name - got: " extnam (extension-name)) ) ) 15 16 ;;; Support 17 18 ;; Filename Support 8 19 9 20 (define (make-fn bn . en) … … 31 42 (shared-fn (import-fn bn)) ) 32 43 33 ;; 44 (define (inline-fn bn) 45 (make-fn bn "inline") ) 46 47 (define (program-fn bn) 48 (make-fn bn (and (eq? 'windows (software-type)) "exe")) ) 49 50 ;; File Support 51 52 (define (copy-file-to-directory fn dn) 53 (copy-file fn (make-pathname dn fn)) ) 54 55 (define (copy-to-repository fn) 56 (copy-file-to-directory fn (repository-path)) ) 57 58 (define (copy-to-home fn) 59 (copy-file-to-directory fn (chicken-home)) ) 60 61 ;; SRFI-29 Bundle Support 62 63 (define *srfi-29-bundles-path* (make-pathname (repository-path) "srfi-29-bundles")) 64 65 (define (srfi-29-bundle-directory spec) 66 (let ([dir (append (list *srfi-29-bundles-path*) (take spec (sub1 (length spec))))] 67 [nam (last spec)]) 68 (make-pathname dir nam) ) ) 69 70 (define (install-srfi-29-bundle nam . spec) 71 (unless (directory? *srfi-29-bundles-path*) 72 (error "missing SRFI-29 bundles directory; please install SRFI-29") ) 73 (let ([bundle-dir (srfi-29-bundle-directory spec)]) 74 (unless (directory? bundle-dir) (create-directory/parents bundle-dir)) ) 75 (let* ([namstr (->string nam)] 76 [bundle-src (make-pathname (append '(".") spec) namstr)] 77 [bundle-dst (make-pathname (append (list *srfi-29-bundles-path*) spec) namstr)]) 78 (copy-file bundle-src bundle-dst) ) ) 79 80 ;; Compile Support 34 81 35 82 (define (compile-static-extension nam . args) … … 46 93 ,@args) 47 94 (compile ,(source-import-fn nam) 48 -optimize-level 2 -debug-level 095 -optimize-level 2 #;4 -debug-level 0 49 96 -shared -output-file ,(shared-import-fn nam)) ) 50 97 51 ;; 98 ;; Install Support 52 99 53 (define (install-shared-extension nam #!key (compile '()) (install '())) 54 (apply compile-shared-extension nam compile) 100 (define (install-shared-extension nam ver . args) 55 101 (install-extension nam 56 102 `(,(shared-fn nam) ,(shared-import-fn nam)) 57 `((version , *version*)103 `((version ,ver) 58 104 (documentation ,(doc-fn nam)) 59 ,@ install)) )105 ,@args)) ) 60 106 61 (define (install-shared-static-extension nam #!key (compile '()) (install '())) 62 (apply compile-shared-extension nam compile) 63 (apply compile-static-extension nam compile) 107 (define (install-static-extension nam ver . args) 64 108 (install-extension nam 65 `(,(s hared-fn nam) ,(static-fn nam) ,(shared-import-fn nam))66 `((version , *version*)109 `(,(static-fn nam)) 110 `((version ,ver) 67 111 (static ,(static-fn nam)) 68 112 (documentation ,(doc-fn nam)) 69 ,@install)) ) 113 ,@args)) ) 114 115 (define (install-shared+static-extension ver nam . args) 116 (install-extension nam 117 `(,(shared-fn nam) ,(shared-import-fn nam) ,(static-fn nam)) 118 `((version ,ver) 119 (static ,(static-fn nam)) 120 (documentation ,(doc-fn nam)) 121 ,@args)) ) 122 123 ;; Build Support 124 125 (define (build-shared-extension nam ver #!key (compile '()) (install '())) 126 (apply compile-shared-extension nam compile) 127 (apply install-shared-extension nam ver install) ) 128 129 (define (build-static-extension nam ver #!key (compile '()) (install '())) 130 (apply compile-static-extension nam compile) 131 (apply install-static-extension nam ver install) ) 132 133 (define (build-shared+static-extension nam ver #!key (shared-compile '()) (static-compile '()) (install '())) 134 (apply compile-shared-extension nam shared-compile) 135 (apply compile-static-extension nam static-compile) 136 (apply install-shared+static-extension nam ver install) ) 70 137 71 138 ;;; 72 139 73 (define *version* "2.0.0") 74 75 (install-shared-extension 'box) 140 (build-shared-extension *extension-name* *extension-version*)
Note: See TracChangeset
for help on using the changeset viewer.