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

Diff of /eclass/libtool.eclass

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

Revision 1.45 Revision 1.51
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.45 2005/05/11 11:10:31 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.51 2005/09/02 09:35:17 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
9 9
10ECLASS="libtool"
11INHERITED="${INHERITED} ${ECLASS}"
12 10
13# 2004.09.25 rac 11# 2004.09.25 rac
14# i have verified that at least one package can use this eclass and 12# i have verified that at least one package can use this eclass and
15# build properly even without libtool installed yet, probably using 13# build properly even without libtool installed yet, probably using
16# the files in the distribution. eliminating this dependency fixes 14# the files in the distribution. eliminating this dependency fixes
86 # Go through the patches in reverse order (large to small) 84 # Go through the patches in reverse order (large to small)
87 for x in $(ls -d "${patch_dir}"/* 2> /dev/null | sort -r) ; do 85 for x in $(ls -d "${patch_dir}"/* 2> /dev/null | sort -r) ; do
88 if [[ -n ${x} && -f ${x} ]] ; then 86 if [[ -n ${x} && -f ${x} ]] ; then
89 local ltver=$(VER_to_int "${version}") 87 local ltver=$(VER_to_int "${version}")
90 local ptver=$(VER_to_int "${x##*/}") 88 local ptver=$(VER_to_int "${x##*/}")
91 89
92 # If libtool version smaller than patch version, skip patch. 90 # If libtool version smaller than patch version, skip patch.
93 [[ ${ltver} -lt ${ptver} ]] && continue 91 [[ ${ltver} -lt ${ptver} ]] && continue
94 # For --remove-internal-dep ... 92 # For --remove-internal-dep ...
95 if [[ -n $3 ]] ; then 93 if [[ -n $3 ]] ; then
96 # For replace @REM_INT_DEP@ with what was passed 94 # For replace @REM_INT_DEP@ with what was passed
167 die "elibtoolize called with $x ??" 165 die "elibtoolize called with $x ??"
168 esac 166 esac
169 done 167 done
170 168
171 if use ppc-macos ; then 169 if use ppc-macos ; then
170 local opts
171 [[ -f Makefile.am ]] && opts="--automake"
172 glibtoolize --copy --force 172 glibtoolize --copy --force ${opts}
173 darwintoolize 173 darwintoolize
174 fi 174 fi
175 175
176 for x in ${my_dirlist} ; do 176 for x in ${my_dirlist} ; do
177 local tmp=$(echo "${x}" | sed -e "s|${S}||") 177 local tmp=$(echo "${x}" | sed -e "s|${WORKDIR}||")
178 export ELT_APPLIED_PATCHES= 178 export ELT_APPLIED_PATCHES=
179 179
180 cd ${x} 180 cd ${x}
181 einfo "Patching \${S}$(echo "/${tmp}/ltmain.sh" | sed -e 's|//|/|g') ..." 181 einfo "Running elibtoolize in: $(echo "/${tmp}" | sed -e 's|//|/|g; s|^/||')"
182 182
183 for y in ${elt_patches} ; do 183 for y in ${elt_patches} ; do
184 local ret=0 184 local ret=0
185 185
186 case "${y}" in 186 case "${y}" in
226 eerror "Portage patch requested, but failed to apply!" 226 eerror "Portage patch requested, but failed to apply!"
227 die "Portage patch requested, but failed to apply!" 227 die "Portage patch requested, but failed to apply!"
228 fi 228 fi
229 else 229 else
230 if [[ -n $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then 230 if [[ -n $(grep 'We do not want portage' "${x}/ltmain.sh") ]] ; then
231 ewarn " Portage patch seems to be already applied." 231 # ewarn " Portage patch seems to be already applied."
232 ewarn " Please verify that it is not needed." 232 # ewarn " Please verify that it is not needed."
233 :
233 else 234 else
235 local version=$( \
236 eval $(grep -e '^[[:space:]]*VERSION=' "${x}/ltmain.sh"); \
237 echo "${VERSION}")
238
234 echo 239 echo
235 eerror "Portage patch failed to apply!" 240 eerror "Portage patch failed to apply (ltmain.sh version ${version})!"
236 die "Portage patch failed to apply!" 241 die "Portage patch failed to apply!"
237 fi 242 fi
238 # We do not want to run libtoolize ... 243 # We do not want to run libtoolize ...
239 ELT_APPLIED_PATCHES="portage" 244 ELT_APPLIED_PATCHES="portage"
240 fi 245 fi
246 if [[ ${do_portage} == "no" && \ 251 if [[ ${do_portage} == "no" && \
247 ${do_reversedeps} == "no" && \ 252 ${do_reversedeps} == "no" && \
248 ${do_only_patches} == "no" && \ 253 ${do_only_patches} == "no" && \
249 ${deptoremove} == "" ]] 254 ${deptoremove} == "" ]]
250 then 255 then
256 ewarn "Cannot apply any patches, please file a bug about this"
257 break
258
251 # Sometimes ltmain.sh is in a subdirectory ... 259 # Sometimes ltmain.sh is in a subdirectory ...
252 if [[ ! -f ${x}/configure.in && ! -f ${x}/configure.ac ]] ; then 260 if [[ ! -f ${x}/configure.in && ! -f ${x}/configure.ac ]] ; then
253 if [[ -f ${x}/../configure.in || -f ${x}/../configure.ac ]] ; then 261 if [[ -f ${x}/../configure.in || -f ${x}/../configure.ac ]] ; then
254 cd "${x}"/../ 262 cd "${x}"/../
255 fi 263 fi
256 fi 264 fi
257 265
258 if type -p libtoolize &> /dev/null ; then 266 if type -p libtoolize &> /dev/null ; then
259 ewarn "Cannot apply any patch, running libtoolize..." 267 ewarn "Cannot apply any patches, running libtoolize..."
260 libtoolize --copy --force 268 libtoolize --copy --force
261 fi 269 fi
262 cd "${x}" 270 cd "${x}"
263 break 271 break
264 fi 272 fi

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.20