Index: sqlite3.c
===================================================================
--- sqlite3.c	(revision 827113)
+++ sqlite3.c	(working copy)
@@ -18750,8 +18750,11 @@
 */
 #if OS_UNIX              /* This file is used on unix only */
 
-/* #define SQLITE_ENABLE_LOCKING_STYLE 0 */
+/* We want to use a fixed locking style for digiKam : */
+#define SQLITE_ENABLE_LOCKING_STYLE     1
+#define SQLITE_FIXED_LOCKING_STYLE      dotlockLockingStyle
 
+
 /*
 ** These #defines should enable >2GB file support on Posix if the
 ** underlying operating system supports it.  If the OS lacks
@@ -20330,6 +20333,8 @@
 
 
 #ifdef SQLITE_ENABLE_LOCKING_STYLE
+
+#ifdef HAVE_FSCTL
 #pragma mark AFP Support
 
 /*
@@ -20644,7 +20649,9 @@
   return SQLITE_OK;
 }
 
+#endif /* HAVE_FSCTL */
 
+
 #pragma mark flock() style locking
 
 /*
@@ -20946,6 +20953,7 @@
 };
 
 #ifdef SQLITE_ENABLE_LOCKING_STYLE
+#ifdef HAVE_FSCTL
 /*
 ** This vector defines all the methods that can operate on an sqlite3_file
 ** for unix with AFP style file locking.
@@ -20965,6 +20973,7 @@
   unixSectorSize,
   unixDeviceCharacteristics
 };
+#endif /* HAVE_FSCTL */
 
 /*
 ** This vector defines all the methods that can operate on an sqlite3_file
@@ -21077,6 +21086,7 @@
   SET_THREADID(pNew);
     
   switch(lockingStyle) {
+#ifdef HAVE_FSCTL
     case afpLockingStyle: {
       /* afp locking uses the file path so it needs to be included in
       ** the afpLockingContext */
@@ -21096,6 +21106,7 @@
       srandomdev();
       break;
     }
+#endif /* HAVE_FSCTL */
     case flockLockingStyle:
       /* flock locking doesn't need additional lockingContext information */
       pNew->pMethod = &sqlite3FlockLockingUnixIoMethod;
