Changeset 13700 in project


Ignore:
Timestamp:
03/12/09 10:29:56 (11 years ago)
Author:
Kon Lovett
Message:

Quasi-quote fixes.

Location:
release/4/setup-helper
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/setup-helper/tags/1.0.0/setup-helper.scm

    r13554 r13700  
    1111
    1212(define (verify-extension-name nam)
    13   (let ([extnam (->string nam)])
     13  (let ((extnam (->string nam)))
    1414    (unless (string=? extnam (extension-name))
    1515      (error "unexpected extension-name" extnam (extension-name)) ) ) )
     
    7474(define install-srfi-29-bundle)
    7575
    76 (let ([*srfi-29-bundles-directory* (make-repository-pathname "srfi-29-bundles")])
    77 
     76(let ((*srfi-29-bundles-directory* (make-repository-pathname "srfi-29-bundles")))
    7877  (define (srfi-29-bundle-directory spec)
    7978    (if (null? spec)
    8079        *srfi-29-bundles-directory*
    81         (let ([dir (append (list *srfi-29-bundles-directory*) (take spec (sub1 (length spec))))]
    82               [nam (last spec)])
     80        (let ((dir (append (list *srfi-29-bundles-directory*) (take spec (sub1 (length spec)))))
     81              (nam (last spec)))
    8382          (make-pathname dir nam) ) ) )
    84 
    8583  (set! install-srfi-29-bundle
    8684    (lambda (nam . spec)
    8785      (unless (directory? *srfi-29-bundles-directory*)
    8886        (error "missing SRFI-29 bundles directory; please install SRFI-29") )
    89       (let ([bundle-dir (srfi-29-bundle-directory spec)])
     87      (let ((bundle-dir (srfi-29-bundle-directory spec)))
    9088        (unless (directory? bundle-dir) (create-directory/parents bundle-dir)) )
    91       (let* ([namstr (->string nam)]
    92              [bundle-src (make-pathname (append '(".") spec) namstr)]
    93              [bundle-dst (make-pathname (append (list *srfi-29-bundles-directory*) spec) namstr)])
     89      (let* ((namstr (->string nam))
     90             (bundle-src (make-pathname (append '(".") spec) namstr))
     91             (bundle-dst (make-pathname (append (list *srfi-29-bundles-directory*) spec) namstr)))
    9492        (copy-file bundle-src bundle-dst) ) ) ) )
    9593
    9694;; Compile Support
    9795
    98 (define default-static-compile-options (make-parameter '(-optimize-level 2 -debug-level 1)))
    99 
    100 (define default-shared-compile-options (make-parameter '(-optimize-level 2 -debug-level 1)))
    101 
    102 (define default-import-compile-options (make-parameter '(-optimize-level 2 #;4 -debug-level 1)))
    103 
    104 (define (compile-static-extension nam #!key (options '()))
    105   (compile ,(source-filename nam)
     96(define default-static-compile-options (make-parameter '(-c -optimize-level 2 -debug-level 1)))
     97(define default-shared-compile-options (make-parameter '(-shared -optimize-level 2 -debug-level 1)))
     98(define default-import-compile-options (make-parameter '(-shared -optimize-level 3 -debug-level 0)))
     99
     100(define (compile-static nam #!key (options '()) inline?)
     101  (compile
     102    ,(source-filename nam)
    106103    ,@(default-static-compile-options)
    107      -unit ,nam -c -output-file ,(static-filename nam)
     104    -unit ,nam
     105    ,@(if (memq '-output-file options) '() `(-output-file ,(static-filename nam)))
     106    ,@(if inline? `(-emit-inline-file ,(inline-filename nam)) '())
    108107    ,@options) )
    109108
    110 (define (compile-shared-extension nam #!key (options '()))
    111   (compile ,(source-filename nam)
     109(define (compile-shared nam #!key (options '()) inline?)
     110  (compile
     111    ,(source-filename nam)
    112112    ,@(default-shared-compile-options)
    113     -shared -output-file ,(shared-filename nam)
     113    ,@(if (memq '-output-file options) '() `(-output-file ,(shared-filename nam)))
     114    ,@(if inline? `(-emit-inline-file ,(inline-filename nam)) '())
    114115    ,@options) )
    115116
    116 (define (compile-shared-extension-module nam #!key (options '()))
    117   (compile ,(source-filename nam)
     117(define (compile-shared-module nam #!key (options '()) inline?)
     118  (compile
     119    ,(source-filename nam)
    118120    ,@(default-shared-compile-options)
    119     -shared -output-file ,(shared-filename nam)
     121    ,@(if (memq '-output-file options) '() `(-output-file ,(shared-filename nam)))
    120122    -emit-import-library ,nam
     123    ,@(if inline? `(-emit-inline-file ,(inline-filename nam)) '())
    121124    ,@options)
    122   (compile ,(source-import-filename nam)
     125  (compile
     126    ,(source-import-filename nam)
    123127    ,@(default-import-compile-options)
    124     -shared -output-file ,(shared-import-filename nam)) )
     128    -output-file ,(shared-import-filename nam)) )
    125129
    126130;; Install Support
    127131
    128 #;(define default-install-options (make-parameter '()))
    129 
    130 (define (install-static-extension nam ver #!key (options '()))
    131   (install-extension nam
    132    `(,(static-filename nam))
    133    `((version ,ver)
     132(define default-static-install-options (make-parameter '()))
     133(define default-shared-install-options (make-parameter '()))
     134(define default-shared-module-install-options (make-parameter '()))
     135(define default-shared+static-module-install-options (make-parameter '()))
     136
     137(define (install-static-extension nam ver #!key (options '()) (files '()) output-file?)
     138  (install-extension nam
     139   `(,@(if output-file? '() `(,(static-filename nam))) ,@files)
     140   `(,@(default-static-install-options)
     141     (version ,ver)
    134142     (static ,(static-filename nam))
    135143     (documentation ,(document-filename nam))
    136144     ,@options)) )
    137145
    138 (define (install-shared-extension nam ver #!key (options '()))
    139   (install-extension nam
    140    `(,(shared-filename nam))
    141    `((version ,ver)
    142      (documentation ,(document-filename nam))
    143      ,@options)) )
    144 
    145 (define (install-shared-extension-module nam ver #!key (options '()))
    146   (install-extension nam
    147    `(,(shared-filename nam) ,(shared-import-filename nam))
    148    `((version ,ver)
    149      (documentation ,(document-filename nam))
    150      ,@options)) )
    151 
    152 (define (install-shared+static-extension-module nam ver #!key (options '()))
    153   (install-extension nam
    154    `(,(shared-filename nam) ,(shared-import-filename nam) ,(static-filename nam))
    155    `((version ,ver)
     146(define (install-shared-extension nam ver #!key (options '()) (files '()) output-file?)
     147  (install-extension nam
     148   `(,@(if output-file? '() `(,(shared-filename nam))) ,@files)
     149   `(,@(default-shared-install-options)
     150     (version ,ver)
     151     (documentation ,(document-filename nam))
     152     ,@options)) )
     153
     154(define (install-shared-extension-module nam ver #!key (options '()) (files '()) output-file?)
     155  (install-extension nam
     156   `(,@(if output-file? '() `(,(shared-filename nam)))
     157     ,(shared-import-filename nam)
     158     ,@files)
     159   `(,@(default-shared-module-install-options)
     160     (version ,ver)
     161     (documentation ,(document-filename nam))
     162     ,@options)) )
     163
     164(define (install-shared+static-extension-module nam ver
     165          #!key (options '()) (files '()) shared-output-file? static-output-file?)
     166  (install-extension nam
     167   `(,@(if shared-output-file? '() `(,(shared-filename nam)))
     168     ,(shared-import-filename nam)
     169     ,@(if static-output-file? '() `((static-filename nam)))
     170     ,@files)
     171   `(,@(default-shared+static-module-install-options)
     172     (version ,ver)
    156173     (static ,(static-filename nam))
    157174     (documentation ,(document-filename nam))
     
    160177;; Setup Support
    161178
    162 (define (setup-static-extension nam ver #!key (compile-options '()) (install-options '()))
    163   (compile-static-extension nam options: compile-options)
    164   (install-static-extension nam ver options: install-options) )
    165 
    166 (define (setup-shared-extension nam ver #!key (compile-options '()) (install-options '()))
    167   (compile-shared-extension nam options: compile-options)
    168   (install-shared-extension nam ver options: install-options) )
    169 
    170 (define (setup-shared-extension-module nam ver #!key (compile-options '()) (install-options '()))
    171   (compile-shared-extension-module nam options: compile-options)
    172   (install-shared-extension-module nam ver options: install-options) )
    173 
    174 (define (setup-shared+static-extension-module nam ver #!key (shared-compile-options '()) (static-compile-options '()) (install-options '()))
    175   (compile-static-extension nam options: static-compile-options)
    176   (compile-shared-extension-module nam options: shared-compile-options)
    177   (install-shared+static-extension-module nam ver options: install-options) )
     179(define (setup-static-extension nam ver
     180          #!key (compile-options '()) inline? (install-options '()) (files '()))
     181  (and-let* ((of (memq '-output-file compile-options)))
     182    (set! files (append files (list (cadr of)))) )
     183  (compile-static nam options: compile-options inline?: inline?)
     184  (install-static-extension nam ver options: install-options files: files) )
     185
     186(define (setup-shared-extension nam ver
     187          #!key (compile-options '()) inline? (install-options '()) (files '()))
     188  (and-let* ((of (memq '-output-file compile-options)))
     189    (set! files (append files (list (cadr of)))) )
     190  (compile-shared nam options: compile-options inline?: inline?)
     191  (install-shared-extension nam ver options: install-options files: files) )
     192
     193(define (setup-shared-extension-module nam ver
     194          #!key (compile-options '()) inline? (install-options '()) (files '()))
     195  (and-let* ((of (memq '-output-file compile-options)))
     196    (set! files (append files (list (cadr of)))) )
     197  (compile-shared-module nam options: compile-options inline?: inline?)
     198  (install-shared-extension-module nam ver options: install-options files: files) )
     199
     200(define (setup-shared+static-extension-module nam ver
     201          #!key (shared-compile-options '()) shared-inline?
     202                (static-compile-options '()) static-inline?
     203                (install-options '()) (files '()))
     204  (compile-static nam options: static-compile-options inline?: static-inline?)
     205  (compile-shared-module nam options: shared-compile-options inline?: shared-inline?)
     206  (install-shared+static-extension-module nam ver options: install-options files: files) )
  • release/4/setup-helper/trunk/setup-helper.scm

    r13644 r13700  
    103103    ,@(default-static-compile-options)
    104104    -unit ,nam
    105     ,@((if (memq '-output-file options) '() (list -output-file ,(static-filename nam))))
    106     ,@((if inline? (list '-emit-inline-file (inline-filename nam)) '()))
     105    ,@(if (memq '-output-file options) '() `(-output-file ,(static-filename nam)))
     106    ,@(if inline? `(-emit-inline-file ,(inline-filename nam)) '())
    107107    ,@options) )
    108108
     
    111111    ,(source-filename nam)
    112112    ,@(default-shared-compile-options)
    113     ,@((if (memq '-output-file options) '() (list -output-file ,(shared-filename nam))))
    114     ,@((if inline? (list '-emit-inline-file (inline-filename nam)) '()))
     113    ,@(if (memq '-output-file options) '() `(-output-file ,(shared-filename nam)))
     114    ,@(if inline? `(-emit-inline-file ,(inline-filename nam)) '())
    115115    ,@options) )
    116116
     
    119119    ,(source-filename nam)
    120120    ,@(default-shared-compile-options)
    121     ,@((if (memq '-output-file options) '() (list -output-file ,(shared-filename nam))))
     121    ,@(if (memq '-output-file options) '() `(-output-file ,(shared-filename nam)))
    122122    -emit-import-library ,nam
    123     ,@((if inline? (list '-emit-inline-file (inline-filename nam)) '()))
     123    ,@(if inline? `(-emit-inline-file ,(inline-filename nam)) '())
    124124    ,@options)
    125125  (compile
     
    137137(define (install-static-extension nam ver #!key (options '()) (files '()) output-file?)
    138138  (install-extension nam
    139    `(,@((if output-file? '() (static-filename nam))) ,@files)
     139   `(,@(if output-file? '() `(,(static-filename nam))) ,@files)
    140140   `(,@(default-static-install-options)
    141141     (version ,ver)
     
    146146(define (install-shared-extension nam ver #!key (options '()) (files '()) output-file?)
    147147  (install-extension nam
    148    `(,@((if output-file? '() (shared-filename nam))) ,@files)
     148   `(,@(if output-file? '() `(,(shared-filename nam))) ,@files)
    149149   `(,@(default-shared-install-options)
    150150     (version ,ver)
     
    154154(define (install-shared-extension-module nam ver #!key (options '()) (files '()) output-file?)
    155155  (install-extension nam
    156    `(,@((if output-file? '() (shared-filename nam)))
     156   `(,@(if output-file? '() `(,(shared-filename nam)))
    157157     ,(shared-import-filename nam)
    158158     ,@files)
     
    165165          #!key (options '()) (files '()) shared-output-file? static-output-file?)
    166166  (install-extension nam
    167    `(,@((if shared-output-file? '() (shared-filename nam)))
     167   `(,@(if shared-output-file? '() `(,(shared-filename nam)))
    168168     ,(shared-import-filename nam)
    169      ,@((if static-output-file? '() (static-filename nam)))
     169     ,@(if static-output-file? '() `((static-filename nam)))
    170170     ,@files)
    171171   `(,@(default-shared+static-module-install-options)
Note: See TracChangeset for help on using the changeset viewer.