Introduction
| 介绍
|
It is not difficult to set up development environment for A1200 mobile phone in Fedora Core 6 Linux.
I will show you how to do it step by step.
| 在Fedora Core 6版本的Linux系统下面设置一套用于A1200手机的开发环境是不难的。
我会一步步地告诉你该怎么做。
|
1. Download or make crosstool-gcc-3.3.2-gli bc-2.3.2-arm-linux-devel-0.42-1.*.rpm | 1. 下载或自行编译生成 crosstool-gcc-3.3.2-gli bc-2.3.2-arm-linux-devel-0.42-1*.rpm |
If your Linux is running on a 64 bit x86 system, you may download crosstool-gcc-3.3.2-glibc-2.3.2-arm-lin ux-devel-0.42-1.x86_64.rpm from here. This RPM is made by codeminders.
Or if your Linux is running on a 32 bit x86 system, you may download crosstool-gcc-3.3.2-glibc-2.3.2-arm-lin ux-devel-0.42-1.i386.rpm from here or here or here. This RPM is made by me based on SRPM provided by codeminders.
Or if you want to compile and make this package by yourself, you may do the following: - Install gcc 3.2.3. (gcc 3.2 is used to make crosstool-gcc-3.3.2. Although you can not find gcc 3.2 in Fedora Core 6 software package list, but you can get it from Fedora Core 5 software download site and manually install it.)
- Download compat-gc c-32-3.2.3-56.fc5.i386.rpm from official Fedora Core 5 Download site.
- As root user,
- run rpm -vih compat-gcc-32-3.2.3*.rpm
- Download crosstool-gcc-3.3.2-gli bc-2.3.2-0.42-1.src.rpm from here.
- As root user,
- Run rpm -vih crosstool*.src.rpm
- Run cd /usr/src/redhat/SPECS
- Run rpmbuild -bb crosstool*.spec
Then, you can find the package in /usr/src/redhat/RPMS/ directory.
| 如果你的Linux运行在64位的x86系统上,你可以从这里下载crosstool-gcc-3.3.2-glibc-2.3.2-arm-lin ux-devel-0.42-1.x86_64.rpm。这个RPM是codeminders制作的。
或者如果你的Linux运行在32位的x86系统上,你可以从这里 或这里或这里下载crosstool-gcc-3.3.2-glibc-2.3.2-arm-lin ux-devel-0.42-1.i386.rpm。这个RPM是我根据codeminders提供的SRPM制作的。
或者如果你想要自己编译并生成这个安装包,你可以这样做: - 安装gcc 3.2.3. (编译crosstool-gcc-3.3.2本身需要用到gcc 3.2。 虽然在Fedora Core 6的软件包里是找不到gcc 3.2,但是我们可以从Fedora Core 5的软件包下载网站上找到它,并且可以手工进行安装。)
- 从Fedora Core 5的官方网站下载compat-gc c-32-3.2.3-56.fc5.i386.rpm。
- 以超级用户的身份,
- 执行rpm -vih compat-gcc-32-3.2.3*.rpm
- 从这里下载crosstool-gcc-3.3.2-gli bc-2.3.2-0.42-1.src.rpm。
- 以超级用户的身份,
- 执行 rpm -vih crosstool*.src.rpm
- 执行 cd /usr/src/redhat/SPECS
- 执行 rpmbuild -bb crosstool*.spec
于是,你就可以在/usr/src/redhat/RPMS/目录下找到编译生成的安装包了. |
2. Install cross-compiler
| 2. 安装交叉编译器
|
- As root user,
- Run rpm -vih crosstool*devel*.rpm
- Create crosstool.sh in /etc/profile.d directory
- Run chmod a+x /etc/profile.d/crosstool.sh
- Run /etc/profile.d/crosstool.sh
Content of crosstool.sh should be:
| - 以超级用户的身份,
- 执行 rpm -vih crosstool*devel*.rpm
- 在/etc/profile.d目录下创建crosstool.sh文件
- 执行chmod a+x /etc/profile.d/crosstool.sh
- 执行/etc/profile.d/crosstool.sh
把这些作为crosstool.sh文件的内容: |
if ! echo ${PATH} | /bin/grep -q /usr/crosstool/gcc-3.3.2-glibc-2.3.2/arm-linux/bin ; then PATH=/usr/crosstool/gcc-3.3.2-glibc-2.3.2/arm-linux/bin:${PATH} fi
|
3. Install librarys and header files
| 3. 安装库文件和头文件
|
- Download dev-ezx-0.2.0.tgz from here. This is the unofficial SDK reverse-engineered by Sam Revitch.
- Extract it to any place (for example, /usr/local) you like .
- Copy the full contents (including sub-directories) of /usr/lib from your phone to dev-ezx-0.2.0/lib.
- Change to directory dev-ezx-0.2.0/moc.
- Run make
- Download ezx-sdk.tar.gz from here or here. This is the official SDK leaked from Motorola.
- Extract doc directory to dev-ezx-0.2.0/
- Extract all files inside include directory to dev-ezx-0.2.0/include/ezx directory, if files with the same name already exist, replace them.
- Modify ezxres.h to change "QPixmap getIcon(char const*);" to "QPixmap getIcon(char const*, bool);".
- Rename directory dev-ezx-0.2.0 to ezx-sdk or any other name you like.
| - 从这里下载dev-ezx-0.2.0.tgz。这是Sam Revitch 通过逆向工程的办法自己做的非官方SDK。
- 把它展开到任意的目录(例如,/usr/local)下。
- 拷贝你手机上/usr/lib目录下的所有内容(含子目录)到dev-ezx-0.2.0/lib。
- 进入dev-ezx-0.2.0/moc目录。
- 执行make
- 从这里或这里下载ezx-sdk.tar.gz。这是泄露出来的摩托罗拉公司的官方SDK。
- 展开其中的doc目录到dev-ezx-0.2.0/
- 将include目录中的所有文件展开到dev-ezx-0.2.0/include/ezx目录,如遇有同名文件,覆盖之。
- 修改ezxres.h文件,将“QPixmap getIcon(char const*);”改为“QPixmap getIcon(char const*, bool);”
- 将目录dev-ezx-0.2.0改名为ezx-sdk或其它任何你喜欢的名字。
|
4. Build helloworld to verify your development environment
| 4. 编译helloworld以验证你的开发环境
|
To verify your development environment, you can try to compile the helloworld sample application. - Change to directory helloworld.
- Modify Makefile
- Change LIBS from "-lezxappbase-xscale-r -lqte-mt-xscale-r -lezxjpeg-xscale-r -lezxnotification-xscale-r" to "-lezxappbase -lqte-mt -lezxjpeg -lezxpm -lipp-jp -lipp-miscGen -lezxappsdk -lezxopenwindow"
- Download test2.rar from here . This is a sample provided by yan0.
- Extract (you may need to run rpm -ivh http://rpm.livna.org/livna-rele ase-6.rpm and yum install unrar first if unrar not installed yet) test2.cpp and rename it to helloworld.cpp
- Run make clean
- Run make
- Run make dist
| 为了验证你的开发环境,你可以尝试编译helloworld程序。 - 进入helloworld目录。
- 修改Makefile文件。
- 将LIBS由“-lezxappbase-xscale-r -lqte-mt-xscale-r -lezxjpeg-xscale-r -lezxnotification-xscale-r”修改为“-lezxappbase -lqte-mt -lezxjpeg -lezxpm -lipp-jp -lipp-miscGen -lezxappsdk -lezxopenwindow”
- 从这里下载test2.rar。这是yan0写的样例程序。
- 展开(如果你没有unrar那么你需要先执行rpm -ivh http://rpm.livna.org/livna-rele ase-6.rpm和yum install unrar以安装unrar)其中的test2.cpp文件并改名为helloworld.cpp。
- 执行 make clean
- 执行 make
- 执行 make dist
|
5. Run helloworld from inside your phone
| 5. 在你的手机上运行helloworld
|
By default USBLAN driver should be already include in Linux kernel.
To connect to your phone, you may follow these steps: - Run ifconfig -a and check if "usb0" is there.
- If "usb0" is there, run this command to configure IP address: ifconfig usb0 192.168.1.1
netmask 255.255.255.248 up - Then you can access your phone through IP address 192.168.1.2
- If you want to run any application on your phone when you are telneting to it, you need to run this command on your phone first: ". /home/native/.profile"
| 缺省情况下,USBLAN的驱动已经包含在Linux的kernel中了。
为了连接到你的手机,可以这样做: - 执行ifconfig -a然后检查是不是能看到“usb0”。
- 如果能看到“usb0”,执行这个命令来设置IP地址:ifconfig usb0 192.168.1.1
netmask 255.255.255.248 up - 然后你就可以通过192.168.1.2这个地址来访问你的手机了。
- 如果想直接telnet进手机后从命令行执行程序,你需要先在手机上执行:“. /home/native/.profile”。
|
6. Use helloworld as template, develop your own application
| 6. 把helloworld作为模板,开发你自己的应用
|
Start your own adventure!
| 开始你自己的探索之路吧!
|
没有评论:
发表评论