summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-09-23 07:15:06 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-09-23 07:15:06 (GMT)
commit56ed53c70fbcf68097f0d837748766107f8b65d9 (patch)
tree203f14050b9a853fd1a4ec7cb29cd085db022dc8 /configure
parent2b152b183980611ae2b0f16077e6122dcb933861 (diff)
Allow fully qulified file name in tools to check for.
Simplify checking for bash. /trunk/configure | 30 13 17 0 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure30
1 files changed, 13 insertions, 17 deletions
diff --git a/configure b/configure
index 363ee37..ce6491f 100755
--- a/configure
+++ b/configure
@@ -10,9 +10,10 @@ DATE=$(date +%Y%m%d)
# - makeinfo for building docs, even if discarded later on
# - others obvious... :-/
TOOLS_TO_CHECK='
-make/^GNU
+/bin/bash/^GNU bash, version 3\.
+make/^GNU Make
gcc
-awk/^GNU
+awk/^GNU Awk
sed
bison
flex
@@ -46,12 +47,12 @@ do_error() {
# A small function to test for existence of various tools
# Usage: has_or_abort foobar
-# -> foobar must exist in PATH
+# -> foobar must exist in PATH or be an exiting fully qualified file name
# Usage: has_or_abort foobar/string
-# -> foobar must exist in PATH, and $(foobar --version) must contain 'string'
+# -> foobar must exist in PATH or be an existing FQFN, and $(foobar --version) must contain 'string'
has_or_abort() {
- tool=$(echo "${1}/" |cut -d / -f 1)
- regexp=$(echo "${1}/" |cut -d / -f 2)
+ tool="${1%/*}"
+ regexp="${1##*/}"
printf "Checking for '${tool}'... "
where=$(which "${tool}" 2>/dev/null || true)
if [ -z "${where}" ]; then
@@ -249,18 +250,13 @@ echo "${VERSION}"
[ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc/ct-ng-${VERSION}"
[ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man/man1"
-# Check bash is present, and at least version 3.0
-printf "Checking '/bin/bash' is at least bash-3.0... "
-[ -x /bin/bash ] || do_error "bash 3.0 or above was not found in '/bin/bash'"
-bash_version=$(/bin/bash -c 'echo ${BASH_VERSION}')
-bash_major=$(/bin/bash -c 'echo ${BASH_VERSINFO[0]}')
-[ ${bash_major} -ge 3 ] || do_error "bash 3.0 or above is needed ('/bin/bash' is '${bash_version}')"
-echo "${bash_version}"
-
# Check the existence of absolutely required tools
-for tool in ${TOOLS_TO_CHECK}; do
- has_or_abort "${tool}"
-done
+{ IFS='
+';
+ for tool in ${TOOLS_TO_CHECK}; do
+ has_or_abort "${tool}"
+ done;
+}
# It's safer to change all ',' to spaces rather than setting IFS
CONTRIB_list=$(echo "${CONTRIB_list}" |sed -r -e 's/,+/ /g;')