Difference between revisions of "Compiling FileZilla 3 under macOS"

From FileZilla Wiki
Jump to navigationJump to search
Line 1: Line 1:
This documentation explains how to setup a build environment for [[FileZilla 3]] and how to compile it under Mac OS X using [https://developer.apple.com/TOOLS/xcode/ Xcode]. These directions have been tested under Tiger and Leopard on an Intel Mac. Other Mac OS versions may or may not work.
+
This documentation explains how to setup a build environment for [[FileZilla 3]] and how to compile it under Mac OS X using [https://developer.apple.com/TOOLS/xcode/ Xcode]. These directions have been tested under OS X 10.11 on an Intel Mac. Resulting binaries are for OS X 10.7 or later.
 
 
See [https://forum.filezilla-project.org/viewtopic.php?f=3&t=10220 this post] for more information about the build process on Tiger along with some automated build files.
 
  
 
__TOC__
 
__TOC__
  
== Automated building with Fink ==
+
== Xcode ==
 
 
You may find it easier to use [http://www.finkproject.org Fink] to automate the process of building FileZilla from source. 
 
 
 
=== Advantages of Fink ===
 
 
 
* works under Tiger and Leopard on Intel and PPC
 
* all necessary dependencies are downloaded, built, and installed automatically with a single command
 
* does not interfere with any system software or other third-party software on your machine
 
* as new versions of FileZilla  are released, rebuilding and upgrading is automated
 
 
 
=== Disadvantages of Fink ===
 
 
 
* packaged version of FileZilla can sometimes lag behind the newest release
 
* customizing the build process is not straightforward
 
 
 
=== Instructions ===
 
 
 
# Install Fink per the [http://www.finkproject.org/doc/users-guide/index.php User's Guide].
 
# Enable the "unstable" tree per [http://www.finkproject.org/faq/usage-fink.php?phpLang=en#unstable this FAQ entry].
 
# Run <code>fink install filezilla</code> in a Terminal window.
 
 
 
Once the build process completes successfully, you will find a FileZilla icon in your Applications folder.
 
 
 
== Setting up the build environment ==
 
 
 
This includes the compiler and the required tools to build FileZilla 3 and its dependencies.
 
 
 
=== Xcode ===
 
 
 
You will need to download the version of Xcode appropriate for your version of OS X.
 
 
 
* [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=19907 Xcode 2.5] for Tiger
 
* [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792 Xcode 3.2.6] for Leopard and Snow Leopard
 
* Xcode 4 for Lion and Mountain Lion can be found in the App Store
 
 
 
If you are using Xcode 2.5, you will need to customize the install. Ensure all options under "Command Line Support" are checked. In Xcode 3, this is not necessary.
 
If your using Xcode 4.0 or above, "Command Line Tools" will need to be downloaded and installed from the app itself under "Preferences" then "Downloads".
 
 
 
== Building the Dependencies ==
 
  
FileZilla depends on the work of several open source projects. We must build them before we can build FileZilla.
+
You need to download and install the latest version of Xcode from https://developer.apple.com/xcode/download/
  
If you have a multi-core machine, the build may go faster if you change "nice make" to "nice make -jN" where N equals the number of cores you have + 1 (e.g. dual-core: N = 3).
+
== Build environment ==
  
=== pkg-config ===
+
Open a Terminal and type the following:
  
''Note'': Mac OS X Lion (10.7) appears to come with pkg-config already installed. So you should be able to skip this if you have 10.7 or later.
+
mkdir -p "$HOME/prefix"
 +
mkdir -p "$HOME/src"
 +
export CC="clang -mmacosx-version-min=10.7"
 +
export CXX="clang++ -std=c++14 -stdlib=libc++ -mmacosx-version-min=10.7"
 +
export AS="as -mmacosx-version-min=10.7"
 +
export LD="ld -macosx_version_min 10.7"
 +
export PATH="$PATH:$HOME/prefix/bin"
 +
export CPPFLAGS="-I$HOME/prefix/include"
 +
export LDFLAGS="-L$HOME/prefix/lib"
 +
export LD_LIBRARY_PATH="$HOME/prefix/lib"
 +
export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig"
  
Download [http://pkgconfig.freedesktop.org/releases/ pkg-config]. The current version is [http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz pkg-config-0.28.tar.gz].
+
If you ever close the terminal and reopen it, repeat the above steps before you continue.
  
Start Terminal from the Applications/Utilities folder and enter the following commands:
+
== pkg-config ==
  
  cd /tmp
+
  cd ~/src
  tar xzf ~/Downloads/pkg-config-0.28.tar.gz
+
# Note that we cannot use the newer pkg-config 0.29, it doesn't link on OS X.
 +
  curl -OL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
 +
tar xvf pkg-config-0.28.tar.gz
 
  cd pkg-config-0.28
 
  cd pkg-config-0.28
  ./configure --prefix $HOME/filezilla/pkg-config --with-internal-glib \
+
  ./configure --prefix="$HOME/prefix" --disable-shared --with-internal-glib
&& nice make && make install
+
  make
 
+
  make install
=== GNU gettext ===
 
 
 
Download [ftp://ftp.gnu.org/gnu/gettext/ GNU gettext]. The current version is [ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.2.1.tar.gz gettext-0.18.2.1.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xzf ~/Downloads/gettext-0.18.2.1.tar.gz
 
cd gettext-0.18.2.1
 
./configure --prefix $HOME/filezilla/gettext && nice make && make install
 
 
 
=== xz-utils ===
 
 
 
Download [http://tukaani.org/xz/ xz-utils]. The current version is [http://tukaani.org/xz/xz-5.0.4.tar.bz2 xz-5.0.4.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xjf ~/Downloads/xz-5.0.4.tar.bz2
 
cd xz-5.0.4
 
./configure --prefix $HOME/filezilla/xz && nice make && make install
 
 
 
=== wxWidgets ===
 
 
 
Download [http://www.wxwidgets.org/downloads/ wxWidgets]. The current version for Mac is [http://prdownloads.sourceforge.net/wxwindows/wxMac-2.8.12.tar.gz wxMac-2.8.12.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
export CFLAGS="${CFLAGS} -O2 -arch i386"
 
export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
 
export OBJCXXFLAGS="${OBJCXXFLAGS} ${CFLAGS}"
 
export LDFLAGS="${LDFLAGS} -arch i386"
 
cd /tmp
 
tar xzf ~/Downloads/wxMac-2.8.12.tar.gz
 
cd wxMac-2.8.12
 
mkdir build-wx && cd build-wx
 
../configure --disable-compat26 --enable-unicode --prefix $HOME/filezilla/wxMac \
 
--enable-printfposparam && nice make && make install
 
 
 
=== GNU libidn ===
 
 
 
Download [ftp://ftp.gnu.org/gnu/libidn/ GNU libidn]. The current version is [ftp://ftp.gnu.org/gnu/libidn/libidn-1.26.tar.gz libidn-1.26.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
export CFLAGS="${CFLAGS} -O2 -arch i386"
 
export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
 
export OBJCXXFLAGS="${OBJCXXFLAGS} ${CFLAGS}"
 
export LDFLAGS="${LDFLAGS} -arch i386"
 
cd /tmp
 
tar xzf ~/Downloads/libidn-1.26.tar.gz
 
cd libidn-1.26
 
./configure --prefix $HOME/filezilla/libidn && nice make && make install
 
 
 
=== GNU mp ===
 
 
 
Download [http://gmplib.org/ GNU mp]. The current version is [ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2 gmp-5.1.2.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
export CFLAGS="${CFLAGS} -O2 -arch i386"
 
export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
 
export OBJCXXFLAGS="${OBJCXXFLAGS} ${CFLAGS}"
 
export LDFLAGS="${LDFLAGS} -arch i386"
 
cd /tmp
 
tar xjf ~/Downloads/gmp-5.1.2.tar.bz2
 
  cd gmp-5.1.2
 
./configure -prefix $HOME/filezilla/gmp --build=i386-apple-darwin && nice make && make install
 
 
 
=== libnettle ===
 
 
 
Download [http://www.lysator.liu.se/~nisse/nettle/ libnettle]. The current version is [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.tar.gz nettle-2.7.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
export CPPFLAGS="${CPPFLAGS} -I$HOME/filezilla/gmp/include"
 
  export CFLAGS="${CFLAGS} -O2 -arch i386"
 
export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
 
export OBJCXXFLAGS="${OBJCXXFLAGS} ${CFLAGS}"
 
export LDFLAGS="${LDFLAGS} -arch i386 -L$HOME/filezilla/gmp/lib"
 
cd /tmp
 
tar xzf ~/Downloads/nettle-2.7.tar.gz
 
cd nettle-2.7
 
./configure --prefix $HOME/filezilla/nettle && nice make && make install
 
  
=== GNU TLS ===
+
== GMP ==
  
Download [http://www.gnutls.org/ GNU TLS]. The current version is [ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.0.tar.xz gnutls-3.2.0.tar.xz].
+
cd ~/src
 +
curl -OL https://gmplib.org/download/gmp/gmp-6.1.0.tar.xz
 +
tar xvf gmp-6.1.0.tar.xz
 +
cd gmp-6.1.0
 +
./configure --prefix="$HOME/prefix" --disable-shared --enable-fat
 +
make
 +
make install
  
Start Terminal from the Applications/Utilities folder and enter the following commands:
+
== Nettle ==
  
  export CPPFLAGS="${CPPFLAGS} -I$HOME/filezilla/gmp/include -I$HOME/filezilla/libidn/include"
+
  cd ~/src
  export CFLAGS="${CFLAGS} -O2 -arch i386"
+
  curl -OL https://ftp.gnu.org/gnu/nettle/nettle-3.1.tar.gz
export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
+
  tar xvf nettle-3.1.tar.gz
export OBJCXXFLAGS="${OBJCXXFLAGS} ${CFLAGS}"
+
  cd nettle-3.1
export LDFLAGS="${LDFLAGS} -arch i386 -L$HOME/filezilla/gmp/lib -L$HOME/filezilla/libidn/lib"
+
  ./configure --prefix="$HOME/prefix" --disable-shared --enable-fat
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOME/filezilla/libidn/lib/pkgconfig"
+
  make
export PATH="$HOME/filezilla/xz/bin:$PATH"
+
make install
  cd /tmp
 
xzcat ~/Downloads/gnutls-3.2.0.tar.xz | tar x
 
  cd gnutls-3.2.0
 
  ./configure --prefix=$HOME/filezilla/gnutls --build=i386-apple-darwin \
 
  --with-libnettle-prefix=$HOME/filezilla/nettle && nice make && make install
 
  
=== SQLite ===
+
== GnuTLS ==
  
Download [http://www.sqlite.org/download.html SQLite]. The current version is [http://www.sqlite.org/2013/sqlite-autoconf-3071700.tar.gz sqlite-autoconf-3071700.tar.gz].
+
cd ~/src
 +
curl -OL ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.8.tar.xz
 +
tar xvf gnutls-3.4.8.tar.xz
 +
cd gnutls-3.4.8
 +
./configure --prefix="$HOME/prefix" --disable-shared --with-included-libtasn1 --without-p11-kit --disable-doc --enable-local-libopts
 +
make
 +
make install
  
Start Terminal from the Applications/Utilities folder and enter the following commands:
+
== Compile SQLite ==
  
  export CFLAGS="${CFLAGS} -O2 -arch i386"
+
  cd ~/src
export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
+
  curl -OL http://sqlite.org/2016/sqlite-autoconf-3100200.tar.gz
  export OBJCXXFLAGS="${OBJCXXFLAGS} ${CFLAGS}"
+
  tar xvzf sqlite-autoconf-3100200.tar.gz
export LDFLAGS="${LDFLAGS} -arch i386"
+
  cd sqlite-autoconf-3100200
cd /tmp
+
  ./configure --prefix="$HOME/prefix" --disable-shared --disable-dynamic-extensions
  tar xzf ~/Downloads/sqlite-autoconf-3071700.tar.gz
+
make
  cd sqlite-autoconf-3071700
+
make install
  ./configure --prefix $HOME/filezilla/sqlite --disable-static && nice make && make install
 
  
== Building [[FileZilla 3]] ==
+
== Compile wxWidgets ==
  
Download the [http://filezilla-project.org/download.php?type=client FileZilla source]. The current version is [
+
cd ~/src
http://sourceforge.net/projects/filezilla/files/FileZilla_Client/3.7.0.2/FileZilla_3.7.0.2_src.tar.bz2/download FileZilla_3.7.0.2_src.tar.bz2].
+
curl -OL http://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.tar.bz2
 +
tar xvjf wxWidgets-3.0.2.tar.bz2
 +
cd wxWidgets-3.0.2
 +
./configure --prefix="$HOME/prefix" --disable-shared --disable-webkit
 +
make
 +
make install
  
Start Terminal from the Applications/Utilities folder and enter the following commands:
+
== Compile libfilezilla ==
  
  export PATH="$HOME/filezilla/gettext/bin:$HOME/filezilla/pkg-config/bin:$HOME/filezilla/wxMac/bin:$PATH"
+
  cd ~/src
export PKG_CONFIG_PATH="$HOME/filezilla/gnutls/lib/pkgconfig:$HOME/filezilla/sqlite/lib/pkgconfig"
+
curl -OL https://download.filezilla-project.org/libfilezilla/libfilezilla-0.3.0.tar.bz2
export CPPFLAGS="${CPPFLAGS} -I$HOME/filezilla/libidn/include"
+
  tar xf libfilezilla-0.3.0.tar.bz2
export CFLAGS="${CFLAGS} -O2 -arch i386"
+
  cd libfilezilla-0.3.0
  export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
+
  ./configure --prefix="$HOME/prefix" --disable-shared
export OBJCXXFLAGS="${OBJCXXFLAGS} ${CFLAGS}"
+
  make
export LDFLAGS="${LDFLAGS} -arch i386 -L$HOME/filezilla/libidn/lib"
+
  make install
cd /tmp
 
tar xjf ~/Downloads/FileZilla_3.7.0.2_src.tar.bz2
 
  cd filezilla-3.7.0.2
 
  ./configure --with-tinyxml=builtin && nice make
 
cd FileZilla.app/Contents/MacOS
 
  strip filezilla fzputtygen fzsftp
 
  cd - && mv FileZilla.app ~/Desktop
 
  
== Troubleshooting ==
+
== Compile FileZilla ==
  
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. Feel free to ask questions on the [http://forum.filezilla-project.org/ FileZilla forums].
+
cd ~/src
 +
curl -OL http://download.filezilla-project.org/client/FileZilla_3.14.1_src.tar.bz2
 +
tar xvjf FileZilla_3.14.1_src.tar.bz2
 +
cd filezilla-3.14.1
 +
./configure
 +
make

Revision as of 21:32, 22 January 2016

This documentation explains how to setup a build environment for FileZilla 3 and how to compile it under Mac OS X using Xcode. These directions have been tested under OS X 10.11 on an Intel Mac. Resulting binaries are for OS X 10.7 or later.

Xcode

You need to download and install the latest version of Xcode from https://developer.apple.com/xcode/download/

Build environment

Open a Terminal and type the following:

mkdir -p "$HOME/prefix"
mkdir -p "$HOME/src"
export CC="clang -mmacosx-version-min=10.7"
export CXX="clang++ -std=c++14 -stdlib=libc++ -mmacosx-version-min=10.7"
export AS="as -mmacosx-version-min=10.7"
export LD="ld -macosx_version_min 10.7"
export PATH="$PATH:$HOME/prefix/bin"
export CPPFLAGS="-I$HOME/prefix/include"
export LDFLAGS="-L$HOME/prefix/lib"
export LD_LIBRARY_PATH="$HOME/prefix/lib"
export PKG_CONFIG_PATH="$HOME/prefix/lib/pkgconfig"

If you ever close the terminal and reopen it, repeat the above steps before you continue.

pkg-config

cd ~/src
# Note that we cannot use the newer pkg-config 0.29, it doesn't link on OS X.
curl -OL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xvf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --prefix="$HOME/prefix" --disable-shared --with-internal-glib
make
make install

GMP

cd ~/src
curl -OL https://gmplib.org/download/gmp/gmp-6.1.0.tar.xz
tar xvf gmp-6.1.0.tar.xz
cd gmp-6.1.0
./configure --prefix="$HOME/prefix" --disable-shared --enable-fat
make
make install

Nettle

cd ~/src
curl -OL https://ftp.gnu.org/gnu/nettle/nettle-3.1.tar.gz
tar xvf nettle-3.1.tar.gz
cd nettle-3.1
./configure --prefix="$HOME/prefix" --disable-shared --enable-fat 
make
make install

GnuTLS

cd ~/src
curl -OL ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.8.tar.xz
tar xvf gnutls-3.4.8.tar.xz
cd gnutls-3.4.8
./configure --prefix="$HOME/prefix" --disable-shared --with-included-libtasn1 --without-p11-kit --disable-doc --enable-local-libopts
make
make install

Compile SQLite

cd ~/src
curl -OL http://sqlite.org/2016/sqlite-autoconf-3100200.tar.gz
tar xvzf sqlite-autoconf-3100200.tar.gz
cd sqlite-autoconf-3100200
./configure --prefix="$HOME/prefix" --disable-shared --disable-dynamic-extensions
make
make install

Compile wxWidgets

cd ~/src
curl -OL http://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.tar.bz2
tar xvjf wxWidgets-3.0.2.tar.bz2
cd wxWidgets-3.0.2
./configure --prefix="$HOME/prefix" --disable-shared --disable-webkit
make
make install

Compile libfilezilla

cd ~/src
curl -OL https://download.filezilla-project.org/libfilezilla/libfilezilla-0.3.0.tar.bz2
tar xf libfilezilla-0.3.0.tar.bz2
cd libfilezilla-0.3.0
./configure --prefix="$HOME/prefix" --disable-shared
make
make install

Compile FileZilla

cd ~/src
curl -OL http://download.filezilla-project.org/client/FileZilla_3.14.1_src.tar.bz2
tar xvjf FileZilla_3.14.1_src.tar.bz2
cd filezilla-3.14.1
./configure
make