2010-12-13 17:26:14 +01:00
|
|
|
Copyright (c) 2010 Laszlo Hanyecz
|
2011-06-27 22:11:35 +02:00
|
|
|
Portions Copyright (c) 2011 Douglas Huff
|
|
|
|
Distributed under the MIT/X11 software license, see the accompanying file
|
|
|
|
license.txt or http://www.opensource.org/licenses/mit-license.php. This
|
|
|
|
product includes software developed by the OpenSSL Project for use in the
|
|
|
|
OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic
|
|
|
|
software written by Eric Young (eay@cryptsoft.com) and UPnP software written by
|
|
|
|
Thomas Bernard.
|
2010-08-29 18:58:15 +02:00
|
|
|
|
|
|
|
|
2011-09-26 17:40:43 +02:00
|
|
|
Mac OS X bitcoind build instructions
|
2011-06-27 22:11:35 +02:00
|
|
|
Laszlo Hanyecz <solar@heliacal.net>
|
|
|
|
Douglas Huff <dhuff@jrbobdobbs.org>
|
2010-08-29 18:58:15 +02:00
|
|
|
|
|
|
|
|
2011-09-26 17:40:43 +02:00
|
|
|
See readme-qt.rst for instructions on building Bitcoin QT, the
|
|
|
|
graphical user interface.
|
|
|
|
|
2010-08-29 18:58:15 +02:00
|
|
|
Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian.
|
|
|
|
|
|
|
|
All of the commands should be executed in Terminal.app.. it's in
|
|
|
|
/Applications/Utilities
|
|
|
|
|
2011-06-27 22:11:35 +02:00
|
|
|
You need to install XCode with all the options checked so that the compiler and
|
|
|
|
everything is available in /usr not just /Developer I think it comes on the DVD
|
|
|
|
but you can get the current version from http://developer.apple.com
|
2010-08-29 18:58:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
1. Pick a directory to work inside.. something like ~/bitcoin works. The
|
|
|
|
structure I use looks like this:
|
2011-06-27 22:11:35 +02:00
|
|
|
|
2010-08-29 18:58:15 +02:00
|
|
|
(~ is your home directory)
|
|
|
|
|
|
|
|
~/bitcoin
|
2011-06-27 22:11:35 +02:00
|
|
|
~/bitcoin/bitcoin # Upstream source tree
|
|
|
|
~/bitcoin/src # source code (symlink to ~/bitcoin/bitcoin/src)
|
2010-08-29 18:58:15 +02:00
|
|
|
~/bitcoin/deps # dependencies.. like libraries and headers needed to compile
|
|
|
|
|
|
|
|
Just execute: mkdir ~/bitcoin
|
|
|
|
This will create the top dir for you..
|
|
|
|
|
|
|
|
WARNING: do not use the ~ notation with the configure scripts.. use the full
|
|
|
|
name of the directory, for example /Users/james/bitcoin/deps for a user named
|
|
|
|
'james'. In my examples I am using 'macosuser' so make sure you change that.
|
|
|
|
|
2011-06-27 22:11:35 +02:00
|
|
|
2. Check out the bitcoin code from github:
|
2010-08-29 18:58:15 +02:00
|
|
|
|
|
|
|
cd ~/bitcoin
|
2011-06-27 22:11:35 +02:00
|
|
|
git clone https://github.com/bitcoin/bitcoin.git
|
|
|
|
ln -s bitcoin/src src
|
2010-08-29 18:58:15 +02:00
|
|
|
|
2011-06-27 22:11:35 +02:00
|
|
|
This will make ~/bitcoin/bitcoin for you with all the files from git. This puts
|
|
|
|
the actual sources in ~/bitcoin/bitcoin/src and create a symlink src in
|
|
|
|
~/bitcoin to this location.
|
2010-08-29 18:58:15 +02:00
|
|
|
|
|
|
|
3. Get and build the dependencies
|
|
|
|
|
|
|
|
|
|
|
|
Boost
|
|
|
|
-----
|
|
|
|
|
|
|
|
Download from http://www.boost.org/users/download/
|
|
|
|
I'm assuming it ended up in ~/Downloads..
|
|
|
|
|
|
|
|
mkdir ~/bitcoin/deps
|
|
|
|
cd ~/bitcoin/deps
|
|
|
|
tar xvjf ~/Downloads/boost_1_42_0.tar.bz2
|
|
|
|
cd boost_1_42_0
|
|
|
|
./bootstrap.sh
|
2011-04-13 22:38:22 +02:00
|
|
|
./bjam architecture=combined address-model=32_64 macosx-version=10.5 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install
|
|
|
|
|
|
|
|
If you're using Snow Leopard, you will need to specify 10.6 as your Mac OS X
|
|
|
|
version instead of 10.5.
|
2010-08-29 18:58:15 +02:00
|
|
|
|
|
|
|
This part takes a while.. use your judgement and fix it if something doesn't
|
|
|
|
build for some reason.
|
|
|
|
|
|
|
|
Change the prefix to whatever your directory is (my username in this example
|
|
|
|
is macosuser). I'm also running on 10.6 so i have macosx-version=10.6 change
|
|
|
|
to 10.5 if you're using leopard.
|
|
|
|
|
|
|
|
This is what my output looked like at the end:
|
|
|
|
...failed updating 2 targets...
|
|
|
|
...skipped 144 targets...
|
|
|
|
...updated 8074 targets...
|
|
|
|
|
|
|
|
|
|
|
|
OpenSSL
|
|
|
|
-------
|
|
|
|
|
2011-06-27 22:11:35 +02:00
|
|
|
(System or MacPorts openssl will work fine. Optional.)
|
|
|
|
|
2010-08-29 18:58:15 +02:00
|
|
|
Download from http://www.openssl.org/source/
|
|
|
|
|
|
|
|
We would like to build this as a 32 bit/64 bit library so we actually build it
|
|
|
|
2 times and join it together here.. If you downloaded with safari it already
|
|
|
|
uncompressed it so it will just be a tar not a tar.gz
|
|
|
|
|
|
|
|
cd ~/bitcoin/deps
|
|
|
|
tar xvf ~/Downloads/openssl-1.0.0.tar
|
|
|
|
mv openssl-1.0.0 openssl-1.0.0-i386
|
|
|
|
tar xvf ~/Downloads/openssl-1.0.0.tar
|
|
|
|
mv openssl-1.0.0 openssl-1.0.0-x86_64
|
|
|
|
# build i386 (32 bit intel) binary
|
|
|
|
cd openssl-1.0.0-i386
|
2011-04-13 22:38:22 +02:00
|
|
|
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin-i386-cc && make
|
2010-08-29 18:58:15 +02:00
|
|
|
make install # only do this on one of the architectures, to install the headers
|
|
|
|
cd ..
|
|
|
|
# build x86_64 (64 bit intel) binary
|
|
|
|
cd openssl-1.0.0-x86_64
|
2011-04-13 22:38:22 +02:00
|
|
|
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin64-x86_64-cc && make
|
2010-08-29 18:58:15 +02:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# combine the libs
|
|
|
|
cd ~/bitcoin/deps
|
|
|
|
lipo -arch i386 openssl-1.0.0-i386/libcrypto.a -arch x86_64 openssl-1.0.0-x86_64/libcrypto.a -o lib/libcrypto.a -create
|
|
|
|
lipo -arch i386 openssl-1.0.0-i386/libssl.a -arch x86_64 openssl-1.0.0-x86_64/libssl.a -o lib/libssl.a -create
|
|
|
|
|
|
|
|
Verify your binaries
|
|
|
|
|
|
|
|
file lib/libcrypto.a
|
|
|
|
|
|
|
|
output should look like this:
|
|
|
|
|
2011-03-26 13:01:27 +01:00
|
|
|
lib/libcrypto.a: Mach-O universal binary with 2 architectures
|
2011-06-27 22:11:35 +02:00
|
|
|
lib/libcrypto.a (for architecture i386): current ar archive random library
|
|
|
|
lib/libcrypto.a (for architecture x86_64): current ar archive random library
|
2010-08-29 18:58:15 +02:00
|
|
|
|
|
|
|
|
2011-03-26 13:01:27 +01:00
|
|
|
miniupnpc
|
|
|
|
---------
|
|
|
|
|
2011-06-27 22:11:35 +02:00
|
|
|
(MacPorts miniupnpc package works fine. You will need to modify makefile.)
|
|
|
|
|
2011-03-26 13:01:27 +01:00
|
|
|
The process for miniupnpc (optional) is similar to that of OpenSSL.
|
|
|
|
|
|
|
|
Download from http://miniupnp.tuxfamily.org/files/.
|
|
|
|
|
|
|
|
cd ~/bitcoin/deps
|
2011-08-12 00:20:07 +02:00
|
|
|
tar xvf ~/Downloads/miniupnpc-1.6.tar
|
|
|
|
mv miniupnpc-1.6 miniupnpc-1.6-x86_64
|
|
|
|
tar xvf ~/Downloads/miniupnpc-1.6.tar
|
|
|
|
mv miniupnpc-1.6 miniupnpc-1.6-i386
|
2011-03-26 13:01:27 +01:00
|
|
|
# build x86_64 (64 bit intel) binary
|
2011-08-12 00:20:07 +02:00
|
|
|
cd miniupnpc-1.6-x86_64
|
2011-03-26 13:01:27 +01:00
|
|
|
export CFLAGS="-arch x86_64"
|
|
|
|
export LDFLAGS="-arch x86_64"
|
|
|
|
export PREFIX="/Users/macuser/bitcoin/deps"
|
|
|
|
make && make install
|
|
|
|
# build i386 (32 bit intel) binary
|
2011-08-12 00:20:07 +02:00
|
|
|
cd miniupnpc-1.6-i386
|
2011-03-26 13:01:27 +01:00
|
|
|
export CFLAGS="-arch i386"
|
|
|
|
export LDFLAGS="-arch i386"
|
|
|
|
export PREFIX="/Users/macuser/bitcoin/deps"
|
|
|
|
make
|
|
|
|
|
|
|
|
# combine the libs
|
|
|
|
cd ~/bitcoin/deps
|
2011-08-12 00:20:07 +02:00
|
|
|
lipo -arch i386 miniupnpc-1.6-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.6-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create
|
2011-03-26 13:01:27 +01:00
|
|
|
|
|
|
|
Verify your binaries
|
|
|
|
|
|
|
|
file lib/libminiupnpc.a
|
|
|
|
|
|
|
|
output should look like this:
|
|
|
|
|
|
|
|
lib/libminiupnpc.a: Mach-O universal binary with 2 architectures
|
2011-06-27 22:11:35 +02:00
|
|
|
lib/libminiupnpc.a (for architecture i386): current ar archive random library
|
|
|
|
lib/libminiupnpc.a (for architecture x86_64): current ar archive random library
|
2011-03-26 13:01:27 +01:00
|
|
|
|
|
|
|
|
2010-08-29 18:58:15 +02:00
|
|
|
Berkeley DB
|
|
|
|
-----------
|
|
|
|
|
2011-06-27 22:11:35 +02:00
|
|
|
(System or MacPorts version work fine.)
|
|
|
|
|
2010-08-29 18:58:15 +02:00
|
|
|
Download from http://freshmeat.net/projects/berkeleydb/
|
|
|
|
|
|
|
|
cd ~/bitcoin/deps
|
2011-08-12 00:20:07 +02:00
|
|
|
tar xvf ~/Downloads/db-4.8.30.tar
|
|
|
|
cd db-4.8.30/build_unix
|
2010-08-29 18:58:15 +02:00
|
|
|
../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install
|
|
|
|
|
|
|
|
|
2011-09-26 17:40:43 +02:00
|
|
|
Now you should be able to build bitcoind:
|
2010-08-29 18:58:15 +02:00
|
|
|
|
2011-06-27 22:11:35 +02:00
|
|
|
cd ~/bitcoin/src
|
2011-09-26 17:40:43 +02:00
|
|
|
make -f makefile.osx bitcoind
|