Editing Maemo软件开发工具包

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.

Warning: This page is 39 kilobytes long; some browsers may have problems editing pages approaching or longer than 32kb. Please consider breaking the page into smaller sections.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 21: Line 21:
在GNU/Linux桌面系统上,Maemo SDK使用[http://scratchbox.org/ Scratchbox]这个开源交叉编译工具,创建了一个沙盒环境。
在GNU/Linux桌面系统上,Maemo SDK使用[http://scratchbox.org/ Scratchbox]这个开源交叉编译工具,创建了一个沙盒环境。
-
在大多数情况下,这个环境就象普通操作系统一样工作,只不过添加了一些开发工具。
+
在大多数情况下,这个环境就象普通操作一样运行,只不过添加了一些开发工具。
这意味着Maemo软件的开发流程与普通桌面Linux程序十分相似。麻烦的嵌入式开发过程,例如交叉编译,都由Scratchbox自动进行。
这意味着Maemo软件的开发流程与普通桌面Linux程序十分相似。麻烦的嵌入式开发过程,例如交叉编译,都由Scratchbox自动进行。
Line 37: Line 37:
当程序在''ARMEL''环境中编译完成后,就可以在手持设备上直接运行了。由于SDK提供的模拟器并不完善,所以实际的测试必须在真实设备上进行。
当程序在''ARMEL''环境中编译完成后,就可以在手持设备上直接运行了。由于SDK提供的模拟器并不完善,所以实际的测试必须在真实设备上进行。
-
== Scratchbox ==
+
== 施工中 Scratchbox ==
Scratchbox是一个特定的“沙盒”环境,提供了一个与真实的Linux系统(通常被称为host machine,宿主机)隔离的开发环境。
Scratchbox是一个特定的“沙盒”环境,提供了一个与真实的Linux系统(通常被称为host machine,宿主机)隔离的开发环境。
Line 49: Line 49:
这是隔离技术的一个重要组成部分。因此,这个环境被称为“沙盒”,一个可以任意玩耍,无须担心影响真实系统环境的区域。
这是隔离技术的一个重要组成部分。因此,这个环境被称为“沙盒”,一个可以任意玩耍,无须担心影响真实系统环境的区域。
-
隔离技术的另一环节,就是库调用转发机制,利用LD_PRELOAD,编译器以及其他程序,都将使用沙盒环境下的函数库。
+
隔离技术的另一环节,就是库调用转发机制,利用LD_PRELOAD,编译器以及其他程序,都将使用沙盒环境下函数库。
-
总而言之,Scratchbox:
+
总而言之,Scratchbox是:
-
* 是一个实现了开发用沙盒(隔离了真实系统环境)的软件包。
+
* 一个实现了开发用沙盒(隔离了真是系统环境)的软件包。
* 包含了易于使用的交叉编译工具。
* 包含了易于使用的交叉编译工具。
* 多个开发者可以使用同一个开发系统。
* 多个开发者可以使用同一个开发系统。
Line 59: Line 59:
* 通过被称作sbrsh的机制,以及[http://bellard.org/qemu Qemu]虚拟机的cpu指令翻译,可以在宿主机上运行目标硬件系统的二进制执行文件。
* 通过被称作sbrsh的机制,以及[http://bellard.org/qemu Qemu]虚拟机的cpu指令翻译,可以在宿主机上运行目标硬件系统的二进制执行文件。
-
除了这些主要的特性以外,你也可以自己开发能够在Scratchbox环境中安装的软件包。
+
Besides these main features, it is possible to develop your own software packages that can be installed and used inside a Scratchbox environment. Scratchbox also includes some integration of Debian package management, so that once the source files are set up correctly and a couple of configuration files have been written, binary distribution packages can be created for various architectures (similar to .msi files in Windows, or .rpm files in Fedora Core, RHEL and SUSE). These tools are also used to provide the environment with a packaging database so that other development packages can be installed over the Internet when needed (by using standard Debian package management tools).
-
Scratchbox已经整合了Debian的包管理器,因此,只要正确地编写了配置文件,就可以为不同架构的平台编译创建二进制软件包(deb文件,与Windows下的msi文件,Fedora/RHEL的rpm文件类似)。
+
Fremantle also uses a similar packaging system, and this means that packages built using Scratchbox and the SDK can be installed on the real device.
-
同时,你也可以使用标准的Debian包管理工具,通过互联网下载安装你所需要的软件包。
+
Scratchbox is licensed under the GPL and it is open for outside contributions. For in-depth coverage on Scratchbox and its capabilities, please visit the [http://scratchbox.org project website].
-
Maemo 5 Fremantle 也使用了相同的包管理机制,在Scratchbox下创建的软件包,可以直接安装到真实的物理设备上。
+
This material discusses only the Scratchbox capabilities that are necessary to use the Maemo SDK.
-
Scratchbox以GPL证书发布,欢迎外界的捐助。以上内容仅涉及了Scratchbox与Maemo 5 SDK相关的部分。如果需要深入了解Scratchbox的细节,请访问[http://scratchbox.org Scratchbox项目主页]。
 
 +
===Scratchbox In-Depth===
-
=== 深入Scratchbox ===
+
Scratchbox is Maemo SDK's cross-compiling environment. The default Scratchbox installation works as-is under most conditions, but some details are good to know for more specialized usage.
-
Scratchbox是Maemo SDK使用的交叉编译环境。在大多数情况下,默认安装的Scratchbox就能顺利工作。但如果你有特殊的需要,那么有必要了解一些Scratchbox的细节。
+
The ''target'' inside Scratchbox contains a root file system. When you create a new target inside Scratchbox, specify the ''toolchain'' you will use to build applications. Examples of a ''target'' include X86 and ARMEL, provided by Maemo SDK on top of Scratchbox.
-
''目标环境''(''target''),是Scratchbox建立的一个根文件系统,当你在Scratchbox里创建了一个''目标环境''后,就指定了''工具链''(''toolchain''),用于创建你的应用程序。Maemo SDK创建了两个''目标环境''——X86(FREMANTLE_X86)和ARMEL(FREMANTLE_ARMEL)。
+
''Host tools'' are native to the host, provided for convenience and speed. They are always transparently preferred over target tools. For example, cross-compiling applications to the target architecture. Host tools consist of devkits and ''toolchains''.
-
''宿主工具''(''Host tools'')是宿主机环境下的原生程序,提供了最佳的可用性与性能。他们始终在目标环境外透明地执行。举例来说,宿主工具包含''开发工具''(''devkit'')与''工具链''(''toolchains'')。这些工具为目标架构创建可运行的二进制程序,
+
A toolchain provides the minimal set of tools for compiling binaries for the target. Each scratchbox target must have one and only one toolchain selected.
-
''开发工具''''devkit'')是一组开发工具,他们是宿主机系统下的原生程序。每个''开发工具''都可以针对某个目标环境单独启用。举例来说,doctool是一个开发工具,用来创建文档(类似doxygen),你可以在每个目标环境下单独启用/禁用该工具。
+
''CPU transparency methods'' take care of running the applications on an emulator, target device or directly on the host transparently from the user's perspective. The available CPU transparency methods come from a special ''devkit'' called ''cputransp''. For each of Maemo SDK's pre-defined targets, a CPU transparency method is selected and defined.
-
''工具链''(''toolchains'')提供了最基本的编译工具集合,每一个Scratchbox目标环境都必须指定一个工具链。工具链为目标环境创建,处理二进制文件。除了编译器(''gcc'')外,工具链还包括了一个链接器(''ld'')以及其他''二进制工具包''(''binutils''),例如''strip''(去除文件中的调试信息),''objdump''(二进制文件分析器)和''string''(显示文件中的可打印字符)。
+
A ''toolchain'' is a collection of tools used to produce binaries for the target environment. In addition to a compiler (''gcc''), the toolchain contains a linker (''ld'') and other ''binutils'', such as ''strip'', ''objdump'' and ''strings''.
-
''CPU译码器''(''CPU transparency methods'')提供了在模拟器中运行目标架构程序的能力。Maeomo SDK官方支持的宿主机系统是x86架构的Linux系统,而实际设备的cpu却可能是arm架构的。''CPU译码器''解决了在x86设备上运行arm程序的问题。用户可以在编译阶段,选择一个程序是为了宿主系统,还是目标系统(arm或是x86)编译。Maamo SDK包含的''开发工具''(''devkit'')中,一个名为''cputransp''的工具包提供了这一功能,这个工具包提供了完整的配置,并且会被默认选中安装。
+
A ''devkit'' is a collection of tools native to the host. A devkit can be selected or disabled for a target. An example of a devkit is the doctools devkit, which provides tools (like doxygen) for building documentation.
-
''根文件系统包''(''rootstrap'')包含了一个目标设备的根文件系统。Maemo SDK为每个目标环境(X86和ARMEL)各自提供了Scratchbox环境下的根文件系统包。需要提醒的是,两个目标环境的home目录是共享的。而''/tmp''目录同时在宿主机和两个目标环境间共享。
+
A ''rootstrap'' is a root file system for the target device. Maemo SDK provides root file systems for both targets (X86 and ARMEL) inside Scratchbox. Note that the user's home directory is shared for all targets. The ''/tmp'' directory is shared for all targets and also with the host.
-
大体上,Maemo SDK这样进行目标环境的配置。
+
From Scratchbox's point of view, Maemo SDK is a set of preconfigured ''targets'' and ''root file system''s. One set is provided for both ''X86'' and ''ARMEL'' architectures on top of a working Scratchbox installation.
-
首先,在Scratchbox环境中创建了两个''目标环境''——''X86''和''ARMEL''。
+
==Development on Maemo SDK==
-
 
+
-
然后为目标环境选择''开发工具'',其中包括''cpu译码器''和''toolchain''等关键工具。你还可以选择''doctool''和''debian sys''等系统辅助工具。
+
-
 
+
-
最后将''根文件系统''解包复制到目标环境中,这样就完成了目标环境的配置。
+
-
 
+
-
== 施工中 使用Maemo SDK进行开发 ==
+
The Maemo SDK provides all of its development tools inside Scratchbox. Also the UI framework is started with a single command, ''af-sb-init'', run within Scratchbox. However, it needs a secondary X server of proper size and bit-depth to be displayed on.
The Maemo SDK provides all of its development tools inside Scratchbox. Also the UI framework is started with a single command, ''af-sb-init'', run within Scratchbox. However, it needs a secondary X server of proper size and bit-depth to be displayed on.

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)