diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2006-06-29 06:45:51 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2006-06-29 06:45:51 +0000 |
commit | 7a1256295e33c0d6d05124266bd8c23fab3c8973 (patch) | |
tree | e6606ae7785fec523837602a0a0afc0788ed2214 /sys-devel/autoconf-wrapper | |
parent | libpng dependency changed to <1.2.10 due to bug #137059 (diff) | |
download | gentoo-2-7a1256295e33c0d6d05124266bd8c23fab3c8973.tar.gz gentoo-2-7a1256295e33c0d6d05124266bd8c23fab3c8973.tar.bz2 gentoo-2-7a1256295e33c0d6d05124266bd8c23fab3c8973.zip |
Update wrapper to be more generic with different versions of autconf-2.59 or later.
(Portage version: 2.1.1_pre1-r5)
Diffstat (limited to 'sys-devel/autoconf-wrapper')
-rw-r--r-- | sys-devel/autoconf-wrapper/ChangeLog | 7 | ||||
-rwxr-xr-x | sys-devel/autoconf-wrapper/files/ac-wrapper-3.3.sh | 125 |
2 files changed, 131 insertions, 1 deletions
diff --git a/sys-devel/autoconf-wrapper/ChangeLog b/sys-devel/autoconf-wrapper/ChangeLog index 36c8dd43fc94..1594d56ed77a 100644 --- a/sys-devel/autoconf-wrapper/ChangeLog +++ b/sys-devel/autoconf-wrapper/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-devel/autoconf-wrapper # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/autoconf-wrapper/ChangeLog,v 1.32 2006/06/27 00:51:05 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/autoconf-wrapper/ChangeLog,v 1.33 2006/06/29 06:45:51 azarah Exp $ + + 29 Jun 2006; Martin Schlemmer <azarah@gentoo.org> + +files/ac-wrapper-3.3.sh: + Update wrapper to be more generic with different versions of autconf-2.59 or + later. *autoconf-wrapper-3.2-r2 (27 Jun 2006) diff --git a/sys-devel/autoconf-wrapper/files/ac-wrapper-3.3.sh b/sys-devel/autoconf-wrapper/files/ac-wrapper-3.3.sh new file mode 100755 index 000000000000..ad4ca4a069c5 --- /dev/null +++ b/sys-devel/autoconf-wrapper/files/ac-wrapper-3.3.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# Copyright 1999-2005 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-3.3.sh,v 1.1 2006/06/29 06:45:51 azarah Exp $ + +# Based on the ac-wrapper.pl script provided by MandrakeSoft +# Rewritten in bash by Gregorio Guidi +# +# Executes the correct autoconf version. +# +# - defaults to latest version (2.5x) +# - runs autoconf 2.13 only if: +# - envvar WANT_AUTOCONF is set to `2.1' +# -or- +# - `ac{local,include}.m4' or `configure.{in,ac}' have AC_PREREQ(2.1) (not higher) +# -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 +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 +fi + +if type -p autoconf-2.60 &>/dev/null ; then + binary_new="${0}-2.60" +elif type -p autoconf-2.59d &>/dev/null ; then + binary_new="${0}-2.59d" +else + binary_new="${0}-2.59" +fi +binary_old="${0}-2.13" +binary=${binary_new} + +acprereq_version() { + gawk \ + '($0 !~ /^[[:space:]]*(#|dnl)/) { + if (match($0, "AC_PREREQ\\(\\[?([0-9]\\.[0-9])", res)) + VERSIONS[COUNT++] = res[1] + } + + END { + asort(VERSIONS) + print VERSIONS[COUNT] + }' "$@" +} + +generated_version() { + gawk \ + '{ + if (match($0, + "^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9].[0-9])", + res)) { + print res[3] + exit + } + }' "$@" +} + +# +# autodetect routine +# +if [[ ${WANT_AUTOCONF} != "2.5" ]] ; then + if [[ ${WANT_AUTOCONF} == "2.1" ]] ; then + if [[ ! -f "configure.ac" ]] ; then + binary=${binary_old} + else + 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 + fi + else + # Automake-1.7 and better requie autoconf-2.5x + case "${WANT_AUTOMAKE}" in + 1.[7-9]) ;; + *) + acfiles=$(ls ac{local,include}.m4 configure.{in,ac} 2>/dev/null) + [[ -n ${acfiles} ]] && confversion=$(acprereq_version ${acfiles}) + + [[ -z ${confversion} && -r "configure" ]] && \ + confversion=$(generated_version configure) + + if [[ ${confversion} == "2.1" && ! -f "configure.ac" ]] ; then + binary="${binary_old}" + fi + esac + fi +fi + +if [[ -n ${WANT_ACWRAPPER_DEBUG} ]] ; then + if [[ -n ${WANT_AUTOCONF} ]] ; then + echo "ac-wrapper: DEBUG: WANT_AUTOCONF is set to ${WANT_AUTOCONF}" >&2 + fi + echo "ac-wrapper: DEBUG: will execute <${binary}>" >&2 +fi + +# +# for further consistency +# +if [[ ${binary} == "${binary_new}" ]] ; then + export WANT_AUTOCONF="2.5" +elif [[ ${binary} == "${binary_old}" ]] ; then + export WANT_AUTOCONF="2.1" +fi + +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 +fi + +exec "${binary}" "$@" + +echo "ac-wrapper: was unable to exec ${binary} !?" >&2 +exit 1 |