This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: readline woes


I'm not sure if these are related, but you may want to check the
following threads.  More comments below.

libreadline.dll.a missing functions
http://www.cygwin.com/ml/cygwin-apps/2001-01/msg00007.html

bash calls private readline functions
http://www.cygwin.com/ml/cygwin-apps/2001-01/msg00018.html

> On a freshly updated box the fileman example of the readline package
> works differently if linked statically or dynamically to
> libreadline. fileman defines its own completer function, so readline
> will try to complete a command name for the first item on the command
> line, and it will try to complete filenames for all subsequent items.
> 
> If I link statically, this works as expected. If I link dynamically,
> the filename completion still works, but it does no longer try to
> complete a command for the first item.

Odd.  I do not see this difference; both statically linked and
dynamically linked fileman.exe (fileman-stat.exe) work identically.

> I do not see this problem on a box which is still using cygwin1.dll
> version 1.1.7 (and no other packages updated since then). 

Really odd.  Given the same readline distro (readline-4.1-2), changing
cygwin shouldn't affect this function, I don't think.

> The only
> apparent difference is that fileman does not compile out of the box
> with the updated tools. The variables rl_readline_name and
> rl_attempted_completion_function need to be defined as global
> variables in fileman.c to get it link properly. Is this the wrong fix?

That is the wrong fix.  readline.h (included by fileman.c) already
defines:

extern READLINE_EXPORT_VAR(CPPFunction *)
rl_attempted_completion_function;
extern READLINE_EXPORT_VAR(char *) rl_readline_name;

Are you sure that you're using the correct -Ddefine's to link
dynamically/statically? check /usr/doc/Cygwin/readline-4.1.README.

Also, using a freshly updated box (with the since-deprecated
gcc-2.95.2-7), and using the readline-4.1-2-src.tar.gz package, fileman
builds cleanly ("CC='gcc -mwin32' ./configure --prefix=/usr
--with-ncurses")  Using gcc-2.95.2-6 (current official version) you
don't need to specify CC.

> It's not that I badly need fileman, but I use similar code in my own
> programs, and fileman is a fairly simple testcase for this problem.

--Chuck

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]