summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTitanSnow <[email protected]>2017-05-08 07:42:29 +0800
committerTitanSnow <[email protected]>2017-05-08 07:42:29 +0800
commitc89daffdb800aab6d8c7b46a9bac2d8657cde9eb (patch)
tree14c31ecb620d158f39c98117bfc1412a46e4a45c
parent3db167aa122f776ef358d7c23453b56994568849 (diff)
fix readline check
-rw-r--r--core/detect/readline.c3
-rw-r--r--core/makefile4
2 files changed, 5 insertions, 2 deletions
diff --git a/core/detect/readline.c b/core/detect/readline.c
new file mode 100644
index 000000000..13452bd84
--- /dev/null
+++ b/core/detect/readline.c
@@ -0,0 +1,3 @@
+#include<stdio.h>
+#include<readline/readline.h>
+int main(){readline(0);return 0;}
diff --git a/core/makefile b/core/makefile
index 10911402f..fcee1b008 100644
--- a/core/makefile
+++ b/core/makefile
@@ -269,8 +269,8 @@ base_LIBNAMES := ws2_32
endif
ifeq ($(PLAT),linux)
-base_LIBPATH := $(shell find "/usr" -name libreadline.so | grep ".*/" -o)
-base_LIBNAMES := $(shell find "/usr" -name libreadline.so | grep readline -o) m dl pthread
+base_LIBPATH :=
+base_LIBNAMES := $(shell if { cat detect/readline.c | $(CC) -xc - -lreadline -o /dev/null 2>/dev/null; }; then echo readline; fi ) m dl pthread
endif
# check jit compiler