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

Diff of /eclass/libtool.eclass

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

Revision 1.35 Revision 1.41
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.35 2004/09/29 03:49:59 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.41 2004/11/22 14:55:57 vapier 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
51 local patch="$2" 51 local patch="$2"
52 52
53 # We only support patchlevel of 0 - why worry if its static patches? 53 # We only support patchlevel of 0 - why worry if its static patches?
54 if patch -p0 --dry-run $1 < ${patch} &>${T}/elibtool.log 54 if patch -p0 --dry-run $1 < ${patch} &>${T}/elibtool.log
55 then 55 then
56 einfo " Applying $(basename "$(dirname "${patch}")")-${patch##*/}.patch..." 56 einfo " Applying $(basename "$(dirname "${patch}")")-${patch##*/}.patch ..."
57 patch -p0 $1 < ${patch} &>${T}/elibtool.log 57 patch -p0 $1 < ${patch} &>${T}/elibtool.log
58 ret=$? 58 ret=$?
59 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${patch##*/}" 59 export ELT_APPLIED_PATCHES="${ELT_APPLIED_PATCHES} ${patch##*/}"
60 else 60 else
61 ret=1 61 ret=1
156 my_dirlist="${S}" 156 my_dirlist="${S}"
157 else 157 else
158 my_dirlist= 158 my_dirlist=
159 fi 159 fi
160 ;; 160 ;;
161 "--no-uclibc")
162 NO_UCLIBCTOOLIZE=1
163 ;;
161 esac 164 esac
162 done 165 done
166
167 if use ppc-macos ; then
168 glibtoolize --copy --force
169 darwintoolize
170 fi
163 171
164 for x in ${my_dirlist} 172 for x in ${my_dirlist}
165 do 173 do
166 local tmp="$(echo "${x}" | sed -e "s|${S}||")" 174 local tmp="$(echo "${x}" | sed -e "s|${S}||")"
167 export ELT_APPLIED_PATCHES= 175 export ELT_APPLIED_PATCHES=
168 176
169 cd ${x} 177 cd ${x}
170 einfo "Patching \${S}$(echo "/${tmp}/ltmain.sh" | sed -e 's|//|/|g')..." 178 einfo "Patching \${S}$(echo "/${tmp}/ltmain.sh" | sed -e 's|//|/|g') ..."
171 179
172 for y in ${elt_patches} 180 for y in ${elt_patches}
173 do 181 do
174 local ret=0 182 local ret=0
175 183
267 275
268 uclibctoolize 276 uclibctoolize
269} 277}
270 278
271uclibctoolize() { 279uclibctoolize() {
280 [ -n "${NO_UCLIBCTOOLIZE}" ] && return 0
281
282 local errmsg=""
283 [ "${PORTAGE_LIBC}" = "uClibc" ] \
284 && errmsg="PLEASE CHECK" \
285 || errmsg="Already patched"
272 local targets="" 286 local targets=""
273 local x 287 local x
274 288
275 if [ -z "$@" ] ; then 289 if [ -z "$@" ] ; then
276 targets="$(find ${S} -name configure -o -name ltconfig)" 290 targets="$(find ${S} -name configure -o -name ltconfig)"
282 case $(basename "${x}") in 296 case $(basename "${x}") in
283 configure) 297 configure)
284 if grep 'Transform linux' "${x}" >/dev/null ; then 298 if grep 'Transform linux' "${x}" >/dev/null ; then
285 ebegin " Fixing \${S}${x/${S}}" 299 ebegin " Fixing \${S}${x/${S}}"
286 patch -p0 "${x}" "${ELT_PATCH_DIR}/uclibc/configure.patch" > /dev/null 300 patch -p0 "${x}" "${ELT_PATCH_DIR}/uclibc/configure.patch" > /dev/null
287 eend $? "PLEASE CHECK ${x}" 301 eend $? "${errmsg} ${x}"
288 fi 302 fi
289 ;; 303 ;;
290 304
291 ltconfig) 305 ltconfig)
292 local ver="$(grep '^VERSION=' ${x})" 306 local ver="$(grep '^VERSION=' ${x})"
293 ver="${ver/VERSION=}" 307 ver="${ver/VERSION=}"
294 [ "${ver:0:3}" == "1.4" ] && ver="1.3" # 1.4 and 1.3 are compat 308 [ "${ver:0:3}" == "1.4" ] && ver="1.3" # 1.4 and 1.3 are compat
295 ebegin " Fixing \${S}${x/${S}}" 309 ebegin " Fixing \${S}${x/${S}}"
296 patch -p0 "${x}" "${ELT_PATCH_DIR}/uclibc/ltconfig-${ver:0:3}.patch" > /dev/null 310 patch -p0 "${x}" "${ELT_PATCH_DIR}/uclibc/ltconfig-${ver:0:3}.patch" > /dev/null
311 eend $? "${errmsg} ${x}"
312 ;;
313 esac
314 done
315}
316
317darwintoolize() {
318 local targets=""
319 local x
320
321 if [ -z "$@" ] ; then
322 targets="$(find ${S} -name ltmain.sh -o -name ltconfig)"
323 fi
324
325 einfo "Applying Darwin/libtool patches ..."
326 for x in ${targets} ; do
327 [ ! -s "${x}" ] && continue
328 case $(basename "${x}") in
329 ltmain.sh|ltconfig)
330 local ver="$(grep '^VERSION=' ${x})"
331 ver="${ver/VERSION=}"
332 if [ "${ver:0:3}" == "1.4" -o "${ver:0:3}" == "1.5" ];
333 then
334 ver="1.3" # 1.4, 1.5 and 1.3 are compat
335 fi
336
337 ebegin " Fixing \${S}${x/${S}}"
338 patch -p0 "${x}" "${ELT_PATCH_DIR}/darwin/$(basename "${x}")-${ver:0:3}.patch" > /dev/null
297 eend $? "PLEASE CHECK ${x}" 339 eend $? "PLEASE CHECK ${x}"
298 ;; 340 ;;
299 esac 341 esac
300 done 342 done
301} 343}

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20