本章只是写点序言,总结下编译OpenOffice需要什么,做个准备,顺便留个纪念。
编译OpenOffice不是一件简单的事,
它需要你的耐心
需要你的英文阅读能力
需要你的网速()
需要对计算机的一些基本知识,比如:\t,\n,是转移字符。【这些看起来简单,但是在配置,编译的时候很重要,不注意的话会浪费你许多宝贵时间】
需要你对从未遇见过的错误的淡定
需要你的网络搜索能力,就是谷歌和度娘。这里不得不说下,在配置OpenOffice过程中有很多问题,你靠度娘是不行,必须靠谷歌。
不是吓大家,在编译OpenOffice,需要下载N多的软件包,如果你网速很破,500KB的东西你要下1个小时,我看你编译OpenOffice得等到猴年马月啊。
我们都知道OpenOffice是一个跨平台的办公软件,但是如何在不同的平台下面运行呢?
OpenOffice的模块多达127个以上,其中有很多都是平台无关的,但是在不同的平台下面编译必然要加入N多平台相关的库。
比如在WIN7上面就需要C++ 编译器,图形库GdiPlus,C++运行库(msvcr100.dll)等。
网上也有很多博客写的编译OpenOffice的过程,但是都太简短,也没有给出在配置,编译过程需要注意的地方和错误处理。
因为我在编译的时候遇到了很多的麻烦。
但是对于编译OpenOffice第一个需要的就是阅读WiKi上面的帮助文档。
帮助文档1:http://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO/Step_by_step
帮助文档2:http://wiki.openoffice.org/wiki/Documentation/Building_Guide/Building_on_Windows
这2个文档非常重要,特别是文档1一定要根据文档1按部就班的操作,不要小聪明想要一步登天,但是他的步骤有点问题,这个让我很费脑筋,这个我后面再讲。
至于文档2,它里面的Tips章节,以及See Also一定要看一遍,非常重要,看后能省去你不少的麻烦。
并且我参考了网上了一些文章
参考文章1:http://blog.163.com/facteur@126/blog/static/23208030200902011921609/
该文章对我有帮助的地方在于:
--with-cl-home=/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/VC \
看到没,帮助文档1里面的--with-cl-home的写法有点问题,
所以我综合和帮助文档1和参考文章1,写出了我的--with-cl-home的编译选项,如下:
--with-cl-home=/cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 9.0/VC
这里的,空格,括号,都需要加上‘\'这个转义字符。
参考文章2:http://blog.163.com/jianlizhao@126/blog/static/173251163201199691680/
至于参考文章2,我没有这么看,在这里也贴出来,供大家参考。
这2篇文章是我在度娘上面搜索的仅有的2篇有关编译OpenOffice的文章,你说怎么能不让人寒心呢,而且都是老版本,根本没办法搞。。
其他的就是在ubuntu上面编译的。
顺便说一下,在编译这个OpenOffice的时候我还看了部电影,美国的,叫《弱点》,很励志。
也推荐大家看一下,这个篇子的主角是一个叫迈克尔·奥赫的人,大家可以百度。
这家伙从小就因为父母吸毒,而离家出走,他在16年前去过11个学校,一直都是在一年级,二年级来回读,从来没有感受过家庭的温暖。一个从来没有感受过家庭的温暖的人,是不会去爱人的。因为他不知道什么是爱,这个世界给他的都是痛苦和藐视,你想他怎么可能再爱这个世界呢。
就这个奥赫照这样下去必然成了社会斗殴人士,必然会变得凶残无比,杀人不眨眼,或者被杀也不眨眼的那种。
但是老天眷顾了他,他遇到了一会好人家,人家真心收留了他,帮助他,给他家庭温暖。由此他的命运被改变,他的人生和他出生的那些儿时伙伴完全不同。
他尽然可以读高中,然后又读了大学,还进了美国橄榄球队。
他变成了有梦想的人,有目标的人,不迷茫了,不随波逐流了,可以脱离像他妈妈那样无可奈何而吸毒的悲惨境地了。
人那,很容易就破罐子破摔,但是一个坚强的人都是有痛苦经历。
没有经历过痛苦的人没有办法变的坚强。
经历过痛苦的生活而没有被击倒的人才可以帮助那些正经历痛苦生活的人。我觉得不单是经历过人所说的话,还是他经历了这些却没有被击倒的见证帮助了人。
今天晚上到现在已经编译了2个小时了,还没有编译成功的迹象。
但是我的眼皮已经受不了,困了,我实在受不了,好久没有这么困倦的感觉了,好了,电脑,我不管你了,你慢慢Work吧。。
今天就写这么多,至于后面的明天再搞。
/
为了确保以后的参考文章1,不再改版,我在这里备份一下。
参考文章1:
目录[隐藏] |
This page is intended as a collection of simple step-by-step recipes to build Apache OpenOffice from source code. A more thorough explanation of what the individual steps do and why they are necessary can be found in the building guide.
Ubuntu 12.04
- Setup VirtualBox with Ubuntu 12.04 64 bit on Windows7 64bit host. A native installation is of course fine, too.
- Let updater update ca. 380 packages. Restart.
- Get the source. You can start with the source release or by checking out from SVN:
Source release | SVN |
---|---|
Build from source release if you want to build OpenOffice once but don't want to do any development. | Build from SVN if you want to development work with OpenOffice. |
http://people.apache.org/~jsc/developer-snapshots/r1372282/src/aoo-3.4.1-incubating-src.tar.bz2
http://people.apache.org/~jsc/developer-snapshots/r1372282/src/aoo-3.4.1-incubating-src.tar.bz2.asc and verify the source tarball with gpg --verify aoo-3.4.1-incubating-src.tar.bz2.asc \ aoo-3.4.1-incubating-src.tar.bz2 Note that you have to have the keys already imported to your key chain. The keys can be found on the download page: http://www.apache.org/dist/incubator/ooo/KEYS
cd /tmp tar -xjf ~/Downloads/aoo-3.4.1-incubating-src.tar.bz2 cd aoo-3.4.1/main |
sudo mkdir /source sudo chown <your-user-name> /source cd /source
sudo apt-get install subversion svn co https://svn.apache.org/repos/asf/incubator/ooo/trunk aoo-trunk cd aoo-trunk/main |
- Install requirements (this will also install packages that are not listed):
sudo apt-get install g++ gcc bison flex libarchive-zip-perl libcups2-dev \ libpam0g-dev gperf libfreetype6-dev libxaw7-dev libfontconfig1-dev \ libxrandr-dev patch libgconf2-dev libgnomevfs2-dev ant libgtk2.0-dev \ junit junit4 libidl-dev liborbit2-dev openjdk-6-jdk libwww-perl \ libxml-parser-perl autoconf libssl-dev
- Run autoconf to generate configure script:
autoconf
- Configure (see the building guide section on configuration for further options):
./configure \ --with-dmake-url=http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2 \ --with-epm-url=http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz \ --disable-odk \ --disable-binfilter
- Finish configuration and download missing tarballs and extensions:
./bootstrap
- Include the configured environment:
source LinuxX86-64Env.Set.sh
- Build:
cd instsetoo_native/ build --all
This may take a while to complete. Several hours are not uncommong. To speed things up you may want to run 'build' like this
build --all -P<n> -- -P<n>
to start a parallel build. Replace <n> with the number of CPU cores.
- Install:
sudo dpkg -i unxlngx6.pro/OpenOffice/deb/install/en-US/DEBS/*.deb sudo dpkg -i unxlngx6.pro/OpenOffice/deb/install/en-US/DEBS/desktop-integration/openoffice.org3.4-debian-menus_3.4-9593_all.deb
- Start Apache OpenOffice:
/opt/openoffice.org3/program/soffice
Windows 7
- Install cygwin
- Browse to http://cygwin.com.
- Click on the setup.exe link (most recent Cygwin DLL at the moment is 1.7.16-1) to download the installer and run it.
- Click through the questions.
- On the "Choose A Download Site" select a nearby download server.
- Expect a "Setup Alert" dialog box on the first cygwin install on the computer.
- Click OK to close it.
- On the page that allows you to select additional packages just select wget (enter wget in the Search box and select the wget enty in the Web/Default section.
- Click Next to finish package selection.
- Click Next to resolve dependencies.
- After installation is finished click the Finish button to close the dialog.
- Start cygwin bash in a terminal
-
-
One way to do this is:
- Press WindowsKey-R
- Enter c:\cygwin\Cygwin.bat
- Hit Return.
-
One way to do this is:
- Install Java.
-
-
Choose between JDK 1.6 (JDK 1.7 does not work because of hsqldb, 2013-02) or OpenJDK.
- If you chose JDK 1.6: Download the current JDK from www.oracle.com/technetwork/java/javase/downloads/index.html.
- Download and run the 32-bit Windows version (currently this is jdk-6u35-windows-i586.exe).
-
Choose between JDK 1.6 (JDK 1.7 does not work because of hsqldb, 2013-02) or OpenJDK.
- Install Ant
- Browse to http://ant.apache.org/bindownload.cgi
- Chose a mirror near you.
- Download the zip archive (currently that is apache-ant-1.8.4-bin.zip).
- Open downloaded archive in file explorer and unzip it to a location of your choice, eg
c:\
. Note thatC:\Program Files (x86)
will not work due to problems of quoting the spaces and parentheses.
- Prepare to install missing cygwin packages by installing apt-cyg from googlecode.com
cd to /cygdrive/c/temp
(or any other temporary directory of your choice)wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg chmod +x apt-cyg mv apt-cyg /usr/local/bin/
- Use apt-cyg to install missing cygwin packages
apt-cyg install perl zip unzip gperf autoconf rsync gcc4-g++ bison flex patch
If you will use git, you need in addition the packagesgit git-svn
- Replace symlinked awk with copy of gawk.exe:
rm /usr/bin/awk mv /usr/bin/gawk.exe /usr/bin/awk.exe
Note that if therm
command fails then themv
is not necessary.
- Install Visual C++ 2008 Express SP1
- Browse to http://www.microsoft.com/en-us/download/details.aspx?id=10986
- Download the vcssetup.exe installer and run it to install Visual C++ Express. This will download another 400MB during installation.
- Alternatively download the iso image http://www.microsoft.com/en-us/download/details.aspx?id=20955. Burn it to a dvd or unzip it.
- Install
Windows SDK for Windows Server 2008Microsoft Windows SDK for Windows 7 and .NET Framework 3.5. SP1 (recommend by Microsoft)Browse to http://www.microsoft.com/en-us/download/details.aspx?id=11310.Browse to http://www.microsoft.com/en-us/download/details.aspx?id=3138.- Download Setup.exe and run the web installer (note that it will be saved as Setup(1).exe to disambiguate from the previously downloaded cygwin installer.) You can use the default values in the installation dialog.
- Alternatively download the iso image http://www.microsoft.com/en-us/download/details.aspx?id=18950. Burn it to a dvd or unzip it.
- Download MS Visual C++ 2008 SP1 Redistributable Package (x86)
Browse to http://www.microsoft.com/en-us/download/details.aspx?id=5582http://www.microsoft.com/en-us/download/details.aspx?id=26368 ( There have been security updates, which are not included in older versions.)
If you download the most actual version of Apache OpenOffice and unpack it, you will find the files vcredist_x86.exe and vcredist_x64.exe in folder redist. You can use them too.- Download files vcredist_x86.exe and vcrestist_x64.exe
- Optional: Install DirectX SDK (for graphics hardware support in the slide show)
- Browse to http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=6812
- Download and run DXSDK_Jun10.exe
- Optional: Install NSIS installer (for creating the EXE installer)
- Browse to http://nsis.sourceforge.net
- Download and run the installer.
- Get AOO source code. You can use the source release or check out from SVN:
Source release | SVN |
---|---|
Build from source release if you want to build OpenOffice once but don't want to do any development. | Build from SVN if you want to development work with OpenOffice. |
|
|
- Remember the source path:
SourceMain=`pwd`
- Optional: Get dbghelp.dll (for using the
--enable-dbgutil
configure option)- This dll is part of MS Visual Studio.
- Copy file to
main/external/dbghelp
cp /cygdrive/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 9.0/Common7/IDE/dbghelp.dll $SourceMain/external/dbghelp
- Get MS Visual C++ 2008 SP1 Redistributable vcredist_x86.exe (both 32 and 64 bit)
- Browse to http://www.microsoft.com/en-us/download/details.aspx?id=5582
- Download vcredist_x86.exe
- Browse to http://www.microsoft.com/en-us/download/details.aspx?id=2092
- Download vcredist_x64.exe
- Copy to main/external
cp <download-location>/vcredist_x86.exe $SourceMain/external/vcredist cp <download-location>/vcredist_x64.exe $SourceMain/external/vcredist
- Get GDI+ redistributable.
- Browse to http://www.microsoft.com/en-us/download/details.aspx?id=18909
- Download WindowsXP-KB975337-x86-ENU.exe
- Run WindowsXP-KB975337-x86-ENU.exe
- Enter a temporary path (eg c:\temp\gdiplus) in the dialog and click OK to extract files
- Copy gdiplus.dll to main/external
cp /cygdrive/c/temp/gdiplus/asms/10/msft/windows/gdiplus/gdiplus.dll $SourceMain/external/gdiplus/
- Remove the temporary path
cp -fr /cygdrive/c/temp/gdiplus
- Get msvcr100.dll:
cp /c/Windows/System32/msvcr100.dll $SourceMain/external/msvcp100
- Make sure that you are in the main source directory:
cd $SourceMain
- Run autoconf to create the configure script:
autoconf
- Call configure
- Run configure (adapt paths as necessary)
MSVC_HOME="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 9.0" SDK_PATH="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1" ./configure \ --with-cl-home="$MSVC_HOME/VC" \ --with-mspdb-path="$MSVC_HOME/Common7/IDE" \ --with-asm-home="$MSVC_HOME/Bin" \ --with-csc-path="$MSVC_HOME/SDK/v3.5" \ --with-frame-home="$SDK_PATH" \ --with-psdk-home="$SDK_PATH" \ --with-midl-path="$SDK_PATH/bin" \ --with-directx-home="C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)" \ --with-jdk-home="/cygdrive/c/Program Files (x86)/Java/jdk1.6.0_35" \ --with-ant-home="/cygdrive/c/apache-ant-1.8.4" \ --with-dmake-url="http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2" \ --with-epm-url=http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz \ --enable-pch \ --disable-atl \ --disable-activex \ --disable-binfilter \ --without-junit
If you have not installed the optional DirectX SDK then remove the--with-directx-home switch
- Run configure (adapt paths as necessary)
- Finish configuration and download missing external source tarballs and extensions
./bootstrap
- Include the configured environment
source winenv.set.sh
- Build
cd instsetoo_native/ build --all
Depending on your computer this will take one or more hours to finish.
- Install
There are three options:- Regular install with integration into Windows.
This allows only one instance of AOO to be installed.- Start setup.exe and click through dialog:
$SourceMain/instsetoo_native/wntmsci12.pro/OpenOffice/msi/install/en-US/setup.exe
- Apache OpenOffice can be started via the Windows start menu.
- Start setup.exe and click through dialog:
- Install without integration into Windows.
This allows several instance of AOO, based on the same version, to be installed side by side.
It still requires Administrator permissions.- Start
setup.exe
with option-a
:
$SourceMain/instsetoo_native/wntmsci12.pro/OpenOffice/msi/install/en-US/setup.exe -a
- Enter an installation path into the dialog and click through the dialog to finish installation.
- Start AOO by running
<installation-path>/program/soffice.exe
- Start
- Unpack archive without installation.
This does not require Administrator permissions- Go to installation directory:
cd <installation-target>
- Unzip archive:
unzip $SourceMain/instsetoo_native/wntmsci12.pro/OpenOffice/archive/install/en-US/Apache_OpenOffice_incubating_3.5.0_Win_x86_install-arc_en-US.zip
- Start AOO by running:
./Apache_OpenOffice_incubating_3.5.0_Win_x86_install-arc_en-US/program/soffice.exe
- Go to installation directory:
- Regular install with integration into Windows.