source: project/release/3/readline/readline.setup @ 10881

Last change on this file since 10881 was 10881, checked in by elf, 12 years ago

small fixes

File size: 1.9 KB
Line 
1;;;; readline.setup -*- Scheme -*-
2
3
4(with-output-to-file "rl-usable-test.scm"
5    (lambda ()
6        (display "#>\n\n")
7        (display "#include <stdio.h>\n")
8        (display "#include <readline/readline.h>\n")
9        (display "#include <readline/history.h>\n")
10        (display "int main() {\n")
11        (display "    char *c = readline(\"foo\");\n")
12        (display "    add_history(\"test\");\n")
13        (display "    rl_refresh_line(0, 0);\n")
14        (display "    return 0;\n")
15        (display "}\n\n")
16        (display "<#\n\n")))
17
18
19(define-macro (check-rllibs libs)
20    `(and (condition-case (compile -s -o rlu-test rl-usable-test.scm ,@libs)
21              (t ()    #f))
22          '(,@libs)))
23
24(define rl-extralib
25    (or (check-rllibs (-lreadline -lhistory -ltermcap))
26        (check-rllibs (-lreadline -lhistory -lcurses))
27        (check-rllibs (-lreadline -lhistory -lncurses))
28        (check-rllibs (-lreadline -ltermcap))
29        (check-rllibs (-lreadline -lcurses))
30        (check-rllibs (-lreadline -lncurses))
31        (check-rllibs (-lreadline -lhistory))
32        (chick-rllibs (-lreadline))
33        (error 
34            (string-append
35                "This extension requires GNU readline.  GNU readline "
36                "may be found at ftp://ftp.gnu.org/pub/gnu/readline\n"
37                "For more information, please consult "
38                "http://chicken.wiki.br/readline#Installation%20problems."
39            ))))
40
41(compile -s -O2 -d0 -emit-exports readline.exports readline.scm ,@rl-extralib)
42
43(compile -c -O2 -d0 -static-libs -static-extensions readline.scm
44         -o readline-static.o -unit readline ,@rl-extralib)
45
46
47(install-extension
48    'readline
49    '("readline.so" "readline.html" "readline-static.o")
50    `((version           1.97)
51      (static            "readline-static.o")
52      (static-options    ,(string-intersperse (map ->string rl-extralib) " "))
53      (exports           "readline.exports")
54      (documentation     "readline.html")))
55
Note: See TracBrowser for help on using the repository browser.