On Tue, 04 Dec 2007, Neil Williams wrote:
> +my @shlibdeps=();
> +# ARCH for some awkward builds
> +my $crossprefix = Dpkg::Arch::debarch_to_gnutriplet($ENV{ARCH}) if 
> ($ENV{ARCH});

What's the role of $ARCH ? And why shall we consider that we're
crossbuilding only because this variable is set ?

> +# host for normal cross builds.
> +$crossprefix = $ENV{DEB_HOST_GNU_TYPE}
> +    if (($ENV{DEB_HOST_GNU_TYPE}) and ($ENV{DEB_HOST_GNU_TYPE} ne 
> $ENV{DEB_BUILD_GNU_TYPE}));

I think you should use the functions contained in Dpkg::Arch instead of
relying only the environment variables here... 

use Dpkg::Arch qw(get_host_arch get_build_arch debarch_to_gnutriplet);
[...]
if (get_host_arch() ne get_build_arch()) {
    $crossprefix = debarch_to_gnutriplet(get_host_arch());
}

> +# target when building a cross compiler
> +$crossprefix = $ENV{DEB_TARGET_GNU_TYPE}
> +    if (($ENV{DEB_TARGET_GNU_TYPE}) and ($ENV{DEB_TARGET_GNU_TYPE} ne 
> $ENV{DEB_BUILD_GNU_TYPE}));

Why would we need a special treatment of libs when creating a
cross-compiler? The cross-compiler runs on the build arch but is not linked
against any lib of the target arch so it doesn't need to scan the
directories of the target arch.

(I may be missing something here, but I don't see what currently)

> +if ($crossprefix)
> +{
> +    @shlibdeps = ( "${crossprefix}/lib", "/usr/${crossprefix}/lib",
> +    "/${crossprefix}/lib32", "/usr/${crossprefix}/lib32",
> +    "/${crossprefix}/lib64", "/usr/${crossprefix}/lib64",
> +    "/emul/ia32-linux/lib", "/emul/ia32-linux/usr/lib" );
> +}

There's no need for a special escapment of the variables here.
"/usr/$crossprefix/something" works ok.

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/



Reply via email to