First you clone the repository from your terminal and change directory into the new folder that was created.
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoinNow you can check what version you are working with with this git command
git tagRead the ReadMe and the build docs for instructions
more doc/build-osc.mdInstall the dependencies
sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automakeIf you haven’t already, install Homebrew. Homebrew is a package manager that installs dependencies to their own directory and then links their files into /usr/local. Homebrew will only install files within its confines and you can download Homebrew wherever you want. If you have already installed Homebrew, update it with the command below.
brew install autoconf automake berkeley-db4 boost miniupnpc openssl pkg-config protobufAfter you have installed the dependencies, you should check that Homebrew installed OpenSSL properly. OpenSSL is a robust toolkit for the Transport Layer Security and Secure Socket Layer protocols that is required.
openssl versionIf it hasnt been installed correctly you can force a connection with the command below.
brew link openssl --forceYou can now start the build process by generating a set of build scripts. If it is done correctly it should create a set of configuration scripts that will query your system to discover the correct settings and to ensure you have all the necessary libraries to compile the code properly.
./autogen.shThe most important script that offers many customizations to the build process is the configure script. Check the customizations that are possible with this command.
./configure --helpUsage: To assign a variable specify them as VAR=VALUE
Below are some useful configurations
--version // displays version information
--disable-FEATURE // do not include FEATURE (same as –enable-FEATURE=no)
--enable-FEATURE[=ARG] // include FEATURE [ARG=yes]
Now run the configuration script to automatically discover all the necessary libraries. If all goes well this creates a customized build script for your operating system.
Start the compilation process. If this returns no errors then bitcoind has been compiled properly.
The final step is to install the bitcoind executable into the system path. You need to put in your password for this.
sudo make installYou can confirm that everything is downloaded correctly by checking for the following two paths. Both should return a valid path. The default installation put it in /usr/local/bin.