aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-11-21 19:08:54 +0000
committerMike Frysinger <vapier@gentoo.org>2009-11-21 19:08:54 +0000
commit8ae9b04509bbda6cd81b7b6d1c6104a4953709f6 (patch)
tree5aeea058cd4c7c276d83dd00c1b3922027fa2d9e
parentSupport autoconf-2.64. (diff)
downloadautotools-wrappers-8ae9b04509bbda6cd81b7b6d1c6104a4953709f6.tar.gz
autotools-wrappers-8ae9b04509bbda6cd81b7b6d1c6104a4953709f6.tar.bz2
autotools-wrappers-8ae9b04509bbda6cd81b7b6d1c6104a4953709f6.zip
Support autoconf-2.65 and switch to POSIX sh.ac-8
Package-Manager: portage-2.2_rc49/cvs/Linux x86_64
-rwxr-xr-xac-wrapper.sh73
1 files changed, 35 insertions, 38 deletions
diff --git a/ac-wrapper.sh b/ac-wrapper.sh
index f9b43d4..b39f02e 100755
--- a/ac-wrapper.sh
+++ b/ac-wrapper.sh
@@ -1,7 +1,7 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+#!/bin/sh
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/autoconf-wrapper/files/ac-wrapper-7.sh,v 1.1 2009/07/27 04:15:07 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/autoconf-wrapper/files/ac-wrapper-8.sh,v 1.1 2009/11/21 19:08:54 vapier Exp $
# Based on the ac-wrapper.pl script provided by MandrakeSoft
# Rewritten in bash by Gregorio Guidi
@@ -16,22 +16,23 @@
# -or-
# - `configure' is already present and was generated by autoconf 2.13
-if [[ ${0##*/} == "ac-wrapper.sh" ]] ; then
- echo "Don't call this script directly" >&2
- exit 1
+warn() { printf "ac-wrapper: $*\n" 1>&2; }
+err() { warn "$@"; exit 1; }
+
+if [ "${0##*/}" = "ac-wrapper.sh" ] ; then
+ err "Don't call this script directly"
fi
-if [[ ${WANT_AUTOCONF} == "2.1" && ${0##*/} == "autom4te" ]] ; then
- echo "ac-wrapper: Autoconf 2.13 doesn't contain autom4te." >&2
- echo " Either unset WANT_AUTOCONF or don't execute anything" >&2
- echo " that would use autom4te." >&2
- exit 1
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ "${0##*/}" = "autom4te" ] ; then
+ err "Autoconf 2.13 doesn't contain autom4te.\n" \
+ " Either unset WANT_AUTOCONF or don't execute anything\n" \
+ " that would use autom4te."
fi
#
# Set up bindings between actual version and WANT_AUTOCONF
#
-vers="2.64:2.5 2.63:2.5 2.62:2.5 2.61:2.5 2.60:2.5 2.59:2.5 2.13:2.1"
+vers="2.65:2.5 2.64:2.5 2.63:2.5 2.62:2.5 2.61:2.5 2.60:2.5 2.59:2.5 2.13:2.1"
binary=""
for v in ${vers} ; do
@@ -41,10 +42,9 @@ for v in ${vers} ; do
fi
done
if [ -z "${binary}" ] ; then
- echo "ac-wrapper: Unable to locate any usuable version of autoconf." >&2
- echo " I tried these versions: ${vers}" >&2
- echo " With a base name of '${0}'." >&2
- exit 1
+ err "Unable to locate any usuable version of autoconf.\n" \
+ "\tI tried these versions: ${vers}\n" \
+ "\tWith a base name of '${0}'."
fi
#
@@ -54,7 +54,7 @@ fi
if [ -n "${WANT_AUTOCONF}" ] ; then
for v in ${vers} x ; do
if [ "${v}" = "x" ] ; then
- echo "ac-wrapper: warning: invalid WANT_AUTOCONF '${WANT_AUTOCONF}'; ignoring." >&2
+ warn "warning: invalid WANT_AUTOCONF '${WANT_AUTOCONF}'; ignoring."
unset WANT_AUTOCONF
break
fi
@@ -102,37 +102,36 @@ generated_version() {
#
# autodetect routine
#
-if [[ ${WANT_AUTOCONF} == "2.1" ]] && [ -f "configure.ac" ] ; then
- echo "ac-wrapper: Since configure.ac is present, aclocal always use" >&2
- echo " autoconf 2.59+, which conflicts with your choice and" >&2
- echo " causes error. You have two options:" >&2
- echo " 1. Try execute command again after removing configure.ac" >&2
- echo " 2. Don't set WANT_AUTOCONF" >&2
- exit 1
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ -f "configure.ac" ] ; then
+ err "Since configure.ac is present, aclocal always use\n" \
+ "\tautoconf 2.59+, which conflicts with your choice and\n" \
+ "\tcauses error. You have two options:\n" \
+ "\t1. Try execute command again after removing configure.ac\n" \
+ "\t2. Don't set WANT_AUTOCONF"
fi
-if [[ ${WANT_AUTOCONF} != "2.5" ]] && [[ -n ${WANT_AUTOMAKE} ]] ; then
+if [ "${WANT_AUTOCONF}" != "2.5" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
# Automake-1.7 and better require autoconf-2.5x so if WANT_AUTOMAKE
# is set to an older version, let's do some sanity checks.
case "${WANT_AUTOMAKE}" in
1.[456])
acfiles=$(ls ac{local,include}.m4 configure.{in,ac} 2>/dev/null)
- [[ -n ${acfiles} ]] && confversion=$(acprereq_version ${acfiles})
+ [ -n "${acfiles}" ] && confversion=$(acprereq_version ${acfiles})
- [[ -z ${confversion} && -r "configure" ]] \
+ [ -z "${confversion}" ] && [ -r "configure" ] \
&& confversion=$(generated_version configure)
- if [[ ${confversion} == "2.1" && ! -f "configure.ac" ]] ; then
+ if [ "${confversion}" = "2.1" ] && [ ! -f "configure.ac" ] ; then
binary="${0}-2.13"
fi
esac
fi
-if [[ -n ${WANT_ACWRAPPER_DEBUG} ]] ; then
- if [[ -n ${WANT_AUTOCONF} ]] ; then
- echo "ac-wrapper: DEBUG: WANT_AUTOCONF is set to ${WANT_AUTOCONF}" >&2
+if [ -n "${WANT_ACWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOCONF}" ] ; then
+ warn "DEBUG: WANT_AUTOCONF is set to ${WANT_AUTOCONF}"
fi
- echo "ac-wrapper: DEBUG: will execute <${binary}>" >&2
+ warn "DEBUG: will execute <${binary}>"
fi
#
@@ -149,14 +148,12 @@ done
#
# Now try to run the binary
#
-if [[ ! -x ${binary} ]] ; then
+if [ ! -x "${binary}" ] ; then
# this shouldn't happen
- echo "ac-wrapper: ${binary} is missing or not executable." >&2
- echo " Please try emerging the correct version of autoconf." >&2
- exit 1
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try emerging the correct version of autoconf."
fi
exec "${binary}" "$@"
-echo "ac-wrapper: was unable to exec ${binary} !?" >&2
-exit 1
+err "ac-wrapper: was unable to exec ${binary} !?"