Mercurial > njs
changeset 931:760d38110fd9
Support for building with GNU Readline library.
| author | Valentin Bartenev <vbart@nginx.com> |
|---|---|
| date | Fri, 26 Apr 2019 17:59:42 +0300 |
| parents | 43dc900bc914 |
| children | 60e98e247a53 |
| files | auto/editline auto/expect auto/make auto/readline configure njs/njs_shell.c |
| diffstat | 6 files changed, 92 insertions(+), 72 deletions(-) [+] |
line wrap: on
line diff
--- a/auto/editline Thu Apr 25 19:50:20 2019 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -# Copyright (C) Dmitry Volyntsev -# Copyright (C) NGINX, Inc. - - -NXT_EDITLINE_CFLAGS= -NXT_EDITLINE_LIB= - -nxt_found=no - -nxt_feature="editline library in editline/readline.h" -nxt_feature_name=NXT_HAVE_EDITLINE -nxt_feature_run=no -nxt_feature_incs= -nxt_feature_libs="-ledit" -nxt_feature_test="#include <stdio.h> - #include <editline/readline.h> - - int main(void) { - add_history(NULL); - return 0; - }" -. auto/feature - -if [ $nxt_found = no ]; then - - # FreeBSD port - - nxt_feature_name=NXT_HAVE_EDIT_READLINE - nxt_feature="editline in edit/readline/readline.h" - nxt_feature_test="#include <stdio.h> - #include <edit/readline/readline.h> - - int main(void) { - add_history(NULL); - return 0; - }" - - . auto/feature -fi - -if [ $nxt_found = no ]; then - - # NetBSD - - nxt_feature_name=NXT_HAVE_READLINE - nxt_feature="editline in readline/readline.h" - nxt_feature_test="#include <stdio.h> - #include <readline/readline.h> - - int main(void) { - add_history(NULL); - return 0; - }" - . auto/feature -fi - -NXT_DEFAULT_TARGET=libnjs - -if [ $nxt_found = yes ]; then - NXT_HAVE_LIBEDIT=YES - NXT_EDITLINE_CFLAGS=$nxt_feature_incs - NXT_EDITLINE_LIB=$nxt_feature_libs - NXT_DEFAULT_TARGET="$NXT_DEFAULT_TARGET njs" - -else - NXT_HAVE_LIBEDIT=NO - $echo " - building interactive shell is not possible" -fi
--- a/auto/expect Thu Apr 25 19:50:20 2019 +0300 +++ b/auto/expect Fri Apr 26 17:59:42 2019 +0300 @@ -17,7 +17,7 @@ $echo " not found" fi -if [ $nxt_found = yes -a $NXT_HAVE_LIBEDIT = YES ]; then +if [ $nxt_found = yes -a $NXT_HAVE_READLINE = YES ]; then cat << END >> $NXT_MAKEFILE njs_expect_test: njs njs/test/njs_expect_test.exp
--- a/auto/make Thu Apr 25 19:50:20 2019 +0300 +++ b/auto/make Fri Apr 26 17:59:42 2019 +0300 @@ -178,10 +178,10 @@ njs/njs_shell.c \$(NXT_CC) -o $NXT_BUILD_DIR/njs \$(NXT_CFLAGS) \\ $NXT_LIB_AUX_CFLAGS \$(NXT_LIB_INCS) \\ - $NXT_EDITLINE_CFLAGS -Injs \\ + $NXT_READLINE_CFLAGS -Injs \\ njs/njs_shell.c \\ $NXT_BUILD_DIR/libnjs.a \\ - -lm $NXT_LIBS $NXT_LIB_AUX_LIBS $NXT_EDITLINE_LIB + -lm $NXT_LIBS $NXT_LIB_AUX_LIBS $NXT_READLINE_LIB END
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/auto/readline Fri Apr 26 17:59:42 2019 +0300 @@ -0,0 +1,85 @@ +# Copyright (C) Dmitry Volyntsev +# Copyright (C) NGINX, Inc. + + +NXT_READLINE_CFLAGS= +NXT_READLINE_LIB= + +nxt_found=no + +nxt_feature="GNU readline library" +nxt_feature_name=NXT_HAVE_GNU_READLINE +nxt_feature_run=no +nxt_feature_incs= +nxt_feature_libs="-lreadline" +nxt_feature_test="#include <stdio.h> + #include <readline/readline.h> + #include <readline/history.h> + + int main(void) { + add_history(NULL); + return 0; + }" +. auto/feature + +if [ $nxt_found = no ]; then + nxt_feature="editline library in editline/readline.h" + nxt_feature_name=NXT_HAVE_EDITLINE + nxt_feature_libs="-ledit" + nxt_feature_test="#include <stdio.h> + #include <editline/readline.h> + + int main(void) { + add_history(NULL); + return 0; + }" + . auto/feature +fi + +if [ $nxt_found = no ]; then + + # FreeBSD port + + nxt_feature_name=NXT_HAVE_EDIT_READLINE + nxt_feature="editline in edit/readline/readline.h" + nxt_feature_test="#include <stdio.h> + #include <edit/readline/readline.h> + + int main(void) { + add_history(NULL); + return 0; + }" + + . auto/feature +fi + +if [ $nxt_found = no ]; then + + # NetBSD + + nxt_feature_name=NXT_HAVE_NETBSD_READLINE + nxt_feature="editline in readline/readline.h" + nxt_feature_test="#include <stdio.h> + #include <readline/readline.h> + + int main(void) { + add_history(NULL); + return 0; + }" + . auto/feature +fi + + + +NXT_DEFAULT_TARGET=libnjs + +if [ $nxt_found = yes ]; then + NXT_HAVE_READLINE=YES + NXT_READLINE_CFLAGS=$nxt_feature_incs + NXT_READLINE_LIB=$nxt_feature_libs + NXT_DEFAULT_TARGET="$NXT_DEFAULT_TARGET njs" + +else + NXT_HAVE_READLINE=NO + $echo " - building interactive shell is not possible" +fi
