Changeset 13545 in project


Ignore:
Timestamp:
03/07/09 02:14:57 (11 years ago)
Author:
Kon Lovett
Message:

Save.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/box/trunk/box.setup

    r13512 r13545  
    11;;;; box.setup
    22
    3 ;;;
     3;;; Release 4 Only!
    44
    55(required-chicken-version 4.0)
    66
    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
    819
    920(define (make-fn bn . en)
     
    3142  (shared-fn (import-fn bn)) )
    3243
    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
    3481
    3582(define (compile-static-extension nam . args)
     
    4693    ,@args)
    4794  (compile ,(source-import-fn nam)
    48     -optimize-level 2 -debug-level 0
     95    -optimize-level 2 #;4 -debug-level 0
    4996    -shared -output-file ,(shared-import-fn nam)) )
    5097
    51 ;;
     98;; Install Support
    5299
    53 (define (install-shared-extension nam #!key (compile '()) (install '()))
    54   (apply compile-shared-extension nam compile)
     100(define (install-shared-extension nam ver . args)
    55101  (install-extension nam
    56102   `(,(shared-fn nam) ,(shared-import-fn nam))
    57    `((version ,*version*)
     103   `((version ,ver)
    58104     (documentation ,(doc-fn nam))
    59      ,@install)) )
     105     ,@args)) )
    60106
    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)
    64108  (install-extension nam
    65    `(,(shared-fn nam) ,(static-fn nam) ,(shared-import-fn nam))
    66    `((version ,*version*)
     109   `(,(static-fn nam))
     110   `((version ,ver)
    67111     (static ,(static-fn nam))
    68112     (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) )
    70137
    71138;;;
    72139
    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.