#! /bin/sh /usr/share/dpatch/dpatch-run
## 09_wtdbosqlite3_needs_threads.dpatch by <pgquiles@elpauer.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Sqlite3 needs threading support, therefore the sqlite3 backend for
## DP: Wt::Dbo should only be built if threads are available (and we should
## DP: link to the threads library, too)
@DPATCH@
diff -rupd witty-3.1.2.orig/src/Wt/Dbo/backend/CMakeLists.txt witty-3.1.2/src/Wt/Dbo/backend/CMakeLists.txt
--- witty-3.1.2.orig/src/Wt/Dbo/backend/CMakeLists.txt 2010-03-27 01:14:33.920957665 +0100
+++ witty-3.1.2/src/Wt/Dbo/backend/CMakeLists.txt 2010-03-27 01:16:42.396956820 +0100
@@ -6,6 +6,10 @@ ELSE(USE_SYSTEM_SQLITE3)
SET(Sqlite3_SRCS amalgamation/sqlite3.c)
ENDIF(USE_SYSTEM_SQLITE3)
+FIND_PACKAGE(Threads)
+
+IF(Threads_FOUND)
+
ADD_LIBRARY(wtdbosqlite3
Sqlite3.C
${Sqlite3_SRCS}
@@ -34,6 +38,8 @@ PROPERTIES
INSTALL_FILES(/include/Wt/Dbo/backend "^Sqlite3$")
+ENDIF(Threads_FOUND)
+
IF(POSTGRES_FOUND)
MESSAGE("** Wt::Dbo: building Postgres backend.")
ADD_LIBRARY(wtdbopostgres