source: project/release/4/synch/tags/2.0.0/synch.setup @ 13493

Last change on this file since 13493 was 13471, checked in by Kon Lovett, 12 years ago

Save

File size: 1.8 KB
Line 
1;;;; synch.setup
2
3;;
4
5(required-chicken-version 4.0)
6
7;;
8
9(define *version* (if (file-exists? "version") (string-chomp (read-all "version") "\n") "trunk"))
10
11;;
12
13(define (make-fn bn . en)
14  (apply make-pathname #f (->string bn) en) )
15
16(define (doc-fn bn)
17  (make-fn bn "html") )
18
19(define (source-fn bn)
20  (make-fn bn "scm") )
21
22(define (shared-fn bn)
23  (make-fn bn ##sys#load-dynamic-extension) )
24
25(define (static-fn bn)
26  (make-fn bn "o") )
27
28(define (import-fn bn)
29  (make-fn bn "import") )
30
31(define (source-import-fn bn)
32  (source-fn (import-fn bn)) )
33
34(define (shared-import-fn bn)
35  (shared-fn (import-fn bn)) )
36
37;;
38
39(define (compile-static-extension nam . args)
40  (compile ,(source-fn nam)
41    -optimize-level 2 -debug-level 1
42    -c -unit ,nam -output-file ,(static-fn nam)
43    ,@args) )
44
45(define (compile-shared-extension nam . args)
46  (compile ,(source-fn nam)
47    -optimize-level 2 -debug-level 1
48    -shared -output-file ,(shared-fn nam)
49    -emit-import-library ,nam
50    ,@args)
51  (compile ,(source-import-fn nam)
52    -optimize-level 2 -debug-level 0
53    -shared -output-file ,(shared-import-fn nam)) )
54
55;;
56
57(define (install-shared-extension nam #!key (compile '()) (install '()))
58  (apply compile-shared-extension nam compile)
59  (install-extension nam
60   `(,(shared-fn nam) ,(shared-import-fn nam))
61   `((version ,*version*)
62     (documentation ,(doc-fn nam))
63     ,@install)) )
64
65(define (install-shared-static-extension nam  #!key (compile '()) (install '()))
66  (apply compile-shared-extension nam compile)
67  (apply compile-static-extension nam compile)
68  (install-extension nam
69   `(,(shared-fn nam) ,(static-fn nam) ,(shared-import-fn nam))
70   `((version ,*version*)
71     (static ,(static-fn nam))
72     (documentation ,(doc-fn nam))
73     ,@install)) )
74
75;;;
76
77(install-shared-extension 'synch)
Note: See TracBrowser for help on using the repository browser.