Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2002:
[Freeciv-Dev] server support readline version 4.2 or greater
Home

[Freeciv-Dev] server support readline version 4.2 or greater

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] server support readline version 4.2 or greater
From: Davide Pagnin <nightmare@xxxxxxxxxx>
Date: Sun, 12 May 2002 20:19:01 +0200

        Hi All!

Another mail about complaint on the compilation part from the cvs.
Besides the difficulty to have system working properly, It is very
annoying this constant race towards unnecessary innovation.

Sometime, this race lead to problems (like autoconf 2.52), and the
solution happen to be to stick with the good old thing...

In the case of readline 4.2, it is known to work properly, and so
It is correct to have freeciv supporting it, but my complaint is
that old systems with readline 4.1 or less, have to make an 
unnecessary upgrade or to build without readline!
(Yes, I've read the suggestion in the INSTALL file, that explicitly
state to convert every instance of rl_completion_* to completion_,
to have it backward compatible.

But I'm guessing how is definitely possible that having such a 
powerful instrument like auto* stuff and configure, there is no
way to have both the old and new code supported!

My reasoning is like this:

check for readline.h presence
if yes
check for libreadline presence 
if yes
check for rl_completion_matches presence
if no
check for completion_matches presence

All you need at this point is to put some more define in the source
file, perhaps you can call it HAVE_OLDREADLINE, and have make those
little change that are necessary to be backward compatible to the
source code, the server/stdinhand.c file have to be slightly
modified and so the header file and your almost done!
perhaps:
#ifndef HAVE_OLDREADLINE
char **freeciv_completion(const char *text, int start, int end)
#elsif
char **freeciv_completion(char *text, int start, int end)
#endif
(And the like, for all the rl_completion_ calls)

You can even define a simple macro to have the substitution done
and save source cleaniness.
#ifndef HAVE_OLDREADLINE
#define RL_COMPLETION_MATCHES(x) rl_completion_matches
#elsif
#define RL_COMPLETION_MATCHES(x) completion_matches
#endif


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] server support readline version 4.2 or greater, Davide Pagnin <=