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

Diff of /eclass/libtool.eclass

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

Revision 1.14 Revision 1.20
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.20 2003/02/16 04:26:21 vapier 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.14 2002/10/20 10:43:04 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
23 local dorelink="yes" 25 local dorelink="yes"
24 local dotmp="yes" 26 local dotmp="yes"
25 local doportage="yes" 27 local doportage="yes"
26 local portage="no" 28 local portage="no"
27 local reversedeps="no" 29 local reversedeps="no"
30 local removeinternaldep="no"
31 local deptoremove=""
28 local mylist="" 32 local mylist=""
29 33
30 mylist="$(find_ltmain)" 34 mylist="$(find_ltmain)"
31 for x in ${*} 35 for x in ${*}
32 do 36 do
41 # http://bugzilla.gnome.org/show_bug.cgi?id=75635 45 # http://bugzilla.gnome.org/show_bug.cgi?id=75635
42 if [ "${x}" = "--reverse-deps" ] 46 if [ "${x}" = "--reverse-deps" ]
43 then 47 then
44 reversedeps="yes" 48 reversedeps="yes"
45 fi 49 fi
50 if [ `echo ${x} | grep "^--remove-internal-dep="` ]
51 then
52 removeinternaldep="yes"
53 deptoremove=`echo ${x} | sed -e 's/--remove-internal-dep=//'`
54 fi
46 # Only patch the ltmain.sh in ${S} 55 # Only patch the ltmain.sh in ${S}
47 if [ "${x}" = "--shallow" ] 56 if [ "${x}" = "--shallow" ]
48 then 57 then
49 if [ -f ${S}/ltmain.sh ] 58 if [ -f ${S}/ltmain.sh ]
50 then 59 then
143 ;; 152 ;;
144 esac 153 esac
145 154
146 einfo "Applying libtool-${y/_patch/}.patch..." 155 einfo "Applying libtool-${y/_patch/}.patch..."
147 eval ${y} $>${T}/elibtool.log 156 eval ${y} $>${T}/elibtool.log
148 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] 157 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] && [ "${removeinternaldep}" = "no" ]
149 then 158 then
159 # Sometimes ltmain.sh is in a subdirectory ...
160 if [ ! -f ${x}/configure.in -a ! -f ${x}/configure.ac ]
161 then
162 if [ -f ${x}/../configure.in -o -f ${x}/../configure.ac ]
163 then
164 cd ${x}/../
165 fi
166 fi
167
150 ewarn "Cannot apply any patch, running libtoolize..." 168 ewarn "Cannot apply any patch, running libtoolize..."
151 libtoolize --copy --force 169 libtoolize --copy --force
170 cd ${x}
152 break 171 break
153 fi 172 fi
154 done 173 done
155 174
156 if [ "${reversedeps}" = "yes" ] 175 if [ "${reversedeps}" = "yes" ]
157 then 176 then
158 if eval reversedeps_patch --test $>${T}/libtool.foo 177 if eval reversedeps_patch --test $>${T}/libtool.foo
159 then 178 then
160 einfo "Applying libtool-reverse-deps.patch..." 179 einfo "Applying libtool-reverse-deps.patch..."
161 eval reversedeps_patch $>${T}/libtool.foo 180 eval reversedeps_patch $>${T}/libtool.foo
181 else
182 ewarn "Not applying libtool-reverse-deps.patch..."
183 fi
184 fi
185
186 if [ "${removeinternaldep}" = "yes" ]
187 then
188 if eval remove_internal_dep_patch $deptoremove --test $>${T}/libtool.foo
189 then
190 einfo "Applying remove-internal-dep.patch (removing $deptoremove)..."
191 eval remove_internal_dep_patch $deptoremove $>${T}/libtool.foo
192 else
193 ewarn "Not applying libtool-remove-internal-dep.patch..."
162 fi 194 fi
163 fi 195 fi
164 done 196 done
165 197
166 if [ -f libtool ] 198 if [ -f libtool ]
772 ;; 804 ;;
773 *) tmp_libs="$tmp_libs $deplib" ;; 805 *) tmp_libs="$tmp_libs $deplib" ;;
774 ENDPATCH 806 ENDPATCH
775} 807}
776 808
809remove_internal_dep_patch() {
810 local opts=""
811
812 if [ "${2}" = "--test" ]
813 then
814 opts="--force --dry-run"
815 fi
816
817 patch ${opts} -p0 <<-ENDPATCH
818 --- ltmain.sh.orig 2002-11-01 19:56:50.000000000 -0600
819 +++ ltmain.sh 2002-11-01 19:57:03.000000000 -0600
820 @@ -4551,6 +4551,8 @@
821 if test "\$installed" = yes && test "\$D"; then
822 install_libdir="\`echo "\$install_libdir" |sed -e "s:\$D::g" -e 's://:/:g'\`"
823 fi
824 + # Removing $1 from dependency_libs in .la
825 + dependency_libs=\`echo \$dependency_libs | \$Xsed -e 's%\([^ ]*lib${1}\.\(so\|la\|a\)\)\|\(-l${1}\)%%g'\`
826 \$echo > \$output "\\
827 # \$outputname - a libtool library file
828 # Generated by \$PROGRAM - GNU \$PACKAGE \$VERSION\$TIMESTAMP
829 ENDPATCH
830}
831

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20