Closed antis81 closed 7 years ago
I'll take a proper look at this tonight, but typically the trick is to run the configure script inside rpxc, rather than have configure call rpxc-wrapped tools.
I'd try removing the -device-option CROSS_COMPILE=${CC}
line and then running it as rpxc ./your-configure-script
.
There's a bunch of environment variables pre-set in rpxc which can be handy: --host $HOST
comes up quite a bit.
Thanks for the quick reply! Yeah, I needed some time to understand how stuff works. :smile: Anyway, rpxc env
(same with rpxc -- env
) outputs the correct environment vars, but up to now I couldn't manage to hand the environment over to the configure script. I already tried with -device-option CROSS_COMPILE=$CROSS_COMPILE
without luck. I'll follow your advice and try it without that option.
I've built a docker image against my not-yet-released onbuild branch. This branch has a sort-of-hacky install-raspbian script which installs raspbian dev packages into the embedded sysroot.
Give this a try, it should get you at least part-way there.
Create a Dockerfile with:
FROM sdt4docker/raspberry-pi-cross-compiler:qt-testing
# Install native debian build tools
RUN install-debian build-essential
# Install raspberry pi dev packages
RUN install-raspbian libgles2-mesa-dev zlib1g zlib1g-dev
(Don't put it in the same tree as the qt sources. The docker context will be huge.)
Then create yourself a custom downstream image to build with:
export RPXC_IMAGE=rpxc-qt
docker build -t $RPXC_IMAGE .
With the RPXC_IMAGE
environment variable set to your custom image, rpxc
will automatically use that.
Then you should be able to start building with:
# Make sure these are single quotes, not double quotes.
# You want the $VARS to be expanded inside the container, not in your shell.
rpxc bash -c './configure -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=$CROSS_COMPILE [other options]'
All the other non-cross-compile options will work. Your $WD
should probably become /build
as that's where your $PWD
gets mounted in the running container. I don't think you need -sysroot
, but if you do, set it to $RASPBIAN_ROOT
.
There's still a bunch of raspbian packages you'll need to add. The basic flow is to build, see where it bombs out, add that package with install-raspbian
, build a new docker image and try again.
In that scenario its quicker to keep adding entire new RUN install-raspbian $package
lines.
With any luck, you'll eventually get all the dependencies and it will build successfully.
Closing as part of an old issue tidy-up. Please create a new issue if necessary.
I'm writing a script to cross-compile Qt with rpxc and got a bit stuck on the "configure" step of Qt5 cross compile. It expects an attribute pointing to the cross-compile toolchain. Complete call looks like this:
The compiler is suffixed by the configure script (e.g. with "gcc"). Any idea how to get this right?