Okay, in that second job, autoconf does not detect that it's a cross-compile, just like for me.
I think I found the problem with .libs:
You're using libtool 1.5.26. I'm on 2.2.6b.
$ libtoolize --version
libtoolize (GNU libtool) 2.2.6b
Written by Gary V. Vaughan <email@example.com>, 2003
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ which libtoolize
$ dpkg -S /usr/bin/libto
$ dpkg -S /usr/bin/libtoolize
$ apt-cache show libtool
Maintainer: Ubuntu Developers <firstname.lastname@example.org>
Original-Maintainer: Kurt Roeckx <email@example.com>
I'm guessing that's it. It looks like Lenny has a much older version than Lucid. 2.2.6b is in Lenny backports, FWIW.
I'll just make a version of the script that works with both the older and newer version.