@@ -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'] )
15321532fi
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] )
15871542AC_SUBST ( [ READLINE_LIBS] )
15881543
15891544# #############################################################################
0 commit comments