+2007-11-23 Guillem Jover <guillem@debian.org>
+
+ * scripts/Dpkg/Arch.pm (get_build_arch): Rename to ...
+ (get_raw_build_arch): ... this.
+ (get_build_arch): New function.
+ (get_host_arch): Rename to ...
+ (get_raw_host_arch): ... this. Use get_raw_build_arch instead of
+ get_build_arch.
+ (get_host_arch): New function.
+ (@EXPORT_OK): Add get_raw_build_arch and get_raw_host_arch.
+ * scripts/dpkg-architecture.pl: Import get_raw_build_arch and
+ get_raw_host_arch instead of get_build_arch and get_host_arch.
+ Fix all callers.
+
2007-11-23 Guillem Jover <guillem@debian.org>
* scripts/dpkg-architecture.pl (%env): Rename to ...
[ Guillem Jover ]
* Add support for Package-Type in dpkg-name.
+ * Restore cross compilation support by honouring the environment host and
+ arch variables to override the default values on the dpkg-dev scripts.
[ Updated man pages translations ]
* Swedish (Peter Karlsson)
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT_OK = qw(get_build_arch get_host_arch get_gcc_host_gnu_type
+our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
+ get_build_arch get_host_arch get_gcc_host_gnu_type
get_valid_arches debarch_eq debarch_is
debarch_to_gnutriplet gnutriplet_to_debarch
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
my $host_arch;
my $gcc_host_gnu_type;
- sub get_build_arch()
+ sub get_raw_build_arch()
{
return $build_arch if defined $build_arch;
return $build_arch;
}
+ sub get_build_arch()
+ {
+ return $ENV{DEB_BUILD_ARCH} || get_raw_build_arch();
+ }
+
sub get_gcc_host_gnu_type()
{
return $gcc_host_gnu_type if defined $gcc_host_gnu_type;
return $gcc_host_gnu_type;
}
- sub get_host_arch()
+ sub get_raw_host_arch()
{
return $host_arch if defined $host_arch;
if (!defined($host_arch)) {
# Switch to native compilation.
- $host_arch = get_build_arch();
+ $host_arch = get_raw_build_arch();
}
return $host_arch;
}
+
+ sub get_host_arch()
+ {
+ return $ENV{DEB_HOST_ARCH} || get_raw_host_arch();
+ }
}
sub get_valid_arches()
use Dpkg;
use Dpkg::Gettext;
use Dpkg::ErrorHandling qw(warning syserr usageerr);
-use Dpkg::Arch qw(get_build_arch get_host_arch get_gcc_host_gnu_type
+use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type
get_valid_arches debarch_eq debarch_is debarch_to_debtriplet
debarch_to_gnutriplet gnutriplet_to_debarch);
DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
-$v{DEB_BUILD_ARCH} = get_build_arch();
+$v{DEB_BUILD_ARCH} = get_raw_build_arch();
$v{DEB_BUILD_GNU_TYPE} = debarch_to_gnutriplet($v{DEB_BUILD_ARCH});
-$v{DEB_HOST_ARCH} = get_host_arch();
+$v{DEB_HOST_ARCH} = get_raw_host_arch();
$v{DEB_HOST_GNU_TYPE} = debarch_to_gnutriplet($v{DEB_HOST_ARCH});
# Set user values: