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

Diff of /eclass/libtool.eclass

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

Revision 1.8 Revision 1.10
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.8 2002/06/26 20:17:53 azarah Exp $ 5# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.10 2002/06/29 23:50:56 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=""
19 local dotest="yes" 20 local dotest="yes"
20 local dorelink="yes" 21 local dorelink="yes"
21 local dotmp="yes" 22 local dotmp="yes"
22 local doportage="yes" 23 local doportage="yes"
23 local portage="no" 24 local portage="no"
25 local reversedeps="no"
24 local mylist="" 26 local mylist=""
25 27
26 mylist="$(find_ltmain)" 28 mylist="$(find_ltmain)"
27 # Only apply portage patch, and dont "libtoolize --copy --force"
28 # if all patches fail.
29 for x in ${*} 29 for x in ${*}
30 do 30 do
31 # Only apply portage patch, and dont "libtoolize --copy --force"
32 # if all patches fail.
31 if [ "${x}" = "--portage" ] 33 if [ "${x}" = "--portage" ]
32 then 34 then
33 portage="yes" 35 portage="yes"
36 fi
37 # Apply the reverse-deps patch
38 #
39 # http://bugzilla.gnome.org/show_bug.cgi?id=75635
40 if [ "${x}" = "--reverse-deps" ]
41 then
42 reversedeps="yes"
34 fi 43 fi
35 # Only patch the ltmain.sh in ${S} 44 # Only patch the ltmain.sh in ${S}
36 if [ "${x}" = "--shallow" ] 45 if [ "${x}" = "--shallow" ]
37 then 46 then
38 if [ -f ${S}/ltmain.sh ] 47 if [ -f ${S}/ltmain.sh ]
124 ;; 133 ;;
125 esac 134 esac
126 135
127 einfo "Applying libtool-${y/_patch/}.patch..." 136 einfo "Applying libtool-${y/_patch/}.patch..."
128 eval ${y} $>${T}/libtool.foo 137 eval ${y} $>${T}/libtool.foo
129 elif [ "${portage}" = "no" ] 138 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ]
130 then 139 then
140 ewarn "Cannot apply any patch, running libtoolize..."
131 libtoolize --copy --force 141 libtoolize --copy --force
132 break 142 break
133 fi 143 fi
134 done 144 done
145
146 if [ "${reversedeps}" = "yes" ]
147 then
148 if eval reversedeps_patch --test $>${T}/libtool.foo
149 then
150 einfo "Applying libtool-reverse-deps.patch..."
151 eval reversedeps_patch $>${T}/libtool.foo
152 fi
153 fi
135 done 154 done
136 155
137 if [ -f libtool ] 156 if [ -f libtool ]
138 then 157 then
139 rm -f libtool 158 rm -f libtool
177 fi 196 fi
178 197
179 patch ${opts} -p0 <<-"ENDPATCH" 198 patch ${opts} -p0 <<-"ENDPATCH"
180 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002 199 --- ltmain.sh.orig Wed Apr 3 01:19:37 2002
181 +++ ltmain.sh Sun May 26 19:50:52 2002 200 +++ ltmain.sh Sun May 26 19:50:52 2002
182 @@ -3940,9 +3940,40 @@ 201 @@ -3940,9 +3940,41 @@
183 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 202 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
184 exit 1 203 exit 1
185 fi 204 fi
186 - newdependency_libs="$newdependency_libs $libdir/$name" 205 - newdependency_libs="$newdependency_libs $libdir/$name"
187 + # We do not want portage's install root ($D) present. Check only for 206 + # We do not want portage's install root ($D) present. Check only for
197 + newdependency_libs="$newdependency_libs $mynewdependency_lib" 216 + newdependency_libs="$newdependency_libs $mynewdependency_lib"
198 + fi 217 + fi
199 + fi 218 + fi
200 + ;; 219 + ;;
201 + *) 220 + *)
202 + if test "$installed" = yes && test "$S"; then 221 + if test "$installed" = yes; then
203 + # We do not want portage's build root ($S) present. 222 + # We do not want portage's build root ($S) present.
204 + if test -n "`echo $deplib |grep -e "$S"`" 223 + if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
205 + then
206 + newdependency_libs="" 224 + newdependency_libs=""
207 + # We do not want portage's install root ($D) present. 225 + # We do not want portage's install root ($D) present.
208 + elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then 226 + elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
209 + mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`" 227 + mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`"
228 + else
229 + mynewdependency_lib="$deplib"
210 + fi 230 + fi
211 + else 231 + else
212 + mynewdependency_lib="$deplib" 232 + mynewdependency_lib="$deplib"
213 + fi 233 + fi
214 + # Do not add duplicates 234 + # Do not add duplicates
695 hardcode_libdirs= 715 hardcode_libdirs=
696 dep_rpath= 716 dep_rpath=
697 ENDPATCH 717 ENDPATCH
698} 718}
699 719
720reversedeps_patch() {
721
722 local opts=""
723
724 if [ "${1}" = "--test" ]
725 then
726 opts="--force --dry-run"
727 fi
728
729 patch ${opts} -p0 <<-"ENDPATCH"
730 --- ltmain.sh.orig Sat Mar 23 22:48:45 2002
731 +++ ltmain.sh Sat Mar 23 22:45:38 2002
732 @@ -1553,6 +1553,8 @@
733 convenience="$convenience $ladir/$objdir/$old_library"
734 old_convenience="$old_convenience $ladir/$objdir/$old_library"
735 tmp_libs=
736 + # PKGW
737 + dependency_libs=
738 for deplib in $dependency_libs; do
739 deplibs="$deplib $deplibs"
740 case "$tmp_libs " in
741 @@ -1668,6 +1670,8 @@
742 fi
743
744 tmp_libs=
745 + #PKGW
746 + dependency_libs=
747 for deplib in $dependency_libs; do
748 case $deplib in
749 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
750 @@ -2081,7 +2085,7 @@
751 -L*)
752 case " $tmp_libs " in
753 *" $deplib "*) ;;
754 - *) tmp_libs="$tmp_libs $deplib" ;;
755 + *) tmp_libs="$deplib $tmp_libs" ;;
756 esac
757 ;;
758 *) tmp_libs="$tmp_libs $deplib" ;;
759 ENDPATCH
760}
761

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

  ViewVC Help
Powered by ViewVC 1.1.20