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

Diff of /eclass/libtool.eclass

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

Revision 1.5 Revision 1.9
1#!/bin/bash 1#!/bin/bash
2# Copyright 1999-2002 Gentoo Technologies, Inc. 2# Copyright 1999-2002 Gentoo Technologies, Inc.
3# Distributed under the terms of the GNU General Public License, v2 or later 3# Distributed under the terms of the GNU General Public License, v2 or later
4# Author: Martin Schlemmer <azarah@gentoo.org> 4# Author: Martin Schlemmer <azarah@gentoo.org>
5# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.5 2002/06/10 18:25:04 azarah Exp $ 5# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.9 2002/06/26 22:38:07 azarah Exp $
6# This eclass patches ltmain.sh distributed with libtoolized packages with the 6# This eclass patches ltmain.sh distributed with libtoolized packages with the
7# relink and portage patch 7# relink and portage patch
8ECLASS=libtool 8ECLASS=libtool
9newdepend sys-devel/libtool 9newdepend sys-devel/libtool
10 10
11DESCRIPTION="Based on the ${ECLASS} eclass" 11DESCRIPTION="Based on the ${ECLASS} eclass"
12 12
13ELIBTOOL_VERSION=1.8.1
13 14
14elibtoolize() { 15elibtoolize() {
15 16
16 local x="" 17 local x=""
17 local y="" 18 local y=""
18 local dopatch="no" 19 local dopatch="no"
19 local dotest="yes" 20 local dotest="yes"
20 local dorelink="yes" 21 local dorelink="yes"
22 local dotmp="yes"
21 local doportage="yes" 23 local doportage="yes"
22 local portage="no" 24 local portage="no"
23 local mylist="" 25 local mylist=""
24 26
25 mylist="$(find_ltmain)" 27 mylist="$(find_ltmain)"
50 cd ${x} 52 cd ${x}
51 einfo "Working directory: ${x}..." 53 einfo "Working directory: ${x}..."
52 dopatch="yes" 54 dopatch="yes"
53 dotest="yes" 55 dotest="yes"
54 dorelink="yes" 56 dorelink="yes"
57 dotmp="yes"
55 doportage="yes" 58 doportage="yes"
56 59
57 for y in test_patch relink_patch portage_patch 60 for y in test_patch relink_patch tmp_patch portage_patch
58 do 61 do
59 if ! eval ${y} --test $>${T}/libtool.foo 62 if ! eval ${y} --test $>${T}/libtool.foo
60 then 63 then
61 case ${y} in 64 case ${y} in
62 test_patch) 65 test_patch)
70 then 73 then
71 dopatch="no" 74 dopatch="no"
72 fi 75 fi
73 dorelink="no" 76 dorelink="no"
74 ;; 77 ;;
78 tmp_patch)
79 # non critical patch
80 dotmp="no"
81 ;;
75 portage_patch) 82 portage_patch)
76 # critical patch 83 # critical patch
77 if [ "${portage}" = "yes" ] 84 if [ "${portage}" = "yes" ]
78 then 85 then
79 echo 86 echo
85 ;; 92 ;;
86 esac 93 esac
87 fi 94 fi
88 done 95 done
89 96
90 for y in test_patch relink_patch portage_patch 97 for y in test_patch relink_patch tmp_patch portage_patch
91 do 98 do
92 if [ "${dopatch}" = "yes" ] 99 if [ "${dopatch}" = "yes" ]
93 then 100 then
94 case ${y} in 101 case ${y} in
95 test_patch) 102 test_patch)
98 continue 105 continue
99 fi 106 fi
100 ;; 107 ;;
101 relink_patch) 108 relink_patch)
102 if [ "${dorelink}" = "no" ] 109 if [ "${dorelink}" = "no" ]
110 then
111 continue
112 fi
113 ;;
114 tmp_patch)
115 if [ "${dotmp}" = "no" ]
103 then 116 then
104 continue 117 continue
105 fi 118 fi
106 ;; 119 ;;
107 portage_patch) 120 portage_patch)
119 libtoolize --copy --force 132 libtoolize --copy --force
120 break 133 break
121 fi 134 fi
122 done 135 done
123 done 136 done
137
138 if [ -f libtool ]
139 then
140 rm -f libtool
141 fi
142
143 # We need to change the pwd back to $S, as we may be called in
144 # src_compile()
145 cd ${S}
124} 146}
125 147
126# 148#
127# Returns all the directories containing ltmain.sh 149# Returns all the directories containing ltmain.sh
128# 150#
156 fi 178 fi
157 179
158 patch ${opts} -p0 <<-"ENDPATCH" 180 patch ${opts} -p0 <<-"ENDPATCH"
159 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002 181 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002
160 +++ ltmain.sh Sun May 26 19:50:52 2002 182 +++ ltmain.sh Sun May 26 19:50:52 2002
161 @@ -3940,9 +3940,39 @@ 183 @@ -3940,9 +3940,41 @@
162 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 184 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
163 exit 1 185 exit 1
164 fi 186 fi
165 - newdependency_libs="$newdependency_libs $libdir/$name" 187 - newdependency_libs="$newdependency_libs $libdir/$name"
166 + # We do not want portage's install root ($D) present. Check only for 188 + # We do not want portage's install root ($D) present. Check only for
167 + # this if the .la is being installed. 189 + # this if the .la is being installed.
168 + if test "$installed" = yes; then 190 + if test "$installed" = yes && test "$D"; then
169 + mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:${D}::g" -e 's://:/:g'`" 191 + mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:$D::g" -e 's://:/:g'`"
170 + else 192 + else
171 + mynewdependency_lib="$libdir/$name" 193 + mynewdependency_lib="$libdir/$name"
172 + fi 194 + fi
173 + # Do not add duplicates 195 + # Do not add duplicates
196 + if test "$mynewdependency_lib"; then
174 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`" 197 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
175 + then
176 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 198 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
199 + fi
177 + fi 200 + fi
178 + ;; 201 + ;;
179 + *) 202 + *)
180 + if test "$installed" = yes; then 203 + if test "$installed" = yes; then
181 + # We do not want portage's build root ($S} present. 204 + # We do not want portage's build root ($S) present.
182 + if test -n "`echo $deplib |grep -e "${S}"`" 205 + if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
183 + then
184 + newdependency_libs="" 206 + newdependency_libs=""
185 + # We do not want portage's install root ($D) present. 207 + # We do not want portage's install root ($D) present.
186 + elif test -n "`echo $deplib |grep -e "${D}"`" 208 + elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
187 + then
188 + mynewdependency_lib="`echo "$deplib" |sed -e "s:${D}::g" -e 's://:/:g'`" 209 + mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`"
210 + else
211 + mynewdependency_lib="$deplib"
189 + fi 212 + fi
190 + else 213 + else
191 + mynewdependency_lib="$deplib" 214 + mynewdependency_lib="$deplib"
192 + fi 215 + fi
193 + # Do not add duplicates 216 + # Do not add duplicates
217 + if test "$mynewdependency_lib"; then
194 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`" 218 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
195 + then
196 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 219 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
220 + fi
197 + fi 221 + fi
198 ;; 222 ;;
199 - *) newdependency_libs="$newdependency_libs $deplib" ;; 223 - *) newdependency_libs="$newdependency_libs $deplib" ;;
200 esac 224 esac
201 done 225 done
203 @@ -3975,6 +4005,10 @@ 227 @@ -3975,6 +4005,10 @@
204 case $host,$output,$installed,$module,$dlname in 228 case $host,$output,$installed,$module,$dlname in
205 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 229 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
206 esac 230 esac
207 + # Do not add duplicates 231 + # Do not add duplicates
208 + if test "$installed" = yes; then 232 + if test "$installed" = yes && test "$D"; then
209 + install_libdir="`echo "$install_libdir" |sed -e "s:${D}::g" -e 's://:/:g'`" 233 + install_libdir="`echo "$install_libdir" |sed -e "s:$D::g" -e 's://:/:g'`"
210 + fi 234 + fi
211 $echo > $output "\ 235 $echo > $output "\
212 # $outputname - a libtool library file 236 # $outputname - a libtool library file
213 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 237 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
214 ENDPATCH 238 ENDPATCH
325 - continue 349 - continue
326 + exit 1 350 + exit 1
327 fi 351 fi
328 fi 352 fi
329 353
354 ENDPATCH
355
356 retval=$?
357
358 # This one dont apply clean to libtool-1.4.2a, so do it manually.
359 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ]
360 then
361 cp ltmain.sh ltmain.sh.orig
362 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \
363 ltmain.sh.orig > ltmain.sh
364 rm -f ltmain.sh.orig
365 fi
366
367 return ${retval}
368}
369
370tmp_patch() {
371
372 local opts=""
373
374 if [ "${1}" = "--test" ]
375 then
376 opts="--force --dry-run"
377 fi
378
379 patch ${opts} -p0 <<-"ENDPATCH"
380 --- ltmain.sh Sun Aug 12 18:08:05 2001
381 +++ ltmain-relinkable.sh Tue Aug 28 18:55:13 2001
330 @@ -4782,7 +4829,11 @@ 382 @@ -4782,7 +4829,11 @@
331 if test "$finalize" = yes && test -z "$run"; then 383 if test "$finalize" = yes && test -z "$run"; then
332 tmpdir="/tmp" 384 tmpdir="/tmp"
333 test -n "$TMPDIR" && tmpdir="$TMPDIR" 385 test -n "$TMPDIR" && tmpdir="$TMPDIR"
334 - tmpdir="$tmpdir/libtool-$$" 386 - tmpdir="$tmpdir/libtool-$$"
339 + fi 391 + fi
340 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : 392 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
341 else 393 else
342 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 394 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
343 ENDPATCH 395 ENDPATCH
344
345 retval=$?
346
347 # This one dont apply clean to libtool-1.4.2a, so do it manually.
348 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ]
349 then
350 cp ltmain.sh ltmain.sh.orig
351 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \
352 ltmain.sh.orig > ltmain.sh
353 rm -f ltmain.sh.orig
354 fi
355
356 return ${retval}
357} 396}
358 397
359test_patch() { 398test_patch() {
360 399
361 local opts="" 400 local opts=""

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20