Use dpkg --add-architecture if it's available.

Newer versions of dpkg put the information for multiarch in a different
spot.

BUG=None

Review URL: https://codereview.chromium.org/11570071

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174482 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/install-chroot.sh b/build/install-chroot.sh
index e49726d..155fc79 100755
--- a/build/install-chroot.sh
+++ b/build/install-chroot.sh
@@ -587,9 +587,12 @@
   sudo sed -i 's/ / [arch=amd64,i386] /' \
               "/var/lib/chroot/${target}/etc/apt/sources.list"
   [ -d /var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/ ] &&
-  echo foreign-architecture \
-       $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) |
-    sudo sh -c "cat >'/var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/multiarch'"
+  sudo "/usr/local/bin/${target%bit}" dpkg --add-architecture \
+      $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) >&/dev/null ||
+    echo foreign-architecture \
+        $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) |
+      sudo sh -c \
+        "cat >'/var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/multiarch'"
 }
 
 # Configure "sudo" package