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

Diff of /eclass/libtool.eclass

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

Revision 1.9 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.9 2002/06/26 22:38:07 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
13ELIBTOOL_VERSION=1.8.1 15ELIBTOOL_VERSION=1.8.1
20 local dotest="yes" 22 local dotest="yes"
21 local dorelink="yes" 23 local dorelink="yes"
22 local dotmp="yes" 24 local dotmp="yes"
23 local doportage="yes" 25 local doportage="yes"
24 local portage="no" 26 local portage="no"
27 local reversedeps="no"
25 local mylist="" 28 local mylist=""
26 29
27 mylist="$(find_ltmain)" 30 mylist="$(find_ltmain)"
28 # Only apply portage patch, and dont "libtoolize --copy --force"
29 # if all patches fail.
30 for x in ${*} 31 for x in ${*}
31 do 32 do
33 # Only apply portage patch, and dont "libtoolize --copy --force"
34 # if all patches fail.
32 if [ "${x}" = "--portage" ] 35 if [ "${x}" = "--portage" ]
33 then 36 then
34 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"
35 fi 45 fi
36 # Only patch the ltmain.sh in ${S} 46 # Only patch the ltmain.sh in ${S}
37 if [ "${x}" = "--shallow" ] 47 if [ "${x}" = "--shallow" ]
38 then 48 then
39 if [ -f ${S}/ltmain.sh ] 49 if [ -f ${S}/ltmain.sh ]
57 dotmp="yes" 67 dotmp="yes"
58 doportage="yes" 68 doportage="yes"
59 69
60 for y in test_patch relink_patch tmp_patch portage_patch 70 for y in test_patch relink_patch tmp_patch portage_patch
61 do 71 do
62 if ! eval ${y} --test $>${T}/libtool.foo 72 if ! eval ${y} --test $>${T}/elibtool.log
63 then 73 then
64 case ${y} in 74 case ${y} in
65 test_patch) 75 test_patch)
66 # non critical patch 76 # non critical patch
67 dotest="no" 77 dotest="no"
92 ;; 102 ;;
93 esac 103 esac
94 fi 104 fi
95 done 105 done
96 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
97 for y in test_patch relink_patch tmp_patch portage_patch 115 for y in test_patch relink_patch tmp_patch portage_patch
98 do 116 do
99 if [ "${dopatch}" = "yes" ] 117 if [ "${dopatch}" = "yes" ]
100 then 118 then
101 case ${y} in 119 case ${y} in
124 fi 142 fi
125 ;; 143 ;;
126 esac 144 esac
127 145
128 einfo "Applying libtool-${y/_patch/}.patch..." 146 einfo "Applying libtool-${y/_patch/}.patch..."
129 eval ${y} $>${T}/libtool.foo 147 eval ${y} $>${T}/elibtool.log
130 elif [ "${portage}" = "no" ] 148 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ]
131 then 149 then
150 ewarn "Cannot apply any patch, running libtoolize..."
132 libtoolize --copy --force 151 libtoolize --copy --force
133 break 152 break
134 fi 153 fi
135 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
136 done 164 done
137 165
138 if [ -f libtool ] 166 if [ -f libtool ]
139 then 167 then
140 rm -f libtool 168 rm -f libtool
178 fi 206 fi
179 207
180 patch ${opts} -p0 <<-"ENDPATCH" 208 patch ${opts} -p0 <<-"ENDPATCH"
181 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002 209 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002
182 +++ ltmain.sh Sun May 26 19:50:52 2002 210 +++ ltmain.sh Sun May 26 19:50:52 2002
183 @@ -3940,9 +3940,41 @@ 211 @@ -3940,9 +3940,46 @@
184 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 212 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
185 exit 1 213 exit 1
186 fi 214 fi
187 - newdependency_libs="$newdependency_libs $libdir/$name" 215 - newdependency_libs="$newdependency_libs $libdir/$name"
188 + # 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
189 + # this if the .la is being installed. 217 + # this if the .la is being installed.
190 + if test "$installed" = yes && test "$D"; then 218 + if test "$installed" = yes && test "$D"; then
191 + 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'`"
192 + else 220 + else
193 + mynewdependency_lib="$libdir/$name" 221 + mynewdependency_lib="$libdir/$name"
194 + fi 222 + fi
195 + # Do not add duplicates 223 + # Do not add duplicates
196 + if test "$mynewdependency_lib"; then 224 + if test "$mynewdependency_lib"; then
197 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then 225 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
198 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 226 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
199 + fi 227 + fi
200 + fi 228 + fi
201 + ;; 229 + ;;
202 + *) 230 + *)
203 + 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
204 + # We do not want portage's build root ($S) present. 237 + # We do not want portage's build root ($S) present.
205 + if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then 238 + if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
206 + newdependency_libs="" 239 + mynewdependency_lib=""
207 + # We do not want portage's install root ($D) present. 240 + # We do not want portage's install root ($D) present.
208 + elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then 241 + elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; 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'`"
210 + else 243 + else
211 + mynewdependency_lib="$deplib" 244 + mynewdependency_lib="$deplib"
212 + fi 245 + fi
213 + else 246 + else
214 + mynewdependency_lib="$deplib" 247 + mynewdependency_lib="$deplib"
215 + fi 248 + fi
216 + # Do not add duplicates 249 + # Do not add duplicates
217 + if test "$mynewdependency_lib"; then 250 + if test "$mynewdependency_lib"; then
218 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then 251 + if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
219 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 252 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
220 + fi 253 + fi
221 + fi 254 + fi
222 ;; 255 ;;
223 - *) newdependency_libs="$newdependency_libs $deplib" ;; 256 - *) newdependency_libs="$newdependency_libs $deplib" ;;
224 esac 257 esac
697 hardcode_libdirs= 730 hardcode_libdirs=
698 dep_rpath= 731 dep_rpath=
699 ENDPATCH 732 ENDPATCH
700} 733}
701 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.9  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20