Move version retrieve stuff to ELT_libtool_version(). Do not warn on relink patch...
authorMartin Schlemmer <azarah@gentoo.org>
Mon, 5 Sep 2005 22:23:10 +0000 (22:23 +0000)
committerMartin Schlemmer <azarah@gentoo.org>
Mon, 5 Sep 2005 22:23:10 +0000 (22:23 +0000)
eclass/libtool.eclass

index 565406d0442af1b5170d2d7e40cccfeedb681d42..0db9542f6b9718df834428738641c7b08956ba98 100644 (file)
@@ -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 <azarah@gentoo.org>
 #
@@ -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
                                                ;;