Difference between revisions of "Compiling FileZilla 3 under macOS"

From FileZilla Wiki
Jump to navigationJump to search
(Revert spam)
 
(97 intermediate revisions by 18 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 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 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.
 
 
See [http://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 need to download and install the latest version of Xcode from https://developer.apple.com/xcode/download/
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 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.
 
 
 
== Building the Dependencies ==
 
 
 
FileZilla depends on the work of several open source projects. We must build them before we can build FileZilla.
 
 
 
The dependencies can take a long time to build. Instead of waiting for each project to build, you can start an additional Terminal Shell for each one and run them at the same time. However, you must have libgpg-error built before libgcrypt, and you must have libgcrypt built before GNU TLS.
 
 
 
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).
 
 
 
=== wxWidgets ===
 
 
 
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.12.tar.gz wxMac-2.8.12.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xzf ~/Desktop/wxMac-2.8.12.tar.gz
 
mkdir build-wx
 
cd build-wx
 
../wxMac-2.8.12/configure --disable-compat26 --enable-unicode \
 
--prefix $HOME/filezilla/wxMac && nice 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.1.1.tar.gz gettext-0.18.1.1.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xzf ~/Desktop/gettext-0.18.1.1.tar.gz
 
cd gettext-0.18.1.1
 
./configure --prefix $HOME/filezilla/gettext && nice make && make install
 
 
 
=== pkg-config ===
 
 
 
Download [http://pkgconfig.freedesktop.org/releases/ pkg-config]. You will need version 0.23 or later. The current version is [http://pkgconfig.freedesktop.org/releases/pkg-config-0.25.tar.gz pkg-config-0.25.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xzf ~/Desktop/pkg-config-0.25.tar.gz
 
cd pkg-config-0.25
 
./configure --prefix $HOME/filezilla/pkg-config && nice make && make install
 
 
 
'''Note:''' I have not been able to successfully build pkg-config 0.26. It appears to depend on an older version already being present. I suggest sticking with 0.25 for now.
 
 
 
=== GNU libidn ===
 
 
 
Download [ftp://ftp.gnu.org/gnu/libidn/ GNU libidn]. The current version is [ftp://ftp.gnu.org/gnu/libidn/libidn-1.22.tar.gz libidn-1.22.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xzf ~/Desktop/libidn-1.22.tar.gz
 
cd libidn-1.22
 
./configure --prefix $HOME/filezilla/libidn && nice make && 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.10.tar.bz2 libgpg-error-1.10.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xjf ~/Desktop/libgpg-error-1.10.tar.bz2
 
cd libgpg-error-1.10
 
./configure --prefix $HOME/filezilla/libgpg-error && nice make && make install
 
 
 
=== libgcrypt ===
 
 
 
Download [ftp://ftp.gnupg.org/gcrypt/libgcrypt/ libgcrypt]. The current version is [ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2 libgcrypt-1.5.0.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xjf ~/Desktop/libgcrypt-1.5.0.tar.bz2
 
cd libgcrypt-1.5.0
 
./configure --prefix $HOME/filezilla/libgcrypt \
 
--with-gpg-error-prefix=$HOME/filezilla/libgpg-error && nice make && make install
 
 
 
=== GNU TLS ===
 
 
 
Download [ftp://ftp.gnu.org/pub/gnu/gnutls/ GNU TLS]. The current version is [ftp://ftp.gnu.org/pub/gnu/gnutls/gnutls-2.12.6.1.tar.bz2 gnutls-2.12.6.1.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xjf ~/Desktop/gnutls-2.12.6.1.tar.bz2
 
cd gnutls-2.12.6.1
 
./configure --prefix $HOME/filezilla/gnutls --with-libgcrypt --with-libgcrypt-prefix=$HOME/filezilla/libgcrypt && nice make && make install
 
 
 
=== SQLite ===
 
 
 
Download [http://www.sqlite.org/download.html SQLite]. The current version is [http://www.sqlite.org/sqlite-autoconf-3070800.tar.gz sqlite-autoconf-3070800.tar.gz].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xzf ~/Desktop/sqlite-autoconf-3070800.tar.gz
 
cd sqlite-autoconf-3070800
 
./configure --prefix $HOME/filezilla/sqlite --disable-static && nice make && make install
 
 
 
== Building [[FileZilla 3]] ==
 
 
 
Download the [http://filezilla-project.org/download.php?type=client FileZilla source]. The current version is [http://sourceforge.net/projects/filezilla/files/FileZilla_Client/3.5.1/FileZilla_3.5.1_src.tar.bz2/download FileZilla_3.5.1.src.tar.bz2].
 
 
 
Start Terminal from the Applications/Utilities folder and enter the following commands:
 
 
 
cd /tmp
 
tar xjf ~/Desktop/FileZilla_3.5.1_src.tar.bz2
 
cd filezilla-3.5.1
 
export PATH=$HOME/filezilla/wxMac/bin:$HOME/filezilla/gettext/bin:$HOME/filezilla/pkg-config/bin:$PATH
 
export PKG_CONFIG_PATH=$HOME/filezilla/gnutls/lib/pkgconfig:$HOME/filezilla/sqlite/lib/pkgconfig
 
export CPPFLAGS="-I$HOME/filezilla/libidn/include"
 
export LDFLAGS="-L$HOME/filezilla/libidn/lib"
 
./configure && nice make
 
cd FileZilla.app/Contents/MacOS
 
strip filezilla fzputtygen fzsftp
 
cd - && mv FileZilla.app ~/Desktop
 
 
 
If you get an error after "nice make", try this:
 
 
 
rm -rf FileZilla.app && nice make
 
 
 
== 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. Feel free to ask questions on the [http://forum.filezilla-project.org/ FileZilla forums].
 
 
 
==Building under 10.6 Snow Leopard==
 
 
 
When trying to build these codes under 10.6 you might - on certain machines - end up with errors.  The reason is that we fail to compile wxWidgets for 64 bits. See [http://wiki.wxwidgets.org/Development:_wxMac] for how to build wxMac for 32 bits, or  we may just use the Macports to install wxWidgets:
 
  
  sudo port install wxwidgets
+
==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"
  
And now we also need to build libgpg-error, libgcrypt, GNU TLS  and GNU libidn for 32 bits.   Here is the commands for  libgpg-error:
+
If you ever close the terminal and reopen it, repeat the above steps before you continue.
  
$ arch_flags="-arch i386"
+
==pkg-config==
  $ ./configure --prefix $HOME/filezilla/libgpg-error CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" \
+
  cd ~/src
  CPPFLAGS="$arch_flags" LDFLAGS="$arch_flagsOBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"
+
curl -OL https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
  $ nice make -j5 && make install
+
  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
  
The commands for installing libgcrypt:
+
==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
  
  cd libgcrypt-1.4.6
+
==GMP==
  ./configure --prefix $HOME/filezilla/libgcrypt --with-gpg-error-prefix=$HOME/filezilla/libgpg-error  CC="gcc -m32"
+
  cd ~/src
  nice make -j5 && make install
+
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
  
Note ''CC="gcc -m32"'' is used for building Assemble code for 32 bits. For GNU TLS:
+
==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
  
  $ ./configure --prefix $HOME/filezilla/gnutls --with-libgcrypt --with-libgcrypt-prefix=$HOME/filezilla/libgcrypt  \
+
==GnuTLS==
  CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags"  \
+
cd ~/src
OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"
+
curl -OL https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.4.tar.xz
  $ nice make -j5 && make install
+
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
  
And for GNU libidn:
+
==Compile SQLite==
 +
  cd ~/src
 +
curl -OL https://sqlite.org/2023/sqlite-autoconf-3440200.tar.gz
 +
tar xvzf sqlite-autoconf-3440200.tar.gz
 +
cd sqlite-autoconf-3440200
 +
./configure --prefix="$HOME/prefix" --enable-shared --disable-static --disable-dynamic-extensions
 +
make
 +
make install
  
  $ cd libidn-1.22
+
==gettext==
  $ ./configure --prefix $HOME/filezilla/libidn  CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" \
+
cd ~/src
  LDFLAGS="$arch_flags"  OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"
+
curl -OL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.4.tar.xz
  $ nice make -j5 && make install
+
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==
 +
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
  
Now we can build FileZilla:
+
==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
  
  cd filezilla-3.5.0
+
==Compile FileZilla==
  export PATH=$HOME/filezilla/wxMac/bin:$HOME/filezilla/gettext/bin:$HOME/filezilla/pkg-config/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/client/FileZilla_3.63.2_src.tar.bz2
  export CPPFLAGS="-I$HOME/filezilla/libidn/include"
+
  tar xvjf FileZilla_3.63.2_src.tar.bz2
   
+
  cd filezilla-3.63.2
$ ./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags"  \
+
  ./configure --with-pugixml=builtin
OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"  --with-tinyxml=builtin --with-idn-lib=$HOME/filezilla/libidn/lib/libidn.dylib
+
  make
  $ nice make -j5
 
$ cd FileZilla.app/Contents/MacOS
 
$ strip filezilla fzputtygen  fzsftp
 
$ cd -
 
$ mv FileZilla.app/  ~/Desktop/
 

Latest revision as of 16:08, 27 March 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/2023/sqlite-autoconf-3440200.tar.gz
tar xvzf sqlite-autoconf-3440200.tar.gz
cd sqlite-autoconf-3440200
./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