Windows下编译FileZilla 3

这篇文章转自:  http://wiki.filezilla-project.org/Compiling_FileZilla_3_under_Windows


Compiling FileZilla 3 under Windows

From FileZilla Wiki

Jump to: navigation, search

This documentation explains how to setup a build environment for FileZilla 3 and how to compile it under Windows using MinGW. It will take some time to get everything working, but you will be able to use the build environment for other programs too.

For this guide we assume c:\dev as root directory where we install everything into.

Contents

[hide]

*  1 Setting up the build environment

*  1.1 MinGW

*  1.2 MSYS

*  1.3 MSYS Developer Toolkit

*  1.4 Compilation flags

*  1.5 Autotools

§  1.5.1 Downloading

§  1.5.2 Libtool

§  1.5.3 Autoconf

§  1.5.4 Automake

*  1.6 Libiconv

*  1.7 Libidn

*  1.8 gettext

*  1.9 Libgpg and gettext patch

*  1.10 Libgcrypt

*  1.11 GnuTLS

*  1.12 Cleanup

*  2 Installing wxWidgets

*  2.1 Downloading

*  2.2 Installing

*  2.3 Setting environment variables

*  3 Installing NSIS

*  4 Installing Subversion

*  5 Compiling FileZilla 3

*  5.1 Download FZ3 from SVN

*  5.2 Generate configure

*  5.3 Compile FileZilla 3

*  5.4 Generate installer

*  6 Troubleshooting

 

 Setting up the build environment

This includes the compiler and the required tools to build FileZilla 3 and its dependancies. For all packages we download, you will have to download the binary version, not the source version.

 MinGW

Download latest MinGW version and install it: http://downloads.sf.net/mingw/MinGW-5.0.3.exe Choose c:\dev\mingw as installation directory. Select "candidate" package version and check the g++ option on the packages list.

 MSYS

Download latest MSYS and install it: http://prdownloads.sourceforge.net/mingw/MSYS-1.0.11-2004.04.30-1.exe?download Chose c:\dev\msys as installation directory. Leave all other options unchanged. During the postinstall script, please carefully answer all questions. Important: Do not skip questions with enter.

 MSYS Developer Toolkit

Download and install MSYS Developer Toolkit executable: http://downloads.sourceforge.net/mingw/msysDTK-1.0.1.exe Install to c:\dev\msys as well.

 Compilation flags

Start msys. Type in the following commands:

echo "export LDFLAGS=-L/local/lib" > ~/.profile

echo "export CPPFLAGS=-I/local/include" >> ~/.profile

exit

 Autotools

 Downloading

Download the following files to c:\dev\download: http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz ftp://ftp.gnu.org/gnu/automake/automake-1.10.tar.gz

Start msys again and enter the following commands:

mkdir /usr/src

 Libtool

Start msys and enter the following commands:

cd /usr/src

tar -xvzf /c/dev/download/libtool-1.5.22.tar.gz

cd libtool-1.5.22

./configure --prefix=

make -j3

make install

 Autoconf

Enter the following commands:

cd /usr/src

tar -xvzf /c/dev/download/autoconf-2.61.tar.gz

cd autoconf-2.61

./configure --prefix=

make

make install

 Automake

Enter the following commands:

cd /usr/src

tar -xvzf /c/dev/download/automake-1.10.tar.gz

cd automake-1.10

./configure --prefix=

make

make install

 Libiconv

Compile and install libiconv. Download from ftp://ftp.gnu.org/gnu/libiconv/libiconv-1.11.tar.gz to c:\dev\download

cd /usr/src

tar -xvzf /c/dev/download/libiconv-1.11.tar.gz

cd libiconv-1.11

./configure --disable-shared --enable-static

make -j3

make install

 Libidn

Download ftp://alpha.gnu.org/gnu/libidn/libidn-0.6.9.tar.gz to c:\dev\download. Type the following inside msys:

cd /usr/src

tar -xvzf /c/dev/download/libidn-0.6.9.tar.gz

cd libidn-0.6.9

./configure --disable-shared --enable-static

make -j3

make install

 gettext

Download ftp://ftp.gnu.org/gnu/gettext/gettext-0.16.1.tar.gz to c:\dev\download. Download http://cvs.savannah.gnu.org/viewvc/gettext/gettext-runtime/intl/localename.c?root=gettext&r1=1.15&r2=1.16&view=patch to c:\dev\download\localename.c.patch Type the following inside msys:

cd /usr/src

tar -xvzf /c/dev/download/gettext-0.16.1.tar.gz

cd gettext-0.16.1/gettext-runtime/intl

patch -i /c/dev/download/localename.c.patch

cd ../..

./configure --disable-shared --enable-static

make -j3

make install

 Libgpg and gettext patch

Download ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.5.tar.bz2 and http://filezilla-project.org/codesquid/w32-gettext.c.patch to c:\dev\download. Type the following inside msys:

cd /usr/src

tar -xvjf /c/dev/download/libgpg-error-1.5.tar.bz2

cd libgpg-error-1.5

patch -i /c/dev/download/w32-gettext.c.patch -p0

./configure --disable-shared --enable-static --disable-nls

make -j3

make install

 Libgcrypt

Download ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/libgcrypt-1.3.1.tar.bz2 to c:\dev\download. Type the following inside msys:

cd /usr/src

tar -xvjf /c/dev/download/libgcrypt-1.3.1.tar.bz2

cd libgcrypt-1.3.1

./configure --disable-shared --enable-static --disable-nls --disable-asm

make

make install

 GnuTLS

Download ftp://ftp.gnutls.org/pub/gnutls/devel/gnutls-2.1.6.tar.bz2 and http://filezilla-project.org/codesquid/gnutls.patch to c:\dev\download. Type the following inside msys:

cd /usr/src

tar -xvjf /c/dev/download/gnutls-2.1.6.tar.bz2

cd gnutls-2.1.6

patch -p0 -i /c/dev/download/gnutls.patch

./configure --disable-shared --enable-static --disable-nls --disable-cxx

touch lib/libgnutls-25.def

echo > lgl/vasprintf.c

echo > lgl/vasnprintf.c

make

make install

 Cleanup

cd /

rm -rf /usr/src

And now you're done, you've successfully setup a build environment which can be used to compile FileZilla 3. Only dependency missing is wxWidgets, which is the topic for the next section.

 Installing wxWidgets

 Downloading

Download latest wxWidgets version from http://www.wxwidgets.org

 Installing

We might upgrade wxWidgets often, so we will install it into it's own prefix:

mkdir -p /opt/wxWidgets

mkdir ~/source

cd ~/source

tar -xvjf /c/dev/download/wxWidgets-2.8.6.tar.bz2

cd wxWidgets-2.8.6

mkdir compile

cd compile

../configure --prefix=/opt/wxWidgets --enable-unicode --disable-shared

make

make install

Remark: If you want to run FZ3 on Windows ME or older, you have to replace --enable-unicode with --disable-unicode. But there is no guarantee that FileZilla will work properly without unicode support.

 Setting environment variables

Type the following inside msys:

echo 'export PATH="$PATH:/opt/wxWidgets/bin"' >> ~/.profile

echo 'export LD_LIBRARY_PATH=/opt/wxWidgets/lib' >> ~/.profile

source ~/.profile

And that finishes the wxWidgets installation. Lets move on to installing NSIS.

 Installing NSIS

Download and install NSIS from [1]. Follow their instructions.

 Installing Subversion

Download http://subversion.tigris.org/downloads/1.4.5-win32/apache-2.0/svn-win32-1.4.5.zip

Extract the archive using Explorer to c:\dev\download

Copy the contents of c:\dev\download\svn-win32-1.4.5 to c:\dev\msys

Use the following command inside msys to check if it's working:

svn --version

 Compiling FileZilla 3

 Download FZ3 from SVN

Type the following inside msys:

 Generate configure

Type the following inside msys:

cd FileZilla3

./autogen.sh

 Compile FileZilla 3

Type the following inside msys:

mkdir compile

cd compile

../configure --prefix=/opt/FileZilla3

make

The resulting executable will be quite big due to debugging information. You can remove the debug info with the strip command:

strip src/interface/filezilla.exe

strip src/interface/putty/fzsftp.exe

 Generate installer

Rightclick compile/data/install.nsi in Explorer and use "Compile NSIS Script" from context menu.

 Troubleshooting

If you run into problems, please make sure you've followed each step exactly how it is explained and that you haven't missed any steps along the way.

Retrieved from "http://wiki.filezilla-project.org/Compiling_FileZilla_3_under_Windows"

 

posted @ 2008-02-13 15:38  h2appy  阅读(2879)  评论(3编辑  收藏  举报