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

Diff of /eclass/libtool.eclass

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

Revision 1.52 Revision 1.53
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.52 2005/09/02 10:02:50 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.53 2005/09/02 21:12:09 azarah 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
20 20
21ELIBTOOL_VERSION="2.0.2" 21ELIBTOOL_VERSION="2.0.2"
22 22
23ELT_PATCH_DIR="${PORTDIR}/eclass/ELT-patches" 23ELT_PATCH_DIR="${PORTDIR}/eclass/ELT-patches"
24ELT_APPLIED_PATCHES= 24ELT_APPLIED_PATCHES=
25ELT_LTMAIN_SH=
25 26
26# 27#
27# Returns all the directories containing ltmain.sh 28# Returns all the directories containing ltmain.sh
28# 29#
29ELT_find_ltmain_sh() { 30ELT_find_ltmain_sh() {
64ELT_walk_patches() { 65ELT_walk_patches() {
65 local x= 66 local x=
66 local y= 67 local y=
67 local ret=1 68 local ret=1
68 local patch_dir= 69 local patch_dir=
70 local version=
71 local ltmain_sh=$1
72
73 [[ $1 == *"/configure" ]] && ltmain_sh=${ELT_LTMAIN_SH}
69 local version=$(eval $(grep -e '^[[:space:]]*VERSION=' $1); \ 74 version=$(eval $(grep -e '^[[:space:]]*VERSION=' "${ltmain_sh}"); \
70 echo "${VERSION}") 75 echo "${VERSION}")
71 76
72 if [[ -n $2 ]] ; then 77 if [[ -n $2 ]] ; then
73 if [[ -d ${ELT_PATCH_DIR}/$2 ]] ; then 78 if [[ -d ${ELT_PATCH_DIR}/$2 ]] ; then
74 patch_dir="${ELT_PATCH_DIR}/$2" 79 patch_dir="${ELT_PATCH_DIR}/$2"
116 local do_portage="no" 121 local do_portage="no"
117 local do_reversedeps="no" 122 local do_reversedeps="no"
118 local do_only_patches="no" 123 local do_only_patches="no"
119 local deptoremove= 124 local deptoremove=
120 local my_dirlist= 125 local my_dirlist=
121 local elt_patches="portage relink max_cmd_len sed test tmp" 126 local elt_patches="portage relink max_cmd_len sed test tmp \
127 uclibc-conf uclibc-ltconf"
122 local start_dir="${PWD}" 128 local start_dir="${PWD}"
123 129
124 my_dirlist="$(ELT_find_ltmain_sh)" 130 my_dirlist="$(ELT_find_ltmain_sh)"
125 131
126 for x in "$@" ; do 132 for x in "$@" ; do
174 fi 180 fi
175 181
176 for x in ${my_dirlist} ; do 182 for x in ${my_dirlist} ; do
177 local tmp=$(echo "${x}" | sed -e "s|${WORKDIR}||") 183 local tmp=$(echo "${x}" | sed -e "s|${WORKDIR}||")
178 export ELT_APPLIED_PATCHES= 184 export ELT_APPLIED_PATCHES=
185 export ELT_LTMAIN_SH="${x}/ltmain.sh"
179 186
180 [[ -f ${x}/.elibtoolized ]] && continue 187 [[ -f ${x}/.elibtoolized ]] && continue
181 188
182 cd ${x} 189 cd ${x}
183 einfo "Running elibtoolize in: $(echo "/${tmp}" | sed -e 's|//|/|g; s|^/||')" 190 einfo "Running elibtoolize in: $(echo "/${tmp}" | sed -e 's|//|/|g; s|^/||')"
199 ;; 206 ;;
200 "max_cmd_len") 207 "max_cmd_len")
201 # Do not apply if $max_cmd_len is not used ... 208 # Do not apply if $max_cmd_len is not used ...
202 if [[ -n $(grep 'max_cmd_len' "${x}/ltmain.sh") ]] ; then 209 if [[ -n $(grep 'max_cmd_len' "${x}/ltmain.sh") ]] ; then
203 ELT_walk_patches "${x}/ltmain.sh" "${y}" 210 ELT_walk_patches "${x}/ltmain.sh" "${y}"
211 ret=$?
212 fi
213 ;;
214 "uclibc-conf")
215 if [[ -e ${x}/configure ]] && \
216 grep 'Transform linux' "${x}/configure" > /dev/null ; then
217 ELT_walk_patches "${x}/configure" "${y}"
218 ret=$?
219 # ltmain.sh and co might be in a subdirectory ...
220 elif [[ ! -e ${x}/configure && -e ${x}/../configure ]] && \
221 grep 'Transform linux' "${x}/../configure" > /dev/null ; then
222 ELT_walk_patches "${x}/../configure" "${y}"
223 ret=$?
224 fi
225 ;;
226 "uclibc-ltconf")
227 if [[ -e ${x}/ltconfig ]] ; then
228 ELT_walk_patches "${x}/ltconfig" "${y}"
204 ret=$? 229 ret=$?
205 fi 230 fi
206 ;; 231 ;;
207 *) 232 *)
208 ELT_walk_patches "${x}/ltmain.sh" "${y}" 233 ELT_walk_patches "${x}/ltmain.sh" "${y}"
244 fi 269 fi
245 # We do not want to run libtoolize ... 270 # We do not want to run libtoolize ...
246 ELT_APPLIED_PATCHES="portage" 271 ELT_APPLIED_PATCHES="portage"
247 fi 272 fi
248 ;; 273 ;;
274 "uclibc-"*)
275 [[ ${CHOST} == *"-uclibc" ]] && \
276 ewarn " uClibc patch set '${y}' failed to apply!"
277 ;;
249 esac 278 esac
250 fi 279 fi
251 done 280 done
252 281
253 if [[ -z ${ELT_APPLIED_PATCHES} ]] ; then 282 if [[ -z ${ELT_APPLIED_PATCHES} ]] ; then
279 308
280 touch "${x}/.elibtoolized" 309 touch "${x}/.elibtoolized"
281 done 310 done
282 311
283 cd "${start_dir}" 312 cd "${start_dir}"
284
285 uclibctoolize
286} 313}
287 314
288uclibctoolize() { 315uclibctoolize() {
289 [[ -n ${NO_UCLIBCTOOLIZE} ]] && return 0 316 ewarn "uclibctoolize() is depreciated, please just use libtoolize()!"
290 317 elibtoolize
291 local errmsg=""
292 [[ ${CTARGET:-${CHOST}} == *-uclibc ]] \
293 && errmsg="PLEASE CHECK" \
294 || errmsg="Already patched"
295 local targets=""
296 local x
297
298 if [[ -z $* ]] ; then
299 targets=$(find ${S} -name configure -o -name ltconfig)
300 fi
301
302 einfo "Applying uClibc/libtool patches ..."
303 for x in ${targets} ; do
304 [[ ! -s ${x} ]] && continue
305 case ${x##*/} in
306 configure)
307 if grep 'Transform linux' "${x}" > /dev/null ; then
308 ebegin " Fixing \${S}${x/${S}}"
309 patch -p0 "${x}" "${ELT_PATCH_DIR}/uclibc/configure.patch" > /dev/null
310 eend $? "${errmsg} ${x}"
311 fi
312 ;;
313
314 ltconfig)
315 local ver=$(grep '^VERSION=' ${x})
316 ver=${ver/VERSION=}
317 [[ ${ver:0:3} == "1.4" ]] && ver="1.3" # 1.4 and 1.3 are compat
318 ebegin " Fixing \${S}${x/${S}}"
319 patch -p0 "${x}" "${ELT_PATCH_DIR}/uclibc/ltconfig-${ver:0:3}.patch" > /dev/null
320 eend $? "${errmsg} ${x}"
321 ;;
322 esac
323 done
324} 318}
325 319
326darwintoolize() { 320darwintoolize() {
327 local targets="" 321 local targets=""
328 local x 322 local x

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

  ViewVC Help
Powered by ViewVC 1.1.20