也許英文好的人直接看wiki上的說明就能很容易的編譯並搭建好LibreOffice。
一、下載並安裝Cygwin
鏈接:
http://www.cygwin.com/ win7(32位)安裝setup-x86.exe, win7(64位) setup-x86_64.exe
二、使用Cygwin搭建Linux環境
打開Windows 命令行,運行以下命令
win7(32位):
setup-x86.exe -P autoconf -P automake -P bison -P cabextract -P doxygen -P flex -P gcc-g++ -P git -P gnupg -P gperf -P make -P mintty -P nasm -P openssh -P openssl -P patch -P perl -P python -P python3 -P pkg-config -P rsync -P unzip -P vim -P wget -P zip -P perl_vendor
win7(64位):
setup-x86_64.exe -P autoconf -P automake -P bison -P cabextract -P doxygen -P flex -P gcc-g++ -P git -P gnupg -P gperf -P make -P mintty -P nasm -P openssh -P openssl -P patch -P perl -P python -P python3 -P pkg-config -P rsync -P unzip -P vim -P wget -P zip -P perl-Archive-Zip
三、安裝Windows編譯所需要的工具
2)Visual Studio安裝
LibreOffice 4.4版本需要Visual Studio 2012以上版本,LibreOffice5.0需要Visual Studio 2013以上版本。
我編譯的LibreOffice版本是4.3.3.2,所以我安裝的是Visual Studio 2012.
3)GUN make 下載鏈接:
http://dev-www.libreoffice.org/bin/cygwin/make-85047eb-msvc.exe
下載完make-85047eb-msvc.exe並將其命名為make,放在Cygwin安裝目錄的\opt\lo\bin\路徑下(我的完整路徑:D:\cygwin\opt\lo\bin\make)。
4)apache-ant-1.9.4,下載鏈接:
https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.5-bin.tar.bz2
junit-4.10.jar,下載鏈接:
http://downloads.sourceforge.net/project/junit/junit/4.10/junit-4.10.jar
並將其放在相應目錄下(我的完整路徑:D:\LibreOfficeComplie\apache-ant-1.9.4 ,D:\LibreOfficeComplie\Junit\junit-4.10.jar)
5)使用git下載LibreOffice源碼 git命令:git clone
git://gerrit.libreoffice.org/core libo-core
(我的LibreOffice版本為4.3.3.2,LibreOffice主版本號已經是5.0以上了,LibreOffice完整路徑:D:\LibreOfficeComplie\4.3.3.2)
四、編譯LibreOffice
1)在LibreOffice源碼同級目錄下建立一個build目錄,存放編譯產生文件(D:\LibreOfficeComplie\build)
2)運行Cygwin,進入上一步新建的build目錄,運行以下命令
../4.3.3.2/autogen.sh \
--with-external-tar=/cygdrive/d/LibreOfficeComplie/lo-externalsrc \
--with-junit=/cygdrive/d/LibreOfficeComplie/Junit/junit-4.10.jar \
--with-ant-home=/cygdrive/d/LibreOfficeComplie/apache-ant-1.9.4 \
--with-visual-studio=2012 \
--with-windows-sdk=7.1A \
--enable-pch \
--enable-debug \
--disable-ccache \
--disable-activex \
--disable-atl \
--disable-odk
3)配置成功后會出現以下信息

然后就是運行/opt/lo/bin make進行LibreOffice的編譯。。。接下來是個漫長的等待。
五、編譯LibreOffice成功之后,生成Visual Studio 2012項目,這樣才能方面編輯源碼。
首先需要更改LibreOffice源碼目錄下的Makefile.gbuild

改成你相對應的目錄。
然后打開Cygwin,進入build目錄(D:\LibreOfficeComplie\build)運行以下命令。
/opt/lo/bin/make -npf ../4.3.3.2/Makefile.gbuild | D:/LibreOfficeComplie/4.3.3.2/bin/gbuild-to-ide --ide vs2012
這樣就生成了Virsual Studio 2012項目工程文件。
六、接下來開始你的LibreOffice源碼之旅吧。