Difference between revisions of "Zh/Documentation/Building Guide/Building on Windows"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Created page with "{{Documentation/Building Guide TOC |ShowNextPage=none |ShowPrevPage=none }} {{DISPLAYTITLE:Building on Windows}} Category:Windows Category:Build System __TOC__ = Ov...")
 
 
(41 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Documentation/Building Guide TOC
+
{{Win|建制指导 __TOC__
 
|ShowNextPage=none
 
|ShowNextPage=none
 
|ShowPrevPage=none
 
|ShowPrevPage=none
 
}}
 
}}
  
{{DISPLAYTITLE:Building on Windows}}
+
{{DISPLAYTITLE:Windows环境下的建制}}
 
[[Category:Windows]]
 
[[Category:Windows]]
 
[[Category:Build System]]
 
[[Category:Build System]]
Line 10: Line 10:
 
__TOC__
 
__TOC__
  
= Overview =
+
= 概述=
  
{{Template:Documentation/Windows| This document explains how to build the OpenOffice.org source code on Windows systems.}}
+
{{Win| 这个文档解释了怎么在Windows系统下建立一个OpenOffice.org的源代码.}}
  
For building OpenOffice.org Cygwin is needed, a Windows program that emulates a complete Unix commandline environment. To use this document you need to be familiar with a command line, but you need not to be a UNIX shell wizard.
+
为了能够建制 OpenOffice.org我们需要Cygwin这个工具 , 这是一个模拟一个完整的Unix命令环境的 Windows 程序.为了能够使用它,你需要熟悉命令行, 当然,并不需要你相当了解Unix 内核.
  
{{Template:Documentation/Tip|If you have never used a Unix shell, you might want to take a look at the [http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html shell introduction at TLDP].}}
+
{{Tip|如果你从未使用过Unix shell命令, 你可以访问这个网页 [http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html TLDP内核介绍].}}
  
{{Template:Documentation/Note|<code>$SRC_ROOT</code> will denote the directory in which the source code of OpenOffice.org is stored.}}
+
{{Note|<code>$SRC_ROOT</code> 将表示 OpenOffice.org源代码资源存储所在路径.}}
{{Template:Documentation/Tip|You are advised to check the release notes for the release you are building to inform yourself about changes since previous releases.}}
+
{{Tip|当您建制时建议您检测发布说明来获得与以前发布的版本的一些改变.}}
  
= Requirements=
+
= 基本配置要求=
==hardware requirements==
+
==硬件要求==
  
* 1 or more reasonable fast CPUs (x-way CPU recommended)
+
* 1 个或者多个CPU(速度当然会更快) (推荐x-系类CPU )
* 1 GB RAM (2 GB recommended)
+
* 1 GB 内存 (推荐2 GB )
* 10 GB free disk space (20 GB when debugging)
+
* 10 GB 可存储空间 (debug时需要20 GB )
  
== software requirements==
+
== 软件要求 ==
 
* Windows XP/Vista/7
 
* Windows XP/Vista/7
  
The following table is placed here, so you can come back to it easily, when you want to use a link. The items are explained below. Here's the list of files to download (with links) and the locations in the source tree where you must put them:
+
表格里面的项目是建制必须的一些准备,这些项目解释如下. 表格里面的文件列表列出了中、需要下载的(附有下载链接)文件,这些文件必须放在相应的资源根目录下:
  
  
 
{| class="prettytable" border="1" width="100%"
 
{| class="prettytable" border="1" width="100%"
 
|-
 
|-
! Where to get
+
!从哪里获取这些文件
! Place in/Use configure switch
+
! 放置/使用配置
 
|-
 
|-
| Cygwin: [http://www.cygwin.com Cygwin ToolKit with(dll version 1.5.10)or later]
+
| Cygwin: [http://www.cygwin.com Cygwin 工具 (dll版本 1.5.10)或者更高版本]
| (default)
+
| (默认)
 
|-
 
|-
| C/C++ Compiler: free: [http://www.microsoft.com/express/download/ Visual C++ 2008 Express Compiler(basic install, no optional required)] offical: Visual C++ 2008 Professional
+
| C/C++ 编译器: [http://www.microsoft.com/express/download/Visual C++ 2008 标准版 编译器 (基本安装, 没有可选要求)] 专业版: Visual C++ 2008 Professional
 
| --with-cl-home=
 
| --with-cl-home=
 
|-
 
|-
| Java: [http://java.sun.com/javase/6/ JDK 1.6] for DEV300 milestones >= m37 and all OOo310 versions (older milestones will fail in the hsqldb module)
+
| Java: [http://java.sun.com/javase/6/ JDK 1.6] DEV300 版本 >= m37 适用于 OOo310 系列版本 (旧版本的java 在 hsqldb 模块下将会失败)
 
| --with-jdk-home=
 
| --with-jdk-home=
 
|-
 
|-
| [http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en Windows SDK for Windows Server 2008]<ref name="Foot1">{{Template:Documentation/Note|This also supported on Vista. This is either a DVD image or a net installer. You can either mount the DVD with a suitable tool, burn it do a DVD or use tools like winrar that can extract files from ISO files directly. You don't need to install samples or documentation (saves a lot of disk space). It will also install the .NET Framework 3.5 SDK.
+
| [http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en Windows SDK for Windows Server 2008]<ref name="Foot1">{{Note|Vista系统上也支持;这是一个DVD的图像或网络安装程序,使用合适的工具,您可以安装DVD、将它刻录DVD或使用的工具如WinRAR直接从ISO文件中提取文件;
It might be best to install the Windows SDK into the default directory, and if not that into one without capital letters in the path. I used D:\Dev\Win_SDK\ and received some linking errors in the Python module (see {{Bug|88568}}).}}</ref>
+
您不需要安装样品或文档(可以节省大量的磁盘空间)它也将安装NET Framework 3.5 SDK。最好将Windows SDK安装到默认的目录并且路径中没有大写字。例如我使用:D:\Dev\Win_SDK\,在Python模块中收到了一些链接错误信息;
 +
(see {{Bug|88568}}).}}</ref>
 
|  
 
|  
 
|-
 
|-
Line 55: Line 56:
 
| main/external/gdiplus
 
| main/external/gdiplus
 
|-
 
|-
| [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=CD1FC4B2-0885-47F4-AF45-7FD5E14DB6C0 dbghelp.dll]<ref name="Foot3">{{Template:Documentation/Note|dbghelp.dll is available from the Microsoft site and needs to be saved to $SRC_ROOT/external/dbghelp. Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.}}</ref>
+
| [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=CD1FC4B2-0885-47F4-AF45-7FD5E14DB6C0 dbghelp.dll]<ref name="Foot3">{{Note|DBGHELP.DLL可以从微软的网站获取,需要被保存到$SRC_ROOT/external/dbghelp目录下;微软似乎很喜欢改变这个文件的确切位置。 您可能需要在微软的网站中搜索.}}</ref>
  
Can also be found in the Visual Studio C++ 2008 Express installation.
+
也可以在Visual Studio C++ 2008Express安装文件中找到.
 
| main/external/dbghelp
 
| main/external/dbghelp
 
|-
 
|-
| [http://archive.apache.org/dist/ant/binaries Apache Ant (version 1.6.5 or later)]
+
| [http://archive.apache.org/dist/ant/binaries Apache Ant ( 1.6.5版本或者更高版本)]
 
| --with-ant-home=
 
| --with-ant-home=
 
|-
 
|-
 
| [http://tools.openoffice.org/moz_prebuild/OOo3.2 Mozilla binary distribution] (WNTMSCIruntime.zip,WNTMSCIlib.zip,WNTMSCIinc.zip)
 
| [http://tools.openoffice.org/moz_prebuild/OOo3.2 Mozilla binary distribution] (WNTMSCIruntime.zip,WNTMSCIlib.zip,WNTMSCIinc.zip)
  
Needed as prebuilts for module moz (SeaMonkey) as the current used SeaMonkey version 1.1.4 does not support a build with Visual Studio C++ 2008 compiler.
+
为了预建制模块moz(组件)目前使用的组件版本是1.1.4,不支持 Visual Studio C++ 2008编译器.
 
| main/moz/zipped
 
| main/moz/zipped
 
|-
 
|-
| msvcr71.dll and msvcp71.dll for Mozilla libraries (Search for them in the Web or on your PC. These files should be named as all lower case. Sometimes when downloaded they are upper case and this will cause 'file not found' errors towards the end of the build))
+
| msvcr71.dll msvcp71.dll动态链接库,这两个dll在 Mozilla libraries 起作用(到PC上或者网络上搜寻这两个文件.这两个文件都是小写名,有时下载的这两个文件是大写名,这会导致建制时搜寻不到这两个文件))
 
| main/external/msvcp71  
 
| main/external/msvcp71  
 
|-
 
|-
| msvcp80.dll and msvcr80.dll for Mozilla libraries (found in c:\WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd/msvc)
+
|msvcp80.dll msvcr80.dll 这两个dll在 Mozilla libraries 中起作用;(我们可以再以下位置找到他们c:\WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd/msvc)
 
| main/external/msvcp80
 
| main/external/msvcp80
 
|-
 
|-
| optional: [http://nsis.sourceforge.net/ Nullsoft Scriptable Install System (NSIS)]<ref name="Foot5">{{Template:Documentation/Note|If NSIS is available, a self contained Windows installer is created in addition to the MSI installer files.}}
+
| 可选项: [http://nsis.sourceforge.net/ Nullsoft Scriptable Install System (NSIS)]<ref name="Foot5">{{Note|If NSIS is available, a self contained Windows installer is created in addition to the MSI installer files.}}
{{Template:Documentation/Caution|It used to be that newer version of NSIS broke the build (see {{Bug|85657}}), but it seems that it now works for NSIS up to 2.3.7.}}</ref>
+
{{Warn|如果是NSIS,一个自包含的Windows安装程序被创建在MSI安装程序文件。过去的情况是新版本的NSIS会造成建制中断,但是现在看来NSIS升级到2.3.7也可工作;.}}</ref>
  
 
|
 
|
 
|-
 
|-
| optional: [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812 Microsoft DirectX SDK]<ref name="Foot6"> {{Template:Documentation/Note|If you don't want to download it you can disable DirectX support in the configuration step (<code>--disable-directx</code>).}}
+
| 可选项: [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812 Microsoft DirectX SDK]<ref name="Foot6"> {{Note|如果你不想下载它,你可以禁用DirectX的支持,在配置步骤使用--disable-directx .}}
{{Template:Documentation/Caution|Current (as of 2008/01) versions of the DirectX9 SDK and Windows Platform SDK do not fit to each other. To be able to build with DirextX enabled, you need to patch one file in the Platform SDK. See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID2743771 for details.}}
+
{{Warn|目前(2008/01)的DirectX9 SDK和Windows平台SDK的版本不互相兼容。为了能够在DirextX启用下建制,你需要修补Platform SDK中的一个文件,有关详细信息,请参见[http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID2743771].}}
  
{{Template:Documentation/Caution|Do not use a DirectX10 SDK!}}</ref>
+
{{Warn|不要使用DirectX10的SDK!}}</ref>
 
| --with-directx-home=
 
| --with-directx-home=
 
|}
 
|}
  
  
Legacy requirements that do not apply for Apache OpenOffice:
+
过期的Apache OpenOffice配置要求(已不适用):
 
{| class="prettytable" border="1" width="100%"
 
{| class="prettytable" border="1" width="100%"
 
|-
 
|-
! Where to get
+
! 从那里获得
! Place in
+
! 安置
 
|-
 
|-
| not needed anymore for Apache OpenOffice <s>Only for OOo2.x but due to {{Bug|88652}} in configure still needed for 3.x: [http://download.microsoft.com/download/b/7/5/b75eace3-00e2-4aa0-9a6f-0b6882c71642/unicows.exe unicows.dll from (Microsoft Layer for Unicode)]<ref name="Foot2"> {{Template:Documentation/Note|unicows.dll is available from the Microsoft site and needs to be saved to $SRC_ROOT/external/unicows. Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.}}</ref></s>
+
|Apache OpenOffice不再需要的 <s>仅仅适用于 OOo2.x版本 但根据bug报告 {{Bug|88652}} 3.x的配置中仍需要: [http://download.microsoft.com/download/b/7/5/b75eace3-00e2-4aa0-9a6f-0b6882c71642/unicows.exe unicows.dll from (Microsoft Layer for Unicode)]<ref name="Foot2"> {{Note|unicows.dll可以从微软的网站获取,需要被保存到$ SRC_ROOT /external/ unicows目录下。微软似乎很喜欢改变这个文件的确切位置。 您可能需要在微软的网站中搜索.}}</ref></s>
 
| <s>external/unicows</s>
 
| <s>external/unicows</s>
 
|-
 
|-
| not needed anymore for Apache OpenOffice <s>[http://download.microsoft.com/download/WindowsInstaller/Install/2.0/NT45/EN-US/InstMsiW.exe instmsiw.exe] and [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe instmsia.exe]</s>
+
| Apache OpenOffice不再需要的 <s>[http://download.microsoft.com/download/WindowsInstaller/Install/2.0/NT45/EN-US/InstMsiW.exe instmsiw.exe] and [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe instmsia.exe]</s>
 
| <s>external/msi</s>
 
| <s>external/msi</s>
 
|-
 
|-
| not needed anymore for Apache OpenOffice <s>for 2008 compiler (until DEV300 m22): msvcp90.dll and msvcr90.dll (found in $(msvcdir)\Vc\redist\x86\Microsoft.VC90.CRT)</s>  
+
| Apache OpenOffice不再需要的  <s>for 2008 compiler (until DEV300 m22): msvcp90.dll and msvcr90.dll (found in $(msvcdir)\Vc\redist\x86\Microsoft.VC90.CRT)</s>  
 
| <s>external/msvcp90</s>
 
| <s>external/msvcp90</s>
 
|-
 
|-
| not needed anymore for Apache OpenOffice <s>for 2008 compiler starting with DEV300m23: Microsoft_VC90_CRT_x86.msm and policy_9_0_Microsoft_VC90_CRT_x86.msm for non debug builds and Microsoft_VC90_DebugCRT_x86.msm and policy_9_0_Microsoft_VC90_DebugCRT_x86.msm for debug builds<ref name="Foot4"> {{Template:Documentation/Note|You can find these files in your directory c:\program files\common files\merge modules}}</ref>
+
| Apache OpenOffice不再需要的 <s> 在 DEV300m23下开启2008编译器: Microsoft_VC90_CRT_x86.msm and policy_9_0_Microsoft_VC90_CRT_x86.msm for non debug builds and Microsoft_VC90_DebugCRT_x86.msm and policy_9_0_Microsoft_VC90_DebugCRT_x86.msm for debug builds<ref name="Foot4"> {{Note|你可以在这个目录下找到 c:\program files\common files\merge modules}}</ref>
. These merge modules are available in VS08 Express Edition and VS08 Professional Edtion. All *.msm files are located at c:\Program Files\Common Files\Merge Module. </s>
+
. 这些联合的模块可以再vs08 Express版本和VS08 Professional版本下找到. 所有的 *.msm 文件 都在此位置 c:\Program Files\Common Files\Merge Module. </s>
 
| <s>main/external/msm90</s>
 
| <s>main/external/msm90</s>
 
|}
 
|}
  
=== adding required files to the build tree ===
+
=== 添加所有的文件到建制对应目录下 ===
  
{{Template:Documentation/Tip|Some of the files can be found in a suitable OOo installation set also, so you can save the download by “stealing” it from your OOo installation.}}
+
{{Tip|一些文件可在一个相匹配的OOo的安装文件中找到,这样你可以不必去下载,从你的安装文件中找到它即可,而节省一点不必要的工作.}}
  
{{Template:Documentation/Note|OOo uses some Mozilla libraries. Building the corresponding sources is only possible with the VC2003 compiler so you have to use precompiled libraries that require the msvx71 libraries mentioned above. On Windows the Mozilla libraries are needed only for Mozilla address book support. Unfortunately a bug in the module dependencies makes it necessary that the Mozilla libaries are used anyway as otherwise building the module <tt>xmlsecurity</tt> fails (see below).}}
+
{{Documentation/NoteOOo使用  Mozilla的库文件. 只有通过VC2003编译器才可能成功建立资源,所以你必须使用msvx71预编译库;在Windows系统中,Mozilla通讯录才需要Mozilla库支持; 不幸的是,有一个bug揭示:因为模块的依赖关系使得凡是依赖Mozilla库建立的模块必须依赖此模块,否则会失败; <tt>xmlsecurity</tt> (见下文).}}
  
{{Template:Documentation/Note|The default cygwin version offered on http://www.cygwin.com/ now is 1.7.x. For current milestones it is recommended to use this version as it fixes the .dll remapping probelm (see below) and is required for builds on Windows 7. If you need to build old versions of the source code, check out http://www.cygwin.com/win-9x.html}}
+
{{Note|默认提供的cygwin版本 http://www.cygwin.com/ 目前版本是1.7.x. 当前的进度中,我们建议您使用这个版本,因为它修复了.dll重映射的问题(见下文),而且可以运行在Windows 7上.如果你需要建立旧版本的资源,检查这里 http://www.cygwin.com/win-9x.html}}
  
= Installation and Preparation of Build Tools =
+
= 建制工具的准备和安装 =
== setting up cygwin ==
+
== 建立cygwin ==
  
Go to http://www.cygwin.com/ and download and install the current version.
+
你可以到这里 http://www.cygwin.com/ 下载和安装最新版本的cygwin.
{{Template:Documentation/Caution|Make sure that you keep the filetype set to “Unix/binary”.}}
+
{{Warn|请确保保持文件类型是"Unix/binary".}}
{{Template:Documentation/Caution|Make sure that the PATH variable in your cygwin shell does not contain any blanks and quotes, otherwise configure will not work}}
+
{{Warn|请确保cygwin shell路径中没有包含空格和引号,否则配置将不会正常工作}}
  
=== required additional packages ===
+
=== 额外需要的软件包 ===
Cygwin consists of some basic and a lot of optional packages. As building OOo needs some of these optional packages you have to select them in the installer.
+
Cygwin由一系列基础的和可选的安装包组成. 在建立OOo时,你需要在安装器中选择一些可选的安装包,这些需要的安装包如下:
Here's a complete list of the needed packages:
+
 
* Category Archive:
 
* Category Archive:
 
** unzip
 
** unzip
Line 135: Line 135:
 
** gperf
 
** gperf
 
** make
 
** make
** openssl-devel (only needed for perl modules for CWS tooling, see below)
+
** openssl-devel (仅在用 perl modules 建立 CWS工具时有效 , 见下文)
** mercurial (or cvs for 2.x-3.0, or subversion for 3.1 codeline)
+
** mercurial (需要 cvs 2.x-3.0, 或者3.1版本 )
 
** readline
 
** readline
 
* Category Libs
 
* Category Libs
Line 152: Line 152:
 
** wget
 
** wget
  
{{Template:Documentation/Note|The installer will automatically check and download some more packages needed by thosed listed here. The whole process takes roughly 20 minutes.}}
+
{{Note|安装器会自动检查和下载这些安装包需要的相关安装包,整个过程需要20分钟以上.}}
  
=== breaking links to executables ===
+
=== 使用可执行文件替换链接符号 ===
Within the Cygwin Toolkit, some executables might be symlinks: awk.exe and gunzip.exe, tar.exe (in older releases only). This can lead to a break of the build later, and the symlinks should be replaced by copies of the command they link to.
+
在Cygwin工具包,一些可执行文件仅仅符号链接(快捷键),如awk.exe gunzip.exe,tar.exe(旧版本)。 这可能会导致生成时的中断,应该使用该链接对应的命令行的副本更换符号链接
 
+
作为检查,请执行:
To check this, execute:
+
  
 
  ls -l /bin/awk.exe
 
  ls -l /bin/awk.exe
  
whether e.g. awk.exe is a symlink. In version 1.5.24-2 awk.exe is a link to gawk.exe. The shell will show this by putting out “awk.exe -> gawk.exe”. In this case gawk.exe must be copied to awk.exe by executing:  
+
例如:awk,exe是一个连接,在版本1.5.24-2中awk.exe仅仅是一个链接到gawk.exe的链接,执行这个shell将显示“awk.exe->gawk.exe”,因此,必须用gawk.exe覆盖awk.exe,通过以下命令:  
  
 
  cd /bin
 
  cd /bin
Line 168: Line 167:
  
  
In case you overlook something here or you have a newer Cygwin version with additional symlinks not mentioned here it's not a problem. You will get a helpful error message about an existing link in the configuration step (configure) later. The message will tell you which link you have to remove and you can do it following the advice given above for the awk.exe/gawk.exe pair.
+
如果你忽略了一些东西或者你碰到新Cygwin版本里有一些符号链接从没有被提到过,这没有多大影响. 你将会在稍后的配置步骤得到一个有用的有关链接错误告警消息,这个消息将告诉你不得不移删除一个链接.你可以根据awk.exe/gawk.exe环节给出的建议来做.
  
=== installing additional perl modules in cygwin ===
+
=== 在cygwin中安装额外perl模块 ===
As explained some perl modules must be installed with CPAN. The necessary command in the cygwin shell is
+
如上所说,一些perl 模块必须用CPAN来安装.使用shell命令来完成必要的安装:
  
 
  perl -MCPAN -e shell
 
  perl -MCPAN -e shell
  
If this command is executed the first time CPAN will ask for configuration. Choose autoconfiguration.  
+
如果这个命令第一次执行CPAN,它将会要求您配置,请选择自动配置.  
  
{{Template:Documentation/Caution|Please note that CPAN is not able to deal with usernames containing spaces. To work around this fact, when CPAN asks you to specify the ''CPAN build and cache directory'', change the default suggestion to <tt>/cpan</tt>.}}
+
{{Warn|请注意:CAPN不能过处理包含空格的用户名. 要解决这个问题, 当CPAN要求您指定的CPAN的构建和高速缓存目录时,建议更改默认的目录到此 <tt>/cpan</tt>.}}
  
At the end the CPAN shell appeared and is ready to accept commands for installations. Each module is installed by typing <code>install $MODULENAME</code>. The modules that must be installed are:
+
命令结束时,CPAN命令出现并随时准备接受命令进行安装;每一个模块使用命名 <code>install $模块名</code>. 一些必须被安装的模块是:
  
 
* Archive::Zip
 
* Archive::Zip
 
* LWP::UserAgent
 
* LWP::UserAgent
  
not needed anymore for Apache OpenOffice
+
Apache OpenOffice不在适用:
 
<s>
 
<s>
* XML::Parser (though it seems that this is already installed; doesn't hurt to do it)
+
* XML::Parser (虽然它看来是已经安装了,这样做也不会有影响)
 
* URI
 
* URI
 
* Crypt::SSLeay
 
* Crypt::SSLeay
Line 192: Line 191:
 
</s>
 
</s>
  
CPAN will detect if a selected module depends on other modules and it will offer to download them also. As explained please just confirm this.
+
CPAN将会侦测这些选择的模块是否依赖于其他的模块,同时也提供这些模块的下载;如上所说,请确认这些.
  
{{Template:Documentation/Note|The last three modules are only needed if you want to use the cws tooling. These tools are necessary if you want to create and maintain your own [http://wiki.services.openoffice.org/wiki/CWS Child Workspaces] or if you want to build one of them. I recommend to install them anyway as sooner or later you want to work on a child workspace.}}
+
{{Note|最后的三个模块仅仅在你需要适用cws工具时才需要. 这些工具在你创建和维护你自己的子工作空间步骤中起作用,[http://wiki.services.openoffice.org/wiki/CWS Child Workspaces] 或者你想要建立其中一个时这也是必须要的安装的. 建议你安装这些,因为你迟早都要工作在子工作空间.}}
  
{{Template:Documentation/Caution|I got an error message from CPAN somewhat like the following:
+
{{Warn|这有一个从CPAN错误例子:
 
<pre>C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\bin\cygiconv-2.dll to same
 
<pre>C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\bin\cygiconv-2.dll to same
 
address as parent(0x7C0000) != 0x7D0000</pre>
 
address as parent(0x7C0000) != 0x7D0000</pre>
To fix this, I had to exit the Cygwin shell, run cmd.exe, then type "c:\cygwin\bin\ash.exe" to start the minimal shell, then type <code>/bin/rebaseall</code>. Then CPAN worked when I ran it again.}}
+
为了修正这问题, 退出Cygwin, 运行cmd.exe, 输入"c:\cygwin\bin\ash.exe" 启动ash.exe, 然后输入 <code>/bin/rebaseall</code>. CPAN将重新运行.}}
  
{{Template:Documentation/Caution| I got another error when cygwin was performing <tt>make install</tt>:
+
{{Warn|另一个发生在当使用cygwin运行<tt>make install</tt>时的错误例子 :
 
<pre>ERROR: Can't create '/usr/bin'; Do not have write permissions on '/usr/bin'</pre>
 
<pre>ERROR: Can't create '/usr/bin'; Do not have write permissions on '/usr/bin'</pre>
I can actually write to /usr/bin; however when I do <tt>ls -ld /usr/bin</tt>, cygwin reports no write permission; and <tt>chmod u+w /usr/bin</tt> gives <tt>Permission denied</tt>. This causes the install process to fail when it checks permissions. As a kludge, I installed vim, and edited line 368 of /usr/lib/perl5/5.10/ExtUtils/Install.pm, replacing this:
+
其实我可以写入到/usr/bin; 但是当我执行 <tt>ls -ld /usr/bin</tt>, cygwin提示不具有写入权限; 并且<tt>chmod(文件访问模式) u+w /usr/bin</tt> 提示 <tt>Permission denied</tt>(权限被拒绝). 这将导致因为权限拒绝而导致安装过程失败. 作为一个组合,我安装了vim,并且编辑了 / usr/lib/perl5/5.10/ExtUtils/Install.pm的368行,更换:
 
<pre>return -w $dir;</pre>
 
<pre>return -w $dir;</pre>
with this:
+
替换为:
 
<pre>return 1;</pre>
 
<pre>return 1;</pre>
which allowed installation to proceed.}}
+
该命令意思是允许安装进行.}}
  
= Full Builds =
+
=全部建制 =
  
{{Template:Documentation/Caution| Use a short absolute directory name to store OpenOffice.org source, such as <tt>C:\ooo</tt>. Otherwise, there are weird issues during the building of the <tt>postprocess</tt> module, because the command line length of some build actions is too long: <pre> 1 [main] perl 1972 C:\cygwin\bin\perl.exe: *** fatal error - fork: can't reserve memory for stack 0x83C840 - 0x840000,  
+
{{Warn| 请使用一个短的绝对路径来存储OpenOffice.org资源,例如 <tt>C:\ooo</tt>.否则,在后续的模块建制过程中将会因为某些建制动作命令行长度过长而出现奇怪的问题: <pre> 1 [main] perl 1972 C:\cygwin\bin\perl.exe: *** fatal error - fork: can't reserve memory for stack 0x83C840 - 0x840000,  
 
Win32 error 487
 
Win32 error 487
 
  </pre>}}
 
  </pre>}}
  
== configure ==
+
== 配置 ==
Finally the <code>configure</code> tool is used to create the environment. It checks that all software, hardware, and system requirements for the build are satisfied, and creates configuration files called winenv.set (for tcsh) and winenv.set.sh (for bash) that are used to set all necessary build environment variables. Before running configure, make sure that all needed programs are in the system path or start configure with the appropriate command line switches. If configure detects a problem it will stop and give you a useful hint how to fix it.
+
配置工具用于创建环境.  
 +
它将检测所有的软硬件信息和系统设备是否满足建制要求, 创建配置文件通过调用:winenv.set(tcsh)和winenv.set.sh(bash)这两个文件来设置建制需要的环境变量.在运行配置之前,请确保所需的所有程序都在系统路径或通过相应的命令行启动配置.如果配置侦测到了问题,它将会停止并提供一些有用的信息帮助你修复配置.
  
For building OOo from the Mercurial repository:
+
从Mercurial库建制OOo:
You will find the <code>configure</code> script in <code>$SRC_ROOT</code>. The resulting configuration files are created there too.
+
你将发现配置信息脚本文件在根目录下;配置的结果文件也生成在根目录下.
  
For building OOo from the Apache svn repository:
+
从Apache的SVN存储库建设OOo:
call <code>autoconf</code> in <code>$SRC_ROOT</code>. This will create the configure step. Repeat that and the configure step after each change in configure.in (either by yourself or anyone else).And every time you make changes to the <code>configure.in</code> script, the script will remind you to run <code>autoconf</code> again.
+
<code>$SRC_ROOT</code>下调用<code>autoconf</code>. 它将生成配置步骤.  
 +
在每次在<code>configure.in</code>(无论是自己或其他任何人)更改配置步骤后和每次进行更改<code>configure.in</code>脚本,该脚本会提醒你重新运行<code>autoconf</code>.
  
 
  autoconf
 
  autoconf
  
==== sample configure calls ====
+
==== 配置例子 ====
  
You can get short explanations for all parameters by using ./configure --help.
+
你可以通过使用 ./configure --help来获得所有参数的简短的解释.
  
minimum (requires the most prerequisites) - pathes of course are machine dependent:
+
最精短配置(当然最基本的先决条件得满足)--路径根据不同设备而不同:
  
 
  ./configure  
 
  ./configure  
Line 246: Line 247:
 
   --with-ant-home=/ant \
 
   --with-ant-home=/ant \
  
some further settings that might help to get rid of some prerequisites that not every developer needs (but be aware, this will also remove some parts from the final build result):
+
这里有一些高阶设定能够帮助你拜托一些先决条件准备 这并不是每一个开发者都要求的(但是要注意,这操作会从最终的建制结果中删除某些部分):
  
 
   --disable-mozilla \
 
   --disable-mozilla \
Line 256: Line 257:
 
   --disable-odk \
 
   --disable-odk \
  
for all builds on code lines older than OOo330 or older than milestone m77 on the DEV300 code line:
+
以下是为了在比OOo330版本的版本或者比DEV300旧的版本中建制:
  
 
   --with-use-shell=bash
 
   --with-use-shell=bash
  
some other settings worth considering:  
+
一些设置请慎重考虑:  
  
 
   --enable-pch \
 
   --enable-pch \
Line 266: Line 267:
 
   --enable-dbgutil \
 
   --enable-dbgutil \
  
in case you want to have several workspaces on your hard disk, it might be a good idea to share external source tarballs:
+
如果你想要在你的磁盘中建立多个工作空间,将外部资源包文件设为共享将会是个不错的主意:
  
 
   --with-external-tar=d:/OOo/ext_sources \
 
   --with-external-tar=d:/OOo/ext_sources \
  
==== configure settings tips ====
+
==== 配置设定提示 ====
{{Template:Documentation/Caution|Make sure that the <code>PATH</code> variable in your cygwin shell does not contain any blanks and quotes.}}
+
{{Warn|确保Cygwin的shell的<code>PATH</code>变量中不包含任何空格和引号}}
{{Template:Documentation/Caution|Paths might have problems with spaces. Install requirements into pathes without them. Alternatively, feel free to install the various packages using the default path containing spaces and then use the mixed short path for the configure stage. The mixed short path can be obtained using Cygwin's cygpath tool, eg:
+
{{Warn|路径含有空格将会导致问题. 安装要求路径不能含有空格;然而,各种安装包使用的默认路径中包含空格,这些会使用混合短路径的来配置。 混合短路径可以使用Cygwin的cygpath的工具得到, eg:
 
<pre>$ cygpath -m -s "c:\Program Files\Microsoft Visual Studio 9.0\VC"
 
<pre>$ cygpath -m -s "c:\Program Files\Microsoft Visual Studio 9.0\VC"
 
  c:/PROGRA~1/MICROS~1.0/VC</pre>
 
  c:/PROGRA~1/MICROS~1.0/VC</pre>
The <code>with-psdk-home</code> setting needs a case-sensitive path name. I recommend to use case-sensitive usage in all cases - it's good to get used to case sensitivity if you are going to work with Cygwin.}}
+
<code>with-psdk-home</code>设置需要区分大小写的路径名。 在任何情况下,我建议使用区分大小写的用法 - 如果你要使用Cygwin,区分大小写这是很好的习惯.}}
{{Template:Documentation/Caution|Beware of using <code>/c/</code> instead of <code>/cygdrive/c/</code>.}}
+
{{Warn|注意使用<code>/c/</code> 而不是 <code>/cygdrive/c/</code>.}}
{{Template:Documentation/Caution|Avoid trailing slashes in configure parameters. They sure cause problems for <code>--with-psdk-home</code>.}}
+
{{Warn|在配置参数中主意避免斜划线,在<code>--with--psdk--home</code>过程中斜划线将会导致问题.}}
{{Template:Documentation/Note|Paths to dependencies might be different for your installation. The pathes containing "msvc" and "msdk" should be self-explanatory.}}
+
{{Note|不同的安装所安装路径而不同,作为开发者包含msvc和msdk的路径您应该相当清楚.}}
{{Template:Documentation/Tip|There are a number of options that you can use with the configure script. To display these options, type the following command:
+
{{Tip|有很多的可选配置脚本文件你可以使用,你可以使用以下命令来查看:
 
<pre>./configure --help</pre>}}
 
<pre>./configure --help</pre>}}
{{Template:Documentation/Tip|If you run into problems with early DEV300 releases, check your settings in winenv.set.sh for <code>WINDOWS_VISTA_PSDK</code> to be set <code>TRUE</code>. This is important if <code>configure</code> fails to detect the Windows platform SDK version correctly. The detection failure results from the way how configure searches for the Vista PSDK in older releases: it will be found only if it is installed into the default location.}}  
+
{{Tip|如果你运行在DEV300上出现问题,请在<code>winenv.set.sh</code>中检查<code>WINDOWS_VISTA_PSDK</code>的设定,设定其为true, This is important if <code>configure</code> fails to detect the Windows platform SDK version correctly. The detection failure results from the way how configure searches for the Vista PSDK in older releases: it will be found only if it is installed into the default location.}}  
{{Template:Documentation/Caution|If you run into problems compiling on an "Express Edition" (such as <tt>Cannot open include files: 'atlbase.h': No such files or directory</tt>), check your settings in winenv.set.sh for <code>DISABLE_ATL</code>, <code>DISABLE_ACTIVEX</code>: all have to be set <code>TRUE</code>. Visual Studio Express compilers do not contain everything needed to build the OOo ActiveX control, OLE automation and native Windows OLE support, so either disable support for them via <code>--disable-atl --disable-activex</code> or add them [http://stackoverflow.com/questions/6979918/compile-atl-project-with-only-windows-sdk-7-1 via the WDK].
+
{{Warn|If you run into problems compiling on an "Express Edition" (such as <tt>Cannot open include files: 'atlbase.h': No such files or directory</tt>), check your settings in winenv.set.sh for <code>DISABLE_ATL</code>, <code>DISABLE_ACTIVEX</code>: all have to be set <code>TRUE</code>. Visual Studio Express compilers do not contain everything needed to 建制OOo所需的全部ActiveX控件、自动OLE和原生Windows OLE支持,所以通过--disable-atl --disable-activex 禁用他们或者增加他们通过这里:[http://stackoverflow.com/questions/6979918/compile-atl-project-with-only-windows-sdk-7-1 via the WDK].
{{Template:Documentation/Tip|As DirectX is not needed for most developers, its SDK consumes a lot of disk space and is prone to incompatibilities I recommend to build without DirecX support by using <code>--disable-directx</code> as shown above. Otherwise you have to provide the path to the SDK in <code>--with-directx-home</code>.}}
+
{{Tip|因为并不是所有的开发者需要DiretX,它的SDK需要消耗大量硬盘空间,而且易于导致不兼容,所以我们建议通过--disable-directx建制一个没有DirectX支持的OOo,如上述例子中一样,否则,你必须提供DirectX支持的SDK路径,你可以使用<code>--with-directx-home</code>来设置}}
{{Template:Documentation/Tip|OOo uses some Mozilla components. It is not possible to build them from the sources using the Visual Studio 2005 compiler. Disabling the Mozilla components with <code>--disable-mozilla</code> completely currently does might not work due to a bug in the module dependencies.}}
+
{{Tip|OOo使用了Mozilla的一些组件。使用Visual Studio 2005编译器编译源代码来建制OOo是不可能的。通过<code>--disable-mozilla</code> 来完全禁用Mozilla 组件根据当前BUG报告,因为模块之间的相互依赖性,这可能会导致建制不能正常工作.}}
{{Template:Documentation/Tip|If you experiment with the newest sources, mind that it can happen sometimes that <code>configure.in</code> was updated, but it was forgotten to update configure too. The configure script itself is created from <code>configure.in</code> using the <code>autoreconf</code> command. The perl script <code>set_soenv</code> is created when you run configure from <code>set_soenv.in</code>.}}
+
{{Tip|如果试用最新的源代码资源,错误有可能发生,因为configure.in更新了,但是配置忘记了更新;配置脚本是configure.in使用autoreconf命令中产生的;perl脚本set_soenv是从set_soenv.in运行配置产生的}}
{{Template:Documentation/Tip|csc.exe comes from the <code>c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322</code> directory, you might need <code>--with-csc-path</code>.}}
+
{{Tip|csc.exe在 <code>c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322</code> 目录中,你可能需要 <code>--with-csc-path</code>.}}
{{Template:Documentation/Tip|If you fail to getting together a working installation of Cygwin, one possibility is to use a known-to-work combination of Cygwin packages, i.e. a direct copy of some other user's Cygwin tree. [[User:TorLillqvist]] has such a tree (from late 2006) zipped up at http://download.go-oo.org/tstnvl/tml/tml-cygwin.zip . Don't hesitate to ask for advice if necessary.}}
+
{{Tip|如果你未能成功安装Cygwin,有一种方法是使用已知的在Cygwin起作用的安装包,也就是说直接从其他用户相应的目录下那里复制相应的安装包. [[用户:TorLillqvist]]有一些安装树目录压缩存放在 http://download.go-oo.org/tstnvl/tml/tml-cygwin.zip . 如果需要帮助尽管问他.}}
  
== bootstrap ==
+
== 引导 ==
After running configure you must create the dmake make utility that is needed for the build of OpenOffice.org. This done from the SRC_ROOT directory by calling
+
在运行configure之后,你必须为创建OpenOffice.org而创建一个dmake make实用程序。 通过这从SRC_ROOT(根目录)目录下调用
  
 
  ./bootstrap
 
  ./bootstrap
  
{{Template:Documentation/Note|1=Starting with DEV300m77, the sources for external modules (e.g. libxml2) were moved out of the source repository. The bootstrap step will now create a directory called "ext_sources" beside the repository and populate it with the required file via HTTP.
+
{{Note|1=以DEV300M77启动,外部模块资源(例如,libxm12)被从资源代码库移出。引导步骤将会在资源库边上直接创建一个"ext_sources"库,并通过http下载需要的文件在该库里.
If need to change that behavior, checkout the configure switches
+
如果想要改变这些默认配置,请检测配置
  --with-external-tar=<TARFILE PATH>  : Specify path to tarfiles manually
+
  --with-external-tar=<TARFILE PATH>  : 手动指定路径
  --disable-fetch-external            : Disables fetching external tarballs from web sources.}}
+
  --disable-fetch-external            : 禁止从网络资源中获取外部压缩包.}}
  
== setting the enviroment ==
+
== 设定环境 ==
  
When the configure script has been run successfully a file <code>winenv.Set.sh</code> was created<ref name="Foot7">{{Template:Documentation/Note|When you want to use tcsh instead of bash, you will need to use the file <code>winenv.Set</code> instead:
+
当配置脚本成功运行后,winenv.set.sn文件将会生成;请执行:<ref name="Foot7">{{Note|如果你想使用tcsh而不是bash,你需要使用winenv.set来代替::
 
<pre> source winenv.Set
 
<pre> source winenv.Set
 
  rehash</pre>
 
  rehash</pre>
If you do not use tcsh, it is better to delete that file, as it will get in the way for tab-completion sooner or later.}}</ref>. Do this:
+
如果你不使用tchs,最好删除这个文件,因为迟早它将阻碍完全建制.}}</ref>. 请执行:
  
 
  source winenv.Set.sh
 
  source winenv.Set.sh
  
to set up the enviroment for the build.
+
来设定建制的环境.
  
== starting the build ==
+
== 开始建制 ==
Build the software by typing the following in <code>$SRC_ROOT</code><ref name="Foot8">{{Template:Documentation/Note|You can also run:
+
请在根目录下输入以下来建制<code>$SRC_ROOT</code><ref name="Foot8">{{Note|你也可以运行:
 
<pre>make</pre>
 
<pre>make</pre>
but GNU/make will just start dmake. You can also run the following in the <code>instetoo_native</code> module:
+
但是 GNU/make 仅仅会启动 dmake. 你也可以在instetoo_native模块下运行:
 
<pre>build --all</pre>
 
<pre>build --all</pre>
For details run:
+
有关详细信息,请运行:
 
<pre>build --help</pre>}}</ref>:
 
<pre>build --help</pre>}}</ref>:
 
  dmake
 
  dmake
  
The building procedure will take at least an hour (on a 3 GHz Quad-Core with 8GB RAM).
+
建制过程至少需要一个小时(3GHz,4核,8G内存).
  
There are some special things in the way how OOo builds its modules. Every module has an “output” folder (with some subfolders for the different kinds of generated output) that is created the first time a build is done in the module. The name of this folder is “wntmsci10.pro” for builds with MSVC++2003, “wntmsci11.pro” for builds with MSVC++2005 and "wntmsci12.pro" for builds with MSVC++2008 (for the meaning of the "pro" extension see below). After a successful build of a module some of the generated files are copied to the output folder of the “solver” module by executing a tool called “deliver” (this is automatically called by build --all for each of the modules). Other modules will take these “delivered” files (header files, libraries etc.) to resolve their dependencies. The content of the solver module will also be used to pack the installation sets in the final step.
+
OOo在建制其模块过程中有很多特别的东西,每个模块在它第一次建制过程中都有一个“输出”文件夹(输出生成的一些子文件夹)生成.通过MSVC++2003建制的文件夹名字是“wntmsci10.pro”,在MSVC++2005和MSVC++2008建制下该文件夹名字是“wntmsci12.pro”.成功建制一个模块之后一些生成的文件通过执行一个名为“deliver”的工具(自动在建制每一个模块中执行)复制到一个命名为“solver”模块输出文件夹中.其他的模块将使用这些“deloverd”文件(头文件,库...)来解决他们之间的依赖;solver模块的内容页将被用来包装最后的安装步骤.
  
{{Template:Documentation/Tip|Using some not quite latest cygwin releases (1.5.18/1.5.19) can lead to tcsh freezing in places - the build will appear to hang. You can fix this by running ''ls /proc/$nnn/fd'' where $nnn is the number of the process. Or just run
+
{{Tip|使用一些不是最新版的cygwin(1.5.18/1.5.19)将导致建制挂起,你可以在$nnn是运行的进程号处运行ls /proc/$nnn/fd,或者运行:
 
<pre>ls /proc/*/fd</pre>
 
<pre>ls /proc/*/fd</pre>
to "unhang" the process. See {{Bug|51560}} for more info...}}
+
“取消挂起”的过程详细信息,请参阅参考51560}}
  
  
= Partial Builds =
+
= 部分建制 =
There are two ways to do partial builds:
+
有两种部分建制的方法:
* compatible
+
* 兼容的
* incompatible
+
* 不兼容的
Only do compatible partial builds if you know exactly what you are doing.
+
如果你清楚你正在干什么那么可以选择兼容模式;
{{Documentation/Note|For more information, see [[Compatible Builds]].}}
+
{{Note|更多的信息,请看兼容模式建制 [[Compatible Builds]].}}
== rebuilding from a module (incompatible build) ==
+
 
+
If you decide to change a module in an incompatible way, you will need to rebuild all modules depending on it (directly or indirectly):
+
  
 +
== 模块重建(不兼容建制)==
 +
如果你决定用不兼容的模式建制一个模块,你需要重建所有依赖于此模块的模块(直接或间接);
 
  cd $SRC_ROOT/instsetoo_native
 
  cd $SRC_ROOT/instsetoo_native
 
  build --from $INCOMPATIPLEMODULE --prepare
 
  build --from $INCOMPATIPLEMODULE --prepare
 
  build --from $INCOMPATIBLEMODULE
 
  build --from $INCOMPATIBLEMODULE
  
== rebuilding a module (compatible build) ==
+
== 模块重建(兼容建制) ==
  
To rebuild a module you can delete all output directories with, rebuild and redeliver into the solver with:
+
重建一个模块时,你需要直接删除掉所有的输出文件,并且重新建制和传递到solver,通过以下命令:
  
 
  cd $MODULE
 
  cd $MODULE
Line 350: Line 350:
 
  build && deliver
 
  build && deliver
  
A simple <code>build</code> in <code>$SRC_ROOT/instsetoo_native</code> will recreate the installation sets, provided all other modules have already been build.<ref name="Foot9">{{Documentation/Caution|<code>build --all</code> would rebuild changed/missing files. However, it does not check for incompatible modules. If unsure, use <code>build --from --prepare</code>.}}</ref>
+
根目录下instsetoo_native中的简单建制将会重新创建安装步骤,先确保其他的所有模块已经建制完成.<ref name="Foot9">{{Warn|<code>build --all</code> 将重建 更改的文件。 但是,它不检查不兼容的模块。 如果不确定,请使用<code>build --from --prepare</code>.}}</ref>
  
= Building a Module with Debug Information =
+
= 建制一个带有debug信息的模块 =
  
To rebuild a module with debug information and additional assertions and checks, run:
+
建制一个带有debug信息和额外断言和检测的模块,请运行:
  
 
  cd $MODULE
 
  cd $MODULE
Line 360: Line 360:
 
  build debug=true --from $MODULE
 
  build debug=true --from $MODULE
  
Drop the newly created binaries into an existing installation. Building an installation set with them will not help, as binaries are stripped on packing by default.
+
把新创建的二进制文件替换到现有的安装文件。 这些与建立一个安装并不起任何作用;因为默认情况二进制文件被剥夺.
  
{{Template:Documentation/Tip|For details, see [[Windows Debugging]].}}
+
{{Tip|更详细的内容请看 [[Windows Debugging]].}}
= Finding the Installation Sets =
+
 
After a successful build you will find the OOo installation set in
+
= 查找安装设置 =
 +
成功建制后你将在以下位置找到OOo的安装
  
 
  instsetoo_native/wntmscixx.pro/OpenOffice/msi/Install/en-US
 
  instsetoo_native/wntmscixx.pro/OpenOffice/msi/Install/en-US
  
“instsetoo_native” is the module that packs the installation set.
+
instsetoo_native是一个安装设置的模块.
  
{{Documentation/Tip|If you already have a version of OOo installed you can install your freshly built version in parallel by installing it with setup /a that just unpacks all files without any system registration. See [[Run_OOo_versions_parallel|Running in parallel]].}}
+
{{Tip|如果你已经安装一个版本的OOo,你可以在平行的安装刚刚建制的版本,通过设置安装 /a 解压缩的所有文件而不需要任何系统注册; 请参阅 [[Run_OOo_versions_parallel|Running in parallel]].}}
  
= Tips And Tricks =
+
= 技巧和窍门 =
== ccache ==
+
== 高速缓存 ==
For Windows: download from [http://artax.karlin.mff.cuni.cz/~kendy/ccache/ here], do the following:
+
Windows系统从这里下载[http://artax.karlin.mff.cuni.cz/~kendy/ccache/ here],按照以下步骤进行 :
  
 
  export CCACHE_DIR="some/place/with/space"
 
  export CCACHE_DIR="some/place/with/space"
Line 381: Line 382:
 
  export CXX="guw.pl ccache cl"
 
  export CXX="guw.pl ccache cl"
 
  # export USE_PCH=  if you experience trouble with precompiled headers
 
  # export USE_PCH=  if you experience trouble with precompiled headers
== dependencies ==
+
 
 +
== 依赖性 ==
  
 
'''nodep'''
 
'''nodep'''
  
If you set the environment variable <code>nodep</code> to <code>TRUE</code>, then dependendy information files are not created - the build finishes faster.
+
如果你将环境变量nodep设为true,那么dependendy的信息文件不会创建-构建也完成得更快.
  
{{Template:Documentation/Caution|But only enable that on a clean build. Once you have built OOo and then made modifications, unset the variable again to be on the safe side.}}
+
{{Warn|但是仅仅在纯建制时,设置其为使能;一旦你建制了OOo并且已经修改过,出于安全考虑请重置变量.}}
  
 
'''NO_HIDS'''
 
'''NO_HIDS'''
  
Similar to the <code>nodep</code> variable, this one prevents the generation of HIDs (Help IDs) that are mainly used for automated testing - if you only want to build OOo, you don't need those.
+
这个是和nodep类似的变量,它阻止一些为自动测试而生成的HID文件的生成;如果你仅仅是想要建制一个OOo,那么你没必要需要这些;.
  
== parallel builds ==
+
== 平行建制 ==
If you have a multiprocessor machine or similar, you can run a parallel build. There are two levels  of parallelism  - one operating on makefile (directory) level, the other one on the global level. The two levels of parallelism result from the two-step build procedure in the OOo build environment. The build script runs through all the directories it reads from the build.lst files in all modules and calls dmake for every directory.  
+
如果你有一个多刻处理器机器或类似的,你可以运行一个并行构建。有两个级别的并行 - makefile文件(目录)的水平,另外一个在全局层面上运行的。这两个级别平行建制由OOo建制环境中两个建制步骤产生;建制脚本从所有目录中的模块的build.lst文件中读取运行脚本运行 并且dmake每一个目录;
 +
.  
  
'''parallelism on the global level'''
+
'''全局层面的平行建制'''
  
For parallelism on the global level, you have to run build from <code>$SRC_ROOT>/instsetoo_native</code> with the <code>-P<number></code> switch, for example:
+
全局层面的平行建制,你必须运行建制从 $SRC_ROOT/instsetoo_native目录下使用-P<处理器数目>,例如:
 
<pre>
 
<pre>
 
build -P2
 
build -P2
 
</pre>
 
</pre>
  
This takes build how many dmake processes it is allowd to start in parallel.
+
这命令告诉build过程允许同时并行执行多少个dmake进程.
  
'''parallelism on the directory level'''
+
'''目录层面的平行建制'''
  
 
  export MAXPROCESS=<numer or processes>  
 
  export MAXPROCESS=<numer or processes>  
  
This tells dmake how many targets it is allowed to build in parallel. When you don't use build.pl but build a single directory (single makefile), you can achieve the same with
+
这命令告诉dmake有多少个目标被允许同时并行建制;当你不使用build.pl但是建制一个单一的目录(单一的makefile),你可以使用
 
+
 
<pre>
 
<pre>
 
dmake -P2
 
dmake -P2
 
</pre>
 
</pre>
  
'''combining both levels'''
+
'''结合两种等级平行建制'''
  
If you want to have parallelism on both levels, you can call
+
如果想结合两种等级平行建制
  
 
<pre>
 
<pre>
Line 423: Line 425:
 
</pre>
 
</pre>
  
"--" is a special build.pl parameter that passes every further parameters to the dmake processes it starts.
+
"--" "是build.pl一个特殊的参数,传递当dmake开始后需要的下一个参数.
  
''' Recommendation '''
+
'''推荐 '''
  
Experience tells that using the doubled number of cores in your machine is a good choice, using more threads does not make a big difference, except if the combined option is chosen. So even on single core machines using two threads will speed up the build considerably.
+
经验告诉我们使用多颗处理器是一个好的选择,使用多个线程并不会早场大麻烦,除了当合并的选项被选上;所以咋一个单核处理器中使用两个以上的线程将会加速建制过程;
  
== create prebuilt mozilla ==
+
== 创建预编译Mozilla浏览器 ==
For the mozilla-components you have the choice to either build from mozilla sources, to use precompiled packages or to use system-mozilla (the one installed on your buildsystem, not everything might work, depending on the version you got installed).
+
对于mozilla的组件,你可以选择要么从Mozilla的资源使用预编译的软件包构建,或者或使用系统Mozilla浏览器(安装在您的构建系统中,不是一切都可以使用,这取决于你被安装的版本)如果你愿意你可以轻松的创建一个预先包装的二进制文件的版本(或因为你无法使用官方的资源,或者编译器不匹配而无法建制或者其他技术原因或者因为你想建立的东西你没有建制),请参照:
You can easily create your own version of the prepacked binaries if you wish to do so (either because you cannot use the official ones because of mismatch of compiler version used to build them/other technical reasons or because you want to use stuff you didn't build yourself).
+
To do so:
+
  
* build the <code>moz</code> module from the mozilla sources
+
* 从Mozilla源建立moz模块
* use <code>--enable-build-mozilla</code> when running configure and put the mozilla-source tarball to <code>moz/download</code>
+
* 运行时配置时请运行--enable-build-mozilla并把Mozilla的源代码包放到moz/download目录下
* in <code>moz</code> run <code>dmake zip</code> to create the zip files
+
* 在moz中运行 dmake zip 创建zip文件
* you'll find the zips in <code>{platform}.pro/zipped</code>
+
* 你可以在 {platform}.pro/zipped发现zips;
  
Copy them to a location of your liking.
+
将它们复制到你喜欢的位置.
Now instead of using <code>--enable-build-mozilla</code>, use <code>--disable-build-mozilla</code> and copy the zips you created or downloaded to <code>moz/zipped</code> and these will be used when compiling.
+
现在使用--disable-build-mozilla而不是使用--enable-build-mozilla ,并复制你创建或下载的zips到moz/zipped ,这些在编译时使用。这将大大降低你的建制时间(否则你将花费额外的时间用来编译mozilla);
This will greatly reduce build-time (you save the time that would otherwise be spent on compiling mozilla).
+
  
= See Also =
+
= 参考 =
{{Template:Documentation/Note|For more information on building OOo on Windows see:
+
{{Note|For more information on building OOo on Windows see:
 
* [[Building on Windows (older releases)]]
 
* [[Building on Windows (older releases)]]
 
* [[CPAN_install| Perl modules installation with CPAN]]
 
* [[CPAN_install| Perl modules installation with CPAN]]

Latest revision as of 10:17, 16 July 2018


概述

Documentation windows.png 这个文档解释了怎么在Windows系统下建立一个OpenOffice.org的源代码.

为了能够建制 OpenOffice.org我们需要Cygwin这个工具 , 这是一个模拟一个完整的Unix命令环境的 Windows 程序.为了能够使用它,你需要熟悉命令行, 当然,并不需要你相当了解Unix 内核.

Tip.png 如果你从未使用过Unix shell命令, 你可以访问这个网页 TLDP内核介绍.


Documentation note.png $SRC_ROOT 将表示 OpenOffice.org源代码资源存储所在路径.
Tip.png 当您建制时建议您检测发布说明来获得与以前发布的版本的一些改变.


基本配置要求

硬件要求

  • 1 个或者多个CPU(速度当然会更快) (推荐x-系类CPU )
  • 1 GB 内存 (推荐2 GB )
  • 10 GB 可存储空间 (debug时需要20 GB )

软件要求

  • Windows XP/Vista/7

表格里面的项目是建制必须的一些准备,这些项目解释如下. 表格里面的文件列表列出了中、需要下载的(附有下载链接)文件,这些文件必须放在相应的资源根目录下:


从哪里获取这些文件 放置/使用配置
Cygwin: Cygwin 工具 (dll版本 1.5.10)或者更高版本 (默认)
C/C++ 编译器: C++ 2008 标准版 编译器 (基本安装, 没有可选要求) 专业版: Visual C++ 2008 Professional --with-cl-home=
Java: JDK 1.6 DEV300 版本 >= m37 适用于 OOo310 系列版本 (旧版本的java 在 hsqldb 模块下将会失败) --with-jdk-home=
Windows SDK for Windows Server 2008[1]
GDI+ Redistributable (Genuine Windows Validation required) main/external/gdiplus
dbghelp.dll[2]

也可以在Visual Studio C++ 2008Express安装文件中找到.

main/external/dbghelp
Apache Ant ( 1.6.5版本或者更高版本) --with-ant-home=
Mozilla binary distribution (WNTMSCIruntime.zip,WNTMSCIlib.zip,WNTMSCIinc.zip)

为了预建制模块moz(组件)目前使用的组件版本是1.1.4,不支持 Visual Studio C++ 2008编译器.

main/moz/zipped
msvcr71.dll 和 msvcp71.dll动态链接库,这两个dll在 Mozilla libraries 起作用(到PC上或者网络上搜寻这两个文件.这两个文件都是小写名,有时下载的这两个文件是大写名,这会导致建制时搜寻不到这两个文件)) main/external/msvcp71
msvcp80.dll 和 msvcr80.dll 这两个dll在 Mozilla libraries 中起作用;(我们可以再以下位置找到他们c:\WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd/msvc) main/external/msvcp80
可选项: Nullsoft Scriptable Install System (NSIS)[3]
可选项: Microsoft DirectX SDK[4] --with-directx-home=


过期的Apache OpenOffice配置要求(已不适用):

从那里获得 安置
Apache OpenOffice不再需要的 仅仅适用于 OOo2.x版本 但根据bug报告 Issue 88652 3.x的配置中仍需要: unicows.dll from (Microsoft Layer for Unicode)[5] external/unicows
Apache OpenOffice不再需要的 instmsiw.exe and instmsia.exe external/msi
Apache OpenOffice不再需要的 for 2008 compiler (until DEV300 m22): msvcp90.dll and msvcr90.dll (found in $(msvcdir)\Vc\redist\x86\Microsoft.VC90.CRT) external/msvcp90
Apache OpenOffice不再需要的 在 DEV300m23下开启2008编译器: Microsoft_VC90_CRT_x86.msm and policy_9_0_Microsoft_VC90_CRT_x86.msm for non debug builds and Microsoft_VC90_DebugCRT_x86.msm and policy_9_0_Microsoft_VC90_DebugCRT_x86.msm for debug builds[6]

. 这些联合的模块可以再vs08 Express版本和VS08 Professional版本下找到. 所有的 *.msm 文件 都在此位置 c:\Program Files\Common Files\Merge Module.

main/external/msm90

添加所有的文件到建制对应目录下

Tip.png 一些文件可在一个相匹配的OOo的安装文件中找到,这样你可以不必去下载,从你的安装文件中找到它即可,而节省一点不必要的工作.


{{Documentation/NoteOOo使用 Mozilla的库文件. 只有通过VC2003编译器才可能成功建立资源,所以你必须使用msvx71预编译库;在Windows系统中,Mozilla通讯录才需要Mozilla库支持; 不幸的是,有一个bug揭示:因为模块的依赖关系使得凡是依赖Mozilla库建立的模块必须依赖此模块,否则会失败; xmlsecurity (见下文).}}

Documentation note.png 默认提供的cygwin版本 http://www.cygwin.com/ 目前版本是1.7.x. 当前的进度中,我们建议您使用这个版本,因为它修复了.dll重映射的问题(见下文),而且可以运行在Windows 7上.如果你需要建立旧版本的资源,检查这里 http://www.cygwin.com/win-9x.html

建制工具的准备和安装

建立cygwin

你可以到这里 http://www.cygwin.com/ 下载和安装最新版本的cygwin.

Documentation caution.png 请确保保持文件类型是"Unix/binary".
Documentation caution.png 请确保cygwin shell路径中没有包含空格和引号,否则配置将不会正常工作

额外需要的软件包

Cygwin由一系列基础的和可选的安装包组成. 在建立OOo时,你需要在安装器中选择一些可选的安装包,这些需要的安装包如下:

  • Category Archive:
    • unzip
    • zip
  • Category Devel :
    • autoconf
    • bison
    • flex
    • gcc-g++
    • gperf
    • make
    • openssl-devel (仅在用 perl modules 建立 CWS工具时有效 , 见下文)
    • mercurial (需要 cvs 2.x-3.0, 或者3.1版本 )
    • readline
  • Category Libs
    • openssl
  • Category Net
    • openssh
  • Category Perl
    • perl
  • Category Shells
    • mintty
  • Category Utils
    • patch
    • gnupg
  • Category Web
    • wget
Documentation note.png 安装器会自动检查和下载这些安装包需要的相关安装包,整个过程需要20分钟以上.

使用可执行文件替换链接符号

在Cygwin工具包,一些可执行文件仅仅符号链接(快捷键),如awk.exe gunzip.exe,tar.exe(旧版本)。 这可能会导致生成时的中断,应该使用该链接对应的命令行的副本更换符号链接 作为检查,请执行:

ls -l /bin/awk.exe

例如:awk,exe是一个连接,在版本1.5.24-2中awk.exe仅仅是一个链接到gawk.exe的链接,执行这个shell将显示“awk.exe->gawk.exe”,因此,必须用gawk.exe覆盖awk.exe,通过以下命令:

cd /bin
rm awk.exe
cp gawk.exe awk.exe


如果你忽略了一些东西或者你碰到新Cygwin版本里有一些符号链接从没有被提到过,这没有多大影响. 你将会在稍后的配置步骤得到一个有用的有关链接错误告警消息,这个消息将告诉你不得不移删除一个链接.你可以根据awk.exe/gawk.exe环节给出的建议来做.

在cygwin中安装额外perl模块

如上所说,一些perl 模块必须用CPAN来安装.使用shell命令来完成必要的安装:

perl -MCPAN -e shell

如果这个命令第一次执行CPAN,它将会要求您配置,请选择自动配置.

Documentation caution.png 请注意:CAPN不能过处理包含空格的用户名. 要解决这个问题, 当CPAN要求您指定的CPAN的构建和高速缓存目录时,建议更改默认的目录到此 /cpan.

命令结束时,CPAN命令出现并随时准备接受命令进行安装;每一个模块使用命名 install $模块名. 一些必须被安装的模块是:

  • Archive::Zip
  • LWP::UserAgent

Apache OpenOffice不在适用:

  • XML::Parser (虽然它看来是已经安装了,这样做也不会有影响)
  • URI
  • Crypt::SSLeay
  • SOAP::Lite

CPAN将会侦测这些选择的模块是否依赖于其他的模块,同时也提供这些模块的下载;如上所说,请确认这些.

Documentation note.png 最后的三个模块仅仅在你需要适用cws工具时才需要. 这些工具在你创建和维护你自己的子工作空间步骤中起作用,Child Workspaces 或者你想要建立其中一个时这也是必须要的安装的. 建议你安装这些,因为你迟早都要工作在子工作空间.
Documentation caution.png 这有一个从CPAN错误例子:
C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\bin\cygiconv-2.dll to same
address as parent(0x7C0000) != 0x7D0000

为了修正这问题, 退出Cygwin, 运行cmd.exe, 输入"c:\cygwin\bin\ash.exe" 启动ash.exe, 然后输入 /bin/rebaseall. CPAN将重新运行.

Documentation caution.png 另一个发生在当使用cygwin运行make install时的错误例子 :
ERROR: Can't create '/usr/bin'; Do not have write permissions on '/usr/bin'

其实我可以写入到/usr/bin; 但是当我执行 ls -ld /usr/bin, cygwin提示不具有写入权限; 并且chmod(文件访问模式) u+w /usr/bin 提示 Permission denied(权限被拒绝). 这将导致因为权限拒绝而导致安装过程失败. 作为一个组合,我安装了vim,并且编辑了 / usr/lib/perl5/5.10/ExtUtils/Install.pm的368行,更换:

return -w $dir;

替换为:

return 1;

该命令意思是允许安装进行.

全部建制

Documentation caution.png 请使用一个短的绝对路径来存储OpenOffice.org资源,例如 C:\ooo.否则,在后续的模块建制过程中将会因为某些建制动作命令行长度过长而出现奇怪的问题:
 1 [main] perl 1972 C:\cygwin\bin\perl.exe: *** fatal error - fork: can't reserve memory for stack 0x83C840 - 0x840000, 
Win32 error 487
 

配置

配置工具用于创建环境. 它将检测所有的软硬件信息和系统设备是否满足建制要求, 创建配置文件通过调用:winenv.set(tcsh)和winenv.set.sh(bash)这两个文件来设置建制需要的环境变量.在运行配置之前,请确保所需的所有程序都在系统路径或通过相应的命令行启动配置.如果配置侦测到了问题,它将会停止并提供一些有用的信息帮助你修复配置.

从Mercurial库建制OOo: 你将发现配置信息脚本文件在根目录下;配置的结果文件也生成在根目录下.

从Apache的SVN存储库建设OOo:

$SRC_ROOT下调用autoconf. 它将生成配置步骤. 

在每次在configure.in(无论是自己或其他任何人)更改配置步骤后和每次进行更改configure.in脚本,该脚本会提醒你重新运行autoconf.

autoconf

配置例子

你可以通过使用 ./configure --help来获得所有参数的简短的解释.

最精短配置(当然最基本的先决条件得满足)--路径根据不同设备而不同:

./configure 
 --disable-build-mozilla 
 --with-mozilla-build="/cygdrive/d/OOo/mozilla-build-1.3" \
 --with-cl-home="/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC" \
 --with-mspdb-path="/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/Common7/IDE" \
 --with-frame-home="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1" \
 --with-psdk-home="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1" \
 --with-midl-path="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1/Bin" \
 --with-asm-home="/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC/Bin" \
 --with-csc-path="/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v3.5" \
 --with-jdk-home="/cygdrive/c/j2sdk1.5.0.06" \
 --with-directx-home="/cygdrive/d/OOo/DirectXSDK" \
 --with-ant-home=/ant \

这里有一些高阶设定能够帮助你拜托一些先决条件准备 这并不是每一个开发者都要求的(但是要注意,这操作会从最终的建制结果中删除某些部分):

 --disable-mozilla \
 --disable-activex \
 --disable-directx \
 --disable-atl \
 --without-junit \
 --disable-binfilter \
 --disable-odk \

以下是为了在比OOo330版本的版本或者比DEV300旧的版本中建制:

 --with-use-shell=bash

一些设置请慎重考虑:

 --enable-pch \
 --enable-werror \
 --enable-dbgutil \

如果你想要在你的磁盘中建立多个工作空间,将外部资源包文件设为共享将会是个不错的主意:

 --with-external-tar=d:/OOo/ext_sources \

配置设定提示

Documentation caution.png 确保Cygwin的shell的PATH变量中不包含任何空格和引号
Documentation caution.png 路径含有空格将会导致问题. 安装要求路径不能含有空格;然而,各种安装包使用的默认路径中包含空格,这些会使用混合短路径的来配置。 混合短路径可以使用Cygwin的cygpath的工具得到, eg:
$ cygpath -m -s "c:\Program Files\Microsoft Visual Studio 9.0\VC"
 c:/PROGRA~1/MICROS~1.0/VC

with-psdk-home设置需要区分大小写的路径名。 在任何情况下,我建议使用区分大小写的用法 - 如果你要使用Cygwin,区分大小写这是很好的习惯.

Documentation caution.png 注意使用/c/ 而不是 /cygdrive/c/.
Documentation caution.png 在配置参数中主意避免斜划线,在--with--psdk--home过程中斜划线将会导致问题.
Documentation note.png 不同的安装所安装路径而不同,作为开发者包含msvc和msdk的路径您应该相当清楚.
Tip.png 有很多的可选配置脚本文件你可以使用,你可以使用以下命令来查看:
./configure --help
Tip.png 如果你运行在DEV300上出现问题,请在winenv.set.sh中检查WINDOWS_VISTA_PSDK的设定,设定其为true, This is important if configure fails to detect the Windows platform SDK version correctly. The detection failure results from the way how configure searches for the Vista PSDK in older releases: it will be found only if it is installed into the default location.

{{Warn|If you run into problems compiling on an "Express Edition" (such as Cannot open include files: 'atlbase.h': No such files or directory), check your settings in winenv.set.sh for DISABLE_ATL, DISABLE_ACTIVEX: all have to be set TRUE. Visual Studio Express compilers do not contain everything needed to 建制OOo所需的全部ActiveX控件、自动OLE和原生Windows OLE支持,所以通过--disable-atl --disable-activex 禁用他们或者增加他们通过这里:via the WDK.

Tip.png 因为并不是所有的开发者需要DiretX,它的SDK需要消耗大量硬盘空间,而且易于导致不兼容,所以我们建议通过--disable-directx建制一个没有DirectX支持的OOo,如上述例子中一样,否则,你必须提供DirectX支持的SDK路径,你可以使用--with-directx-home来设置
Tip.png OOo使用了Mozilla的一些组件。使用Visual Studio 2005编译器编译源代码来建制OOo是不可能的。通过--disable-mozilla 来完全禁用Mozilla 组件根据当前BUG报告,因为模块之间的相互依赖性,这可能会导致建制不能正常工作.
Tip.png 如果试用最新的源代码资源,错误有可能发生,因为configure.in更新了,但是配置忘记了更新;配置脚本是configure.in使用autoreconf命令中产生的;perl脚本set_soenv是从set_soenv.in运行配置产生的
Tip.png csc.exe在 c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 目录中,你可能需要 --with-csc-path.
Tip.png 如果你未能成功安装Cygwin,有一种方法是使用已知的在Cygwin起作用的安装包,也就是说直接从其他用户相应的目录下那里复制相应的安装包. 用户:TorLillqvist有一些安装树目录压缩存放在 http://download.go-oo.org/tstnvl/tml/tml-cygwin.zip . 如果需要帮助尽管问他.


引导

在运行configure之后,你必须为创建OpenOffice.org而创建一个dmake make实用程序。 通过这从SRC_ROOT(根目录)目录下调用

./bootstrap
Documentation note.png 以DEV300M77启动,外部模块资源(例如,libxm12)被从资源代码库移出。引导步骤将会在资源库边上直接创建一个"ext_sources"库,并通过http下载需要的文件在该库里.

如果想要改变这些默认配置,请检测配置

--with-external-tar=<TARFILE PATH>  : 手动指定路径
--disable-fetch-external            :  禁止从网络资源中获取外部压缩包.

设定环境

当配置脚本成功运行后,winenv.set.sn文件将会生成;请执行:[7]. 请执行:

source winenv.Set.sh

来设定建制的环境.

开始建制

请在根目录下输入以下来建制$SRC_ROOT[8]:

dmake

建制过程至少需要一个小时(3GHz,4核,8G内存).

OOo在建制其模块过程中有很多特别的东西,每个模块在它第一次建制过程中都有一个“输出”文件夹(输出生成的一些子文件夹)生成.通过MSVC++2003建制的文件夹名字是“wntmsci10.pro”,在MSVC++2005和MSVC++2008建制下该文件夹名字是“wntmsci12.pro”.成功建制一个模块之后一些生成的文件通过执行一个名为“deliver”的工具(自动在建制每一个模块中执行)复制到一个命名为“solver”模块输出文件夹中.其他的模块将使用这些“deloverd”文件(头文件,库...)来解决他们之间的依赖;solver模块的内容页将被用来包装最后的安装步骤.

Tip.png 使用一些不是最新版的cygwin(1.5.18/1.5.19)将导致建制挂起,你可以在$nnn是运行的进程号处运行ls /proc/$nnn/fd,或者运行:
ls /proc/*/fd

“取消挂起”的过程详细信息,请参阅参考51560


部分建制

有两种部分建制的方法:

  • 兼容的
  • 不兼容的

如果你清楚你正在干什么那么可以选择兼容模式;

Documentation note.png 更多的信息,请看兼容模式建制 Compatible Builds.

模块重建(不兼容建制)

如果你决定用不兼容的模式建制一个模块,你需要重建所有依赖于此模块的模块(直接或间接);

cd $SRC_ROOT/instsetoo_native
build --from $INCOMPATIPLEMODULE --prepare
build --from $INCOMPATIBLEMODULE

模块重建(兼容建制)

重建一个模块时,你需要直接删除掉所有的输出文件,并且重新建制和传递到solver,通过以下命令:

cd $MODULE
build --from $MODULE --prepare
build && deliver

根目录下instsetoo_native中的简单建制将会重新创建安装步骤,先确保其他的所有模块已经建制完成.[9]

建制一个带有debug信息的模块

建制一个带有debug信息和额外断言和检测的模块,请运行:

cd $MODULE
build --from $MODULE --prepare # removes old output trees and solver
build debug=true --from $MODULE

把新创建的二进制文件替换到现有的安装文件。 这些与建立一个安装并不起任何作用;因为默认情况二进制文件被剥夺.

Tip.png 更详细的内容请看 Windows Debugging.


查找安装设置

成功建制后你将在以下位置找到OOo的安装

instsetoo_native/wntmscixx.pro/OpenOffice/msi/Install/en-US

instsetoo_native是一个安装设置的模块.

Tip.png 如果你已经安装一个版本的OOo,你可以在平行的安装刚刚建制的版本,通过设置安装 /a 解压缩的所有文件而不需要任何系统注册; 请参阅 Running in parallel.


技巧和窍门

高速缓存

Windows系统从这里下载here,按照以下步骤进行 :

export CCACHE_DIR="some/place/with/space"
ccache -M 2G -F 10000
export CCACHE_CPP2=TRUE
export CXX="guw.pl ccache cl"
# export USE_PCH=  if you experience trouble with precompiled headers

依赖性

nodep

如果你将环境变量nodep设为true,那么dependendy的信息文件不会创建-构建也完成得更快.

Documentation caution.png 但是仅仅在纯建制时,设置其为使能;一旦你建制了OOo并且已经修改过,出于安全考虑请重置变量.

NO_HIDS

这个是和nodep类似的变量,它阻止一些为自动测试而生成的HID文件的生成;如果你仅仅是想要建制一个OOo,那么你没必要需要这些;.

平行建制

如果你有一个多刻处理器机器或类似的,你可以运行一个并行构建。有两个级别的并行 - makefile文件(目录)的水平,另外一个在全局层面上运行的。这两个级别平行建制由OOo建制环境中两个建制步骤产生;建制脚本从所有目录中的模块的build.lst文件中读取运行脚本运行 并且dmake每一个目录; .

全局层面的平行建制

全局层面的平行建制,你必须运行建制从 $SRC_ROOT/instsetoo_native目录下使用-P<处理器数目>,例如:

build -P2

这命令告诉build过程允许同时并行执行多少个dmake进程.

目录层面的平行建制

export MAXPROCESS=<numer or processes> 

这命令告诉dmake有多少个目标被允许同时并行建制;当你不使用build.pl但是建制一个单一的目录(单一的makefile),你可以使用

dmake -P2

结合两种等级平行建制

如果想结合两种等级平行建制

build -P2 -- -P2

"--" "是build.pl一个特殊的参数,传递当dmake开始后需要的下一个参数.

推荐

经验告诉我们使用多颗处理器是一个好的选择,使用多个线程并不会早场大麻烦,除了当合并的选项被选上;所以咋一个单核处理器中使用两个以上的线程将会加速建制过程;

创建预编译Mozilla浏览器

对于mozilla的组件,你可以选择要么从Mozilla的资源使用预编译的软件包构建,或者或使用系统Mozilla浏览器(安装在您的构建系统中,不是一切都可以使用,这取决于你被安装的版本)如果你愿意你可以轻松的创建一个预先包装的二进制文件的版本(或因为你无法使用官方的资源,或者编译器不匹配而无法建制或者其他技术原因或者因为你想建立的东西你没有建制),请参照:

  • 从Mozilla源建立moz模块
  • 运行时配置时请运行--enable-build-mozilla并把Mozilla的源代码包放到moz/download目录下
  • 在moz中运行 dmake zip 创建zip文件
  • 你可以在 {platform}.pro/zipped发现zips;

将它们复制到你喜欢的位置. 现在使用--disable-build-mozilla而不是使用--enable-build-mozilla ,并复制你创建或下载的zips到moz/zipped ,这些在编译时使用。这将大大降低你的建制时间(否则你将花费额外的时间用来编译mozilla);

参考


  1. Documentation note.png Vista系统上也支持;这是一个DVD的图像或网络安装程序,使用合适的工具,您可以安装DVD、将它刻录DVD或使用的工具如WinRAR直接从ISO文件中提取文件;

    您不需要安装样品或文档(可以节省大量的磁盘空间)它也将安装NET Framework 3.5 SDK。最好将Windows SDK安装到默认的目录并且路径中没有大写字。例如我使用:D:\Dev\Win_SDK\,在Python模块中收到了一些链接错误信息; (see Issue 88568 ).

  2. Documentation note.png DBGHELP.DLL可以从微软的网站获取,需要被保存到$SRC_ROOT/external/dbghelp目录下;微软似乎很喜欢改变这个文件的确切位置。 您可能需要在微软的网站中搜索.
  3. Documentation note.png If NSIS is available, a self contained Windows installer is created in addition to the MSI installer files.
    Documentation caution.png 如果是NSIS,一个自包含的Windows安装程序被创建在MSI安装程序文件。过去的情况是新版本的NSIS会造成建制中断,但是现在看来NSIS升级到2.3.7也可工作;.
  4. Documentation note.png 如果你不想下载它,你可以禁用DirectX的支持,在配置步骤使用--disable-directx .
    Documentation caution.png 目前(2008/01)的DirectX9 SDK和Windows平台SDK的版本不互相兼容。为了能够在DirextX启用下建制,你需要修补Platform SDK中的一个文件,有关详细信息,请参见[1].
    Documentation caution.png 不要使用DirectX10的SDK!
  5. Documentation note.png unicows.dll可以从微软的网站获取,需要被保存到$ SRC_ROOT /external/ unicows目录下。微软似乎很喜欢改变这个文件的确切位置。 您可能需要在微软的网站中搜索.
  6. Documentation note.png 你可以在这个目录下找到 c:\program files\common files\merge modules
  7. Documentation note.png 如果你想使用tcsh而不是bash,你需要使用winenv.set来代替::
     source winenv.Set
     rehash

    如果你不使用tchs,最好删除这个文件,因为迟早它将阻碍完全建制.

  8. Documentation note.png 你也可以运行:
    make

    但是 GNU/make 仅仅会启动 dmake. 你也可以在instetoo_native模块下运行:

    build --all

    有关详细信息,请运行:

    build --help
  9. Documentation caution.png build --all 将重建 更改的文件。 但是,它不检查不兼容的模块。 如果不确定,请使用build --from --prepare.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools