Fossil SCM

Modify auto.def to detect the case where the system SQLite is too old for WAL support (used by fossil).

dan 2011-07-14 11:09 trunk
Commit 5fe55cb10331cd85bab4fd79e405691e1ac32fd5
1 file changed +28 -9
+28 -9
--- auto.def
+++ auto.def
@@ -26,21 +26,40 @@
2626
define EXTRA_CFLAGS ""
2727
define EXTRA_LDFLAGS ""
2828
define USE_SYSTEM_SQLITE ""
2929
3030
if {![opt-bool internal-sqlite]} {
31
- if {![cc-check-function-in-lib sqlite3_open sqlite3]} {
32
- if {![cc-check-function-in-lib sqlite3_open sqlite3 {-ldl}]} {
33
- user-error "system sqlite3 not found"
34
- } else {
35
- # On some systems (slackware), the libsqlite3.so file cannot be
36
- # linked without also specifying -ldl. This is a bug in the
37
- # distribution.
38
- define-append EXTRA_LDFLAGS -ldl
31
+ proc find_internal_sqlite {} {
32
+
33
+ # On some systems (slackware), libsqlite3 requires -ldl to link. So
34
+ # search for the system SQLite once with -ldl, and once without. If
35
+ # the library can only be found with $extralibs set to -ldl, then
36
+ # the code below will append -ldl to LIBS.
37
+ #
38
+ foreach extralibs {{} {-ldl}} {
39
+
40
+ # Locate the system SQLite by searching for sqlite3_open(). Then check
41
+ # if sqlite3_wal_checkpoint() can be found as well. If we can find
42
+ # open() but not wal_checkpoint(), then the system SQLite is too old
43
+ # to link against fossil.
44
+ #
45
+ if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
46
+ if {![cc-check-function-in-lib sqlite3_wal_checkpoint sqlite3 $extralibs]} {
47
+ user-error "system sqlite3 too old (require >= 3.7.0)"
48
+ }
49
+
50
+ # Success. Update symbols and return.
51
+ #
52
+ define USE_SYSTEM_SQLITE 1
53
+ define-append LIBS $extralibs
54
+ return
3955
}
4056
}
41
- define USE_SYSTEM_SQLITE 1
57
+ user-error "system sqlite3 not found"
58
+ }
59
+
60
+ find_internal_sqlite
4261
}
4362
4463
if {[opt-bool fossil-debug]} {
4564
define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
4665
}
4766
--- auto.def
+++ auto.def
@@ -26,21 +26,40 @@
26 define EXTRA_CFLAGS ""
27 define EXTRA_LDFLAGS ""
28 define USE_SYSTEM_SQLITE ""
29
30 if {![opt-bool internal-sqlite]} {
31 if {![cc-check-function-in-lib sqlite3_open sqlite3]} {
32 if {![cc-check-function-in-lib sqlite3_open sqlite3 {-ldl}]} {
33 user-error "system sqlite3 not found"
34 } else {
35 # On some systems (slackware), the libsqlite3.so file cannot be
36 # linked without also specifying -ldl. This is a bug in the
37 # distribution.
38 define-append EXTRA_LDFLAGS -ldl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39 }
40 }
41 define USE_SYSTEM_SQLITE 1
 
 
 
42 }
43
44 if {[opt-bool fossil-debug]} {
45 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
46 }
47
--- auto.def
+++ auto.def
@@ -26,21 +26,40 @@
26 define EXTRA_CFLAGS ""
27 define EXTRA_LDFLAGS ""
28 define USE_SYSTEM_SQLITE ""
29
30 if {![opt-bool internal-sqlite]} {
31 proc find_internal_sqlite {} {
32
33 # On some systems (slackware), libsqlite3 requires -ldl to link. So
34 # search for the system SQLite once with -ldl, and once without. If
35 # the library can only be found with $extralibs set to -ldl, then
36 # the code below will append -ldl to LIBS.
37 #
38 foreach extralibs {{} {-ldl}} {
39
40 # Locate the system SQLite by searching for sqlite3_open(). Then check
41 # if sqlite3_wal_checkpoint() can be found as well. If we can find
42 # open() but not wal_checkpoint(), then the system SQLite is too old
43 # to link against fossil.
44 #
45 if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
46 if {![cc-check-function-in-lib sqlite3_wal_checkpoint sqlite3 $extralibs]} {
47 user-error "system sqlite3 too old (require >= 3.7.0)"
48 }
49
50 # Success. Update symbols and return.
51 #
52 define USE_SYSTEM_SQLITE 1
53 define-append LIBS $extralibs
54 return
55 }
56 }
57 user-error "system sqlite3 not found"
58 }
59
60 find_internal_sqlite
61 }
62
63 if {[opt-bool fossil-debug]} {
64 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
65 }
66

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button