From: Dmitry Volyntsev Date: Fri, 18 Aug 2017 15:40:39 +0000 (+0300) Subject: Improved editline detection on various platforms. X-Git-Tag: 0.1.13~6 X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=6eeac8fa4e894c652915027d60a0eebeac83fa88;p=njs.git Improved editline detection on various platforms. --- diff --git a/Makefile b/Makefile index a6a9d4e8..01ed2c2f 100644 --- a/Makefile +++ b/Makefile @@ -396,7 +396,7 @@ $(NXT_BUILDDIR)/njs: \ njs/njs.c \ $(NXT_CC) -o $(NXT_BUILDDIR)/njs $(NXT_CFLAGS) \ - -I$(NXT_LIB) -Injs \ + -I$(NXT_LIB) $(NXT_EDITLINE_CFLAGS) -Injs \ njs/njs.c \ $(NXT_BUILDDIR)/libnjs.a \ -lm $(NXT_PCRE_LIB) $(NXT_EDITLINE_LIB) diff --git a/njs/njs.c b/njs/njs.c index 719d027e..6106a52b 100644 --- a/njs/njs.c +++ b/njs/njs.c @@ -27,7 +27,7 @@ #include #include -#include +#include typedef enum { diff --git a/nxt/auto/editline b/nxt/auto/editline index 45b06703..c7c6b91b 100644 --- a/nxt/auto/editline +++ b/nxt/auto/editline @@ -1,12 +1,15 @@ # Copyright (C) Dmitry Volyntsev # Copyright (C) NGINX, Inc. +nxt_found=no + nxt_feature="editline library" nxt_feature_name=NXT_HAVE_EDITLINE nxt_feature_run=no -nxt_feature_incs= -nxt_feature_libs=-ledit -nxt_feature_test="#include +nxt_feature_incs="-I/usr/include/editline" +nxt_feature_libs="-ledit" +nxt_feature_test="#include + #include int main(void) { add_history(NULL); @@ -14,9 +17,21 @@ nxt_feature_test="#include }" . ${NXT_AUTO}feature +if [ $nxt_found = no ]; then + + # FreeBSD port + + nxt_feature="editline in /usr/include/edit" + nxt_feature_incs="-I/usr/include/edit/readline" + + . auto/feature +fi + if [ $nxt_found = yes ]; then cat << END >> $NXT_MAKEFILE_CONF -NXT_EDITLINE_LIB = -ledit + +NXT_EDITLINE_CFLAGS = $nxt_feature_incs +NXT_EDITLINE_LIB = $nxt_feature_libs END else