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

Diff of /eclass/libtool.eclass

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

Revision 1.7 Revision 1.13
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.7 2002/06/24 02:06:01 azarah Exp $ 5# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.13 2002/08/29 23:56:15 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
9INHERITED="$INHERITED $ECLASS"
10
9newdepend sys-devel/libtool 11newdepend sys-devel/libtool
10 12
11DESCRIPTION="Based on the ${ECLASS} eclass" 13DESCRIPTION="Based on the ${ECLASS} eclass"
12 14
15ELIBTOOL_VERSION=1.8.1
13 16
14elibtoolize() { 17elibtoolize() {
15 18
16 local x="" 19 local x=""
17 local y="" 20 local y=""
19 local dotest="yes" 22 local dotest="yes"
20 local dorelink="yes" 23 local dorelink="yes"
21 local dotmp="yes" 24 local dotmp="yes"
22 local doportage="yes" 25 local doportage="yes"
23 local portage="no" 26 local portage="no"
27 local reversedeps="no"
24 local mylist="" 28 local mylist=""
25 29
26 mylist="$(find_ltmain)" 30 mylist="$(find_ltmain)"
27 # Only apply portage patch, and dont "libtoolize --copy --force"
28 # if all patches fail.
29 for x in ${*} 31 for x in ${*}
30 do 32 do
33 # Only apply portage patch, and dont "libtoolize --copy --force"
34 # if all patches fail.
31 if [ "${x}" = "--portage" ] 35 if [ "${x}" = "--portage" ]
32 then 36 then
33 portage="yes" 37 portage="yes"
38 fi
39 # Apply the reverse-deps patch
40 #
41 # http://bugzilla.gnome.org/show_bug.cgi?id=75635
42 if [ "${x}" = "--reverse-deps" ]
43 then
44 reversedeps="yes"
34 fi 45 fi
35 # Only patch the ltmain.sh in ${S} 46 # Only patch the ltmain.sh in ${S}
36 if [ "${x}" = "--shallow" ] 47 if [ "${x}" = "--shallow" ]
37 then 48 then
38 if [ -f ${S}/ltmain.sh ] 49 if [ -f ${S}/ltmain.sh ]
56 dotmp="yes" 67 dotmp="yes"
57 doportage="yes" 68 doportage="yes"
58 69
59 for y in test_patch relink_patch tmp_patch portage_patch 70 for y in test_patch relink_patch tmp_patch portage_patch
60 do 71 do
61 if ! eval ${y} --test $>${T}/libtool.foo 72 if ! eval ${y} --test $>${T}/elibtool.log
62 then 73 then
63 case ${y} in 74 case ${y} in
64 test_patch) 75 test_patch)
65 # non critical patch 76 # non critical patch
66 dotest="no" 77 dotest="no"
91 ;; 102 ;;
92 esac 103 esac
93 fi 104 fi
94 done 105 done
95 106
107# Only apply portage patch ... I think if other can apply, they should.
108# if [ "${portage}" = "yes" ]
109# then
110# dotest="no"
111# dorelink="no"
112# dotmp="no"
113# fi
114
96 for y in test_patch relink_patch tmp_patch portage_patch 115 for y in test_patch relink_patch tmp_patch portage_patch
97 do 116 do
98 if [ "${dopatch}" = "yes" ] 117 if [ "${dopatch}" = "yes" ]
99 then 118 then
100 case ${y} in 119 case ${y} in
123 fi 142 fi
124 ;; 143 ;;
125 esac 144 esac
126 145
127 einfo "Applying libtool-${y/_patch/}.patch..." 146 einfo "Applying libtool-${y/_patch/}.patch..."
128 eval ${y} $>${T}/libtool.foo 147 eval ${y} $>${T}/elibtool.log
129 elif [ "${portage}" = "no" ] 148 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ]
130 then 149 then
150 ewarn "Cannot apply any patch, running libtoolize..."
131 libtoolize --copy --force 151 libtoolize --copy --force
132 break 152 break
133 fi 153 fi
134 done 154 done
155
156 if [ "${reversedeps}" = "yes" ]
157 then
158 if eval reversedeps_patch --test $>${T}/libtool.foo
159 then
160 einfo "Applying libtool-reverse-deps.patch..."
161 eval reversedeps_patch $>${T}/libtool.foo
162 fi
163 fi
135 done 164 done
136 165
137 if [ -f libtool ] 166 if [ -f libtool ]
138 then 167 then
139 rm -f libtool 168 rm -f libtool
177 fi 206 fi
178 207
179 patch ${opts} -p0 <<-"ENDPATCH" 208 patch ${opts} -p0 <<-"ENDPATCH"
180 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002 209 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002
181 +++ ltmain.sh Sun May 26 19:50:52 2002 210 +++ ltmain.sh Sun May 26 19:50:52 2002
182 @@ -3940,9 +3940,39 @@ 211 @@ -3940,9 +3940,46 @@
183 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 212 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
184 exit 1 213 exit 1
185 fi 214 fi
186 - newdependency_libs="$newdependency_libs $libdir/$name" 215 - newdependency_libs="$newdependency_libs $libdir/$name"
187 + # We do not want portage's install root ($D) present. Check only for 216 + # We do not want portage's install root ($D) present. Check only for
188 + # this if the .la is being installed. 217 + # this if the .la is being installed.
189 + if test "$installed" = yes; then 218 + if test "$installed" = yes && test "$D"; then
190 + mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:${D}::g" -e 's://:/:g'`" 219 + eval mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:$D::g" -e 's://:/:g'`"
191 + else 220 + else
192 + mynewdependency_lib="$libdir/$name" 221 + mynewdependency_lib="$libdir/$name"
193 + fi 222 + fi
194 + # Do not add duplicates 223 + # Do not add duplicates
224 + if test "$mynewdependency_lib"; then
195 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`" 225 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
196 + then
197 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 226 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
227 + fi
198 + fi 228 + fi
199 + ;; 229 + ;;
200 + *) 230 + *)
201 + if test "$installed" = yes; then 231 + if test "$installed" = yes; then
232 + # Rather use S=WORKDIR if our version of portage supports it.
233 + # This is because some ebuild (gcc) do not use $S as buildroot.
234 + if test "$PWORKDIR"; then
235 + S="$PWORKDIR"
236 + fi
202 + # We do not want portage's build root ($S} present. 237 + # We do not want portage's build root ($S) present.
203 + if test -n "`echo $deplib |grep -e "${S}"`" 238 + if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
204 + then 239 + mynewdependency_lib=""
205 + newdependency_libs=""
206 + # We do not want portage's install root ($D) present. 240 + # We do not want portage's install root ($D) present.
207 + elif test -n "`echo $deplib |grep -e "${D}"`" 241 + elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
208 + then
209 + mynewdependency_lib="`echo "$deplib" |sed -e "s:${D}::g" -e 's://:/:g'`" 242 + eval mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`"
243 + else
244 + mynewdependency_lib="$deplib"
210 + fi 245 + fi
211 + else 246 + else
212 + mynewdependency_lib="$deplib" 247 + mynewdependency_lib="$deplib"
213 + fi 248 + fi
214 + # Do not add duplicates 249 + # Do not add duplicates
250 + if test "$mynewdependency_lib"; then
215 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`" 251 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
216 + then
217 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 252 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
253 + fi
218 + fi 254 + fi
219 ;; 255 ;;
220 - *) newdependency_libs="$newdependency_libs $deplib" ;; 256 - *) newdependency_libs="$newdependency_libs $deplib" ;;
221 esac 257 esac
222 done 258 done
224 @@ -3975,6 +4005,10 @@ 260 @@ -3975,6 +4005,10 @@
225 case $host,$output,$installed,$module,$dlname in 261 case $host,$output,$installed,$module,$dlname in
226 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 262 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
227 esac 263 esac
228 + # Do not add duplicates 264 + # Do not add duplicates
229 + if test "$installed" = yes; then 265 + if test "$installed" = yes && test "$D"; then
230 + install_libdir="`echo "$install_libdir" |sed -e "s:${D}::g" -e 's://:/:g'`" 266 + install_libdir="`echo "$install_libdir" |sed -e "s:$D::g" -e 's://:/:g'`"
231 + fi 267 + fi
232 $echo > $output "\ 268 $echo > $output "\
233 # $outputname - a libtool library file 269 # $outputname - a libtool library file
234 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 270 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
235 ENDPATCH 271 ENDPATCH
694 hardcode_libdirs= 730 hardcode_libdirs=
695 dep_rpath= 731 dep_rpath=
696 ENDPATCH 732 ENDPATCH
697} 733}
698 734
735reversedeps_patch() {
736
737 local opts=""
738
739 if [ "${1}" = "--test" ]
740 then
741 opts="--force --dry-run"
742 fi
743
744 patch ${opts} -p0 <<-"ENDPATCH"
745 --- ltmain.sh.orig Sat Mar 23 22:48:45 2002
746 +++ ltmain.sh Sat Mar 23 22:45:38 2002
747 @@ -1553,6 +1553,8 @@
748 convenience="$convenience $ladir/$objdir/$old_library"
749 old_convenience="$old_convenience $ladir/$objdir/$old_library"
750 tmp_libs=
751 + # PKGW
752 + dependency_libs=
753 for deplib in $dependency_libs; do
754 deplibs="$deplib $deplibs"
755 case "$tmp_libs " in
756 @@ -1668,6 +1670,8 @@
757 fi
758
759 tmp_libs=
760 + #PKGW
761 + dependency_libs=
762 for deplib in $dependency_libs; do
763 case $deplib in
764 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
765 @@ -2081,7 +2085,7 @@
766 -L*)
767 case " $tmp_libs " in
768 *" $deplib "*) ;;
769 - *) tmp_libs="$tmp_libs $deplib" ;;
770 + *) tmp_libs="$deplib $tmp_libs" ;;
771 esac
772 ;;
773 *) tmp_libs="$tmp_libs $deplib" ;;
774 ENDPATCH
775}
776

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

  ViewVC Help
Powered by ViewVC 1.1.20