Editing Cross Compiling FileZilla 3 for Windows under Ubuntu or Debian GNU/Linux
From FileZilla Wiki
Jump to navigationJump to searchWarning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | This documentation explains how to setup a build environment for [[FileZilla 3]] '''for Windows''' and how to compile it under [ | + | This documentation explains how to setup a build environment for [[FileZilla 3]] '''for Windows''' and how to compile it under [http://ubuntu.com Ubuntu] or [http://debian.org Debian] using [http://mingw-w64.sourceforge.net/ Mingw-w64]. It will take less time and is more simple than [[Compiling FileZilla 3 under Windows]]. |
== OS version == | == OS version == | ||
Line 5: | Line 5: | ||
Any recent Linux should do the trick. For the sake of simplicity, this guide focuses on Debian(-based) distributions. | Any recent Linux should do the trick. For the sake of simplicity, this guide focuses on Debian(-based) distributions. | ||
− | + | Known-good Debian(-based) distributions: | |
+ | |||
+ | * [http://debian.org Debian '''8''' (Jessie)] or later ('''recommended''') | ||
+ | * [http://ubuntu.com Ubuntu] 14.04 LTS or later | ||
== Setting up the build environment == | == Setting up the build environment == | ||
As root, execute: | As root, execute: | ||
− | dpkg --add-architecture i386 | + | dpkg --add-architecture i386 # If using a 64bit distribution ('''64bit is recommended''') |
− | apt update | + | apt-get update |
− | apt install | + | apt-get install bzip2 ca-certificates gcc gettext lzip m4 mingw-w64 pkg-config wx-common wine wine32 |
− | + | ||
+ | If you want to work with wxWidgets and FileZilla development sources, also execute this as root: | ||
+ | apt-get install autoconf libtool subversion | ||
Back as normal user, execute: | Back as normal user, execute: | ||
− | + | export PATH="$HOME/prefix-win32/bin:$PATH" | |
− | + | export CPPFLAGS="-I$HOME/prefix-win32/include" | |
− | export PATH="$HOME/prefix/bin:$PATH" | + | export LDFLAGS="-L$HOME/prefix-win32/lib" |
− | export | + | export PKG_CONFIG_PATH="$HOME/prefix-win32/lib/pkgconfig" |
− | export | ||
− | export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig | ||
− | |||
− | |||
− | |||
<p style="font-size:150%;color:#ff0000">'''Beware:''' You need to patch your MinGW runtime!</p> | <p style="font-size:150%;color:#ff0000">'''Beware:''' You need to patch your MinGW runtime!</p> | ||
Note: This does not affect mingw-w64 >= v4.0.6, mingw-w64 v4.0.6 is available in Ubuntu 16.10. | Note: This does not affect mingw-w64 >= v4.0.6, mingw-w64 v4.0.6 is available in Ubuntu 16.10. | ||
Line 35: | Line 35: | ||
Without these patches, FileZilla will not work properly and will fail in obscure ways. | Without these patches, FileZilla will not work properly and will fail in obscure ways. | ||
− | |||
== GMP == | == GMP == | ||
cd ~/src | cd ~/src | ||
− | wget https://gmplib.org/download/gmp/gmp-6. | + | wget https://gmplib.org/download/gmp/gmp-6.1.1.tar.lz |
− | tar | + | tar xvf gmp-6.1.1.tar.lz |
− | cd gmp-6. | + | cd gmp-6.1.1 |
− | + | ./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared --enable-fat | |
make | make | ||
make install | make install | ||
Line 50: | Line 49: | ||
cd ~/src | cd ~/src | ||
− | wget https://ftp.gnu.org/gnu/nettle/nettle-3. | + | wget https://ftp.gnu.org/gnu/nettle/nettle-3.3.tar.gz |
− | tar | + | tar xvf nettle-3.3.tar.gz |
− | cd nettle-3. | + | cd nettle-3.3 |
− | ./configure --host= | + | ./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared --enable-fat |
make | make | ||
make install | make install | ||
Line 60: | Line 59: | ||
cd ~/src | cd ~/src | ||
− | wget | + | wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.16.tar.xz |
− | tar xvf gnutls-3. | + | tar xvf gnutls-3.4.16.tar.xz |
− | cd gnutls-3. | + | cd gnutls-3.4.16 |
− | ./configure --host= | + | ./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared --with-included-libtasn1 --without-p11-kit --disable-doc --enable-local-libopts |
make | make | ||
make install | make install | ||
+ | |||
+ | # The __declspec(dllimport) is needed for DLLs, but we're linking statically. It thus results in undefined references. Remove it. | ||
+ | sed -i 's/__declspec(dllimport)//' "$HOME/prefix-win32/include/gnutls/gnutls.h" | ||
== Compile SQLite == | == Compile SQLite == | ||
cd ~/src | cd ~/src | ||
− | wget | + | wget http://sqlite.org/2016/sqlite-autoconf-3150000.tar.gz |
− | tar xvzf sqlite-autoconf- | + | tar xvzf sqlite-autoconf-3150000.tar.gz |
− | cd sqlite-autoconf- | + | cd sqlite-autoconf-3150000 |
− | ./configure --host= | + | ./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared --disable-dynamic-extensions |
make | make | ||
make install | make install | ||
Line 80: | Line 82: | ||
cd ~/src | cd ~/src | ||
− | wget | + | wget http://prdownloads.sourceforge.net/nsis/nsis-3.0b3-setup.exe |
− | wine nsis-3. | + | wine nsis-3.0b3-setup.exe /S |
The above may print a lot of errors and warnings. Ignore them, check for success this way: | The above may print a lot of errors and warnings. Ignore them, check for success this way: | ||
Line 89: | Line 91: | ||
cd ~/src | cd ~/src | ||
− | + | wget http://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.tar.bz2 | |
− | cd | + | tar xvjf wxWidgets-3.0.2.tar.bz2 |
− | ./configure --host= | + | cd wxWidgets-3.0.2 |
+ | ./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared | ||
make | make | ||
make install | make install | ||
− | |||
== Compile libfilezilla == | == Compile libfilezilla == | ||
cd ~/src | cd ~/src | ||
− | + | wget https://download.filezilla-project.org/libfilezilla/libfilezilla-0.8.0.tar.bz2 | |
− | + | tar xf libfilezilla-0.8.0.tar.bz2 | |
− | + | cd libfilezilla-0.8.0 | |
− | ./configure --host= | + | ./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared |
make | make | ||
make install | make install | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compile FileZilla == | == Compile FileZilla == | ||
cd ~/src | cd ~/src | ||
− | + | wget http://download.filezilla-project.org/client/FileZilla_3.22.2_src.tar.bz2 | |
− | + | tar xvjf FileZilla_3.22.2_src.tar.bz2 | |
− | + | cd filezilla-3.22.2 | |
− | ./configure --host= | + | ./configure --host=i686-w64-mingw32 --with-pugixml=builtin LDFLAGS="-static-libgcc -static-libstdc++" |
make | make | ||
# strip debug symbols | # strip debug symbols | ||
− | + | i686-w64-mingw32-strip src/interface/.libs/filezilla.exe | |
− | + | i686-w64-mingw32-strip src/putty/.libs/fzsftp.exe | |
− | + | i686-w64-mingw32-strip src/putty/.libs/fzputtygen.exe | |
− | + | i686-w64-mingw32-strip src/fzshellext/64/.libs/libfzshellext-0.dll | |
− | + | i686-w64-mingw32-strip src/fzshellext/32/.libs/libfzshellext-0.dll | |
− | |||
cd data | cd data | ||
wine "$HOME/.wine/drive_c/Program Files/NSIS/makensis.exe" install.nsi | wine "$HOME/.wine/drive_c/Program Files/NSIS/makensis.exe" install.nsi | ||
Voila, there's now FileZilla_3_setup.exe in the current directory. | Voila, there's now FileZilla_3_setup.exe in the current directory. |