I have a raspberry PI with Emdebian installed on it and you want to cross-compile projects.
There is a lot of documentation on how to get the tool chain and build a simple project with it. I myself managed to build a toolchain with crosstool-ng and wrote a welcome program that works great.
I don’t understand how to handle cross-compiling more complex projects like Qt, which have dependencies on other libraries . Let me use libdbus as an example, as this is one of the Qt dependencies.
Installed Emdebian already contains libdbus.so, so naturally, I would prefer to use this instead of cross-compiling my own libdbus.so, since it takes a lot of time to compile all Qt dependencies.
For cross-compilation, as I understand it, there are two important directories:
- The staging directory , where all installed libraries and applications are stored. First, this is a copy of the sysroot toolchain and is populated with a large number of libraries because they are cross-compiled.
- The rootfs directory , which is equivalent to what is on the device, is essentially a copy of the staging directory without unnecessary materials such as documentation and header files. As far as I understand, the best approach is to copy the necessary files from the intermediate directory to rootfs.
Getting the rootfs directory is easy, as it might be mounting NFS from the device. But how do I get an intermediate directory for an existing installation of Emdebian in PI? Elements such as dbus headers that are not installed on root files should be included in the staging directory.
dbus , apt-get install libdbus-dev, rootfs . , , rootfs , .. , , , .
dbus ? ?
, , ? libc, libstd++ .., , ? , crosstool-ng?
( , , Qt, . , /rootfs)