Fossil SCM

Merge the autosetup updates into trunk.

drh 2011-08-26 14:09 trunk merge
Commit 64a2b0d51f6f7ee9bcb9c885f96649723ad2e0bf
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -1,11 +1,11 @@
11
#!/bin/sh
22
# Copyright (c) 2006-2011 WorkWare Systems http://www.workware.net.au/
33
# All rights reserved
44
# vim:se syntax=tcl:
55
# \
6
-dir=`dirname "$0"`; exec `"$dir/find-tclsh" || echo false` "$0" "$@"
6
+dir=`dirname "$0"`; exec "`$dir/find-tclsh`" "$0" "$@"
77
88
set autosetup(version) 0.6.2
99
1010
# Can be set to 1 to debug early-init problems
1111
set autosetup(debug) 0
@@ -182,11 +182,11 @@
182182
183183
# @opt-bool option ...
184184
#
185185
# Check each of the named, boolean options and return 1 if any of them have
186186
# been set by the user.
187
-#
187
+#
188188
proc opt-bool {args} {
189189
option-check-names {*}$args
190190
opt_bool ::useropts {*}$args
191191
}
192192
@@ -198,11 +198,11 @@
198198
# If only a single value is required, use something like:
199199
#
200200
## lindex [opt-val $names] end
201201
#
202202
# If no options were set, $default is returned (exactly, not as a list).
203
-#
203
+#
204204
proc opt-val {names {default ""}} {
205205
option-check-names {*}$names
206206
join [opt_val ::useropts $names $default]
207207
}
208208
@@ -396,11 +396,11 @@
396396
# These options are not displayed with --help and can be useful for internal options or as aliases.
397397
#
398398
# For example, --disable-lfs is an alias for --disable=largefile:
399399
#
400400
## lfs=1 largefile=1 => "Disable large file support"
401
-#
401
+#
402402
proc options {optlist} {
403403
# Allow options as a list or args
404404
options-add $optlist "Local Options:"
405405
406406
if {$::autosetup(showhelp)} {
@@ -434,11 +434,11 @@
434434
return $alias
435435
}
436436
}
437437
438438
# @define name ?value=1?
439
-#
439
+#
440440
# Defines the named variable to the given value.
441441
# These (name, value) pairs represent the results of the configuration check
442442
# and are available to be checked, modified and substituted.
443443
#
444444
proc define {name {value 1}} {
@@ -564,10 +564,40 @@
564564
foreach arg $argv {
565565
lappend args [quote-if-needed $arg]
566566
}
567567
join $args
568568
}
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
+}
569599
570600
# @find-executable name
571601
#
572602
# Searches the path for an executable with the given name.
573603
# Note that the name may include some parameters, e.g. "cc -mbig-endian",
@@ -999,21 +1029,24 @@
9991029
10001030
# Simple getopt module
10011031
10021032
# Parse everything out of the argv list which looks like an option
10031033
# 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
10041035
proc getopt {argvname} {
10051036
upvar $argvname argv
1037
+ set nargv {}
10061038
10071039
for {set i 0} {$i < [llength $argv]} {incr i} {
10081040
set arg [lindex $argv $i]
10091041
10101042
#dputs arg=$arg
10111043
10121044
if {$arg eq "--"} {
10131045
# End of options
10141046
incr i
1047
+ lappend nargv {*}[lrange $argv $i end]
10151048
break
10161049
}
10171050
10181051
if {[regexp {^--([^=][^=]+)=(.*)$} $arg -> name value]} {
10191052
lappend opts($name) $value
@@ -1023,18 +1056,18 @@
10231056
} else {
10241057
set value 1
10251058
}
10261059
lappend opts($name) $value
10271060
} else {
1028
- break
1061
+ lappend nargv $arg
10291062
}
10301063
}
10311064
1032
- #puts "getopt: argv=[join $argv] => [join [lrange $argv $i end]]"
1065
+ #puts "getopt: argv=[join $argv] => [join $nargv]"
10331066
#parray opts
10341067
1035
- set argv [lrange $argv $i end]
1068
+ set argv $nargv
10361069
10371070
return [array get opts]
10381071
}
10391072
10401073
proc opt_val {optarrayname options {default {}}} {
@@ -1264,11 +1297,11 @@
12641297
writefile configure "#!/bin/sh\nWRAPPER=\"\$0\" exec $::autosetup(dir)/autosetup \"\$@\"\n"
12651298
} else {
12661299
writefile configure \
12671300
{#!/bin/sh
12681301
dir="`dirname "$0"`/autosetup"
1269
-WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@"
1302
+WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@"
12701303
}
12711304
}
12721305
catch {exec chmod 755 configure}
12731306
}
12741307
if {![file exists auto.def]} {
@@ -1279,11 +1312,11 @@
12791312
12801313
# Add any user options here
12811314
options {
12821315
}
12831316
1284
-make-autoconf-h config.h
1317
+make-config-header config.h
12851318
make-template Makefile.in
12861319
}
12871320
}
12881321
if {![file exists Makefile.in]} {
12891322
puts "Note: I don't see Makefile.in. You will probably need to create one."
@@ -1511,11 +1544,11 @@
15111544
string map {\\ /} [env $name {*}$args]
15121545
}
15131546
# Jim uses system() for exec under mingw, so
15141547
# we need to fetch the output ourselves
15151548
proc exec-with-stderr {args} {
1516
- set tmpfile /tmp/autosetup.[format %05x [rand 10000]].tmp
1549
+ set tmpfile auto[format %04x [rand 10000]].tmp
15171550
set rc [catch [list exec {*}$args >$tmpfile 2>&1] result]
15181551
set result [readfile $tmpfile]
15191552
file delete $tmpfile
15201553
return -code $rc $result
15211554
}
15221555
--- 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
--- autosetup/cc-lib.tcl
+++ autosetup/cc-lib.tcl
@@ -48,21 +48,21 @@
4848
cc-check-includes sys/types.h sys/param.h
4949
set rc 0
5050
msg-checking "Checking endian..."
5151
cc-with {-includes {sys/types.h sys/param.h}} {
5252
if {[cctest -code {
53
- #if! defined(BIG_ENDIAN) || !defined(BYTE_ORDER)
53
+ #if !defined(BIG_ENDIAN) || !defined(BYTE_ORDER)
5454
#error unknown
5555
#elif BYTE_ORDER != BIG_ENDIAN
5656
#error little
5757
#endif
5858
}]} {
5959
define-feature big-endian
6060
msg-result "big"
6161
set rc 1
6262
} elseif {[cctest -code {
63
- #if! defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER)
63
+ #if !defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER)
6464
#error unknown
6565
#elif BYTE_ORDER != LITTLE_ENDIAN
6666
#error big
6767
#endif
6868
}]} {
6969
--- 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
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -35,14 +35,29 @@
3535
}
3636
*-*-cygwin {
3737
define SH_LDFLAGS -shared
3838
define SHOBJ_LDFLAGS -shared
3939
}
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
+ }
4055
* {
4156
# Generic Unix settings
4257
define SH_LINKFLAGS -rdynamic
43
- define SH_CFLAGS -fPIC
58
+ define SH_CFLAGS -fpic
4459
define SH_LDFLAGS -shared
45
- define SHOBJ_CFLAGS -fPIC
60
+ define SHOBJ_CFLAGS -fpic
4661
define SHOBJ_LDFLAGS "-shared -nostartfiles"
4762
}
4863
}
4964
--- 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
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -416,11 +416,11 @@
416416
#
417417
# Any failures are recorded in 'config.log'
418418
#
419419
proc cctest {args} {
420420
set src conftest__.c
421
- set tmp conftest__.o
421
+ set tmp conftest__
422422
423423
# Easiest way to merge in the settings
424424
cc-with $args {
425425
array set opts [cc-get-settings]
426426
}
@@ -468,10 +468,11 @@
468468
autosetup-error "cctest called with unknown language: $opts(-lang)"
469469
}
470470
}
471471
472472
if {!$opts(-link)} {
473
+ set tmp conftest__.o
473474
lappend cmdline -c
474475
}
475476
lappend cmdline {*}$opts(-cflags)
476477
477478
switch -glob -- [get-define host] {
478479
--- 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
--- autosetup/system.tcl
+++ autosetup/system.tcl
@@ -6,28 +6,32 @@
66
# This module supports common system interrogation and options
77
# such as --host, --build, --prefix, and setting srcdir, builddir, and EXEXT.
88
#
99
# It also support the 'feature' naming convention, where searching
1010
# 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
+#
1412
module-options {
1513
host:host-alias => {a complete or partial cpu-vendor-opsys for the system where
1614
the application will run (defaults to the same value as --build)}
1715
build:build-alias => {a complete or partial cpu-vendor-opsys for the system
1816
where the application will be built (defaults to the
1917
result of running config.guess)}
2018
prefix:dir => {the target directory for the build (defaults to /usr/local)}
2119
20
+ # These (hidden) options are supported for autoconf/automake compatibility
21
+ exec-prefix:
22
+ bindir:
23
+ sbindir:
2224
includedir:
2325
mandir:
2426
infodir:
2527
libexecdir:
28
+ datadir:
29
+ libdir:
2630
sysconfdir:
31
+ sharedstatedir:
2732
localstatedir:
28
-
2933
maintainer-mode=0
3034
dependency-tracking=0
3135
}
3236
3337
# Returns 1 if exists, or 0 if not
@@ -107,10 +111,28 @@
107111
#
108112
# The special value @srcdir@ is subsituted with the relative
109113
# path to the source directory from the directory where the output
110114
# file is created. Use @top_srcdir@ for the absolute path.
111115
#
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
+#
112134
proc make-template {template {out {}}} {
113135
set infile [file join $::autosetup(srcdir) $template]
114136
115137
if {![file exists $infile]} {
116138
user-error "Template $template is missing"
@@ -136,11 +158,43 @@
136158
137159
set mapping {}
138160
foreach {n v} [array get ::define] {
139161
lappend mapping @$n@ $v
140162
}
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
142196
143197
msg-result "Created [relative-path $out] from [relative-path $template]"
144198
}
145199
146200
# build/host tuples and cross-compilation prefix
@@ -171,23 +225,27 @@
171225
define builddir $autosetup(builddir)
172226
define srcdir $autosetup(srcdir)
173227
# Allow this to come from the environment
174228
define top_srcdir [get-env top_srcdir [get-define srcdir]]
175229
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
+}
189247
190248
define SHELL [get-env SHELL [find-an-executable sh bash ksh]]
191249
192250
# Windows vs. non-Windows
193251
switch -glob -- [get-define host] {
194252
--- 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 @@
11
#!/bin/sh
22
dir="`dirname "$0"`/autosetup"
3
-WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@"
3
+WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@"
44
--- 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

Keyboard Shortcuts

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