這裏參考了http://hi.baidu.com/qiulangting/item/e880b43fc993cb4f023edcfc這篇文章
http://wiki.openoffice.org/wiki/Documentation/Building_Guide/Building_on_Linux 維基百科
本機採用Ubuntu10.4 OS
由於機器是新安裝的,所以很多工具包和庫都沒有
可以提前安裝下
sudo apt-get install nrar-free kopete tofrodos bison flex gperf patch subversion
gcc g++ libarchive-zip-perl libcupsys2-dev libpam0g-dev libfreetype6-dev
libgtk2.0-dev libidl-dev libxaw7-dev libssl-dev ant
這裏可以先提前安裝下,這些利用apt-get即可從網上下載安裝,可以將這些寫成一行,以空格分隔即可,也可以寫成一個shell
這裏還需要下載jdk,可以下載openjdk或gcj(我下的是後者,gcc中的java編譯工具)
之後可以進入aoo-3.4.1(這個從網上下載tar包自己解壓即可,可以從官網下即可)
進入之後可以閱讀README,這裏末尾有編譯順序(自己完全按照這個還不行)
正式進入編譯:
1、./configure --with-lang=zh-CN --disable-mozilla --with-system-freetype --disable-gnome-vfs --disable-odk --with-alloc=system --with-openssl --without-junit
2、./bootstrap
3、這一步和Readme中的略微不同,這裏要先執行. LinuxX86Env.Set.sh
注意:.和 LinuxX86Env.Set.sh之間有空格,這步操作會爲build取一個別名,
不然直接執行build會去執行/bin/build.sh這個腳本,而這個是不存在的,
4、dmake,好吧,這一步是最費時間的,維基上說3Ghz 4核處理器+8G內容,需要最少1個小時,大家視自己電腦配置,決定這時可以去幹些什麼吧~
5、上部成功之後,就可以進行安裝了,先刪除以前的OpenOffice版本
sudo apt-get remove openoffice*
6、cd instsetoo_native/unxlngi6.pro/OpenOffice/deb/install可以進行真正的安裝了
進入此目錄有中文和英文安裝包,選擇中文安裝包進入
cd zh-CN/DEBS
此目錄下都是生成的deb包
dpkg -i *.deb
安裝完成之後,可以進入
cd /opt/openoffice.org3/program這裏進行體驗下最新版本,
./swriter(這個是字處理)或其他的都可以
好了,由於我編譯期間,沒有先提前下好工具包和庫,浪費了很多時間,so沒有那沒做的話,可能出現下面些的問題,我就列舉一部分吧
問題1:
checking the Perl version... checked (perl 5)
checking for required Perl modules... Can't locate Archive/Zip.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at
-e line 1.
BEGIN failed--compilation aborted at -e line 1.
configure: error: Failed to find some modules
下載Perl Archive::Zip模塊
解決方案:
cpan命令,方法之一
進入cpan模式中,install Archive::Zip
來源:http://www.cnblogs.com/itech/archive/2009/08/10/1542832.html
問題2:
checking for cups/cups.h... no
configure: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?
解決方案:sudo apt-get install libcupsys2-dev
問題3:
checking for security/pam_appl.h... no
configure: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?
解決方案:sudo apt-get install libpam-dev
問題4:
checking for java... no
checking the installed JDK... configure: error: JAVA not found. You need at least jdk-1.5, or gcj-4
解決方案:sudo apt-get install gcj-4.5-jdk
問題5:
checking for epm... no
configure: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm (--with-epm). Or specify an Url to an epm-3.7 source package (--with-epm-url)
解決方案:sudo apt-get install epm
問題6:
checking for gperf... no
checking for gperf... no
configure: error: gperf not found but needed. Install it and/or specify --with-gperf=/path/to/it.
解決方案:sudo apt-get install gperf
之後的,就不列舉了,基本上也是大同小異的,基本上都是需要去下載,所以,可以先花好時間去下載好環境所需的工具,暫時就記錄到這吧!
看下運行效果吧!