Fossil SCM
Enable building with Tcl integration enabled using autosetup and/or makemake.tcl. Patch provided by Steve Bennett.
Commit
5ffb7d71d373d98499b4aa00e3eb51ec0d469e95
Parent
7017c87b40c9219…
4 files changed
+21
+8
-1
+9
-1
+5
M
auto.def
+21
| --- auto.def | ||
| +++ auto.def | ||
| @@ -4,10 +4,11 @@ | ||
| 4 | 4 | |
| 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 | + with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} | |
| 9 | 10 | internal-sqlite=1 => {Don't use the internal sqlite, use the system one} |
| 10 | 11 | static=0 => {Link a static executable} |
| 11 | 12 | lineedit=1 => {Disable line editing} |
| 12 | 13 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 13 | 14 | } |
| @@ -78,10 +79,30 @@ | ||
| 78 | 79 | define-append EXTRA_LDFLAGS -L$zlibpath |
| 79 | 80 | } |
| 80 | 81 | if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} { |
| 81 | 82 | user-error "zlib not found please install it or specify the location with --with-zlib" |
| 82 | 83 | } |
| 84 | + | |
| 85 | +set tclpath [opt-val with-tcl] | |
| 86 | +if {$tclpath ne ""} { | |
| 87 | + if {$tclpath ne "1"} { | |
| 88 | + cc-with [list -cflags [list -I$tclpath/include -L$tclpath/lib]] | |
| 89 | + } | |
| 90 | + if {![cc-check-includes tcl.h] || ![cc-check-function-in-lib Tcl_CreateInterp tcl]} { | |
| 91 | + if {$tclpath eq ""} { | |
| 92 | + user-error "No system Tcl available. Try --with-tcl=<path>" | |
| 93 | + } else { | |
| 94 | + user-error "No Tcl available at $tclpath" | |
| 95 | + } | |
| 96 | + } | |
| 97 | + define FOSSIL_ENABLE_TCL | |
| 98 | + define-append LIBS -ltcl | |
| 99 | + if {$tclpath ne "1"} { | |
| 100 | + define-append EXTRA_CFLAGS -I$tclpath/include | |
| 101 | + define-append EXTRA_LDFLAGS -L$tclpath/lib | |
| 102 | + } | |
| 103 | +} | |
| 83 | 104 | |
| 84 | 105 | # Helper for openssl checking |
| 85 | 106 | proc check-for-openssl {msg {cflags {}}} { |
| 86 | 107 | msg-checking "Checking for $msg..." |
| 87 | 108 | set rc 0 |
| 88 | 109 |
| --- auto.def | |
| +++ auto.def | |
| @@ -4,10 +4,11 @@ | |
| 4 | |
| 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 | internal-sqlite=1 => {Don't use the internal sqlite, use the system one} |
| 10 | static=0 => {Link a static executable} |
| 11 | lineedit=1 => {Disable line editing} |
| 12 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 13 | } |
| @@ -78,10 +79,30 @@ | |
| 78 | define-append EXTRA_LDFLAGS -L$zlibpath |
| 79 | } |
| 80 | if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} { |
| 81 | user-error "zlib not found please install it or specify the location with --with-zlib" |
| 82 | } |
| 83 | |
| 84 | # Helper for openssl checking |
| 85 | proc check-for-openssl {msg {cflags {}}} { |
| 86 | msg-checking "Checking for $msg..." |
| 87 | set rc 0 |
| 88 |
| --- auto.def | |
| +++ auto.def | |
| @@ -4,10 +4,11 @@ | |
| 4 | |
| 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 | } |
| @@ -78,10 +79,30 @@ | |
| 79 | define-append EXTRA_LDFLAGS -L$zlibpath |
| 80 | } |
| 81 | if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} { |
| 82 | user-error "zlib not found please install it or specify the location with --with-zlib" |
| 83 | } |
| 84 | |
| 85 | set tclpath [opt-val with-tcl] |
| 86 | if {$tclpath ne ""} { |
| 87 | if {$tclpath ne "1"} { |
| 88 | cc-with [list -cflags [list -I$tclpath/include -L$tclpath/lib]] |
| 89 | } |
| 90 | if {![cc-check-includes tcl.h] || ![cc-check-function-in-lib Tcl_CreateInterp tcl]} { |
| 91 | if {$tclpath eq ""} { |
| 92 | user-error "No system Tcl available. Try --with-tcl=<path>" |
| 93 | } else { |
| 94 | user-error "No Tcl available at $tclpath" |
| 95 | } |
| 96 | } |
| 97 | define FOSSIL_ENABLE_TCL |
| 98 | define-append LIBS -ltcl |
| 99 | if {$tclpath ne "1"} { |
| 100 | define-append EXTRA_CFLAGS -I$tclpath/include |
| 101 | define-append EXTRA_LDFLAGS -L$tclpath/lib |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | # Helper for openssl checking |
| 106 | proc check-for-openssl {msg {cflags {}}} { |
| 107 | msg-checking "Checking for $msg..." |
| 108 | set rc 0 |
| 109 |
+8
-1
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -301,11 +301,15 @@ | ||
| 301 | 301 | # using -lsqlite3. |
| 302 | 302 | SQLITE3_OBJ.1 = |
| 303 | 303 | SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o |
| 304 | 304 | SQLITE3_OBJ. = $(SQLITE3_OBJ.0) |
| 305 | 305 | |
| 306 | -EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o | |
| 306 | +TCL_OBJ.1 = | |
| 307 | +TCL_OBJ.0 = $(OBJDIR)/th_tcl.o | |
| 308 | +TCL_OBJ. = $(TCL_OBJ.0) | |
| 309 | + | |
| 310 | +EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(TCL_OBJ.$(FOSSIL_ENABLE_TCL)) | |
| 307 | 311 | |
| 308 | 312 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) |
| 309 | 313 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) |
| 310 | 314 | |
| 311 | 315 | # This rule prevents make from using its default rules to try build |
| @@ -909,5 +913,8 @@ | ||
| 909 | 913 | $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th.c -o $(OBJDIR)/th.o |
| 910 | 914 | |
| 911 | 915 | $(OBJDIR)/th_lang.o: $(SRCDIR)/th_lang.c |
| 912 | 916 | $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_lang.c -o $(OBJDIR)/th_lang.o |
| 913 | 917 | |
| 918 | +$(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c | |
| 919 | + $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o | |
| 920 | + | |
| 914 | 921 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -301,11 +301,15 @@ | |
| 301 | # using -lsqlite3. |
| 302 | SQLITE3_OBJ.1 = |
| 303 | SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o |
| 304 | SQLITE3_OBJ. = $(SQLITE3_OBJ.0) |
| 305 | |
| 306 | EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o |
| 307 | |
| 308 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) |
| 309 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) |
| 310 | |
| 311 | # This rule prevents make from using its default rules to try build |
| @@ -909,5 +913,8 @@ | |
| 909 | $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th.c -o $(OBJDIR)/th.o |
| 910 | |
| 911 | $(OBJDIR)/th_lang.o: $(SRCDIR)/th_lang.c |
| 912 | $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_lang.c -o $(OBJDIR)/th_lang.o |
| 913 | |
| 914 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -301,11 +301,15 @@ | |
| 301 | # using -lsqlite3. |
| 302 | SQLITE3_OBJ.1 = |
| 303 | SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o |
| 304 | SQLITE3_OBJ. = $(SQLITE3_OBJ.0) |
| 305 | |
| 306 | TCL_OBJ.1 = |
| 307 | TCL_OBJ.0 = $(OBJDIR)/th_tcl.o |
| 308 | TCL_OBJ. = $(TCL_OBJ.0) |
| 309 | |
| 310 | EXTRAOBJ = $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) $(OBJDIR)/shell.o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o $(TCL_OBJ.$(FOSSIL_ENABLE_TCL)) |
| 311 | |
| 312 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) |
| 313 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) |
| 314 | |
| 315 | # This rule prevents make from using its default rules to try build |
| @@ -909,5 +913,8 @@ | |
| 913 | $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th.c -o $(OBJDIR)/th.o |
| 914 | |
| 915 | $(OBJDIR)/th_lang.o: $(SRCDIR)/th_lang.c |
| 916 | $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_lang.c -o $(OBJDIR)/th_lang.o |
| 917 | |
| 918 | $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 919 | $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o |
| 920 | |
| 921 |
+9
-1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -198,15 +198,20 @@ | ||
| 198 | 198 | # using -lsqlite3. |
| 199 | 199 | SQLITE3_OBJ.1 = |
| 200 | 200 | SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o |
| 201 | 201 | SQLITE3_OBJ. = $(SQLITE3_OBJ.0) |
| 202 | 202 | |
| 203 | +TCL_OBJ.1 = | |
| 204 | +TCL_OBJ.0 = $(OBJDIR)/th_tcl.o | |
| 205 | +TCL_OBJ. = $(TCL_OBJ.0) | |
| 206 | + | |
| 203 | 207 | EXTRAOBJ = \ |
| 204 | 208 | $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \ |
| 205 | 209 | $(OBJDIR)/shell.o \ |
| 206 | 210 | $(OBJDIR)/th.o \ |
| 207 | - $(OBJDIR)/th_lang.o | |
| 211 | + $(OBJDIR)/th_lang.o \ | |
| 212 | + $(TCL_OBJ.$(FOSSIL_ENABLE_TCL)) | |
| 208 | 213 | |
| 209 | 214 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) |
| 210 | 215 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) |
| 211 | 216 | |
| 212 | 217 | # This rule prevents make from using its default rules to try build |
| @@ -265,10 +270,13 @@ | ||
| 265 | 270 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n" |
| 266 | 271 | |
| 267 | 272 | writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c" |
| 268 | 273 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n" |
| 269 | 274 | |
| 275 | +writeln "\$(OBJDIR)/th_tcl.o:\t\$(SRCDIR)/th_tcl.c" | |
| 276 | +writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n" | |
| 277 | + | |
| 270 | 278 | close $output_file |
| 271 | 279 | # |
| 272 | 280 | # End of the main.mk output |
| 273 | 281 | ############################################################################## |
| 274 | 282 | ############################################################################## |
| 275 | 283 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -198,15 +198,20 @@ | |
| 198 | # using -lsqlite3. |
| 199 | SQLITE3_OBJ.1 = |
| 200 | SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o |
| 201 | SQLITE3_OBJ. = $(SQLITE3_OBJ.0) |
| 202 | |
| 203 | EXTRAOBJ = \ |
| 204 | $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \ |
| 205 | $(OBJDIR)/shell.o \ |
| 206 | $(OBJDIR)/th.o \ |
| 207 | $(OBJDIR)/th_lang.o |
| 208 | |
| 209 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) |
| 210 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) |
| 211 | |
| 212 | # This rule prevents make from using its default rules to try build |
| @@ -265,10 +270,13 @@ | |
| 265 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n" |
| 266 | |
| 267 | writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c" |
| 268 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n" |
| 269 | |
| 270 | close $output_file |
| 271 | # |
| 272 | # End of the main.mk output |
| 273 | ############################################################################## |
| 274 | ############################################################################## |
| 275 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -198,15 +198,20 @@ | |
| 198 | # using -lsqlite3. |
| 199 | SQLITE3_OBJ.1 = |
| 200 | SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o |
| 201 | SQLITE3_OBJ. = $(SQLITE3_OBJ.0) |
| 202 | |
| 203 | TCL_OBJ.1 = |
| 204 | TCL_OBJ.0 = $(OBJDIR)/th_tcl.o |
| 205 | TCL_OBJ. = $(TCL_OBJ.0) |
| 206 | |
| 207 | EXTRAOBJ = \ |
| 208 | $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \ |
| 209 | $(OBJDIR)/shell.o \ |
| 210 | $(OBJDIR)/th.o \ |
| 211 | $(OBJDIR)/th_lang.o \ |
| 212 | $(TCL_OBJ.$(FOSSIL_ENABLE_TCL)) |
| 213 | |
| 214 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) |
| 215 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) |
| 216 | |
| 217 | # This rule prevents make from using its default rules to try build |
| @@ -265,10 +270,13 @@ | |
| 270 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n" |
| 271 | |
| 272 | writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c" |
| 273 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n" |
| 274 | |
| 275 | writeln "\$(OBJDIR)/th_tcl.o:\t\$(SRCDIR)/th_tcl.c" |
| 276 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n" |
| 277 | |
| 278 | close $output_file |
| 279 | # |
| 280 | # End of the main.mk output |
| 281 | ############################################################################## |
| 282 | ############################################################################## |
| 283 |
+5
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -1,10 +1,13 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | ** This file contains code used to bridge the TH1 and Tcl scripting languages. |
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | 5 | #include "config.h" |
| 6 | + | |
| 7 | +#ifdef FOSSIL_ENABLE_TCL | |
| 8 | + | |
| 6 | 9 | #include "th.h" |
| 7 | 10 | #include "tcl.h" |
| 8 | 11 | |
| 9 | 12 | /* |
| 10 | 13 | ** Are we being compiled against Tcl 8.6 or higher? |
| @@ -418,5 +421,7 @@ | ||
| 418 | 421 | if( !ctx ) ctx = pContext; |
| 419 | 422 | Th_CreateCommand(interp, aCommand[i].zName, aCommand[i].xProc, ctx, 0); |
| 420 | 423 | } |
| 421 | 424 | return TH_OK; |
| 422 | 425 | } |
| 426 | + | |
| 427 | +#endif /* FOSSIL_ENABLE_TCL */ | |
| 423 | 428 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -1,10 +1,13 @@ | |
| 1 | /* |
| 2 | ** This file contains code used to bridge the TH1 and Tcl scripting languages. |
| 3 | */ |
| 4 | |
| 5 | #include "config.h" |
| 6 | #include "th.h" |
| 7 | #include "tcl.h" |
| 8 | |
| 9 | /* |
| 10 | ** Are we being compiled against Tcl 8.6 or higher? |
| @@ -418,5 +421,7 @@ | |
| 418 | if( !ctx ) ctx = pContext; |
| 419 | Th_CreateCommand(interp, aCommand[i].zName, aCommand[i].xProc, ctx, 0); |
| 420 | } |
| 421 | return TH_OK; |
| 422 | } |
| 423 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -1,10 +1,13 @@ | |
| 1 | /* |
| 2 | ** This file contains code used to bridge the TH1 and Tcl scripting languages. |
| 3 | */ |
| 4 | |
| 5 | #include "config.h" |
| 6 | |
| 7 | #ifdef FOSSIL_ENABLE_TCL |
| 8 | |
| 9 | #include "th.h" |
| 10 | #include "tcl.h" |
| 11 | |
| 12 | /* |
| 13 | ** Are we being compiled against Tcl 8.6 or higher? |
| @@ -418,5 +421,7 @@ | |
| 421 | if( !ctx ) ctx = pContext; |
| 422 | Th_CreateCommand(interp, aCommand[i].zName, aCommand[i].xProc, ctx, 0); |
| 423 | } |
| 424 | return TH_OK; |
| 425 | } |
| 426 | |
| 427 | #endif /* FOSSIL_ENABLE_TCL */ |
| 428 |