Skip to content

Commit 8ef8e16

Browse files
authored
Merge pull request #3898 from NTULINUX/2.9_libedit
Convert to libedit (2.9 branch)
2 parents 40122c1 + 7980d94 commit 8ef8e16

File tree

4 files changed

+12
-68
lines changed

4 files changed

+12
-68
lines changed

debian/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fi
3535

3636
EXTRA_BUILD=
3737
PYTHON_VERSION_NEXT=$(python3 -c 'import sys; print (sys.version[:2] + str(1+int(sys.version[2])))')
38-
LIBREADLINE_DEV="libeditreadline-dev | libreadline-gplv2-dev | libreadline-dev"
38+
LIBREADLINE_DEV="libeditreadline-dev"
3939

4040
ENABLE_BUILD_DOCUMENTATION=--enable-build-documentation=pdf
4141

src/configure.ac

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,6 @@ RTPREFIX=""
128128
KERNELDIR=""
129129
RTFLAGS=""
130130

131-
NONDISTRIBUTABLE=false
132-
AC_ARG_ENABLE(non-distributable,
133-
AS_HELP_STRING(
134-
[--enable-non-distributable],
135-
[To build LinuxCNC even if a license problem would render the resulting binaries non-distributable under the terms of the LinuxCNC license]),
136-
[
137-
case "$enableval" in
138-
(yes) NONDISTRIBUTABLE=true ;;
139-
esac
140-
])
141-
142131
##############################################################################
143132
# Subsection 2.1 #
144133
# Check for arguments to ./configure #
@@ -1526,59 +1515,14 @@ fi
15261515
temp_LIBS=$LIBS
15271516
LIBS=
15281517

1529-
# check for readline.h and friends, optional for halcmd
1530-
AC_CHECK_HEADERS(readline/readline.h, [HAVE_READLINE=yes], [HAVE_READLINE=no])
1531-
AC_CHECK_HEADERS(readline/history.h, [], [HAVE_READLINE=no])
1532-
1533-
echo "Trying readline without -ltermcap"
1534-
AC_CHECK_LIB(readline, readline, [HAVE_READLINE_NOTERMCAP=yes], [])
1535-
unset ac_cv_lib_readline_readline
1536-
echo "Trying readline with -ltermcap"
1537-
AC_CHECK_LIB(readline, readline, [HAVE_READLINE_TERMCAP=yes], [], -ltermcap)
1538-
unset ac_cv_lib_readline_readline
1539-
1540-
if test "x$HAVE_READLINE_NOTERMCAP" = "xyes"; then
1541-
echo "Readline does not require -ltermcap"
1542-
READLINE_LIBS="-lreadline"
1543-
elif test "x$HAVE_READLINE_TERMCAP" = "xyes"; then
1544-
echo "Readline requires -ltermcap"
1545-
READLINE_LIBS="-lreadline -ltermcap"
1546-
else
1547-
HAVE_READLINE=no
1548-
fi
1549-
1550-
AC_MSG_CHECKING([whether readline license is compatible with GPL-2])
1551-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1552-
#include <stdio.h>
1553-
#include <readline/readline.h>
1554-
]], [[
1555-
#if RL_VERSION_MAJOR > 5
1556-
#error Readline version 6 and up are not compatible with GPL-2
1557-
#endif
1558-
]])],[AC_MSG_RESULT(yes)],[
1559-
AC_MSG_RESULT(no)
1560-
AC_MSG_WARN(
1561-
[The LinuxCNC binary you are building may not be
1562-
distributable due to a license incompatibility with LinuxCNC (some portions
1563-
GPL-2 only) and Readline version 6 and greater (GPL-3 or later).])
1564-
if $NONDISTRIBUTABLE; then
1565-
AC_MSG_WARN(
1566-
[User requested to enable non-distributable builds. Continuing.])
1567-
else
1568-
AC_MSG_ERROR(
1569-
[To configure LinuxCNC in this way, you must
1570-
invoke configure with "--enable-non-distributable=yes". Note that on
1571-
Debian-based systems, you may be able to use libeditreadline-dev or
1572-
libreadline-gplv2-dev instead of libreadline-dev.])
1573-
fi
1518+
AC_CHECK_HEADERS([editline/readline.h histedit.h], [], [
1519+
AC_MSG_ERROR([libedit headers not found. Please install libedit-dev or libedit-devel.])
1520+
])
1521+
AC_CHECK_LIB([edit], [readline], [
1522+
READLINE_LIBS="-ledit"
1523+
], [
1524+
AC_MSG_ERROR([libedit library (-ledit) not found.])
15741525
])
1575-
1576-
if test "x$HAVE_READLINE" = "xyes"; then
1577-
AC_DEFINE([HAVE_READLINE], [], [Define to 1 if you have the 'readline' library (-lreadline) and required headers])
1578-
else
1579-
AC_MSG_ERROR([Required library 'readline' missing.])
1580-
fi
1581-
AC_SUBST([HAVE_READLINE])
15821526
AC_SUBST([READLINE_LIBS])
15831527

15841528
##############################################################################

src/emc/sai/driver.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include <stdarg.h>
3232
#include <string>
3333

34-
#include <readline/readline.h>
35-
#include <readline/history.h>
34+
#include <editline/readline.h>
35+
#include <histedit.h>
3636
#include <glob.h>
3737
#include <wordexp.h>
3838
#include <rtapi_string.h>

src/hal/utils/halcmd_completion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
#define HALCMD_COMPLETION_H
4242

4343
#include <stdio.h>
44-
#include <readline/readline.h>
45-
#include <readline/history.h>
44+
#include <editline/readline.h>
45+
#include <histedit.h>
4646

4747
extern int comp_id;
4848
extern void halcmd_init_readline();

0 commit comments

Comments
 (0)