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

Diff of /eclass/libtool.eclass

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

Revision 1.6 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.6 2002/06/18 08:43:28 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)
120 break 133 break
121 fi 134 fi
122 done 135 done
123 done 136 done
124 137
138 if [ -f libtool ]
139 then
140 rm -f libtool
141 fi
142
125 # We need to change the pwd back to $S, as we may be called in 143 # We need to change the pwd back to $S, as we may be called in
126 # src_compile() 144 # src_compile()
127 cd ${S} 145 cd ${S}
128} 146}
129 147
160 fi 178 fi
161 179
162 patch ${opts} -p0 <<-"ENDPATCH" 180 patch ${opts} -p0 <<-"ENDPATCH"
163 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002 181 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002
164 +++ ltmain.sh Sun May 26 19:50:52 2002 182 +++ ltmain.sh Sun May 26 19:50:52 2002
165 @@ -3940,9 +3940,39 @@ 183 @@ -3940,9 +3940,41 @@
166 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 184 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
167 exit 1 185 exit 1
168 fi 186 fi
169 - newdependency_libs="$newdependency_libs $libdir/$name" 187 - newdependency_libs="$newdependency_libs $libdir/$name"
170 + # 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
171 + # this if the .la is being installed. 189 + # this if the .la is being installed.
172 + if test "$installed" = yes; then 190 + if test "$installed" = yes && test "$D"; then
173 + 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'`"
174 + else 192 + else
175 + mynewdependency_lib="$libdir/$name" 193 + mynewdependency_lib="$libdir/$name"
176 + fi 194 + fi
177 + # Do not add duplicates 195 + # Do not add duplicates
196 + if test "$mynewdependency_lib"; then
178 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`" 197 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
179 + then
180 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 198 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
199 + fi
181 + fi 200 + fi
182 + ;; 201 + ;;
183 + *) 202 + *)
184 + if test "$installed" = yes; then 203 + if test "$installed" = yes; then
185 + # We do not want portage's build root ($S} present. 204 + # We do not want portage's build root ($S) present.
186 + if test -n "`echo $deplib |grep -e "${S}"`" 205 + if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
187 + then
188 + newdependency_libs="" 206 + newdependency_libs=""
189 + # We do not want portage's install root ($D) present. 207 + # We do not want portage's install root ($D) present.
190 + elif test -n "`echo $deplib |grep -e "${D}"`" 208 + elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
191 + then
192 + 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"
193 + fi 212 + fi
194 + else 213 + else
195 + mynewdependency_lib="$deplib" 214 + mynewdependency_lib="$deplib"
196 + fi 215 + fi
197 + # Do not add duplicates 216 + # Do not add duplicates
217 + if test "$mynewdependency_lib"; then
198 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`" 218 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
199 + then
200 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 219 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
220 + fi
201 + fi 221 + fi
202 ;; 222 ;;
203 - *) newdependency_libs="$newdependency_libs $deplib" ;; 223 - *) newdependency_libs="$newdependency_libs $deplib" ;;
204 esac 224 esac
205 done 225 done
207 @@ -3975,6 +4005,10 @@ 227 @@ -3975,6 +4005,10 @@
208 case $host,$output,$installed,$module,$dlname in 228 case $host,$output,$installed,$module,$dlname in
209 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 229 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
210 esac 230 esac
211 + # Do not add duplicates 231 + # Do not add duplicates
212 + if test "$installed" = yes; then 232 + if test "$installed" = yes && test "$D"; then
213 + 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'`"
214 + fi 234 + fi
215 $echo > $output "\ 235 $echo > $output "\
216 # $outputname - a libtool library file 236 # $outputname - a libtool library file
217 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 237 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
218 ENDPATCH 238 ENDPATCH
329 - continue 349 - continue
330 + exit 1 350 + exit 1
331 fi 351 fi
332 fi 352 fi
333 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
334 @@ -4782,7 +4829,11 @@ 382 @@ -4782,7 +4829,11 @@
335 if test "$finalize" = yes && test -z "$run"; then 383 if test "$finalize" = yes && test -z "$run"; then
336 tmpdir="/tmp" 384 tmpdir="/tmp"
337 test -n "$TMPDIR" && tmpdir="$TMPDIR" 385 test -n "$TMPDIR" && tmpdir="$TMPDIR"
338 - tmpdir="$tmpdir/libtool-$$" 386 - tmpdir="$tmpdir/libtool-$$"
343 + fi 391 + fi
344 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : 392 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
345 else 393 else
346 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 394 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
347 ENDPATCH 395 ENDPATCH
348
349 retval=$?
350
351 # This one dont apply clean to libtool-1.4.2a, so do it manually.
352 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ]
353 then
354 cp ltmain.sh ltmain.sh.orig
355 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \
356 ltmain.sh.orig > ltmain.sh
357 rm -f ltmain.sh.orig
358 fi
359
360 return ${retval}
361} 396}
362 397
363test_patch() { 398test_patch() {
364 399
365 local opts="" 400 local opts=""

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

  ViewVC Help
Powered by ViewVC 1.1.20