Subject: [clisp-list] Clisp (cvs) cygwin and readline

From: [email-masked] (Karl Pflästerer)
Date: Sat Aug 2 11:04:03 2003

Hi,
the current cvs version compiles fine under cygwin but I'm unable to use
readline.

I do
(a) ./configure /tmp/clisp
(b) cd /tmp/clisp; ./makemake --with-dynamic-ffi --with-readline > Makefile 
(c) make

All seems to be fine but I can't use readline.

In unixconf.h I can read:
,----
| /* CL_READLINE */
| /* Define if you have a recent readline (4+). */
| #define HAVE_READLINE 1
| /* Define as const if the declaration of filename_completion_function()
|    needs const in the first argument */
| #define READLINE_CONST const
| /* The readline built-in filename completion function, either
|    rl_filename_completion_function() or filename_completion_function() */
| #define READLINE_FILE_COMPLETE rl_filename_completion_function
`----

Also linking happens with -lreadline; from the Makefile
,----
| LIBS = -lintl libcharset.a libavcall.a libcallback.a -lreadline -lncurses   -liconv 
`----

I see one problem in config.log
,----
| configure:23270: checking readline/readline.h usability
| configure:23283: gcc -c -g -O2  conftest.c >&5
| configure:23286: $? = 0
| configure:23289: test -s conftest.o
| configure:23292: $? = 0
| configure:23302: result: yes
| configure:23306: checking readline/readline.h presence
| configure:23317: gcc -E  conftest.c
| configure:23323: $? = 0
| configure:23342: result: yes
| configure:23378: checking for readline/readline.h
| configure:23385: result: yes
| configure:23399: checking for library containing readline
| configure:23430: gcc -o conftest.exe -g -O2   conftest.c -lncurses  >&5
| /c/WINDOWS/TEMP/ccKd7JgM.o(.text+0x16): In function `main':
| /tmp/clisp/configure:23599: undefined reference to `_readline'
| collect2: ld returned 1 exit status
`----

When I try to use eg. the tabkey only a tab char gets inserted and with
the arrow keys I only can read the following:

[1]> 
*** - READ from #<INPUT CONCATENATED-STREAM #<INPUT STRING-INPUT-STREAM> #<IO TERMINAL-STREAM>>: illegal character #\Escape
1. Break [2]> 

With eg. guile (which comes precompiled with cygwin) the readline lib
can be used without problems.

   Karl
-- 
'Twas brillig, and the slithy toves
    Did gyre and gimble in the wabe;
  All mimsy were the borogoves,
   And the mome raths outgrabe.   "Lewis Carroll" "Jabberwocky"

---

From: Sam Steingold <[email-masked]>
Date: Sun Aug 3 06:33:05 2003

> * In message <[email-masked]>
> * On the subject of "Clisp (cvs) cygwin and readline"
> * Sent on Sat, 02 Aug 2003 19:59:30 +0200
> * Honorable [email-masked] (Karl Pflästerer) writes:
>
> the current cvs version compiles fine under cygwin but I'm unable to
> use readline.
works for me.

> | #define HAVE_READLINE 1

so you do have a working readline.

> | collect2: ld returned 1 exit status

look below - you will see success with -lreadline.

> *** - READ from #<INPUT CONCATENATED-STREAM #<INPUT STRING-INPUT-STREAM> #<IO TERMINAL-STREAM>>: illegal character #\Escape

this usually means that CLISP thinks that it is not on a console.
see make_terminal_stream_() in src/tream.d.
(./configure --with-debug --build build-g)
you will probably discover that same_tty is false.
why?
are you running on a cygwin xterm/rxvt?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
The only thing worse than X Windows: (X Windows) - X

---

From: [email-masked] (Karl Pflästerer)
Date: Mon Aug 4 15:28:02 2003

> so you do have a working readline.

Right. As I wrote other programs (like guile, python or the bash use it
also).

> look below - you will see success with -lreadline.

Right.

> see make_terminal_stream_() in src/tream.d.

I must study that.

> you will probably discover that same_tty is false.

I will compile it again like that tommorrow.

> are you running on a cygwin xterm/rxvt?

Yes (in rxvt).  But I tried it also in a plain windows command.com.  The
same result.

I will search further at least it works for most other people.

   Karl
-- 
 He took his vorpal sword in hand:
     Long time the manxome foe he sought--
 So rested he by the Tumtum tree,
     And stood awhile in thought.  "Lewis Carroll" "Jabberwocky"

---

From: Sam Steingold <[email-masked]>
Date: Thu Aug 14 15:28:05 2003

> * In message <[email-masked]>
> * On the subject of "Re: Re: Clisp (cvs) cygwin and readline"
> * Sent on Tue, 05 Aug 2003 00:26:18 +0200
> Yes (in rxvt).  But I tried it also in a plain windows command.com.
> The same result.

this is weird. what version of windows?

please run under gdb and report what these return:

isatty(0)
isatty(1)
isatty(2)
ttyname(0)
ttyname(1)
ttyname(2)

thanks.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
All extremists should be taken out and shot.