From b89f38960651701ed76a87e21c7a566fe0714f3c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 11 Dec 2020 21:18:02 +0100 Subject: [PATCH] CONFIG: support optional config.sh/readline file - provides a hook for specifying alternative locations --- wmake/scripts/have_readline | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/wmake/scripts/have_readline b/wmake/scripts/have_readline index 16b0bba5e4..1da43ab787 100644 --- a/wmake/scripts/have_readline +++ b/wmake/scripts/have_readline @@ -16,8 +16,11 @@ # Description # Detection/setup of READLINE # -# Requires -# None +# Optional +# config.sh/readline +# +# Environment +# READLINE_ARCH_PATH # # Functions provided # have_readline, no_readline, echo_readline, search_readline @@ -27,6 +30,8 @@ # READLINE_INC_DIR # READLINE_LIB_DIR # +# Without a config file, defaults to system +# #------------------------------------------------------------------------------ . ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions # General system functions @@ -108,7 +113,16 @@ search_readline() # Output as per search_* function have_readline() { - search_readline system + local config="config.sh/readline" + local file + + # Allow missing file + if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" + then + . "$file" + fi + + search_readline "$READLINE_ARCH_PATH" }