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

Diff of /eclass/libtool.eclass

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

Revision 1.62 Revision 1.70
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.62 2005/12/07 22:50:05 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.70 2006/04/28 16:23:54 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
18 18
19DESCRIPTION="Based on the ${ECLASS} eclass" 19DESCRIPTION="Based on the ${ECLASS} eclass"
20 20
21ELIBTOOL_VERSION="2.0.2" 21ELIBTOOL_VERSION="2.0.2"
22 22
23ELT_PATCH_DIR="${PORTDIR}/eclass/ELT-patches" 23ELT_PATCH_DIR="${ECLASSDIR}/ELT-patches"
24ELT_APPLIED_PATCHES= 24ELT_APPLIED_PATCHES=
25ELT_LTMAIN_SH= 25ELT_LTMAIN_SH=
26 26
27# 27#
28# Returns all the directories containing ltmain.sh 28# Returns all the directories containing ltmain.sh
84 local ret=1 84 local ret=1
85 local file=$1 85 local file=$1
86 local patch_set=$2 86 local patch_set=$2
87 local patch_dir= 87 local patch_dir=
88 local rem_int_dep=$3 88 local rem_int_dep=$3
89 local version=
90 local ltmain_sh=$1
91
92 [[ ${file} == *"/configure" ]] && ltmain_sh=${ELT_LTMAIN_SH}
93 version=$(ELT_libtool_version "${ltmain_sh}")
94 89
95 if [[ -n ${patch_set} ]] ; then 90 if [[ -n ${patch_set} ]] ; then
96 if [[ -d ${ELT_PATCH_DIR}/${patch_set} ]] ; then 91 if [[ -d ${ELT_PATCH_DIR}/${patch_set} ]] ; then
97 patch_dir="${ELT_PATCH_DIR}/${patch_set}" 92 patch_dir="${ELT_PATCH_DIR}/${patch_set}"
98 else 93 else
99 return "${ret}" 94 return "${ret}"
100 fi 95 fi
101 96
102 if [[ ${version} == "0" ]] ; then
103 eerror "Could not get VERSION for ${file##*/}!"
104 die "Could not get VERSION for ${file##*/}!"
105 fi
106
107 # Go through the patches in reverse order (large to small) 97 # Go through the patches in reverse order (large to small)
108 for x in $(ls -d "${patch_dir}"/* 2> /dev/null | grep -v 'CVS' | sort -r) ; do 98 for x in $(ls -d "${patch_dir}"/* 2> /dev/null | grep -v 'CVS' | sort -r) ; do
109 if [[ -n ${x} && -f ${x} ]] ; then 99 if [[ -n ${x} && -f ${x} ]] ; then
110 local ltver=$(VER_to_int "${version}")
111 local ptver=$(VER_to_int "${x##*/}")
112
113 # If libtool version smaller than patch version, skip patch.
114 [[ ${ltver} -lt ${ptver} ]] && continue
115 # For --remove-internal-dep ... 100 # For --remove-internal-dep ...
116 if [[ -n ${rem_int_dep} ]] ; then 101 if [[ -n ${rem_int_dep} ]] ; then
117 # For replace @REM_INT_DEP@ with what was passed 102 # For replace @REM_INT_DEP@ with what was passed
118 # to --remove-internal-dep 103 # to --remove-internal-dep
119 sed -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ${x} > \ 104 sed -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ${x} > \
140 local do_reversedeps="no" 125 local do_reversedeps="no"
141 local do_only_patches="no" 126 local do_only_patches="no"
142 local do_uclibc="yes" 127 local do_uclibc="yes"
143 local deptoremove= 128 local deptoremove=
144 local my_dirlist= 129 local my_dirlist=
145 local elt_patches="portage relink max_cmd_len sed test tmp" 130 local elt_patches="portage relink max_cmd_len sed test tmp"# kde-fastinstall
146 local start_dir=${PWD} 131 local start_dir=${PWD}
147 132
148 my_dirlist=$(ELT_find_ltmain_sh) 133 my_dirlist=$(ELT_find_ltmain_sh)
149 134
150 for x in "$@" ; do 135 for x in "$@" ; do
191 176
192 [[ ${do_uclibc} == "yes" ]] && \ 177 [[ ${do_uclibc} == "yes" ]] && \
193 elt_patches="${elt_patches} uclibc-conf uclibc-ltconf" 178 elt_patches="${elt_patches} uclibc-conf uclibc-ltconf"
194 179
195 [[ ${CHOST} == *"-freebsd"* ]] && \ 180 [[ ${CHOST} == *"-freebsd"* ]] && \
196 elt_patches="${elt_patches} fbsd-conf" 181 elt_patches="${elt_patches} fbsd-conf fbsd-ltconf"
197 182
198 if useq ppc-macos ; then 183 if useq ppc-macos ; then
199 local opts 184 local opts
200 [[ -f Makefile.am ]] && opts="--automake" 185 [[ -f Makefile.am ]] && opts="--automake"
201 glibtoolize --copy --force ${opts} 186 glibtoolize --copy --force ${opts}
215 200
216 for y in ${elt_patches} ; do 201 for y in ${elt_patches} ; do
217 local ret=0 202 local ret=0
218 203
219 case "${y}" in 204 case "${y}" in
205 "portage")
206 # Stupid test to see if its already applied ...
207 if [[ -z $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then
208 ELT_walk_patches "${x}/ltmain.sh" "${y}"
209 ret=$?
210 fi
211 ;;
220 "rem-int-dep") 212 "rem-int-dep")
221 ELT_walk_patches "${x}/ltmain.sh" "${y}" "${deptoremove}" 213 ELT_walk_patches "${x}/ltmain.sh" "${y}" "${deptoremove}"
222 ret=$? 214 ret=$?
223 ;; 215 ;;
224 "fix-relink") 216 "fix-relink")
261 ret=$? 253 ret=$?
262 # ltmain.sh and co might be in a subdirectory ... 254 # ltmain.sh and co might be in a subdirectory ...
263 elif [[ ! -e ${x}/configure && -e ${x}/../configure && \ 255 elif [[ ! -e ${x}/configure && -e ${x}/../configure && \
264 -n $(grep 'version_type=freebsd-' "${x}/../configure") ]] ; then 256 -n $(grep 'version_type=freebsd-' "${x}/../configure") ]] ; then
265 ELT_walk_patches "${x}/../configure" "${y}" 257 ELT_walk_patches "${x}/../configure" "${y}"
258 ret=$?
259 fi
260 ;;
261 "fbsd-ltconf")
262 if [[ -s ${x}/ltconfig ]] ; then
263 ELT_walk_patches "${x}/ltconfig" "${y}"
266 ret=$? 264 ret=$?
267 fi 265 fi
268 ;; 266 ;;
269 "darwin-ltconf") 267 "darwin-ltconf")
270 # Newer libtoolize clears ltconfig, as not used anymore 268 # Newer libtoolize clears ltconfig, as not used anymore
296 if [[ ${do_portage} == "yes" ]] ; then 294 if [[ ${do_portage} == "yes" ]] ; then
297 # Stupid test to see if its already applied ... 295 # Stupid test to see if its already applied ...
298 if [[ -z $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then 296 if [[ -z $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then
299 echo 297 echo
300 eerror "Portage patch requested, but failed to apply!" 298 eerror "Portage patch requested, but failed to apply!"
299 eerror "Please bug azarah or vapier to add proper patch."
301 die "Portage patch requested, but failed to apply!" 300 die "Portage patch requested, but failed to apply!"
302 fi 301 fi
303 else 302 else
304 if [[ -n $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then 303 if [[ -n $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then
305 # ewarn " Portage patch seems to be already applied." 304 # ewarn " Portage patch seems to be already applied."
310 eval $(grep -e '^[[:space:]]*VERSION=' "${x}/ltmain.sh"); \ 309 eval $(grep -e '^[[:space:]]*VERSION=' "${x}/ltmain.sh"); \
311 echo "${VERSION}") 310 echo "${VERSION}")
312 311
313 echo 312 echo
314 eerror "Portage patch failed to apply (ltmain.sh version ${version})!" 313 eerror "Portage patch failed to apply (ltmain.sh version ${version})!"
314 eerror "Please bug azarah or vapier to add proper patch."
315 die "Portage patch failed to apply!" 315 die "Portage patch failed to apply!"
316 fi 316 fi
317 # We do not want to run libtoolize ... 317 # We do not want to run libtoolize ...
318 ELT_APPLIED_PATCHES="portage" 318 ELT_APPLIED_PATCHES="portage"
319 fi 319 fi
322 [[ ${CHOST} == *"-uclibc" ]] && \ 322 [[ ${CHOST} == *"-uclibc" ]] && \
323 ewarn " uClibc patch set '${y}' failed to apply!" 323 ewarn " uClibc patch set '${y}' failed to apply!"
324 ;; 324 ;;
325 "fbsd-"*) 325 "fbsd-"*)
326 if [[ ${CHOST} == *"-freebsd"* ]] ; then 326 if [[ ${CHOST} == *"-freebsd"* ]] ; then
327 if [[ -z $(grep 'Handle Gentoo/FreeBSD as it was Linux' "${x}/configure") ]]; then 327 if [[ -z $(grep 'Handle Gentoo/FreeBSD as it was Linux' \
328 "${x}/configure" "${x}/../configure" 2>/dev/null) ]]; then
328 eerror " FreeBSD patch set '${y}' failed to apply!" 329 eerror " FreeBSD patch set '${y}' failed to apply!"
329 die "FreeBSD patch set '${y}' failed to apply!" 330 die "FreeBSD patch set '${y}' failed to apply!"
330 fi 331 fi
331 fi 332 fi
332 ;; 333 ;;
333 "darwin-"*) 334 "darwin-"*)
334 useq ppc-macos && \ 335 useq ppc-macos && \
335 ewarn " Darwin patch set '${y}' failed to apply!" 336 ewarn " Darwin patch set '${y}' failed to apply!"
337 ;;
338 "kde-fastinstall")
339 if [[ -n $(grep 'test "$mode" != relink && test "$fast_install" = no' ${x}/ltmain.sh) ]]; then
340 ewarn "Patch ${y} failed to apply. If you experience build failures, please report this."
341 fi
336 ;; 342 ;;
337 esac 343 esac
338 fi 344 fi
339 done 345 done
340 346

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.70

  ViewVC Help
Powered by ViewVC 1.1.20