Skip to content

Commit e4f906c

Browse files
committed
Convert to libedit so everyone can redistribute
Signed-off-by: Alec Ari <neotheuser@ymail.com>
1 parent 01df6b7 commit e4f906c

File tree

3 files changed

+11
-56
lines changed

3 files changed

+11
-56
lines changed

src/configure.ac

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,59 +1531,14 @@ if test "x$HAVE_LIBFMT" = "xno"; then
15311531
AC_MSG_ERROR([libfmt header not found. Install with 'sudo apt-get install libfmt-dev'])
15321532
fi
15331533

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

15891544
##############################################################################

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)