summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-05-22 00:00:29 +0200
committerAlbert Cervin <albert@acervin.com>2024-09-12 20:17:56 +0200
commit405da5f84b072ea97b69359454899f45d92d24b6 (patch)
tree20525b4bc44a5d8cbab4d62abe8413e174731db6 /configure
parent4ab7e453e26afc6e9f4938c65f89463fbba9e267 (diff)
downloaddged-405da5f84b072ea97b69359454899f45d92d24b6.tar.gz
dged-405da5f84b072ea97b69359454899f45d92d24b6.tar.xz
dged-405da5f84b072ea97b69359454899f45d92d24b6.zip
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.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure47
1 files changed, 40 insertions, 7 deletions
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=<PREFIX> Set the build prefix path to <PREFIX>, 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=<PREFIX> Set the build prefix path to <PREFIX>. 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