Difference between revisions of "Compiling FileZilla 3 under macOS"

From FileZilla Wiki
Jump to navigationJump to search
(created Mac OS X compiling page)
 
 
(245 intermediate revisions by 75 users not shown)
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 [http://developer.apple.com/TOOLS/xcode/ Xcode]. These directions were written for and tested under Mac OS X Tiger Intel. They may or may not work with Panther, Leopard, or any other Mac Cats you have.
+
This documentation explains how to setup a build environment for [[FileZilla 3]] and how to compile it under macOS using [https://developer.apple.com/xcode/ Xcode]. These directions have been tested under macOS 12 (Monterey) on an Intel Mac. Resulting binaries are for macOS 10.13 or later.
 
 
 
__TOC__
 
__TOC__
  
== Setting up the build environment ==
+
==Xcode==
 +
You need to download and install the latest version of Xcode from https://developer.apple.com/xcode/download/
  
This includes the compiler and the required tools to build FileZilla 3 and its dependancies.
+
==Build environment==
 +
Open a Terminal and type the following:
 +
mkdir -p "$HOME/prefix"
 +
mkdir -p "$HOME/src"
 +
export CC="clang -mmacosx-version-min=10.13"
 +
export CXX="clang++ -std=c++17 -stdlib=libc++ -mmacosx-version-min=10.13"
 +
export OBJC="clang -mmacosx-version-min=10.13"
 +
export OBJCXX="clang++ -std=c++17 -stdlib=libc++ -mmacosx-version-min=10.13"
 +
export AS="as -mmacosx-version-min=10.13"
 +
export LD="ld -macosx_version_min 10.13"
 +
export PATH="$HOME/prefix/bin:$PATH"
 +
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"
  
=== Xcode ===
+
If you ever close the terminal and reopen it, repeat the above steps before you continue.
  
Download and install the latest Xcode package for your system. [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=19907 Xcode 2.5] is the right version for Tiger.  
+
==pkg-config==
 +
cd ~/src
 +
curl -OL https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
 +
tar xvf pkg-config-0.29.2.tar.gz
 +
cd pkg-config-0.29.2
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --with-internal-glib
 +
make
 +
make install
  
Make sure you select the BSD developer subsystem and the command line tools from the Xcode installer.
+
==libidn==
 +
cd ~/src
 +
curl -OL https://ftp.gnu.org/gnu/libidn/libidn-1.41.tar.gz
 +
tar xvzf libidn-1.41.tar.gz
 +
cd libidn-1.41
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static
 +
make
 +
make install
  
== Building the Dependencies ==
+
==GMP==
 +
cd ~/src
 +
curl -OL https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz
 +
tar xvf gmp-6.3.0.tar.xz
 +
cd gmp-6.3.0
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat
 +
make
 +
make install
  
FileZilla depends on the work of several open source projects. We must build them before we can build FileZilla.
+
==Nettle==
 +
cd ~/src
 +
curl -OL https://ftp.gnu.org/gnu/nettle/nettle-3.9.1.tar.gz
 +
tar xvf nettle-3.9.1.tar.gz
 +
cd nettle-3.9.1
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat
 +
make
 +
make install
  
=== wxWidgets ===
+
==GnuTLS==
 +
cd ~/src
 +
curl -OL https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.4.tar.xz
 +
tar xvf gnutls-3.8.4.tar.xz
 +
cd gnutls-3.8.4
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --with-included-libtasn1 --without-p11-kit --disable-doc --enable-local-libopts --disable-nls --with-included-unistring --disable-guile --disable-cxx --without-brotli
 +
make
 +
make install
  
Download [http://www.wxwidgets.org/downloads/ wxWidgets]. You will need version 2.8.9 or later. The current version for Mac is [http://prdownloads.sourceforge.net/wxwindows/wxMac-2.8.9.tar.gz wxMac-2.8.9.tar.gz].
+
==Compile SQLite==
 +
cd ~/src
 +
curl -OL https://sqlite.org/2024/sqlite-autoconf-3450300.tar.gz
 +
tar xvzf sqlite-autoconf-3450300.tar.gz
 +
cd sqlite-autoconf-3450300
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --disable-dynamic-extensions
 +
make
 +
make install
  
Start Terminal from the Applications/Utilities folder and enter the following commands:
+
==gettext==
 +
cd ~/src
 +
curl -OL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.4.tar.xz
 +
tar xvf gettext-0.22.4.tar.xz
 +
cd gettext-0.22.4
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static
 +
make
 +
make install
  
  cd /tmp
+
==Compile wxWidgets==
  gzip -cd ~/Desktop/wxMac-2.8.9.tar.gz | tar x
+
  cd ~/src
  mkdir build-wx
+
  curl -OL https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxWidgets-3.2.4.tar.bz2
  cd build-wx
+
  tar xvf wxWidgets-3.2.4.tar.bz2
  ../wxMac-2.8.9/configure --disable-shared --disable-compat26 --enable-unicode \
+
  cd wxWidgets-3.2.4
--prefix /usr/local/wxMac-2.8.9
+
  ./configure --prefix="$HOME/prefix" --enable-shared --without-libcurl --without-libtiff --with-macosx-version-min=10.13
 
  make
 
  make
  sudo make install
+
  make install
  
=== GNU libidn ===
+
==Compile libfilezilla==
 +
cd ~/src
 +
curl -OL https://download.filezilla-project.org/libfilezilla/libfilezilla-0.41.1.tar.bz2
 +
tar xf libfilezilla-0.41.1.tar.bz2
 +
cd libfilezilla-0.41.1
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static
 +
make
 +
make install
  
Download [http://ftp.gnu.org/gnu/libidn/ GNU libidn]. The current version is [http://ftp.gnu.org/gnu/libidn/libidn-1.11.tar.gz libidn-1.11.tar.gz].
+
==Compile FileZilla==
 
+
  cd ~/src
Start Terminal from the Applications/Utilities folder and enter the following commands:
+
  curl -OL https://download.filezilla-project.org/client/FileZilla_3.63.2_src.tar.bz2
 
+
  tar xvjf FileZilla_3.63.2_src.tar.bz2
cd /tmp
+
  cd filezilla-3.63.2
gzip -cd ~/Desktop/libidn-1.11.tar.gz | tar x
+
  ./configure --with-pugixml=builtin
cd libidn-1.11
+
  make
./configure --disable-shared --prefix /usr/local && make
 
sudo make install
 
 
 
=== libgpg-error ===
 
 
 
Download [ftp://ftp.gnupg.org/gcrypt/libgpg-error/ libgpg-error]. The current version is [ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.bz2 libgpg-error-1.7.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
  cd /tmp
 
bzip2 -cd ~/Desktop/libgpg-error-1.7.tar.bz2 | tar x
 
  cd libgpg-error-1.7
 
./configure --disable-shared --prefix /usr/local && make
 
sudo make install
 
 
 
=== libgcrypt ===
 
 
 
Download [ftp://ftp.gnupg.org/gcrypt/libgcrypt/ libgcrypt]. The current version is [ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.3.tar.bz2 libgcrypt-1.4.3.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
bzip2 -cd ~/Desktop/libgcrypt-1.4.3.tar.bz2 | tar x
 
cd libgcrypt-1.4.3
 
./configure --disable-shared --with-gpg-error-prefix=/usr/local --prefix /usr/local && make
 
sudo make install
 
 
 
=== GNU TLS ===
 
 
 
Download [http://ftp.gnu.org/gnu/gnutls/ GNU TLS]. The current version is [http://ftp.gnu.org/gnu/gnutls/gnutls-2.6.3.tar.bz2 gnutls-2.6.3.tar.bz2]
 
 
 
You also need to download [http://filezilla-project.org/codesquid/gnutls.patch gnutls.patch].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
bzip2 -cd ~/Desktop/gnutls-2.6.3.tar.bz2 | tar x
 
cd gnutls-2.6.3
 
patch < ~/Desktop/gnutls.patch
 
./configure --disable-shared --with-libgcrypt-prefix=/usr/local --prefix /usr/local && make
 
sudo make install
 
 
 
Now we need to fix a problem with libgnutls-config because it forgets it needs zlib.
 
 
 
Open Terminal again if you closed it, and enter these commands:
 
 
 
cd /usr/local/bin
 
sudo nano -w libgnutls-config
 
 
 
Look for a line near the top that says:
 
 
 
gnutls_libs="-L${exec_prefix}/lib -lgnutls  -L/usr/local/lib -lgcrypt -lgpg-error  "
 
 
 
Change it to read
 
 
 
gnutls_libs="-L${exec_prefix}/lib -lgnutls  -L/usr/local/lib -lgcrypt -lgpg-error -lz "
 
 
 
Notice all we added is the -lz at the end. Please note the space between -lz and the closing quote; it '''must''' be present.
 
 
 
=== GNU gettext ===
 
 
 
Download [http://ftp.gnu.org/gnu/gettext/ GNU gettext]. The current version is [http://ftp.gnu.org/gnu/gettext/gettext-0.17.tar.gz gettext-0.17.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
gzip -cd ~/Desktop/gettext-0.17.tar.gz | tar x
 
cd gettext-0.17
 
./configure --disable-shared --prefix /usr/local && make
 
sudo make install
 
 
 
== Building [[FileZilla 3]] ==
 
 
 
Download the [http://filezilla-project.org/download.php?type=client FileZilla source]. The current version is [https://www.ohloh.net/projects/filezilla/download?filename=FileZilla_3.1.6_src.tar.bz2 FileZilla_3.1.5_src.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
  cd /tmp
 
bzip2 -cd ~/Desktop/FileZilla_3.1.6_src.tar.bz2 | tar x
 
  cd filezilla-3.1.6
 
export PATH=/usr/local/bin:/usr/local/wxMac-2.8.9/bin:$PATH
 
  ./configure --disable-shared && make
 
  mv FileZilla.app ~/Desktop
 
 
 
== 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.
 

Latest revision as of 11:21, 8 May 2024

This documentation explains how to setup a build environment for FileZilla 3 and how to compile it under macOS using Xcode. These directions have been tested under macOS 12 (Monterey) on an Intel Mac. Resulting binaries are for macOS 10.13 or later.

Xcode[edit]

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

Build environment[edit]

Open a Terminal and type the following:

mkdir -p "$HOME/prefix"
mkdir -p "$HOME/src"
export CC="clang -mmacosx-version-min=10.13"
export CXX="clang++ -std=c++17 -stdlib=libc++ -mmacosx-version-min=10.13"
export OBJC="clang -mmacosx-version-min=10.13"
export OBJCXX="clang++ -std=c++17 -stdlib=libc++ -mmacosx-version-min=10.13"
export AS="as -mmacosx-version-min=10.13"
export LD="ld -macosx_version_min 10.13"
export PATH="$HOME/prefix/bin:$PATH"
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[edit]

cd ~/src
curl -OL https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
tar xvf pkg-config-0.29.2.tar.gz
cd pkg-config-0.29.2
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --with-internal-glib
make
make install

libidn[edit]

cd ~/src
curl -OL https://ftp.gnu.org/gnu/libidn/libidn-1.41.tar.gz
tar xvzf libidn-1.41.tar.gz
cd libidn-1.41
./configure --prefix="$HOME/prefix" --enable-shared --disable-static
make
make install

GMP[edit]

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

Nettle[edit]

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

GnuTLS[edit]

cd ~/src
curl -OL https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.4.tar.xz
tar xvf gnutls-3.8.4.tar.xz
cd gnutls-3.8.4
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --with-included-libtasn1 --without-p11-kit --disable-doc --enable-local-libopts --disable-nls --with-included-unistring --disable-guile --disable-cxx --without-brotli
make
make install

Compile SQLite[edit]

cd ~/src
curl -OL https://sqlite.org/2024/sqlite-autoconf-3450300.tar.gz
tar xvzf sqlite-autoconf-3450300.tar.gz
cd sqlite-autoconf-3450300
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --disable-dynamic-extensions
make
make install

gettext[edit]

cd ~/src
curl -OL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.4.tar.xz
tar xvf gettext-0.22.4.tar.xz
cd gettext-0.22.4
./configure --prefix="$HOME/prefix" --enable-shared --disable-static
make
make install

Compile wxWidgets[edit]

cd ~/src
curl -OL https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxWidgets-3.2.4.tar.bz2
tar xvf wxWidgets-3.2.4.tar.bz2
cd wxWidgets-3.2.4
./configure --prefix="$HOME/prefix" --enable-shared --without-libcurl --without-libtiff --with-macosx-version-min=10.13
make
make install

Compile libfilezilla[edit]

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

Compile FileZilla[edit]

cd ~/src
curl -OL https://download.filezilla-project.org/client/FileZilla_3.63.2_src.tar.bz2
tar xvjf FileZilla_3.63.2_src.tar.bz2
cd filezilla-3.63.2
./configure --with-pugixml=builtin
make