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

Diff of /eclass/libtool.eclass

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

Revision 1.59 Revision 1.61
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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.59 2005/09/05 22:23:10 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.61 2005/10/09 13:01:41 flameeyes Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@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
192 elt_patches="${elt_patches} uclibc-conf uclibc-ltconf" 192 elt_patches="${elt_patches} uclibc-conf uclibc-ltconf"
193 193
194 [[ ${CHOST} == *"-freebsd"* ]] && \ 194 [[ ${CHOST} == *"-freebsd"* ]] && \
195 elt_patches="${elt_patches} fbsd-conf" 195 elt_patches="${elt_patches} fbsd-conf"
196 196
197 if use ppc-macos ; then 197 if useq ppc-macos ; then
198 local opts 198 local opts
199 [[ -f Makefile.am ]] && opts="--automake" 199 [[ -f Makefile.am ]] && opts="--automake"
200 glibtoolize --copy --force ${opts} 200 glibtoolize --copy --force ${opts}
201 darwintoolize 201
202 elt_patches="${elt_patches} darwin-ltconf darwin-ltmain"
202 fi 203 fi
203 204
204 for x in ${my_dirlist} ; do 205 for x in ${my_dirlist} ; do
205 local tmp=$(echo "${x}" | sed -e "s|${WORKDIR}||") 206 local tmp=$(echo "${x}" | sed -e "s|${WORKDIR}||")
206 export ELT_APPLIED_PATCHES= 207 export ELT_APPLIED_PATCHES=
244 ELT_walk_patches "${x}/../configure" "${y}" 245 ELT_walk_patches "${x}/../configure" "${y}"
245 ret=$? 246 ret=$?
246 fi 247 fi
247 ;; 248 ;;
248 "uclibc-ltconf") 249 "uclibc-ltconf")
250 # Newer libtoolize clears ltconfig, as not used anymore
249 if [[ -e ${x}/ltconfig ]] ; then 251 if [[ -s ${x}/ltconfig ]] ; then
250 ELT_walk_patches "${x}/ltconfig" "${y}" 252 ELT_walk_patches "${x}/ltconfig" "${y}"
251 ret=$? 253 ret=$?
252 fi 254 fi
253 ;; 255 ;;
254 "fbsd-conf") 256 "fbsd-conf")
258 ret=$? 260 ret=$?
259 # ltmain.sh and co might be in a subdirectory ... 261 # ltmain.sh and co might be in a subdirectory ...
260 elif [[ ! -e ${x}/configure && -e ${x}/../configure && \ 262 elif [[ ! -e ${x}/configure && -e ${x}/../configure && \
261 -n $(grep 'version_type=freebsd-' "${x}/../configure") ]] ; then 263 -n $(grep 'version_type=freebsd-' "${x}/../configure") ]] ; then
262 ELT_walk_patches "${x}/../configure" "${y}" 264 ELT_walk_patches "${x}/../configure" "${y}"
265 ret=$?
266 fi
267 ;;
268 "darwin-ltconf")
269 # Newer libtoolize clears ltconfig, as not used anymore
270 if [[ -s ${x}/ltconfig ]] ; then
271 ELT_walk_patches "${x}/ltconfig" "${y}"
263 ret=$? 272 ret=$?
264 fi 273 fi
265 ;; 274 ;;
266 *) 275 *)
267 ELT_walk_patches "${x}/ltmain.sh" "${y}" 276 ELT_walk_patches "${x}/ltmain.sh" "${y}"
311 "uclibc-"*) 320 "uclibc-"*)
312 [[ ${CHOST} == *"-uclibc" ]] && \ 321 [[ ${CHOST} == *"-uclibc" ]] && \
313 ewarn " uClibc patch set '${y}' failed to apply!" 322 ewarn " uClibc patch set '${y}' failed to apply!"
314 ;; 323 ;;
315 "fbsd-"*) 324 "fbsd-"*)
316 [[ ${CHOST} == *"-freebsd"* ]] && \ 325 if [[ ${CHOST} == *"-freebsd"* ]] ; then
326 if [[ -z $(grep 'Handle Gentoo/FreeBSD as it was Linux' "${x}/configure") ]]; then
317 eerror " FreeBSD patch set '${y}' failed to apply!" 327 eerror " FreeBSD patch set '${y}' failed to apply!"
318 die "FreeBSD patch set '${y}' failed to apply!" 328 die "FreeBSD patch set '${y}' failed to apply!"
329 fi
330 fi
331 ;;
332 "darwin-"*)
333 useq ppc-macos && \
334 ewarn " Darwin patch set '${y}' failed to apply!"
319 ;; 335 ;;
320 esac 336 esac
321 fi 337 fi
322 done 338 done
323 339
353 369
354 cd "${start_dir}" 370 cd "${start_dir}"
355} 371}
356 372
357uclibctoolize() { 373uclibctoolize() {
358 ewarn "uclibctoolize() is depreciated, please just use libtoolize()!" 374 ewarn "uclibctoolize() is depreciated, please just use elibtoolize()!"
359 elibtoolize 375 elibtoolize
360} 376}
361 377
362darwintoolize() { 378darwintoolize() {
363 local targets="" 379 ewarn "darwintoolize() is depreciated, please just use elibtoolize()!"
364 local x 380 elibtoolize
365
366 if [[ -z $* ]] ; then
367 targets=$(find ${S} -name ltmain.sh -o -name ltconfig)
368 fi
369
370 einfo "Applying Darwin/libtool patches ..."
371 for x in ${targets} ; do
372 [[ ! -s ${x} ]] && continue
373 case ${x##*/} in
374 ltmain.sh|ltconfig)
375 local ver=$(grep '^VERSION=' ${x})
376 ver=${ver/VERSION=}
377 if [[ ${ver:0:3} == "1.4" || ${ver:0:3} == "1.5" ]] ; then
378 ver="1.3" # 1.4, 1.5 and 1.3 are compat
379 fi
380
381 ebegin " Fixing \${S}${x/${S}}"
382 patch -p0 "${x}" "${ELT_PATCH_DIR}/darwin/${x##*/}-${ver:0:3}.patch" > /dev/null
383 eend $? "PLEASE CHECK ${x}"
384 ;;
385 esac
386 done
387} 381}
388 382
389# char *VER_major(string) 383# char *VER_major(string)
390# 384#
391# Return the Major (X of X.Y.Z) version 385# Return the Major (X of X.Y.Z) version

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.61

  ViewVC Help
Powered by ViewVC 1.1.20