/[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.7
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.7 2002/06/24 02:06:01 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
124 141
125 # We need to change the pwd back to $S, as we may be called in 142 # We need to change the pwd back to $S, as we may be called in
126 # src_compile() 143 # src_compile()
127 cd ${S} 144 cd ${S}
128} 145}
329 - continue 346 - continue
330 + exit 1 347 + exit 1
331 fi 348 fi
332 fi 349 fi
333 350
351 ENDPATCH
352
353 retval=$?
354
355 # This one dont apply clean to libtool-1.4.2a, so do it manually.
356 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ]
357 then
358 cp ltmain.sh ltmain.sh.orig
359 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \
360 ltmain.sh.orig > ltmain.sh
361 rm -f ltmain.sh.orig
362 fi
363
364 return ${retval}
365}
366
367tmp_patch() {
368
369 local opts=""
370
371 if [ "${1}" = "--test" ]
372 then
373 opts="--force --dry-run"
374 fi
375
376 patch ${opts} -p0 <<-"ENDPATCH"
377 --- ltmain.sh Sun Aug 12 18:08:05 2001
378 +++ ltmain-relinkable.sh Tue Aug 28 18:55:13 2001
334 @@ -4782,7 +4829,11 @@ 379 @@ -4782,7 +4829,11 @@
335 if test "$finalize" = yes && test -z "$run"; then 380 if test "$finalize" = yes && test -z "$run"; then
336 tmpdir="/tmp" 381 tmpdir="/tmp"
337 test -n "$TMPDIR" && tmpdir="$TMPDIR" 382 test -n "$TMPDIR" && tmpdir="$TMPDIR"
338 - tmpdir="$tmpdir/libtool-$$" 383 - tmpdir="$tmpdir/libtool-$$"
343 + fi 388 + fi
344 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : 389 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
345 else 390 else
346 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 391 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
347 ENDPATCH 392 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} 393}
362 394
363test_patch() { 395test_patch() {
364 396
365 local opts="" 397 local opts=""

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

  ViewVC Help
Powered by ViewVC 1.1.20