|Re: [paho-dev] not a shared executable|
On 08/23/2013 06:18 AM, Ian Craggs wrote:
The "--build" and "--host" options to the configure script allow you to set things up each time you compile. You set the build to your PC and the host to the target platform/compiler, like:
./configure --build=i686-pc-linux-gnu --host=arm-eabiBy making them different, it knows that you're cross-compiling and will use the compiler "arm-eabi-gcc", and so on.
You can also use the "--prefix" option to set the install directory, so that you can have a bunch of different versions on your computer (one for Raspberry Pi, one for Beaglebone, etc).
./configure --build=i686-pc-linux-gnu --host=arm-linux --prefix=/opt/xlibs/arm-linuxIf you compile natively on any platform, you don't worry about the settings. Just:
./configureAfter you configure, you run "make" and "make install", and the libraries are where you requested.
That's the beauty of this... You don't have to worry about the different targets, assuming that they are Linux/gcc.
And it is very consistent across libraries. A very large percentage of Linux libraries can be cross-compiled in this manner, whether or not that was the author's intent. It just works.
With just a makefile, someone new would have to start searching through the file to find out how to cross-compile. With a configure script, it's consistent with much of the rest of the Linux world.
Agreed, this is only for Linux, mainly for gcc. Some other system, such as Ant my encompass both. But most Linux C developers are probably not familiar with using Ant.
Back to the top