Android/NSPR

From MozillaWiki
< Android
Revision as of 00:45, 24 March 2010 by AlexPakhotin (talk | contribs) (Created page with '=NSPR for Android= ==Building== As mentioned on the main Android page, create a nspr directory, configure nspr, and build it: $ mkdir nspr $ cd nspr $ $moz/nsprpu…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

NSPR for Android

Building

As mentioned on the main Android page, create a nspr directory, configure nspr, and build it:

$ mkdir nspr
$ cd nspr
$ $moz/nsprpub/configure \
   --target=arm-android-eabi \
   --with-android-ndk=$NDK 
$ make -s

bug 542113 "Add support for building NSPR on Android" resolves some build issues.

Tests

If you get errors compiling NSPR tests, this patch from the bug 542113 may help.

Running

Copy all the tests to /data/local/nspr on the device or emulator using

$ adb push $file /data/local/nspr

Copy the libraries as well:

$ adb push $objdir/nsprpub/pr/src/libnspr4.so /data/local/nspr
$ adb push $objdir/nsprpub/lib/libc/src/libplc4.so /data/local/nspr

Run the shell, add the nspr dir to the LD_LIBRARY_PATH environment variable, and you are ready to go:

$ adb shell

# cd /data/local/nspr
# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
# ./env -d

PASSED