dpkg-cross and -config scripts, (e.g. libusb-config)
I am trying to cross-compile a program that uses libusb. I have
installed a dpkg-cross'd version of libusb for this program to build
against and it mostly works.
The difficulty is that the program's configure script calls the
libusb-config script (eg "libusb-config --libs"), but that was removed
from the .deb by dpkg-cross. (And even if it hadn't been removed I
guess that it would have reported wrong paths.) It instead picks up my
native libusb-config and returns "-L/usr/lib -lusb".
I notice that libusb-dev includes a pkg-config .pc file, and "pkg-config
--libs libusb" returns "-lusb". This .pc file is transformed and
retained in the .deb by dpkg-cross so
"PKG_CONFIG_PATH=/usr/armeb-linux/lib/pkgconfig pkg-config --libs
libusb" returns "-L/usr/armeb-linux/lib -lusb".
libusb-config is a self-contained script, not an indirection to pkg-config.
So, I wonder how best to sort this out. Perhaps dpkg-cross could
transform libusb-config; it would work if it just replaced /usr/lib with
/usr/armeb-linux/lib. Perhaps I could replace libusb-config with an
indirection of some sort to pkg-config.
I imagine that this sort of thing is quite common; how has/would anyone
else work around it?
FYI the program I'm trying to build is libftdi, from