Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Cross-compiling Paho C libraries

This is the first time that I've heard the word "gerrit", but I'll have a look.


On 03/25/2014 06:59 PM, Ian Craggs wrote:
Hi Frank,

sounds reasonable.  I'll open a bug for tracking (and doing).  You could submit a patch via gerrit, if you feel inclined.


On 03/24/2014 04:58 PM, Frank Pagliughi wrote:
Hello Ian and All,

I was just looking into cross-compiling the C libraries for an ARM/Linux target. It looks like it could work pretty easily, but the problem is that the Makefile is forcing the CC variable to "gcc" in all instances. What we want is to be able to use a cross-compiling variant, like "arm-linux-gcc", "arm-none-linux-gnueabi-gcc", or similar, as the user desires.

What looks to be simple and easy it to introduce a CROSS_COMPILE Make variable, which would normally resolve to an empty string for a host build, but could be set on the command line to specify a GCC prefix. In the Makefile, just assign all of the tools that are used to respect the prefix, like:
 I would then, probably also want to direct the output to a specific location for this build. Maybe use the prefix to name a specific build directory. Something like:
ifndef blddir
  blddir = build/$(CROSS_COMPILE)output
And then the library can be cross-compiled with:
$ make CROSS_COMPILE=arm-linux-
I tried this and it works nicely, but I was also cross-compiling from a Linux host. I assume that we would also need to set the target OS. Can that already be done by setting the TARGET_PLATFORM variable as well?


paho-dev mailing list

Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Committer on Paho, Mosquitto

paho-dev mailing list

Back to the top