From 405da5f84b072ea97b69359454899f45d92d24b6 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 22 May 2024 00:00:29 +0200 Subject: WIP LSP client This contains the start of an LSP client. Nothing (except starting the LSP server) works at the moment and the feature is disabled by default. --- configure | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'configure') diff --git a/configure b/configure index f95baae..ecc1949 100755 --- a/configure +++ b/configure @@ -3,13 +3,15 @@ _usage="./configure -- configure the DGED build. Options: - --[enable|disable]-syntax Enable or disable syntax highlighting support. - --enable-asan Build DGED with address sanitizer enabled. - --prefix= Set the build prefix path to , default: /usr/local. + --[enable|disable]-syntax Enable or disable syntax highlighting support. Default: enabled. + --[enable|disable]-lsp Enable or disable Language Server Protocol support. Default: disabled (experimental). + --enable-asan Build DGED with address sanitizer enabled. Default: disabled. + --prefix= Set the build prefix path to . Default: /usr/local. -h/--help Show this help text. " enable_syntax=1 +enable_lsp=0 enable_asan=0 prefix= while [ "$#" -gt 0 ]; do @@ -24,6 +26,16 @@ while [ "$#" -gt 0 ]; do shift 1 ;; + --enable-lsp) + enable_lsp=1 + shift 1 + ;; + + --disable-lsp) + enable_lsp=0 + shift 1 + ;; + --enable-asan) enable_asan=1 shift 1 @@ -75,21 +87,42 @@ else echo "none." fi +echo -n "detecting process model..." +if ./scripts/has_header "unistd.h"; then + echo "posix." + echo "#define PROCESS_MODEL posix" >> src/config.h + echo "PROCESS_MODEL ?= posix" >> config.mk +else + echo "unknown." +fi + if [ "$enable_syntax" -ne 0 ]; then - echo "enabling syntax highlighting" + echo "enabling syntax highlighting." echo "SYNTAX_ENABLE = true" >> config.mk + echo "#define SYNTAX_ENABLE 1" >> src/config.h else - echo "disabling syntax highlighting" + echo "disabling syntax highlighting." echo "SYNTAX_ENABLE = false" >> config.mk + echo "#undef SYNTAX_ENABLE" >> src/config.h +fi + +if [ "$enable_lsp" -ne 0 ]; then + echo "enabling language server support." + echo "LSP_ENABLE = true" >> config.mk + echo "#define LSP_ENABLE 1" >> src/config.h +else + echo "disabling language server support." + echo "LSP_ENABLE = false" >> config.mk + echo "#undef LSP_ENABLE" >> src/config.h fi if [ "$enable_asan" -ne 0 ]; then - echo "enabling address sanitizer" + echo "enabling address sanitizer." echo "ASAN = true" >> config.mk fi if [ -n "$prefix" ]; then - echo "setting prefix to \"$prefix\"" + echo "setting prefix to \"$prefix\"." echo "prefix = $prefix" >> config.mk fi -- cgit v1.2.3