Venkatesh Srinivas, it works over here. Did you take out the SSE2 stuff?
Here is the HOWTO:
Compiling Bitcoind on OpenBSD4.9 Sparc64
This doc will guide you to compiling Bitcoind on OpenBSD-4.9 Sparc64
---Getting Ready---
Besides Bitcoind's direct dependncys you will need to install gmake and wget from the packages collection
Bitconind's dependencys are not satisfied with the packages or ports collection of OpenBSD4.9.
http://mirror.ece.vt.edu/pub/OpenBSD/4.9/packages/sparc64/ <-packages
Berkley DB 4.6.21p4 is there but we need 4.7
Boost 1.42 is there but we need 1.37
OpenSSL is unkonwn
Some of these deps are a couple of years old, but we will get them anyways.
We will need: Boost 1.37, Berkley DB 4.7.25, openSSL 0.9.8g, and Bitcoind R251
Make a directory for this compilation project and the dependencys.
Lets get all the downloading out of the way first
cd ~
mkdir bitcoind
mkdir bitcoind/deps
cd bitcoind/deps
wget "http://www.openssl.org/source/openssl-0.9.8g.tar.gz"
tar -xzf openssl-0.9.8g.tar.gz
wget "http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz"
tar -xzf db-4.7.25.tar.gz
Go online to
http://sourceforge.net/projects/boost/files/boost/1.37.0/and download and and unzip it like the others
Now we will use svn to get Bitcoin. SVN will make a folder called trunk to put the code in.
cd ~/bitcoind/
svn checkout https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk
--Compiling and building dependencys--
Lets start with Boost
cd ~/bitcoind/deps/boost_1_37_0
./configure --prefix=~/bitcoind/deps link=static runtime-link=static install
make
Now Berkley DB
cd ~/bitcoind/deps/db-4.7.25
cd build_unix
../dist/configure --prefix=~/bitcoind/deps --enable-cxx
make
make install
Finally we need need to finess openssl a bit. DES was giving me problems so i excluded it, you might not have to. I also had to change a file because of use of a depreciate option to the m4 macro processor.
cd ~/bitcoind/deps/openssl-0.9.8g
#you may wish to change the line below if you are using a diffrent arch. or want to try to include des
./Configure --prefix=~/bitcoind/deps --openssldir=~/bitcoind/deps/openssl no-des BSD-sparc64
make depend
#if you get an error running the command below you might need to change "m4 -B" to "m4 -D" because -B is depreciated
make
---OpenBSD specific changes to the code of Bitcoin ---
net.cpp and irc.cpp need some changes to work on OpenBSD
OpenBSD does not have MSG_NOSIGNAL so we will "ignore it" by adding these three lines below the headers in each of the two files
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
#endif
now irc.cpp is done but net.cpp need some more work
vi ~/bitcoind/trunk/net.cpp
use the / key to search for SO_NOSIGPIPE. This is not supported in OpenBSD either so we will take it out. We need to yank 4 lines from #ifdefBSD down to #endif
you will find one more of these by searching again for the same thing, take it out
Finally we will drop in our own makefile and be ready to compile bitcoind
cd ~/bitcoind/trunk/
cat > Makefile.OpenBSD
#Bitcoind makefile for OpenBSD
INCLUDEPATHS= \
-I"~/bitcoind/deps/include" \
-I"~/bitcoind/deps/include/boost-1_37"
LIBPATHS= \
-L"~/bitcoind/deps/lib"
WXLIBS= \
-Wl,-Bstatic \
-l wx_gtk2ud-2.9 \
-Wl,-Bdynamic \
-l gtk-x11-2.0 \
-l SM
LIBS= -dead-strip \
-l boost_system-gcc42-mt \
-l boost_filesystem-gcc42-mt \
-l boost_program_options-gcc42-mt \
-l boost_thread-gcc42-mt \
-l db_cxx \
-l ssl \
-l crypto \
-Wl,-Bdynamic \
-l z \
-l pthread
DEFS=-D__WXGTK__ -DNOPCH -DUSE_SSL -D__BSD__
DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-O2 -fstack-protector -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) $(LIBPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
OBJS= \
obj/util.o \
obj/script.o \
obj/db.o \
obj/net.o \
obj/irc.o \
obj/main.o \
obj/rpc.o \
obj/init.o \
cryptopp/obj/sha.o \
cryptopp/obj/cpu.o
all: bitcoin
obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
g++ -c $(CFLAGS) -O3 -o $@ $<
obj/sha256.o: sha256.cpp
g++ -c $(CFLAGS) -O3 -o $@ $<
bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha256.o
g++ $(CFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha256.o
g++ $(CFLAGS) -o $@ $^ $(LIBS)
clean:
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f cryptopp/obj/*.o
-rm -f headers.h.gch
---Compiling Bitcoind---
cd ~/bitcoind/trunk/
gmake -f Makefile.OpenBSD bitcoind
Enjoy