ENH: split up internals of wmake/scripts/have_XXX functions

- adds some more flexibility
This commit is contained in:
Mark Olesen
2020-05-15 13:58:16 +02:00
committed by Andrew Heather
parent c156125669
commit f8ef85b72f
14 changed files with 679 additions and 480 deletions

View File

@ -20,7 +20,7 @@
# None
#
# Functions provided
# have_readline, no_readline, echo_readline
# have_readline, no_readline, echo_readline, search_readline
#
# Variables set on success
# HAVE_LIBREADLINE - as per GNU autoconf
@ -32,7 +32,7 @@
#------------------------------------------------------------------------------
# Reset variables
# Reset
no_readline()
{
unset HAVE_LIBREADLINE READLINE_INC_DIR READLINE_LIB_DIR
@ -48,17 +48,18 @@ echo_readline()
}
# Search
# $1 : prefix (*_ARCH_PATH, system, ...)
#
# On success, return 0 and export variables
# -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR
have_readline()
search_readline()
{
local warn # warn="==> skip readline"
local settings
# Expected location, include/library names
local prefix=system
local incName="readline/readline.h"
local libName="libreadline"
local prefix="${1:-system}"
local header library
# ----------------------------------
@ -104,7 +105,16 @@ have_readline()
}
# Reset variables
# Output as per search_* function
have_readline()
{
search_readline system
}
#------------------------------------------------------------------------------
# Reset
no_readline
# Test/query