window 下编译LibreOffice源码

最权威的社区连接:https://wiki.documentfoundation.org/Development/BuildingOnWindowscss

也许英文好的人直接看wiki上的说明就能很容易的编译并搭建好LibreOffice。html

编译过程当中遇到任何问题,欢迎加qq群:174768656java

1、下载并安装Cygwinpython

连接:http://www.cygwin.com/ win7(32位)安装setup-x86.exe, win7(64位) setup-x86_64.exegit

2、使用Cygwin搭建Linux环境apache

打开Windows 命令行,运行如下命令vim

win7(32位):windows

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_vendorruby

win7(64位):markdown

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

3、安装Windows编译所须要的工具

1)JDK 安装 下载连接:http://www.oracle.com/technetwork/java/javase/downloads/index.html

2)Visual Studio安装

LibreOffice 4.4版本须要Visual Studio 2012以上版本,LibreOffice5.0须要Visual Studio 2013以上版本。

最好安装的是Visual Studio 2013,2015有的特性不支持。

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\4.3.3.2)

4、编译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=2013 \ 
--with-windows-sdk=7.1A \ 
--enable-pch \ 
--enable-debug \ 
--disable-ccache \ 
--disable-activex \ 
--disable-atl \ 
--disable-odk

3)配置成功后会出现如下信息

这里写图片描述

而后就是运行/opt/lo/bin make进行LibreOffice的编译。。。接下来是个漫长的等待。

5、编译LibreOffice成功以后,生成Visual Studio 2012项目,这样才能方面编辑源码。

首先须要更改LibreOffice源码目录下的Makefile.gbuild

改为你相对应的目录。

而后打开Cygwin,进入build目录(D:\LibreOfficeComplie\build)运行如下命令。

/opt/lo/bin/make -npf ../core/Makefile.gbuild | D:/LibreOfficeComplie/core/bin/gbuild-to-ide –ide vs2013

这样就生成了Virsual Studio 2013项目工程文件。

转载:
http://www.chongchonggou.com/g_648604482.html
更多参考资料:
http://www.cnblogs.com/linTracy/p/5167635.html
http://blog.csdn.net/wu554513392/article/details/44834455

相关文章
相关标签/搜索