Skip to content

Instantly share code, notes, and snippets.

@Paxa
Last active April 1, 2020 04:25
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Paxa/8916618 to your computer and use it in GitHub Desktop.
Save Paxa/8916618 to your computer and use it in GitHub Desktop.
Cross-compiling wget for blackberry 10 (QNX)

How to compile wget for blackberry 10

Prepare

  1. Download from here http://ftp.gnu.org/gnu/wget/
  2. Extract sources archive, (using extract for example)
  3. Or run tar xf wget-1.15.tar.xz
  4. Copy file bb10_compile from this gist to source folder

Compile

cd wget-1.15
chmod +x bb10_compile
./bb10_compile

If it worked well then run make:

# load variables
tmp_pwd=`pwd`; cd /Applications/Momentics.app && source bbndk-* && cd $tmp_pwd; unset tmp_pwd;
make

No you can see ./src/wget - executable for blackberry.

Run

You can put ./src/wget to your application and upload to phone. Then run with ssh.


If you can't compile, this is download link https://dl.dropboxusercontent.com/u/586048/bb10/wget

#! /bin/sh
tmp_pwd=`pwd`
cd /Applications/Momentics.app && source bbndk-* && cd $tmp_pwd
QNX_BINS="${QNX_HOST}/usr/bin"
./configure CC="${QNX_BINS}/qcc" CXX="${QNX_BINS}/qcc" \
LDFLAGS="-Vgcc_ntoarmv7le" RANLIB="ntoarmv7-ranlib" AR="ntoarmv7-ar" \
CFLAGS="-Vgcc_ntoarmv7le" \
OS=qnx6 --target=armv7 \
--host=armv7 --with-ssl=openssl
@oddboy
Copy link

oddboy commented Feb 12, 2014

bb10_compile above is written for Mac?

@Paxa
Copy link
Author

Paxa commented Feb 13, 2014

Yes, but it should work on linux too if you change /Applications/Momentics.app
On windows - I don't know. May be you can just import .h and binary files

@yamsergey
Copy link

How did you make it run on the device? I can't make it executable. chmod/umask/tar -p doesn't work for me :( Always end up with can't execute: need permissions

@yamsergey
Copy link

Ok. Figured that out. I can't change files permissions in folders owned by root which is all folders created from the file manager. But can do whatever I want from term48 home folder. And it works. Thanks for the script 👍

@lwiechec
Copy link

lwiechec commented Nov 4, 2018

Hi, I tried to compile wget 1.19 (latest at this time) and it looks like the Momentics C compiler (SDK version 10.3.1.12) cannot handle it:

...
make[3]: Entering directory '/home/luke/fun/blackberry/wget-1.19/src'
  CC       connect.o
In file included from wget.h:217:0,
                 from connect.c:32:
log.h:44:6: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
log.h:45:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
In file included from connect.c:63:0:
utils.h:78:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
  CC       convert.o
In file included from wget.h:217:0,
                 from convert.c:31:
log.h:44:6: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
log.h:45:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
In file included from convert.c:42:0:
utils.h:78:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
  CC       cookies.o
In file included from wget.h:217:0,
                 from cookies.c:46:
log.h:44:6: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
log.h:45:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
In file included from cookies.c:58:0:
utils.h:78:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
  CC       ftp.o
In file included from wget.h:217:0,
                 from ftp.c:32:
log.h:44:6: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
log.h:45:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
In file included from ftp.c:43:0:
utils.h:78:1: warning: 'libintl_printf' is an unrecognized format function type [-Wformat]
ftp.c: In function 'getftp':
ftp.c:1466:18: error: 'struct options' has no member named 'rpl_unlink'
cc: /home/luke/fun/blackberry/bbndk/host_10_3_1_12/linux/x86/usr/lib/gcc/arm-unknown-nto-qnx8.0.0eabi/4.6.3/cc1 error 1
Makefile:1651: recipe for target 'ftp.o' failed
make[3]: *** [ftp.o] Error 1
make[3]: Leaving directory '/home/luke/fun/blackberry/wget-1.19/src'
Makefile:1466: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/luke/fun/blackberry/wget-1.19/src'
Makefile:1456: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/luke/fun/blackberry/wget-1.19'
Makefile:1412: recipe for target 'all' failed
make: *** [all] Error 2

(full report here).

Would that mean that Wget 1.19 is - 'too new' ?

Any hint would be extremely apreciated! :)

@lwiechec
Copy link

lwiechec commented Nov 5, 2018

hmm, compilation was successful with wget-1.19.5. Strange.

@karawitan
Copy link

Just to let you know, Wget is included in Berrymuch , the " Power user Unix distribution for Blackberry 10 "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment