$OpenBSD$
--- makefile.unix.orig	Thu Apr 21 00:08:01 2011
+++ makefile.unix	Mon May 23 15:35:11 2011
@@ -15,13 +15,16 @@ DEFS=-DNOPCH -DFOURWAYSSE2 -DUSE_SSL
 # for boost 1.37, add -mt to the boost libraries
 LIBS= \
  -Wl,-Bstatic \
-   -l boost_system \
-   -l boost_filesystem \
-   -l boost_program_options \
-   -l boost_thread \
+   -L$(PREFIX)/lib \
+   -L$(PREFIX)/lib/db4 \
+   -l boost_system-mt \
+   -l boost_filesystem-mt \
+   -l boost_program_options-mt \
+   -l boost_thread-mt \
    -l db_cxx \
    -l ssl \
-   -l crypto
+   -l crypto \
+   -pthread
 
 ifdef USE_UPNP
 	LIBS += -l miniupnpc
@@ -31,12 +34,11 @@ endif
 LIBS+= \
  -Wl,-Bdynamic \
    -l gthread-2.0 \
-   -l z \
-   -l dl
+   -l z
 
 
 DEBUGFLAGS=-g -D__WXDEBUG__
-CXXFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS)
+CXXFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) -I$(PREFIX)/include -I$(PREFIX)/include/db4
 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
 
@@ -63,7 +65,7 @@ cryptopp/obj/%.o: cryptopp/%.cpp
 	$(CXX) -c $(CXXFLAGS) -O3 -o $@ $<
 
 obj/sha256.o: sha256.cpp
-	$(CXX) -c $(CXXFLAGS) -msse2 -O3 -march=amdfam10 -o $@ $<
+	$(CXX) -c $(CXXFLAGS) -msse2 -O3 -o $@ $<
 
 bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha256.o
 	$(CXX) $(CXXFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
