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

Diff of /eclass/libtool.eclass

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

Revision 1.13 Revision 1.23
1#!/bin/bash
2# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
3# Distributed under the terms of the GNU General Public License, v2 or later 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.23 2003/04/08 11:34:57 azarah Exp $
4#
4# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
5# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.13 2002/08/29 23:56:15 azarah Exp $ 6#
6# This eclass patches ltmain.sh distributed with libtoolized packages with the 7# This eclass patches ltmain.sh distributed with libtoolized packages with the
7# relink and portage patch 8# relink and portage patch
9
8ECLASS=libtool 10ECLASS=libtool
9INHERITED="$INHERITED $ECLASS" 11INHERITED="$INHERITED $ECLASS"
10 12
11newdepend sys-devel/libtool 13newdepend "!bootstrap? ( sys-devel/libtool )"
12 14
13DESCRIPTION="Based on the ${ECLASS} eclass" 15DESCRIPTION="Based on the ${ECLASS} eclass"
14 16
15ELIBTOOL_VERSION=1.8.1 17ELIBTOOL_VERSION=1.8.1
16 18
20 local y="" 22 local y=""
21 local dopatch="no" 23 local dopatch="no"
22 local dotest="yes" 24 local dotest="yes"
23 local dorelink="yes" 25 local dorelink="yes"
24 local dotmp="yes" 26 local dotmp="yes"
27 local dosed="yes"
25 local doportage="yes" 28 local doportage="yes"
26 local portage="no" 29 local portage="no"
27 local reversedeps="no" 30 local reversedeps="no"
31 local removeinternaldep="no"
32 local deptoremove=""
28 local mylist="" 33 local mylist=""
29 34
30 mylist="$(find_ltmain)" 35 mylist="$(find_ltmain)"
31 for x in ${*} 36 for x in ${*}
32 do 37 do
41 # http://bugzilla.gnome.org/show_bug.cgi?id=75635 46 # http://bugzilla.gnome.org/show_bug.cgi?id=75635
42 if [ "${x}" = "--reverse-deps" ] 47 if [ "${x}" = "--reverse-deps" ]
43 then 48 then
44 reversedeps="yes" 49 reversedeps="yes"
45 fi 50 fi
51 if [ `echo ${x} | grep "^--remove-internal-dep="` ]
52 then
53 removeinternaldep="yes"
54 deptoremove=`echo ${x} | sed -e 's/--remove-internal-dep=//'`
55 fi
46 # Only patch the ltmain.sh in ${S} 56 # Only patch the ltmain.sh in ${S}
47 if [ "${x}" = "--shallow" ] 57 if [ "${x}" = "--shallow" ]
48 then 58 then
49 if [ -f ${S}/ltmain.sh ] 59 if [ -f ${S}/ltmain.sh ]
50 then 60 then
63 einfo "Working directory: ${x}..." 73 einfo "Working directory: ${x}..."
64 dopatch="yes" 74 dopatch="yes"
65 dotest="yes" 75 dotest="yes"
66 dorelink="yes" 76 dorelink="yes"
67 dotmp="yes" 77 dotmp="yes"
78 dosed="yes"
68 doportage="yes" 79 doportage="yes"
69 80
70 for y in test_patch relink_patch tmp_patch portage_patch 81 for y in test_patch relink_patch tmp_patch sed_patch portage_patch
71 do 82 do
72 if ! eval ${y} --test $>${T}/elibtool.log 83 if ! eval ${y} --test $>${T}/elibtool.log
73 then 84 then
74 case ${y} in 85 case ${y} in
75 test_patch) 86 test_patch)
86 dorelink="no" 97 dorelink="no"
87 ;; 98 ;;
88 tmp_patch) 99 tmp_patch)
89 # non critical patch 100 # non critical patch
90 dotmp="no" 101 dotmp="no"
102 ;;
103 sed_patch)
104 # non critical patch
105 dosed="no"
91 ;; 106 ;;
92 portage_patch) 107 portage_patch)
93 # critical patch 108 # critical patch
94 if [ "${portage}" = "yes" ] 109 if [ "${portage}" = "yes" ]
95 then 110 then
110# dotest="no" 125# dotest="no"
111# dorelink="no" 126# dorelink="no"
112# dotmp="no" 127# dotmp="no"
113# fi 128# fi
114 129
115 for y in test_patch relink_patch tmp_patch portage_patch 130 for y in test_patch relink_patch tmp_patch sed_patch portage_patch
116 do 131 do
117 if [ "${dopatch}" = "yes" ] 132 if [ "${dopatch}" = "yes" ]
118 then 133 then
119 case ${y} in 134 case ${y} in
120 test_patch) 135 test_patch)
133 if [ "${dotmp}" = "no" ] 148 if [ "${dotmp}" = "no" ]
134 then 149 then
135 continue 150 continue
136 fi 151 fi
137 ;; 152 ;;
153 sed_patch)
154 if [ "${dosed}" = "no" ]
155 then
156 continue
157 fi
158 ;;
138 portage_patch) 159 portage_patch)
139 if [ "${doportage}" = "no" ] 160 if [ "${doportage}" = "no" ]
140 then 161 then
141 continue 162 continue
142 fi 163 fi
143 ;; 164 ;;
144 esac 165 esac
145 166
146 einfo "Applying libtool-${y/_patch/}.patch..." 167 einfo "Applying libtool-${y/_patch/}.patch..."
147 eval ${y} $>${T}/elibtool.log 168 eval ${y} $>${T}/elibtool.log
148 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] 169 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] && [ "${removeinternaldep}" = "no" ]
149 then 170 then
171 # Sometimes ltmain.sh is in a subdirectory ...
172 if [ ! -f ${x}/configure.in -a ! -f ${x}/configure.ac ]
173 then
174 if [ -f ${x}/../configure.in -o -f ${x}/../configure.ac ]
175 then
176 cd ${x}/../
177 fi
178 fi
179
150 ewarn "Cannot apply any patch, running libtoolize..." 180 ewarn "Cannot apply any patch, running libtoolize..."
151 libtoolize --copy --force 181 libtoolize --copy --force
182 cd ${x}
152 break 183 break
153 fi 184 fi
154 done 185 done
155 186
156 if [ "${reversedeps}" = "yes" ] 187 if [ "${reversedeps}" = "yes" ]
157 then 188 then
158 if eval reversedeps_patch --test $>${T}/libtool.foo 189 if eval reversedeps_patch --test $>${T}/libtool.foo
159 then 190 then
160 einfo "Applying libtool-reverse-deps.patch..." 191 einfo "Applying libtool-reverse-deps.patch..."
161 eval reversedeps_patch $>${T}/libtool.foo 192 eval reversedeps_patch $>${T}/libtool.foo
193 else
194 ewarn "Not applying libtool-reverse-deps.patch..."
195 fi
196 fi
197
198 if [ "${removeinternaldep}" = "yes" ]
199 then
200 if eval remove_internal_dep_patch $deptoremove --test $>${T}/libtool.foo
201 then
202 einfo "Applying remove-internal-dep.patch (removing $deptoremove)..."
203 eval remove_internal_dep_patch $deptoremove $>${T}/libtool.foo
204 else
205 ewarn "Not applying libtool-remove-internal-dep.patch..."
162 fi 206 fi
163 fi 207 fi
164 done 208 done
165 209
166 if [ -f libtool ] 210 if [ -f libtool ]
384 fi 428 fi
385 fi 429 fi
386 430
387 ENDPATCH 431 ENDPATCH
388 432
389 retval=$? 433 retval=$?
390 434
391 # This one dont apply clean to libtool-1.4.2a, so do it manually. 435 # This one dont apply clean to libtool-1.4.2a, so do it manually.
392 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ] 436 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ]
393 then 437 then
394 cp ltmain.sh ltmain.sh.orig 438 cp ltmain.sh ltmain.sh.orig
395 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \ 439 sed -e 's:cd `pwd`; $SHELL $0 --mode=relink $libtool_args:cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@:' \
396 ltmain.sh.orig > ltmain.sh 440 ltmain.sh.orig > ltmain.sh
397 rm -f ltmain.sh.orig 441 rm -f ltmain.sh.orig
398 fi 442 fi
399 443
400 return ${retval} 444 return ${retval}
401} 445}
402 446
403tmp_patch() { 447tmp_patch() {
404 448
405 local opts="" 449 local opts=""
772 ;; 816 ;;
773 *) tmp_libs="$tmp_libs $deplib" ;; 817 *) tmp_libs="$tmp_libs $deplib" ;;
774 ENDPATCH 818 ENDPATCH
775} 819}
776 820
821remove_internal_dep_patch() {
822 local opts=""
823
824 if [ "${2}" = "--test" ]
825 then
826 opts="--force --dry-run"
827 fi
828
829 patch ${opts} -p0 <<-ENDPATCH
830 --- ltmain.sh.orig 2002-11-01 19:56:50.000000000 -0600
831 +++ ltmain.sh 2002-11-01 19:57:03.000000000 -0600
832 @@ -4551,6 +4551,8 @@
833 if test "\$installed" = yes && test "\$D"; then
834 install_libdir="\`echo "\$install_libdir" |sed -e "s:\$D::g" -e 's://:/:g'\`"
835 fi
836 + # Removing $1 from dependency_libs in .la
837 + dependency_libs=\`echo \$dependency_libs | \$Xsed -e 's%\([^ ]*lib${1}\.\(so\|la\|a\)\)\|\(-l${1}\)%%g'\`
838 \$echo > \$output "\\
839 # \$outputname - a libtool library file
840 # Generated by \$PROGRAM - GNU \$PACKAGE \$VERSION\$TIMESTAMP
841 ENDPATCH
842}
843
844sed_patch() {
845
846 local opts=""
847
848 if [ "${1}" = "--test" ]
849 then
850 opts="--force --dry-run"
851 fi
852
853 patch ${opts} -p1 <<-"ENDPATCH"
854 --- libtool-1.4.3/ltmain.sh.ltmain-SED 2003-02-13 14:54:24.000000000 +0100
855 +++ libtool-1.4.3/ltmain.sh 2003-02-13 15:24:49.000000000 +0100
856 @@ -48,6 +48,9 @@ EOF
857 exit 0
858 fi
859
860 +# define SED for historic ltconfig's generated by Libtool 1.3
861 +test -z "$SED" && SED=sed
862 +
863 # The name of this program.
864 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
865 modename="$progname"
866 ENDPATCH
867}
868

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

  ViewVC Help
Powered by ViewVC 1.1.20