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

Diff of /eclass/libtool.eclass

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

Revision 1.1 Revision 1.5
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.1 2002/06/05 22:53:11 azarah Exp $ 5# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.5 2002/06/10 18:25:04 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
14elibtoolize() { 14elibtoolize() {
15 15
16 local x="" 16 local x=""
17 local y="" 17 local y=""
18 local dopatch="no" 18 local dopatch="no"
19 local dotest="yes"
20 local dorelink="yes"
21 local doportage="yes"
22 local portage="no"
23 local mylist=""
19 24
20 for x in $(find_ltmain) 25 mylist="$(find_ltmain)"
26 # Only apply portage patch, and dont "libtoolize --copy --force"
27 # if all patches fail.
28 for x in ${*}
29 do
30 if [ "${x}" = "--portage" ]
31 then
32 portage="yes"
33 fi
34 # Only patch the ltmain.sh in ${S}
35 if [ "${x}" = "--shallow" ]
36 then
37 if [ -f ${S}/ltmain.sh ]
38 then
39 mylist="${S}"
40 else
41 mylist=""
42 fi
43 else
44 mylist="$(find_ltmain)"
45 fi
46 done
47
48 for x in ${mylist}
21 do 49 do
22 cd ${x} 50 cd ${x}
23 einfo "Working directory: ${x}..." 51 einfo "Working directory: ${x}..."
24 dopatch="yes" 52 dopatch="yes"
25 53 dotest="yes"
54 dorelink="yes"
55 doportage="yes"
56
26 for y in test_patch relink_patch portage_patch 57 for y in test_patch relink_patch portage_patch
27 do 58 do
28 if ! eval ${y} --test $>${T}/libtool.foo 59 if ! eval ${y} --test $>${T}/libtool.foo
29 then 60 then
61 case ${y} in
62 test_patch)
63 # non critical patch
64 dotest="no"
65 ;;
66 relink_patch)
67 # critical patch, but could be applied
68 if [ -z "$(grep -e "inst_prefix_dir" ltmain.sh)" ] && \
69 [ "${portage}" = "no" ]
70 then
71 dopatch="no"
72 fi
73 dorelink="no"
74 ;;
75 portage_patch)
76 # critical patch
77 if [ "${portage}" = "yes" ]
78 then
79 echo
80 eerror "Portage patch requested, but failed to apply!"
81 die
82 fi
30 dopatch="no" 83 dopatch="no"
31 break 84 doportage="no"
85 ;;
86 esac
32 fi 87 fi
33 done 88 done
34 89
35 for y in test_patch relink_patch portage_patch 90 for y in test_patch relink_patch portage_patch
36 do 91 do
37 if [ "${dopatch}" = "yes" ] 92 if [ "${dopatch}" = "yes" ]
38 then 93 then
94 case ${y} in
95 test_patch)
96 if [ "${dotest}" = "no" ]
97 then
98 continue
99 fi
100 ;;
101 relink_patch)
102 if [ "${dorelink}" = "no" ]
103 then
104 continue
105 fi
106 ;;
107 portage_patch)
108 if [ "${doportage}" = "no" ]
109 then
110 continue
111 fi
112 ;;
113 esac
114
39 einfo "Applying libtool-${y/_patch/}.patch..." 115 einfo "Applying libtool-${y/_patch/}.patch..."
40 eval ${y} $>${T}/libtool.foo 116 eval ${y} $>${T}/libtool.foo
41 else 117 elif [ "${portage}" = "no" ]
118 then
42 libtoolize --copy --force 119 libtoolize --copy --force
43 break 120 break
44 fi 121 fi
45 done 122 done
46 done 123 done

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20