/[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.19
1#!/bin/bash
2# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2002 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
4# Author: Martin Schlemmer <azarah@gentoo.org> 3# 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 $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.19 2002/12/28 18:17:05 azarah Exp $
6# This eclass patches ltmain.sh distributed with libtoolized packages with the 5# This eclass patches ltmain.sh distributed with libtoolized packages with the
7# relink and portage patch 6# relink and portage patch
7
8ECLASS=libtool 8ECLASS=libtool
9INHERITED="$INHERITED $ECLASS" 9INHERITED="$INHERITED $ECLASS"
10 10
11newdepend sys-devel/libtool 11newdepend "!bootstrap? ( sys-devel/libtool )"
12 12
13DESCRIPTION="Based on the ${ECLASS} eclass" 13DESCRIPTION="Based on the ${ECLASS} eclass"
14 14
15ELIBTOOL_VERSION=1.8.1 15ELIBTOOL_VERSION=1.8.1
16 16
23 local dorelink="yes" 23 local dorelink="yes"
24 local dotmp="yes" 24 local dotmp="yes"
25 local doportage="yes" 25 local doportage="yes"
26 local portage="no" 26 local portage="no"
27 local reversedeps="no" 27 local reversedeps="no"
28 local removeinternaldep="no"
29 local deptoremove=""
28 local mylist="" 30 local mylist=""
29 31
30 mylist="$(find_ltmain)" 32 mylist="$(find_ltmain)"
31 for x in ${*} 33 for x in ${*}
32 do 34 do
41 # http://bugzilla.gnome.org/show_bug.cgi?id=75635 43 # http://bugzilla.gnome.org/show_bug.cgi?id=75635
42 if [ "${x}" = "--reverse-deps" ] 44 if [ "${x}" = "--reverse-deps" ]
43 then 45 then
44 reversedeps="yes" 46 reversedeps="yes"
45 fi 47 fi
48 if [ `echo ${x} | grep "^--remove-internal-dep="` ]
49 then
50 removeinternaldep="yes"
51 deptoremove=`echo ${x} | sed -e 's/--remove-internal-dep=//'`
52 fi
46 # Only patch the ltmain.sh in ${S} 53 # Only patch the ltmain.sh in ${S}
47 if [ "${x}" = "--shallow" ] 54 if [ "${x}" = "--shallow" ]
48 then 55 then
49 if [ -f ${S}/ltmain.sh ] 56 if [ -f ${S}/ltmain.sh ]
50 then 57 then
143 ;; 150 ;;
144 esac 151 esac
145 152
146 einfo "Applying libtool-${y/_patch/}.patch..." 153 einfo "Applying libtool-${y/_patch/}.patch..."
147 eval ${y} $>${T}/elibtool.log 154 eval ${y} $>${T}/elibtool.log
148 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] 155 elif [ "${portage}" = "no" ] && [ "${reversedeps}" = "no" ] && [ "${removeinternaldep}" = "no" ]
149 then 156 then
157 # Sometimes ltmain.sh is in a subdirectory ...
158 if [ ! -f ${x}/configure.in -a ! -f ${x}/configure.ac ]
159 then
160 if [ -f ${x}/../configure.in -o -f ${x}/../configure.ac ]
161 then
162 cd ${x}/../
163 fi
164 fi
165
150 ewarn "Cannot apply any patch, running libtoolize..." 166 ewarn "Cannot apply any patch, running libtoolize..."
151 libtoolize --copy --force 167 libtoolize --copy --force
168 cd ${x}
152 break 169 break
153 fi 170 fi
154 done 171 done
155 172
156 if [ "${reversedeps}" = "yes" ] 173 if [ "${reversedeps}" = "yes" ]
157 then 174 then
158 if eval reversedeps_patch --test $>${T}/libtool.foo 175 if eval reversedeps_patch --test $>${T}/libtool.foo
159 then 176 then
160 einfo "Applying libtool-reverse-deps.patch..." 177 einfo "Applying libtool-reverse-deps.patch..."
161 eval reversedeps_patch $>${T}/libtool.foo 178 eval reversedeps_patch $>${T}/libtool.foo
179 else
180 ewarn "Not applying libtool-reverse-deps.patch..."
181 fi
182 fi
183
184 if [ "${removeinternaldep}" = "yes" ]
185 then
186 if eval remove_internal_dep_patch $deptoremove --test $>${T}/libtool.foo
187 then
188 einfo "Applying remove-internal-dep.patch (removing $deptoremove)..."
189 eval remove_internal_dep_patch $deptoremove $>${T}/libtool.foo
190 else
191 ewarn "Not applying libtool-remove-internal-dep.patch..."
162 fi 192 fi
163 fi 193 fi
164 done 194 done
165 195
166 if [ -f libtool ] 196 if [ -f libtool ]
384 fi 414 fi
385 fi 415 fi
386 416
387 ENDPATCH 417 ENDPATCH
388 418
389 retval=$? 419 retval=$?
390 420
391 # This one dont apply clean to libtool-1.4.2a, so do it manually. 421 # This one dont apply clean to libtool-1.4.2a, so do it manually.
392 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ] 422 if [ "${1}" != "--test" ] && [ "${retval}" -eq 0 ]
393 then 423 then
394 cp ltmain.sh ltmain.sh.orig 424 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@:' \ 425 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 426 ltmain.sh.orig > ltmain.sh
397 rm -f ltmain.sh.orig 427 rm -f ltmain.sh.orig
398 fi 428 fi
399 429
400 return ${retval} 430 return ${retval}
401} 431}
402 432
403tmp_patch() { 433tmp_patch() {
404 434
405 local opts="" 435 local opts=""
772 ;; 802 ;;
773 *) tmp_libs="$tmp_libs $deplib" ;; 803 *) tmp_libs="$tmp_libs $deplib" ;;
774 ENDPATCH 804 ENDPATCH
775} 805}
776 806
807remove_internal_dep_patch() {
808 local opts=""
809
810 if [ "${2}" = "--test" ]
811 then
812 opts="--force --dry-run"
813 fi
814
815 patch ${opts} -p0 <<-ENDPATCH
816 --- ltmain.sh.orig 2002-11-01 19:56:50.000000000 -0600
817 +++ ltmain.sh 2002-11-01 19:57:03.000000000 -0600
818 @@ -4551,6 +4551,8 @@
819 if test "\$installed" = yes && test "\$D"; then
820 install_libdir="\`echo "\$install_libdir" |sed -e "s:\$D::g" -e 's://:/:g'\`"
821 fi
822 + # Removing $1 from dependency_libs in .la
823 + dependency_libs=\`echo \$dependency_libs | \$Xsed -e 's%\([^ ]*lib${1}\.\(so\|la\|a\)\)\|\(-l${1}\)%%g'\`
824 \$echo > \$output "\\
825 # \$outputname - a libtool library file
826 # Generated by \$PROGRAM - GNU \$PACKAGE \$VERSION\$TIMESTAMP
827 ENDPATCH
828}
829

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

  ViewVC Help
Powered by ViewVC 1.1.20