diff -urN origs/sqlite3-3.7.15.2/aclocal.m4 sqlite3-3.7.15.2/aclocal.m4
diff -urN origs/sqlite3-3.7.15.2/config.guess sqlite3-3.7.15.2/config.guess
diff -urN origs/sqlite3-3.7.15.2/config.h.in sqlite3-3.7.15.2/config.h.in
diff -urN origs/sqlite3-3.7.15.2/config.sub sqlite3-3.7.15.2/config.sub
diff -urN origs/sqlite3-3.7.15.2/configure sqlite3-3.7.15.2/configure
diff -urN origs/sqlite3-3.7.15.2/debian/changelog sqlite3-3.7.15.2/debian/changelog
--- origs/sqlite3-3.7.15.2/debian/changelog	2013-01-15 17:38:17.000000000 +0000
+++ sqlite3-3.7.15.2/debian/changelog	2013-01-21 23:01:41.000000000 +0000
@@ -1,3 +1,9 @@
+sqlite3 (3.7.15.2-1ubuntu1) precise; urgency=low
+
+  * use dh_autoreconf to update config.sub,guess for arm64
+
+ -- Wookey <wookey@wookware.org>  Mon, 21 Jan 2013 22:52:27 +0000
+
 sqlite3 (3.7.15.2-1) unstable; urgency=low
 
   * New upstream release.
diff -urN origs/sqlite3-3.7.15.2/debian/control sqlite3-3.7.15.2/debian/control
--- origs/sqlite3-3.7.15.2/debian/control	2012-05-16 12:20:46.000000000 +0100
+++ sqlite3-3.7.15.2/debian/control	2013-01-22 04:11:43.000000000 +0000
@@ -2,7 +2,7 @@
 Section: devel
 Priority: optional
 Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.hu>
-Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 8.1.3), autoconf (>= 2.59), libtool (>= 1.5.2), automake, autotools-dev, chrpath, libreadline-dev, tcl8.5-dev
+Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 8.1.3), autoconf (>= 2.59), libtool (>= 1.5.2), automake, autotools-dev, dh-autoreconf, chrpath, libreadline-dev, tcl8.5-dev (> 8.5.11-2)
 Build-Conflicts: tcl8.4, tcl8.4-dev
 Homepage: http://www.sqlite.org/
 Standards-Version: 3.9.3
diff -urN origs/sqlite3-3.7.15.2/debian/rules sqlite3-3.7.15.2/debian/rules
--- origs/sqlite3-3.7.15.2/debian/rules	2012-05-16 12:34:33.000000000 +0100
+++ sqlite3-3.7.15.2/debian/rules	2013-01-22 10:33:42.000000000 +0000
@@ -20,10 +20,10 @@
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-  confflags += --build $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/lib/tcl8.5
+  confflags += --build $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl8.5
   export CROSS_BUILDING=no
 else
-  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/$(DEB_HOST_GNU_TYPE)/lib/tcl8.5 LDFLAGS=-L/usr/$(DEB_HOST_GNU_TYPE)/lib
+  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl8.5
   export CROSS_BUILDING=yes
 endif
 
@@ -40,7 +40,7 @@
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
-	autoconf
+	dh_autoreconf
 	./configure --prefix=/usr --mandir="/usr/share/man" \
 	  $(confflags) --enable-threadsafe \
 	  --enable-load-extension \
@@ -75,6 +75,7 @@
 	[ ! -f Makefile ] || $(MAKE) distclean
 	rm -f config.h
 	rm -f debian/libsqlite3-0.install debian/libsqlite3-dev.install
+	dh_autoreconf_clean
 	dh_clean
 
 install: build
@@ -94,12 +95,18 @@
 
 	# Create the pkgIndex.tcl file for the Tcl module. This generated file
 	# actually turns out to be relocatable.
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
 	echo "pkg_mkIndex -verbose $(DESTDIR)/usr/lib/tcltk/sqlite3" | \
 		LD_LIBRARY_PATH=$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH) \
 		tclsh8.5
 	grep -q 'package ifneeded sqlite3' \
 		$(DESTDIR)/usr/lib/tcltk/sqlite3/pkgIndex.tcl || \
 		(echo "pkgIndex.tcl seems to be wrong" && exit 1)
+else
+	# not at all clear how to do this cross. It should end up with
+        # header boilerplate followed by:
+	# package ifneeded sqlite3 3.7.13 [list load [file join $dir libtclsqlite3.so]]
+endif
 
 binary-indep: build install
 	dh_testdir
diff -urN origs/sqlite3-3.7.15.2/install-sh sqlite3-3.7.15.2/install-sh
diff -urN origs/sqlite3-3.7.15.2/ltmain.sh sqlite3-3.7.15.2/ltmain.sh
