Cross compiling libjpeg for Linux on ARM
I am taking this opportunity to document a cross compilation procedure for libjpeg targeting ARM Linux mostly so that I won’t have to go searching for it again in the future!
First create a directory and cd to it:
Now get the source and un-tar it:
Configure the build, specifying your C compiler and cross compilation host, then make:
Here, I am using the xilinx build of the compiler, hence the reference to xilinx in the host and CC parameters, if I wasn’t using the xilinx tools the above configure command may have looked more like this:
Now make install, specifying a directory for the output:
If all goes well the output of the build process should be written to the _install directory, copy the .so files to the appropriate directory on your target device (e.g. /usr/local/lib)
1 2 | mkdir libjpeg_build cd libjpeg_build |
Now get the source and un-tar it:
1 2 3 | wget http://www.ijg.org/files/jpegsrc.v9.tar.gz tar -xzvf jpegsrc.v9.tar.gz |
Configure the build, specifying your C compiler and cross compilation host, then make:
1 2 3 | ./configure --host=arm-xilinx-linux CC=arm-xilinx-linux-gnueabi-gcc make |
Here, I am using the xilinx build of the compiler, hence the reference to xilinx in the host and CC parameters, if I wasn’t using the xilinx tools the above configure command may have looked more like this:
1 | ./configure --host=arm-linux CC=arm-linux-gnueabi-gcc |
Now make install, specifying a directory for the output:
1 | make install DESTDIR=./_install |
If all goes well the output of the build process should be written to the _install directory, copy the .so files to the appropriate directory on your target device (e.g. /usr/local/lib)