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

Diff of /eclass/libtool.eclass

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

Revision 1.97 Revision 1.105
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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.97 2011/12/13 21:28:15 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.105 2013/05/07 14:23:33 vapier 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
28 d="${ECLASSDIR_LOCAL}/ELT-patches" 28 d="${ECLASSDIR_LOCAL}/ELT-patches"
29 fi 29 fi
30 echo "${d}" 30 echo "${d}"
31} 31}
32 32
33DESCRIPTION="Based on the ${ECLASS} eclass"
34
35inherit multilib toolchain-funcs 33inherit multilib toolchain-funcs
36 34
37# 35#
38# See if we can apply $2 on $1, and if so, do it 36# See if we can apply $2 on $1, and if so, do it
39# 37#
49 __ELT_NOTED_TMP=true 47 __ELT_NOTED_TMP=true
50 printf 'temp patch: %s\n' "${patch}" > "${log}" 48 printf 'temp patch: %s\n' "${patch}" > "${log}"
51 fi 49 fi
52 printf '\nTrying %s\n' "${disp}" >> "${log}" 50 printf '\nTrying %s\n' "${disp}" >> "${log}"
53 51
52 if [[ ! -e ${file} ]] ; then
53 echo "File not found: ${file}" >> "${log}"
54 return 1
55 fi
56
57 # Save file for permission restoration. `patch` sometimes resets things.
58 cp -p "${file}" "${file}.gentoo.elt"
54 # We only support patchlevel of 0 - why worry if its static patches? 59 # We only support patchlevel of 0 - why worry if its static patches?
55 if patch -p0 --dry-run "${file}" "${patch}" >> "${log}" 2>&1 ; then 60 if patch -p0 --dry-run "${file}" "${patch}" >> "${log}" 2>&1 ; then
56 einfo " Applying ${disp} ..." 61 einfo " Applying ${disp} ..."
57 patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" >> "${log}" 2>&1 62 patch -p0 -g0 --no-backup-if-mismatch "${file}" "${patch}" >> "${log}" 2>&1
58 ret=$? 63 ret=$?
59 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${src}" 64 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${src}"
60 else 65 else
61 ret=1 66 ret=1
62 fi 67 fi
68 chmod --reference="${file}.gentoo.elt" "${file}"
69 rm -f "${file}.gentoo.elt"
63 70
64 return "${ret}" 71 return "${ret}"
65} 72}
66 73
67# 74#
132 local do_only_patches="no" 139 local do_only_patches="no"
133 local do_uclibc="yes" 140 local do_uclibc="yes"
134 local deptoremove= 141 local deptoremove=
135 local do_shallow="no" 142 local do_shallow="no"
136 local force="false" 143 local force="false"
137 local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed" 144 local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed target-nm"
138 145
139 for x in "$@" ; do 146 for x in "$@" ; do
140 case ${x} in 147 case ${x} in
141 --portage) 148 --portage)
142 # Only apply portage patch, and don't 149 # Only apply portage patch, and don't
180 [[ ${do_uclibc} == "yes" ]] && elt_patches+=" uclibc-conf uclibc-ltconf" 187 [[ ${do_uclibc} == "yes" ]] && elt_patches+=" uclibc-conf uclibc-ltconf"
181 188
182 case ${CHOST} in 189 case ${CHOST} in
183 *-aix*) elt_patches+=" hardcode aixrtl aix-noundef" ;; #213277 190 *-aix*) elt_patches+=" hardcode aixrtl aix-noundef" ;; #213277
184 *-darwin*) elt_patches+=" darwin-ltconf darwin-ltmain darwin-conf" ;; 191 *-darwin*) elt_patches+=" darwin-ltconf darwin-ltmain darwin-conf" ;;
192 *-solaris*) elt_patches+=" sol2-conf sol2-ltmain" ;;
185 *-freebsd*) elt_patches+=" fbsd-conf fbsd-ltconf" ;; 193 *-freebsd*) elt_patches+=" fbsd-conf fbsd-ltconf" ;;
186 *-hpux*) elt_patches+=" hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc" ;; 194 *-hpux*) elt_patches+=" hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc" ;;
187 *-irix*) elt_patches+=" irix-ltmain" ;; 195 *-irix*) elt_patches+=" irix-ltmain" ;;
188 *-mint*) elt_patches+=" mint-conf" ;; 196 *-mint*) elt_patches+=" mint-conf" ;;
189 esac 197 esac
206 214
207 if [[ -f ${d}/.elibtoolized ]] ; then 215 if [[ -f ${d}/.elibtoolized ]] ; then
208 ${force} || continue 216 ${force} || continue
209 fi 217 fi
210 218
219 local outfunc="einfo"
220 [[ -f ${d}/.elibtoolized ]] && outfunc="ewarn"
211 einfo "Running elibtoolize in: ${d#${WORKDIR}/}/" 221 ${outfunc} "Running elibtoolize in: ${d#${WORKDIR}/}/"
212 if [[ -f ${d}/.elibtoolized ]] ; then 222 if [[ ${outfunc} == "ewarn" ]] ; then
213 ewarn " We've already been run in this tree; you should" 223 ewarn " We've already been run in this tree; you should"
214 ewarn " avoid this if possible (perhaps by filing a bug)" 224 ewarn " avoid this if possible (perhaps by filing a bug)"
215 fi 225 fi
216 226
217 for p in ${elt_patches} ; do 227 for p in ${elt_patches} ; do
328 # have at least one patch succeeded. 338 # have at least one patch succeeded.
329 ret=0 339 ret=0
330 fi 340 fi
331 done 341 done
332 ;; 342 ;;
333 mint-conf|gold-conf) 343 mint-conf|gold-conf|sol2-conf)
334 ret=1 344 ret=1
335 local subret=1 345 local subret=1
336 if [[ -e ${d}/configure ]]; then 346 if [[ -e ${d}/configure ]]; then
337 ELT_walk_patches "${d}/configure" "${p}" 347 ELT_walk_patches "${d}/configure" "${p}"
338 subret=$? 348 subret=$?
346 fi 356 fi
347 if [[ $subret -eq 0 ]]; then 357 if [[ $subret -eq 0 ]]; then
348 # have at least one patch succeeded. 358 # have at least one patch succeeded.
349 ret=0 359 ret=0
350 fi 360 fi
361 ;;
362 target-nm)
363 ELT_walk_patches "${d}/configure" "${p}"
364 ret=$?
351 ;; 365 ;;
352 install-sh) 366 install-sh)
353 ELT_walk_patches "${d}/install-sh" "${p}" 367 ELT_walk_patches "${d}/install-sh" "${p}"
354 ret=$? 368 ret=$?
355 ;; 369 ;;

Legend:
Removed from v.1.97  
changed lines
  Added in v.1.105

  ViewVC Help
Powered by ViewVC 1.1.20