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

Diff of /eclass/libtool.eclass

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

Revision 1.95 Revision 1.102
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.95 2011/11/14 17:08:49 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.102 2012/09/15 16:16:53 zmedico 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
12# 12#
13# Note, this eclass does not require libtool as it only applies patches to 13# Note, this eclass does not require libtool as it only applies patches to
14# generated libtool files. We do not run the libtoolize program because that 14# generated libtool files. We do not run the libtoolize program because that
15# requires a regeneration of the main autotool files in order to work properly. 15# requires a regeneration of the main autotool files in order to work properly.
16 16
17DESCRIPTION="Based on the ${ECLASS} eclass" 17if [[ ${___ECLASS_ONCE_LIBTOOL} != "recur -_+^+_- spank" ]] ; then
18___ECLASS_ONCE_LIBTOOL="recur -_+^+_- spank"
19
20# If an overlay has eclass overrides, but doesn't actually override the
21# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's
22# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So
23# add a check to locate the ELT-patches/ regardless of what's going on.
24ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*}
25elt_patch_dir() {
26 local d="${ECLASSDIR}/ELT-patches"
27 if [[ ! -d ${d} ]] ; then
28 d="${ECLASSDIR_LOCAL}/ELT-patches"
29 fi
30 echo "${d}"
31}
18 32
19inherit multilib toolchain-funcs 33inherit multilib toolchain-funcs
20
21ELT_PATCH_DIR="${ECLASSDIR}/ELT-patches"
22 34
23# 35#
24# 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
25# 37#
26ELT_try_and_apply_patch() { 38ELT_try_and_apply_patch() {
68ELT_walk_patches() { 80ELT_walk_patches() {
69 local patch tmp 81 local patch tmp
70 local ret=1 82 local ret=1
71 local file=$1 83 local file=$1
72 local patch_set=$2 84 local patch_set=$2
73 local patch_dir="${ELT_PATCH_DIR}/${patch_set}" 85 local patch_dir="$(elt_patch_dir)/${patch_set}"
74 local rem_int_dep=$3 86 local rem_int_dep=$3
75 87
76 [[ -z ${patch_set} ]] && return 1 88 [[ -z ${patch_set} ]] && return 1
77 [[ ! -d ${patch_dir} ]] && return 1 89 [[ ! -d ${patch_dir} ]] && return 1
78 90
82 # replace @REM_INT_DEP@ with what was passed 94 # replace @REM_INT_DEP@ with what was passed
83 # to --remove-internal-dep 95 # to --remove-internal-dep
84 sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ) 96 sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" )
85 fi 97 fi
86 98
87 pushd "${ELT_PATCH_DIR}" >/dev/null || die 99 pushd "$(elt_patch_dir)" >/dev/null || die
88 100
89 # Go through the patches in reverse order (newer version to older) 101 # Go through the patches in reverse order (newer version to older)
90 for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do 102 for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do
91 tmp="${T}/libtool-elt.patch" 103 tmp="${T}/libtool-elt.patch"
92 sed "${sed_args[@]}" "${patch}" > "${tmp}" || die 104 sed "${sed_args[@]}" "${patch}" > "${tmp}" || die
166 [[ ${do_uclibc} == "yes" ]] && elt_patches+=" uclibc-conf uclibc-ltconf" 178 [[ ${do_uclibc} == "yes" ]] && elt_patches+=" uclibc-conf uclibc-ltconf"
167 179
168 case ${CHOST} in 180 case ${CHOST} in
169 *-aix*) elt_patches+=" hardcode aixrtl aix-noundef" ;; #213277 181 *-aix*) elt_patches+=" hardcode aixrtl aix-noundef" ;; #213277
170 *-darwin*) elt_patches+=" darwin-ltconf darwin-ltmain darwin-conf" ;; 182 *-darwin*) elt_patches+=" darwin-ltconf darwin-ltmain darwin-conf" ;;
183 *-solaris*) elt_patches+=" sol2-conf sol2-ltmain" ;;
171 *-freebsd*) elt_patches+=" fbsd-conf fbsd-ltconf" ;; 184 *-freebsd*) elt_patches+=" fbsd-conf fbsd-ltconf" ;;
172 *-hpux*) elt_patches+=" hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc" ;; 185 *-hpux*) elt_patches+=" hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc" ;;
173 *-irix*) elt_patches+=" irix-ltmain" ;; 186 *-irix*) elt_patches+=" irix-ltmain" ;;
174 *-mint*) elt_patches+=" mint-conf" ;; 187 *-mint*) elt_patches+=" mint-conf" ;;
175 esac 188 esac
192 205
193 if [[ -f ${d}/.elibtoolized ]] ; then 206 if [[ -f ${d}/.elibtoolized ]] ; then
194 ${force} || continue 207 ${force} || continue
195 fi 208 fi
196 209
210 local outfunc="einfo"
211 [[ -f ${d}/.elibtoolized ]] && outfunc="ewarn"
197 einfo "Running elibtoolize in: ${d#${WORKDIR}/}/" 212 ${outfunc} "Running elibtoolize in: ${d#${WORKDIR}/}/"
198 if [[ -f ${d}/.elibtoolized ]] ; then 213 if [[ ${outfunc} == "ewarn" ]] ; then
199 ewarn " We've already been run in this tree; you should" 214 ewarn " We've already been run in this tree; you should"
200 ewarn " avoid this if possible (perhaps by filing a bug)" 215 ewarn " avoid this if possible (perhaps by filing a bug)"
201 fi 216 fi
202 217
203 for p in ${elt_patches} ; do 218 for p in ${elt_patches} ; do
314 # have at least one patch succeeded. 329 # have at least one patch succeeded.
315 ret=0 330 ret=0
316 fi 331 fi
317 done 332 done
318 ;; 333 ;;
319 mint-conf|gold-conf) 334 mint-conf|gold-conf|sol2-conf)
320 ret=1 335 ret=1
321 local subret=1 336 local subret=1
322 if [[ -e ${d}/configure ]]; then 337 if [[ -e ${d}/configure ]]; then
323 ELT_walk_patches "${d}/configure" "${p}" 338 ELT_walk_patches "${d}/configure" "${p}"
324 subret=$? 339 subret=$?
484 fi 499 fi
485 500
486 echo 1 501 echo 1
487 return 1 502 return 1
488} 503}
504
505fi

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.102

  ViewVC Help
Powered by ViewVC 1.1.20