| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2010 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.19 2011/09/16 15:38:40 mgorny Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.20 2011/09/16 15:38:54 mgorny Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: autotools-utils.eclass |
5 | # @ECLASS: autotools-utils.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Maciej Mrozowski <reavertm@gentoo.org> |
7 | # Maciej Mrozowski <reavertm@gentoo.org> |
| 8 | # Michał Górny <mgorny@gentoo.org> |
8 | # Michał Górny <mgorny@gentoo.org> |
| … | |
… | |
| 184 | # - user explicitly wants us to remove all .la files, |
184 | # - user explicitly wants us to remove all .la files, |
| 185 | # - respective static archive doesn't exist, |
185 | # - respective static archive doesn't exist, |
| 186 | # - they are covered by a .pc file already, |
186 | # - they are covered by a .pc file already, |
| 187 | # - they don't provide any new information (no libs & no flags). |
187 | # - they don't provide any new information (no libs & no flags). |
| 188 | local removing |
188 | local removing |
| 189 | if [[ ${removing_all} ]]; then removing=1 |
189 | if [[ ${removing_all} ]]; then removing='forced' |
| 190 | elif [[ ! -f ${archivefile} ]]; then removing=1 |
190 | elif [[ ! -f ${archivefile} ]]; then removing='no static archive' |
| 191 | elif has "$(basename "${f}")" "${pc_libs[@]}"; then removing=1 |
191 | elif has "$(basename "${f}")" "${pc_libs[@]}"; then |
|
|
192 | removing='covered by .pc' |
| 192 | elif [[ ! $(sed -n -e \ |
193 | elif [[ ! $(sed -n -e \ |
| 193 | "s/^\(dependency_libs\|inherited_linker_flags\)='\(.*\)'$/\2/p" \ |
194 | "s/^\(dependency_libs\|inherited_linker_flags\)='\(.*\)'$/\2/p" \ |
| 194 | "${f}") ]]; then removing=1 |
195 | "${f}") ]]; then removing='no libs & flags' |
| 195 | fi |
196 | fi |
| 196 | |
197 | |
| 197 | if [[ ${removing} ]]; then |
198 | if [[ ${removing} ]]; then |
| 198 | einfo "Removing unnecessary ${f#${D%/}}" |
199 | einfo "Removing unnecessary ${f#${D%/}} (${removing})" |
| 199 | rm -f "${f}" || die |
200 | rm -f "${f}" || die |
| 200 | fi |
201 | fi |
| 201 | done |
202 | done |
| 202 | } |
203 | } |
| 203 | |
204 | |