10-14-2013 01:56 PM - last edited on 09-15-2014 12:14 PM by doturner
Library name: libx264
Build system: autotools
First, make sure your environment is configured for command line development, and that you have autotools installed.
Changes to configure script
The QNX specific part of the configure script adds the 'extras' directory to the include path, but the files in there can only be compiled by Microsoft Visual studio. Fix this by opening configure, looking for the section starting with '*qnx*)' and commenting out the following line:
Configuring for QNX ARM (for devices)
./configure --host=arm-nto-qnx --cross-prefix=arm-unknown-nto-qnx8.0.0eabi- --disable-cli --enable-static --enable-shared --disable-asm --prefix=`pwd`/build/arm-qnx/release
Configuring for QNX x86 (for simulator)
./configure --host=x86-nto-qnx --cross-prefix=i486-pc-nto-qnx8.0.0- --disable-cli --enable-static --enable-shared --disable-asm --enable-debug --prefix=`pwd`/build/x86-qnx/debug
Configure flags explained
Here's what the configure flags do:
--host. This is used by the configure script to determine which host architecture we're building for. In this case the important part is: qnx. In configure you'll find a switch statement which matches *qnx* and sets up the build accordingly.
--cross-prefix. This identifies the prefix which should be used when calling the build tools. For example, instead of calling gcc, we'll call arm-unknown-nto-qnx8.0.0eabi-gcc.
--disable-cli. Don't build the command line interface. I've assumed that the library will be called directly when running on the device, rather than from the command line.
--enable-static and --enabled-shared. Build static and shared libraries.
--disable-asm. Disable the platform specific assembler optimisation. Without this configure will look for yasm. But yasm isn't compatible with ARM so we cannot use it for optimisations.
--prefix. Specifies the installation directory for the libraries, headers and executables. I use the convention "build/<qnx_variant>/<build_type>" where qnx_variant can be arm-qnx or x86-qnx and build_type can be release or debug.
make -j8 make install
Note: the -j flag simply specifies the number of cores I want to use during compilation. It can dramatically decrease build times.
Because I used the --prefix flag the library and header files will be installed under build/<qnx_variant>/<build_type>
01-18-2014 02:51 AM
I'm just getting started with porting to BB10, and I plan to try out a few of these examples to learn how it all works. I'm primarily a Windows developer (have been since the mid 1980's) although I have some familiarity with POSIX platforms. I'm wondering about the requirement for autotools, since this is not normally something present on Windows.
Are these instructions assuming a POSIX environment like Linux (which I can set up in a VM if I MUST), or is it suitable to use MinGW or GnuWin32 for autotools? Does anyone have experience building these libaries on Windows since that would be my preference?
02-19-2014 06:00 AM - edited 02-19-2014 06:01 AM
@greenmr This seems like an excellent topic for a new thread. If you start the thread and then message me I'll ask my Windows colleagues to take a look.
09-12-2014 07:26 AM
I am trying to build libx264 for ARM QNX platform. I am using an Ubuntu machine with a cross compiler for ARM. When I `make' the libx264 source package I get a lot of errors.
I used the ./config line as previously suggested:
./configure --host=arm-nto-qnx --cross-prefix=arm-unknown-nto-qnx6.5.0- --disable-cli --enable-static --enable-shared --enable-debug --disable-asm --prefix=`pwd`/build/arm-qnx
The first errors when running `make':
arm-unknown-nto-qnx6.5.0-gcc -Wshadow -O1 -g -Wall -I. -I. -I./extras -std=gnu99 -fPIC -fno-tree-vectorize -c -o common/mc.o common/mc.c In file included from common/osdep.h:35, from common/common.h:117, from common/mc.c:27: ./extras/inttypes.h:33:2: error: #error "Use this header only with Microsoft Visual C++ compilers!" In file included from ./extras/inttypes.h:43, from common/osdep.h:35, from common/common.h:117, from common/mc.c:27: ./extras/stdint.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int64_t' ./extras/stdint.h:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'uint64_t' ./extras/stdint.h:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int_least64_t' ./extras/stdint.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'uint_least64_t' ./extras/stdint.h:56: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int_fast64_t' ./extras/stdint.h:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'uint_fast64_t' ./extras/stdint.h:64: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'intmax_t' ./extras/stdint.h:65: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'uintmax_t'
The full error log can be found here: link to log
I googled these problems but could not find a solution yet. Any suggestions?