source: project/release/3/glpk/trunk/glpk.setup @ 10875

Last change on this file since 10875 was 10875, checked in by Ivan Raikov, 12 years ago

Added an entry for release 1.1

File size: 1.3 KB
Line 
1
2(define has-exports? (string>=? (chicken-version) "2.310"))
3
4(define (dynld-name fn)         
5  (make-pathname #f fn ##sys#load-dynamic-extension))   
6
7(define (glpk-try-compile header ldflags cppflags)
8  (and (try-compile
9        (string-append header "\n"
10                        "int main(int argc, char **argv) { glp_create_prob(); return 0; }\n")
11        ldflags: ldflags
12        cflags: cppflags
13        )
14       (cons ldflags cppflags)))
15
16(define-macro (glpk-test . rest)
17  `(or (any identity (map (lambda (p) (glpk-try-compile (first p) (second p) (third p))) ',rest))
18       (error "unable to figure out location of GLPK library")))
19
20(define ld+cpp-options
21  (glpk-test ("#include <glpk.h>" "-lglpk" "-I.")
22             ("#include <glpk.h>" "-lglpk" "-I. -I/usr/include/glpk")
23             ("#include <glpk.h>" "-lglpk" "-I. -I/opt/local/include")))
24
25(compile -O -d2 -s -o ,(dynld-name "glpk")
26         ,@(if has-exports? '(-check-imports -emit-exports glpk.exports) '())
27         glpk.scm  -lchicken -ldl  -L "\"" ,(car ld+cpp-options) "\""
28         -C "\"" ,(cdr ld+cpp-options) "\"")
29
30(run (csi -qbs glpk-eggdoc.scm > glpk.html))
31
32(install-extension
33
34  ; Name of your extension:
35  'glpk
36
37  ; Files to install for your extension:
38  `(,(dynld-name "glpk")  )
39
40  ; Assoc list with properties for your extension:
41  `((version 1.1)
42    (documentation "glpk.html")
43    ,@(if has-exports? `((exports "glpk.exports")) (list)) ))
Note: See TracBrowser for help on using the repository browser.