Add editline support
GNU readline recently changed license to GPLv3+ which makes it incompatible with chrony (GPLv2). This patch adds support for editline library (BSD license).
This commit is contained in:
parent
eefb5c7552
commit
84cbeeadd1
2 changed files with 16 additions and 2 deletions
4
client.c
4
client.c
|
@ -41,9 +41,13 @@
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
#ifdef FEAT_READLINE
|
#ifdef FEAT_READLINE
|
||||||
|
#ifdef USE_EDITLINE
|
||||||
|
#include <editline/readline.h>
|
||||||
|
#else
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_STDINT_H
|
#ifdef HAS_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
14
configure
vendored
14
configure
vendored
|
@ -129,6 +129,7 @@ for instance \`--prefix=$HOME'.
|
||||||
|
|
||||||
For better control, use the options below.
|
For better control, use the options below.
|
||||||
--disable-readline Don't try to use GNU readline
|
--disable-readline Don't try to use GNU readline
|
||||||
|
--with-editline Use editline library instead of readline
|
||||||
--readline-dir=DIR Specify parent of readline include and lib directories
|
--readline-dir=DIR Specify parent of readline include and lib directories
|
||||||
--readline-inc-dir=DIR Specify where readline include directory is
|
--readline-inc-dir=DIR Specify where readline include directory is
|
||||||
--readline-lib-dir=DIR Specify where readline lib directory is
|
--readline-lib-dir=DIR Specify where readline lib directory is
|
||||||
|
@ -174,6 +175,7 @@ SYSDEFS=""
|
||||||
|
|
||||||
# Support for readline (on by default)
|
# Support for readline (on by default)
|
||||||
feat_readline=1
|
feat_readline=1
|
||||||
|
use_editline=0
|
||||||
feat_rtc=1
|
feat_rtc=1
|
||||||
feat_linuxcaps=0
|
feat_linuxcaps=0
|
||||||
readline_lib=""
|
readline_lib=""
|
||||||
|
@ -195,6 +197,9 @@ do
|
||||||
--disable-readline )
|
--disable-readline )
|
||||||
feat_readline=0
|
feat_readline=0
|
||||||
;;
|
;;
|
||||||
|
--with-editline )
|
||||||
|
use_editline=1
|
||||||
|
;;
|
||||||
--with-readline-library=* )
|
--with-readline-library=* )
|
||||||
readline_lib=-L`echo $option | sed -e 's/^.*=//;'`
|
readline_lib=-L`echo $option | sed -e 's/^.*=//;'`
|
||||||
;;
|
;;
|
||||||
|
@ -341,8 +346,13 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $feat_readline = "1" ]; then
|
if [ $feat_readline = "1" ]; then
|
||||||
READLINE_COMPILE="-DFEAT_READLINE=1 $readline_inc"
|
if [ $use_editline = "1" ]; then
|
||||||
READLINE_LINK="$readline_lib $ncurses_lib -lreadline -lncurses"
|
READLINE_COMPILE="-DFEAT_READLINE=1 -DUSE_EDITLINE=1 $readline_inc"
|
||||||
|
READLINE_LINK="$readline_lib -ledit"
|
||||||
|
else
|
||||||
|
READLINE_COMPILE="-DFEAT_READLINE=1 $readline_inc"
|
||||||
|
READLINE_LINK="$readline_lib $ncurses_lib -lreadline -lncurses"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
READLINE_COMPILE=""
|
READLINE_COMPILE=""
|
||||||
READLINE_LINK=""
|
READLINE_LINK=""
|
||||||
|
|
Loading…
Reference in a new issue