Welcome!

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

Reply
Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Developing for BlackBerry using Interix (SFU/SUA)

[ Edited ]

For the other like three people out there who use Interix (SFU/SUA) and want to be able to do PlayBook development from within their Korn Shell prompt, you might find the following script handy:

 

# This script is sets environment variables requires to use this version of NDK
# from the command line. To use the script, you have to "source" it into your shell,
# source bbndk-env-interix.sh
# if source command is not available use "." (dot) command instead
#
# This script is intended for use with Microsoft's Interix, known better as
# Services for Unix (SFU) or Subsystem for Unix Applications (SUA).
#
QNX_TARGET="C:/bbndk-2.0.1/target/qnx6"
QNX_HOST="C:/bbndk-2.0.1/host/win32/x86"
QNX_CONFIGURATION="D:/Users/USERNAME/Local Settings/Application Data/Research In Motion/BlackBerry Native SDK"
MAKEFLAGS="-I$QNX_TARGET/usr/include"
#PATH="$(winpath2unix "$QNX_HOST")/usr/bin:$(winpath2unix "$QNX_CONFIGURATION")/bin:$(winpath2unix "$QNX_HOST")/usr/qde/eclipse/jre/bin:$PATH"
PATH_WINDOWS="$QNX_HOST/usr/bin:$QNX_CONFIGURATION/bin:$QNX_HOST/usr/qde/eclipse/jre/bin:$PATH_WINDOWS"

export QNX_TARGET QNX_HOST QNX_CONFIGURATION MAKEFLAGS LD_LIBRARY_PATH PATH PATH_WINDOWS

for path in \
		"$(winpath2unix "$QNX_HOST")/usr/bin" \
		"$(winpath2unix "$QNX_CONFIGURATION")/bin" \
		"$(winpath2unix "$QNX_HOST")/usr/qde/eclipse/jre/bin" \
	; do
	if [ -d "$path" ]; then
		for ext in exe bat; do
			for file in "$path"/*.$ext; do
				alias $(basename $file .$ext)="runwin32 \"$(posixpath2nt $file)\""
			done
		done
	fi
done

 

For more information about this script, please see the article I've written about it.

 

 

NOTE: Chances are that if you don't already know what Interix/SFU/SUA is/are, you probably aren't interested in the above script. Interix (the Windows POSIX subsystem) is only available on Windows XP Professional, Vista/7 Ultimate, the Server SKUs, and presumably it will still be included (though deprecated) in 8 (as it is also NT 6 like Vista and "7").

 

I do have an MSYS script as well I could post if anyone's interested, but that is a trivial change that I probably should file a bug report about to make the default bbndk-env.sh sane on at least one POSIXy environment for Windows. (The $PATH issue isn't a concern with MSYS [at least with NDK 2.0.1, untested with 10] due to the NDK's $QNX_HOST binaries being compiled with MingW.)



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! Smiley Very Happy