| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.58 2005/09/04 20:45:57 azarah Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.59 2005/09/05 22:23:10 azarah Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass patches ltmain.sh distributed with libtoolized packages with the |
7 | # This eclass patches ltmain.sh distributed with libtoolized packages with the |
| 8 | # relink and portage patch among others |
8 | # relink and portage patch among others |
| … | |
… | |
| 55 | else |
55 | else |
| 56 | ret=1 |
56 | ret=1 |
| 57 | fi |
57 | fi |
| 58 | |
58 | |
| 59 | return "${ret}" |
59 | return "${ret}" |
|
|
60 | } |
|
|
61 | |
|
|
62 | # |
|
|
63 | # Get string version of ltmain.sh or ltconfig (passed as $1) |
|
|
64 | # |
|
|
65 | ELT_libtool_version() { |
|
|
66 | local ltmain_sh=$1 |
|
|
67 | local version= |
|
|
68 | |
|
|
69 | version=$(eval $(grep -e '^[[:space:]]*VERSION=' "${ltmain_sh}"); \ |
|
|
70 | echo "${VERSION}") |
|
|
71 | [[ -z ${version} ]] && version="0" |
|
|
72 | |
|
|
73 | echo "${version}" |
| 60 | } |
74 | } |
| 61 | |
75 | |
| 62 | # |
76 | # |
| 63 | # Run through the patches in $2 and see if any |
77 | # Run through the patches in $2 and see if any |
| 64 | # apply to $1 ... |
78 | # apply to $1 ... |
| … | |
… | |
| 73 | local rem_int_dep=$3 |
87 | local rem_int_dep=$3 |
| 74 | local version= |
88 | local version= |
| 75 | local ltmain_sh=$1 |
89 | local ltmain_sh=$1 |
| 76 | |
90 | |
| 77 | [[ ${file} == *"/configure" ]] && ltmain_sh=${ELT_LTMAIN_SH} |
91 | [[ ${file} == *"/configure" ]] && ltmain_sh=${ELT_LTMAIN_SH} |
| 78 | version=$(eval $(grep -e '^[[:space:]]*VERSION=' "${ltmain_sh}"); \ |
92 | version=$(ELT_libtool_version "${ltmain_sh}") |
| 79 | echo "${VERSION}") |
|
|
| 80 | |
93 | |
| 81 | if [[ -n ${patch_set} ]] ; then |
94 | if [[ -n ${patch_set} ]] ; then |
| 82 | if [[ -d ${ELT_PATCH_DIR}/${patch_set} ]] ; then |
95 | if [[ -d ${ELT_PATCH_DIR}/${patch_set} ]] ; then |
| 83 | patch_dir="${ELT_PATCH_DIR}/${patch_set}" |
96 | patch_dir="${ELT_PATCH_DIR}/${patch_set}" |
| 84 | else |
97 | else |
| 85 | return "${ret}" |
98 | return "${ret}" |
| 86 | fi |
99 | fi |
| 87 | |
100 | |
| 88 | if [[ -z ${version} ]] ; then |
101 | if [[ ${version} == "0" ]] ; then |
| 89 | eerror "Could not get VERSION for ${file##*/}!" |
102 | eerror "Could not get VERSION for ${file##*/}!" |
| 90 | die "Could not get VERSION for ${file##*/}!" |
103 | die "Could not get VERSION for ${file##*/}!" |
| 91 | fi |
104 | fi |
| 92 | |
105 | |
| 93 | # Go through the patches in reverse order (large to small) |
106 | # Go through the patches in reverse order (large to small) |
| … | |
… | |
| 257 | esac |
270 | esac |
| 258 | |
271 | |
| 259 | if [[ ${ret} -ne 0 ]] ; then |
272 | if [[ ${ret} -ne 0 ]] ; then |
| 260 | case ${y} in |
273 | case ${y} in |
| 261 | "relink") |
274 | "relink") |
|
|
275 | local version=$(ELT_libtool_version "${x}/ltmain.sh") |
| 262 | # Critical patch, but could be applied ... |
276 | # Critical patch, but could be applied ... |
|
|
277 | # FIXME: Still need a patch for ltmain.sh > 1.4.0 |
| 263 | if [[ -z $(grep 'inst_prefix_dir' "${x}/ltmain.sh") ]] ; then |
278 | if [[ -z $(grep 'inst_prefix_dir' "${x}/ltmain.sh") && \ |
|
|
279 | $(VER_to_int "${version}") -ge $(VER_to_int "1.4.0") ]] ; then |
| 264 | ewarn " Could not apply relink.patch!" |
280 | ewarn " Could not apply relink.patch!" |
| 265 | fi |
281 | fi |
| 266 | ;; |
282 | ;; |
| 267 | "portage") |
283 | "portage") |
| 268 | # Critical patch - for this one we abort, as it can really |
284 | # Critical patch - for this one we abort, as it can really |