Hi Again ;-) Here is the third, and I hope final installment, of the dpkg-architecture support saga. This patch again supersedes those previously posted. It uses a simpler (and more correct) way of sanitising $CC, and it adds the -f option to the dpkg-architecture call, which is required for correct behaviour when diverted dpkg-shlibdeps is called from diverted dpkg-buildpackage, since otherwise values are taken from the environment rather than the value of the -a option which is what we really want here.
With this and the new ostable/triplettable entries I have now been able to build a complete (and apparently also working!) uclibc-arm toolchain. Cheers, Ron diff --git a/dpkg-cross.pl b/dpkg-cross.pl index 134f783..1a292ce 100644 --- a/dpkg-cross.pl +++ b/dpkg-cross.pl @@ -44,36 +44,18 @@ foreach my $var_ ( @intern_vars ) { $DPKGCROSSVERSION = "1.38"; # Convertion table for Debian GNU/Linux architecture name (``$arch'') to GNU -# type. +# type. This lists additional arch names that are not already supported by +# dpkg-architecture. %archtable = ( - 'i386' => 'i486-linux-gnu', - 'sparc' => 'sparc-linux-gnu', 'sparc64' => 'sparc-linux-gnu', - 'alpha' => 'alpha-linux-gnu', - 'm68k' => 'm68k-linux-gnu', - 'arm' => 'arm-linux-gnu', - 'armeb' => 'armeb-linux-gnueabi', - 'armel' => 'arm-linux-gnueabi', - 'powerpc' => 'powerpc-linux-gnu', + 'armeb' => 'armeb-linux-gnueabi', #XXX This differs from dpkg-architecture 'ppc' => 'powerpc-linux-gnu', - 'mips' => 'mips-linux-gnu', - 'mipsel' => 'mipsel-linux-gnu', - 'sh3' => 'sh3-linux-gnu', - 'sh4' => 'sh4-linux-gnu', - 'sh3eb' => 'sh3eb-linux-gnu', - 'sh4eb' => 'sh4eb-linux-gnu', - 'hppa' => 'hppa-linux-gnu', - 'hurd-i386' => 'i386-gnu', - 's390' => 's390-linux-gnu', - 's390x' => 's390-linux-gnu', - 'ia64' => 'ia64-linux-gnu', - 'm32r' => 'm32r-linux-gnu', - 'openbsd-i386' => 'i386-openbsd', - 'freebsd-i386' => 'i386-freebsd', - 'darwin-powerpc' => 'powerpc-darwin', - 'darwin-i386' => 'i386-darwin', - 'win32-i386' => 'i386-cygwin', - 'amd64' => 'x86_64-linux-gnu'); + 'hurd-i386' => 'i386-gnu', #XXX This differs from dpkg-architecture + 's390x' => 's390-linux-gnu', #XXX This differs from dpkg-architecture + 'openbsd-i386' => 'i386-openbsd', #XXX This differs from dpkg-architecture + 'freebsd-i386' => 'i386-freebsd', #XXX This differs from dpkg-architecture + 'darwin-i386' => 'i386-darwin', #XXX This differs from dpkg-architecture + 'win32-i386' => 'i386-cygwin'); # Regexps to parse 'file' output to detect arch of ELF binary # Note that it is not always possibe to restore Debian architecture @@ -275,8 +257,10 @@ sub setup { # Set ``$arch'' to defaults if not already specified. $arch = get_architecture(); die "$progname: Architecture is not specified.\n" unless ($arch); - $deb_host_gnu_type = $archtable{$arch}; # FIXME: should use dpkg-architecture here - + + chomp($deb_host_gnu_type = `CC="" dpkg-architecture -f -a$arch -qDEB_HOST_GNU_TYPE 2> /dev/null`); + $deb_host_gnu_type ||= $archtable{$arch}; + # Finalize, no subst possible crossbase. $crossbase ||= "/usr"; @@ -443,6 +427,12 @@ sub get_tool { return $t_ if ($t_); } + my $prefix_ = `CC="" dpkg-architecture -f -a$arch_ -qDEB_HOST_GNU_TYPE 2> /dev/null`; + if( chomp($prefix_) ) { + my $t_ = find_in_path($prefix_ . "-" . $tool_); + return $t_ if ($t_); + } + if (defined($crossprefixtable{$arch_})) { my @l_ = @{$crossprefixtable{$arch_}}; # move $crossprefix to the first place in the list -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]