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

Diff of /eclass/libtool.eclass

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

Revision 1.94 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.94 2011/10/03 04:04:46 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
117 local do_reversedeps="no" 129 local do_reversedeps="no"
118 local do_only_patches="no" 130 local do_only_patches="no"
119 local do_uclibc="yes" 131 local do_uclibc="yes"
120 local deptoremove= 132 local deptoremove=
121 local do_shallow="no" 133 local do_shallow="no"
134 local force="false"
122 local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed" 135 local elt_patches="install-sh ltmain portage relink max_cmd_len sed test tmp cross as-needed"
123 136
124 for x in "$@" ; do 137 for x in "$@" ; do
125 case ${x} in 138 case ${x} in
126 --portage) 139 --portage)
151 do_shallow="yes" 164 do_shallow="yes"
152 ;; 165 ;;
153 --no-uclibc) 166 --no-uclibc)
154 do_uclibc="no" 167 do_uclibc="no"
155 ;; 168 ;;
169 --force)
170 force="true"
171 ;;
156 *) 172 *)
157 eerror "Invalid elibtoolize option: ${x}" 173 eerror "Invalid elibtoolize option: ${x}"
158 die "elibtoolize called with ${x} ??" 174 die "elibtoolize called with ${x} ??"
159 esac 175 esac
160 done 176 done
162 [[ ${do_uclibc} == "yes" ]] && elt_patches+=" uclibc-conf uclibc-ltconf" 178 [[ ${do_uclibc} == "yes" ]] && elt_patches+=" uclibc-conf uclibc-ltconf"
163 179
164 case ${CHOST} in 180 case ${CHOST} in
165 *-aix*) elt_patches+=" hardcode aixrtl aix-noundef" ;; #213277 181 *-aix*) elt_patches+=" hardcode aixrtl aix-noundef" ;; #213277
166 *-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" ;;
167 *-freebsd*) elt_patches+=" fbsd-conf fbsd-ltconf" ;; 184 *-freebsd*) elt_patches+=" fbsd-conf fbsd-ltconf" ;;
168 *-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" ;;
169 *-irix*) elt_patches+=" irix-ltmain" ;; 186 *-irix*) elt_patches+=" irix-ltmain" ;;
170 *-mint*) elt_patches+=" mint-conf" ;; 187 *-mint*) elt_patches+=" mint-conf" ;;
171 esac 188 esac
184 201
185 local d p 202 local d p
186 for d in "$@" ; do 203 for d in "$@" ; do
187 export ELT_APPLIED_PATCHES= 204 export ELT_APPLIED_PATCHES=
188 205
206 if [[ -f ${d}/.elibtoolized ]] ; then
207 ${force} || continue
208 fi
209
210 local outfunc="einfo"
189 [[ -f ${d}/.elibtoolized ]] && continue 211 [[ -f ${d}/.elibtoolized ]] && outfunc="ewarn"
190
191 einfo "Running elibtoolize in: ${d#${WORKDIR}/}/" 212 ${outfunc} "Running elibtoolize in: ${d#${WORKDIR}/}/"
213 if [[ ${outfunc} == "ewarn" ]] ; then
214 ewarn " We've already been run in this tree; you should"
215 ewarn " avoid this if possible (perhaps by filing a bug)"
216 fi
192 217
193 for p in ${elt_patches} ; do 218 for p in ${elt_patches} ; do
194 local ret=0 219 local ret=0
195 220
196 case ${p} in 221 case ${p} in
304 # have at least one patch succeeded. 329 # have at least one patch succeeded.
305 ret=0 330 ret=0
306 fi 331 fi
307 done 332 done
308 ;; 333 ;;
309 mint-conf|gold-conf) 334 mint-conf|gold-conf|sol2-conf)
310 ret=1 335 ret=1
311 local subret=1 336 local subret=1
312 if [[ -e ${d}/configure ]]; then 337 if [[ -e ${d}/configure ]]; then
313 ELT_walk_patches "${d}/configure" "${p}" 338 ELT_walk_patches "${d}/configure" "${p}"
314 subret=$? 339 subret=$?
474 fi 499 fi
475 500
476 echo 1 501 echo 1
477 return 1 502 return 1
478} 503}
504
505fi

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

  ViewVC Help
Powered by ViewVC 1.1.20