#include "util.h"
#ifdef FEAT_READLINE
-#ifdef USE_EDITLINE
#include <editline/readline.h>
-#else
-#include <readline/readline.h>
-#include <readline/history.h>
-#endif
#endif
/* ================================================== */
}
/* ================================================== */
-/* Tab-completion when editline/readline is available */
+/* Tab-completion when editline is available */
#ifdef FEAT_READLINE
For better control, use the options below.
--disable-readline Disable line editing support
- --without-readline Don't use GNU readline even if it is available
--without-editline Don't use editline even if it is available
- --with-readline-includes=DIR Specify where readline include directory is
- --with-readline-library=DIR Specify where readline lib directory is
- --with-ncurses-library=DIR Specify where ncurses lib directory is
--disable-sechash Disable support for hashes other than MD5
--without-nettle Don't use nettle even if it is available
--without-nss Don't use NSS even if it is available
feat_ntp=1
feat_refclock=1
feat_readline=1
-try_readline=1
try_editline=1
feat_sechash=1
try_nettle=1
feat_scfilter=0
try_seccomp=-1
priv_ops=""
-readline_lib=""
-readline_inc=""
-ncurses_lib=""
feat_ipv6=1
feat_phc=1
try_phc=0
--disable-readline )
feat_readline=0
;;
- --without-readline )
- try_readline=0
- ;;
--without-editline )
try_editline=0
;;
- --with-readline-library=* )
- readline_lib=-L`echo $option | sed -e 's/^.*=//;'`
- ;;
- --with-readline-includes=* )
- readline_inc=-I`echo $option | sed -e 's/^.*=//;'`
- ;;
- --with-ncurses-library=* )
- ncurses_lib=-L`echo $option | sed -e 's/^.*=//;'`
- ;;
--prefix=* | --install_prefix=* )
SETPREFIX=`echo $option | sed -e 's/[^=]*=//;'`
;;
READLINE_LINK=""
if [ $feat_readline = "1" ]; then
if [ $try_editline = "1" ]; then
- if test_code editline 'stdio.h editline/readline.h' \
- "$readline_inc" "$readline_lib -ledit" \
- 'add_history(readline("prompt"));'
- then
- add_def FEAT_READLINE
- add_def USE_EDITLINE
- MYCPPFLAGS="$MYCPPFLAGS $readline_inc"
- READLINE_LINK="$readline_lib -ledit"
- fi
- fi
-
- if [ "x$READLINE_LINK" = "x" ] && [ $try_readline = "1" ]; then
- if test_code readline 'stdio.h readline/readline.h readline/history.h' \
- "$readline_inc" "$readline_lib -lreadline" \
- 'add_history(readline("prompt"));'
- then
- add_def FEAT_READLINE
- MYCPPFLAGS="$MYCPPFLAGS $readline_inc"
- READLINE_LINK="$readline_lib -lreadline"
- fi
- fi
-
- if [ "x$READLINE_LINK" = "x" ] && [ $try_readline = "1" ]; then
- if test_code 'readline with -lncurses' \
- 'stdio.h readline/readline.h readline/history.h' \
- "$readline_inc" "$readline_lib $ncurses_lib -lreadline -lncurses" \
+ if test_code editline 'stdio.h editline/readline.h' '' '-ledit' \
'add_history(readline("prompt"));'
then
add_def FEAT_READLINE
- MYCPPFLAGS="$MYCPPFLAGS $readline_inc"
- READLINE_LINK="$readline_lib $ncurses_lib -lreadline -lncurses"
+ READLINE_LINK="-ledit"
fi
fi
don't want to enable the support, specify the `--disable-sechash` flag to
`configure`.
-If development files for the editline or readline library are available,
+If development files for the editline library are available,
`chronyc` will be built with line editing support. If you don't want this,
specify the `--disable-readline` flag to `configure`.
the kernel attack surface and possibly prevent kernel exploits from `chronyd`
if it is compromised.
-== Support for line editing libraries
-
-`chronyc` can be built with support for line editing, this allows you to use
-the cursor keys to replay and edit old commands. Two libraries are supported
-which provide such functionality, editline and GNU readline.
-
-Please note that readline since version 6.0 is licensed under GPLv3+ which is
-incompatible with chrony's license GPLv2. You should use editline instead if
-you don't want to use older readline versions.
-
-The `configure` script will automatically enable the line editing support if
-one of the supported libraries is available. If they are both available, the
-editline library will be used.
-
-If you don't want to use it (in which case `chronyc` will use a minimal command
-line interface), invoke `configure` like this:
-
-----
-./configure --disable-readline other-options...
-----
-
-If you have editline, readline or ncurses installed in locations that aren't
-normally searched by the compiler and linker, you need to use extra options:
-
-`--with-readline-includes=directory_name`::
- This defines the name of the directory above the one where `readline.h` is.
- `readline.h` is assumed to be in `editline` or `readline` subdirectory of the
- named directory.
-
-`--with-readline-library=directory_name`::
- This defines the directory containing the `libedit.a` or `libedit.so` file,
- or `libreadline.a` or `libreadline.so` file.
-
-`--with-ncurses-library=directory_name`::
- This defines the directory containing the `libncurses.a` or `libncurses.so`
- file.
-
== Extra options for package builders
The `configure` and `make` procedures have some extra options that may be