diff options
author | Roland Hieber <rohieb@users.noreply.github.com> | 2021-02-09 01:05:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 01:05:25 (GMT) |
commit | e1f77695132e814728cda982f11342a2e3c7272c (patch) | |
tree | 0257b7b939cedffc7dda48ef96b8e7bfdb8dc9fa /Modules | |
parent | bf2e7e55d7306b1e2fce7dce767e8df5ff42cf1c (diff) | |
download | cpython-e1f77695132e814728cda982f11342a2e3c7272c.zip cpython-e1f77695132e814728cda982f11342a2e3c7272c.tar.gz cpython-e1f77695132e814728cda982f11342a2e3c7272c.tar.bz2 |
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
7105319ada2e66365902 (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)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/readline.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/readline.c b/Modules/readline.c index 6cb3ee5..02b2c40 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -26,10 +26,14 @@ # define RESTORE_LOCALE(sl) #endif +#ifdef WITH_EDITLINE +# include <editline/readline.h> +#else /* GNU readline definitions */ -#undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ -#include <readline/readline.h> -#include <readline/history.h> +# undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ +# include <readline/readline.h> +# include <readline/history.h> +#endif #ifdef HAVE_RL_COMPLETION_MATCHES #define completion_matches(x, y) \ |