Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)

Porting libraries - x264

[ Edited ]

Library name: libx264

Website: http://www.videolan.org/developers/x264.html

Source code: ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2

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>

Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C

Re: Porting libraries - x264

Thanks, very usefull :smileyhappy:

Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course

Re: Porting libraries - x264

Good work!
Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Posts: 145
Registered: ‎05-31-2013
My Device: BlackBerry Z10 Limited Edition

Re: Porting libraries - x264

Call me clueless but isn't this already included in 10.2 Gold SDK?

Posts: 35
Registered: ‎10-15-2013
My Device: BlackBerry Z30

Re: Porting libraries - x264

Posts: 911
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: Porting libraries - x264

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?

Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
Posts: 35
Registered: ‎10-15-2013
My Device: BlackBerry Z30

Re: Porting libraries - x264

[ Edited ]

@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.  

New Contributor
Posts: 3
Registered: ‎09-11-2014
My Device: non-BlackBerry user

Re: Porting libraries - x264

Hi everyone,


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?


Best Regards,


Posts: 35
Registered: ‎10-15-2013
My Device: BlackBerry Z30

Re: Porting libraries - x264

Did you perform the step #1 in the original post? It looks like you're trying to compile the `extras` folder.