Fossil SCM

Some fine-tuning for autosetup to support the Tcl stubs mechanism.

mistachkin 2012-09-29 07:16 UTC tclStubsV2
Commit 01de4c53b12e188b3f6354c9be9885045aacf056
1 file changed +15 -6
+15 -6
--- auto.def
+++ auto.def
@@ -5,10 +5,11 @@
55
options {
66
with-openssl:path|auto|none
77
=> {Look for openssl in the given path, or auto or none}
88
with-zlib:path => {Look for zlib in the given path}
99
with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
10
+ with-tcl-stubs=0 => {Enable Tcl integration via stubs mechanism}
1011
internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
1112
static=0 => {Link a static executable}
1213
lineedit=1 => {Disable line editing}
1314
fossil-debug=0 => {Build with fossil debugging enabled}
1415
json=0 => {Build with fossil JSON API enabled}
@@ -32,11 +33,11 @@
3233
if {![opt-bool internal-sqlite]} {
3334
proc find_internal_sqlite {} {
3435
3536
# On some systems (slackware), libsqlite3 requires -ldl to link. So
3637
# search for the system SQLite once with -ldl, and once without. If
37
- # the library can only be found with $extralibs set to -ldl, then
38
+ # the library can only be found with $extralibs set to -ldl, then
3839
# the code below will append -ldl to LIBS.
3940
#
4041
foreach extralibs {{} {-ldl}} {
4142
4243
# Locate the system SQLite by searching for sqlite3_open(). Then check
@@ -95,30 +96,38 @@
9596
set tclpath [opt-val with-tcl]
9697
if {$tclpath ne ""} {
9798
# Note parse-tclconfig-sh is in autosetup/local.tcl
9899
if {$tclpath eq "1"} {
99100
# Use the system Tcl. Look in some likely places.
100
- array set tclconfig [parse-tclconfig-sh /usr /usr/local /usr/share /opt/local]
101
+ array set tclconfig [parse-tclconfig-sh \
102
+ /usr /usr/local /usr/share /opt/local]
101103
set msg "on your system"
102104
} else {
103105
array set tclconfig [parse-tclconfig-sh $tclpath]
104106
set msg "at $tclpath"
105107
}
106108
if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
107109
user-error "Cannot find Tcl $msg"
108110
}
109
- set tclstubs [opt-val with-tcl-stubs]
110
- if {$tclstubs eq "1" && $tclconfig(TCL_SUPPORTS_STUBS)} {
111
+ set tclstubs [opt-bool with-tcl-stubs]
112
+ if {$tclstubs && $tclconfig(TCL_SUPPORTS_STUBS)} {
111113
set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
112114
define FOSSIL_ENABLE_TCL_STUBS
115
+ define USE_TCL_STUBS
113116
} else {
114117
set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
115118
}
116119
set cflags $tclconfig(TCL_INCLUDE_SPEC)
117120
cc-with [list -cflags $cflags -libs $libs] {
118
- if {![cc-check-functions Tcl_CreateInterp]} {
119
- user-error "Cannot find a usable Tcl $msg"
121
+ if {$tclstubs} {
122
+ if {![cc-check-functions Tcl_InitStubs]} {
123
+ user-error "Cannot find a usable Tcl stubs library $msg"
124
+ }
125
+ } else {
126
+ if {![cc-check-functions Tcl_CreateInterp]} {
127
+ user-error "Cannot find a usable Tcl library $msg"
128
+ }
120129
}
121130
}
122131
set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
123132
msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
124133
define-append LIBS $libs
125134
--- auto.def
+++ auto.def
@@ -5,10 +5,11 @@
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
9 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
 
10 internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
11 static=0 => {Link a static executable}
12 lineedit=1 => {Disable line editing}
13 fossil-debug=0 => {Build with fossil debugging enabled}
14 json=0 => {Build with fossil JSON API enabled}
@@ -32,11 +33,11 @@
32 if {![opt-bool internal-sqlite]} {
33 proc find_internal_sqlite {} {
34
35 # On some systems (slackware), libsqlite3 requires -ldl to link. So
36 # search for the system SQLite once with -ldl, and once without. If
37 # the library can only be found with $extralibs set to -ldl, then
38 # the code below will append -ldl to LIBS.
39 #
40 foreach extralibs {{} {-ldl}} {
41
42 # Locate the system SQLite by searching for sqlite3_open(). Then check
@@ -95,30 +96,38 @@
95 set tclpath [opt-val with-tcl]
96 if {$tclpath ne ""} {
97 # Note parse-tclconfig-sh is in autosetup/local.tcl
98 if {$tclpath eq "1"} {
99 # Use the system Tcl. Look in some likely places.
100 array set tclconfig [parse-tclconfig-sh /usr /usr/local /usr/share /opt/local]
 
101 set msg "on your system"
102 } else {
103 array set tclconfig [parse-tclconfig-sh $tclpath]
104 set msg "at $tclpath"
105 }
106 if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
107 user-error "Cannot find Tcl $msg"
108 }
109 set tclstubs [opt-val with-tcl-stubs]
110 if {$tclstubs eq "1" && $tclconfig(TCL_SUPPORTS_STUBS)} {
111 set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
112 define FOSSIL_ENABLE_TCL_STUBS
 
113 } else {
114 set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
115 }
116 set cflags $tclconfig(TCL_INCLUDE_SPEC)
117 cc-with [list -cflags $cflags -libs $libs] {
118 if {![cc-check-functions Tcl_CreateInterp]} {
119 user-error "Cannot find a usable Tcl $msg"
 
 
 
 
 
 
120 }
121 }
122 set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
123 msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
124 define-append LIBS $libs
125
--- auto.def
+++ auto.def
@@ -5,10 +5,11 @@
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
9 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
10 with-tcl-stubs=0 => {Enable Tcl integration via stubs mechanism}
11 internal-sqlite=1 => {Don't use the internal sqlite, use the system one}
12 static=0 => {Link a static executable}
13 lineedit=1 => {Disable line editing}
14 fossil-debug=0 => {Build with fossil debugging enabled}
15 json=0 => {Build with fossil JSON API enabled}
@@ -32,11 +33,11 @@
33 if {![opt-bool internal-sqlite]} {
34 proc find_internal_sqlite {} {
35
36 # On some systems (slackware), libsqlite3 requires -ldl to link. So
37 # search for the system SQLite once with -ldl, and once without. If
38 # the library can only be found with $extralibs set to -ldl, then
39 # the code below will append -ldl to LIBS.
40 #
41 foreach extralibs {{} {-ldl}} {
42
43 # Locate the system SQLite by searching for sqlite3_open(). Then check
@@ -95,30 +96,38 @@
96 set tclpath [opt-val with-tcl]
97 if {$tclpath ne ""} {
98 # Note parse-tclconfig-sh is in autosetup/local.tcl
99 if {$tclpath eq "1"} {
100 # Use the system Tcl. Look in some likely places.
101 array set tclconfig [parse-tclconfig-sh \
102 /usr /usr/local /usr/share /opt/local]
103 set msg "on your system"
104 } else {
105 array set tclconfig [parse-tclconfig-sh $tclpath]
106 set msg "at $tclpath"
107 }
108 if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
109 user-error "Cannot find Tcl $msg"
110 }
111 set tclstubs [opt-bool with-tcl-stubs]
112 if {$tclstubs && $tclconfig(TCL_SUPPORTS_STUBS)} {
113 set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
114 define FOSSIL_ENABLE_TCL_STUBS
115 define USE_TCL_STUBS
116 } else {
117 set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
118 }
119 set cflags $tclconfig(TCL_INCLUDE_SPEC)
120 cc-with [list -cflags $cflags -libs $libs] {
121 if {$tclstubs} {
122 if {![cc-check-functions Tcl_InitStubs]} {
123 user-error "Cannot find a usable Tcl stubs library $msg"
124 }
125 } else {
126 if {![cc-check-functions Tcl_CreateInterp]} {
127 user-error "Cannot find a usable Tcl library $msg"
128 }
129 }
130 }
131 set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
132 msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
133 define-append LIBS $libs
134

Keyboard Shortcuts

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