summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-23 16:49:49 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-23 16:52:00 +0200
commit426392f71d5f45aad8c57969643fd6c365ce2362 (patch)
tree3e5b6ddfc395e26f1a931f9a97516ede9b7c68d3 /cmake
parent1ec240e3df3e9c8571c0df174b9f239b451dbf3a (diff)
downloadsink-426392f71d5f45aad8c57969643fd6c365ce2362.tar.gz
sink-426392f71d5f45aad8c57969643fd6c365ce2362.zip
Replaced readline with cpp-linenoise
... a single header readline replacement that works on all linux, osx and windows (or so they claim). Besides cleaning up the code considerably, it should help us build sinksh on windows where readline is not really (there are some ancient broken readline ports) available. cpp-readline comes from here: https://github.com/yhirose/cpp-linenoise
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindReadline.cmake47
1 files changed, 0 insertions, 47 deletions
diff --git a/cmake/modules/FindReadline.cmake b/cmake/modules/FindReadline.cmake
deleted file mode 100644
index 5e110da..0000000
--- a/cmake/modules/FindReadline.cmake
+++ /dev/null
@@ -1,47 +0,0 @@
1# - Try to find readline include dirs and libraries
2#
3# Usage of this module as follows:
4#
5# find_package(Readline)
6#
7# Variables used by this module, they can change the default behaviour and need
8# to be set before calling find_package:
9#
10# Readline_ROOT_DIR Set this variable to the root installation of
11# readline if the module has problems finding the
12# proper installation path.
13#
14# Variables defined by this module:
15#
16# READLINE_FOUND System has readline, include and lib dirs found
17# Readline_INCLUDE_DIR The readline include directories.
18# Readline_LIBRARY The readline library.
19
20find_path(Readline_ROOT_DIR
21 NAMES include/readline/readline.h
22 )
23
24find_path(Readline_INCLUDE_DIR
25 NAMES readline/readline.h
26 HINTS ${Readline_ROOT_DIR}/include
27 )
28
29find_library(Readline_LIBRARY
30 NAMES readline
31 HINTS ${Readline_ROOT_DIR}/lib
32 )
33
34set(Readline_VERSION Readline_VERSION-NOTFOUND)
35if (Readline_INCLUDE_DIR)
36 if(EXISTS "${Readline_INCLUDE_DIR}/readline/readline.h")
37 file(STRINGS "${Readline_INCLUDE_DIR}/readline/readline.h" _Readline_HEADER_CONTENTS REGEX "#define RL_VERSION_[A-Z]+")
38 string(REGEX REPLACE ".*#define RL_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" Readline_VERSION_MAJOR "${_Readline_HEADER_CONTENTS}")
39 string(REGEX REPLACE ".*#define RL_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" Readline_VERSION_MINOR "${_Readline_HEADER_CONTENTS}")
40 set(Readline_VERSION ${Readline_VERSION_MAJOR}.${Readline_VERSION_MINOR})
41 unset(_Readline_HEADER_CONTENTS)
42 endif()
43endif()
44
45find_package_handle_standard_args(Readline FOUND_VAR Readline_FOUND
46 REQUIRED_VARS Readline_LIBRARY Readline_INCLUDE_DIR Readline_ROOT_DIR
47 VERSION_VAR Readline_VERSION)