source: project/release/4/glpk/trunk/glpk.setup @ 14401

Last change on this file since 14401 was 14401, checked in by Ivan Raikov, 11 years ago

glpk ported to Chicken 4

File size: 1.2 KB
Line 
1;; -*- Hen -*-
2
3(define (dynld-name fn)         
4  (make-pathname #f fn ##sys#load-dynamic-extension))   
5
6(define (glpk-try-compile header ldflags cppflags)
7  (and (try-compile
8        (string-append header "\n"
9                       "int main(int argc, char **argv) { glp_create_prob(); return 0; }\n")
10        ldflags: ldflags
11        cflags: cppflags)
12       (cons ldflags cppflags)))
13
14(define-syntax glpk-test
15  (syntax-rules ()
16    ((_ (flags ...))
17     (condition-case (glpk-try-compile flags ...)
18                     (t ()    #f)))))
19
20(define ld+cpp-options
21  (or (glpk-test ("#include <glpk.h>" "-lglpk" "-I."))
22      (glpk-test ("#include <glpk.h>" "-lglpk" "-I. -I/usr/include/glpk"))
23      (glpk-test ("#include <glpk.h>" "-lglpk" "-I. -I/opt/local/include"))
24      (error "unable to figure out location of GLPK library")))
25
26(compile -O2 -d0 -I. -s glpk.scm  -j glpk
27         -L "\"" ,(car ld+cpp-options) "\""
28         -C "\"" ,(cdr ld+cpp-options) "\"")
29(compile -O2 -d0 -s glpk.import.scm)
30
31(run (csi -s glpk-eggdoc.scm > glpk.html))
32
33(install-extension
34
35  ; Name of your extension:
36  'glpk
37
38  ; Files to install for your extension:
39  `(,(dynld-name "glpk") ,(dynld-name "glpk.import")  )
40
41  ; Assoc list with properties for your extension:
42  `((version 1.2)
43    (documentation "glpk.html")))
Note: See TracBrowser for help on using the repository browser.