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

Diff of /eclass/libtool.eclass

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

Revision 1.83 Revision 1.88
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.83 2009/05/03 20:03:10 loki_val Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.88 2010/05/11 04:45:48 vapier Exp $
4# 4#
5# Maintainer: base-system@gentoo.org 5# Maintainer: base-system@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
74# 74#
75# Run through the patches in $2 and see if any 75# Run through the patches in $2 and see if any
76# apply to $1 ... 76# apply to $1 ...
77# 77#
78ELT_walk_patches() { 78ELT_walk_patches() {
79 local x= 79 local patch
80 local y=
81 local ret=1 80 local ret=1
82 local file=$1 81 local file=$1
83 local patch_set=$2 82 local patch_set=$2
84 local patch_dir= 83 local patch_dir="${ELT_PATCH_DIR}/${patch_set}"
85 local rem_int_dep=$3 84 local rem_int_dep=$3
86 85
87 if [[ -n ${patch_set} ]] ; then 86 [[ -z ${patch_set} ]] && return 1
88 if [[ -d ${ELT_PATCH_DIR}/${patch_set} ]] ; then 87 [[ ! -d ${patch_dir} ]] && return 1
89 patch_dir="${ELT_PATCH_DIR}/${patch_set}" 88
90 else 89 pushd "${ELT_PATCH_DIR}" >/dev/null
91 return "${ret}" 90
91 # Go through the patches in reverse order (newer version to older)
92 for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do
93 # For --remove-internal-dep ...
94 if [[ -n ${rem_int_dep} ]] ; then
95 # For replace @REM_INT_DEP@ with what was passed
96 # to --remove-internal-dep
97 local tmp="${T}/$$.rem_int_deps.patch"
98 sed -e "s|@REM_INT_DEP@|${rem_int_dep}|g" "${patch}" > "${tmp}"
99 patch=${tmp}
92 fi 100 fi
93 101
94 # Go through the patches in reverse order (large to small)
95 for x in $(ls -d "${patch_dir}"/* 2> /dev/null | grep -v 'CVS' | sort -r) ; do
96 if [[ -n ${x} && -f ${x} ]] ; then
97 # For --remove-internal-dep ...
98 if [[ -n ${rem_int_dep} ]] ; then
99 # For replace @REM_INT_DEP@ with what was passed
100 # to --remove-internal-dep
101 sed -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ${x} > \
102 "${T}/$$.rem_int_deps.patch"
103
104 x="${T}/$$.rem_int_deps.patch"
105 fi
106
107 if ELT_try_and_apply_patch "${file}" "${x}" ; then 102 if ELT_try_and_apply_patch "${file}" "${patch}" ; then
103 # Break to unwind w/popd rather than return directly
108 ret=0 104 ret=0
109 break 105 break
110 fi
111 fi 106 fi
112 done 107 done
113 fi
114 108
109 popd >/dev/null
115 return "${ret}" 110 return ${ret}
116} 111}
117 112
118elibtoolize() { 113elibtoolize() {
119 local x= 114 local x=
120 local y= 115 local y=
172 done 167 done
173 168
174 [[ ${do_uclibc} == "yes" ]] && \ 169 [[ ${do_uclibc} == "yes" ]] && \
175 elt_patches="${elt_patches} uclibc-conf uclibc-ltconf" 170 elt_patches="${elt_patches} uclibc-conf uclibc-ltconf"
176 171
177 [[ ${CHOST} == *"-freebsd"* ]] && \ 172 case "${CHOST}" in
173 *-aix*)
174 elt_patches="${elt_patches} hardcode aixrtl"
175 ;;
176 *-darwin*)
177 elt_patches="${elt_patches} darwin-ltconf darwin-ltmain darwin-conf"
178 ;;
179 *-freebsd*)
178 elt_patches="${elt_patches} fbsd-conf fbsd-ltconf" 180 elt_patches="${elt_patches} fbsd-conf fbsd-ltconf"
179 181 ;;
180 [[ ${CHOST} == *"-darwin"* ]] && \ 182 *-hpux*)
183 elt_patches="${elt_patches} hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc"
184 ;;
185 *-irix*)
181 elt_patches="${elt_patches} darwin-ltconf darwin-ltmain" 186 elt_patches="${elt_patches} irix-ltmain"
187 ;;
188 *-mint*)
189 elt_patches="${elt_patches} mint-conf"
190 ;;
191 esac
182 192
183 for x in ${my_dirlist} ; do 193 for x in ${my_dirlist} ; do
184 local tmp=$(echo "${x}" | sed -e "s|${WORKDIR}||") 194 local tmp=$(echo "${x}" | sed -e "s|${WORKDIR}||")
185 export ELT_APPLIED_PATCHES= 195 export ELT_APPLIED_PATCHES=
186 export ELT_LTMAIN_SH="${x}/ltmain.sh" 196 export ELT_LTMAIN_SH="${x}/ltmain.sh"
258 if [[ -s ${x}/ltconfig ]] ; then 268 if [[ -s ${x}/ltconfig ]] ; then
259 ELT_walk_patches "${x}/ltconfig" "${y}" 269 ELT_walk_patches "${x}/ltconfig" "${y}"
260 ret=$? 270 ret=$?
261 fi 271 fi
262 ;; 272 ;;
273 "darwin-conf")
274 if [[ -e ${x}/configure && \
275 -n $(grep '&& echo \.so ||' "${x}/configure") ]] ; then
276 ELT_walk_patches "${x}/configure" "${y}"
277 ret=$?
278 # ltmain.sh and co might be in a subdirectory ...
279 elif [[ ! -e ${x}/configure && -e ${x}/../configure && \
280 -n $(grep '&& echo \.so ||' "${x}/../configure") ]] ; then
281 ELT_walk_patches "${x}/../configure" "${y}"
282 ret=$?
283 fi
284 ;;
263 "darwin-ltconf") 285 "darwin-ltconf")
264 # Newer libtoolize clears ltconfig, as not used anymore 286 # Newer libtoolize clears ltconfig, as not used anymore
265 if [[ -s ${x}/ltconfig ]] ; then 287 if [[ -s ${x}/ltconfig ]] ; then
266 ELT_walk_patches "${x}/ltconfig" "${y}" 288 ELT_walk_patches "${x}/ltconfig" "${y}"
267 ret=$? 289 ret=$?
290 fi
291 ;;
292 "darwin-ltmain")
293 # special case to avoid false positives (failing to apply
294 # ltmain.sh path message), newer libtools have this patch
295 # built in, so not much to patch around then
296 if [[ -e ${x}/ltmain.sh && \
297 -z $(grep 'verstring="-compatibility_version' "${x}/ltmain.sh") ]] ; then
298 ELT_walk_patches "${x}/ltmain.sh" "${y}"
299 ret=$?
300 fi
301 ;;
302 "aixrtl" | "hpux-conf")
303 ret=1
304 local subret=0
305 # apply multiple patches as often as they match
306 while [[ $subret -eq 0 ]]; do
307 subret=1
308 if [[ -e ${x}/configure ]]; then
309 ELT_walk_patches "${x}/configure" "${y}"
310 subret=$?
311 # ltmain.sh and co might be in a subdirectory ...
312 elif [[ ! -e ${x}/configure && -e ${x}/../configure ]] ; then
313 ELT_walk_patches "${x}/../configure" "${y}"
314 subret=$?
315 fi
316 if [[ $subret -eq 0 ]]; then
317 # have at least one patch succeeded.
318 ret=0
319 fi
320 done
321 ;;
322 "mint-conf")
323 ret=1
324 local subret=1
325 if [[ -e ${x}/configure ]]; then
326 ELT_walk_patches "${x}/configure" "${y}"
327 subret=$?
328 # ltmain.sh and co might be in a subdirectory ...
329 elif [[ ! -e ${x}/configure && -e ${x}/../configure ]] ; then
330 ELT_walk_patches "${x}/../configure" "${y}"
331 subret=$?
332 fi
333 if [[ $subret -eq 0 ]]; then
334 # have at least one patch succeeded.
335 ret=0
268 fi 336 fi
269 ;; 337 ;;
270 "install-sh") 338 "install-sh")
271 ELT_walk_patches "${x}/install-sh" "${y}" 339 ELT_walk_patches "${x}/install-sh" "${y}"
272 ret=$? 340 ret=$?
300 if [[ ${do_portage} == "yes" ]] ; then 368 if [[ ${do_portage} == "yes" ]] ; then
301 # Stupid test to see if its already applied ... 369 # Stupid test to see if its already applied ...
302 if [[ -z $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then 370 if [[ -z $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then
303 echo 371 echo
304 eerror "Portage patch requested, but failed to apply!" 372 eerror "Portage patch requested, but failed to apply!"
305 eerror "Please bug azarah or vapier to add proper patch." 373 eerror "Please file a bug report to add a proper patch."
306 die "Portage patch requested, but failed to apply!" 374 die "Portage patch requested, but failed to apply!"
307 fi 375 fi
308 else 376 else
309 if [[ -n $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then 377 if [[ -n $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then
310 # ewarn " Portage patch seems to be already applied." 378 # ewarn " Portage patch seems to be already applied."
315 eval $(grep -e '^[[:space:]]*VERSION=' "${x}/ltmain.sh"); \ 383 eval $(grep -e '^[[:space:]]*VERSION=' "${x}/ltmain.sh"); \
316 echo "${VERSION}") 384 echo "${VERSION}")
317 385
318 echo 386 echo
319 eerror "Portage patch failed to apply (ltmain.sh version ${version})!" 387 eerror "Portage patch failed to apply (ltmain.sh version ${version})!"
320 eerror "Please bug azarah or vapier to add proper patch." 388 eerror "Please file a bug report to add a proper patch."
321 die "Portage patch failed to apply!" 389 die "Portage patch failed to apply!"
322 fi 390 fi
323 # We do not want to run libtoolize ... 391 # We do not want to run libtoolize ...
324 ELT_APPLIED_PATCHES="portage" 392 ELT_APPLIED_PATCHES="portage"
325 fi 393 fi

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.88

  ViewVC Help
Powered by ViewVC 1.1.20