$OpenBSD: patch-Makefile_in,v 1.11 2009/01/31 15:49:34 simon Exp $
--- Makefile.in.orig	Thu Jan 15 15:01:45 2009
+++ Makefile.in	Tue Jan 27 10:23:37 2009
@@ -172,11 +172,11 @@ OBJS0 = alter.lo analyze.lo attach.lo auth.lo bitvec.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
 #
@@ -268,7 +268,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
 #
@@ -431,7 +432,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))
 
 
@@ -456,7 +457,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 "$(libdir)/sqlite" \
 		-module -avoid-version
 
@@ -493,6 +494,9 @@ lemon$(BEXE):	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
 sqlite3.lo:	sqlite3.c
 	$(LTCOMPILE) -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)
@@ -783,6 +787,8 @@ clean:	
 
 distclean:	clean
 	rm -f config.log config.status libtool Makefile sqlite3.pc
+
+.PHONY: test
 
 #
 # Windows section
