summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Prakash Jana <engineerarun@gmail.com>2022-04-04 04:00:33 +0530
committerArun Prakash Jana <engineerarun@gmail.com>2022-04-04 04:03:50 +0530
commit24b564abd1593eb94295cfd4f632043476107450 (patch)
treee0f338c2ecc7103cbf805049d52c5f539f36f991
parentcc64d9ea6b48a7bae1778b5888d14cefb1c0c2ce (diff)
Support BSD Editline
-rw-r--r--Makefile10
-rw-r--r--README.md6
2 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index de373fd..53ca869 100644
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,17 @@ CFLAGS_OPTIMIZATION ?= -O3
CFLAGS_WARNINGS ?= -Wall -Wextra -Wno-unused-parameter -Werror
LDLIBS_READLINE ?= -lreadline
+LDLIBS_EDITLINE ?= -ledit
CFLAGS += $(CFLAGS_OPTIMIZATION) $(CFLAGS_WARNINGS)
-LDLIBS += $(LDLIBS_READLINE)
+
+O_EL := 0 # set to use the BSD editline library
+
+ifeq ($(strip $(O_EL)),1)
+ LDLIBS += $(LDLIBS_EDITLINE)
+else
+ LDLIBS += $(LDLIBS_READLINE)
+endif
SRC = $(wildcard src/*.c)
INCLUDE = -Iinc
diff --git a/README.md b/README.md
index c9b53d8..512918a 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ It has a [`bc`](https://www.gnu.org/software/bc/manual/html_mono/bc.html) mode f
#### Dependencies
-`bcal` is written in C and depends on standard libc and libreadline. It invokes GNU `bc` or `calc` for non-storage expressions.
+`bcal` is written in C and depends on standard libc and GNU Readline (or [BSD Editline](https://www.thrysoee.dk/editline/)). It invokes GNU `bc` or `calc` for non-storage expressions.
To use `calc`:
@@ -76,8 +76,10 @@ If you have git installed, clone this repository. Otherwise, download the [lates
Install to default location (`/usr/local`):
- $ make
$ sudo make strip install
+To link to libedit:
+
+ $ sudo make O_EL=1 strip install
To uninstall, run:
$ sudo make uninstall