├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 jeffli678 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # build-FreeFileSync 2 | FreeFileSync is a great open source file synchronization tool. It is one of my favorite tools. However, despite its open source nature, there is no build instruction for it. This repo records my own way of building FreeFileSync 10.12 on Ubuntu 18.04. 3 | 4 | ## 0. Download and extract the source code 5 | 6 | As of writing, the latest version of FreeFileSync is 10.12 and it can be downloaded from: 7 | 8 | https://freefilesync.org/download/FreeFileSync_10.12_Source.zip. 9 | 10 | Note wget does not work with this URL. You can manually specify a version number to get the source code of an earlier version 11 | 12 | You also need to get a Resources.zip from an earlier version of the source code, e.g., 10.11, https://freefilesync.org/download/FreeFileSync_10.11_Source.zip. This is probably a bug that the developer forgets to include it. Without it, the program cannot find the icons needed for the UI. The Resouces.zip is in FreeFileSync_10.11_Source/FreeFileSync/Build. Simply copy and paste the zip to the same place in the 10.12 folder. 13 | 14 | ## 1. Install a newer version of gcc 15 | 16 | FreeFileSync requires a c++ compiler that supports c++2a. The default version of gcc on Ubuntu is 7.4.0 and does not work. I followed the instruction at: https://solarianprogrammer.com/2016/10/07/building-gcc-ubuntu-linux/ to build and install the gcc 9.1.0. 17 | 18 | If you follow the steps correctly, you should be able to run "gcc-9.1 -v" without any error. 19 | 20 | ## 2. Install wxWidgets 21 | 22 | FreeFileSync 10.12 requires at least wxWidgets 3.1.1 to compile -- because I find it uses several functions newly added in the version 3.1.1. I choose to install 3.1.2, the latest as of writing. Building wxWidgets should be relatively easy: 23 | 24 | ``` 25 | wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.tar.bz2 26 | tar xf wxWidgets-3.1.2.tar.bz2 27 | cd wxWidgets-3.1.2/ 28 | mkdir gtk-build # or any other name you like 29 | cd gtk-build 30 | ../configure --disable-shared --enable-unicode 31 | make 32 | make install # use sudo if necessary 33 | ``` 34 | 35 | ## 3. Install Boost 36 | 37 | FreeFileSync requries Boost to compile. However, it does not require a very recent version, so simply install the system package to get version 1.65.1: 38 | 39 | ``` 40 | sudo apt install libboost-all-dev 41 | ``` 42 | 43 | ## 4. Modify the Makefile 44 | 45 | The Makefile is at FreeFileSync_10.12_Source/FreeFileSync/Source/Makefile. We need to change all occurrances (there should be two) of "g++" to "g++-9.1" . In the original file, the C++ compiler is hardcoded to g++. However, we installed the gcc-9.1 in the first step and it is called g++-9.1. 46 | 47 | ## 5. Tweak the code: 48 | 49 | Now everything is almost ready. However, depending on your version of libssh2 and libcurl, you may encounter several errors. The best way to fix this is to install the latest version of these two libraries. However, I am not very familiar with them and do not want to change the system default version, so I fix the code when I get compilation errors. 50 | 51 | In "afs/libcurl/curl_wrap.h", comment the line 78 and 120. Basically, we wipe out 52 | ``` 53 | ZEN_CHECK_CASE_FOR_CONSTANT(CURLE_OBSOLETE51); 54 | and ZEN_CHECK_CASE_FOR_CONSTANT(CURLE_RECURSIVE_API_CALL);. 55 | ``` 56 | 57 | In "afs/sftp.cpp", add at line 58 58 | ``` 59 | #define MAX_SFTP_OUTGOING_SIZE 30000 60 | #define MAX_SFTP_READ_SIZE 30000 61 | ``` 62 | 63 | In "afs/sftp.cpp", add at line 1662 64 | ``` 65 | #define LIBSSH2_SFTP_DEFAULT_MODE -1 66 | ``` 67 | 68 | I found the above consts from header files in newer versions of libssh2 and libcurl. 69 | 70 | ## 6. Compile: 71 | 72 | Run "make" in folder FreeFileSync_10.12_Source/FreeFileSync/Source. It will take roughly 10 minutes to compile on a i7 machine. 73 | 74 | The binary should be waiting for you in FreeFileSync_10.12_Source/FreeFileSync/Build/Bin. 75 | 76 | Hopefully, you make it! 77 | --------------------------------------------------------------------------------