From e50487f12c2361144c367eaf34e2073b17b885bc Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Tue, 9 Aug 2011 13:10:28 +0000 Subject: [PATCH] Allow "versioned" names of the auto-tools to be used. Previously bootstrap required aclocal/automake to be available as "aclocal" and "automake", but some platforms allows multiple versions of these tools to be installed and makes them available as "aclocal-". This patch extends the bootstrap script to try to search for various names for the tools. Patch by Trond Norbye. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1155352 13f79535-47bb-0310-9956-ffa450edef68 --- THANKS | 2 +- bootstrap | 44 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/THANKS b/THANKS index c2e18c808ee..526c74b5b61 100644 --- a/THANKS +++ b/THANKS @@ -85,6 +85,6 @@ suggesting improvements or submitting changes. Some of these people are: * Andrey Somov * Chris Coulson * Dave Cottlehuber - + * Trond Norbye For a list of authors see the `AUTHORS` file. diff --git a/bootstrap b/bootstrap index bdb35a3b5af..1190280c200 100755 --- a/bootstrap +++ b/bootstrap @@ -49,16 +49,42 @@ gunzip -c m4/ac_check_icu.m4.gz > m4/ac_check_icu.m4 gunzip -c m4/ac_check_curl.m4.gz > m4/ac_check_curl.m4 gunzip -c m4/pkg.m4.gz > m4/pkg.m4 -if test -x "`which glibtoolize 2> /dev/null || true`"; then - glibtoolize -f -c --automake -else - libtoolize -f -c --automake -fi +# Seach a list of names for the first occurence of a program. +# Some systems may use aclocal-1.10, others may have aclocal etc. +# +# Exit with status code 0 if the program exists (and print the +# path to stdout), exit with status code 1 if it can't be +# located +find_program() { + set +e + for f in "$@" + do + file=`which ${f} 2>/dev/null | grep -v '^no '` + if test -n "x${file}" -a -x "${file}" + then + echo ${file} + set -e + exit 0 + fi + done + + echo "Failed to locate required program:" 1>&2 + echo "\t$@" 1>&2 + set -e + exit 1 +} + +LIBTOOLIZE=`find_program glibtoolize libtoolize` +ACLOCAL=`find_program aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal` +AUTOHEADER=`find_program autoheader` +AUTOMAKE=`find_program automake-1.11 automake-1.10 automake-1.9 automake` +AUTOCONF=`find_program autoconf` -aclocal -I m4 -autoheader -f -automake -f -a 2>&1 | sed -e "/install/d" -autoconf -f +${LIBTOOLIZE} -f -c --automake +${ACLOCAL} -I m4 +${AUTOHEADER} -f +${AUTOMAKE} -f -a 2>&1 | sed -e "/install/d" +${AUTOCONF} -f ln -f -s "`dirname \`readlink build-aux/missing\``/INSTALL"