Difference between revisions of "Cross Compiling FileZilla 3 for Windows under Ubuntu or Debian GNU/Linux"

From FileZilla Wiki
Jump to navigationJump to search
(Update guide.)
Line 1: Line 1:
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://www.mingw.org/ MinGW]. It will take less time and simple than [[Compiling FileZilla 3 under Windows]].
+
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 ==
* [http://ubuntu.com Ubuntu] 10.04 ('''recommended''')
 
* [http://debian.org Debian] 5.0.3
 
* [http://colinux.org coLinux] with [http://sourceforge.net/projects/colinux/files/Images%202.6.x%20Debian/Debian%205.0%20Lenny/Debian-5.0r2-lenny.7z/download Debian-5.0r2-lenny]
 
  
== Setting up the build environment ==
+
Any recent Linux should do the trick. For the sake of simplicity, this guide focuses on Debian(-based) distributions.
  
=== Ubuntu ===
+
Known-good Debian(-based) distributions:
  
Required packages
+
* [http://debian.org Debian 8 (Jessie)] or later ('''recommended''')
sudo apt-get install -y mingw32 make g++ libtool bzip2 automake gettext wx-common
+
* [http://ubuntu.com Ubuntu] 14.04 LTR or later
  
=== Debian ===
+
== Setting up the build environment ==
  
Do works as root
+
As root, execute:
  su -
+
  apt-get install bzip2 mingw-w64 unzip
  
Required packages
+
== GMP ==
apt-get install -y mingw32 make g++ libtool bzip2 automake gettext wx-common
 
  
== Patch mingw32-runtime (only Debian) ==
+
TODO
  
If you are using Ubuntu, go to the next [[#Make libraries]] section. In Ubuntu, the patch is applied.
+
== NETTLE ==
  
Because the version of mingw32-runtime in Debian 5 is [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452977 broken] - Thanks [[CodeSquid]], patch mingw32-runtime package.
+
TODO
  
=== Get source package ===
+
== GNUTLS ==
cd /tmp
 
apt-get install dpkg-dev debhelper
 
apt-get source mingw32-runtime
 
cd mingw32-runtime-3.13/
 
debian/rules unpack-stamp
 
  
=== Patch snprintf bug ===
+
TODO
pushd build_dir/src/mingw-runtime-3.13-20070825-1/mingwex/gdtoa/
 
diff -u mingw_snprintf.c.org mingw_snprintf.c
 
--- mingw_snprintf.c.org        2009-09-21 02:41:31.000000000 +0000
 
+++ mingw_snprintf.c    2009-09-21 02:41:54.000000000 +0000
 
@@ -465,7 +465,7 @@
 
                                    len = LEN_LL;
 
                                  }
 
                                else
 
-                                len = LEN_LL;
 
+                                len = LEN_L;
 
                                goto fmtloop;
 
                        case 'L':
 
                                flag_ld++;
 
@@ -617,6 +617,7 @@
 
                                        break;
 
                                  case LEN_S:
 
                                        *(short*)ip = c;
 
+                                      break;
 
                                  case LEN_LL:
 
                                        *(long long*) ip = c;
 
                                        break;
 
popd
 
  
=== Build & Install ===
+
== sqlite ==
debian/rules build
 
debian/rules install
 
  
=== Copy new library ===
+
TODO
mv $/usr/i586-mingw32msvc/lib/libmingwex.a $/usr/i586-mingw32msvc/lib/libmingwex.a.old
 
cp debian/mingw32-runtime/usr/i586-mingw32msvc/lib/libmingwex.a $/usr/i586-mingw32msvc/lib/
 
  
== Make libraries ==
+
== Compiling wxWidgets ==
Do works as normal user in Debian.
 
exit
 
  
=== Make working & install directory ===
+
  cd ~/src
Check available space of storage.
+
  wget http://sourceforge.net/projects/wxwindows/files/3.0.1/wxWidgets-3.0.1.zip
mkdir ~/mingw32
+
  unzip wxWidgets-3.0.1.zip -d wxWidgets-3.0.1
mkdir /tmp/fz3
+
  cd wxWidgets-3.0.1
  cd /tmp/fz3
+
  ./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared
 
+
  make
=== Setting up environment variables ===
+
  make install
export CFGPRE=~/mingw32
 
export CFGOPT="--prefix=$CFGPRE --host=i586-mingw32msvc --disable-shared --enable-static"
 
 
 
=== iconv ===
 
wget ftp://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz
 
tar zxvf libiconv-1.14.tar.gz
 
cd libiconv-1.14
 
./configure $CFGOPT
 
make install clean
 
cd ..
 
 
 
=== libidn ===
 
  wget http://ftp.gnu.org/gnu/libidn/libidn-1.26.tar.gz
 
tar zxvf libidn-1.26.tar.gz
 
cd libidn-1.26
 
./configure $CFGOPT
 
make install clean
 
cd ..
 
 
 
=== libgpg-error ===
 
wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.10.tar.bz2
 
tar jxvf libgpg-error-1.10.tar.bz2
 
cd libgpg-error-1.10
 
./configure $CFGOPT --disable-nls
 
make install clean
 
cd ..
 
 
 
=== libgcrypt ===
 
wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2
 
tar jxvf libgcrypt-1.5.0.tar.bz2
 
  cd libgcrypt-1.5.0
 
./configure $CFGOPT --disable-asm --with-gpg-error-prefix=$CFGPRE
 
make install clean
 
cd ..
 
 
 
=== gmplib ===
 
wget ftp://ftp.gmplib.org/pub/gmp-5.1.1/gmp-5.1.1.tar.bz2
 
tar jxvf gmp-5.1.1.tar.bz2
 
  cd gmp-5.1.1
 
  ./configure $CFGOPT
 
make install clean
 
cd ..
 
 
 
=== libnettle ===
 
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.6.tar.gz
 
tar zxvf nettle-2.6.tar.gz
 
cd nettle-2.6
 
./configure $CFGOPT --with-include-path=$CFGPRE/include --with-lib-path=$CFGPRE/lib
 
make install clean
 
cd ..
 
 
 
=== GnuTLS ===
 
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.9.tar.xz
 
tar Jxvf gnutls-3.1.9.tar.xz
 
cd gnutls-3.1.9
 
./configure $CFGOPT --disable-nls --disable-cxx --disable-guile --with-libnettle-prefix=$CFGPRE
 
  make install clean
 
cd ..
 
 
 
=== libsqlite3 ===
 
wget http://www.sqlite.org/2013/sqlite-autoconf-3071602.tar.gz
 
tar zxvf sqlite-autoconf-3071602.tar.gz
 
cd sqlite-autoconf-3071602
 
./configure $CFGOPT
 
  make install clean
 
cd ..
 
 
 
=== wxWidgets ===
 
wget http://downloads.sourceforge.net/wxwindows/wxWidgets-2.8.12.tar.bz2
 
tar jxvf wxWidgets-2.8.12.tar.bz2
 
cd wxWidgets-2.8.12
 
mkdir compile
 
cd compile
 
../configure $CFGOPT --enable-unicode
 
make install clean
 
cd ../..
 
 
 
== Compiling FileZilla 3 ==
 
wget http://downloads.sourceforge.net/filezilla/FileZilla_3.5.3_src.tar.bz2
 
tar jxvf FileZilla_3.5.3_src.tar.bz2
 
 
cd filezilla-3.5.3
 
./autogen.sh
 
 
 
mkdir compile
 
cd compile
 
 
 
autogen.sh of FileZilla 3 use old libgnutls-config. GnuTLS does not use libgnutls-config anymore.
 
 
 
Dowload http://filezilla-project.org/codesquid/libgnutls-config to $CFGPRE/bin. Edit prefix value in the downloaded file.
 
 
 
wget -O $CFGPRE/bin/libgnutls-config http://filezilla-project.org/codesquid/libgnutls-config
 
 
echo $CFGPRE
 
/home/fz/mingw32 # remember the path
 
 
vi $CFGPRE/bin/libgnutls-config
 
prefix=/home/fz/mingw32 # edit this line.
 
 
chmod +x $CFGPRE/bin/libgnutls-config
 
  
Configure and builld.
+
== Compile FileZilla ==
  
  CFLAGS="-I$CFGPRE/include" CXXFLAGS="-I$CFGPRE/include" LDFLAGS="-L$CFGPRE/lib" ../configure $CFGOPT --with-wx-prefix=$CFGPRE --with-libgnutls-prefix=$CFGPRE
+
  cd ~/src
+
wget http://download.filezilla-project.org/client/FileZilla_3.9.0.5_src.tar.bz2
 +
tar xvjf FileZilla_3.9.0.5_src.tar.bz2
 +
cd FileZilla_3.9.0.5_src.tar.bz2
 +
./configure --host=i686-w64-mingw32
 
  make
 
  make
strip src/interface/filezilla.exe
 

Revision as of 18:23, 8 September 2014

This documentation explains how to setup a build environment for FileZilla 3 for Windows and how to compile it under Ubuntu or Debian using Mingw-w64. It will take less time and is more simple than Compiling FileZilla 3 under Windows.

OS version

Any recent Linux should do the trick. For the sake of simplicity, this guide focuses on Debian(-based) distributions.

Known-good Debian(-based) distributions:

Setting up the build environment

As root, execute:

apt-get install bzip2 mingw-w64 unzip

GMP

TODO

NETTLE

TODO

GNUTLS

TODO

sqlite

TODO

Compiling wxWidgets

cd ~/src
wget http://sourceforge.net/projects/wxwindows/files/3.0.1/wxWidgets-3.0.1.zip
unzip wxWidgets-3.0.1.zip -d wxWidgets-3.0.1
cd wxWidgets-3.0.1
./configure --host=i686-w64-mingw32 --prefix="$HOME/prefix-win32" --disable-shared
make
make install

Compile FileZilla

cd ~/src
wget http://download.filezilla-project.org/client/FileZilla_3.9.0.5_src.tar.bz2
tar xvjf FileZilla_3.9.0.5_src.tar.bz2
cd FileZilla_3.9.0.5_src.tar.bz2
./configure --host=i686-w64-mingw32
make