Fossil SCM
Some fine-tuning for autosetup to support the Tcl stubs mechanism.
Commit
01de4c53b12e188b3f6354c9be9885045aacf056
Parent
9d0a4a89d776527…
1 file changed
+15
-6
M
auto.def
+15
-6
| --- auto.def | ||
| +++ auto.def | ||
| @@ -5,10 +5,11 @@ | ||
| 5 | 5 | options { |
| 6 | 6 | with-openssl:path|auto|none |
| 7 | 7 | => {Look for openssl in the given path, or auto or none} |
| 8 | 8 | with-zlib:path => {Look for zlib in the given path} |
| 9 | 9 | with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} |
| 10 | + with-tcl-stubs=0 => {Enable Tcl integration via stubs mechanism} | |
| 10 | 11 | internal-sqlite=1 => {Don't use the internal sqlite, use the system one} |
| 11 | 12 | static=0 => {Link a static executable} |
| 12 | 13 | lineedit=1 => {Disable line editing} |
| 13 | 14 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 14 | 15 | json=0 => {Build with fossil JSON API enabled} |
| @@ -32,11 +33,11 @@ | ||
| 32 | 33 | if {![opt-bool internal-sqlite]} { |
| 33 | 34 | proc find_internal_sqlite {} { |
| 34 | 35 | |
| 35 | 36 | # On some systems (slackware), libsqlite3 requires -ldl to link. So |
| 36 | 37 | # 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 | |
| 38 | 39 | # the code below will append -ldl to LIBS. |
| 39 | 40 | # |
| 40 | 41 | foreach extralibs {{} {-ldl}} { |
| 41 | 42 | |
| 42 | 43 | # Locate the system SQLite by searching for sqlite3_open(). Then check |
| @@ -95,30 +96,38 @@ | ||
| 95 | 96 | set tclpath [opt-val with-tcl] |
| 96 | 97 | if {$tclpath ne ""} { |
| 97 | 98 | # Note parse-tclconfig-sh is in autosetup/local.tcl |
| 98 | 99 | if {$tclpath eq "1"} { |
| 99 | 100 | # 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] | |
| 101 | 103 | set msg "on your system" |
| 102 | 104 | } else { |
| 103 | 105 | array set tclconfig [parse-tclconfig-sh $tclpath] |
| 104 | 106 | set msg "at $tclpath" |
| 105 | 107 | } |
| 106 | 108 | if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} { |
| 107 | 109 | user-error "Cannot find Tcl $msg" |
| 108 | 110 | } |
| 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)} { | |
| 111 | 113 | set libs "$tclconfig(TCL_STUB_LIB_SPEC)" |
| 112 | 114 | define FOSSIL_ENABLE_TCL_STUBS |
| 115 | + define USE_TCL_STUBS | |
| 113 | 116 | } else { |
| 114 | 117 | set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)" |
| 115 | 118 | } |
| 116 | 119 | set cflags $tclconfig(TCL_INCLUDE_SPEC) |
| 117 | 120 | 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 | + } | |
| 120 | 129 | } |
| 121 | 130 | } |
| 122 | 131 | set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL) |
| 123 | 132 | msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)" |
| 124 | 133 | define-append LIBS $libs |
| 125 | 134 |
| --- 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 |