From 73bba12d8ba1bff2b2c0266a7fdbe1ee8ab0ad6a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 28 Apr 2017 16:53:56 +0200 Subject: Check for libreadline --- src/nix/local.mk | 4 +++- src/nix/repl.cc | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nix/local.mk b/src/nix/local.mk index 21f190e476f4..e71cf16fabf6 100644 --- a/src/nix/local.mk +++ b/src/nix/local.mk @@ -6,6 +6,8 @@ nix_SOURCES := $(wildcard $(d)/*.cc) nix_LIBS = libexpr libmain libstore libutil libformat -nix_LDFLAGS = -lreadline +ifeq ($(HAVE_READLINE), 1) + nix_LDFLAGS += -lreadline +endif $(eval $(call install-symlink, nix, $(bindir)/nix-hash)) diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 17203d3c299f..13488bf1dbd4 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -1,3 +1,5 @@ +#if HAVE_LIBREADLINE + #include #include @@ -726,3 +728,5 @@ struct CmdRepl : StoreCommand static RegisterCommand r1(make_ref()); } + +#endif -- cgit 1.4.1