<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Harry Li&#039;s Forum Nokia Blog</title> 
<subtitle type="html">A Forum Nokia Blog</subtitle>
 
<updated>2009-02-10T23:46:01+07:00</updated> 
<id>http://www.lifetype.net,1.2/</id>
<link rel="alternate" type="text/html"  hreflang="en" href="http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog" />
 
<rights>Copyright (c) kcomex</rights>
<generator uri="http://www.lifetype.net/" version="1.2">LifeType at Forum Nokia</generator> 
 
<entry> 
<title>A Generic Makefile build script for Symbian</title>
<link rel="alternate" type="text/html" href="http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog/2009/02/10/a-generic-makefile-build-script-for-symbian" /> 
<id>tag:blogs.forum.nokia.com,2009-02-10:1975</id>
 
<updated>2009-02-10T23:46:01+07:00</updated> 
<published>2009-02-10T23:46:01+07:00</published> 
<summary type="html"> 
In the past days, I have made a build scripts which utilizes a couple of files to build a S60 project in a faster and simpler way. Gnu Make is the main actor in this solution, and this is ...</summary> 
<author> 
 
<name>kcomex</name> 
<uri>http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog</uri> 
</author> 
<dc:subject>
S60 
Symbian C++ 
</dc:subject> 
<content type="text/html" xml:lang="en" xml:base="http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog"> 
&lt;p&gt;
In the past days, I have made a build scripts which utilizes a couple of files to build a S60 project in a faster and simpler way. Gnu Make is the main actor in this solution, and this is inspired by the Mozilla project. The main feature of the building is that its much faster than Carbide.c++ IDE and command line build because here I only take care of a set of parameters used in a project, the rest of them are omitted. 
&lt;/p&gt;
&lt;p&gt;
Build with this &amp;quot;Gnu Make for Symbian&amp;quot;, you need three files &lt;a href=&quot;http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog/resource/general/Makefile&quot; target=&quot;_blank&quot;&gt;Makefile&lt;/a&gt;, &lt;a href=&quot;http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog/resource/general/defines.mk&quot; target=&quot;_blank&quot;&gt;defines.mk&lt;/a&gt; and config.mk in &lt;em&gt;&lt;strong&gt;myapp\gms&lt;/strong&gt;&lt;/em&gt; path. Then you need to install &lt;a href=&quot;http://www.mingw.org/wiki/msys&quot; target=&quot;_blank&quot;&gt;MSYS&lt;/a&gt; . Also three environment parameters should be set like this:
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;SYMBIAN_SDK_PATH = /c/symbian/9.1/s60_3rd_mr/&lt;/li&gt;
	&lt;li&gt;ACTIVE_PERL = /c/perl/bin/perl.exe&lt;/li&gt;
	&lt;li&gt;CC_INSTALL_PATH = /c/Program\Files/CSL\ Code\ Sourcery&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Please be noted the first one should contains a trailing slash like classic EPOCROOT environment variable. The second one is the ActivePerl .exe file used by some resource compiler script. The last one is the path to GCCE compiler installation path, without trailing slash. If there are spaces in any of them, please use &lt;strong&gt;&amp;quot;\ &amp;quot; &lt;/strong&gt;backslash with a space instead.
&lt;/p&gt;
&lt;p&gt;
After all these done, you could change your working directory into the build home bye &amp;quot;&lt;em&gt;&lt;strong&gt;cd /c/myapp/gms&lt;/strong&gt;&lt;/em&gt;&amp;quot;. Then &amp;quot;&lt;em&gt;&lt;strong&gt;make build&lt;/strong&gt;&lt;/em&gt;&amp;quot; will do the build and &amp;quot;&lt;em&gt;&lt;strong&gt;make pack&lt;/strong&gt;&lt;/em&gt;&amp;quot; will also do the makesis work.
&lt;/p&gt;
&lt;p&gt;
A sample config.mk file is shown below. I guess probably everything is explained by its name.
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;color: #0000ff&quot;&gt;PROJECT_NAME = helloworld&lt;br /&gt;
TARGET_TYPE = EXE&lt;br /&gt;
UID2 = 0&lt;br /&gt;
UID3 = A000ABCD&lt;br /&gt;
SECUREID = A000ABCD&lt;br /&gt;
EPOCSTACKSIZE = 0x5000&lt;br /&gt;
CAPABILITY = NONE&lt;br /&gt;
SYSINCLUDE = $(EPOCROOT)/include&lt;br /&gt;
USERINCLUDE = ../inc&lt;br /&gt;
CXXSRCS = \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; helloworld.cpp \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(NULL)&lt;br /&gt;
CSRCS = \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; helloworld.c \&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(NULL)&lt;br /&gt;
IMG_SRCS = ../gfx/icon.svg&lt;br /&gt;
IMG_TARGETS = $(DIST_PATH)/$(PROJECT_NAME)_aif.mif&lt;br /&gt;
IMG_ARGS = /c32&lt;br /&gt;
RSS_TARGETS = &lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;$(DIST_PATH)/$(PROJECT_NAME).rsc &lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;$(DIST_PATH)/$(PROJECT_NAME)_reg.rsc&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0000ff&quot;&gt;LANG_MACRO = -DLANGUAGE_SC&lt;br /&gt;
SYSLIBRARY = euser.lib estlib.lib avkon.lib&lt;br /&gt;
CERT = /c/cert/selfsigned.cer&lt;br /&gt;
KEY = /c/cert/selfsigned.key&lt;br /&gt;
&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Although there are a number of limitations in this script, hope you like this tiny thing and in future I will fill it more powerful :)
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt; 
</content> 
</entry> 
 
<entry> 
<title>Finishing the immigration to GNU make</title>
<link rel="alternate" type="text/html" href="http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog/2008/08/01/finishing-the-immigration-to-gnu-make" /> 
<id>tag:blogs.forum.nokia.com,2008-08-01:1667</id>
 
<updated>2008-08-01T14:38:28+08:00</updated> 
<published>2008-08-01T14:38:28+08:00</published> 
<summary type="html"> During last couple of weeks, I made the immigration of building&amp;nbsp; Mozilla NSPR component &amp;nbsp;with Carbide.C++ (still based on makemake and friends Perl scripts) to GNU make and autoconf ...</summary> 
<author> 
 
<name>kcomex</name> 
<uri>http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog</uri> 
</author> 
<dc:subject>
S60 
Symbian C++ 
Mozilla 
</dc:subject> 
<content type="text/html" xml:lang="en" xml:base="http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog"> 
&lt;p&gt;During last couple of weeks, I made the immigration of building&amp;nbsp;&lt;a href=&quot;http://wiki.mozilla.org/Mobile/Symbian/NSPR&quot; target=&quot;_blank&quot;&gt;Mozilla NSPR component&lt;/a&gt;&amp;nbsp;with Carbide.C++ (still based on makemake and friends Perl scripts) to GNU make and autoconf friends. Here I will share some points I learned in this process.&lt;/p&gt;&lt;p&gt;First of all, if your open source project uses a lot of &lt;a href=&quot;http://www.symbian.com/developer/techlib/v9.1docs/doc_source/guide/N1001E/StaticData.html#idioms.staticdata&quot; target=&quot;_blank&quot;&gt;Writable Static Data&lt;/a&gt;&amp;nbsp;(WSD),&amp;nbsp;in theory even only one single variable,&amp;nbsp;and they are used in dynamically linked library (DLL) target type, then your only choice is buying a&amp;nbsp;&lt;a href=&quot;http://www.arm.com/products/DevTools/RealViewSoftwareDevelopment.html&quot; target=&quot;_blank&quot;&gt;RVCT compiler&lt;/a&gt;. Because GCCE compiler which ships with the S60 SDK has a defect that can not build a working DLL binary if there is WSD in it. This&amp;nbsp;&lt;a href=&quot;http://www3.symbian.com/faq.nsf/AllByDate/B8542F039C193CCC802573DA0011DFA7&quot; target=&quot;_blank&quot;&gt;known bug&lt;/a&gt;&amp;nbsp;is documented by Symbian already. Though in the document Symbian stated the problem is solved in a later GCCE release possibly, yet I had tried&amp;nbsp;&lt;a href=&quot;http://www.codesourcery.com/gnu_toolchains/arm/portal/subscription3058&quot; target=&quot;_blank&quot;&gt;all GCCE releases&lt;/a&gt;&amp;nbsp;which is later than 2005Q1C, then found some of them will generate an internal compiler error and some of them build the same defective binary almost the same as 2005Q1C. So I think I could give you the advice : try only GCCE compiler tools if it is shipped with Nokia or Symbian, otherwise you are spending your time on what has been proven already.&lt;/p&gt;&lt;p&gt;Then let&#039;s get back to the build tool chain immigration affair. Actually I observed all original makmake build process in Carbide.C++, and then try to copy all compiler and linker arguments to GNU make Makefile scripts. The work is not so hard, and the result is also convenient to verify. Here are some brief points need your attention:&lt;/p&gt;&lt;ul&gt;	&lt;li&gt;Compiler/linker arguments are main additions feed to Makefile&lt;/li&gt;	&lt;li&gt;Emulator builds and target device builds use different compiler/linker&lt;/li&gt;	&lt;li&gt;Device builds will need post linker operations,&amp;nbsp;&lt;a href=&quot;http://www.symbian.com/developer/techlib/v9.1docs/doc_source/N10356/BuildTools/native/elf2e32.guide.html#buildguide.elf2e32.main&quot; target=&quot;_blank&quot;&gt;elf2e32&lt;/a&gt;&amp;nbsp;is the tool we use&lt;/li&gt;	&lt;li&gt;ActivePerl is used to calling the .RSS resource file compiling, other Perl probably won&#039;t work&lt;/li&gt;	&lt;li&gt;Building statically linked library (.LIB target type) takes no post linker jobs to do, compared with .DLL and .EXE&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Also, it really depends on the project scale you are working with. Like Mozilla NSPR component, it uses several config and make rules files to make targets for over two dozens operating systems, then finding which place is proper to add arguments takes longer than making the modify itself.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Finally, you could have a look at&amp;nbsp;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=442706&quot; target=&quot;_blank&quot;&gt;Bug 442706&lt;/a&gt;, the patch there will show you the modifications made against the original NSPR build scripts. A detailed description about how to build NSPR with GNU make/autoconf can be found at&amp;nbsp;&lt;a href=&quot;http://wiki.mozilla.org/Mobile/Symbian/NSPR&quot; target=&quot;_blank&quot;&gt;Mozilla Wiki&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Cheers~&amp;nbsp;&lt;img src=&quot;http://blogs.forum.nokia.com/js/tinymce/plugins/emotions/images/smiley-laughing.gif&quot; border=&quot;0&quot; alt=&quot;Laughing&quot; title=&quot;Laughing&quot; /&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt; 
</content> 
</entry> 
 
<entry> 
<title>Evaluate the project before porting</title>
<link rel="alternate" type="text/html" href="http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog/2008/05/08/evaluate-the-project-before-porting" /> 
<id>tag:blogs.forum.nokia.com,2008-05-08:1508</id>
 
<updated>2008-05-08T09:16:10+08:00</updated> 
<published>2008-05-08T09:16:10+08:00</published> 
<summary type="html"> 
Porting an open source project is quite different from developing a new application for mobile phones. During past days without  Open C , we have to rewrite lots of code to satisfy both Symbian ...</summary> 
<author> 
 
<name>kcomex</name> 
<uri>http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog</uri> 
</author> 
<dc:subject>
Open C 
S60 
Symbian C++ 
Mozilla 
</dc:subject> 
<content type="text/html" xml:lang="en" xml:base="http://blogs.forum.nokia.com/blog/harry-lis-forum-nokia-blog"> 
&lt;p&gt;
Porting an open source project is quite different from developing a new application for mobile phones. During past days without &lt;a href=&quot;http://wiki.forum.nokia.com/index.php/Category:Open_C&quot; target=&quot;_blank&quot;&gt;Open C&lt;/a&gt;, we have to rewrite lots of code to satisfy both Symbian OS rules/limitation and difference between mobile devices and desktop computers. Touching so much code will cost more development time, but what&#039;s worse is that making changes too much will drive you thinking &amp;quot;Should I start a new project rather than using only a little from this existing project?&amp;quot;. So porting an existing application onto Symbian OS makes you keep concerning how much modification will you make, if too much consider starting a new one or just share the name or brand. As far as I know, &lt;a href=&quot;https://helixcommunity.org/&quot; target=&quot;_blank&quot;&gt;HelixCommunity&lt;/a&gt; is the first big and famous open source project ported to Symbian OS, and it supports as early as v6.1. I checked out its source in 2004 (means their code nowadays might be different a lot), this is one example of making too much changes so you can tell few difference between porting like this or making a new project. Since S60 3rd Edition, there is Open C we can utilize, the job is easier. But still we can not ignore this consideration because of the nature of mobile phones. In one word, first step of porting an existing project is evaluate how much changes will be made approximately. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;http://www.forum.nokia.com/main/resources/technologies/open_c/tips_for_selecting_open_source_code.html&quot; target=&quot;_blank&quot;&gt;This document&lt;/a&gt; in Forum Nokia web site is very helpful, and generally speaking smaller projects are always easier to make decision if it could be ported than bigger ones. Smaller ones are always based on some existing framework, if the framework exists or can be ported on Symbian OS then the project itself will be fine in most cases. Huge project like Mozilla or Helix will give us an impression that it is likely impossible to port cause it has so many dependencies and self owned framework. However, we want eveidence to support our decision. Let&#039;s get back to Mozilla, after searching its website, there is an &amp;quot;&lt;a href=&quot;http://developer.mozilla.org/en/docs/C%2B%2B_Portability_Guide&quot; target=&quot;_blank&quot;&gt;C/C++ Portability Guide&lt;/a&gt;&amp;quot; which shows us an amazing likeness of Symbian OS programming limitations. From this article, we could learn Mozilla code will probably contain very little exceptions, RTTI and others that Symbian OS C++ does not support. Then with the help of Open C, we could have better confidence about porting without changing too much code. 
&lt;/p&gt;
&lt;p&gt;
Next we have to&amp;nbsp; make&amp;nbsp; deeper&amp;nbsp; research on the inner&amp;nbsp; structure&amp;nbsp; of Mozilla platform, cause you can not start portting any piece of code without knowing which level it lies in and what it does actually. Stay tuned, I will bring more as the work goes on &lt;img src=&quot;http://blogs.forum.nokia.com/js/tinymce/plugins/emotions/images/smiley-smile.gif&quot; border=&quot;0&quot; alt=&quot;Smile&quot; title=&quot;Smile&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt; 
</content> 
</entry> 
 
</feed>