Skip to content

Commit 4fd0453

Browse files
authored
Merge pull request #3868 from NTULINUX/libedit
Convert to libedit so everyone can redistribute (second pass)
2 parents 01df6b7 + 21a1aa9 commit 4fd0453

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
@@ -72,7 +72,7 @@ fi
7272

7373
EXTRA_BUILD=
7474
PYTHON_VERSION_NEXT=$(python3 -c 'import sys; print (sys.version[:2] + str(1+int(sys.version[2])))')
75-
LIBREADLINE_DEV="libeditreadline-dev | libreadline-gplv2-dev | libreadline-dev"
75+
LIBREADLINE_DEV="libeditreadline-dev"
7676

7777
ENABLE_BUILD_DOCUMENTATION=--enable-build-documentation=pdf
7878

src/configure.ac

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

129-
NONDISTRIBUTABLE=false
130-
AC_ARG_ENABLE(non-distributable,
131-
AS_HELP_STRING(
132-
[--enable-non-distributable],
133-
[To build LinuxCNC even if a license problem would render the resulting binaries non-distributable under the terms of the LinuxCNC license]),
134-
[
135-
case "$enableval" in
136-
(yes) NONDISTRIBUTABLE=true ;;
137-
esac
138-
])
139-
140129
##############################################################################
141130
# Subsection 2.1 #
142131
# Check for arguments to ./configure #
@@ -1531,59 +1520,14 @@ if test "x$HAVE_LIBFMT" = "xno"; then
15311520
AC_MSG_ERROR([libfmt header not found. Install with 'sudo apt-get install libfmt-dev'])
15321521
fi
15331522

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
1523+
AC_CHECK_HEADERS([editline/readline.h histedit.h], [], [
1524+
AC_MSG_ERROR([libedit headers not found. Please install libedit-dev or libedit-devel.])
1525+
])
1526+
AC_CHECK_LIB([edit], [readline], [
1527+
READLINE_LIBS="-ledit"
1528+
], [
1529+
AC_MSG_ERROR([libedit library (-ledit) not found.])
15791530
])
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])
15871531
AC_SUBST([READLINE_LIBS])
15881532

15891533
##############################################################################

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)