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: Donnie Berkholz <dberkholz@g.o>
Subject: Re: [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
Date: Mon, 12 Sep 2011 16:00:20 -0500
On 21:57 Mon 12 Sep     , Michał Górny wrote:
> Right now, autotools-utils.eclass punts .la files only with
> USE=-static-libs. We'd like to broaden the range of it and strip .la
> files when they are not necessary for static linkage as well.
> 
> The following patch introduces an initial support for that. It assumes
> that the .la file can be removed if the library is mentioned in any of
> pkg-config files installed by the package, or if doesn't specify any
> dependency libs nor linker flags.

If I understand correctly, this will break for any packages that don't 
use pkg-config to link. The maintainers will manually need to add 
pkg-config calls to the ebuilds of anything that could statically link 
against a library using only libtool and not pkg-config. Is that 
accurate?

It might be worthwhile to add an easy way to force this argument on for 
every package for the purposes of testing, e.g. an environment variable.

>  # @FUNCTION: remove_libtool_files
> -# @USAGE: [all|none]
> +# @USAGE: [all|only-not-required|none]

Is there a way to document the arguments of eclass functions? You added 
the name of the arg but didn't describe its purpose or why anyone would 
want to use it.

On a semantic note, that argument name (only-not-required) doesn't make 
sense to me. I might do something more helpful like pkgconfig-duplicates 
instead.

> +	if [[ "$1" == 'only-not-required' ]]; then

This is way more quoting than you need within double brackets.

>  	local f
>  	for f in $(find "${D}" -type f -name '*.la'); do
>  		# Keep only .la files with shouldnotlink=yes - likely plugins
>  		local shouldnotlink=$(sed -ne '/^shouldnotlink=yes$/p' "${f}")
>  		if [[  "$1" == 'all' || -z ${shouldnotlink} ]]; then
> +			if [[ "$1" == 'only-not-required' ]]; then

Is there a case where one of those arguments might be $2 but you'd still 
want to run this?

I feel like that shouldnotlink thing is really confusing the logic, 
because there's multiple nested tests for different values of $1 in here 
instead of just testing the args once at the top and setting variables.

> +				# remove .la files only when .pc files provide the libs
> +				# already or they don't give any information
> +				! has $(basename "${f}") ${pc_libs} \
> +						&& [[ -n "$(sed -n \

The comment says "or" but I see an "and" here.

> +							-e "s/^dependency_libs='\(.*\)'$/\1/p" \
> +							-e "s/^inherited_linker_flags='\(.*\)'$/\1/p" \
> +							"${f}")" ]] \
> +						&& continue
> +			fi
> +

-- 
Thanks,
Donnie

Donnie Berkholz
Council Member / Sr. Developer
Gentoo Linux
Blog: http://dberkholz.com
Attachment:
pgpgRu3pjEdD2.pgp (PGP signature)
Replies:
Re: [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
-- Michał Górny
Re: [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
-- Samuli Suominen
References:
[PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
-- Michał Górny
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
[PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
Next by thread:
Re: [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.
Previous by date:
Re: multilib setup
Next by date:
Re: [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs.


Updated Jun 29, 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.