Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Michał Górny <mgorny@g.o>
Subject: [PATCH autotools-utils 8/9] Remove static libs covered by .pc files as well.
Date: Tue, 13 Sep 2011 16:10:32 +0200
---
 eclass/autotools-utils.eclass |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 9d7e134..2e01dcc 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -156,6 +156,15 @@ remove_libtool_files() {
 		esac
 	fi
 
+	local pc_libs=()
+	if [[ ! ${removing_all} ]]; then
+		local arg
+		for arg in $(find "${D}" -name '*.pc' -exec \
+					sed -n -e 's;^Libs:;;p' {} +); do
+			[[ ${arg} == -l* ]] && pc_libs+=(lib${arg#-l}.la)
+		done
+	fi
+
 	local f
 	find "${D}" -type f -name '*.la' -print0 | while read -r -d '' f; do
 		local shouldnotlink=$(sed -ne '/^shouldnotlink=yes$/p' "${f}")
@@ -174,10 +183,12 @@ remove_libtool_files() {
 		# Remove .la files when:
 		# - user explicitly wants us to remove all .la files,
 		# - respective static archive doesn't exist,
+		# - they are covered by a .pc file already,
 		# - they don't provide any new information (no libs & no flags).
 		local removing
 		if [[ ${removing_all} ]]; then removing=1
 		elif [[ ! -f ${archivefile} ]]; then removing=1
+		elif has "$(basename "${f}")" "${pc_libs[@]}"; then removing=1
 		elif [[ ! $(sed -n -e \
 			"s/^\(dependency_libs\|inherited_linker_flags\)='\(.*\)'$/\2/p" \
 			"${f}") ]]; then removing=1
-- 
1.7.6.1



References:
[PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
-- Michał Górny
[PATCH autotools-utils 1/9] Fix handling whitespace in filenames when looking for .la files.
-- Michał Górny
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
[PATCH autotools-utils 5/9] Check command-line args completely in remove_libtool_files().
Next by thread:
[PATCH autotools-utils 3/9] For .la removal, look for static archives rather than USE=static-libs.
Previous by date:
[PATCH autotools-utils 5/9] Check command-line args completely in remove_libtool_files().
Next by date:
[PATCH autotools-utils 3/9] For .la removal, look for static archives rather than USE=static-libs.


Updated Jun 23, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.