Mobile/Symbian/NSPR: Difference between revisions

Line 46: Line 46:
* Get Mozilla source tree, by either [http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS CVS] or [http://developer.mozilla.org/en/docs/Download_Mozilla_Source_Code FTP download].
* Get Mozilla source tree, by either [http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS CVS] or [http://developer.mozilla.org/en/docs/Download_Mozilla_Source_Code FTP download].
* Apply the [https://bugzilla.mozilla.org/attachment.cgi?id=324584 patch] against the tree, at <tt>mozilla/nsprpub/</tt>.
* Apply the [https://bugzilla.mozilla.org/attachment.cgi?id=324584 patch] against the tree, at <tt>mozilla/nsprpub/</tt>.
* Make directory <tt>mozilla/nsprpub/build/symbian/tests</tt>, and then execute <tt>python gen_tests.py</tt> from path <tt>mozilla/nsprpub/build/symbian</tt> to generate test case project files in that directory you just created.
* Make sure Symbian development tool chain are ready. Run some <tt>helloword</tt>.
* Assume your Mozilla source tree is located at <tt>D:\mozilla</tt>, and you have downloaded and installed '''S60 SDK 3rd Edition Maintenance Release'''. Launch your Carbide.C++, and do following steps:
**  From menu, choose '''File » Import » Symbian OS Bld.inf file'''
**  type <tt>D:\mozilla\nsprpub\build\symbian\bld.inf</tt>
**  Select <tt>S60_3rd_MR</tt> and all two child nodes
**  Two '''''Next''''' to finish
* In NSPR tests, most output are written to <tt>stderr</tt>, but Symbian OS just ignores the <tt>stderr</tt> output. We have to do some tricks. In your Symbian SDK, for example <tt>D:\Symbian\9.1\S60_3rd_MR\Epoc32\include\stdapis</tt>, edit the <tt>stdio.h</tt>, change line 278 into the following lines:<br/>
* In NSPR tests, most output are written to <tt>stderr</tt>, but Symbian OS just ignores the <tt>stderr</tt> output. We have to do some tricks. In your Symbian SDK, for example <tt>D:\Symbian\9.1\S60_3rd_MR\Epoc32\include\stdapis</tt>, edit the <tt>stdio.h</tt>, change line 278 into the following lines:<br/>
  #ifdef MOZ_STDERR_TO_STDOUT
  #ifdef MOZ_STDERR_TO_STDOUT
Line 59: Line 52:
  #define stderr  (__stderr())
  #define stderr  (__stderr())
  #endif
  #endif
* In your Carbide.C++, now you can choose '''Project » Build Project''' from menu to compile and link NSPR for Symbian OS.
* Assume your Mozilla source tree is located at <tt>D:\mozilla</tt>, configure for emulator build by
* By default, the IDE builds binaries for Emulator(WINS). We could build binaries for device by select '''Project » Build Configurations » Set Active » Phone Release''' from menu.
configure --target=arm-none-symbianelf --enable-symbian-target=WINSCW
* If there is no error after building the '''Phone Release''' project configuration, it's time to generate target device installation package. Select '''Project » Properties''' from menu, select '''Carbide.c++ » Carbide Build Configurations''', click '''Add''' in tab '''SIS Builder''' to select our <tt>.pkg</tt> file. Probably it is located at <tt>D:\mozilla\nsprpub\build\symbian\sis\run_nspr_tests_static.pkg</tt>. Then we have to select '''Sign sis file with certificate/key pair''', and locate the certificate/key pair files from [http://wiki.mozilla.org/Mobile/Symbian/NSPR#NSPR_port_for_Symbian_OS_supporting_files NSPR for Symbian supporting files].
or configure for target build by
* Do the '''Project » Build Project''' again from menu bar, you will finally see the line in Console output.   
configure --target=arm-none-symbianelf --enable-symbian-target=GCCE --disable-debug
... ...
* Then invoke the build process by <tt>make</tt> and build test cases by <tt>cd pr/tests; make</tt>.
... ...
 
***SIS Creation Complete
At this point, you have done building NSPR for Symbian OS.
At this point, you have done building NSPR for Symbian OS.


90

edits