Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1f7769

Browse files
authored
bpo-13501: allow choosing between readline and libedit (GH-24189)
In contrast to macOS, libedit is available as its own include file and library on Linux systems to prevent file name clashes. So if both libraries are available on the system, readline is currently chosen by default; and if only libedit is available, it is not found at all. This patch adds a way to link against libedit by adding the following arguments to configure: --with-readline link against libreadline (the default) --with-readline=editline link against libeditline --with-readline=no disable building the readline module --without-readline (same) The runtime detection of libedit vs. readline was already done in commit 7105319 (2019-12-04, serge-sans-paille: "bpo-38634: Allow non-apple build to cope with libedit (GH-16986)"). Fixes: GH-12076 ("bpo-13501 Build or disable readline with Editline") Fixes: bpo-13501 ("Make libedit support more generic; port readline / libedit to FreeBSD") Co-authored-by: Enji Cooper (ngie-eign) Co-authored-by: Martin Panter (vadmium) Co-authored-by: Robert Marshall (kellinm)
1 parent bf2e7e5 commit e1f7769

File tree

6 files changed

+275
-207
lines changed

6 files changed

+275
-207
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The configure script can now use *libedit* instead of *readline* with the
2+
command line option ``--with-readline=editline``.

Modules/readline.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@
2626
# define RESTORE_LOCALE(sl)
2727
#endif
2828

29+
#ifdef WITH_EDITLINE
30+
# include <editline/readline.h>
31+
#else
2932
/* GNU readline definitions */
30-
#undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */
31-
#include <readline/readline.h>
32-
#include <readline/history.h>
33+
# undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */
34+
# include <readline/readline.h>
35+
# include <readline/history.h>
36+
#endif
3337

3438
#ifdef HAVE_RL_COMPLETION_MATCHES
3539
#define completion_matches(x, y) \

0 commit comments

Comments
 (0)