From e4f906c56bd59fb7eb098119650d96ba0ee13c4b Mon Sep 17 00:00:00 2001 From: Alec Ari Date: Wed, 18 Mar 2026 03:41:48 -0500 Subject: [PATCH 1/2] Convert to libedit so everyone can redistribute Signed-off-by: Alec Ari --- src/configure.ac | 59 ++++--------------------------- src/emc/sai/driver.cc | 4 +-- src/hal/utils/halcmd_completion.h | 4 +-- 3 files changed, 11 insertions(+), 56 deletions(-) diff --git a/src/configure.ac b/src/configure.ac index bd580adbc3e..b3076441f3e 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -1531,59 +1531,14 @@ if test "x$HAVE_LIBFMT" = "xno"; then AC_MSG_ERROR([libfmt header not found. Install with 'sudo apt-get install libfmt-dev']) fi -# check for readline.h and friends, optional for halcmd -AC_CHECK_HEADERS(readline/readline.h, [HAVE_READLINE=yes], [HAVE_READLINE=no]) -AC_CHECK_HEADERS(readline/history.h, [], [HAVE_READLINE=no]) - -echo "Trying readline without -ltermcap" -AC_CHECK_LIB(readline, readline, [HAVE_READLINE_NOTERMCAP=yes], []) -unset ac_cv_lib_readline_readline -echo "Trying readline with -ltermcap" -AC_CHECK_LIB(readline, readline, [HAVE_READLINE_TERMCAP=yes], [], -ltermcap) -unset ac_cv_lib_readline_readline - -if test "x$HAVE_READLINE_NOTERMCAP" = "xyes"; then - echo "Readline does not require -ltermcap" - READLINE_LIBS="-lreadline" -elif test "x$HAVE_READLINE_TERMCAP" = "xyes"; then - echo "Readline requires -ltermcap" - READLINE_LIBS="-lreadline -ltermcap" -else - HAVE_READLINE=no -fi - -AC_MSG_CHECKING([whether readline license is compatible with GPL-2]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]], [[ - #if RL_VERSION_MAJOR > 5 - #error Readline version 6 and up are not compatible with GPL-2 - #endif - ]])],[AC_MSG_RESULT(yes)],[ - AC_MSG_RESULT(no) - AC_MSG_WARN( -[The LinuxCNC binary you are building may not be -distributable due to a license incompatibility with LinuxCNC (some portions -GPL-2 only) and Readline version 6 and greater (GPL-3 or later).]) - if $NONDISTRIBUTABLE; then - AC_MSG_WARN( -[User requested to enable non-distributable builds. Continuing.]) - else - AC_MSG_ERROR( -[To configure LinuxCNC in this way, you must -invoke configure with "--enable-non-distributable=yes". Note that on -Debian-based systems, you may be able to use libeditreadline-dev or -libreadline-gplv2-dev instead of libreadline-dev.]) - fi +AC_CHECK_HEADERS([editline/readline.h histedit.h], [], [ + AC_MSG_ERROR([libedit headers not found. Please install libedit-dev or libedit-devel.]) +]) +AC_CHECK_LIB([edit], [readline], [ + READLINE_LIBS="-ledit" +], [ + AC_MSG_ERROR([libedit library (-ledit) not found.]) ]) - -if test "x$HAVE_READLINE" = "xyes"; then - AC_DEFINE([HAVE_READLINE], [], [Define to 1 if you have the 'readline' library (-lreadline) and required headers]) -else - AC_MSG_ERROR([Required library 'readline' missing.]) -fi -AC_SUBST([HAVE_READLINE]) AC_SUBST([READLINE_LIBS]) ############################################################################## diff --git a/src/emc/sai/driver.cc b/src/emc/sai/driver.cc index cd64762acc6..0496c5f693a 100644 --- a/src/emc/sai/driver.cc +++ b/src/emc/sai/driver.cc @@ -31,8 +31,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/src/hal/utils/halcmd_completion.h b/src/hal/utils/halcmd_completion.h index ada16d74469..f7ad92e60f9 100644 --- a/src/hal/utils/halcmd_completion.h +++ b/src/hal/utils/halcmd_completion.h @@ -41,8 +41,8 @@ #define HALCMD_COMPLETION_H #include -#include -#include +#include +#include extern int comp_id; extern void halcmd_init_readline(); From 21a1aa948d2905628cd2d6ca52f74c3b1d7af591 Mon Sep 17 00:00:00 2001 From: Alec Ari Date: Wed, 18 Mar 2026 11:36:48 -0500 Subject: [PATCH 2/2] Improvements to PR #3868 Signed-off-by: Alec Ari --- debian/configure | 2 +- src/configure.ac | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/debian/configure b/debian/configure index 109c1af9842..044e61f2391 100755 --- a/debian/configure +++ b/debian/configure @@ -72,7 +72,7 @@ fi EXTRA_BUILD= PYTHON_VERSION_NEXT=$(python3 -c 'import sys; print (sys.version[:2] + str(1+int(sys.version[2])))') -LIBREADLINE_DEV="libeditreadline-dev | libreadline-gplv2-dev | libreadline-dev" +LIBREADLINE_DEV="libeditreadline-dev" ENABLE_BUILD_DOCUMENTATION=--enable-build-documentation=pdf diff --git a/src/configure.ac b/src/configure.ac index b3076441f3e..917c1f69d50 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -126,17 +126,6 @@ RTPREFIX="" KERNELDIR="" RTFLAGS="" -NONDISTRIBUTABLE=false -AC_ARG_ENABLE(non-distributable, - AS_HELP_STRING( - [--enable-non-distributable], - [To build LinuxCNC even if a license problem would render the resulting binaries non-distributable under the terms of the LinuxCNC license]), - [ - case "$enableval" in - (yes) NONDISTRIBUTABLE=true ;; - esac - ]) - ############################################################################## # Subsection 2.1 # # Check for arguments to ./configure #