source: project/release/4/readline/readline.setup @ 14325

Last change on this file since 14325 was 14325, checked in by felix winkelmann, 11 years ago

ported to chicken 4, version is 1.98

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-syntax check-rllibs 
20  (syntax-rules ()
21    ((_ (libs ...))
22     (and (condition-case (compile -s -o rlu-test rl-usable-test.scm libs ...)
23            (t ()    #f))
24          '(libs ...)))))
25
26(define rl-extralib
27    (or (check-rllibs (-lreadline -lhistory -ltermcap))
28        (check-rllibs (-lreadline -lhistory -lcurses))
29        (check-rllibs (-lreadline -lhistory -lncurses))
30        (check-rllibs (-lreadline -ltermcap))
31        (check-rllibs (-lreadline -lcurses))
32        (check-rllibs (-lreadline -lncurses))
33        (check-rllibs (-lreadline -lhistory))
34        (chick-rllibs (-lreadline))
35        (error 
36            (string-append
37                "This extension requires GNU readline.  GNU readline "
38                "may be found at ftp://ftp.gnu.org/pub/gnu/readline\n"
39                "For more information, please consult "
40                "http://chicken.wiki.br/readline#Installation%20problems."
41            ))))
42
43(compile -s -O2 readline.scm ,@rl-extralib)
44
45(compile -c -O2 -d0 -j readline readline.scm
46         -o readline-static.o -unit readline ,@rl-extralib)
47
48(compile -s -O2 -d0 readline.import.scm)
49
50
51(install-extension
52    'readline
53    '("readline.so" "readline.import.so" "readline-static.o")
54    `((version           1.98)
55      (static            "readline-static.o")
56      (static-options    ,(string-intersperse (map ->string rl-extralib) " "))))
57
Note: See TracBrowser for help on using the repository browser.