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

Diff of /eclass/libtool.eclass

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

Revision 1.106 Revision 1.107
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.106 2013/05/11 11:17:58 aballier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.107 2013/11/22 09:05:55 haubi 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
202 fi 202 fi
203 203
204 # Reuse "$@" for dirs to patch 204 # Reuse "$@" for dirs to patch
205 set -- 205 set --
206 if [[ ${do_shallow} == "yes" ]] ; then 206 if [[ ${do_shallow} == "yes" ]] ; then
207 [[ -f ${S}/ltmain.sh ]] && set -- "${S}" 207 [[ -f ${S}/ltmain.sh || -f ${S}/configure ]] && set -- "${S}"
208 else 208 else
209 set -- $(find "${S}" -name ltmain.sh -printf '%h ') 209 set -- $(find "${S}" '(' -name ltmain.sh -o -name configure ')' -printf '%h\n' | sort -u)
210 fi 210 fi
211 211
212 local d p 212 local d p
213 for d in "$@" ; do 213 for d in "$@" ; do
214 export ELT_APPLIED_PATCHES= 214 export ELT_APPLIED_PATCHES=
223 if [[ ${outfunc} == "ewarn" ]] ; then 223 if [[ ${outfunc} == "ewarn" ]] ; then
224 ewarn " We've already been run in this tree; you should" 224 ewarn " We've already been run in this tree; you should"
225 ewarn " avoid this if possible (perhaps by filing a bug)" 225 ewarn " avoid this if possible (perhaps by filing a bug)"
226 fi 226 fi
227 227
228 local ret
229
230 # patching ltmain.sh
231 [[ -f ${d}/ltmain.sh ]] &&
228 for p in ${elt_patches} ; do 232 for p in ${elt_patches} ; do
229 local ret=0 233 ret=0
230 234
231 case ${p} in 235 case ${p} in
232 portage) 236 portage)
233 # Stupid test to see if its already applied ... 237 # Stupid test to see if its already applied ...
234 if ! grep -qs 'We do not want portage' "${d}/ltmain.sh" ; then 238 if ! grep -qs 'We do not want portage' "${d}/ltmain.sh" ; then
256 ;; 260 ;;
257 as-needed) 261 as-needed)
258 ELT_walk_patches "${d}/ltmain.sh" "${p}" 262 ELT_walk_patches "${d}/ltmain.sh" "${p}"
259 ret=$? 263 ret=$?
260 ;; 264 ;;
261 uclibc-conf)
262 if grep -qs 'Transform linux' "${d}/configure" ; then
263 ELT_walk_patches "${d}/configure" "${p}"
264 ret=$?
265 # ltmain.sh and co might be in a subdirectory ...
266 elif [[ ! -e ${d}/configure ]] && \
267 grep -qs 'Transform linux' "${d}/../configure" ; then
268 ELT_walk_patches "${d}/../configure" "${p}"
269 ret=$?
270 fi
271 ;;
272 uclibc-ltconf) 265 uclibc-ltconf)
273 # Newer libtoolize clears ltconfig, as not used anymore 266 # Newer libtoolize clears ltconfig, as not used anymore
274 if [[ -s ${d}/ltconfig ]] ; then 267 if [[ -s ${d}/ltconfig ]] ; then
275 ELT_walk_patches "${d}/ltconfig" "${p}" 268 ELT_walk_patches "${d}/ltconfig" "${p}"
276 ret=$? 269 ret=$?
277 fi 270 fi
278 ;; 271 ;;
279 fbsd-conf)
280 if grep -qs 'version_type=freebsd-' "${d}/configure" ; then
281 ELT_walk_patches "${d}/configure" "${p}"
282 ret=$?
283 # ltmain.sh and co might be in a subdirectory ...
284 elif [[ ! -e ${d}/configure ]] && \
285 grep -qs 'version_type=freebsd-' "${d}/../configure" ; then
286 ELT_walk_patches "${d}/../configure" "${p}"
287 ret=$?
288 fi
289 ;;
290 fbsd-ltconf) 272 fbsd-ltconf)
291 if [[ -s ${d}/ltconfig ]] ; then 273 if [[ -s ${d}/ltconfig ]] ; then
292 ELT_walk_patches "${d}/ltconfig" "${p}" 274 ELT_walk_patches "${d}/ltconfig" "${p}"
293 ret=$?
294 fi
295 ;;
296 darwin-conf)
297 if grep -qs '&& echo \.so ||' "${d}/configure" ; then
298 ELT_walk_patches "${d}/configure" "${p}"
299 ret=$?
300 # ltmain.sh and co might be in a subdirectory ...
301 elif [[ ! -e ${d}/configure ]] && \
302 grep -qs '&& echo \.so ||' "${d}/../configure" ; then
303 ELT_walk_patches "${d}/../configure" "${p}"
304 ret=$? 275 ret=$?
305 fi 276 fi
306 ;; 277 ;;
307 darwin-ltconf) 278 darwin-ltconf)
308 # Newer libtoolize clears ltconfig, as not used anymore 279 # Newer libtoolize clears ltconfig, as not used anymore
318 if [[ -e ${d}/ltmain.sh ]] && \ 289 if [[ -e ${d}/ltmain.sh ]] && \
319 ! grep -qs 'verstring="-compatibility_version' "${d}/ltmain.sh" ; then 290 ! grep -qs 'verstring="-compatibility_version' "${d}/ltmain.sh" ; then
320 ELT_walk_patches "${d}/ltmain.sh" "${p}" 291 ELT_walk_patches "${d}/ltmain.sh" "${p}"
321 ret=$? 292 ret=$?
322 fi 293 fi
323 ;;
324 aixrtl|hpux-conf)
325 ret=1
326 local subret=0
327 # apply multiple patches as often as they match
328 while [[ $subret -eq 0 ]]; do
329 subret=1
330 if [[ -e ${d}/configure ]]; then
331 ELT_walk_patches "${d}/configure" "${p}"
332 subret=$?
333 # ltmain.sh and co might be in a subdirectory ...
334 elif [[ ! -e ${d}/configure && -e ${d}/../configure ]] ; then
335 ELT_walk_patches "${d}/../configure" "${p}"
336 subret=$?
337 fi
338 if [[ $subret -eq 0 ]]; then
339 # have at least one patch succeeded.
340 ret=0
341 fi
342 done
343 ;;
344 mint-conf|gold-conf|sol2-conf)
345 ret=1
346 local subret=1
347 if [[ -e ${d}/configure ]]; then
348 ELT_walk_patches "${d}/configure" "${p}"
349 subret=$?
350 # ltmain.sh and co might be in a subdirectory ...
351 elif [[ -e ${d}/../configure ]] ; then
352 ELT_walk_patches "${d}/../configure" "${p}"
353 subret=$?
354 elif [[ -e ${d}/../../configure ]] ; then
355 ELT_walk_patches "${d}/../../configure" "${p}"
356 subret=$?
357 fi
358 if [[ $subret -eq 0 ]]; then
359 # have at least one patch succeeded.
360 ret=0
361 fi
362 ;;
363 target-nm)
364 ELT_walk_patches "${d}/configure" "${p}"
365 ret=$?
366 ;; 294 ;;
367 install-sh) 295 install-sh)
368 ELT_walk_patches "${d}/install-sh" "${p}" 296 ELT_walk_patches "${d}/install-sh" "${p}"
369 ret=$? 297 ret=$?
370 ;; 298 ;;
419 fi 347 fi
420 ;; 348 ;;
421 uclibc-*) 349 uclibc-*)
422 [[ ${CHOST} == *-uclibc ]] && ewarn " uClibc patch set '${p}' failed to apply!" 350 [[ ${CHOST} == *-uclibc ]] && ewarn " uClibc patch set '${p}' failed to apply!"
423 ;; 351 ;;
424 fbsd-*)
425 if [[ ${CHOST} == *-freebsd* ]] ; then
426 if [[ -z $(grep 'Handle Gentoo/FreeBSD as it was Linux' \
427 "${d}/configure" "${d}/../configure" 2>/dev/null) ]]; then
428 eerror " FreeBSD patch set '${p}' failed to apply!"
429 die "FreeBSD patch set '${p}' failed to apply!"
430 fi
431 fi
432 ;;
433 darwin-*) 352 darwin-*)
434 [[ ${CHOST} == *"-darwin"* ]] && ewarn " Darwin patch set '${p}' failed to apply!" 353 [[ ${CHOST} == *"-darwin"* ]] && ewarn " Darwin patch set '${p}' failed to apply!"
435 ;; 354 ;;
436 esac 355 esac
437 fi 356 fi
438 done 357 done
439 358
359 # makes sense for ltmain.sh patches only
360 [[ -f ${d}/ltmain.sh ]] &&
440 if [[ -z ${ELT_APPLIED_PATCHES} ]] ; then 361 if [[ -z ${ELT_APPLIED_PATCHES} ]] ; then
441 if [[ ${do_portage} == "no" && \ 362 if [[ ${do_portage} == "no" && \
442 ${do_reversedeps} == "no" && \ 363 ${do_reversedeps} == "no" && \
443 ${do_only_patches} == "no" && \ 364 ${do_only_patches} == "no" && \
444 ${deptoremove} == "" ]] 365 ${deptoremove} == "" ]]
446 ewarn "Cannot apply any patches, please file a bug about this" 367 ewarn "Cannot apply any patches, please file a bug about this"
447 die 368 die
448 fi 369 fi
449 fi 370 fi
450 371
372 # patching configure
373 [[ -f ${d}/configure ]] &&
374 for p in ${elt_patches} ; do
375 ret=0
376
377 case ${p} in
378 uclibc-conf)
379 if grep -qs 'Transform linux' "${d}/configure" ; then
380 ELT_walk_patches "${d}/configure" "${p}"
381 ret=$?
382 fi
383 ;;
384 fbsd-conf)
385 if grep -qs 'version_type=freebsd-' "${d}/configure" ; then
386 ELT_walk_patches "${d}/configure" "${p}"
387 ret=$?
388 fi
389 ;;
390 darwin-conf)
391 if grep -qs '&& echo \.so ||' "${d}/configure" ; then
392 ELT_walk_patches "${d}/configure" "${p}"
393 ret=$?
394 fi
395 ;;
396 aixrtl|hpux-conf)
397 ret=1
398 local subret=0
399 # apply multiple patches as often as they match
400 while [[ $subret -eq 0 ]]; do
401 subret=1
402 if [[ -e ${d}/configure ]]; then
403 ELT_walk_patches "${d}/configure" "${p}"
404 subret=$?
405 fi
406 if [[ $subret -eq 0 ]]; then
407 # have at least one patch succeeded.
408 ret=0
409 fi
410 done
411 ;;
412 mint-conf|gold-conf|sol2-conf)
413 ELT_walk_patches "${d}/configure" "${p}"
414 ret=$?
415 ;;
416 target-nm)
417 ELT_walk_patches "${d}/configure" "${p}"
418 ret=$?
419 ;;
420 *)
421 # ltmain.sh patches are applied above
422 ;;
423 esac
424
425 if [[ ${ret} -ne 0 ]] ; then
426 case ${p} in
427 uclibc-*)
428 [[ ${CHOST} == *-uclibc ]] && ewarn " uClibc patch set '${p}' failed to apply!"
429 ;;
430 fbsd-*)
431 if [[ ${CHOST} == *-freebsd* ]] ; then
432 if [[ -z $(grep 'Handle Gentoo/FreeBSD as it was Linux' \
433 "${d}/configure" 2>/dev/null) ]]; then
434 eerror " FreeBSD patch set '${p}' failed to apply!"
435 die "FreeBSD patch set '${p}' failed to apply!"
436 fi
437 fi
438 ;;
439 darwin-*)
440 [[ ${CHOST} == *"-darwin"* ]] && ewarn " Darwin patch set '${p}' failed to apply!"
441 ;;
442 esac
443 fi
444 done
445
451 rm -f "${d}/libtool" 446 rm -f "${d}/libtool"
452 447
453 > "${d}/.elibtoolized" 448 > "${d}/.elibtoolized"
454 done 449 done
455} 450}

Legend:
Removed from v.1.106  
changed lines
  Added in v.1.107

  ViewVC Help
Powered by ViewVC 1.1.20