$OpenBSD: patch-Makefile_in,v 1.14 2009/08/03 09:55:47 sthen Exp $
--- Makefile.in.orig	Thu Jun 25 12:35:50 2009
+++ Makefile.in	Sun Jun 28 14:40:39 2009
@@ -176,11 +176,11 @@ OBJS0 = alter.lo analyze.lo attach.lo auth.lo backup.l
         table.lo tokenize.lo trigger.lo update.lo \
         util.lo vacuum.lo \
         vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo \
-        walker.lo where.lo utf.lo vtab.lo
+        walker.lo where.lo utf.lo vtab.lo pthread_stub.lo
 
 # Object files for the amalgamation.
 #
-OBJS1 = sqlite3.lo
+OBJS1 = sqlite3.lo pthread_stub.lo
 
 # Determine the real value of LIBOBJ based on the 'configure' script
 #
@@ -274,7 +274,8 @@ SRC = \
   $(TOP)/src/vdbeInt.h \
   $(TOP)/src/vtab.c \
   $(TOP)/src/walker.c \
-  $(TOP)/src/where.c
+  $(TOP)/src/where.c \
+  $(TOP)/src/pthread_stub.c
 
 # Generated source code files
 #
@@ -439,7 +440,7 @@ HDR += \
 # hidden when the library is built via the amalgamation).
 #
 TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
-TESTFIXTURE_SRC1 = sqlite3.c
+TESTFIXTURE_SRC1 = sqlite3.c $(TOP)/src/pthread_stub.c
 TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
 
 
@@ -467,7 +468,7 @@ libsqlite3.la:	$(LIBOBJ)
 
 libtclsqlite3.la:	tclsqlite.lo libsqlite3.la
 	$(LTLINK) -o $@ tclsqlite.lo \
-		libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \
+		libsqlite3.la -L./.libs @TCL_STUB_LIB_SPEC@ $(TLIBS) \
 		-rpath "$(TCLLIBDIR)" \
 		-version-info "8:6:8" \
 		-avoid-version
@@ -507,6 +508,9 @@ lemon$(BEXE):	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
 sqlite3.lo:	sqlite3.c
 	$(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c
 
+pthread_stub.lo: $(TOP)/src/pthread_stub.c
+	$(LTCOMPILE) -c $(TOP)/src/pthread_stub.c
+
 # Rules to build individual files
 #
 alter.lo:	$(TOP)/src/alter.c $(HDR)
@@ -810,6 +814,8 @@ clean:	
 
 distclean:	clean
 	rm -f config.log config.status libtool Makefile sqlite3.pc
+
+.PHONY: test
 
 #
 # Windows section
