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

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

  ViewVC Help
Powered by ViewVC 1.1.20