source: project/release/4/pyffi/trunk/pyffi.setup @ 14475

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

pyffi ported to Chicken 4

File size: 1.6 KB
Line 
1;; -*- Hen -*-
2
3(define (python-try-compile header cppflags ldflags)
4  (and (try-compile
5        (string-append header "\n"
6                       "int main() { Py_Initialize(); return 0; }\n")
7        ldflags: ldflags
8        cflags: cppflags)
9       (cons cppflags ldflags) ))
10
11(define-syntax python-test
12  (syntax-rules ()
13    ((_ (flags ...))
14     (condition-case (python-try-compile flags ...)
15                     (t ()    #f)))))
16
17(define cpp+ld-options
18  (or (python-test ("#include <Python.h>" "-I/System/Library/Frameworks/Python.framework/Headers" "-framework Python"))
19      (python-test ("#include <Python.h>" "-I/usr/include/python2.5" "-lpython2.5"))
20      (python-test ("#include <Python.h>" "-I/usr/include/python2.4" "-lpython2.4"))
21      (python-test ("#include <Python.h>" "-I/usr/include/python2.3" "-lpython2.3"))
22      (python-test ("#include <Python.h>" "" "-lpython25"))
23      (python-test ("#include <Python.h>" "" "-lpython24"))
24      (python-test ("#include <Python.h>" "" "-lpython23"))
25      (python-test ("#include <Python.h>" "-I/usr/include/python" "-lpython"))
26      (error "unable to figure out location of Python")))
27
28(define c-options  (car cpp+ld-options))
29(define ld-options (cdr cpp+ld-options))
30
31(define (dynld-name fn)         
32  (make-pathname #f fn ##sys#load-dynamic-extension))   
33
34(compile -O2 -d0 -I. -s pyffi.scm  -j pyffi -X easyffi
35         -L "\"" ,ld-options "\"" -C "\"" ,c-options "\"" )
36(compile -O2 -d0 -s pyffi.import.scm)
37
38(run (csi -qbs pyffi-eggdoc.scm > pyffi.html))
39
40(install-extension
41 'pyffi
42 `(,(dynld-name "pyffi") ,(dynld-name "pyffi.import")  )
43 `((version 2.11)
44   (documentation "pyffi.html")))
Note: See TracBrowser for help on using the repository browser.