From 2ed428b766b41916260ff3c52dde25f69ca446e5 Mon Sep 17 00:00:00 2001 From: Martin Schlemmer Date: Mon, 5 Sep 2005 22:23:10 +0000 Subject: [PATCH] Move version retrieve stuff to ELT_libtool_version(). Do not warn on relink patch for libtool < 1.4.0. --- eclass/libtool.eclass | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass index 565406d0442a..0db9542f6b97 100644 --- a/eclass/libtool.eclass +++ b/eclass/libtool.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.58 2005/09/04 20:45:57 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.59 2005/09/05 22:23:10 azarah Exp $ # # Author: Martin Schlemmer # @@ -59,6 +59,20 @@ ELT_try_and_apply_patch() { return "${ret}" } +# +# Get string version of ltmain.sh or ltconfig (passed as $1) +# +ELT_libtool_version() { + local ltmain_sh=$1 + local version= + + version=$(eval $(grep -e '^[[:space:]]*VERSION=' "${ltmain_sh}"); \ + echo "${VERSION}") + [[ -z ${version} ]] && version="0" + + echo "${version}" +} + # # Run through the patches in $2 and see if any # apply to $1 ... @@ -75,8 +89,7 @@ ELT_walk_patches() { local ltmain_sh=$1 [[ ${file} == *"/configure" ]] && ltmain_sh=${ELT_LTMAIN_SH} - version=$(eval $(grep -e '^[[:space:]]*VERSION=' "${ltmain_sh}"); \ - echo "${VERSION}") + version=$(ELT_libtool_version "${ltmain_sh}") if [[ -n ${patch_set} ]] ; then if [[ -d ${ELT_PATCH_DIR}/${patch_set} ]] ; then @@ -85,7 +98,7 @@ ELT_walk_patches() { return "${ret}" fi - if [[ -z ${version} ]] ; then + if [[ ${version} == "0" ]] ; then eerror "Could not get VERSION for ${file##*/}!" die "Could not get VERSION for ${file##*/}!" fi @@ -259,8 +272,11 @@ elibtoolize() { if [[ ${ret} -ne 0 ]] ; then case ${y} in "relink") + local version=$(ELT_libtool_version "${x}/ltmain.sh") # Critical patch, but could be applied ... - if [[ -z $(grep 'inst_prefix_dir' "${x}/ltmain.sh") ]] ; then + # FIXME: Still need a patch for ltmain.sh > 1.4.0 + if [[ -z $(grep 'inst_prefix_dir' "${x}/ltmain.sh") && \ + $(VER_to_int "${version}") -ge $(VER_to_int "1.4.0") ]] ; then ewarn " Could not apply relink.patch!" fi ;; -- 2.26.2