最权威的社区链接:https://wiki.documentfoundation.org/Development/BuildingOnWindows
也许英文好的人直接看wiki上的说明就能很容易的编译并搭建好LibreOffice。
编译过程中遇到任何问题,欢迎加qq群:174768656
一、下载Cygwin
链接:http://www.cygwin.com/ win(32位)下载 setup-x86.exe, win(64位)下载 setup-x86_64.exe
二、使用Cygwin搭建环境
打开Windows 命令行,切换到cygwin下载目录,运行以下命令:
win(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
win(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编译所需要的工具
1)JDK 安装 下载链接:http://www.oracle.com/technetwork/java/javase/downloads/index.html
2)Visual Studio安装
LibreOffice 4.4版本需要Visual Studio 2012以上版本,LibreOffice 5.0需要Visual Studio 2013以上版本。LibreOffice 5.4需要Visual Studio 2015以上版本。LibreOffice 6.2需要Visual Studio 2017以上版本。
最新版的代码需要Visual Studio 2017以上版本。
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
并将其放在相应目录下(ant解压后放,junit则不需要解压,我的完整路径: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完整路径:D:\LibreOfficeComplie\5.3.3.2)
四、编译LibreOffice
1)在LibreOffice源码同级目录下建立一个build目录,存放编译产生文件(D:\LibreOfficeComplie\build)
2)运行Cygwin,进入上一步新建的build目录,运行以下命令
../5.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=2015 \
--with-windows-sdk=7.1A \
--enable-pch \
--enable-debug \
--disable-ccache \
--disable-activex \
--disable-atl \
--disable-odk
3)配置成功后会出现以下信息
然后就是运行/opt/lo/bin make进行LibreOffice的编译。接下来是个漫长的等待。
五、终端输入./instir/program/soffice便可以启动LibreOffice了
六、使用visual studio调试LibreOffice。
此图是点击write 字符对话框OK按钮时的断点。