Fossil SCM
Merge the latest trunk changes into the symlinks branch.
Commit
24c16584cc6825e3f4c40c7b098d70272276c963
Parent
35de2bdd0729247…
15 files changed
+44
-11
+2
-2
+17
-2
+2
-1
+76
-18
+1
-1
+1
-1
+1
-1
+21
-3
+11
-5
+6
-2
+3
-2
+3
-2
+15
+7
+44
-11
| --- autosetup/autosetup | ||
| +++ autosetup/autosetup | ||
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | #!/bin/sh |
| 2 | 2 | # Copyright (c) 2006-2011 WorkWare Systems http://www.workware.net.au/ |
| 3 | 3 | # All rights reserved |
| 4 | 4 | # vim:se syntax=tcl: |
| 5 | 5 | # \ |
| 6 | -dir=`dirname "$0"`; exec `"$dir/find-tclsh" || echo false` "$0" "$@" | |
| 6 | +dir=`dirname "$0"`; exec "`$dir/find-tclsh`" "$0" "$@" | |
| 7 | 7 | |
| 8 | 8 | set autosetup(version) 0.6.2 |
| 9 | 9 | |
| 10 | 10 | # Can be set to 1 to debug early-init problems |
| 11 | 11 | set autosetup(debug) 0 |
| @@ -182,11 +182,11 @@ | ||
| 182 | 182 | |
| 183 | 183 | # @opt-bool option ... |
| 184 | 184 | # |
| 185 | 185 | # Check each of the named, boolean options and return 1 if any of them have |
| 186 | 186 | # been set by the user. |
| 187 | -# | |
| 187 | +# | |
| 188 | 188 | proc opt-bool {args} { |
| 189 | 189 | option-check-names {*}$args |
| 190 | 190 | opt_bool ::useropts {*}$args |
| 191 | 191 | } |
| 192 | 192 | |
| @@ -198,11 +198,11 @@ | ||
| 198 | 198 | # If only a single value is required, use something like: |
| 199 | 199 | # |
| 200 | 200 | ## lindex [opt-val $names] end |
| 201 | 201 | # |
| 202 | 202 | # If no options were set, $default is returned (exactly, not as a list). |
| 203 | -# | |
| 203 | +# | |
| 204 | 204 | proc opt-val {names {default ""}} { |
| 205 | 205 | option-check-names {*}$names |
| 206 | 206 | join [opt_val ::useropts $names $default] |
| 207 | 207 | } |
| 208 | 208 | |
| @@ -396,11 +396,11 @@ | ||
| 396 | 396 | # These options are not displayed with --help and can be useful for internal options or as aliases. |
| 397 | 397 | # |
| 398 | 398 | # For example, --disable-lfs is an alias for --disable=largefile: |
| 399 | 399 | # |
| 400 | 400 | ## lfs=1 largefile=1 => "Disable large file support" |
| 401 | -# | |
| 401 | +# | |
| 402 | 402 | proc options {optlist} { |
| 403 | 403 | # Allow options as a list or args |
| 404 | 404 | options-add $optlist "Local Options:" |
| 405 | 405 | |
| 406 | 406 | if {$::autosetup(showhelp)} { |
| @@ -434,11 +434,11 @@ | ||
| 434 | 434 | return $alias |
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | # @define name ?value=1? |
| 439 | -# | |
| 439 | +# | |
| 440 | 440 | # Defines the named variable to the given value. |
| 441 | 441 | # These (name, value) pairs represent the results of the configuration check |
| 442 | 442 | # and are available to be checked, modified and substituted. |
| 443 | 443 | # |
| 444 | 444 | proc define {name {value 1}} { |
| @@ -564,10 +564,40 @@ | ||
| 564 | 564 | foreach arg $argv { |
| 565 | 565 | lappend args [quote-if-needed $arg] |
| 566 | 566 | } |
| 567 | 567 | join $args |
| 568 | 568 | } |
| 569 | + | |
| 570 | +# @suffix suf list | |
| 571 | +# | |
| 572 | +# Takes a list and returns a new list with $suf appended | |
| 573 | +# to each element | |
| 574 | +# | |
| 575 | +## suffix .c {a b c} => {a.c b.c c.c} | |
| 576 | +# | |
| 577 | +proc suffix {suf list} { | |
| 578 | + set result {} | |
| 579 | + foreach p $list { | |
| 580 | + lappend result $p$suf | |
| 581 | + } | |
| 582 | + return $result | |
| 583 | +} | |
| 584 | + | |
| 585 | +# @prefix pre list | |
| 586 | +# | |
| 587 | +# Takes a list and returns a new list with $pre prepended | |
| 588 | +# to each element | |
| 589 | +# | |
| 590 | +## prefix jim- {a.c b.c} => {jim-a.c jim-b.c} | |
| 591 | +# | |
| 592 | +proc prefix {pre list} { | |
| 593 | + set result {} | |
| 594 | + foreach p $list { | |
| 595 | + lappend result $pre$p | |
| 596 | + } | |
| 597 | + return $result | |
| 598 | +} | |
| 569 | 599 | |
| 570 | 600 | # @find-executable name |
| 571 | 601 | # |
| 572 | 602 | # Searches the path for an executable with the given name. |
| 573 | 603 | # Note that the name may include some parameters, e.g. "cc -mbig-endian", |
| @@ -999,21 +1029,24 @@ | ||
| 999 | 1029 | |
| 1000 | 1030 | # Simple getopt module |
| 1001 | 1031 | |
| 1002 | 1032 | # Parse everything out of the argv list which looks like an option |
| 1003 | 1033 | # Knows about --enable-thing and --disable-thing as alternatives for --thing=0 or --thing=1 |
| 1034 | +# Everything which doesn't look like an option, or is after --, is left unchanged | |
| 1004 | 1035 | proc getopt {argvname} { |
| 1005 | 1036 | upvar $argvname argv |
| 1037 | + set nargv {} | |
| 1006 | 1038 | |
| 1007 | 1039 | for {set i 0} {$i < [llength $argv]} {incr i} { |
| 1008 | 1040 | set arg [lindex $argv $i] |
| 1009 | 1041 | |
| 1010 | 1042 | #dputs arg=$arg |
| 1011 | 1043 | |
| 1012 | 1044 | if {$arg eq "--"} { |
| 1013 | 1045 | # End of options |
| 1014 | 1046 | incr i |
| 1047 | + lappend nargv {*}[lrange $argv $i end] | |
| 1015 | 1048 | break |
| 1016 | 1049 | } |
| 1017 | 1050 | |
| 1018 | 1051 | if {[regexp {^--([^=][^=]+)=(.*)$} $arg -> name value]} { |
| 1019 | 1052 | lappend opts($name) $value |
| @@ -1023,18 +1056,18 @@ | ||
| 1023 | 1056 | } else { |
| 1024 | 1057 | set value 1 |
| 1025 | 1058 | } |
| 1026 | 1059 | lappend opts($name) $value |
| 1027 | 1060 | } else { |
| 1028 | - break | |
| 1061 | + lappend nargv $arg | |
| 1029 | 1062 | } |
| 1030 | 1063 | } |
| 1031 | 1064 | |
| 1032 | - #puts "getopt: argv=[join $argv] => [join [lrange $argv $i end]]" | |
| 1065 | + #puts "getopt: argv=[join $argv] => [join $nargv]" | |
| 1033 | 1066 | #parray opts |
| 1034 | 1067 | |
| 1035 | - set argv [lrange $argv $i end] | |
| 1068 | + set argv $nargv | |
| 1036 | 1069 | |
| 1037 | 1070 | return [array get opts] |
| 1038 | 1071 | } |
| 1039 | 1072 | |
| 1040 | 1073 | proc opt_val {optarrayname options {default {}}} { |
| @@ -1264,11 +1297,11 @@ | ||
| 1264 | 1297 | writefile configure "#!/bin/sh\nWRAPPER=\"\$0\" exec $::autosetup(dir)/autosetup \"\$@\"\n" |
| 1265 | 1298 | } else { |
| 1266 | 1299 | writefile configure \ |
| 1267 | 1300 | {#!/bin/sh |
| 1268 | 1301 | dir="`dirname "$0"`/autosetup" |
| 1269 | -WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@" | |
| 1302 | +WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@" | |
| 1270 | 1303 | } |
| 1271 | 1304 | } |
| 1272 | 1305 | catch {exec chmod 755 configure} |
| 1273 | 1306 | } |
| 1274 | 1307 | if {![file exists auto.def]} { |
| @@ -1279,11 +1312,11 @@ | ||
| 1279 | 1312 | |
| 1280 | 1313 | # Add any user options here |
| 1281 | 1314 | options { |
| 1282 | 1315 | } |
| 1283 | 1316 | |
| 1284 | -make-autoconf-h config.h | |
| 1317 | +make-config-header config.h | |
| 1285 | 1318 | make-template Makefile.in |
| 1286 | 1319 | } |
| 1287 | 1320 | } |
| 1288 | 1321 | if {![file exists Makefile.in]} { |
| 1289 | 1322 | puts "Note: I don't see Makefile.in. You will probably need to create one." |
| @@ -1511,11 +1544,11 @@ | ||
| 1511 | 1544 | string map {\\ /} [env $name {*}$args] |
| 1512 | 1545 | } |
| 1513 | 1546 | # Jim uses system() for exec under mingw, so |
| 1514 | 1547 | # we need to fetch the output ourselves |
| 1515 | 1548 | proc exec-with-stderr {args} { |
| 1516 | - set tmpfile /tmp/autosetup.[format %05x [rand 10000]].tmp | |
| 1549 | + set tmpfile auto[format %04x [rand 10000]].tmp | |
| 1517 | 1550 | set rc [catch [list exec {*}$args >$tmpfile 2>&1] result] |
| 1518 | 1551 | set result [readfile $tmpfile] |
| 1519 | 1552 | file delete $tmpfile |
| 1520 | 1553 | return -code $rc $result |
| 1521 | 1554 | } |
| 1522 | 1555 |
| --- autosetup/autosetup | |
| +++ autosetup/autosetup | |
| @@ -1,11 +1,11 @@ | |
| 1 | #!/bin/sh |
| 2 | # Copyright (c) 2006-2011 WorkWare Systems http://www.workware.net.au/ |
| 3 | # All rights reserved |
| 4 | # vim:se syntax=tcl: |
| 5 | # \ |
| 6 | dir=`dirname "$0"`; exec `"$dir/find-tclsh" || echo false` "$0" "$@" |
| 7 | |
| 8 | set autosetup(version) 0.6.2 |
| 9 | |
| 10 | # Can be set to 1 to debug early-init problems |
| 11 | set autosetup(debug) 0 |
| @@ -182,11 +182,11 @@ | |
| 182 | |
| 183 | # @opt-bool option ... |
| 184 | # |
| 185 | # Check each of the named, boolean options and return 1 if any of them have |
| 186 | # been set by the user. |
| 187 | # |
| 188 | proc opt-bool {args} { |
| 189 | option-check-names {*}$args |
| 190 | opt_bool ::useropts {*}$args |
| 191 | } |
| 192 | |
| @@ -198,11 +198,11 @@ | |
| 198 | # If only a single value is required, use something like: |
| 199 | # |
| 200 | ## lindex [opt-val $names] end |
| 201 | # |
| 202 | # If no options were set, $default is returned (exactly, not as a list). |
| 203 | # |
| 204 | proc opt-val {names {default ""}} { |
| 205 | option-check-names {*}$names |
| 206 | join [opt_val ::useropts $names $default] |
| 207 | } |
| 208 | |
| @@ -396,11 +396,11 @@ | |
| 396 | # These options are not displayed with --help and can be useful for internal options or as aliases. |
| 397 | # |
| 398 | # For example, --disable-lfs is an alias for --disable=largefile: |
| 399 | # |
| 400 | ## lfs=1 largefile=1 => "Disable large file support" |
| 401 | # |
| 402 | proc options {optlist} { |
| 403 | # Allow options as a list or args |
| 404 | options-add $optlist "Local Options:" |
| 405 | |
| 406 | if {$::autosetup(showhelp)} { |
| @@ -434,11 +434,11 @@ | |
| 434 | return $alias |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | # @define name ?value=1? |
| 439 | # |
| 440 | # Defines the named variable to the given value. |
| 441 | # These (name, value) pairs represent the results of the configuration check |
| 442 | # and are available to be checked, modified and substituted. |
| 443 | # |
| 444 | proc define {name {value 1}} { |
| @@ -564,10 +564,40 @@ | |
| 564 | foreach arg $argv { |
| 565 | lappend args [quote-if-needed $arg] |
| 566 | } |
| 567 | join $args |
| 568 | } |
| 569 | |
| 570 | # @find-executable name |
| 571 | # |
| 572 | # Searches the path for an executable with the given name. |
| 573 | # Note that the name may include some parameters, e.g. "cc -mbig-endian", |
| @@ -999,21 +1029,24 @@ | |
| 999 | |
| 1000 | # Simple getopt module |
| 1001 | |
| 1002 | # Parse everything out of the argv list which looks like an option |
| 1003 | # Knows about --enable-thing and --disable-thing as alternatives for --thing=0 or --thing=1 |
| 1004 | proc getopt {argvname} { |
| 1005 | upvar $argvname argv |
| 1006 | |
| 1007 | for {set i 0} {$i < [llength $argv]} {incr i} { |
| 1008 | set arg [lindex $argv $i] |
| 1009 | |
| 1010 | #dputs arg=$arg |
| 1011 | |
| 1012 | if {$arg eq "--"} { |
| 1013 | # End of options |
| 1014 | incr i |
| 1015 | break |
| 1016 | } |
| 1017 | |
| 1018 | if {[regexp {^--([^=][^=]+)=(.*)$} $arg -> name value]} { |
| 1019 | lappend opts($name) $value |
| @@ -1023,18 +1056,18 @@ | |
| 1023 | } else { |
| 1024 | set value 1 |
| 1025 | } |
| 1026 | lappend opts($name) $value |
| 1027 | } else { |
| 1028 | break |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | #puts "getopt: argv=[join $argv] => [join [lrange $argv $i end]]" |
| 1033 | #parray opts |
| 1034 | |
| 1035 | set argv [lrange $argv $i end] |
| 1036 | |
| 1037 | return [array get opts] |
| 1038 | } |
| 1039 | |
| 1040 | proc opt_val {optarrayname options {default {}}} { |
| @@ -1264,11 +1297,11 @@ | |
| 1264 | writefile configure "#!/bin/sh\nWRAPPER=\"\$0\" exec $::autosetup(dir)/autosetup \"\$@\"\n" |
| 1265 | } else { |
| 1266 | writefile configure \ |
| 1267 | {#!/bin/sh |
| 1268 | dir="`dirname "$0"`/autosetup" |
| 1269 | WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@" |
| 1270 | } |
| 1271 | } |
| 1272 | catch {exec chmod 755 configure} |
| 1273 | } |
| 1274 | if {![file exists auto.def]} { |
| @@ -1279,11 +1312,11 @@ | |
| 1279 | |
| 1280 | # Add any user options here |
| 1281 | options { |
| 1282 | } |
| 1283 | |
| 1284 | make-autoconf-h config.h |
| 1285 | make-template Makefile.in |
| 1286 | } |
| 1287 | } |
| 1288 | if {![file exists Makefile.in]} { |
| 1289 | puts "Note: I don't see Makefile.in. You will probably need to create one." |
| @@ -1511,11 +1544,11 @@ | |
| 1511 | string map {\\ /} [env $name {*}$args] |
| 1512 | } |
| 1513 | # Jim uses system() for exec under mingw, so |
| 1514 | # we need to fetch the output ourselves |
| 1515 | proc exec-with-stderr {args} { |
| 1516 | set tmpfile /tmp/autosetup.[format %05x [rand 10000]].tmp |
| 1517 | set rc [catch [list exec {*}$args >$tmpfile 2>&1] result] |
| 1518 | set result [readfile $tmpfile] |
| 1519 | file delete $tmpfile |
| 1520 | return -code $rc $result |
| 1521 | } |
| 1522 |
| --- autosetup/autosetup | |
| +++ autosetup/autosetup | |
| @@ -1,11 +1,11 @@ | |
| 1 | #!/bin/sh |
| 2 | # Copyright (c) 2006-2011 WorkWare Systems http://www.workware.net.au/ |
| 3 | # All rights reserved |
| 4 | # vim:se syntax=tcl: |
| 5 | # \ |
| 6 | dir=`dirname "$0"`; exec "`$dir/find-tclsh`" "$0" "$@" |
| 7 | |
| 8 | set autosetup(version) 0.6.2 |
| 9 | |
| 10 | # Can be set to 1 to debug early-init problems |
| 11 | set autosetup(debug) 0 |
| @@ -182,11 +182,11 @@ | |
| 182 | |
| 183 | # @opt-bool option ... |
| 184 | # |
| 185 | # Check each of the named, boolean options and return 1 if any of them have |
| 186 | # been set by the user. |
| 187 | # |
| 188 | proc opt-bool {args} { |
| 189 | option-check-names {*}$args |
| 190 | opt_bool ::useropts {*}$args |
| 191 | } |
| 192 | |
| @@ -198,11 +198,11 @@ | |
| 198 | # If only a single value is required, use something like: |
| 199 | # |
| 200 | ## lindex [opt-val $names] end |
| 201 | # |
| 202 | # If no options were set, $default is returned (exactly, not as a list). |
| 203 | # |
| 204 | proc opt-val {names {default ""}} { |
| 205 | option-check-names {*}$names |
| 206 | join [opt_val ::useropts $names $default] |
| 207 | } |
| 208 | |
| @@ -396,11 +396,11 @@ | |
| 396 | # These options are not displayed with --help and can be useful for internal options or as aliases. |
| 397 | # |
| 398 | # For example, --disable-lfs is an alias for --disable=largefile: |
| 399 | # |
| 400 | ## lfs=1 largefile=1 => "Disable large file support" |
| 401 | # |
| 402 | proc options {optlist} { |
| 403 | # Allow options as a list or args |
| 404 | options-add $optlist "Local Options:" |
| 405 | |
| 406 | if {$::autosetup(showhelp)} { |
| @@ -434,11 +434,11 @@ | |
| 434 | return $alias |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | # @define name ?value=1? |
| 439 | # |
| 440 | # Defines the named variable to the given value. |
| 441 | # These (name, value) pairs represent the results of the configuration check |
| 442 | # and are available to be checked, modified and substituted. |
| 443 | # |
| 444 | proc define {name {value 1}} { |
| @@ -564,10 +564,40 @@ | |
| 564 | foreach arg $argv { |
| 565 | lappend args [quote-if-needed $arg] |
| 566 | } |
| 567 | join $args |
| 568 | } |
| 569 | |
| 570 | # @suffix suf list |
| 571 | # |
| 572 | # Takes a list and returns a new list with $suf appended |
| 573 | # to each element |
| 574 | # |
| 575 | ## suffix .c {a b c} => {a.c b.c c.c} |
| 576 | # |
| 577 | proc suffix {suf list} { |
| 578 | set result {} |
| 579 | foreach p $list { |
| 580 | lappend result $p$suf |
| 581 | } |
| 582 | return $result |
| 583 | } |
| 584 | |
| 585 | # @prefix pre list |
| 586 | # |
| 587 | # Takes a list and returns a new list with $pre prepended |
| 588 | # to each element |
| 589 | # |
| 590 | ## prefix jim- {a.c b.c} => {jim-a.c jim-b.c} |
| 591 | # |
| 592 | proc prefix {pre list} { |
| 593 | set result {} |
| 594 | foreach p $list { |
| 595 | lappend result $pre$p |
| 596 | } |
| 597 | return $result |
| 598 | } |
| 599 | |
| 600 | # @find-executable name |
| 601 | # |
| 602 | # Searches the path for an executable with the given name. |
| 603 | # Note that the name may include some parameters, e.g. "cc -mbig-endian", |
| @@ -999,21 +1029,24 @@ | |
| 1029 | |
| 1030 | # Simple getopt module |
| 1031 | |
| 1032 | # Parse everything out of the argv list which looks like an option |
| 1033 | # Knows about --enable-thing and --disable-thing as alternatives for --thing=0 or --thing=1 |
| 1034 | # Everything which doesn't look like an option, or is after --, is left unchanged |
| 1035 | proc getopt {argvname} { |
| 1036 | upvar $argvname argv |
| 1037 | set nargv {} |
| 1038 | |
| 1039 | for {set i 0} {$i < [llength $argv]} {incr i} { |
| 1040 | set arg [lindex $argv $i] |
| 1041 | |
| 1042 | #dputs arg=$arg |
| 1043 | |
| 1044 | if {$arg eq "--"} { |
| 1045 | # End of options |
| 1046 | incr i |
| 1047 | lappend nargv {*}[lrange $argv $i end] |
| 1048 | break |
| 1049 | } |
| 1050 | |
| 1051 | if {[regexp {^--([^=][^=]+)=(.*)$} $arg -> name value]} { |
| 1052 | lappend opts($name) $value |
| @@ -1023,18 +1056,18 @@ | |
| 1056 | } else { |
| 1057 | set value 1 |
| 1058 | } |
| 1059 | lappend opts($name) $value |
| 1060 | } else { |
| 1061 | lappend nargv $arg |
| 1062 | } |
| 1063 | } |
| 1064 | |
| 1065 | #puts "getopt: argv=[join $argv] => [join $nargv]" |
| 1066 | #parray opts |
| 1067 | |
| 1068 | set argv $nargv |
| 1069 | |
| 1070 | return [array get opts] |
| 1071 | } |
| 1072 | |
| 1073 | proc opt_val {optarrayname options {default {}}} { |
| @@ -1264,11 +1297,11 @@ | |
| 1297 | writefile configure "#!/bin/sh\nWRAPPER=\"\$0\" exec $::autosetup(dir)/autosetup \"\$@\"\n" |
| 1298 | } else { |
| 1299 | writefile configure \ |
| 1300 | {#!/bin/sh |
| 1301 | dir="`dirname "$0"`/autosetup" |
| 1302 | WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@" |
| 1303 | } |
| 1304 | } |
| 1305 | catch {exec chmod 755 configure} |
| 1306 | } |
| 1307 | if {![file exists auto.def]} { |
| @@ -1279,11 +1312,11 @@ | |
| 1312 | |
| 1313 | # Add any user options here |
| 1314 | options { |
| 1315 | } |
| 1316 | |
| 1317 | make-config-header config.h |
| 1318 | make-template Makefile.in |
| 1319 | } |
| 1320 | } |
| 1321 | if {![file exists Makefile.in]} { |
| 1322 | puts "Note: I don't see Makefile.in. You will probably need to create one." |
| @@ -1511,11 +1544,11 @@ | |
| 1544 | string map {\\ /} [env $name {*}$args] |
| 1545 | } |
| 1546 | # Jim uses system() for exec under mingw, so |
| 1547 | # we need to fetch the output ourselves |
| 1548 | proc exec-with-stderr {args} { |
| 1549 | set tmpfile auto[format %04x [rand 10000]].tmp |
| 1550 | set rc [catch [list exec {*}$args >$tmpfile 2>&1] result] |
| 1551 | set result [readfile $tmpfile] |
| 1552 | file delete $tmpfile |
| 1553 | return -code $rc $result |
| 1554 | } |
| 1555 |
+2
-2
| --- autosetup/cc-lib.tcl | ||
| +++ autosetup/cc-lib.tcl | ||
| @@ -48,21 +48,21 @@ | ||
| 48 | 48 | cc-check-includes sys/types.h sys/param.h |
| 49 | 49 | set rc 0 |
| 50 | 50 | msg-checking "Checking endian..." |
| 51 | 51 | cc-with {-includes {sys/types.h sys/param.h}} { |
| 52 | 52 | if {[cctest -code { |
| 53 | - #if! defined(BIG_ENDIAN) || !defined(BYTE_ORDER) | |
| 53 | + #if !defined(BIG_ENDIAN) || !defined(BYTE_ORDER) | |
| 54 | 54 | #error unknown |
| 55 | 55 | #elif BYTE_ORDER != BIG_ENDIAN |
| 56 | 56 | #error little |
| 57 | 57 | #endif |
| 58 | 58 | }]} { |
| 59 | 59 | define-feature big-endian |
| 60 | 60 | msg-result "big" |
| 61 | 61 | set rc 1 |
| 62 | 62 | } elseif {[cctest -code { |
| 63 | - #if! defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER) | |
| 63 | + #if !defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER) | |
| 64 | 64 | #error unknown |
| 65 | 65 | #elif BYTE_ORDER != LITTLE_ENDIAN |
| 66 | 66 | #error big |
| 67 | 67 | #endif |
| 68 | 68 | }]} { |
| 69 | 69 |
| --- autosetup/cc-lib.tcl | |
| +++ autosetup/cc-lib.tcl | |
| @@ -48,21 +48,21 @@ | |
| 48 | cc-check-includes sys/types.h sys/param.h |
| 49 | set rc 0 |
| 50 | msg-checking "Checking endian..." |
| 51 | cc-with {-includes {sys/types.h sys/param.h}} { |
| 52 | if {[cctest -code { |
| 53 | #if! defined(BIG_ENDIAN) || !defined(BYTE_ORDER) |
| 54 | #error unknown |
| 55 | #elif BYTE_ORDER != BIG_ENDIAN |
| 56 | #error little |
| 57 | #endif |
| 58 | }]} { |
| 59 | define-feature big-endian |
| 60 | msg-result "big" |
| 61 | set rc 1 |
| 62 | } elseif {[cctest -code { |
| 63 | #if! defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER) |
| 64 | #error unknown |
| 65 | #elif BYTE_ORDER != LITTLE_ENDIAN |
| 66 | #error big |
| 67 | #endif |
| 68 | }]} { |
| 69 |
| --- autosetup/cc-lib.tcl | |
| +++ autosetup/cc-lib.tcl | |
| @@ -48,21 +48,21 @@ | |
| 48 | cc-check-includes sys/types.h sys/param.h |
| 49 | set rc 0 |
| 50 | msg-checking "Checking endian..." |
| 51 | cc-with {-includes {sys/types.h sys/param.h}} { |
| 52 | if {[cctest -code { |
| 53 | #if !defined(BIG_ENDIAN) || !defined(BYTE_ORDER) |
| 54 | #error unknown |
| 55 | #elif BYTE_ORDER != BIG_ENDIAN |
| 56 | #error little |
| 57 | #endif |
| 58 | }]} { |
| 59 | define-feature big-endian |
| 60 | msg-result "big" |
| 61 | set rc 1 |
| 62 | } elseif {[cctest -code { |
| 63 | #if !defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER) |
| 64 | #error unknown |
| 65 | #elif BYTE_ORDER != LITTLE_ENDIAN |
| 66 | #error big |
| 67 | #endif |
| 68 | }]} { |
| 69 |
+17
-2
| --- autosetup/cc-shared.tcl | ||
| +++ autosetup/cc-shared.tcl | ||
| @@ -35,14 +35,29 @@ | ||
| 35 | 35 | } |
| 36 | 36 | *-*-cygwin { |
| 37 | 37 | define SH_LDFLAGS -shared |
| 38 | 38 | define SHOBJ_LDFLAGS -shared |
| 39 | 39 | } |
| 40 | + *-*-solaris* { | |
| 41 | + # XXX: These haven't been fully tested. | |
| 42 | + #define SH_LINKFLAGS -Wl,-export-dynamic | |
| 43 | + define SH_CFLAGS -Kpic | |
| 44 | + define SHOBJ_CFLAGS -Kpic | |
| 45 | + define SHOBJ_LDFLAGS "-G" | |
| 46 | + } | |
| 47 | + *-*-hpux { | |
| 48 | + # XXX: These haven't been tested | |
| 49 | + define SH_LINKFLAGS -Wl,+s | |
| 50 | + define SH_CFLAGS +z | |
| 51 | + define SHOBJ_CFLAGS "+O3 +z" | |
| 52 | + define SHOBJ_LDFLAGS -b | |
| 53 | + define LD_LIBRARY_PATH SHLIB_PATH | |
| 54 | + } | |
| 40 | 55 | * { |
| 41 | 56 | # Generic Unix settings |
| 42 | 57 | define SH_LINKFLAGS -rdynamic |
| 43 | - define SH_CFLAGS -fPIC | |
| 58 | + define SH_CFLAGS -fpic | |
| 44 | 59 | define SH_LDFLAGS -shared |
| 45 | - define SHOBJ_CFLAGS -fPIC | |
| 60 | + define SHOBJ_CFLAGS -fpic | |
| 46 | 61 | define SHOBJ_LDFLAGS "-shared -nostartfiles" |
| 47 | 62 | } |
| 48 | 63 | } |
| 49 | 64 |
| --- autosetup/cc-shared.tcl | |
| +++ autosetup/cc-shared.tcl | |
| @@ -35,14 +35,29 @@ | |
| 35 | } |
| 36 | *-*-cygwin { |
| 37 | define SH_LDFLAGS -shared |
| 38 | define SHOBJ_LDFLAGS -shared |
| 39 | } |
| 40 | * { |
| 41 | # Generic Unix settings |
| 42 | define SH_LINKFLAGS -rdynamic |
| 43 | define SH_CFLAGS -fPIC |
| 44 | define SH_LDFLAGS -shared |
| 45 | define SHOBJ_CFLAGS -fPIC |
| 46 | define SHOBJ_LDFLAGS "-shared -nostartfiles" |
| 47 | } |
| 48 | } |
| 49 |
| --- autosetup/cc-shared.tcl | |
| +++ autosetup/cc-shared.tcl | |
| @@ -35,14 +35,29 @@ | |
| 35 | } |
| 36 | *-*-cygwin { |
| 37 | define SH_LDFLAGS -shared |
| 38 | define SHOBJ_LDFLAGS -shared |
| 39 | } |
| 40 | *-*-solaris* { |
| 41 | # XXX: These haven't been fully tested. |
| 42 | #define SH_LINKFLAGS -Wl,-export-dynamic |
| 43 | define SH_CFLAGS -Kpic |
| 44 | define SHOBJ_CFLAGS -Kpic |
| 45 | define SHOBJ_LDFLAGS "-G" |
| 46 | } |
| 47 | *-*-hpux { |
| 48 | # XXX: These haven't been tested |
| 49 | define SH_LINKFLAGS -Wl,+s |
| 50 | define SH_CFLAGS +z |
| 51 | define SHOBJ_CFLAGS "+O3 +z" |
| 52 | define SHOBJ_LDFLAGS -b |
| 53 | define LD_LIBRARY_PATH SHLIB_PATH |
| 54 | } |
| 55 | * { |
| 56 | # Generic Unix settings |
| 57 | define SH_LINKFLAGS -rdynamic |
| 58 | define SH_CFLAGS -fpic |
| 59 | define SH_LDFLAGS -shared |
| 60 | define SHOBJ_CFLAGS -fpic |
| 61 | define SHOBJ_LDFLAGS "-shared -nostartfiles" |
| 62 | } |
| 63 | } |
| 64 |
+2
-1
| --- autosetup/cc.tcl | ||
| +++ autosetup/cc.tcl | ||
| @@ -416,11 +416,11 @@ | ||
| 416 | 416 | # |
| 417 | 417 | # Any failures are recorded in 'config.log' |
| 418 | 418 | # |
| 419 | 419 | proc cctest {args} { |
| 420 | 420 | set src conftest__.c |
| 421 | - set tmp conftest__.o | |
| 421 | + set tmp conftest__ | |
| 422 | 422 | |
| 423 | 423 | # Easiest way to merge in the settings |
| 424 | 424 | cc-with $args { |
| 425 | 425 | array set opts [cc-get-settings] |
| 426 | 426 | } |
| @@ -468,10 +468,11 @@ | ||
| 468 | 468 | autosetup-error "cctest called with unknown language: $opts(-lang)" |
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | if {!$opts(-link)} { |
| 473 | + set tmp conftest__.o | |
| 473 | 474 | lappend cmdline -c |
| 474 | 475 | } |
| 475 | 476 | lappend cmdline {*}$opts(-cflags) |
| 476 | 477 | |
| 477 | 478 | switch -glob -- [get-define host] { |
| 478 | 479 |
| --- autosetup/cc.tcl | |
| +++ autosetup/cc.tcl | |
| @@ -416,11 +416,11 @@ | |
| 416 | # |
| 417 | # Any failures are recorded in 'config.log' |
| 418 | # |
| 419 | proc cctest {args} { |
| 420 | set src conftest__.c |
| 421 | set tmp conftest__.o |
| 422 | |
| 423 | # Easiest way to merge in the settings |
| 424 | cc-with $args { |
| 425 | array set opts [cc-get-settings] |
| 426 | } |
| @@ -468,10 +468,11 @@ | |
| 468 | autosetup-error "cctest called with unknown language: $opts(-lang)" |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | if {!$opts(-link)} { |
| 473 | lappend cmdline -c |
| 474 | } |
| 475 | lappend cmdline {*}$opts(-cflags) |
| 476 | |
| 477 | switch -glob -- [get-define host] { |
| 478 |
| --- autosetup/cc.tcl | |
| +++ autosetup/cc.tcl | |
| @@ -416,11 +416,11 @@ | |
| 416 | # |
| 417 | # Any failures are recorded in 'config.log' |
| 418 | # |
| 419 | proc cctest {args} { |
| 420 | set src conftest__.c |
| 421 | set tmp conftest__ |
| 422 | |
| 423 | # Easiest way to merge in the settings |
| 424 | cc-with $args { |
| 425 | array set opts [cc-get-settings] |
| 426 | } |
| @@ -468,10 +468,11 @@ | |
| 468 | autosetup-error "cctest called with unknown language: $opts(-lang)" |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | if {!$opts(-link)} { |
| 473 | set tmp conftest__.o |
| 474 | lappend cmdline -c |
| 475 | } |
| 476 | lappend cmdline {*}$opts(-cflags) |
| 477 | |
| 478 | switch -glob -- [get-define host] { |
| 479 |
+76
-18
| --- autosetup/system.tcl | ||
| +++ autosetup/system.tcl | ||
| @@ -6,28 +6,32 @@ | ||
| 6 | 6 | # This module supports common system interrogation and options |
| 7 | 7 | # such as --host, --build, --prefix, and setting srcdir, builddir, and EXEXT. |
| 8 | 8 | # |
| 9 | 9 | # It also support the 'feature' naming convention, where searching |
| 10 | 10 | # for a feature such as sys/type.h defines HAVE_SYS_TYPES_H |
| 11 | - | |
| 12 | -# Note that the hidden options are supported for autoconf compatibility | |
| 13 | - | |
| 11 | +# | |
| 14 | 12 | module-options { |
| 15 | 13 | host:host-alias => {a complete or partial cpu-vendor-opsys for the system where |
| 16 | 14 | the application will run (defaults to the same value as --build)} |
| 17 | 15 | build:build-alias => {a complete or partial cpu-vendor-opsys for the system |
| 18 | 16 | where the application will be built (defaults to the |
| 19 | 17 | result of running config.guess)} |
| 20 | 18 | prefix:dir => {the target directory for the build (defaults to /usr/local)} |
| 21 | 19 | |
| 20 | + # These (hidden) options are supported for autoconf/automake compatibility | |
| 21 | + exec-prefix: | |
| 22 | + bindir: | |
| 23 | + sbindir: | |
| 22 | 24 | includedir: |
| 23 | 25 | mandir: |
| 24 | 26 | infodir: |
| 25 | 27 | libexecdir: |
| 28 | + datadir: | |
| 29 | + libdir: | |
| 26 | 30 | sysconfdir: |
| 31 | + sharedstatedir: | |
| 27 | 32 | localstatedir: |
| 28 | - | |
| 29 | 33 | maintainer-mode=0 |
| 30 | 34 | dependency-tracking=0 |
| 31 | 35 | } |
| 32 | 36 | |
| 33 | 37 | # Returns 1 if exists, or 0 if not |
| @@ -107,10 +111,28 @@ | ||
| 107 | 111 | # |
| 108 | 112 | # The special value @srcdir@ is subsituted with the relative |
| 109 | 113 | # path to the source directory from the directory where the output |
| 110 | 114 | # file is created. Use @top_srcdir@ for the absolute path. |
| 111 | 115 | # |
| 116 | +# Conditional sections may be specified as follows: | |
| 117 | +## @if name == value | |
| 118 | +## lines | |
| 119 | +## @else | |
| 120 | +## lines | |
| 121 | +## @endif | |
| 122 | +# | |
| 123 | +# Where 'name' is a defined variable name and @else is optional. | |
| 124 | +# If the expression does not match, all lines through '@endif' are ignored. | |
| 125 | +# | |
| 126 | +# The alternative forms may also be used: | |
| 127 | +## @if name | |
| 128 | +## @if name != value | |
| 129 | +# | |
| 130 | +# Where the first form is true if the variable is defined, but not empty or 0 | |
| 131 | +# | |
| 132 | +# Currently these expressions can't be nested. | |
| 133 | +# | |
| 112 | 134 | proc make-template {template {out {}}} { |
| 113 | 135 | set infile [file join $::autosetup(srcdir) $template] |
| 114 | 136 | |
| 115 | 137 | if {![file exists $infile]} { |
| 116 | 138 | user-error "Template $template is missing" |
| @@ -136,11 +158,43 @@ | ||
| 136 | 158 | |
| 137 | 159 | set mapping {} |
| 138 | 160 | foreach {n v} [array get ::define] { |
| 139 | 161 | lappend mapping @$n@ $v |
| 140 | 162 | } |
| 141 | - writefile $out [string map $mapping [readfile $infile]]\n | |
| 163 | + set result {} | |
| 164 | + foreach line [split [readfile $infile] \n] { | |
| 165 | + if {[info exists cond]} { | |
| 166 | + set l [string trimright $line] | |
| 167 | + if {$l eq "@endif"} { | |
| 168 | + unset cond | |
| 169 | + continue | |
| 170 | + } | |
| 171 | + if {$l eq "@else"} { | |
| 172 | + set cond [expr {!$cond}] | |
| 173 | + continue | |
| 174 | + } | |
| 175 | + if {$cond} { | |
| 176 | + lappend result $line | |
| 177 | + } | |
| 178 | + continue | |
| 179 | + } | |
| 180 | + if {[regexp {^@if\s+(\w+)(.*)} $line -> name expression]} { | |
| 181 | + lassign $expression equal value | |
| 182 | + set varval [get-define $name ""] | |
| 183 | + if {$equal eq ""} { | |
| 184 | + set cond [expr {$varval ni {"" 0}}] | |
| 185 | + } else { | |
| 186 | + set cond [expr {$varval eq $value}] | |
| 187 | + if {$equal ne "=="} { | |
| 188 | + set cond [expr {!$cond}] | |
| 189 | + } | |
| 190 | + } | |
| 191 | + continue | |
| 192 | + } | |
| 193 | + lappend result $line | |
| 194 | + } | |
| 195 | + writefile $out [string map $mapping [join $result \n]]\n | |
| 142 | 196 | |
| 143 | 197 | msg-result "Created [relative-path $out] from [relative-path $template]" |
| 144 | 198 | } |
| 145 | 199 | |
| 146 | 200 | # build/host tuples and cross-compilation prefix |
| @@ -171,23 +225,27 @@ | ||
| 171 | 225 | define builddir $autosetup(builddir) |
| 172 | 226 | define srcdir $autosetup(srcdir) |
| 173 | 227 | # Allow this to come from the environment |
| 174 | 228 | define top_srcdir [get-env top_srcdir [get-define srcdir]] |
| 175 | 229 | |
| 176 | -# And less common ones too | |
| 177 | -define exec_prefix \${prefix} | |
| 178 | -define bindir \${exec_prefix}/bin | |
| 179 | -define sbindir \${exec_prefix}/sbin | |
| 180 | -define libexecdir [get-env libexecdir \${exec_prefix}/libexec] | |
| 181 | -define datadir \${prefix}/share | |
| 182 | -define sysconfdir [get-env sysconfdir \${prefix}/etc] | |
| 183 | -define sharedstatedir \${prefix}/com | |
| 184 | -define localstatedir [get-env localstatedir \${prefix}/var] | |
| 185 | -define libdir \${exec_prefix}/lib | |
| 186 | -define infodir [get-env infodir \${prefix}/share/info] | |
| 187 | -define mandir [get-env mandir \${prefix}/share/man] | |
| 188 | -define includedir [get-env includdir \${prefix}/include] | |
| 230 | +# autoconf supports all of these | |
| 231 | +define exec_prefix [opt-val exec-prefix [get-env exec-prefix \${prefix}]] | |
| 232 | +foreach {name defpath} { | |
| 233 | + bindir \${exec_prefix}/bin | |
| 234 | + sbindir \${exec_prefix}/sbin | |
| 235 | + libexecdir \${exec_prefix}/libexec | |
| 236 | + libdir \${exec_prefix}/lib | |
| 237 | + datadir \${prefix}/share | |
| 238 | + sysconfdir \${prefix}/etc | |
| 239 | + sharedstatedir \${prefix}/com | |
| 240 | + localstatedir \${prefix}/var | |
| 241 | + infodir \${prefix}/share/info | |
| 242 | + mandir \${prefix}/share/man | |
| 243 | + includedir \${prefix}/include | |
| 244 | +} { | |
| 245 | + define $name [opt-val $name [get-env $name $defpath]] | |
| 246 | +} | |
| 189 | 247 | |
| 190 | 248 | define SHELL [get-env SHELL [find-an-executable sh bash ksh]] |
| 191 | 249 | |
| 192 | 250 | # Windows vs. non-Windows |
| 193 | 251 | switch -glob -- [get-define host] { |
| 194 | 252 |
| --- autosetup/system.tcl | |
| +++ autosetup/system.tcl | |
| @@ -6,28 +6,32 @@ | |
| 6 | # This module supports common system interrogation and options |
| 7 | # such as --host, --build, --prefix, and setting srcdir, builddir, and EXEXT. |
| 8 | # |
| 9 | # It also support the 'feature' naming convention, where searching |
| 10 | # for a feature such as sys/type.h defines HAVE_SYS_TYPES_H |
| 11 | |
| 12 | # Note that the hidden options are supported for autoconf compatibility |
| 13 | |
| 14 | module-options { |
| 15 | host:host-alias => {a complete or partial cpu-vendor-opsys for the system where |
| 16 | the application will run (defaults to the same value as --build)} |
| 17 | build:build-alias => {a complete or partial cpu-vendor-opsys for the system |
| 18 | where the application will be built (defaults to the |
| 19 | result of running config.guess)} |
| 20 | prefix:dir => {the target directory for the build (defaults to /usr/local)} |
| 21 | |
| 22 | includedir: |
| 23 | mandir: |
| 24 | infodir: |
| 25 | libexecdir: |
| 26 | sysconfdir: |
| 27 | localstatedir: |
| 28 | |
| 29 | maintainer-mode=0 |
| 30 | dependency-tracking=0 |
| 31 | } |
| 32 | |
| 33 | # Returns 1 if exists, or 0 if not |
| @@ -107,10 +111,28 @@ | |
| 107 | # |
| 108 | # The special value @srcdir@ is subsituted with the relative |
| 109 | # path to the source directory from the directory where the output |
| 110 | # file is created. Use @top_srcdir@ for the absolute path. |
| 111 | # |
| 112 | proc make-template {template {out {}}} { |
| 113 | set infile [file join $::autosetup(srcdir) $template] |
| 114 | |
| 115 | if {![file exists $infile]} { |
| 116 | user-error "Template $template is missing" |
| @@ -136,11 +158,43 @@ | |
| 136 | |
| 137 | set mapping {} |
| 138 | foreach {n v} [array get ::define] { |
| 139 | lappend mapping @$n@ $v |
| 140 | } |
| 141 | writefile $out [string map $mapping [readfile $infile]]\n |
| 142 | |
| 143 | msg-result "Created [relative-path $out] from [relative-path $template]" |
| 144 | } |
| 145 | |
| 146 | # build/host tuples and cross-compilation prefix |
| @@ -171,23 +225,27 @@ | |
| 171 | define builddir $autosetup(builddir) |
| 172 | define srcdir $autosetup(srcdir) |
| 173 | # Allow this to come from the environment |
| 174 | define top_srcdir [get-env top_srcdir [get-define srcdir]] |
| 175 | |
| 176 | # And less common ones too |
| 177 | define exec_prefix \${prefix} |
| 178 | define bindir \${exec_prefix}/bin |
| 179 | define sbindir \${exec_prefix}/sbin |
| 180 | define libexecdir [get-env libexecdir \${exec_prefix}/libexec] |
| 181 | define datadir \${prefix}/share |
| 182 | define sysconfdir [get-env sysconfdir \${prefix}/etc] |
| 183 | define sharedstatedir \${prefix}/com |
| 184 | define localstatedir [get-env localstatedir \${prefix}/var] |
| 185 | define libdir \${exec_prefix}/lib |
| 186 | define infodir [get-env infodir \${prefix}/share/info] |
| 187 | define mandir [get-env mandir \${prefix}/share/man] |
| 188 | define includedir [get-env includdir \${prefix}/include] |
| 189 | |
| 190 | define SHELL [get-env SHELL [find-an-executable sh bash ksh]] |
| 191 | |
| 192 | # Windows vs. non-Windows |
| 193 | switch -glob -- [get-define host] { |
| 194 |
| --- autosetup/system.tcl | |
| +++ autosetup/system.tcl | |
| @@ -6,28 +6,32 @@ | |
| 6 | # This module supports common system interrogation and options |
| 7 | # such as --host, --build, --prefix, and setting srcdir, builddir, and EXEXT. |
| 8 | # |
| 9 | # It also support the 'feature' naming convention, where searching |
| 10 | # for a feature such as sys/type.h defines HAVE_SYS_TYPES_H |
| 11 | # |
| 12 | module-options { |
| 13 | host:host-alias => {a complete or partial cpu-vendor-opsys for the system where |
| 14 | the application will run (defaults to the same value as --build)} |
| 15 | build:build-alias => {a complete or partial cpu-vendor-opsys for the system |
| 16 | where the application will be built (defaults to the |
| 17 | result of running config.guess)} |
| 18 | prefix:dir => {the target directory for the build (defaults to /usr/local)} |
| 19 | |
| 20 | # These (hidden) options are supported for autoconf/automake compatibility |
| 21 | exec-prefix: |
| 22 | bindir: |
| 23 | sbindir: |
| 24 | includedir: |
| 25 | mandir: |
| 26 | infodir: |
| 27 | libexecdir: |
| 28 | datadir: |
| 29 | libdir: |
| 30 | sysconfdir: |
| 31 | sharedstatedir: |
| 32 | localstatedir: |
| 33 | maintainer-mode=0 |
| 34 | dependency-tracking=0 |
| 35 | } |
| 36 | |
| 37 | # Returns 1 if exists, or 0 if not |
| @@ -107,10 +111,28 @@ | |
| 111 | # |
| 112 | # The special value @srcdir@ is subsituted with the relative |
| 113 | # path to the source directory from the directory where the output |
| 114 | # file is created. Use @top_srcdir@ for the absolute path. |
| 115 | # |
| 116 | # Conditional sections may be specified as follows: |
| 117 | ## @if name == value |
| 118 | ## lines |
| 119 | ## @else |
| 120 | ## lines |
| 121 | ## @endif |
| 122 | # |
| 123 | # Where 'name' is a defined variable name and @else is optional. |
| 124 | # If the expression does not match, all lines through '@endif' are ignored. |
| 125 | # |
| 126 | # The alternative forms may also be used: |
| 127 | ## @if name |
| 128 | ## @if name != value |
| 129 | # |
| 130 | # Where the first form is true if the variable is defined, but not empty or 0 |
| 131 | # |
| 132 | # Currently these expressions can't be nested. |
| 133 | # |
| 134 | proc make-template {template {out {}}} { |
| 135 | set infile [file join $::autosetup(srcdir) $template] |
| 136 | |
| 137 | if {![file exists $infile]} { |
| 138 | user-error "Template $template is missing" |
| @@ -136,11 +158,43 @@ | |
| 158 | |
| 159 | set mapping {} |
| 160 | foreach {n v} [array get ::define] { |
| 161 | lappend mapping @$n@ $v |
| 162 | } |
| 163 | set result {} |
| 164 | foreach line [split [readfile $infile] \n] { |
| 165 | if {[info exists cond]} { |
| 166 | set l [string trimright $line] |
| 167 | if {$l eq "@endif"} { |
| 168 | unset cond |
| 169 | continue |
| 170 | } |
| 171 | if {$l eq "@else"} { |
| 172 | set cond [expr {!$cond}] |
| 173 | continue |
| 174 | } |
| 175 | if {$cond} { |
| 176 | lappend result $line |
| 177 | } |
| 178 | continue |
| 179 | } |
| 180 | if {[regexp {^@if\s+(\w+)(.*)} $line -> name expression]} { |
| 181 | lassign $expression equal value |
| 182 | set varval [get-define $name ""] |
| 183 | if {$equal eq ""} { |
| 184 | set cond [expr {$varval ni {"" 0}}] |
| 185 | } else { |
| 186 | set cond [expr {$varval eq $value}] |
| 187 | if {$equal ne "=="} { |
| 188 | set cond [expr {!$cond}] |
| 189 | } |
| 190 | } |
| 191 | continue |
| 192 | } |
| 193 | lappend result $line |
| 194 | } |
| 195 | writefile $out [string map $mapping [join $result \n]]\n |
| 196 | |
| 197 | msg-result "Created [relative-path $out] from [relative-path $template]" |
| 198 | } |
| 199 | |
| 200 | # build/host tuples and cross-compilation prefix |
| @@ -171,23 +225,27 @@ | |
| 225 | define builddir $autosetup(builddir) |
| 226 | define srcdir $autosetup(srcdir) |
| 227 | # Allow this to come from the environment |
| 228 | define top_srcdir [get-env top_srcdir [get-define srcdir]] |
| 229 | |
| 230 | # autoconf supports all of these |
| 231 | define exec_prefix [opt-val exec-prefix [get-env exec-prefix \${prefix}]] |
| 232 | foreach {name defpath} { |
| 233 | bindir \${exec_prefix}/bin |
| 234 | sbindir \${exec_prefix}/sbin |
| 235 | libexecdir \${exec_prefix}/libexec |
| 236 | libdir \${exec_prefix}/lib |
| 237 | datadir \${prefix}/share |
| 238 | sysconfdir \${prefix}/etc |
| 239 | sharedstatedir \${prefix}/com |
| 240 | localstatedir \${prefix}/var |
| 241 | infodir \${prefix}/share/info |
| 242 | mandir \${prefix}/share/man |
| 243 | includedir \${prefix}/include |
| 244 | } { |
| 245 | define $name [opt-val $name [get-env $name $defpath]] |
| 246 | } |
| 247 | |
| 248 | define SHELL [get-env SHELL [find-an-executable sh bash ksh]] |
| 249 | |
| 250 | # Windows vs. non-Windows |
| 251 | switch -glob -- [get-define host] { |
| 252 |
+1
-1
| --- configure | ||
| +++ configure | ||
| @@ -1,3 +1,3 @@ | ||
| 1 | 1 | #!/bin/sh |
| 2 | 2 | dir="`dirname "$0"`/autosetup" |
| 3 | -WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@" | |
| 3 | +WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@" | |
| 4 | 4 |
| --- configure | |
| +++ configure | |
| @@ -1,3 +1,3 @@ | |
| 1 | #!/bin/sh |
| 2 | dir="`dirname "$0"`/autosetup" |
| 3 | WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@" |
| 4 |
| --- configure | |
| +++ configure | |
| @@ -1,3 +1,3 @@ | |
| 1 | #!/bin/sh |
| 2 | dir="`dirname "$0"`/autosetup" |
| 3 | WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@" |
| 4 |
+1
-1
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -120,11 +120,11 @@ | ||
| 120 | 120 | ** This routine is called if a blob operation fails because we |
| 121 | 121 | ** have run out of memory. |
| 122 | 122 | */ |
| 123 | 123 | static void blob_panic(void){ |
| 124 | 124 | static const char zErrMsg[] = "out of memory\n"; |
| 125 | - write(2, zErrMsg, sizeof(zErrMsg)-1); | |
| 125 | + fputs(zErrMsg, stderr); | |
| 126 | 126 | fossil_exit(1); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /* |
| 130 | 130 | ** A reallocation function that assumes that aData came from malloc(). |
| 131 | 131 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -120,11 +120,11 @@ | |
| 120 | ** This routine is called if a blob operation fails because we |
| 121 | ** have run out of memory. |
| 122 | */ |
| 123 | static void blob_panic(void){ |
| 124 | static const char zErrMsg[] = "out of memory\n"; |
| 125 | write(2, zErrMsg, sizeof(zErrMsg)-1); |
| 126 | fossil_exit(1); |
| 127 | } |
| 128 | |
| 129 | /* |
| 130 | ** A reallocation function that assumes that aData came from malloc(). |
| 131 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -120,11 +120,11 @@ | |
| 120 | ** This routine is called if a blob operation fails because we |
| 121 | ** have run out of memory. |
| 122 | */ |
| 123 | static void blob_panic(void){ |
| 124 | static const char zErrMsg[] = "out of memory\n"; |
| 125 | fputs(zErrMsg, stderr); |
| 126 | fossil_exit(1); |
| 127 | } |
| 128 | |
| 129 | /* |
| 130 | ** A reallocation function that assumes that aData came from malloc(). |
| 131 |
+1
-1
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -120,11 +120,11 @@ | ||
| 120 | 120 | ** This routine is called if a blob operation fails because we |
| 121 | 121 | ** have run out of memory. |
| 122 | 122 | */ |
| 123 | 123 | static void blob_panic(void){ |
| 124 | 124 | static const char zErrMsg[] = "out of memory\n"; |
| 125 | - write(2, zErrMsg, sizeof(zErrMsg)-1); | |
| 125 | + fputs(zErrMsg, stderr); | |
| 126 | 126 | fossil_exit(1); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /* |
| 130 | 130 | ** A reallocation function that assumes that aData came from malloc(). |
| 131 | 131 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -120,11 +120,11 @@ | |
| 120 | ** This routine is called if a blob operation fails because we |
| 121 | ** have run out of memory. |
| 122 | */ |
| 123 | static void blob_panic(void){ |
| 124 | static const char zErrMsg[] = "out of memory\n"; |
| 125 | write(2, zErrMsg, sizeof(zErrMsg)-1); |
| 126 | fossil_exit(1); |
| 127 | } |
| 128 | |
| 129 | /* |
| 130 | ** A reallocation function that assumes that aData came from malloc(). |
| 131 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -120,11 +120,11 @@ | |
| 120 | ** This routine is called if a blob operation fails because we |
| 121 | ** have run out of memory. |
| 122 | */ |
| 123 | static void blob_panic(void){ |
| 124 | static const char zErrMsg[] = "out of memory\n"; |
| 125 | fputs(zErrMsg, stderr); |
| 126 | fossil_exit(1); |
| 127 | } |
| 128 | |
| 129 | /* |
| 130 | ** A reallocation function that assumes that aData came from malloc(). |
| 131 |
+21
-3
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -281,13 +281,18 @@ | ||
| 281 | 281 | void brlist_page(void){ |
| 282 | 282 | Stmt q; |
| 283 | 283 | int cnt; |
| 284 | 284 | int showClosed = P("closed")!=0; |
| 285 | 285 | int showAll = P("all")!=0; |
| 286 | + int colorTest = P("colortest")!=0; | |
| 286 | 287 | |
| 287 | 288 | login_check_credentials(); |
| 288 | 289 | if( !g.okRead ){ login_needed(); return; } |
| 290 | + if( colorTest ){ | |
| 291 | + showClosed = 0; | |
| 292 | + showAll = 1; | |
| 293 | + } | |
| 289 | 294 | |
| 290 | 295 | style_header(showClosed ? "Closed Branches" : |
| 291 | 296 | showAll ? "All Branches" : "Open Branches"); |
| 292 | 297 | style_submenu_element("Timeline", "Timeline", "brtimeline"); |
| 293 | 298 | if( showClosed ){ |
| @@ -298,10 +303,15 @@ | ||
| 298 | 303 | style_submenu_element("Open","Open","brlist"); |
| 299 | 304 | }else{ |
| 300 | 305 | style_submenu_element("All", "All", "brlist?all"); |
| 301 | 306 | style_submenu_element("Closed","Closed","brlist?closed"); |
| 302 | 307 | } |
| 308 | + if( !colorTest ){ | |
| 309 | + style_submenu_element("Color-Test", "Color-Test", "brlist?colortest"); | |
| 310 | + }else{ | |
| 311 | + style_submenu_element("All", "All", "brlist?all"); | |
| 312 | + } | |
| 303 | 313 | login_anonymous_available(); |
| 304 | 314 | style_sidebox_begin("Nomenclature:", "33%"); |
| 305 | 315 | @ <ol> |
| 306 | 316 | @ <li> An <div class="sideboxDescribed"><a href="brlist"> |
| 307 | 317 | @ open branch</a></div> is a branch that has one or |
| @@ -320,20 +330,28 @@ | ||
| 320 | 330 | prepareBranchQuery(&q, showAll, showClosed); |
| 321 | 331 | cnt = 0; |
| 322 | 332 | while( db_step(&q)==SQLITE_ROW ){ |
| 323 | 333 | const char *zBr = db_column_text(&q, 0); |
| 324 | 334 | if( cnt==0 ){ |
| 325 | - if( showClosed ){ | |
| 335 | + if( colorTest ){ | |
| 336 | + @ <h2>Default background colors for all branches:</h2> | |
| 337 | + }else if( showAll ){ | |
| 338 | + @ <h2>All Branches:</h2> | |
| 339 | + }else if( showClosed ){ | |
| 326 | 340 | @ <h2>Closed Branches:</h2> |
| 327 | 341 | }else{ |
| 328 | 342 | @ <h2>Open Branches:</h2> |
| 329 | 343 | } |
| 330 | 344 | @ <ul> |
| 331 | 345 | cnt++; |
| 332 | 346 | } |
| 333 | - if( g.okHistory ){ | |
| 334 | - @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)">%h(zBr)</a></li> | |
| 347 | + if( colorTest ){ | |
| 348 | + const char *zColor = hash_color(zBr); | |
| 349 | + @ <li><span style="background-color: %s(zColor)"> | |
| 350 | + @ %h(zBr) → %s(zColor)</span></li> | |
| 351 | + }else if( g.okHistory ){ | |
| 352 | + @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)")>%h(zBr)</a></li> | |
| 335 | 353 | }else{ |
| 336 | 354 | @ <li><b>%h(zBr)</b></li> |
| 337 | 355 | } |
| 338 | 356 | } |
| 339 | 357 | if( cnt ){ |
| 340 | 358 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -281,13 +281,18 @@ | |
| 281 | void brlist_page(void){ |
| 282 | Stmt q; |
| 283 | int cnt; |
| 284 | int showClosed = P("closed")!=0; |
| 285 | int showAll = P("all")!=0; |
| 286 | |
| 287 | login_check_credentials(); |
| 288 | if( !g.okRead ){ login_needed(); return; } |
| 289 | |
| 290 | style_header(showClosed ? "Closed Branches" : |
| 291 | showAll ? "All Branches" : "Open Branches"); |
| 292 | style_submenu_element("Timeline", "Timeline", "brtimeline"); |
| 293 | if( showClosed ){ |
| @@ -298,10 +303,15 @@ | |
| 298 | style_submenu_element("Open","Open","brlist"); |
| 299 | }else{ |
| 300 | style_submenu_element("All", "All", "brlist?all"); |
| 301 | style_submenu_element("Closed","Closed","brlist?closed"); |
| 302 | } |
| 303 | login_anonymous_available(); |
| 304 | style_sidebox_begin("Nomenclature:", "33%"); |
| 305 | @ <ol> |
| 306 | @ <li> An <div class="sideboxDescribed"><a href="brlist"> |
| 307 | @ open branch</a></div> is a branch that has one or |
| @@ -320,20 +330,28 @@ | |
| 320 | prepareBranchQuery(&q, showAll, showClosed); |
| 321 | cnt = 0; |
| 322 | while( db_step(&q)==SQLITE_ROW ){ |
| 323 | const char *zBr = db_column_text(&q, 0); |
| 324 | if( cnt==0 ){ |
| 325 | if( showClosed ){ |
| 326 | @ <h2>Closed Branches:</h2> |
| 327 | }else{ |
| 328 | @ <h2>Open Branches:</h2> |
| 329 | } |
| 330 | @ <ul> |
| 331 | cnt++; |
| 332 | } |
| 333 | if( g.okHistory ){ |
| 334 | @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)">%h(zBr)</a></li> |
| 335 | }else{ |
| 336 | @ <li><b>%h(zBr)</b></li> |
| 337 | } |
| 338 | } |
| 339 | if( cnt ){ |
| 340 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -281,13 +281,18 @@ | |
| 281 | void brlist_page(void){ |
| 282 | Stmt q; |
| 283 | int cnt; |
| 284 | int showClosed = P("closed")!=0; |
| 285 | int showAll = P("all")!=0; |
| 286 | int colorTest = P("colortest")!=0; |
| 287 | |
| 288 | login_check_credentials(); |
| 289 | if( !g.okRead ){ login_needed(); return; } |
| 290 | if( colorTest ){ |
| 291 | showClosed = 0; |
| 292 | showAll = 1; |
| 293 | } |
| 294 | |
| 295 | style_header(showClosed ? "Closed Branches" : |
| 296 | showAll ? "All Branches" : "Open Branches"); |
| 297 | style_submenu_element("Timeline", "Timeline", "brtimeline"); |
| 298 | if( showClosed ){ |
| @@ -298,10 +303,15 @@ | |
| 303 | style_submenu_element("Open","Open","brlist"); |
| 304 | }else{ |
| 305 | style_submenu_element("All", "All", "brlist?all"); |
| 306 | style_submenu_element("Closed","Closed","brlist?closed"); |
| 307 | } |
| 308 | if( !colorTest ){ |
| 309 | style_submenu_element("Color-Test", "Color-Test", "brlist?colortest"); |
| 310 | }else{ |
| 311 | style_submenu_element("All", "All", "brlist?all"); |
| 312 | } |
| 313 | login_anonymous_available(); |
| 314 | style_sidebox_begin("Nomenclature:", "33%"); |
| 315 | @ <ol> |
| 316 | @ <li> An <div class="sideboxDescribed"><a href="brlist"> |
| 317 | @ open branch</a></div> is a branch that has one or |
| @@ -320,20 +330,28 @@ | |
| 330 | prepareBranchQuery(&q, showAll, showClosed); |
| 331 | cnt = 0; |
| 332 | while( db_step(&q)==SQLITE_ROW ){ |
| 333 | const char *zBr = db_column_text(&q, 0); |
| 334 | if( cnt==0 ){ |
| 335 | if( colorTest ){ |
| 336 | @ <h2>Default background colors for all branches:</h2> |
| 337 | }else if( showAll ){ |
| 338 | @ <h2>All Branches:</h2> |
| 339 | }else if( showClosed ){ |
| 340 | @ <h2>Closed Branches:</h2> |
| 341 | }else{ |
| 342 | @ <h2>Open Branches:</h2> |
| 343 | } |
| 344 | @ <ul> |
| 345 | cnt++; |
| 346 | } |
| 347 | if( colorTest ){ |
| 348 | const char *zColor = hash_color(zBr); |
| 349 | @ <li><span style="background-color: %s(zColor)"> |
| 350 | @ %h(zBr) → %s(zColor)</span></li> |
| 351 | }else if( g.okHistory ){ |
| 352 | @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)")>%h(zBr)</a></li> |
| 353 | }else{ |
| 354 | @ <li><b>%h(zBr)</b></li> |
| 355 | } |
| 356 | } |
| 357 | if( cnt ){ |
| 358 |
+11
-5
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1153,11 +1153,13 @@ | ||
| 1153 | 1153 | fossil_print("Listening for HTTP requests on TCP port %d\n", iPort); |
| 1154 | 1154 | fflush(stdout); |
| 1155 | 1155 | } |
| 1156 | 1156 | if( zBrowser ){ |
| 1157 | 1157 | zBrowser = mprintf(zBrowser, iPort); |
| 1158 | - system(zBrowser); | |
| 1158 | + if( system(zBrowser)<0 ){ | |
| 1159 | + fossil_warning("cannot start browser: %s\n", zBrowser); | |
| 1160 | + } | |
| 1159 | 1161 | } |
| 1160 | 1162 | while( 1 ){ |
| 1161 | 1163 | if( nchildren>MAX_PARALLEL ){ |
| 1162 | 1164 | /* Slow down if connections are arriving too fast */ |
| 1163 | 1165 | sleep( nchildren-MAX_PARALLEL ); |
| @@ -1174,20 +1176,24 @@ | ||
| 1174 | 1176 | child = fork(); |
| 1175 | 1177 | if( child!=0 ){ |
| 1176 | 1178 | if( child>0 ) nchildren++; |
| 1177 | 1179 | close(connection); |
| 1178 | 1180 | }else{ |
| 1181 | + int nErr = 0, fd; | |
| 1179 | 1182 | close(0); |
| 1180 | - dup(connection); | |
| 1183 | + fd = dup(connection); | |
| 1184 | + if( fd!=0 ) nErr++; | |
| 1181 | 1185 | close(1); |
| 1182 | - dup(connection); | |
| 1186 | + fd = dup(connection); | |
| 1187 | + if( fd!=1 ) nErr++; | |
| 1183 | 1188 | if( !g.fHttpTrace && !g.fSqlTrace ){ |
| 1184 | 1189 | close(2); |
| 1185 | - dup(connection); | |
| 1190 | + fd = dup(connection); | |
| 1191 | + if( fd!=2 ) nErr++; | |
| 1186 | 1192 | } |
| 1187 | 1193 | close(connection); |
| 1188 | - return 0; | |
| 1194 | + return nErr; | |
| 1189 | 1195 | } |
| 1190 | 1196 | } |
| 1191 | 1197 | } |
| 1192 | 1198 | /* Bury dead children */ |
| 1193 | 1199 | while( waitpid(0, 0, WNOHANG)>0 ){ |
| 1194 | 1200 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1153,11 +1153,13 @@ | |
| 1153 | fossil_print("Listening for HTTP requests on TCP port %d\n", iPort); |
| 1154 | fflush(stdout); |
| 1155 | } |
| 1156 | if( zBrowser ){ |
| 1157 | zBrowser = mprintf(zBrowser, iPort); |
| 1158 | system(zBrowser); |
| 1159 | } |
| 1160 | while( 1 ){ |
| 1161 | if( nchildren>MAX_PARALLEL ){ |
| 1162 | /* Slow down if connections are arriving too fast */ |
| 1163 | sleep( nchildren-MAX_PARALLEL ); |
| @@ -1174,20 +1176,24 @@ | |
| 1174 | child = fork(); |
| 1175 | if( child!=0 ){ |
| 1176 | if( child>0 ) nchildren++; |
| 1177 | close(connection); |
| 1178 | }else{ |
| 1179 | close(0); |
| 1180 | dup(connection); |
| 1181 | close(1); |
| 1182 | dup(connection); |
| 1183 | if( !g.fHttpTrace && !g.fSqlTrace ){ |
| 1184 | close(2); |
| 1185 | dup(connection); |
| 1186 | } |
| 1187 | close(connection); |
| 1188 | return 0; |
| 1189 | } |
| 1190 | } |
| 1191 | } |
| 1192 | /* Bury dead children */ |
| 1193 | while( waitpid(0, 0, WNOHANG)>0 ){ |
| 1194 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1153,11 +1153,13 @@ | |
| 1153 | fossil_print("Listening for HTTP requests on TCP port %d\n", iPort); |
| 1154 | fflush(stdout); |
| 1155 | } |
| 1156 | if( zBrowser ){ |
| 1157 | zBrowser = mprintf(zBrowser, iPort); |
| 1158 | if( system(zBrowser)<0 ){ |
| 1159 | fossil_warning("cannot start browser: %s\n", zBrowser); |
| 1160 | } |
| 1161 | } |
| 1162 | while( 1 ){ |
| 1163 | if( nchildren>MAX_PARALLEL ){ |
| 1164 | /* Slow down if connections are arriving too fast */ |
| 1165 | sleep( nchildren-MAX_PARALLEL ); |
| @@ -1174,20 +1176,24 @@ | |
| 1176 | child = fork(); |
| 1177 | if( child!=0 ){ |
| 1178 | if( child>0 ) nchildren++; |
| 1179 | close(connection); |
| 1180 | }else{ |
| 1181 | int nErr = 0, fd; |
| 1182 | close(0); |
| 1183 | fd = dup(connection); |
| 1184 | if( fd!=0 ) nErr++; |
| 1185 | close(1); |
| 1186 | fd = dup(connection); |
| 1187 | if( fd!=1 ) nErr++; |
| 1188 | if( !g.fHttpTrace && !g.fSqlTrace ){ |
| 1189 | close(2); |
| 1190 | fd = dup(connection); |
| 1191 | if( fd!=2 ) nErr++; |
| 1192 | } |
| 1193 | close(connection); |
| 1194 | return nErr; |
| 1195 | } |
| 1196 | } |
| 1197 | } |
| 1198 | /* Bury dead children */ |
| 1199 | while( waitpid(0, 0, WNOHANG)>0 ){ |
| 1200 |
+6
-2
| --- src/popen.c | ||
| +++ src/popen.c | ||
| @@ -172,17 +172,21 @@ | ||
| 172 | 172 | close(pout[1]); |
| 173 | 173 | *pChildPid = 0; |
| 174 | 174 | return 1; |
| 175 | 175 | } |
| 176 | 176 | if( *pChildPid==0 ){ |
| 177 | + int fd; | |
| 178 | + int nErr = 0; | |
| 177 | 179 | /* This is the child process */ |
| 178 | 180 | close(0); |
| 179 | - dup(pout[0]); | |
| 181 | + fd = dup(pout[0]); | |
| 182 | + if( fd!=0 ) nErr++; | |
| 180 | 183 | close(pout[0]); |
| 181 | 184 | close(pout[1]); |
| 182 | 185 | close(1); |
| 183 | - dup(pin[1]); | |
| 186 | + fd = dup(pin[1]); | |
| 187 | + if( fd!=1 ) nErr++; | |
| 184 | 188 | close(pin[0]); |
| 185 | 189 | close(pin[1]); |
| 186 | 190 | execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0); |
| 187 | 191 | return 1; |
| 188 | 192 | }else{ |
| 189 | 193 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -172,17 +172,21 @@ | |
| 172 | close(pout[1]); |
| 173 | *pChildPid = 0; |
| 174 | return 1; |
| 175 | } |
| 176 | if( *pChildPid==0 ){ |
| 177 | /* This is the child process */ |
| 178 | close(0); |
| 179 | dup(pout[0]); |
| 180 | close(pout[0]); |
| 181 | close(pout[1]); |
| 182 | close(1); |
| 183 | dup(pin[1]); |
| 184 | close(pin[0]); |
| 185 | close(pin[1]); |
| 186 | execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0); |
| 187 | return 1; |
| 188 | }else{ |
| 189 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -172,17 +172,21 @@ | |
| 172 | close(pout[1]); |
| 173 | *pChildPid = 0; |
| 174 | return 1; |
| 175 | } |
| 176 | if( *pChildPid==0 ){ |
| 177 | int fd; |
| 178 | int nErr = 0; |
| 179 | /* This is the child process */ |
| 180 | close(0); |
| 181 | fd = dup(pout[0]); |
| 182 | if( fd!=0 ) nErr++; |
| 183 | close(pout[0]); |
| 184 | close(pout[1]); |
| 185 | close(1); |
| 186 | fd = dup(pin[1]); |
| 187 | if( fd!=1 ) nErr++; |
| 188 | close(pin[0]); |
| 189 | close(pin[1]); |
| 190 | execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0); |
| 191 | return 1; |
| 192 | }else{ |
| 193 |
+3
-2
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -327,11 +327,11 @@ | ||
| 327 | 327 | } |
| 328 | 328 | db_finalize(&q); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /* |
| 332 | -** Drop the indicates stash | |
| 332 | +** Drop the indicated stash | |
| 333 | 333 | */ |
| 334 | 334 | static void stash_drop(int stashid){ |
| 335 | 335 | db_multi_exec( |
| 336 | 336 | "DELETE FROM stash WHERE stashid=%d;" |
| 337 | 337 | "DELETE FROM stashfile WHERE stashid=%d;", |
| @@ -397,10 +397,11 @@ | ||
| 397 | 397 | ** Update to the baseline checkout for STASHID then apply the |
| 398 | 398 | ** changes of STASHID. Keep STASHID so that it can be reused |
| 399 | 399 | ** This command is undoable. |
| 400 | 400 | ** |
| 401 | 401 | ** fossil stash drop ?STASHID? ?--all? |
| 402 | +** fossil stash rm ?STASHID? ?--all? | |
| 402 | 403 | ** |
| 403 | 404 | ** Forget everything about STASHID. Forget the whole stash if the |
| 404 | 405 | ** --all flag is used. Individual drops are undoable but --all is not. |
| 405 | 406 | ** |
| 406 | 407 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -480,11 +481,11 @@ | ||
| 480 | 481 | } |
| 481 | 482 | } |
| 482 | 483 | db_finalize(&q); |
| 483 | 484 | if( n==0 ) fossil_print("empty stash\n"); |
| 484 | 485 | }else |
| 485 | - if( memcmp(zCmd, "drop", nCmd)==0 ){ | |
| 486 | + if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){ | |
| 486 | 487 | int allFlag = find_option("all", 0, 0)!=0; |
| 487 | 488 | if( g.argc>4 ) usage("stash apply STASHID"); |
| 488 | 489 | if( allFlag ){ |
| 489 | 490 | db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;"); |
| 490 | 491 | }else{ |
| 491 | 492 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -327,11 +327,11 @@ | |
| 327 | } |
| 328 | db_finalize(&q); |
| 329 | } |
| 330 | |
| 331 | /* |
| 332 | ** Drop the indicates stash |
| 333 | */ |
| 334 | static void stash_drop(int stashid){ |
| 335 | db_multi_exec( |
| 336 | "DELETE FROM stash WHERE stashid=%d;" |
| 337 | "DELETE FROM stashfile WHERE stashid=%d;", |
| @@ -397,10 +397,11 @@ | |
| 397 | ** Update to the baseline checkout for STASHID then apply the |
| 398 | ** changes of STASHID. Keep STASHID so that it can be reused |
| 399 | ** This command is undoable. |
| 400 | ** |
| 401 | ** fossil stash drop ?STASHID? ?--all? |
| 402 | ** |
| 403 | ** Forget everything about STASHID. Forget the whole stash if the |
| 404 | ** --all flag is used. Individual drops are undoable but --all is not. |
| 405 | ** |
| 406 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -480,11 +481,11 @@ | |
| 480 | } |
| 481 | } |
| 482 | db_finalize(&q); |
| 483 | if( n==0 ) fossil_print("empty stash\n"); |
| 484 | }else |
| 485 | if( memcmp(zCmd, "drop", nCmd)==0 ){ |
| 486 | int allFlag = find_option("all", 0, 0)!=0; |
| 487 | if( g.argc>4 ) usage("stash apply STASHID"); |
| 488 | if( allFlag ){ |
| 489 | db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;"); |
| 490 | }else{ |
| 491 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -327,11 +327,11 @@ | |
| 327 | } |
| 328 | db_finalize(&q); |
| 329 | } |
| 330 | |
| 331 | /* |
| 332 | ** Drop the indicated stash |
| 333 | */ |
| 334 | static void stash_drop(int stashid){ |
| 335 | db_multi_exec( |
| 336 | "DELETE FROM stash WHERE stashid=%d;" |
| 337 | "DELETE FROM stashfile WHERE stashid=%d;", |
| @@ -397,10 +397,11 @@ | |
| 397 | ** Update to the baseline checkout for STASHID then apply the |
| 398 | ** changes of STASHID. Keep STASHID so that it can be reused |
| 399 | ** This command is undoable. |
| 400 | ** |
| 401 | ** fossil stash drop ?STASHID? ?--all? |
| 402 | ** fossil stash rm ?STASHID? ?--all? |
| 403 | ** |
| 404 | ** Forget everything about STASHID. Forget the whole stash if the |
| 405 | ** --all flag is used. Individual drops are undoable but --all is not. |
| 406 | ** |
| 407 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -480,11 +481,11 @@ | |
| 481 | } |
| 482 | } |
| 483 | db_finalize(&q); |
| 484 | if( n==0 ) fossil_print("empty stash\n"); |
| 485 | }else |
| 486 | if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){ |
| 487 | int allFlag = find_option("all", 0, 0)!=0; |
| 488 | if( g.argc>4 ) usage("stash apply STASHID"); |
| 489 | if( allFlag ){ |
| 490 | db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;"); |
| 491 | }else{ |
| 492 |
+3
-2
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -327,11 +327,11 @@ | ||
| 327 | 327 | } |
| 328 | 328 | db_finalize(&q); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /* |
| 332 | -** Drop the indicates stash | |
| 332 | +** Drop the indicated stash | |
| 333 | 333 | */ |
| 334 | 334 | static void stash_drop(int stashid){ |
| 335 | 335 | db_multi_exec( |
| 336 | 336 | "DELETE FROM stash WHERE stashid=%d;" |
| 337 | 337 | "DELETE FROM stashfile WHERE stashid=%d;", |
| @@ -397,10 +397,11 @@ | ||
| 397 | 397 | ** Update to the baseline checkout for STASHID then apply the |
| 398 | 398 | ** changes of STASHID. Keep STASHID so that it can be reused |
| 399 | 399 | ** This command is undoable. |
| 400 | 400 | ** |
| 401 | 401 | ** fossil stash drop ?STASHID? ?--all? |
| 402 | +** fossil stash rm ?STASHID? ?--all? | |
| 402 | 403 | ** |
| 403 | 404 | ** Forget everything about STASHID. Forget the whole stash if the |
| 404 | 405 | ** --all flag is used. Individual drops are undoable but --all is not. |
| 405 | 406 | ** |
| 406 | 407 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -480,11 +481,11 @@ | ||
| 480 | 481 | } |
| 481 | 482 | } |
| 482 | 483 | db_finalize(&q); |
| 483 | 484 | if( n==0 ) fossil_print("empty stash\n"); |
| 484 | 485 | }else |
| 485 | - if( memcmp(zCmd, "drop", nCmd)==0 ){ | |
| 486 | + if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){ | |
| 486 | 487 | int allFlag = find_option("all", 0, 0)!=0; |
| 487 | 488 | if( g.argc>4 ) usage("stash apply STASHID"); |
| 488 | 489 | if( allFlag ){ |
| 489 | 490 | db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;"); |
| 490 | 491 | }else{ |
| 491 | 492 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -327,11 +327,11 @@ | |
| 327 | } |
| 328 | db_finalize(&q); |
| 329 | } |
| 330 | |
| 331 | /* |
| 332 | ** Drop the indicates stash |
| 333 | */ |
| 334 | static void stash_drop(int stashid){ |
| 335 | db_multi_exec( |
| 336 | "DELETE FROM stash WHERE stashid=%d;" |
| 337 | "DELETE FROM stashfile WHERE stashid=%d;", |
| @@ -397,10 +397,11 @@ | |
| 397 | ** Update to the baseline checkout for STASHID then apply the |
| 398 | ** changes of STASHID. Keep STASHID so that it can be reused |
| 399 | ** This command is undoable. |
| 400 | ** |
| 401 | ** fossil stash drop ?STASHID? ?--all? |
| 402 | ** |
| 403 | ** Forget everything about STASHID. Forget the whole stash if the |
| 404 | ** --all flag is used. Individual drops are undoable but --all is not. |
| 405 | ** |
| 406 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -480,11 +481,11 @@ | |
| 480 | } |
| 481 | } |
| 482 | db_finalize(&q); |
| 483 | if( n==0 ) fossil_print("empty stash\n"); |
| 484 | }else |
| 485 | if( memcmp(zCmd, "drop", nCmd)==0 ){ |
| 486 | int allFlag = find_option("all", 0, 0)!=0; |
| 487 | if( g.argc>4 ) usage("stash apply STASHID"); |
| 488 | if( allFlag ){ |
| 489 | db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;"); |
| 490 | }else{ |
| 491 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -327,11 +327,11 @@ | |
| 327 | } |
| 328 | db_finalize(&q); |
| 329 | } |
| 330 | |
| 331 | /* |
| 332 | ** Drop the indicated stash |
| 333 | */ |
| 334 | static void stash_drop(int stashid){ |
| 335 | db_multi_exec( |
| 336 | "DELETE FROM stash WHERE stashid=%d;" |
| 337 | "DELETE FROM stashfile WHERE stashid=%d;", |
| @@ -397,10 +397,11 @@ | |
| 397 | ** Update to the baseline checkout for STASHID then apply the |
| 398 | ** changes of STASHID. Keep STASHID so that it can be reused |
| 399 | ** This command is undoable. |
| 400 | ** |
| 401 | ** fossil stash drop ?STASHID? ?--all? |
| 402 | ** fossil stash rm ?STASHID? ?--all? |
| 403 | ** |
| 404 | ** Forget everything about STASHID. Forget the whole stash if the |
| 405 | ** --all flag is used. Individual drops are undoable but --all is not. |
| 406 | ** |
| 407 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -480,11 +481,11 @@ | |
| 481 | } |
| 482 | } |
| 483 | db_finalize(&q); |
| 484 | if( n==0 ) fossil_print("empty stash\n"); |
| 485 | }else |
| 486 | if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){ |
| 487 | int allFlag = find_option("all", 0, 0)!=0; |
| 488 | if( g.argc>4 ) usage("stash apply STASHID"); |
| 489 | if( allFlag ){ |
| 490 | db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;"); |
| 491 | }else{ |
| 492 |
+15
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -152,10 +152,25 @@ | ||
| 152 | 152 | default: r = mx; g = mn, b = h2; break; |
| 153 | 153 | } |
| 154 | 154 | sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b); |
| 155 | 155 | return zColor; |
| 156 | 156 | } |
| 157 | + | |
| 158 | +/* | |
| 159 | +** COMMAND: test-hash-color | |
| 160 | +** | |
| 161 | +** Usage: %fossil test-hash-color TAG ... | |
| 162 | +** | |
| 163 | +** Print out the color names associated with each tag. Used for | |
| 164 | +** testing the hash_color() function. | |
| 165 | +*/ | |
| 166 | +void test_hash_color(void){ | |
| 167 | + int i; | |
| 168 | + for(i=2; i<g.argc; i++){ | |
| 169 | + fossil_print("%20s: %s\n", g.argv[i], hash_color(g.argv[i])); | |
| 170 | + } | |
| 171 | +} | |
| 157 | 172 | |
| 158 | 173 | /* |
| 159 | 174 | ** Output a timeline in the web format given a query. The query |
| 160 | 175 | ** should return these columns: |
| 161 | 176 | ** |
| 162 | 177 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -152,10 +152,25 @@ | |
| 152 | default: r = mx; g = mn, b = h2; break; |
| 153 | } |
| 154 | sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b); |
| 155 | return zColor; |
| 156 | } |
| 157 | |
| 158 | /* |
| 159 | ** Output a timeline in the web format given a query. The query |
| 160 | ** should return these columns: |
| 161 | ** |
| 162 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -152,10 +152,25 @@ | |
| 152 | default: r = mx; g = mn, b = h2; break; |
| 153 | } |
| 154 | sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b); |
| 155 | return zColor; |
| 156 | } |
| 157 | |
| 158 | /* |
| 159 | ** COMMAND: test-hash-color |
| 160 | ** |
| 161 | ** Usage: %fossil test-hash-color TAG ... |
| 162 | ** |
| 163 | ** Print out the color names associated with each tag. Used for |
| 164 | ** testing the hash_color() function. |
| 165 | */ |
| 166 | void test_hash_color(void){ |
| 167 | int i; |
| 168 | for(i=2; i<g.argc; i++){ |
| 169 | fossil_print("%20s: %s\n", g.argv[i], hash_color(g.argv[i])); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | /* |
| 174 | ** Output a timeline in the web format given a query. The query |
| 175 | ** should return these columns: |
| 176 | ** |
| 177 |
+7
| --- www/checkin.wiki | ||
| +++ www/checkin.wiki | ||
| @@ -3,10 +3,12 @@ | ||
| 3 | 3 | <h2><u>Always</u> run the following checklist prior to <u>every</u> |
| 4 | 4 | check-in or commit to the Fossil repository:</h2> |
| 5 | 5 | |
| 6 | 6 | Before every check-in: |
| 7 | 7 | |
| 8 | + 0. <b>fossil user default</b> → your username is correct. | |
| 9 | + | |
| 8 | 10 | 1. <b>fossil diff</b> → |
| 9 | 11 | <ol type="a"> |
| 10 | 12 | <li> No stray changes |
| 11 | 13 | <li> All changes comply with the license |
| 12 | 14 | <li> All inputs are scrubbed before use |
| @@ -31,10 +33,15 @@ | ||
| 31 | 33 | 7. The fossil executable that results from a build actually works. |
| 32 | 34 | |
| 33 | 35 | |
| 34 | 36 | <hr> |
| 35 | 37 | <h2>Commentary</h2> |
| 38 | + | |
| 39 | +Before you go ahead and push content back to the servers, make sure | |
| 40 | +that the username you are using by default matches your username | |
| 41 | +within the project. Also remember to enable the localauth setting | |
| 42 | +if you intend to make changes via a locally served web UI. | |
| 36 | 43 | |
| 37 | 44 | Item 1 is the most important step. Consider using <b>gdiff</b> |
| 38 | 45 | instead of <b>diff</b> if you have a graphical differ configured. Or, |
| 39 | 46 | pipe the output of "<b>fossil diff</b>" into "<b>open -f</b>" (on a mac) to |
| 40 | 47 | get the diff output in a separate text window for easier viewing. |
| 41 | 48 |
| --- www/checkin.wiki | |
| +++ www/checkin.wiki | |
| @@ -3,10 +3,12 @@ | |
| 3 | <h2><u>Always</u> run the following checklist prior to <u>every</u> |
| 4 | check-in or commit to the Fossil repository:</h2> |
| 5 | |
| 6 | Before every check-in: |
| 7 | |
| 8 | 1. <b>fossil diff</b> → |
| 9 | <ol type="a"> |
| 10 | <li> No stray changes |
| 11 | <li> All changes comply with the license |
| 12 | <li> All inputs are scrubbed before use |
| @@ -31,10 +33,15 @@ | |
| 31 | 7. The fossil executable that results from a build actually works. |
| 32 | |
| 33 | |
| 34 | <hr> |
| 35 | <h2>Commentary</h2> |
| 36 | |
| 37 | Item 1 is the most important step. Consider using <b>gdiff</b> |
| 38 | instead of <b>diff</b> if you have a graphical differ configured. Or, |
| 39 | pipe the output of "<b>fossil diff</b>" into "<b>open -f</b>" (on a mac) to |
| 40 | get the diff output in a separate text window for easier viewing. |
| 41 |
| --- www/checkin.wiki | |
| +++ www/checkin.wiki | |
| @@ -3,10 +3,12 @@ | |
| 3 | <h2><u>Always</u> run the following checklist prior to <u>every</u> |
| 4 | check-in or commit to the Fossil repository:</h2> |
| 5 | |
| 6 | Before every check-in: |
| 7 | |
| 8 | 0. <b>fossil user default</b> → your username is correct. |
| 9 | |
| 10 | 1. <b>fossil diff</b> → |
| 11 | <ol type="a"> |
| 12 | <li> No stray changes |
| 13 | <li> All changes comply with the license |
| 14 | <li> All inputs are scrubbed before use |
| @@ -31,10 +33,15 @@ | |
| 33 | 7. The fossil executable that results from a build actually works. |
| 34 | |
| 35 | |
| 36 | <hr> |
| 37 | <h2>Commentary</h2> |
| 38 | |
| 39 | Before you go ahead and push content back to the servers, make sure |
| 40 | that the username you are using by default matches your username |
| 41 | within the project. Also remember to enable the localauth setting |
| 42 | if you intend to make changes via a locally served web UI. |
| 43 | |
| 44 | Item 1 is the most important step. Consider using <b>gdiff</b> |
| 45 | instead of <b>diff</b> if you have a graphical differ configured. Or, |
| 46 | pipe the output of "<b>fossil diff</b>" into "<b>open -f</b>" (on a mac) to |
| 47 | get the diff output in a separate text window for easier viewing. |
| 48 |