/[gentoo-x86]/eclass/libtool.eclass
Gentoo

Diff of /eclass/libtool.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.90 Revision 1.92
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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.90 2010/08/22 22:44:45 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.92 2011/06/10 10:14:21 flameeyes Exp $
4 4
5# @ECLASS: libtool.eclass 5# @ECLASS: libtool.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: quickly update bundled libtool code 8# @BLURB: quickly update bundled libtool code
26ELT_try_and_apply_patch() { 26ELT_try_and_apply_patch() {
27 local ret=0 27 local ret=0
28 local file=$1 28 local file=$1
29 local patch=$2 29 local patch=$2
30 30
31 echo -e "\nTrying $(basename "$(dirname "${patch}")")-${patch##*/}.patch on ${file}" \
32 &>> "${T}/elibtool.log"
33
31 # We only support patchlevel of 0 - why worry if its static patches? 34 # We only support patchlevel of 0 - why worry if its static patches?
32 if patch -p0 --dry-run "${file}" "${patch}" &> "${T}/elibtool.log" ; then 35 if patch -p0 --dry-run "${file}" "${patch}" &>> "${T}/elibtool.log" ; then
33 einfo " Applying $(basename "$(dirname "${patch}")")-${patch##*/}.patch ..." 36 einfo " Applying $(basename "$(dirname "${patch}")")-${patch##*/}.patch ..."
34 patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" \ 37 patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" \
35 &> "${T}/elibtool.log" 38 &>> "${T}/elibtool.log"
36 ret=$? 39 ret=$?
37 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${patch##*/}" 40 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${patch##*/}"
38 else 41 else
39 ret=1 42 ret=1
40 fi 43 fi
159 *-hpux*) elt_patches+=" hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc" ;; 162 *-hpux*) elt_patches+=" hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc" ;;
160 *-irix*) elt_patches+=" irix-ltmain" ;; 163 *-irix*) elt_patches+=" irix-ltmain" ;;
161 *-mint*) elt_patches+=" mint-conf" ;; 164 *-mint*) elt_patches+=" mint-conf" ;;
162 esac 165 esac
163 166
167 if $(tc-getLD) --version 2>&1 | grep -qs 'GNU gold'; then
168 elt_patches+=" gold-conf"
169 fi
170
164 # Reuse "$@" for dirs to patch 171 # Reuse "$@" for dirs to patch
165 set -- 172 set --
166 if [[ ${do_shallow} == "yes" ]] ; then 173 if [[ ${do_shallow} == "yes" ]] ; then
167 [[ -f ${S}/ltmain.sh ]] && set -- "${S}" 174 [[ -f ${S}/ltmain.sh ]] && set -- "${S}"
168 else 175 else
214 if grep -qs 'Transform linux' "${d}/configure" ; then 221 if grep -qs 'Transform linux' "${d}/configure" ; then
215 ELT_walk_patches "${d}/configure" "${p}" 222 ELT_walk_patches "${d}/configure" "${p}"
216 ret=$? 223 ret=$?
217 # ltmain.sh and co might be in a subdirectory ... 224 # ltmain.sh and co might be in a subdirectory ...
218 elif [[ ! -e ${d}/configure ]] && \ 225 elif [[ ! -e ${d}/configure ]] && \
219 grep -qs 'Transform linux' "${d}/../configure" ; then 226 grep -qs 'Transform linux' "${d}/../configure" ; then
220 ELT_walk_patches "${d}/../configure" "${p}" 227 ELT_walk_patches "${d}/../configure" "${p}"
221 ret=$? 228 ret=$?
222 fi 229 fi
223 ;; 230 ;;
224 uclibc-ltconf) 231 uclibc-ltconf)
232 if grep -qs 'version_type=freebsd-' "${d}/configure" ; then 239 if grep -qs 'version_type=freebsd-' "${d}/configure" ; then
233 ELT_walk_patches "${d}/configure" "${p}" 240 ELT_walk_patches "${d}/configure" "${p}"
234 ret=$? 241 ret=$?
235 # ltmain.sh and co might be in a subdirectory ... 242 # ltmain.sh and co might be in a subdirectory ...
236 elif [[ ! -e ${d}/configure ]] && \ 243 elif [[ ! -e ${d}/configure ]] && \
237 grep -qs 'version_type=freebsd-' "${d}/../configure" ; then 244 grep -qs 'version_type=freebsd-' "${d}/../configure" ; then
238 ELT_walk_patches "${d}/../configure" "${p}" 245 ELT_walk_patches "${d}/../configure" "${p}"
239 ret=$? 246 ret=$?
240 fi 247 fi
241 ;; 248 ;;
242 fbsd-ltconf) 249 fbsd-ltconf)
249 if grep -qs '&& echo \.so ||' "${d}/configure" ; then 256 if grep -qs '&& echo \.so ||' "${d}/configure" ; then
250 ELT_walk_patches "${d}/configure" "${p}" 257 ELT_walk_patches "${d}/configure" "${p}"
251 ret=$? 258 ret=$?
252 # ltmain.sh and co might be in a subdirectory ... 259 # ltmain.sh and co might be in a subdirectory ...
253 elif [[ ! -e ${d}/configure ]] && \ 260 elif [[ ! -e ${d}/configure ]] && \
254 grep -qs '&& echo \.so ||' "${d}/../configure" ; then 261 grep -qs '&& echo \.so ||' "${d}/../configure" ; then
255 ELT_walk_patches "${d}/../configure" "${p}" 262 ELT_walk_patches "${d}/../configure" "${p}"
256 ret=$? 263 ret=$?
257 fi 264 fi
258 ;; 265 ;;
259 darwin-ltconf) 266 darwin-ltconf)
291 # have at least one patch succeeded. 298 # have at least one patch succeeded.
292 ret=0 299 ret=0
293 fi 300 fi
294 done 301 done
295 ;; 302 ;;
296 mint-conf) 303 mint-conf|gold-conf)
297 ret=1 304 ret=1
298 local subret=1 305 local subret=1
299 if [[ -e ${d}/configure ]]; then 306 if [[ -e ${d}/configure ]]; then
300 ELT_walk_patches "${d}/configure" "${p}" 307 ELT_walk_patches "${d}/configure" "${p}"
301 subret=$? 308 subret=$?
302 # ltmain.sh and co might be in a subdirectory ... 309 # ltmain.sh and co might be in a subdirectory ...
303 elif [[ ! -e ${d}/configure && -e ${d}/../configure ]] ; then 310 elif [[ -e ${d}/../configure ]] ; then
304 ELT_walk_patches "${d}/../configure" "${p}" 311 ELT_walk_patches "${d}/../configure" "${p}"
312 subret=$?
313 elif [[ -e ${d}/../../configure ]] ; then
314 ELT_walk_patches "${d}/../../configure" "${p}"
305 subret=$? 315 subret=$?
306 fi 316 fi
307 if [[ $subret -eq 0 ]]; then 317 if [[ $subret -eq 0 ]]; then
308 # have at least one patch succeeded. 318 # have at least one patch succeeded.
309 ret=0 319 ret=0
351 if grep -qs 'We do not want portage' "${d}/ltmain.sh" ; then 361 if grep -qs 'We do not want portage' "${d}/ltmain.sh" ; then
352 # ewarn " Portage patch seems to be already applied." 362 # ewarn " Portage patch seems to be already applied."
353 # ewarn " Please verify that it is not needed." 363 # ewarn " Please verify that it is not needed."
354 : 364 :
355 else 365 else
356 local version=$(ELT_libtool_version "${d}"/ltmain.sh) 366 local version=$(ELT_libtool_version "${d}"/ltmain.sh)
357 echo 367 echo
358 eerror "Portage patch failed to apply (ltmain.sh version ${version})!" 368 eerror "Portage patch failed to apply (ltmain.sh version ${version})!"
359 eerror "Please file a bug report to add a proper patch." 369 eerror "Please file a bug report to add a proper patch."
360 die "Portage patch failed to apply!" 370 die "Portage patch failed to apply!"
361 fi 371 fi

Legend:
Removed from v.1.90  
changed lines
  Added in v.1.92

  ViewVC Help
Powered by ViewVC 1.1.20