Fossil SCM

Merge from trunk

ashish 2014-07-20 13:20 UTC ashish-ipv6 merge
Commit c4fca467f727745c95c61bfc2e725e2ddce3a433
161 files changed +1 +2 -2 +12 -12 -52 +1 -4 +1 -1 +46 -6 +46 -6 +25 -8 +9 +9 -7 +240 -331 +154 -103 +53 -53 +195 -55 +66 +1 -1 +55 +32 -2 +56 -13 +14 -14 +1 -1 +2 -2 +62 -38 +5 -17 +45 -37 +7 +21 -22 +18 -31 +18 -31 +89 -45 +22 -16 +55 -3 +79 -8 +75 -7 +2 -1 +18 -18 +155 -102 +1 -1 +48 -46 +196 -91 +191 -85 +10 -10 +17 -1 +91 -20 +19 -18 +8 +3 -63 +1 -1 +128 -40 +13 -12 +13 -12 +118 -42 +7 -7 -15 +258 -154 +15 -15 +5 -5 +3 -3 +3 -3 +12 -8 +1 +57 -31 +57 -31 +68 -25 +158 -55 +158 -55 +36 -11 +118 -49 +126 -123 +6 -6 +15 -15 +1 -1 +2 -1 +14 +1 -1 +322 -94 +58 +1 -2 +10 -6 +36 -27 +49 -48 +178 -1 +9 -9 +3 -3 +65 -36 +10 +614 -136 +7 -7 +5 -8 +9500 -6546 +107 -13 +24 -11 +16 -3 +22 -16 +35 -11 +1 -7 +18 -2 +104 -22 +13 -5 +28 -26 +605 -27 +32 +174 -97 +38 -45 +31 -31 +166 -154 +37 -16 +69 -62 +2 -2 +44 -5 +10 +41 -17 +74 -52 +197 -146 +31 -23 +16 -4 +7 -7 +68 -56 +3 -3 +28 -11 +2 +25 +4 -4 +1 +1 +88 -73 +3 +68 -57 +3 +2 +7 +140 -7 +4 +83 +471 -2 +17613 -14529 +1 -1 +1 -1 +23 -5 +83 -13 +83 -13 +96 -22 +5 +1 +29 -30 +6 +106 -26 +2 -1 +22 -22 +15 -15 +1 -1 +2 -3 +8 -8 +23 +95 -1 +9 -6 +9 -7 +7 -7
~ .fossil-settings/encoding-glob ~ BUILD.txt ~ COPYRIGHT-BSD2.txt - Makefile.Cygwin.in ~ Makefile.in ~ VERSION ~ auto.def ~ auto.def ~ autosetup/autosetup ~ autosetup/cc-shared.tcl ~ autosetup/cc.tcl ~ autosetup/config.guess ~ autosetup/config.sub ~ autosetup/jimsh0.c ~ autosetup/local.tcl - fossil.nsi ~ setup/fossil.iss ~ setup/fossil.nsi + setup/fossil.nsi ~ src/add.c ~ src/allrepo.c ~ src/attach.c ~ src/bag.c ~ src/bisect.c ~ src/blob.c ~ src/branch.c ~ src/browse.c ~ src/cache.c ~ src/captcha.c ~ src/cgi.c ~ src/cgi.c ~ src/checkin.c ~ src/checkout.c ~ src/clone.c ~ src/comformat.c ~ src/config.h ~ src/configure.c ~ src/content.c ~ src/db.c ~ src/delta.c ~ src/descendants.c ~ src/diff.c ~ src/diffcmd.c ~ src/event.c ~ src/export.c ~ src/file.c ~ src/finfo.c ~ src/fusefs.c ~ src/glob.c ~ src/gzip.c ~ src/http.c ~ src/http_socket.c ~ src/http_socket.c ~ src/http_ssl.c ~ src/http_transport.c ~ src/import.c ~ src/info.c ~ src/json.c ~ src/json_artifact.c ~ src/json_status.c ~ src/json_timeline.c ~ src/json_wiki.c ~ src/loadctrl.c ~ src/login.c ~ src/login.c ~ src/lookslike.c ~ src/main.c ~ src/main.c ~ src/main.mk ~ src/makemake.tcl ~ src/manifest.c ~ src/markdown.c ~ src/merge.c ~ src/merge3.c ~ src/mkindex.c ~ src/mkversion.c ~ src/moderate.c ~ src/name.c ~ src/path.c ~ src/popen.c ~ src/printf.c ~ src/rebuild.c ~ src/report.c ~ src/rss.c ~ src/schema.c ~ src/search.c ~ src/setup.c ~ src/sha1.c ~ src/shell.c ~ src/shun.c ~ src/sqlcmd.c ~ src/sqlite3.c ~ src/sqlite3.h ~ src/stash.c ~ src/stat.c ~ src/style.c ~ src/sync.c ~ src/tag.c ~ src/tar.c ~ src/th.c ~ src/th.h ~ src/th_lang.c ~ src/th_main.c ~ src/th_tcl.c ~ src/timeline.c ~ src/tkt.c ~ src/tktsetup.c ~ src/unicode.c ~ src/update.c ~ src/url.c ~ src/user.c ~ src/utf8.c ~ src/util.c ~ src/vfile.c ~ src/wiki.c ~ src/wikiformat.c ~ src/winfile.c ~ src/winhttp.c ~ src/wysiwyg.c ~ src/xfer.c ~ src/xfersetup.c ~ src/zip.c ~ test/comment.test ~ test/file1.test ~ test/graph-test-1.wiki ~ test/merge2.test ~ test/merge5.test ~ test/merge_renames.test ~ test/release-checklist.wiki ~ test/revert.test ~ test/subdir-b/readme.txt ~ test/subdir/one/two/three/four/five/six/readme.txt ~ test/test-page++.wiki ~ test/tester.tcl ~ test/th1-hooks-input.txt ~ test/th1-hooks.test ~ test/th1.test ~ test/utf.test ~ test/utf16be.txt ~ test/utf16le.txt ~ win/Makefile.PellesCGMake ~ win/Makefile.dmc ~ win/Makefile.mingw ~ win/Makefile.mingw.mistachkin ~ win/Makefile.msc ~ win/fossil.rc ~ win/include/dirent.h ~ www/branching.wiki ~ www/build.wiki ~ www/changes.wiki ~ www/concepts.wiki ~ www/fileformat.wiki ~ www/fossil-v-git.wiki ~ www/index.wiki ~ www/makefile.wiki ~ www/password.wiki ~ www/quickstart.wiki ~ www/server.wiki ~ www/shunning.wiki ~ www/sync.wiki ~ www/tickets.wiki
--- a/.fossil-settings/encoding-glob
+++ b/.fossil-settings/encoding-glob
@@ -0,0 +1 @@
1
+compat/zlib/cowin/fossil.rc
--- a/.fossil-settings/encoding-glob
+++ b/.fossil-settings/encoding-glob
@@ -0,0 +1 @@
 
--- a/.fossil-settings/encoding-glob
+++ b/.fossil-settings/encoding-glob
@@ -0,0 +1 @@
1 compat/zlib/cowin/fossil.rc
+2 -2
--- BUILD.txt
+++ BUILD.txt
@@ -22,11 +22,11 @@
2222
2323
cd win; nmake /f Makefile.msc
2424
2525
If you have trouble, or you want to do something fancy, just look at
2626
Makefile.classic. There are 6 configuration options that are all well
27
-commented. Instead of editing the Makefile.classic, consider copying
27
+commented. Instead of editing the Makefile.classic, consider copying
2828
Makefile.classic to an alternative name such as "GNUMakefile",
2929
"BSDMakefile", or "makefile" and editing the copy.
3030
3131
3232
BUILDING OUTSIDE THE SOURCE TREE
@@ -61,11 +61,11 @@
6161
Do not edit src/main.mk directly. Update src/makemake.tcl and
6262
then rerun it.
6363
6464
* The *.h header files are automatically generated using a program
6565
called "makeheaders". Source code to the makeheaders program is
66
- found in src/makeheaders.c. Documentation is found in
66
+ found in src/makeheaders.c. Documentation is found in
6767
src/makeheaders.html.
6868
6969
* Most *.c source files are preprocessed using a program called
7070
"translate". The sources to translate are found in src/translate.c.
7171
A header comment in src/translate.c explains in detail what it does.
7272
--- BUILD.txt
+++ BUILD.txt
@@ -22,11 +22,11 @@
22
23 cd win; nmake /f Makefile.msc
24
25 If you have trouble, or you want to do something fancy, just look at
26 Makefile.classic. There are 6 configuration options that are all well
27 commented. Instead of editing the Makefile.classic, consider copying
28 Makefile.classic to an alternative name such as "GNUMakefile",
29 "BSDMakefile", or "makefile" and editing the copy.
30
31
32 BUILDING OUTSIDE THE SOURCE TREE
@@ -61,11 +61,11 @@
61 Do not edit src/main.mk directly. Update src/makemake.tcl and
62 then rerun it.
63
64 * The *.h header files are automatically generated using a program
65 called "makeheaders". Source code to the makeheaders program is
66 found in src/makeheaders.c. Documentation is found in
67 src/makeheaders.html.
68
69 * Most *.c source files are preprocessed using a program called
70 "translate". The sources to translate are found in src/translate.c.
71 A header comment in src/translate.c explains in detail what it does.
72
--- BUILD.txt
+++ BUILD.txt
@@ -22,11 +22,11 @@
22
23 cd win; nmake /f Makefile.msc
24
25 If you have trouble, or you want to do something fancy, just look at
26 Makefile.classic. There are 6 configuration options that are all well
27 commented. Instead of editing the Makefile.classic, consider copying
28 Makefile.classic to an alternative name such as "GNUMakefile",
29 "BSDMakefile", or "makefile" and editing the copy.
30
31
32 BUILDING OUTSIDE THE SOURCE TREE
@@ -61,11 +61,11 @@
61 Do not edit src/main.mk directly. Update src/makemake.tcl and
62 then rerun it.
63
64 * The *.h header files are automatically generated using a program
65 called "makeheaders". Source code to the makeheaders program is
66 found in src/makeheaders.c. Documentation is found in
67 src/makeheaders.html.
68
69 * Most *.c source files are preprocessed using a program called
70 "translate". The sources to translate are found in src/translate.c.
71 A header comment in src/translate.c explains in detail what it does.
72
+12 -12
--- COPYRIGHT-BSD2.txt
+++ COPYRIGHT-BSD2.txt
@@ -1,31 +1,31 @@
11
Copyright 2007 D. Richard Hipp. All rights reserved.
22
3
-Redistribution and use in source and binary forms, with or
4
-without modification, are permitted provided that the
3
+Redistribution and use in source and binary forms, with or
4
+without modification, are permitted provided that the
55
following conditions are met:
66
77
1. Redistributions of source code must retain the above
8
- copyright notice, this list of conditions and the
8
+ copyright notice, this list of conditions and the
99
following disclaimer.
1010
1111
2. Redistributions in binary form must reproduce the above
1212
copyright notice, this list of conditions and the
1313
following disclaimer in the documentation and/or other
1414
materials provided with the distribution.
1515
16
-THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
17
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
17
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1818
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
-ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
19
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
2020
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
21
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
2323
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
2626
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
28
-The views and conclusions contained in the software and documentation
29
-are those of the authors and contributors and should not be interpreted
28
+The views and conclusions contained in the software and documentation
29
+are those of the authors and contributors and should not be interpreted
3030
as representing official policies, either expressed or implied, of anybody
3131
else.
3232
3333
DELETED Makefile.Cygwin.in
--- COPYRIGHT-BSD2.txt
+++ COPYRIGHT-BSD2.txt
@@ -1,31 +1,31 @@
1 Copyright 2007 D. Richard Hipp. All rights reserved.
2
3 Redistribution and use in source and binary forms, with or
4 without modification, are permitted provided that the
5 following conditions are met:
6
7 1. Redistributions of source code must retain the above
8 copyright notice, this list of conditions and the
9 following disclaimer.
10
11 2. Redistributions in binary form must reproduce the above
12 copyright notice, this list of conditions and the
13 following disclaimer in the documentation and/or other
14 materials provided with the distribution.
15
16 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
17 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
20 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 The views and conclusions contained in the software and documentation
29 are those of the authors and contributors and should not be interpreted
30 as representing official policies, either expressed or implied, of anybody
31 else.
32
33 ELETED Makefile.Cygwin.in
--- COPYRIGHT-BSD2.txt
+++ COPYRIGHT-BSD2.txt
@@ -1,31 +1,31 @@
1 Copyright 2007 D. Richard Hipp. All rights reserved.
2
3 Redistribution and use in source and binary forms, with or
4 without modification, are permitted provided that the
5 following conditions are met:
6
7 1. Redistributions of source code must retain the above
8 copyright notice, this list of conditions and the
9 following disclaimer.
10
11 2. Redistributions in binary form must reproduce the above
12 copyright notice, this list of conditions and the
13 following disclaimer in the documentation and/or other
14 materials provided with the distribution.
15
16 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
17 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
20 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 The views and conclusions contained in the software and documentation
29 are those of the authors and contributors and should not be interpreted
30 as representing official policies, either expressed or implied, of anybody
31 else.
32
33 ELETED Makefile.Cygwin.in
D Makefile.Cygwin.in
-52
--- a/Makefile.Cygwin.in
+++ b/Makefile.Cygwin.in
@@ -1,52 +0,0 @@
1
-#!/usr/bin/make
2
-#
3
-# This is the top-level makefile for Fossil when the build is occurring
4
-# on the Cygwin platform.
5
-#
6
-#### The toplevel directory of the source tree. Fossil can be built
7
-# in a directory that is separate from the source tree. Just change
8
-# the following to point from the build directory to the src/ folder.
9
-#
10
-SRCDIR = @srcdir@/src
11
-
12
-#### The directory into which object code files should be written.
13
-# Having a "./" prefix in the value of this variable breaks our use of the
14
-# "makeheaders" tool when running make on the MinGW platform, apparently
15
-# due to some command line argument manipulation performed automatically
16
-# by the shell.
17
-#
18
-#
19
-OBJDIR = bld
20
-
21
-#### C Compiler and options for use in building executables that
22
-# will run on the platform that is doing the build. This is used
23
-# to compile code-generator programs as part of the build process.
24
-# See TCC below for the C compiler for building the finished binary.
25
-#
26
-BCC = @CC_FOR_BUILD@
27
-
28
-#### The suffix to add to final executable file. When cross-compiling
29
-# to windows, make this ".exe". Otherwise leave it blank.
30
-#
31
-E = @EXEEXT@
32
-
33
-TCC = @CC@
34
-
35
-#### Tcl shell for use in running the fossil testsuite. If you do not
36
-# care about testing the end result, this can be blank.
37
-#
38
-TCLSH = tclsh
39
-
40
-LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
41
-TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @
42
-INSTALLDIR =$(DESTDIR)@prefix@/bin
43
-USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
44
-FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
45
-FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
46
-FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@
47
-SQLITE_CFLAG -DSQLITE_WINNT_MAX_PATH_CHARS=4096BYTES=4096
48
-SQLITE_CFLAGS +=TE_MAX_MMAP_SIZE=0x7fff0000
49
-
50
-include $(SRCDIR)/main.mk
51
-
52
-dis
--- a/Makefile.Cygwin.in
+++ b/Makefile.Cygwin.in
@@ -1,52 +0,0 @@
1 #!/usr/bin/make
2 #
3 # This is the top-level makefile for Fossil when the build is occurring
4 # on the Cygwin platform.
5 #
6 #### The toplevel directory of the source tree. Fossil can be built
7 # in a directory that is separate from the source tree. Just change
8 # the following to point from the build directory to the src/ folder.
9 #
10 SRCDIR = @srcdir@/src
11
12 #### The directory into which object code files should be written.
13 # Having a "./" prefix in the value of this variable breaks our use of the
14 # "makeheaders" tool when running make on the MinGW platform, apparently
15 # due to some command line argument manipulation performed automatically
16 # by the shell.
17 #
18 #
19 OBJDIR = bld
20
21 #### C Compiler and options for use in building executables that
22 # will run on the platform that is doing the build. This is used
23 # to compile code-generator programs as part of the build process.
24 # See TCC below for the C compiler for building the finished binary.
25 #
26 BCC = @CC_FOR_BUILD@
27
28 #### The suffix to add to final executable file. When cross-compiling
29 # to windows, make this ".exe". Otherwise leave it blank.
30 #
31 E = @EXEEXT@
32
33 TCC = @CC@
34
35 #### Tcl shell for use in running the fossil testsuite. If you do not
36 # care about testing the end result, this can be blank.
37 #
38 TCLSH = tclsh
39
40 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
41 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @
42 INSTALLDIR =$(DESTDIR)@prefix@/bin
43 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
44 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
45 FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
46 FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@
47 SQLITE_CFLAG -DSQLITE_WINNT_MAX_PATH_CHARS=4096BYTES=4096
48 SQLITE_CFLAGS +=TE_MAX_MMAP_SIZE=0x7fff0000
49
50 include $(SRCDIR)/main.mk
51
52 dis
--- a/Makefile.Cygwin.in
+++ b/Makefile.Cygwin.in
@@ -1,52 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
+1 -4
--- Makefile.in
+++ Makefile.in
@@ -37,16 +37,13 @@
3737
# care about testing the end result, this can be blank.
3838
#
3939
TCLSH = tclsh
4040
4141
LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42
-TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
42
+TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
4343
INSTALLDIR = $(DESTDIR)@prefix@/bin
4444
USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45
-FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46
-FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
47
-FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@
4845
4946
include $(SRCDIR)/main.mk
5047
5148
distclean: clean
5249
rm -f autoconfig.h config.log Makefile
5350
--- Makefile.in
+++ Makefile.in
@@ -37,16 +37,13 @@
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = tclsh
40
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46 FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
47 FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@
48
49 include $(SRCDIR)/main.mk
50
51 distclean: clean
52 rm -f autoconfig.h config.log Makefile
53
--- Makefile.in
+++ Makefile.in
@@ -37,16 +37,13 @@
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = tclsh
40
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
 
 
 
45
46 include $(SRCDIR)/main.mk
47
48 distclean: clean
49 rm -f autoconfig.h config.log Makefile
50
+1 -1
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1
-1.28
1
+1.30
22
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 1.28
2
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 1.30
2
+46 -6
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
44
55
options {
66
with-openssl:path|auto|none
77
=> {Look for openssl in the given path, or auto or none}
88
with-zlib:path => {Look for zlib in the given path}
9
+ with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
910
with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
1011
with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
1112
with-tcl-private-stubs=0
1213
=> {Enable Tcl integration via private stubs mechanism}
1314
internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
1415
static=0 => {Link a static executable}
1516
lineedit=1 => {Disable line editing}
17
+ fusefs=1 => {Disable the Fuse Filesystem}
1618
fossil-debug=0 => {Build with fossil debugging enabled}
1719
ipv6=1 => {Disable IPv6 support}
1820
json=0 => {Build with fossil JSON API enabled}
1921
}
2022
@@ -42,17 +44,17 @@
4244
# the code below will append -ldl to LIBS.
4345
#
4446
foreach extralibs {{} {-ldl}} {
4547
4648
# Locate the system SQLite by searching for sqlite3_open(). Then check
47
- # if sqlite3_wal_checkpoint() can be found as well. If we can find
48
- # open() but not wal_checkpoint(), then the system SQLite is too old
49
- # to link against fossil.
49
+ # if sqlite3_strglob() can be found as well. If we can find open() but
50
+ # not strglob(), then the system SQLite is too old to link against
51
+ # fossil.
5052
#
5153
if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
52
- if {![cc-check-function-in-lib sqlite3_wal_checkpoint sqlite3 $extralibs]} {
53
- user-error "system sqlite3 too old (require >= 3.7.0)"
54
+ if {![cc-check-function-in-lib sqlite3_strglob sqlite3 $extralibs]} {
55
+ user-error "system sqlite3 too old (require >= 3.7.17)"
5456
}
5557
5658
# Success. Update symbols and return.
5759
#
5860
define USE_SYSTEM_SQLITE 1
@@ -70,28 +72,38 @@
7072
define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
7173
}
7274
7375
if {[opt-bool fossil-debug]} {
7476
define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
77
+ msg-result "Debugging support enabled"
7578
}
7679
7780
if {[opt-bool json]} {
7881
# Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
7982
# is required in the CFLAGS because json*.c
8083
# have #ifdef guards around the whole file without
8184
# reading config.h first.
8285
define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
8386
define FOSSIL_ENABLE_JSON
87
+ msg-result "JSON support enabled"
88
+}
89
+
90
+if {[opt-bool with-th1-hooks]} {
91
+ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
92
+ define FOSSIL_ENABLE_TH1_HOOKS
93
+ msg-result "TH1 hooks support enabled"
8494
}
8595
8696
#if {[opt-bool markdown]} {
8797
# # no-op. Markdown is now enabled by default.
98
+# msg-result "Markdown support enabled"
8899
#}
89100
90101
if {[opt-bool static]} {
91102
# XXX: This will not work on all systems.
92103
define-append EXTRA_LDFLAGS -static
104
+ msg-result "Trying to link statically"
93105
}
94106
95107
if {[opt-bool ipv6]} {
96108
define-append EXTRA_CFLAGS -DWITH_IPV6
97109
msg-result "IPv6 support enabled"
@@ -236,10 +248,22 @@
236248
}
237249
} else {
238250
user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
239251
}
240252
}
253
+
254
+# Check for zlib, using the given location if specified
255
+set zlibpath [opt-val with-zlib]
256
+if {$zlibpath ne ""} {
257
+ cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
258
+ define-append EXTRA_CFLAGS -I$zlibpath
259
+ define-append EXTRA_LDFLAGS -L$zlibpath
260
+ msg-result "Using zlib from $zlibpath"
261
+}
262
+if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
263
+ user-error "zlib not found please install it or specify the location with --with-zlib"
264
+}
241265
242266
if {[opt-bool lineedit]} {
243267
# Need readline-compatible line editing
244268
cc-with {-includes stdio.h} {
245269
if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
@@ -258,16 +282,32 @@
258282
if {[string match *mingw* [get-define host]]} {
259283
define-append LIBS -lwsock32
260284
}
261285
}
262286
cc-check-function-in-lib iconv iconv
287
+cc-check-functions utime
288
+cc-check-functions usleep
289
+
290
+# Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
291
+if {![cc-check-functions getloadavg]} {
292
+ define FOSSIL_OMIT_LOAD_AVERAGE 1
293
+ msg-result "Load average support unavailable"
294
+}
263295
264296
# Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
265297
if {![cc-check-functions getpassphrase]} {
266298
# Haiku needs this
267299
cc-check-function-in-lib getpass bsd
268300
}
269301
cc-check-function-in-lib dlopen dl
302
+
303
+# Check for the FuseFS library
304
+if {[opt-bool fusefs]} {
305
+ if {[cc-check-function-in-lib fuse_mount fuse]} {
306
+ define FOSSIL_HAVE_FUSEFS 1
307
+ define-append LIBS -lfuse
308
+ msg-result "FuseFS support enabled"
309
+ }
310
+}
270311
271312
make-template Makefile.in
272
-make-template Makefile.Cygwin.in
273313
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
274314
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
4
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
 
9 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
10 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
11 with-tcl-private-stubs=0
12 => {Enable Tcl integration via private stubs mechanism}
13 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
14 static=0 => {Link a static executable}
15 lineedit=1 => {Disable line editing}
 
16 fossil-debug=0 => {Build with fossil debugging enabled}
17 ipv6=1 => {Disable IPv6 support}
18 json=0 => {Build with fossil JSON API enabled}
19 }
20
@@ -42,17 +44,17 @@
42 # the code below will append -ldl to LIBS.
43 #
44 foreach extralibs {{} {-ldl}} {
45
46 # Locate the system SQLite by searching for sqlite3_open(). Then check
47 # if sqlite3_wal_checkpoint() can be found as well. If we can find
48 # open() but not wal_checkpoint(), then the system SQLite is too old
49 # to link against fossil.
50 #
51 if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
52 if {![cc-check-function-in-lib sqlite3_wal_checkpoint sqlite3 $extralibs]} {
53 user-error "system sqlite3 too old (require >= 3.7.0)"
54 }
55
56 # Success. Update symbols and return.
57 #
58 define USE_SYSTEM_SQLITE 1
@@ -70,28 +72,38 @@
70 define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
71 }
72
73 if {[opt-bool fossil-debug]} {
74 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
 
75 }
76
77 if {[opt-bool json]} {
78 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
79 # is required in the CFLAGS because json*.c
80 # have #ifdef guards around the whole file without
81 # reading config.h first.
82 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
83 define FOSSIL_ENABLE_JSON
 
 
 
 
 
 
 
84 }
85
86 #if {[opt-bool markdown]} {
87 # # no-op. Markdown is now enabled by default.
 
88 #}
89
90 if {[opt-bool static]} {
91 # XXX: This will not work on all systems.
92 define-append EXTRA_LDFLAGS -static
 
93 }
94
95 if {[opt-bool ipv6]} {
96 define-append EXTRA_CFLAGS -DWITH_IPV6
97 msg-result "IPv6 support enabled"
@@ -236,10 +248,22 @@
236 }
237 } else {
238 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
239 }
240 }
 
 
 
 
 
 
 
 
 
 
 
 
241
242 if {[opt-bool lineedit]} {
243 # Need readline-compatible line editing
244 cc-with {-includes stdio.h} {
245 if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
@@ -258,16 +282,32 @@
258 if {[string match *mingw* [get-define host]]} {
259 define-append LIBS -lwsock32
260 }
261 }
262 cc-check-function-in-lib iconv iconv
 
 
 
 
 
 
 
 
263
264 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
265 if {![cc-check-functions getpassphrase]} {
266 # Haiku needs this
267 cc-check-function-in-lib getpass bsd
268 }
269 cc-check-function-in-lib dlopen dl
 
 
 
 
 
 
 
 
 
270
271 make-template Makefile.in
272 make-template Makefile.Cygwin.in
273 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
274
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
4
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
9 with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
10 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
11 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
12 with-tcl-private-stubs=0
13 => {Enable Tcl integration via private stubs mechanism}
14 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
15 static=0 => {Link a static executable}
16 lineedit=1 => {Disable line editing}
17 fusefs=1 => {Disable the Fuse Filesystem}
18 fossil-debug=0 => {Build with fossil debugging enabled}
19 ipv6=1 => {Disable IPv6 support}
20 json=0 => {Build with fossil JSON API enabled}
21 }
22
@@ -42,17 +44,17 @@
44 # the code below will append -ldl to LIBS.
45 #
46 foreach extralibs {{} {-ldl}} {
47
48 # Locate the system SQLite by searching for sqlite3_open(). Then check
49 # if sqlite3_strglob() can be found as well. If we can find open() but
50 # not strglob(), then the system SQLite is too old to link against
51 # fossil.
52 #
53 if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
54 if {![cc-check-function-in-lib sqlite3_strglob sqlite3 $extralibs]} {
55 user-error "system sqlite3 too old (require >= 3.7.17)"
56 }
57
58 # Success. Update symbols and return.
59 #
60 define USE_SYSTEM_SQLITE 1
@@ -70,28 +72,38 @@
72 define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
73 }
74
75 if {[opt-bool fossil-debug]} {
76 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
77 msg-result "Debugging support enabled"
78 }
79
80 if {[opt-bool json]} {
81 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
82 # is required in the CFLAGS because json*.c
83 # have #ifdef guards around the whole file without
84 # reading config.h first.
85 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
86 define FOSSIL_ENABLE_JSON
87 msg-result "JSON support enabled"
88 }
89
90 if {[opt-bool with-th1-hooks]} {
91 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
92 define FOSSIL_ENABLE_TH1_HOOKS
93 msg-result "TH1 hooks support enabled"
94 }
95
96 #if {[opt-bool markdown]} {
97 # # no-op. Markdown is now enabled by default.
98 # msg-result "Markdown support enabled"
99 #}
100
101 if {[opt-bool static]} {
102 # XXX: This will not work on all systems.
103 define-append EXTRA_LDFLAGS -static
104 msg-result "Trying to link statically"
105 }
106
107 if {[opt-bool ipv6]} {
108 define-append EXTRA_CFLAGS -DWITH_IPV6
109 msg-result "IPv6 support enabled"
@@ -236,10 +248,22 @@
248 }
249 } else {
250 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
251 }
252 }
253
254 # Check for zlib, using the given location if specified
255 set zlibpath [opt-val with-zlib]
256 if {$zlibpath ne ""} {
257 cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
258 define-append EXTRA_CFLAGS -I$zlibpath
259 define-append EXTRA_LDFLAGS -L$zlibpath
260 msg-result "Using zlib from $zlibpath"
261 }
262 if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
263 user-error "zlib not found please install it or specify the location with --with-zlib"
264 }
265
266 if {[opt-bool lineedit]} {
267 # Need readline-compatible line editing
268 cc-with {-includes stdio.h} {
269 if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
@@ -258,16 +282,32 @@
282 if {[string match *mingw* [get-define host]]} {
283 define-append LIBS -lwsock32
284 }
285 }
286 cc-check-function-in-lib iconv iconv
287 cc-check-functions utime
288 cc-check-functions usleep
289
290 # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
291 if {![cc-check-functions getloadavg]} {
292 define FOSSIL_OMIT_LOAD_AVERAGE 1
293 msg-result "Load average support unavailable"
294 }
295
296 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
297 if {![cc-check-functions getpassphrase]} {
298 # Haiku needs this
299 cc-check-function-in-lib getpass bsd
300 }
301 cc-check-function-in-lib dlopen dl
302
303 # Check for the FuseFS library
304 if {[opt-bool fusefs]} {
305 if {[cc-check-function-in-lib fuse_mount fuse]} {
306 define FOSSIL_HAVE_FUSEFS 1
307 define-append LIBS -lfuse
308 msg-result "FuseFS support enabled"
309 }
310 }
311
312 make-template Makefile.in
 
313 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
314
+46 -6
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
44
55
options {
66
with-openssl:path|auto|none
77
=> {Look for openssl in the given path, or auto or none}
88
with-zlib:path => {Look for zlib in the given path}
9
+ with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
910
with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
1011
with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
1112
with-tcl-private-stubs=0
1213
=> {Enable Tcl integration via private stubs mechanism}
1314
internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
1415
static=0 => {Link a static executable}
1516
lineedit=1 => {Disable line editing}
17
+ fusefs=1 => {Disable the Fuse Filesystem}
1618
fossil-debug=0 => {Build with fossil debugging enabled}
1719
ipv6=1 => {Disable IPv6 support}
1820
json=0 => {Build with fossil JSON API enabled}
1921
}
2022
@@ -42,17 +44,17 @@
4244
# the code below will append -ldl to LIBS.
4345
#
4446
foreach extralibs {{} {-ldl}} {
4547
4648
# Locate the system SQLite by searching for sqlite3_open(). Then check
47
- # if sqlite3_wal_checkpoint() can be found as well. If we can find
48
- # open() but not wal_checkpoint(), then the system SQLite is too old
49
- # to link against fossil.
49
+ # if sqlite3_strglob() can be found as well. If we can find open() but
50
+ # not strglob(), then the system SQLite is too old to link against
51
+ # fossil.
5052
#
5153
if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
52
- if {![cc-check-function-in-lib sqlite3_wal_checkpoint sqlite3 $extralibs]} {
53
- user-error "system sqlite3 too old (require >= 3.7.0)"
54
+ if {![cc-check-function-in-lib sqlite3_strglob sqlite3 $extralibs]} {
55
+ user-error "system sqlite3 too old (require >= 3.7.17)"
5456
}
5557
5658
# Success. Update symbols and return.
5759
#
5860
define USE_SYSTEM_SQLITE 1
@@ -70,28 +72,38 @@
7072
define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
7173
}
7274
7375
if {[opt-bool fossil-debug]} {
7476
define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
77
+ msg-result "Debugging support enabled"
7578
}
7679
7780
if {[opt-bool json]} {
7881
# Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
7982
# is required in the CFLAGS because json*.c
8083
# have #ifdef guards around the whole file without
8184
# reading config.h first.
8285
define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
8386
define FOSSIL_ENABLE_JSON
87
+ msg-result "JSON support enabled"
88
+}
89
+
90
+if {[opt-bool with-th1-hooks]} {
91
+ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
92
+ define FOSSIL_ENABLE_TH1_HOOKS
93
+ msg-result "TH1 hooks support enabled"
8494
}
8595
8696
#if {[opt-bool markdown]} {
8797
# # no-op. Markdown is now enabled by default.
98
+# msg-result "Markdown support enabled"
8899
#}
89100
90101
if {[opt-bool static]} {
91102
# XXX: This will not work on all systems.
92103
define-append EXTRA_LDFLAGS -static
104
+ msg-result "Trying to link statically"
93105
}
94106
95107
if {[opt-bool ipv6]} {
96108
define-append EXTRA_CFLAGS -DWITH_IPV6
97109
msg-result "IPv6 support enabled"
@@ -236,10 +248,22 @@
236248
}
237249
} else {
238250
user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
239251
}
240252
}
253
+
254
+# Check for zlib, using the given location if specified
255
+set zlibpath [opt-val with-zlib]
256
+if {$zlibpath ne ""} {
257
+ cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
258
+ define-append EXTRA_CFLAGS -I$zlibpath
259
+ define-append EXTRA_LDFLAGS -L$zlibpath
260
+ msg-result "Using zlib from $zlibpath"
261
+}
262
+if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
263
+ user-error "zlib not found please install it or specify the location with --with-zlib"
264
+}
241265
242266
if {[opt-bool lineedit]} {
243267
# Need readline-compatible line editing
244268
cc-with {-includes stdio.h} {
245269
if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
@@ -258,16 +282,32 @@
258282
if {[string match *mingw* [get-define host]]} {
259283
define-append LIBS -lwsock32
260284
}
261285
}
262286
cc-check-function-in-lib iconv iconv
287
+cc-check-functions utime
288
+cc-check-functions usleep
289
+
290
+# Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
291
+if {![cc-check-functions getloadavg]} {
292
+ define FOSSIL_OMIT_LOAD_AVERAGE 1
293
+ msg-result "Load average support unavailable"
294
+}
263295
264296
# Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
265297
if {![cc-check-functions getpassphrase]} {
266298
# Haiku needs this
267299
cc-check-function-in-lib getpass bsd
268300
}
269301
cc-check-function-in-lib dlopen dl
302
+
303
+# Check for the FuseFS library
304
+if {[opt-bool fusefs]} {
305
+ if {[cc-check-function-in-lib fuse_mount fuse]} {
306
+ define FOSSIL_HAVE_FUSEFS 1
307
+ define-append LIBS -lfuse
308
+ msg-result "FuseFS support enabled"
309
+ }
310
+}
270311
271312
make-template Makefile.in
272
-make-template Makefile.Cygwin.in
273313
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
274314
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
4
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
 
9 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
10 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
11 with-tcl-private-stubs=0
12 => {Enable Tcl integration via private stubs mechanism}
13 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
14 static=0 => {Link a static executable}
15 lineedit=1 => {Disable line editing}
 
16 fossil-debug=0 => {Build with fossil debugging enabled}
17 ipv6=1 => {Disable IPv6 support}
18 json=0 => {Build with fossil JSON API enabled}
19 }
20
@@ -42,17 +44,17 @@
42 # the code below will append -ldl to LIBS.
43 #
44 foreach extralibs {{} {-ldl}} {
45
46 # Locate the system SQLite by searching for sqlite3_open(). Then check
47 # if sqlite3_wal_checkpoint() can be found as well. If we can find
48 # open() but not wal_checkpoint(), then the system SQLite is too old
49 # to link against fossil.
50 #
51 if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
52 if {![cc-check-function-in-lib sqlite3_wal_checkpoint sqlite3 $extralibs]} {
53 user-error "system sqlite3 too old (require >= 3.7.0)"
54 }
55
56 # Success. Update symbols and return.
57 #
58 define USE_SYSTEM_SQLITE 1
@@ -70,28 +72,38 @@
70 define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
71 }
72
73 if {[opt-bool fossil-debug]} {
74 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
 
75 }
76
77 if {[opt-bool json]} {
78 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
79 # is required in the CFLAGS because json*.c
80 # have #ifdef guards around the whole file without
81 # reading config.h first.
82 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
83 define FOSSIL_ENABLE_JSON
 
 
 
 
 
 
 
84 }
85
86 #if {[opt-bool markdown]} {
87 # # no-op. Markdown is now enabled by default.
 
88 #}
89
90 if {[opt-bool static]} {
91 # XXX: This will not work on all systems.
92 define-append EXTRA_LDFLAGS -static
 
93 }
94
95 if {[opt-bool ipv6]} {
96 define-append EXTRA_CFLAGS -DWITH_IPV6
97 msg-result "IPv6 support enabled"
@@ -236,10 +248,22 @@
236 }
237 } else {
238 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
239 }
240 }
 
 
 
 
 
 
 
 
 
 
 
 
241
242 if {[opt-bool lineedit]} {
243 # Need readline-compatible line editing
244 cc-with {-includes stdio.h} {
245 if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
@@ -258,16 +282,32 @@
258 if {[string match *mingw* [get-define host]]} {
259 define-append LIBS -lwsock32
260 }
261 }
262 cc-check-function-in-lib iconv iconv
 
 
 
 
 
 
 
 
263
264 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
265 if {![cc-check-functions getpassphrase]} {
266 # Haiku needs this
267 cc-check-function-in-lib getpass bsd
268 }
269 cc-check-function-in-lib dlopen dl
 
 
 
 
 
 
 
 
 
270
271 make-template Makefile.in
272 make-template Makefile.Cygwin.in
273 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
274
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
4
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
9 with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
10 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
11 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
12 with-tcl-private-stubs=0
13 => {Enable Tcl integration via private stubs mechanism}
14 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
15 static=0 => {Link a static executable}
16 lineedit=1 => {Disable line editing}
17 fusefs=1 => {Disable the Fuse Filesystem}
18 fossil-debug=0 => {Build with fossil debugging enabled}
19 ipv6=1 => {Disable IPv6 support}
20 json=0 => {Build with fossil JSON API enabled}
21 }
22
@@ -42,17 +44,17 @@
44 # the code below will append -ldl to LIBS.
45 #
46 foreach extralibs {{} {-ldl}} {
47
48 # Locate the system SQLite by searching for sqlite3_open(). Then check
49 # if sqlite3_strglob() can be found as well. If we can find open() but
50 # not strglob(), then the system SQLite is too old to link against
51 # fossil.
52 #
53 if {[cc-check-function-in-lib sqlite3_open sqlite3 $extralibs]} {
54 if {![cc-check-function-in-lib sqlite3_strglob sqlite3 $extralibs]} {
55 user-error "system sqlite3 too old (require >= 3.7.17)"
56 }
57
58 # Success. Update symbols and return.
59 #
60 define USE_SYSTEM_SQLITE 1
@@ -70,28 +72,38 @@
72 define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
73 }
74
75 if {[opt-bool fossil-debug]} {
76 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
77 msg-result "Debugging support enabled"
78 }
79
80 if {[opt-bool json]} {
81 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
82 # is required in the CFLAGS because json*.c
83 # have #ifdef guards around the whole file without
84 # reading config.h first.
85 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
86 define FOSSIL_ENABLE_JSON
87 msg-result "JSON support enabled"
88 }
89
90 if {[opt-bool with-th1-hooks]} {
91 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
92 define FOSSIL_ENABLE_TH1_HOOKS
93 msg-result "TH1 hooks support enabled"
94 }
95
96 #if {[opt-bool markdown]} {
97 # # no-op. Markdown is now enabled by default.
98 # msg-result "Markdown support enabled"
99 #}
100
101 if {[opt-bool static]} {
102 # XXX: This will not work on all systems.
103 define-append EXTRA_LDFLAGS -static
104 msg-result "Trying to link statically"
105 }
106
107 if {[opt-bool ipv6]} {
108 define-append EXTRA_CFLAGS -DWITH_IPV6
109 msg-result "IPv6 support enabled"
@@ -236,10 +248,22 @@
248 }
249 } else {
250 user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support"
251 }
252 }
253
254 # Check for zlib, using the given location if specified
255 set zlibpath [opt-val with-zlib]
256 if {$zlibpath ne ""} {
257 cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
258 define-append EXTRA_CFLAGS -I$zlibpath
259 define-append EXTRA_LDFLAGS -L$zlibpath
260 msg-result "Using zlib from $zlibpath"
261 }
262 if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
263 user-error "zlib not found please install it or specify the location with --with-zlib"
264 }
265
266 if {[opt-bool lineedit]} {
267 # Need readline-compatible line editing
268 cc-with {-includes stdio.h} {
269 if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} {
@@ -258,16 +282,32 @@
282 if {[string match *mingw* [get-define host]]} {
283 define-append LIBS -lwsock32
284 }
285 }
286 cc-check-function-in-lib iconv iconv
287 cc-check-functions utime
288 cc-check-functions usleep
289
290 # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
291 if {![cc-check-functions getloadavg]} {
292 define FOSSIL_OMIT_LOAD_AVERAGE 1
293 msg-result "Load average support unavailable"
294 }
295
296 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
297 if {![cc-check-functions getpassphrase]} {
298 # Haiku needs this
299 cc-check-function-in-lib getpass bsd
300 }
301 cc-check-function-in-lib dlopen dl
302
303 # Check for the FuseFS library
304 if {[opt-bool fusefs]} {
305 if {[cc-check-function-in-lib fuse_mount fuse]} {
306 define FOSSIL_HAVE_FUSEFS 1
307 define-append LIBS -lfuse
308 msg-result "FuseFS support enabled"
309 }
310 }
311
312 make-template Makefile.in
 
313 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
314
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -925,11 +925,11 @@
925925
}
926926
927927
# Load module source in the global scope by executing the given command
928928
proc automf_load {args} {
929929
if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} {
930
- autosetup-full-error [error-dump $msg $opts]
930
+ autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
931931
}
932932
}
933933
934934
# Initial settings
935935
set autosetup(exe) $::argv0
@@ -1706,18 +1706,35 @@
17061706
return $msg
17071707
}
17081708
17091709
# Given the return from [catch {...} msg opts], returns an appropriate
17101710
# error message. A nice one for Jim and a less-nice one for Tcl.
1711
+# If 'fulltrace' is set, a full stack trace is provided.
1712
+# Otherwise a simple message is provided.
17111713
#
1712
-# This is designed for developer errors, e.g. in module code
1714
+# This is designed for developer errors, e.g. in module code or auto.def code
1715
+#
17131716
#
1714
-proc error-dump {msg opts} {
1717
+proc error-dump {msg opts fulltrace} {
17151718
if {$::autosetup(istcl)} {
1716
- return "Error: [dict get $opts -errorinfo]"
1719
+ if {$fulltrace} {
1720
+ return "Error: [dict get $opts -errorinfo]"
1721
+ } else {
1722
+ return "Error: $msg"
1723
+ }
17171724
} else {
1718
- return "Error: $msg\n[stackdump $opts(-errorinfo)]"
1725
+ lassign $opts(-errorinfo) p f l
1726
+ if {$f ne ""} {
1727
+ set result "$f:$l: Error: "
1728
+ }
1729
+ append result "$msg\n"
1730
+ if {$fulltrace} {
1731
+ append result [stackdump $opts(-errorinfo)]
1732
+ }
1733
+
1734
+ # Remove the trailing newline
1735
+ string trim $result
17191736
}
17201737
}
17211738
}
17221739
17231740
# ----- module text-formatting -----
@@ -1886,13 +1903,13 @@
18861903
# Entry/Exit
18871904
#
18881905
if {$autosetup(debug)} {
18891906
main $argv
18901907
}
1891
-if {[catch {main $argv} msg] == 1} {
1908
+if {[catch {main $argv} msg opts] == 1} {
18921909
show-notices
1893
- puts stderr [error-stacktrace $msg]
1894
- if {!$autosetup(debug) && !$autosetup(istcl)} {
1910
+ autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
1911
+ if {!$autosetup(debug)} {
18951912
puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace"
18961913
}
18971914
exit 1
18981915
}
18991916
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -925,11 +925,11 @@
925 }
926
927 # Load module source in the global scope by executing the given command
928 proc automf_load {args} {
929 if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} {
930 autosetup-full-error [error-dump $msg $opts]
931 }
932 }
933
934 # Initial settings
935 set autosetup(exe) $::argv0
@@ -1706,18 +1706,35 @@
1706 return $msg
1707 }
1708
1709 # Given the return from [catch {...} msg opts], returns an appropriate
1710 # error message. A nice one for Jim and a less-nice one for Tcl.
 
 
1711 #
1712 # This is designed for developer errors, e.g. in module code
 
1713 #
1714 proc error-dump {msg opts} {
1715 if {$::autosetup(istcl)} {
1716 return "Error: [dict get $opts -errorinfo]"
 
 
 
 
1717 } else {
1718 return "Error: $msg\n[stackdump $opts(-errorinfo)]"
 
 
 
 
 
 
 
 
 
 
1719 }
1720 }
1721 }
1722
1723 # ----- module text-formatting -----
@@ -1886,13 +1903,13 @@
1886 # Entry/Exit
1887 #
1888 if {$autosetup(debug)} {
1889 main $argv
1890 }
1891 if {[catch {main $argv} msg] == 1} {
1892 show-notices
1893 puts stderr [error-stacktrace $msg]
1894 if {!$autosetup(debug) && !$autosetup(istcl)} {
1895 puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace"
1896 }
1897 exit 1
1898 }
1899
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -925,11 +925,11 @@
925 }
926
927 # Load module source in the global scope by executing the given command
928 proc automf_load {args} {
929 if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} {
930 autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
931 }
932 }
933
934 # Initial settings
935 set autosetup(exe) $::argv0
@@ -1706,18 +1706,35 @@
1706 return $msg
1707 }
1708
1709 # Given the return from [catch {...} msg opts], returns an appropriate
1710 # error message. A nice one for Jim and a less-nice one for Tcl.
1711 # If 'fulltrace' is set, a full stack trace is provided.
1712 # Otherwise a simple message is provided.
1713 #
1714 # This is designed for developer errors, e.g. in module code or auto.def code
1715 #
1716 #
1717 proc error-dump {msg opts fulltrace} {
1718 if {$::autosetup(istcl)} {
1719 if {$fulltrace} {
1720 return "Error: [dict get $opts -errorinfo]"
1721 } else {
1722 return "Error: $msg"
1723 }
1724 } else {
1725 lassign $opts(-errorinfo) p f l
1726 if {$f ne ""} {
1727 set result "$f:$l: Error: "
1728 }
1729 append result "$msg\n"
1730 if {$fulltrace} {
1731 append result [stackdump $opts(-errorinfo)]
1732 }
1733
1734 # Remove the trailing newline
1735 string trim $result
1736 }
1737 }
1738 }
1739
1740 # ----- module text-formatting -----
@@ -1886,13 +1903,13 @@
1903 # Entry/Exit
1904 #
1905 if {$autosetup(debug)} {
1906 main $argv
1907 }
1908 if {[catch {main $argv} msg opts] == 1} {
1909 show-notices
1910 autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
1911 if {!$autosetup(debug)} {
1912 puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace"
1913 }
1914 exit 1
1915 }
1916
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -94,10 +94,19 @@
9494
define SHOBJ_LDFLAGS -b
9595
define SH_CFLAGS +z
9696
define SH_LINKFLAGS -Wl,+s
9797
define LD_LIBRARY_PATH SHLIB_PATH
9898
}
99
+ *-*-haiku {
100
+ define SHOBJ_CFLAGS ""
101
+ define SHOBJ_LDFLAGS -shared
102
+ define SH_CFLAGS ""
103
+ define SH_LDFLAGS -shared
104
+ define SH_LINKFLAGS ""
105
+ define SH_SOPREFIX ""
106
+ define LD_LIBRARY_PATH LIBRARY_PATH
107
+ }
99108
}
100109
101110
if {![is-defined SHOBJ_LDFLAGS_R]} {
102111
define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
103112
}
104113
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -94,10 +94,19 @@
94 define SHOBJ_LDFLAGS -b
95 define SH_CFLAGS +z
96 define SH_LINKFLAGS -Wl,+s
97 define LD_LIBRARY_PATH SHLIB_PATH
98 }
 
 
 
 
 
 
 
 
 
99 }
100
101 if {![is-defined SHOBJ_LDFLAGS_R]} {
102 define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
103 }
104
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -94,10 +94,19 @@
94 define SHOBJ_LDFLAGS -b
95 define SH_CFLAGS +z
96 define SH_LINKFLAGS -Wl,+s
97 define LD_LIBRARY_PATH SHLIB_PATH
98 }
99 *-*-haiku {
100 define SHOBJ_CFLAGS ""
101 define SHOBJ_LDFLAGS -shared
102 define SH_CFLAGS ""
103 define SH_LDFLAGS -shared
104 define SH_LINKFLAGS ""
105 define SH_SOPREFIX ""
106 define LD_LIBRARY_PATH LIBRARY_PATH
107 }
108 }
109
110 if {![is-defined SHOBJ_LDFLAGS_R]} {
111 define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
112 }
113
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -333,11 +333,11 @@
333333
}
334334
-libs {
335335
# Note that new libraries are added before previous libraries
336336
set new($name) [list {*}$value {*}$new($name)]
337337
}
338
- -link - -lang {
338
+ -link - -lang - -nooutput {
339339
set new($name) $value
340340
}
341341
-source - -sourcefile - -code {
342342
# XXX: These probably are only valid directly from cctest
343343
set new($name) $value
@@ -428,10 +428,11 @@
428428
## -lang c|c++ Use the C (default) or C++ compiler
429429
## -libs liblist List of libraries to link, e.g. {-ldl -lm}
430430
## -code code Code to compile in the body of main()
431431
## -source code Compile a complete program. Ignore -includes, -declare and -code
432432
## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file]
433
+## -nooutput 1 Treat any compiler output (e.g. a warning) as an error
433434
#
434435
# Unless -source or -sourcefile is specified, the C program looks like:
435436
#
436437
## #include <firstinclude> /* same for remaining includes in the list */
437438
##
@@ -521,11 +522,12 @@
521522
}
522523
523524
writefile $src $lines\n
524525
525526
set ok 1
526
- if {[catch {exec-with-stderr {*}$cmdline} result errinfo]} {
527
+ set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
528
+ if {$err || ($opts(-nooutput) && [string length $result])} {
527529
configlog "Failed: [join $cmdline]"
528530
configlog $result
529531
configlog "============"
530532
configlog "The failed code was:"
531533
configlog $lines
@@ -671,27 +673,27 @@
671673
}
672674
673675
define CCACHE [find-an-executable [get-env CCACHE ccache]]
674676
675677
# Initial cctest settings
676
-cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {}}
678
+cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0}
677679
set autosetup(cc-include-deps) {}
678680
679681
msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]"
680682
if {[get-define CXX] ne "false"} {
681683
msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]"
682684
}
683685
msg-result "Build C compiler...[get-define CC_FOR_BUILD]"
684686
685
-# On Darwin, we prefer to use -gstabs to avoid creating .dSYM directories
686
-# but some compilers don't support -gstabs, so test for it here.
687
+# On Darwin, we prefer to use -g0 to avoid creating .dSYM directories
688
+# but some compilers may not support it, so test here.
687689
switch -glob -- [get-define host] {
688690
*-*-darwin* {
689
- if {[cctest -cflags {-gstabs}]} {
690
- define cc-default-debug -gstabs
691
+ if {[cctest -cflags {-g0}]} {
692
+ define cc-default-debug -g0
691693
}
692694
}
693695
}
694696
695697
if {![cc-check-includes stdlib.h]} {
696698
user-error "Compiler does not work. See config.log"
697699
}
698700
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -333,11 +333,11 @@
333 }
334 -libs {
335 # Note that new libraries are added before previous libraries
336 set new($name) [list {*}$value {*}$new($name)]
337 }
338 -link - -lang {
339 set new($name) $value
340 }
341 -source - -sourcefile - -code {
342 # XXX: These probably are only valid directly from cctest
343 set new($name) $value
@@ -428,10 +428,11 @@
428 ## -lang c|c++ Use the C (default) or C++ compiler
429 ## -libs liblist List of libraries to link, e.g. {-ldl -lm}
430 ## -code code Code to compile in the body of main()
431 ## -source code Compile a complete program. Ignore -includes, -declare and -code
432 ## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file]
 
433 #
434 # Unless -source or -sourcefile is specified, the C program looks like:
435 #
436 ## #include <firstinclude> /* same for remaining includes in the list */
437 ##
@@ -521,11 +522,12 @@
521 }
522
523 writefile $src $lines\n
524
525 set ok 1
526 if {[catch {exec-with-stderr {*}$cmdline} result errinfo]} {
 
527 configlog "Failed: [join $cmdline]"
528 configlog $result
529 configlog "============"
530 configlog "The failed code was:"
531 configlog $lines
@@ -671,27 +673,27 @@
671 }
672
673 define CCACHE [find-an-executable [get-env CCACHE ccache]]
674
675 # Initial cctest settings
676 cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {}}
677 set autosetup(cc-include-deps) {}
678
679 msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]"
680 if {[get-define CXX] ne "false"} {
681 msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]"
682 }
683 msg-result "Build C compiler...[get-define CC_FOR_BUILD]"
684
685 # On Darwin, we prefer to use -gstabs to avoid creating .dSYM directories
686 # but some compilers don't support -gstabs, so test for it here.
687 switch -glob -- [get-define host] {
688 *-*-darwin* {
689 if {[cctest -cflags {-gstabs}]} {
690 define cc-default-debug -gstabs
691 }
692 }
693 }
694
695 if {![cc-check-includes stdlib.h]} {
696 user-error "Compiler does not work. See config.log"
697 }
698
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -333,11 +333,11 @@
333 }
334 -libs {
335 # Note that new libraries are added before previous libraries
336 set new($name) [list {*}$value {*}$new($name)]
337 }
338 -link - -lang - -nooutput {
339 set new($name) $value
340 }
341 -source - -sourcefile - -code {
342 # XXX: These probably are only valid directly from cctest
343 set new($name) $value
@@ -428,10 +428,11 @@
428 ## -lang c|c++ Use the C (default) or C++ compiler
429 ## -libs liblist List of libraries to link, e.g. {-ldl -lm}
430 ## -code code Code to compile in the body of main()
431 ## -source code Compile a complete program. Ignore -includes, -declare and -code
432 ## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file]
433 ## -nooutput 1 Treat any compiler output (e.g. a warning) as an error
434 #
435 # Unless -source or -sourcefile is specified, the C program looks like:
436 #
437 ## #include <firstinclude> /* same for remaining includes in the list */
438 ##
@@ -521,11 +522,12 @@
522 }
523
524 writefile $src $lines\n
525
526 set ok 1
527 set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
528 if {$err || ($opts(-nooutput) && [string length $result])} {
529 configlog "Failed: [join $cmdline]"
530 configlog $result
531 configlog "============"
532 configlog "The failed code was:"
533 configlog $lines
@@ -671,27 +673,27 @@
673 }
674
675 define CCACHE [find-an-executable [get-env CCACHE ccache]]
676
677 # Initial cctest settings
678 cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0}
679 set autosetup(cc-include-deps) {}
680
681 msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]"
682 if {[get-define CXX] ne "false"} {
683 msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]"
684 }
685 msg-result "Build C compiler...[get-define CC_FOR_BUILD]"
686
687 # On Darwin, we prefer to use -g0 to avoid creating .dSYM directories
688 # but some compilers may not support it, so test here.
689 switch -glob -- [get-define host] {
690 *-*-darwin* {
691 if {[cctest -cflags {-g0}]} {
692 define cc-default-debug -g0
693 }
694 }
695 }
696
697 if {![cc-check-includes stdlib.h]} {
698 user-error "Compiler does not work. See config.log"
699 }
700
--- autosetup/config.guess
+++ autosetup/config.guess
@@ -1,44 +1,38 @@
11
#! /bin/sh
22
# Attempt to guess a canonical system name.
3
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5
-# Free Software Foundation, Inc.
3
+# Copyright 1992-2014 Free Software Foundation, Inc.
64
7
-timestamp='2010-09-24'
5
+timestamp='2014-03-23'
86
97
# This file is free software; you can redistribute it and/or modify it
108
# under the terms of the GNU General Public License as published by
11
-# the Free Software Foundation; either version 2 of the License, or
9
+# the Free Software Foundation; either version 3 of the License, or
1210
# (at your option) any later version.
1311
#
1412
# This program is distributed in the hope that it will be useful, but
1513
# WITHOUT ANY WARRANTY; without even the implied warranty of
1614
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1715
# General Public License for more details.
1816
#
1917
# You should have received a copy of the GNU General Public License
20
-# along with this program; if not, write to the Free Software
21
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22
-# 02110-1301, USA.
18
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
2319
#
2420
# As a special exception to the GNU General Public License, if you
2521
# distribute this file as part of a program that contains a
2622
# configuration script generated by Autoconf, you may include it under
27
-# the same distribution terms that you use for the rest of that program.
28
-
29
-
30
-# Originally written by Per Bothner. Please send patches (context
31
-# diff format) to <[email protected]> and include a ChangeLog
32
-# entry.
33
-#
34
-# This script attempts to guess a canonical system name similar to
35
-# config.sub. If it succeeds, it prints the system name on stdout, and
36
-# exits with 0. Otherwise, it exits with 1.
23
+# the same distribution terms that you use for the rest of that
24
+# program. This Exception is an additional permission under section 7
25
+# of the GNU General Public License, version 3 ("GPLv3").
26
+#
27
+# Originally written by Per Bothner.
3728
#
3829
# You can get the latest version of this script from:
3930
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
31
+#
32
+# Please send patches with a ChangeLog entry to [email protected].
33
+
4034
4135
me=`echo "$0" | sed -e 's,.*/,,'`
4236
4337
usage="\
4438
Usage: $0 [OPTION]
@@ -54,13 +48,11 @@
5448
5549
version="\
5650
GNU config.guess ($timestamp)
5751
5852
Originally written by Per Bothner.
59
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61
-Software Foundation, Inc.
53
+Copyright 1992-2014 Free Software Foundation, Inc.
6254
6355
This is free software; see the source for copying conditions. There is NO
6456
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6557
6658
help="
@@ -90,11 +82,11 @@
9082
if test $# != 0; then
9183
echo "$me: too many arguments$help" >&2
9284
exit 1
9385
fi
9486
95
-trap 'exit 1' HUP INT TERM
87
+trap 'exit 1' 1 2 15
9688
9789
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9890
# compiler to aid in system detection is discouraged as it requires
9991
# temporary files to be created and, as you can see below, it is a
10092
# headache to deal with in a portable fashion.
@@ -104,11 +96,11 @@
10496
10597
# Portable tmp directory creation inspired by the Autoconf team.
10698
10799
set_cc_for_build='
108100
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
101
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110102
: ${TMPDIR=/tmp} ;
111103
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112104
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113105
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114106
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -137,17 +129,38 @@
137129
138130
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
139131
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
140132
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
141133
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134
+
135
+case "${UNAME_SYSTEM}" in
136
+Linux|GNU|GNU/*)
137
+ # If the system lacks a compiler, then just pick glibc.
138
+ # We could probably try harder.
139
+ LIBC=gnu
140
+
141
+ eval $set_cc_for_build
142
+ cat <<-EOF > $dummy.c
143
+ #include <features.h>
144
+ #if defined(__UCLIBC__)
145
+ LIBC=uclibc
146
+ #elif defined(__dietlibc__)
147
+ LIBC=dietlibc
148
+ #else
149
+ LIBC=gnu
150
+ #endif
151
+ EOF
152
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
153
+ ;;
154
+esac
142155
143156
# Note: order is significant - the case branches are not exclusive.
144157
145158
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146159
*:NetBSD:*:*)
147160
# NetBSD (nbsd) targets should (where applicable) match one or
148
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
161
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
149162
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
150163
# switched to ELF, *-*-netbsd* would select the old
151164
# object file format. This provides both forward
152165
# compatibility and a consistent mechanism for selecting the
153166
# object file format.
@@ -179,11 +192,11 @@
179192
else
180193
os=netbsdelf
181194
fi
182195
;;
183196
*)
184
- os=netbsd
197
+ os=netbsd
185198
;;
186199
esac
187200
# The OS release
188201
# Debian GNU/NetBSD machines have a different userland, and
189202
# thus, need a distinct triplet. However, they do not need
@@ -200,10 +213,14 @@
200213
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201214
# contains redundant information, the shorter form:
202215
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203216
echo "${machine}-${os}${release}"
204217
exit ;;
218
+ *:Bitrig:*:*)
219
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
220
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
221
+ exit ;;
205222
*:OpenBSD:*:*)
206223
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207224
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208225
exit ;;
209226
*:ekkoBSD:*:*)
@@ -222,11 +239,11 @@
222239
case $UNAME_RELEASE in
223240
*4.0)
224241
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225242
;;
226243
*5.*)
227
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
244
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228245
;;
229246
esac
230247
# According to Compaq, /usr/sbin/psrinfo has been available on
231248
# OSF/1 and Tru64 systems produced since 1995. I hope that
232249
# covers most systems running today. This code pipes the CPU
@@ -268,11 +285,14 @@
268285
# A Vn.n version is a released version.
269286
# A Tn.n version is a released field test version.
270287
# A Xn.n version is an unreleased experimental baselevel.
271288
# 1.2 uses "1.2" for uname -r.
272289
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273
- exit ;;
290
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
291
+ exitcode=$?
292
+ trap '' 0
293
+ exit $exitcode ;;
274294
Alpha\ *:Windows_NT*:*)
275295
# How do we know it's Interix rather than the generic POSIX subsystem?
276296
# Should we change UNAME_MACHINE based on the output of uname instead
277297
# of the specific Alpha model?
278298
echo alpha-pc-interix
@@ -294,16 +314,16 @@
294314
exit ;;
295315
*:z/VM:*:*)
296316
echo s390-ibm-zvmoe
297317
exit ;;
298318
*:OS400:*:*)
299
- echo powerpc-ibm-os400
319
+ echo powerpc-ibm-os400
300320
exit ;;
301321
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
302322
echo arm-acorn-riscix${UNAME_RELEASE}
303323
exit ;;
304
- arm:riscos:*:*|arm:RISCOS:*:*)
324
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
305325
echo arm-unknown-riscos
306326
exit ;;
307327
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
308328
echo hppa1.1-hitachi-hiuxmpp
309329
exit ;;
@@ -393,27 +413,27 @@
393413
# to the lowercase version "mint" (or "freemint"). Finally
394414
# the system name "TOS" denotes a system which is actually not
395415
# MiNT. But MiNT is downward compatible to TOS, so this should
396416
# be no problem.
397417
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
398
- echo m68k-atari-mint${UNAME_RELEASE}
418
+ echo m68k-atari-mint${UNAME_RELEASE}
399419
exit ;;
400420
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
401421
echo m68k-atari-mint${UNAME_RELEASE}
402
- exit ;;
422
+ exit ;;
403423
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
404
- echo m68k-atari-mint${UNAME_RELEASE}
424
+ echo m68k-atari-mint${UNAME_RELEASE}
405425
exit ;;
406426
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
407
- echo m68k-milan-mint${UNAME_RELEASE}
408
- exit ;;
427
+ echo m68k-milan-mint${UNAME_RELEASE}
428
+ exit ;;
409429
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
410
- echo m68k-hades-mint${UNAME_RELEASE}
411
- exit ;;
430
+ echo m68k-hades-mint${UNAME_RELEASE}
431
+ exit ;;
412432
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
413
- echo m68k-unknown-mint${UNAME_RELEASE}
414
- exit ;;
433
+ echo m68k-unknown-mint${UNAME_RELEASE}
434
+ exit ;;
415435
m68k:machten:*:*)
416436
echo m68k-apple-machten${UNAME_RELEASE}
417437
exit ;;
418438
powerpc:machten:*:*)
419439
echo powerpc-apple-machten${UNAME_RELEASE}
@@ -479,12 +499,12 @@
479499
exit ;;
480500
m88k:*:3*:R3*)
481501
echo m88k-motorola-sysv3
482502
exit ;;
483503
AViiON:dgux:*:*)
484
- # DG/UX returns AViiON for all architectures
485
- UNAME_PROCESSOR=`/usr/bin/uname -p`
504
+ # DG/UX returns AViiON for all architectures
505
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
486506
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
487507
then
488508
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
489509
[ ${TARGET_BINARY_INTERFACE}x = x ]
490510
then
@@ -493,11 +513,11 @@
493513
echo m88k-dg-dguxbcs${UNAME_RELEASE}
494514
fi
495515
else
496516
echo i586-dg-dgux${UNAME_RELEASE}
497517
fi
498
- exit ;;
518
+ exit ;;
499519
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
500520
echo m88k-dolphin-sysv3
501521
exit ;;
502522
M88*:*:R3*:*)
503523
# Delta 88k system running SVR3
@@ -593,56 +613,56 @@
593613
9000/31? ) HP_ARCH=m68000 ;;
594614
9000/[34]?? ) HP_ARCH=m68k ;;
595615
9000/[678][0-9][0-9])
596616
if [ -x /usr/bin/getconf ]; then
597617
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
598
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
599
- case "${sc_cpu_version}" in
600
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
601
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
602
- 532) # CPU_PA_RISC2_0
603
- case "${sc_kernel_bits}" in
604
- 32) HP_ARCH="hppa2.0n" ;;
605
- 64) HP_ARCH="hppa2.0w" ;;
618
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619
+ case "${sc_cpu_version}" in
620
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
622
+ 532) # CPU_PA_RISC2_0
623
+ case "${sc_kernel_bits}" in
624
+ 32) HP_ARCH="hppa2.0n" ;;
625
+ 64) HP_ARCH="hppa2.0w" ;;
606626
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
607
- esac ;;
608
- esac
627
+ esac ;;
628
+ esac
609629
fi
610630
if [ "${HP_ARCH}" = "" ]; then
611631
eval $set_cc_for_build
612
- sed 's/^ //' << EOF >$dummy.c
613
-
614
- #define _HPUX_SOURCE
615
- #include <stdlib.h>
616
- #include <unistd.h>
617
-
618
- int main ()
619
- {
620
- #if defined(_SC_KERNEL_BITS)
621
- long bits = sysconf(_SC_KERNEL_BITS);
622
- #endif
623
- long cpu = sysconf (_SC_CPU_VERSION);
624
-
625
- switch (cpu)
626
- {
627
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
628
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
629
- case CPU_PA_RISC2_0:
630
- #if defined(_SC_KERNEL_BITS)
631
- switch (bits)
632
- {
633
- case 64: puts ("hppa2.0w"); break;
634
- case 32: puts ("hppa2.0n"); break;
635
- default: puts ("hppa2.0"); break;
636
- } break;
637
- #else /* !defined(_SC_KERNEL_BITS) */
638
- puts ("hppa2.0"); break;
639
- #endif
640
- default: puts ("hppa1.0"); break;
641
- }
642
- exit (0);
643
- }
632
+ sed 's/^ //' << EOF >$dummy.c
633
+
634
+ #define _HPUX_SOURCE
635
+ #include <stdlib.h>
636
+ #include <unistd.h>
637
+
638
+ int main ()
639
+ {
640
+ #if defined(_SC_KERNEL_BITS)
641
+ long bits = sysconf(_SC_KERNEL_BITS);
642
+ #endif
643
+ long cpu = sysconf (_SC_CPU_VERSION);
644
+
645
+ switch (cpu)
646
+ {
647
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
648
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
649
+ case CPU_PA_RISC2_0:
650
+ #if defined(_SC_KERNEL_BITS)
651
+ switch (bits)
652
+ {
653
+ case 64: puts ("hppa2.0w"); break;
654
+ case 32: puts ("hppa2.0n"); break;
655
+ default: puts ("hppa2.0"); break;
656
+ } break;
657
+ #else /* !defined(_SC_KERNEL_BITS) */
658
+ puts ("hppa2.0"); break;
659
+ #endif
660
+ default: puts ("hppa1.0"); break;
661
+ }
662
+ exit (0);
663
+ }
644664
EOF
645665
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
646666
test -z "$HP_ARCH" && HP_ARCH=hppa
647667
fi ;;
648668
esac
@@ -729,26 +749,26 @@
729749
parisc*:Lites*:*:*)
730750
echo hppa1.1-hp-lites
731751
exit ;;
732752
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
733753
echo c1-convex-bsd
734
- exit ;;
754
+ exit ;;
735755
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
736756
if getsysinfo -f scalar_acc
737757
then echo c32-convex-bsd
738758
else echo c2-convex-bsd
739759
fi
740
- exit ;;
760
+ exit ;;
741761
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
742762
echo c34-convex-bsd
743
- exit ;;
763
+ exit ;;
744764
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
745765
echo c38-convex-bsd
746
- exit ;;
766
+ exit ;;
747767
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
748768
echo c4-convex-bsd
749
- exit ;;
769
+ exit ;;
750770
CRAY*Y-MP:*:*:*)
751771
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752772
exit ;;
753773
CRAY*[A-Z]90:*:*:*)
754774
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
@@ -768,18 +788,18 @@
768788
*:UNICOS/mp:*:*)
769789
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
770790
exit ;;
771791
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
772792
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
773
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
774
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
775
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
776
- exit ;;
793
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
795
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796
+ exit ;;
777797
5000:UNIX_System_V:4.*:*)
778
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
779
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
780
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
798
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
800
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
781801
exit ;;
782802
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
783803
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
784804
exit ;;
785805
sparc*:BSD/OS:*:*)
@@ -787,37 +807,39 @@
787807
exit ;;
788808
*:BSD/OS:*:*)
789809
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
790810
exit ;;
791811
*:FreeBSD:*:*)
792
- case ${UNAME_MACHINE} in
793
- pc98)
794
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
812
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
813
+ case ${UNAME_PROCESSOR} in
795814
amd64)
796815
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797816
*)
798
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
817
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799818
esac
800819
exit ;;
801820
i*:CYGWIN*:*)
802821
echo ${UNAME_MACHINE}-pc-cygwin
803822
exit ;;
823
+ *:MINGW64*:*)
824
+ echo ${UNAME_MACHINE}-pc-mingw64
825
+ exit ;;
804826
*:MINGW*:*)
805827
echo ${UNAME_MACHINE}-pc-mingw32
806828
exit ;;
807
- i*:MSYS*:*)
808
- echo ${UNAME_MACHINE}-pc-msys
809
- exit ;;
829
+ *:MSYS*:*)
830
+ echo ${UNAME_MACHINE}-pc-msys
831
+ exit ;;
810832
i*:windows32*:*)
811
- # uname -m includes "-pc" on this system.
812
- echo ${UNAME_MACHINE}-mingw32
833
+ # uname -m includes "-pc" on this system.
834
+ echo ${UNAME_MACHINE}-mingw32
813835
exit ;;
814836
i*:PW*:*)
815837
echo ${UNAME_MACHINE}-pc-pw32
816838
exit ;;
817839
*:Interix*:*)
818
- case ${UNAME_MACHINE} in
840
+ case ${UNAME_MACHINE} in
819841
x86)
820842
echo i586-pc-interix${UNAME_RELEASE}
821843
exit ;;
822844
authenticamd | genuineintel | EM64T)
823845
echo x86_64-unknown-interix${UNAME_RELEASE}
@@ -850,74 +872,85 @@
850872
prep*:SunOS:5.*:*)
851873
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
852874
exit ;;
853875
*:GNU:*:*)
854876
# the GNU system
855
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
877
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
856878
exit ;;
857879
*:GNU/*:*:*)
858880
# other systems with GNU libc and userland
859
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
881
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
860882
exit ;;
861883
i*86:Minix:*:*)
862884
echo ${UNAME_MACHINE}-pc-minix
863885
exit ;;
886
+ aarch64:Linux:*:*)
887
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
888
+ exit ;;
889
+ aarch64_be:Linux:*:*)
890
+ UNAME_MACHINE=aarch64_be
891
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
892
+ exit ;;
864893
alpha:Linux:*:*)
865894
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
866895
EV5) UNAME_MACHINE=alphaev5 ;;
867896
EV56) UNAME_MACHINE=alphaev56 ;;
868897
PCA56) UNAME_MACHINE=alphapca56 ;;
869898
PCA57) UNAME_MACHINE=alphapca56 ;;
870899
EV6) UNAME_MACHINE=alphaev6 ;;
871900
EV67) UNAME_MACHINE=alphaev67 ;;
872901
EV68*) UNAME_MACHINE=alphaev68 ;;
873
- esac
902
+ esac
874903
objdump --private-headers /bin/sh | grep -q ld.so.1
875
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
876
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
904
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
905
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
906
+ exit ;;
907
+ arc:Linux:*:* | arceb:Linux:*:*)
908
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
877909
exit ;;
878910
arm*:Linux:*:*)
879911
eval $set_cc_for_build
880912
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
881913
| grep -q __ARM_EABI__
882914
then
883
- echo ${UNAME_MACHINE}-unknown-linux-gnu
915
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
884916
else
885
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
917
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918
+ | grep -q __ARM_PCS_VFP
919
+ then
920
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
921
+ else
922
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
923
+ fi
886924
fi
887925
exit ;;
888926
avr32*:Linux:*:*)
889
- echo ${UNAME_MACHINE}-unknown-linux-gnu
927
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
890928
exit ;;
891929
cris:Linux:*:*)
892
- echo cris-axis-linux-gnu
930
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
893931
exit ;;
894932
crisv32:Linux:*:*)
895
- echo crisv32-axis-linux-gnu
933
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
896934
exit ;;
897935
frv:Linux:*:*)
898
- echo frv-unknown-linux-gnu
936
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
937
+ exit ;;
938
+ hexagon:Linux:*:*)
939
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
899940
exit ;;
900941
i*86:Linux:*:*)
901
- LIBC=gnu
902
- eval $set_cc_for_build
903
- sed 's/^ //' << EOF >$dummy.c
904
- #ifdef __dietlibc__
905
- LIBC=dietlibc
906
- #endif
907
-EOF
908
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
909
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
942
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
910943
exit ;;
911944
ia64:Linux:*:*)
912
- echo ${UNAME_MACHINE}-unknown-linux-gnu
945
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
913946
exit ;;
914947
m32r*:Linux:*:*)
915
- echo ${UNAME_MACHINE}-unknown-linux-gnu
948
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
916949
exit ;;
917950
m68*:Linux:*:*)
918
- echo ${UNAME_MACHINE}-unknown-linux-gnu
951
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
919952
exit ;;
920953
mips:Linux:*:* | mips64:Linux:*:*)
921954
eval $set_cc_for_build
922955
sed 's/^ //' << EOF >$dummy.c
923956
#undef CPU
@@ -932,71 +965,80 @@
932965
CPU=
933966
#endif
934967
#endif
935968
EOF
936969
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
937
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
970
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
938971
;;
939
- or32:Linux:*:*)
940
- echo or32-unknown-linux-gnu
972
+ openrisc*:Linux:*:*)
973
+ echo or1k-unknown-linux-${LIBC}
974
+ exit ;;
975
+ or32:Linux:*:* | or1k*:Linux:*:*)
976
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
941977
exit ;;
942978
padre:Linux:*:*)
943
- echo sparc-unknown-linux-gnu
979
+ echo sparc-unknown-linux-${LIBC}
944980
exit ;;
945981
parisc64:Linux:*:* | hppa64:Linux:*:*)
946
- echo hppa64-unknown-linux-gnu
982
+ echo hppa64-unknown-linux-${LIBC}
947983
exit ;;
948984
parisc:Linux:*:* | hppa:Linux:*:*)
949985
# Look for CPU level
950986
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
951
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
952
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
953
- *) echo hppa-unknown-linux-gnu ;;
987
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989
+ *) echo hppa-unknown-linux-${LIBC} ;;
954990
esac
955991
exit ;;
956992
ppc64:Linux:*:*)
957
- echo powerpc64-unknown-linux-gnu
993
+ echo powerpc64-unknown-linux-${LIBC}
958994
exit ;;
959995
ppc:Linux:*:*)
960
- echo powerpc-unknown-linux-gnu
996
+ echo powerpc-unknown-linux-${LIBC}
997
+ exit ;;
998
+ ppc64le:Linux:*:*)
999
+ echo powerpc64le-unknown-linux-${LIBC}
1000
+ exit ;;
1001
+ ppcle:Linux:*:*)
1002
+ echo powerpcle-unknown-linux-${LIBC}
9611003
exit ;;
9621004
s390:Linux:*:* | s390x:Linux:*:*)
963
- echo ${UNAME_MACHINE}-ibm-linux
1005
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
9641006
exit ;;
9651007
sh64*:Linux:*:*)
966
- echo ${UNAME_MACHINE}-unknown-linux-gnu
1008
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9671009
exit ;;
9681010
sh*:Linux:*:*)
969
- echo ${UNAME_MACHINE}-unknown-linux-gnu
1011
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9701012
exit ;;
9711013
sparc:Linux:*:* | sparc64:Linux:*:*)
972
- echo ${UNAME_MACHINE}-unknown-linux-gnu
1014
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9731015
exit ;;
9741016
tile*:Linux:*:*)
975
- echo ${UNAME_MACHINE}-tilera-linux-gnu
1017
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9761018
exit ;;
9771019
vax:Linux:*:*)
978
- echo ${UNAME_MACHINE}-dec-linux-gnu
1020
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
9791021
exit ;;
9801022
x86_64:Linux:*:*)
981
- echo x86_64-unknown-linux-gnu
1023
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9821024
exit ;;
9831025
xtensa*:Linux:*:*)
984
- echo ${UNAME_MACHINE}-unknown-linux-gnu
1026
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9851027
exit ;;
9861028
i*86:DYNIX/ptx:4*:*)
9871029
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
9881030
# earlier versions are messed up and put the nodename in both
9891031
# sysname and nodename.
9901032
echo i386-sequent-sysv4
9911033
exit ;;
9921034
i*86:UNIX_SV:4.2MP:2.*)
993
- # Unixware is an offshoot of SVR4, but it has its own version
994
- # number series starting with 2...
995
- # I am not positive that other SVR4 systems won't match this,
1035
+ # Unixware is an offshoot of SVR4, but it has its own version
1036
+ # number series starting with 2...
1037
+ # I am not positive that other SVR4 systems won't match this,
9961038
# I just have to hope. -- rms.
997
- # Use sysv4.2uw... so that sysv4* matches it.
1039
+ # Use sysv4.2uw... so that sysv4* matches it.
9981040
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
9991041
exit ;;
10001042
i*86:OS/2:*:*)
10011043
# If we were able to find `uname', then EMX Unix compatibility
10021044
# is probably installed.
@@ -1024,11 +1066,11 @@
10241066
else
10251067
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10261068
fi
10271069
exit ;;
10281070
i*86:*:5:[678]*)
1029
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
1071
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
10301072
case `/bin/uname -X | grep "^Machine"` in
10311073
*486*) UNAME_MACHINE=i486 ;;
10321074
*Pentium) UNAME_MACHINE=i586 ;;
10331075
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10341076
esac
@@ -1052,17 +1094,17 @@
10521094
echo ${UNAME_MACHINE}-pc-sysv32
10531095
fi
10541096
exit ;;
10551097
pc:*:*:*)
10561098
# Left here for compatibility:
1057
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
1058
- # the processor, so we play safe by assuming i586.
1099
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
1100
+ # the processor, so we play safe by assuming i586.
10591101
# Note: whatever this is, it MUST be the same as what config.sub
10601102
# prints for the "djgpp" host, or else GDB configury will decide that
10611103
# this is a cross-build.
10621104
echo i586-pc-msdosdjgpp
1063
- exit ;;
1105
+ exit ;;
10641106
Intel:Mach:3*:*)
10651107
echo i386-pc-mach3
10661108
exit ;;
10671109
paragon:*:*:*)
10681110
echo i860-intel-osf1
@@ -1093,12 +1135,12 @@
10931135
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
10941136
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
10951137
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
10961138
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
10971139
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1098
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1099
- && { echo i486-ncr-sysv4; exit; } ;;
1140
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1141
+ && { echo i486-ncr-sysv4; exit; } ;;
11001142
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
11011143
OS_REL='.3'
11021144
test -r /etc/.relid \
11031145
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11041146
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
@@ -1137,14 +1179,14 @@
11371179
echo ${UNAME_MACHINE}-sni-sysv4
11381180
else
11391181
echo ns32k-sni-sysv
11401182
fi
11411183
exit ;;
1142
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1143
- # says <[email protected]>
1144
- echo i586-unisys-sysv4
1145
- exit ;;
1184
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1185
+ # says <[email protected]>
1186
+ echo i586-unisys-sysv4
1187
+ exit ;;
11461188
*:UNIX_System_V:4*:FTX*)
11471189
# From Gerald Hewes <[email protected]>.
11481190
# How about differentiating between stratus architectures? -djm
11491191
echo hppa1.1-stratus-sysv4
11501192
exit ;;
@@ -1166,15 +1208,15 @@
11661208
news*:NEWS-OS:6*:*)
11671209
echo mips-sony-newsos6
11681210
exit ;;
11691211
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
11701212
if [ -d /usr/nec ]; then
1171
- echo mips-nec-sysv${UNAME_RELEASE}
1213
+ echo mips-nec-sysv${UNAME_RELEASE}
11721214
else
1173
- echo mips-unknown-sysv${UNAME_RELEASE}
1215
+ echo mips-unknown-sysv${UNAME_RELEASE}
11741216
fi
1175
- exit ;;
1217
+ exit ;;
11761218
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
11771219
echo powerpc-be-beos
11781220
exit ;;
11791221
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
11801222
echo powerpc-apple-beos
@@ -1183,10 +1225,13 @@
11831225
echo i586-pc-beos
11841226
exit ;;
11851227
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
11861228
echo i586-pc-haiku
11871229
exit ;;
1230
+ x86_64:Haiku:*:*)
1231
+ echo x86_64-unknown-haiku
1232
+ exit ;;
11881233
SX-4:SUPER-UX:*:*)
11891234
echo sx4-nec-superux${UNAME_RELEASE}
11901235
exit ;;
11911236
SX-5:SUPER-UX:*:*)
11921237
echo sx5-nec-superux${UNAME_RELEASE}
@@ -1209,23 +1254,35 @@
12091254
*:Rhapsody:*:*)
12101255
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12111256
exit ;;
12121257
*:Darwin:*:*)
12131258
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1214
- case $UNAME_PROCESSOR in
1215
- i386)
1216
- eval $set_cc_for_build
1217
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1218
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1219
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1220
- grep IS_64BIT_ARCH >/dev/null
1221
- then
1222
- UNAME_PROCESSOR="x86_64"
1223
- fi
1224
- fi ;;
1225
- unknown) UNAME_PROCESSOR=powerpc ;;
1226
- esac
1259
+ eval $set_cc_for_build
1260
+ if test "$UNAME_PROCESSOR" = unknown ; then
1261
+ UNAME_PROCESSOR=powerpc
1262
+ fi
1263
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1264
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1265
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1266
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1267
+ grep IS_64BIT_ARCH >/dev/null
1268
+ then
1269
+ case $UNAME_PROCESSOR in
1270
+ i386) UNAME_PROCESSOR=x86_64 ;;
1271
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
1272
+ esac
1273
+ fi
1274
+ fi
1275
+ elif test "$UNAME_PROCESSOR" = i386 ; then
1276
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
1277
+ # that puts up a graphical alert prompting to install
1278
+ # developer tools. Any system running Mac OS X 10.7 or
1279
+ # later (Darwin 11 and later) is required to have a 64-bit
1280
+ # processor. This is not true of the ARM version of Darwin
1281
+ # that Apple uses in portable devices.
1282
+ UNAME_PROCESSOR=x86_64
1283
+ fi
12271284
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12281285
exit ;;
12291286
*:procnto*:*:* | *:QNX:[0123456789]*:*)
12301287
UNAME_PROCESSOR=`uname -p`
12311288
if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1238,11 +1295,11 @@
12381295
echo i386-pc-qnx
12391296
exit ;;
12401297
NEO-?:NONSTOP_KERNEL:*:*)
12411298
echo neo-tandem-nsk${UNAME_RELEASE}
12421299
exit ;;
1243
- NSE-?:NONSTOP_KERNEL:*:*)
1300
+ NSE-*:NONSTOP_KERNEL:*:*)
12441301
echo nse-tandem-nsk${UNAME_RELEASE}
12451302
exit ;;
12461303
NSR-?:NONSTOP_KERNEL:*:*)
12471304
echo nsr-tandem-nsk${UNAME_RELEASE}
12481305
exit ;;
@@ -1283,17 +1340,17 @@
12831340
exit ;;
12841341
*:ITS:*:*)
12851342
echo pdp10-unknown-its
12861343
exit ;;
12871344
SEI:*:*:SEIUX)
1288
- echo mips-sei-seiux${UNAME_RELEASE}
1345
+ echo mips-sei-seiux${UNAME_RELEASE}
12891346
exit ;;
12901347
*:DragonFly:*:*)
12911348
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
12921349
exit ;;
12931350
*:*VMS:*:*)
1294
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
1351
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
12951352
case "${UNAME_MACHINE}" in
12961353
A*) echo alpha-dec-vms ; exit ;;
12971354
I*) echo ia64-dec-vms ; exit ;;
12981355
V*) echo vax-dec-vms ; exit ;;
12991356
esac ;;
@@ -1307,162 +1364,14 @@
13071364
echo ${UNAME_MACHINE}-pc-rdos
13081365
exit ;;
13091366
i*86:AROS:*:*)
13101367
echo ${UNAME_MACHINE}-pc-aros
13111368
exit ;;
1312
-esac
1313
-
1314
-#echo '(No uname command or uname output not recognized.)' 1>&2
1315
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1316
-
1317
-eval $set_cc_for_build
1318
-cat >$dummy.c <<EOF
1319
-#ifdef _SEQUENT_
1320
-# include <sys/types.h>
1321
-# include <sys/utsname.h>
1322
-#endif
1323
-main ()
1324
-{
1325
-#if defined (sony)
1326
-#if defined (MIPSEB)
1327
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1328
- I don't know.... */
1329
- printf ("mips-sony-bsd\n"); exit (0);
1330
-#else
1331
-#include <sys/param.h>
1332
- printf ("m68k-sony-newsos%s\n",
1333
-#ifdef NEWSOS4
1334
- "4"
1335
-#else
1336
- ""
1337
-#endif
1338
- ); exit (0);
1339
-#endif
1340
-#endif
1341
-
1342
-#if defined (__arm) && defined (__acorn) && defined (__unix)
1343
- printf ("arm-acorn-riscix\n"); exit (0);
1344
-#endif
1345
-
1346
-#if defined (hp300) && !defined (hpux)
1347
- printf ("m68k-hp-bsd\n"); exit (0);
1348
-#endif
1349
-
1350
-#if defined (NeXT)
1351
-#if !defined (__ARCHITECTURE__)
1352
-#define __ARCHITECTURE__ "m68k"
1353
-#endif
1354
- int version;
1355
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1356
- if (version < 4)
1357
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1358
- else
1359
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1360
- exit (0);
1361
-#endif
1362
-
1363
-#if defined (MULTIMAX) || defined (n16)
1364
-#if defined (UMAXV)
1365
- printf ("ns32k-encore-sysv\n"); exit (0);
1366
-#else
1367
-#if defined (CMU)
1368
- printf ("ns32k-encore-mach\n"); exit (0);
1369
-#else
1370
- printf ("ns32k-encore-bsd\n"); exit (0);
1371
-#endif
1372
-#endif
1373
-#endif
1374
-
1375
-#if defined (__386BSD__)
1376
- printf ("i386-pc-bsd\n"); exit (0);
1377
-#endif
1378
-
1379
-#if defined (sequent)
1380
-#if defined (i386)
1381
- printf ("i386-sequent-dynix\n"); exit (0);
1382
-#endif
1383
-#if defined (ns32000)
1384
- printf ("ns32k-sequent-dynix\n"); exit (0);
1385
-#endif
1386
-#endif
1387
-
1388
-#if defined (_SEQUENT_)
1389
- struct utsname un;
1390
-
1391
- uname(&un);
1392
-
1393
- if (strncmp(un.version, "V2", 2) == 0) {
1394
- printf ("i386-sequent-ptx2\n"); exit (0);
1395
- }
1396
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1397
- printf ("i386-sequent-ptx1\n"); exit (0);
1398
- }
1399
- printf ("i386-sequent-ptx\n"); exit (0);
1400
-
1401
-#endif
1402
-
1403
-#if defined (vax)
1404
-# if !defined (ultrix)
1405
-# include <sys/param.h>
1406
-# if defined (BSD)
1407
-# if BSD == 43
1408
- printf ("vax-dec-bsd4.3\n"); exit (0);
1409
-# else
1410
-# if BSD == 199006
1411
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
1412
-# else
1413
- printf ("vax-dec-bsd\n"); exit (0);
1414
-# endif
1415
-# endif
1416
-# else
1417
- printf ("vax-dec-bsd\n"); exit (0);
1418
-# endif
1419
-# else
1420
- printf ("vax-dec-ultrix\n"); exit (0);
1421
-# endif
1422
-#endif
1423
-
1424
-#if defined (alliant) && defined (i860)
1425
- printf ("i860-alliant-bsd\n"); exit (0);
1426
-#endif
1427
-
1428
- exit (1);
1429
-}
1430
-EOF
1431
-
1432
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1433
- { echo "$SYSTEM_NAME"; exit; }
1434
-
1435
-# Apollos put the system type in the environment.
1436
-
1437
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1438
-
1439
-# Convex versions that predate uname can use getsysinfo(1)
1440
-
1441
-if [ -x /usr/convex/getsysinfo ]
1442
-then
1443
- case `getsysinfo -f cpu_type` in
1444
- c1*)
1445
- echo c1-convex-bsd
1446
- exit ;;
1447
- c2*)
1448
- if getsysinfo -f scalar_acc
1449
- then echo c32-convex-bsd
1450
- else echo c2-convex-bsd
1451
- fi
1452
- exit ;;
1453
- c34*)
1454
- echo c34-convex-bsd
1455
- exit ;;
1456
- c38*)
1457
- echo c38-convex-bsd
1458
- exit ;;
1459
- c4*)
1460
- echo c4-convex-bsd
1461
- exit ;;
1462
- esac
1463
-fi
1369
+ x86_64:VMkernel:*:*)
1370
+ echo ${UNAME_MACHINE}-unknown-esx
1371
+ exit ;;
1372
+esac
14641373
14651374
cat >&2 <<EOF
14661375
$0: unable to guess system type
14671376
14681377
This script, last modified $timestamp, has failed to recognize
14691378
--- autosetup/config.guess
+++ autosetup/config.guess
@@ -1,44 +1,38 @@
1 #! /bin/sh
2 # Attempt to guess a canonical system name.
3 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5 # Free Software Foundation, Inc.
6
7 timestamp='2010-09-24'
8
9 # This file is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22 # 02110-1301, USA.
23 #
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
28
29
30 # Originally written by Per Bothner. Please send patches (context
31 # diff format) to <[email protected]> and include a ChangeLog
32 # entry.
33 #
34 # This script attempts to guess a canonical system name similar to
35 # config.sub. If it succeeds, it prints the system name on stdout, and
36 # exits with 0. Otherwise, it exits with 1.
37 #
38 # You can get the latest version of this script from:
39 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
 
 
40
41 me=`echo "$0" | sed -e 's,.*/,,'`
42
43 usage="\
44 Usage: $0 [OPTION]
@@ -54,13 +48,11 @@
54
55 version="\
56 GNU config.guess ($timestamp)
57
58 Originally written by Per Bothner.
59 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61 Software Foundation, Inc.
62
63 This is free software; see the source for copying conditions. There is NO
64 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
65
66 help="
@@ -90,11 +82,11 @@
90 if test $# != 0; then
91 echo "$me: too many arguments$help" >&2
92 exit 1
93 fi
94
95 trap 'exit 1' HUP INT TERM
96
97 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
98 # compiler to aid in system detection is discouraged as it requires
99 # temporary files to be created and, as you can see below, it is a
100 # headache to deal with in a portable fashion.
@@ -104,11 +96,11 @@
104
105 # Portable tmp directory creation inspired by the Autoconf team.
106
107 set_cc_for_build='
108 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
110 : ${TMPDIR=/tmp} ;
111 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -137,17 +129,38 @@
137
138 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
139 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
140 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
141 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
143 # Note: order is significant - the case branches are not exclusive.
144
145 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146 *:NetBSD:*:*)
147 # NetBSD (nbsd) targets should (where applicable) match one or
148 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
149 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
150 # switched to ELF, *-*-netbsd* would select the old
151 # object file format. This provides both forward
152 # compatibility and a consistent mechanism for selecting the
153 # object file format.
@@ -179,11 +192,11 @@
179 else
180 os=netbsdelf
181 fi
182 ;;
183 *)
184 os=netbsd
185 ;;
186 esac
187 # The OS release
188 # Debian GNU/NetBSD machines have a different userland, and
189 # thus, need a distinct triplet. However, they do not need
@@ -200,10 +213,14 @@
200 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201 # contains redundant information, the shorter form:
202 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203 echo "${machine}-${os}${release}"
204 exit ;;
 
 
 
 
205 *:OpenBSD:*:*)
206 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208 exit ;;
209 *:ekkoBSD:*:*)
@@ -222,11 +239,11 @@
222 case $UNAME_RELEASE in
223 *4.0)
224 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225 ;;
226 *5.*)
227 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228 ;;
229 esac
230 # According to Compaq, /usr/sbin/psrinfo has been available on
231 # OSF/1 and Tru64 systems produced since 1995. I hope that
232 # covers most systems running today. This code pipes the CPU
@@ -268,11 +285,14 @@
268 # A Vn.n version is a released version.
269 # A Tn.n version is a released field test version.
270 # A Xn.n version is an unreleased experimental baselevel.
271 # 1.2 uses "1.2" for uname -r.
272 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273 exit ;;
 
 
 
274 Alpha\ *:Windows_NT*:*)
275 # How do we know it's Interix rather than the generic POSIX subsystem?
276 # Should we change UNAME_MACHINE based on the output of uname instead
277 # of the specific Alpha model?
278 echo alpha-pc-interix
@@ -294,16 +314,16 @@
294 exit ;;
295 *:z/VM:*:*)
296 echo s390-ibm-zvmoe
297 exit ;;
298 *:OS400:*:*)
299 echo powerpc-ibm-os400
300 exit ;;
301 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
302 echo arm-acorn-riscix${UNAME_RELEASE}
303 exit ;;
304 arm:riscos:*:*|arm:RISCOS:*:*)
305 echo arm-unknown-riscos
306 exit ;;
307 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
308 echo hppa1.1-hitachi-hiuxmpp
309 exit ;;
@@ -393,27 +413,27 @@
393 # to the lowercase version "mint" (or "freemint"). Finally
394 # the system name "TOS" denotes a system which is actually not
395 # MiNT. But MiNT is downward compatible to TOS, so this should
396 # be no problem.
397 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
398 echo m68k-atari-mint${UNAME_RELEASE}
399 exit ;;
400 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
401 echo m68k-atari-mint${UNAME_RELEASE}
402 exit ;;
403 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
404 echo m68k-atari-mint${UNAME_RELEASE}
405 exit ;;
406 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
407 echo m68k-milan-mint${UNAME_RELEASE}
408 exit ;;
409 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
410 echo m68k-hades-mint${UNAME_RELEASE}
411 exit ;;
412 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
413 echo m68k-unknown-mint${UNAME_RELEASE}
414 exit ;;
415 m68k:machten:*:*)
416 echo m68k-apple-machten${UNAME_RELEASE}
417 exit ;;
418 powerpc:machten:*:*)
419 echo powerpc-apple-machten${UNAME_RELEASE}
@@ -479,12 +499,12 @@
479 exit ;;
480 m88k:*:3*:R3*)
481 echo m88k-motorola-sysv3
482 exit ;;
483 AViiON:dgux:*:*)
484 # DG/UX returns AViiON for all architectures
485 UNAME_PROCESSOR=`/usr/bin/uname -p`
486 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
487 then
488 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
489 [ ${TARGET_BINARY_INTERFACE}x = x ]
490 then
@@ -493,11 +513,11 @@
493 echo m88k-dg-dguxbcs${UNAME_RELEASE}
494 fi
495 else
496 echo i586-dg-dgux${UNAME_RELEASE}
497 fi
498 exit ;;
499 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
500 echo m88k-dolphin-sysv3
501 exit ;;
502 M88*:*:R3*:*)
503 # Delta 88k system running SVR3
@@ -593,56 +613,56 @@
593 9000/31? ) HP_ARCH=m68000 ;;
594 9000/[34]?? ) HP_ARCH=m68k ;;
595 9000/[678][0-9][0-9])
596 if [ -x /usr/bin/getconf ]; then
597 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
598 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
599 case "${sc_cpu_version}" in
600 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
601 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
602 532) # CPU_PA_RISC2_0
603 case "${sc_kernel_bits}" in
604 32) HP_ARCH="hppa2.0n" ;;
605 64) HP_ARCH="hppa2.0w" ;;
606 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
607 esac ;;
608 esac
609 fi
610 if [ "${HP_ARCH}" = "" ]; then
611 eval $set_cc_for_build
612 sed 's/^ //' << EOF >$dummy.c
613
614 #define _HPUX_SOURCE
615 #include <stdlib.h>
616 #include <unistd.h>
617
618 int main ()
619 {
620 #if defined(_SC_KERNEL_BITS)
621 long bits = sysconf(_SC_KERNEL_BITS);
622 #endif
623 long cpu = sysconf (_SC_CPU_VERSION);
624
625 switch (cpu)
626 {
627 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
628 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
629 case CPU_PA_RISC2_0:
630 #if defined(_SC_KERNEL_BITS)
631 switch (bits)
632 {
633 case 64: puts ("hppa2.0w"); break;
634 case 32: puts ("hppa2.0n"); break;
635 default: puts ("hppa2.0"); break;
636 } break;
637 #else /* !defined(_SC_KERNEL_BITS) */
638 puts ("hppa2.0"); break;
639 #endif
640 default: puts ("hppa1.0"); break;
641 }
642 exit (0);
643 }
644 EOF
645 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
646 test -z "$HP_ARCH" && HP_ARCH=hppa
647 fi ;;
648 esac
@@ -729,26 +749,26 @@
729 parisc*:Lites*:*:*)
730 echo hppa1.1-hp-lites
731 exit ;;
732 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
733 echo c1-convex-bsd
734 exit ;;
735 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
736 if getsysinfo -f scalar_acc
737 then echo c32-convex-bsd
738 else echo c2-convex-bsd
739 fi
740 exit ;;
741 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
742 echo c34-convex-bsd
743 exit ;;
744 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
745 echo c38-convex-bsd
746 exit ;;
747 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
748 echo c4-convex-bsd
749 exit ;;
750 CRAY*Y-MP:*:*:*)
751 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752 exit ;;
753 CRAY*[A-Z]90:*:*:*)
754 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
@@ -768,18 +788,18 @@
768 *:UNICOS/mp:*:*)
769 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
770 exit ;;
771 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
772 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
773 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
774 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
775 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
776 exit ;;
777 5000:UNIX_System_V:4.*:*)
778 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
779 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
780 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
781 exit ;;
782 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
783 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
784 exit ;;
785 sparc*:BSD/OS:*:*)
@@ -787,37 +807,39 @@
787 exit ;;
788 *:BSD/OS:*:*)
789 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
790 exit ;;
791 *:FreeBSD:*:*)
792 case ${UNAME_MACHINE} in
793 pc98)
794 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795 amd64)
796 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797 *)
798 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799 esac
800 exit ;;
801 i*:CYGWIN*:*)
802 echo ${UNAME_MACHINE}-pc-cygwin
803 exit ;;
 
 
 
804 *:MINGW*:*)
805 echo ${UNAME_MACHINE}-pc-mingw32
806 exit ;;
807 i*:MSYS*:*)
808 echo ${UNAME_MACHINE}-pc-msys
809 exit ;;
810 i*:windows32*:*)
811 # uname -m includes "-pc" on this system.
812 echo ${UNAME_MACHINE}-mingw32
813 exit ;;
814 i*:PW*:*)
815 echo ${UNAME_MACHINE}-pc-pw32
816 exit ;;
817 *:Interix*:*)
818 case ${UNAME_MACHINE} in
819 x86)
820 echo i586-pc-interix${UNAME_RELEASE}
821 exit ;;
822 authenticamd | genuineintel | EM64T)
823 echo x86_64-unknown-interix${UNAME_RELEASE}
@@ -850,74 +872,85 @@
850 prep*:SunOS:5.*:*)
851 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
852 exit ;;
853 *:GNU:*:*)
854 # the GNU system
855 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
856 exit ;;
857 *:GNU/*:*:*)
858 # other systems with GNU libc and userland
859 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
860 exit ;;
861 i*86:Minix:*:*)
862 echo ${UNAME_MACHINE}-pc-minix
863 exit ;;
 
 
 
 
 
 
 
864 alpha:Linux:*:*)
865 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
866 EV5) UNAME_MACHINE=alphaev5 ;;
867 EV56) UNAME_MACHINE=alphaev56 ;;
868 PCA56) UNAME_MACHINE=alphapca56 ;;
869 PCA57) UNAME_MACHINE=alphapca56 ;;
870 EV6) UNAME_MACHINE=alphaev6 ;;
871 EV67) UNAME_MACHINE=alphaev67 ;;
872 EV68*) UNAME_MACHINE=alphaev68 ;;
873 esac
874 objdump --private-headers /bin/sh | grep -q ld.so.1
875 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
876 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
 
 
 
877 exit ;;
878 arm*:Linux:*:*)
879 eval $set_cc_for_build
880 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
881 | grep -q __ARM_EABI__
882 then
883 echo ${UNAME_MACHINE}-unknown-linux-gnu
884 else
885 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
 
 
 
 
 
 
886 fi
887 exit ;;
888 avr32*:Linux:*:*)
889 echo ${UNAME_MACHINE}-unknown-linux-gnu
890 exit ;;
891 cris:Linux:*:*)
892 echo cris-axis-linux-gnu
893 exit ;;
894 crisv32:Linux:*:*)
895 echo crisv32-axis-linux-gnu
896 exit ;;
897 frv:Linux:*:*)
898 echo frv-unknown-linux-gnu
 
 
 
899 exit ;;
900 i*86:Linux:*:*)
901 LIBC=gnu
902 eval $set_cc_for_build
903 sed 's/^ //' << EOF >$dummy.c
904 #ifdef __dietlibc__
905 LIBC=dietlibc
906 #endif
907 EOF
908 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
909 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
910 exit ;;
911 ia64:Linux:*:*)
912 echo ${UNAME_MACHINE}-unknown-linux-gnu
913 exit ;;
914 m32r*:Linux:*:*)
915 echo ${UNAME_MACHINE}-unknown-linux-gnu
916 exit ;;
917 m68*:Linux:*:*)
918 echo ${UNAME_MACHINE}-unknown-linux-gnu
919 exit ;;
920 mips:Linux:*:* | mips64:Linux:*:*)
921 eval $set_cc_for_build
922 sed 's/^ //' << EOF >$dummy.c
923 #undef CPU
@@ -932,71 +965,80 @@
932 CPU=
933 #endif
934 #endif
935 EOF
936 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
937 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
938 ;;
939 or32:Linux:*:*)
940 echo or32-unknown-linux-gnu
 
 
 
941 exit ;;
942 padre:Linux:*:*)
943 echo sparc-unknown-linux-gnu
944 exit ;;
945 parisc64:Linux:*:* | hppa64:Linux:*:*)
946 echo hppa64-unknown-linux-gnu
947 exit ;;
948 parisc:Linux:*:* | hppa:Linux:*:*)
949 # Look for CPU level
950 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
951 PA7*) echo hppa1.1-unknown-linux-gnu ;;
952 PA8*) echo hppa2.0-unknown-linux-gnu ;;
953 *) echo hppa-unknown-linux-gnu ;;
954 esac
955 exit ;;
956 ppc64:Linux:*:*)
957 echo powerpc64-unknown-linux-gnu
958 exit ;;
959 ppc:Linux:*:*)
960 echo powerpc-unknown-linux-gnu
 
 
 
 
 
 
961 exit ;;
962 s390:Linux:*:* | s390x:Linux:*:*)
963 echo ${UNAME_MACHINE}-ibm-linux
964 exit ;;
965 sh64*:Linux:*:*)
966 echo ${UNAME_MACHINE}-unknown-linux-gnu
967 exit ;;
968 sh*:Linux:*:*)
969 echo ${UNAME_MACHINE}-unknown-linux-gnu
970 exit ;;
971 sparc:Linux:*:* | sparc64:Linux:*:*)
972 echo ${UNAME_MACHINE}-unknown-linux-gnu
973 exit ;;
974 tile*:Linux:*:*)
975 echo ${UNAME_MACHINE}-tilera-linux-gnu
976 exit ;;
977 vax:Linux:*:*)
978 echo ${UNAME_MACHINE}-dec-linux-gnu
979 exit ;;
980 x86_64:Linux:*:*)
981 echo x86_64-unknown-linux-gnu
982 exit ;;
983 xtensa*:Linux:*:*)
984 echo ${UNAME_MACHINE}-unknown-linux-gnu
985 exit ;;
986 i*86:DYNIX/ptx:4*:*)
987 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
988 # earlier versions are messed up and put the nodename in both
989 # sysname and nodename.
990 echo i386-sequent-sysv4
991 exit ;;
992 i*86:UNIX_SV:4.2MP:2.*)
993 # Unixware is an offshoot of SVR4, but it has its own version
994 # number series starting with 2...
995 # I am not positive that other SVR4 systems won't match this,
996 # I just have to hope. -- rms.
997 # Use sysv4.2uw... so that sysv4* matches it.
998 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
999 exit ;;
1000 i*86:OS/2:*:*)
1001 # If we were able to find `uname', then EMX Unix compatibility
1002 # is probably installed.
@@ -1024,11 +1066,11 @@
1024 else
1025 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1026 fi
1027 exit ;;
1028 i*86:*:5:[678]*)
1029 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1030 case `/bin/uname -X | grep "^Machine"` in
1031 *486*) UNAME_MACHINE=i486 ;;
1032 *Pentium) UNAME_MACHINE=i586 ;;
1033 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1034 esac
@@ -1052,17 +1094,17 @@
1052 echo ${UNAME_MACHINE}-pc-sysv32
1053 fi
1054 exit ;;
1055 pc:*:*:*)
1056 # Left here for compatibility:
1057 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1058 # the processor, so we play safe by assuming i586.
1059 # Note: whatever this is, it MUST be the same as what config.sub
1060 # prints for the "djgpp" host, or else GDB configury will decide that
1061 # this is a cross-build.
1062 echo i586-pc-msdosdjgpp
1063 exit ;;
1064 Intel:Mach:3*:*)
1065 echo i386-pc-mach3
1066 exit ;;
1067 paragon:*:*:*)
1068 echo i860-intel-osf1
@@ -1093,12 +1135,12 @@
1093 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1094 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1095 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1096 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1097 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1098 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1099 && { echo i486-ncr-sysv4; exit; } ;;
1100 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1101 OS_REL='.3'
1102 test -r /etc/.relid \
1103 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1104 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
@@ -1137,14 +1179,14 @@
1137 echo ${UNAME_MACHINE}-sni-sysv4
1138 else
1139 echo ns32k-sni-sysv
1140 fi
1141 exit ;;
1142 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1143 # says <[email protected]>
1144 echo i586-unisys-sysv4
1145 exit ;;
1146 *:UNIX_System_V:4*:FTX*)
1147 # From Gerald Hewes <[email protected]>.
1148 # How about differentiating between stratus architectures? -djm
1149 echo hppa1.1-stratus-sysv4
1150 exit ;;
@@ -1166,15 +1208,15 @@
1166 news*:NEWS-OS:6*:*)
1167 echo mips-sony-newsos6
1168 exit ;;
1169 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1170 if [ -d /usr/nec ]; then
1171 echo mips-nec-sysv${UNAME_RELEASE}
1172 else
1173 echo mips-unknown-sysv${UNAME_RELEASE}
1174 fi
1175 exit ;;
1176 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1177 echo powerpc-be-beos
1178 exit ;;
1179 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1180 echo powerpc-apple-beos
@@ -1183,10 +1225,13 @@
1183 echo i586-pc-beos
1184 exit ;;
1185 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1186 echo i586-pc-haiku
1187 exit ;;
 
 
 
1188 SX-4:SUPER-UX:*:*)
1189 echo sx4-nec-superux${UNAME_RELEASE}
1190 exit ;;
1191 SX-5:SUPER-UX:*:*)
1192 echo sx5-nec-superux${UNAME_RELEASE}
@@ -1209,23 +1254,35 @@
1209 *:Rhapsody:*:*)
1210 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1211 exit ;;
1212 *:Darwin:*:*)
1213 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1214 case $UNAME_PROCESSOR in
1215 i386)
1216 eval $set_cc_for_build
1217 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1218 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1219 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1220 grep IS_64BIT_ARCH >/dev/null
1221 then
1222 UNAME_PROCESSOR="x86_64"
1223 fi
1224 fi ;;
1225 unknown) UNAME_PROCESSOR=powerpc ;;
1226 esac
 
 
 
 
 
 
 
 
 
 
 
 
1227 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1228 exit ;;
1229 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1230 UNAME_PROCESSOR=`uname -p`
1231 if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1238,11 +1295,11 @@
1238 echo i386-pc-qnx
1239 exit ;;
1240 NEO-?:NONSTOP_KERNEL:*:*)
1241 echo neo-tandem-nsk${UNAME_RELEASE}
1242 exit ;;
1243 NSE-?:NONSTOP_KERNEL:*:*)
1244 echo nse-tandem-nsk${UNAME_RELEASE}
1245 exit ;;
1246 NSR-?:NONSTOP_KERNEL:*:*)
1247 echo nsr-tandem-nsk${UNAME_RELEASE}
1248 exit ;;
@@ -1283,17 +1340,17 @@
1283 exit ;;
1284 *:ITS:*:*)
1285 echo pdp10-unknown-its
1286 exit ;;
1287 SEI:*:*:SEIUX)
1288 echo mips-sei-seiux${UNAME_RELEASE}
1289 exit ;;
1290 *:DragonFly:*:*)
1291 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1292 exit ;;
1293 *:*VMS:*:*)
1294 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1295 case "${UNAME_MACHINE}" in
1296 A*) echo alpha-dec-vms ; exit ;;
1297 I*) echo ia64-dec-vms ; exit ;;
1298 V*) echo vax-dec-vms ; exit ;;
1299 esac ;;
@@ -1307,162 +1364,14 @@
1307 echo ${UNAME_MACHINE}-pc-rdos
1308 exit ;;
1309 i*86:AROS:*:*)
1310 echo ${UNAME_MACHINE}-pc-aros
1311 exit ;;
1312 esac
1313
1314 #echo '(No uname command or uname output not recognized.)' 1>&2
1315 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1316
1317 eval $set_cc_for_build
1318 cat >$dummy.c <<EOF
1319 #ifdef _SEQUENT_
1320 # include <sys/types.h>
1321 # include <sys/utsname.h>
1322 #endif
1323 main ()
1324 {
1325 #if defined (sony)
1326 #if defined (MIPSEB)
1327 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1328 I don't know.... */
1329 printf ("mips-sony-bsd\n"); exit (0);
1330 #else
1331 #include <sys/param.h>
1332 printf ("m68k-sony-newsos%s\n",
1333 #ifdef NEWSOS4
1334 "4"
1335 #else
1336 ""
1337 #endif
1338 ); exit (0);
1339 #endif
1340 #endif
1341
1342 #if defined (__arm) && defined (__acorn) && defined (__unix)
1343 printf ("arm-acorn-riscix\n"); exit (0);
1344 #endif
1345
1346 #if defined (hp300) && !defined (hpux)
1347 printf ("m68k-hp-bsd\n"); exit (0);
1348 #endif
1349
1350 #if defined (NeXT)
1351 #if !defined (__ARCHITECTURE__)
1352 #define __ARCHITECTURE__ "m68k"
1353 #endif
1354 int version;
1355 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1356 if (version < 4)
1357 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1358 else
1359 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1360 exit (0);
1361 #endif
1362
1363 #if defined (MULTIMAX) || defined (n16)
1364 #if defined (UMAXV)
1365 printf ("ns32k-encore-sysv\n"); exit (0);
1366 #else
1367 #if defined (CMU)
1368 printf ("ns32k-encore-mach\n"); exit (0);
1369 #else
1370 printf ("ns32k-encore-bsd\n"); exit (0);
1371 #endif
1372 #endif
1373 #endif
1374
1375 #if defined (__386BSD__)
1376 printf ("i386-pc-bsd\n"); exit (0);
1377 #endif
1378
1379 #if defined (sequent)
1380 #if defined (i386)
1381 printf ("i386-sequent-dynix\n"); exit (0);
1382 #endif
1383 #if defined (ns32000)
1384 printf ("ns32k-sequent-dynix\n"); exit (0);
1385 #endif
1386 #endif
1387
1388 #if defined (_SEQUENT_)
1389 struct utsname un;
1390
1391 uname(&un);
1392
1393 if (strncmp(un.version, "V2", 2) == 0) {
1394 printf ("i386-sequent-ptx2\n"); exit (0);
1395 }
1396 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1397 printf ("i386-sequent-ptx1\n"); exit (0);
1398 }
1399 printf ("i386-sequent-ptx\n"); exit (0);
1400
1401 #endif
1402
1403 #if defined (vax)
1404 # if !defined (ultrix)
1405 # include <sys/param.h>
1406 # if defined (BSD)
1407 # if BSD == 43
1408 printf ("vax-dec-bsd4.3\n"); exit (0);
1409 # else
1410 # if BSD == 199006
1411 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1412 # else
1413 printf ("vax-dec-bsd\n"); exit (0);
1414 # endif
1415 # endif
1416 # else
1417 printf ("vax-dec-bsd\n"); exit (0);
1418 # endif
1419 # else
1420 printf ("vax-dec-ultrix\n"); exit (0);
1421 # endif
1422 #endif
1423
1424 #if defined (alliant) && defined (i860)
1425 printf ("i860-alliant-bsd\n"); exit (0);
1426 #endif
1427
1428 exit (1);
1429 }
1430 EOF
1431
1432 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1433 { echo "$SYSTEM_NAME"; exit; }
1434
1435 # Apollos put the system type in the environment.
1436
1437 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1438
1439 # Convex versions that predate uname can use getsysinfo(1)
1440
1441 if [ -x /usr/convex/getsysinfo ]
1442 then
1443 case `getsysinfo -f cpu_type` in
1444 c1*)
1445 echo c1-convex-bsd
1446 exit ;;
1447 c2*)
1448 if getsysinfo -f scalar_acc
1449 then echo c32-convex-bsd
1450 else echo c2-convex-bsd
1451 fi
1452 exit ;;
1453 c34*)
1454 echo c34-convex-bsd
1455 exit ;;
1456 c38*)
1457 echo c38-convex-bsd
1458 exit ;;
1459 c4*)
1460 echo c4-convex-bsd
1461 exit ;;
1462 esac
1463 fi
1464
1465 cat >&2 <<EOF
1466 $0: unable to guess system type
1467
1468 This script, last modified $timestamp, has failed to recognize
1469
--- autosetup/config.guess
+++ autosetup/config.guess
@@ -1,44 +1,38 @@
1 #! /bin/sh
2 # Attempt to guess a canonical system name.
3 # Copyright 1992-2014 Free Software Foundation, Inc.
 
 
4
5 timestamp='2014-03-23'
6
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 
19 #
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that
24 # program. This Exception is an additional permission under section 7
25 # of the GNU General Public License, version 3 ("GPLv3").
26 #
27 # Originally written by Per Bothner.
 
 
 
 
 
28 #
29 # You can get the latest version of this script from:
30 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
31 #
32 # Please send patches with a ChangeLog entry to [email protected].
33
34
35 me=`echo "$0" | sed -e 's,.*/,,'`
36
37 usage="\
38 Usage: $0 [OPTION]
@@ -54,13 +48,11 @@
48
49 version="\
50 GNU config.guess ($timestamp)
51
52 Originally written by Per Bothner.
53 Copyright 1992-2014 Free Software Foundation, Inc.
 
 
54
55 This is free software; see the source for copying conditions. There is NO
56 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57
58 help="
@@ -90,11 +82,11 @@
82 if test $# != 0; then
83 echo "$me: too many arguments$help" >&2
84 exit 1
85 fi
86
87 trap 'exit 1' 1 2 15
88
89 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90 # compiler to aid in system detection is discouraged as it requires
91 # temporary files to be created and, as you can see below, it is a
92 # headache to deal with in a portable fashion.
@@ -104,11 +96,11 @@
96
97 # Portable tmp directory creation inspired by the Autoconf team.
98
99 set_cc_for_build='
100 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102 : ${TMPDIR=/tmp} ;
103 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -137,17 +129,38 @@
129
130 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
133 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134
135 case "${UNAME_SYSTEM}" in
136 Linux|GNU|GNU/*)
137 # If the system lacks a compiler, then just pick glibc.
138 # We could probably try harder.
139 LIBC=gnu
140
141 eval $set_cc_for_build
142 cat <<-EOF > $dummy.c
143 #include <features.h>
144 #if defined(__UCLIBC__)
145 LIBC=uclibc
146 #elif defined(__dietlibc__)
147 LIBC=dietlibc
148 #else
149 LIBC=gnu
150 #endif
151 EOF
152 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
153 ;;
154 esac
155
156 # Note: order is significant - the case branches are not exclusive.
157
158 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
159 *:NetBSD:*:*)
160 # NetBSD (nbsd) targets should (where applicable) match one or
161 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
162 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
163 # switched to ELF, *-*-netbsd* would select the old
164 # object file format. This provides both forward
165 # compatibility and a consistent mechanism for selecting the
166 # object file format.
@@ -179,11 +192,11 @@
192 else
193 os=netbsdelf
194 fi
195 ;;
196 *)
197 os=netbsd
198 ;;
199 esac
200 # The OS release
201 # Debian GNU/NetBSD machines have a different userland, and
202 # thus, need a distinct triplet. However, they do not need
@@ -200,10 +213,14 @@
213 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
214 # contains redundant information, the shorter form:
215 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
216 echo "${machine}-${os}${release}"
217 exit ;;
218 *:Bitrig:*:*)
219 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
220 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
221 exit ;;
222 *:OpenBSD:*:*)
223 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
224 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
225 exit ;;
226 *:ekkoBSD:*:*)
@@ -222,11 +239,11 @@
239 case $UNAME_RELEASE in
240 *4.0)
241 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
242 ;;
243 *5.*)
244 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
245 ;;
246 esac
247 # According to Compaq, /usr/sbin/psrinfo has been available on
248 # OSF/1 and Tru64 systems produced since 1995. I hope that
249 # covers most systems running today. This code pipes the CPU
@@ -268,11 +285,14 @@
285 # A Vn.n version is a released version.
286 # A Tn.n version is a released field test version.
287 # A Xn.n version is an unreleased experimental baselevel.
288 # 1.2 uses "1.2" for uname -r.
289 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
290 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
291 exitcode=$?
292 trap '' 0
293 exit $exitcode ;;
294 Alpha\ *:Windows_NT*:*)
295 # How do we know it's Interix rather than the generic POSIX subsystem?
296 # Should we change UNAME_MACHINE based on the output of uname instead
297 # of the specific Alpha model?
298 echo alpha-pc-interix
@@ -294,16 +314,16 @@
314 exit ;;
315 *:z/VM:*:*)
316 echo s390-ibm-zvmoe
317 exit ;;
318 *:OS400:*:*)
319 echo powerpc-ibm-os400
320 exit ;;
321 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
322 echo arm-acorn-riscix${UNAME_RELEASE}
323 exit ;;
324 arm*:riscos:*:*|arm*:RISCOS:*:*)
325 echo arm-unknown-riscos
326 exit ;;
327 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
328 echo hppa1.1-hitachi-hiuxmpp
329 exit ;;
@@ -393,27 +413,27 @@
413 # to the lowercase version "mint" (or "freemint"). Finally
414 # the system name "TOS" denotes a system which is actually not
415 # MiNT. But MiNT is downward compatible to TOS, so this should
416 # be no problem.
417 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
418 echo m68k-atari-mint${UNAME_RELEASE}
419 exit ;;
420 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
421 echo m68k-atari-mint${UNAME_RELEASE}
422 exit ;;
423 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
424 echo m68k-atari-mint${UNAME_RELEASE}
425 exit ;;
426 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
427 echo m68k-milan-mint${UNAME_RELEASE}
428 exit ;;
429 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
430 echo m68k-hades-mint${UNAME_RELEASE}
431 exit ;;
432 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
433 echo m68k-unknown-mint${UNAME_RELEASE}
434 exit ;;
435 m68k:machten:*:*)
436 echo m68k-apple-machten${UNAME_RELEASE}
437 exit ;;
438 powerpc:machten:*:*)
439 echo powerpc-apple-machten${UNAME_RELEASE}
@@ -479,12 +499,12 @@
499 exit ;;
500 m88k:*:3*:R3*)
501 echo m88k-motorola-sysv3
502 exit ;;
503 AViiON:dgux:*:*)
504 # DG/UX returns AViiON for all architectures
505 UNAME_PROCESSOR=`/usr/bin/uname -p`
506 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
507 then
508 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
509 [ ${TARGET_BINARY_INTERFACE}x = x ]
510 then
@@ -493,11 +513,11 @@
513 echo m88k-dg-dguxbcs${UNAME_RELEASE}
514 fi
515 else
516 echo i586-dg-dgux${UNAME_RELEASE}
517 fi
518 exit ;;
519 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
520 echo m88k-dolphin-sysv3
521 exit ;;
522 M88*:*:R3*:*)
523 # Delta 88k system running SVR3
@@ -593,56 +613,56 @@
613 9000/31? ) HP_ARCH=m68000 ;;
614 9000/[34]?? ) HP_ARCH=m68k ;;
615 9000/[678][0-9][0-9])
616 if [ -x /usr/bin/getconf ]; then
617 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
618 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619 case "${sc_cpu_version}" in
620 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
622 532) # CPU_PA_RISC2_0
623 case "${sc_kernel_bits}" in
624 32) HP_ARCH="hppa2.0n" ;;
625 64) HP_ARCH="hppa2.0w" ;;
626 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
627 esac ;;
628 esac
629 fi
630 if [ "${HP_ARCH}" = "" ]; then
631 eval $set_cc_for_build
632 sed 's/^ //' << EOF >$dummy.c
633
634 #define _HPUX_SOURCE
635 #include <stdlib.h>
636 #include <unistd.h>
637
638 int main ()
639 {
640 #if defined(_SC_KERNEL_BITS)
641 long bits = sysconf(_SC_KERNEL_BITS);
642 #endif
643 long cpu = sysconf (_SC_CPU_VERSION);
644
645 switch (cpu)
646 {
647 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
648 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
649 case CPU_PA_RISC2_0:
650 #if defined(_SC_KERNEL_BITS)
651 switch (bits)
652 {
653 case 64: puts ("hppa2.0w"); break;
654 case 32: puts ("hppa2.0n"); break;
655 default: puts ("hppa2.0"); break;
656 } break;
657 #else /* !defined(_SC_KERNEL_BITS) */
658 puts ("hppa2.0"); break;
659 #endif
660 default: puts ("hppa1.0"); break;
661 }
662 exit (0);
663 }
664 EOF
665 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
666 test -z "$HP_ARCH" && HP_ARCH=hppa
667 fi ;;
668 esac
@@ -729,26 +749,26 @@
749 parisc*:Lites*:*:*)
750 echo hppa1.1-hp-lites
751 exit ;;
752 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
753 echo c1-convex-bsd
754 exit ;;
755 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
756 if getsysinfo -f scalar_acc
757 then echo c32-convex-bsd
758 else echo c2-convex-bsd
759 fi
760 exit ;;
761 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
762 echo c34-convex-bsd
763 exit ;;
764 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
765 echo c38-convex-bsd
766 exit ;;
767 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
768 echo c4-convex-bsd
769 exit ;;
770 CRAY*Y-MP:*:*:*)
771 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
772 exit ;;
773 CRAY*[A-Z]90:*:*:*)
774 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
@@ -768,18 +788,18 @@
788 *:UNICOS/mp:*:*)
789 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
790 exit ;;
791 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
792 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
793 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
795 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796 exit ;;
797 5000:UNIX_System_V:4.*:*)
798 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
800 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
801 exit ;;
802 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
803 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
804 exit ;;
805 sparc*:BSD/OS:*:*)
@@ -787,37 +807,39 @@
807 exit ;;
808 *:BSD/OS:*:*)
809 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
810 exit ;;
811 *:FreeBSD:*:*)
812 UNAME_PROCESSOR=`/usr/bin/uname -p`
813 case ${UNAME_PROCESSOR} in
 
814 amd64)
815 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
816 *)
817 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
818 esac
819 exit ;;
820 i*:CYGWIN*:*)
821 echo ${UNAME_MACHINE}-pc-cygwin
822 exit ;;
823 *:MINGW64*:*)
824 echo ${UNAME_MACHINE}-pc-mingw64
825 exit ;;
826 *:MINGW*:*)
827 echo ${UNAME_MACHINE}-pc-mingw32
828 exit ;;
829 *:MSYS*:*)
830 echo ${UNAME_MACHINE}-pc-msys
831 exit ;;
832 i*:windows32*:*)
833 # uname -m includes "-pc" on this system.
834 echo ${UNAME_MACHINE}-mingw32
835 exit ;;
836 i*:PW*:*)
837 echo ${UNAME_MACHINE}-pc-pw32
838 exit ;;
839 *:Interix*:*)
840 case ${UNAME_MACHINE} in
841 x86)
842 echo i586-pc-interix${UNAME_RELEASE}
843 exit ;;
844 authenticamd | genuineintel | EM64T)
845 echo x86_64-unknown-interix${UNAME_RELEASE}
@@ -850,74 +872,85 @@
872 prep*:SunOS:5.*:*)
873 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
874 exit ;;
875 *:GNU:*:*)
876 # the GNU system
877 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
878 exit ;;
879 *:GNU/*:*:*)
880 # other systems with GNU libc and userland
881 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
882 exit ;;
883 i*86:Minix:*:*)
884 echo ${UNAME_MACHINE}-pc-minix
885 exit ;;
886 aarch64:Linux:*:*)
887 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
888 exit ;;
889 aarch64_be:Linux:*:*)
890 UNAME_MACHINE=aarch64_be
891 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
892 exit ;;
893 alpha:Linux:*:*)
894 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
895 EV5) UNAME_MACHINE=alphaev5 ;;
896 EV56) UNAME_MACHINE=alphaev56 ;;
897 PCA56) UNAME_MACHINE=alphapca56 ;;
898 PCA57) UNAME_MACHINE=alphapca56 ;;
899 EV6) UNAME_MACHINE=alphaev6 ;;
900 EV67) UNAME_MACHINE=alphaev67 ;;
901 EV68*) UNAME_MACHINE=alphaev68 ;;
902 esac
903 objdump --private-headers /bin/sh | grep -q ld.so.1
904 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
905 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
906 exit ;;
907 arc:Linux:*:* | arceb:Linux:*:*)
908 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
909 exit ;;
910 arm*:Linux:*:*)
911 eval $set_cc_for_build
912 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
913 | grep -q __ARM_EABI__
914 then
915 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
916 else
917 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918 | grep -q __ARM_PCS_VFP
919 then
920 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
921 else
922 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
923 fi
924 fi
925 exit ;;
926 avr32*:Linux:*:*)
927 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
928 exit ;;
929 cris:Linux:*:*)
930 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
931 exit ;;
932 crisv32:Linux:*:*)
933 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
934 exit ;;
935 frv:Linux:*:*)
936 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
937 exit ;;
938 hexagon:Linux:*:*)
939 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
940 exit ;;
941 i*86:Linux:*:*)
942 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 
 
 
 
 
 
 
 
943 exit ;;
944 ia64:Linux:*:*)
945 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
946 exit ;;
947 m32r*:Linux:*:*)
948 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
949 exit ;;
950 m68*:Linux:*:*)
951 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
952 exit ;;
953 mips:Linux:*:* | mips64:Linux:*:*)
954 eval $set_cc_for_build
955 sed 's/^ //' << EOF >$dummy.c
956 #undef CPU
@@ -932,71 +965,80 @@
965 CPU=
966 #endif
967 #endif
968 EOF
969 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
970 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
971 ;;
972 openrisc*:Linux:*:*)
973 echo or1k-unknown-linux-${LIBC}
974 exit ;;
975 or32:Linux:*:* | or1k*:Linux:*:*)
976 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
977 exit ;;
978 padre:Linux:*:*)
979 echo sparc-unknown-linux-${LIBC}
980 exit ;;
981 parisc64:Linux:*:* | hppa64:Linux:*:*)
982 echo hppa64-unknown-linux-${LIBC}
983 exit ;;
984 parisc:Linux:*:* | hppa:Linux:*:*)
985 # Look for CPU level
986 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
987 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989 *) echo hppa-unknown-linux-${LIBC} ;;
990 esac
991 exit ;;
992 ppc64:Linux:*:*)
993 echo powerpc64-unknown-linux-${LIBC}
994 exit ;;
995 ppc:Linux:*:*)
996 echo powerpc-unknown-linux-${LIBC}
997 exit ;;
998 ppc64le:Linux:*:*)
999 echo powerpc64le-unknown-linux-${LIBC}
1000 exit ;;
1001 ppcle:Linux:*:*)
1002 echo powerpcle-unknown-linux-${LIBC}
1003 exit ;;
1004 s390:Linux:*:* | s390x:Linux:*:*)
1005 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1006 exit ;;
1007 sh64*:Linux:*:*)
1008 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1009 exit ;;
1010 sh*:Linux:*:*)
1011 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1012 exit ;;
1013 sparc:Linux:*:* | sparc64:Linux:*:*)
1014 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1015 exit ;;
1016 tile*:Linux:*:*)
1017 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1018 exit ;;
1019 vax:Linux:*:*)
1020 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1021 exit ;;
1022 x86_64:Linux:*:*)
1023 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1024 exit ;;
1025 xtensa*:Linux:*:*)
1026 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1027 exit ;;
1028 i*86:DYNIX/ptx:4*:*)
1029 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1030 # earlier versions are messed up and put the nodename in both
1031 # sysname and nodename.
1032 echo i386-sequent-sysv4
1033 exit ;;
1034 i*86:UNIX_SV:4.2MP:2.*)
1035 # Unixware is an offshoot of SVR4, but it has its own version
1036 # number series starting with 2...
1037 # I am not positive that other SVR4 systems won't match this,
1038 # I just have to hope. -- rms.
1039 # Use sysv4.2uw... so that sysv4* matches it.
1040 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1041 exit ;;
1042 i*86:OS/2:*:*)
1043 # If we were able to find `uname', then EMX Unix compatibility
1044 # is probably installed.
@@ -1024,11 +1066,11 @@
1066 else
1067 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1068 fi
1069 exit ;;
1070 i*86:*:5:[678]*)
1071 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1072 case `/bin/uname -X | grep "^Machine"` in
1073 *486*) UNAME_MACHINE=i486 ;;
1074 *Pentium) UNAME_MACHINE=i586 ;;
1075 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1076 esac
@@ -1052,17 +1094,17 @@
1094 echo ${UNAME_MACHINE}-pc-sysv32
1095 fi
1096 exit ;;
1097 pc:*:*:*)
1098 # Left here for compatibility:
1099 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1100 # the processor, so we play safe by assuming i586.
1101 # Note: whatever this is, it MUST be the same as what config.sub
1102 # prints for the "djgpp" host, or else GDB configury will decide that
1103 # this is a cross-build.
1104 echo i586-pc-msdosdjgpp
1105 exit ;;
1106 Intel:Mach:3*:*)
1107 echo i386-pc-mach3
1108 exit ;;
1109 paragon:*:*:*)
1110 echo i860-intel-osf1
@@ -1093,12 +1135,12 @@
1135 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1136 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1137 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1138 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1139 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1140 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1141 && { echo i486-ncr-sysv4; exit; } ;;
1142 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1143 OS_REL='.3'
1144 test -r /etc/.relid \
1145 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1146 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
@@ -1137,14 +1179,14 @@
1179 echo ${UNAME_MACHINE}-sni-sysv4
1180 else
1181 echo ns32k-sni-sysv
1182 fi
1183 exit ;;
1184 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1185 # says <[email protected]>
1186 echo i586-unisys-sysv4
1187 exit ;;
1188 *:UNIX_System_V:4*:FTX*)
1189 # From Gerald Hewes <[email protected]>.
1190 # How about differentiating between stratus architectures? -djm
1191 echo hppa1.1-stratus-sysv4
1192 exit ;;
@@ -1166,15 +1208,15 @@
1208 news*:NEWS-OS:6*:*)
1209 echo mips-sony-newsos6
1210 exit ;;
1211 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1212 if [ -d /usr/nec ]; then
1213 echo mips-nec-sysv${UNAME_RELEASE}
1214 else
1215 echo mips-unknown-sysv${UNAME_RELEASE}
1216 fi
1217 exit ;;
1218 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1219 echo powerpc-be-beos
1220 exit ;;
1221 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1222 echo powerpc-apple-beos
@@ -1183,10 +1225,13 @@
1225 echo i586-pc-beos
1226 exit ;;
1227 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1228 echo i586-pc-haiku
1229 exit ;;
1230 x86_64:Haiku:*:*)
1231 echo x86_64-unknown-haiku
1232 exit ;;
1233 SX-4:SUPER-UX:*:*)
1234 echo sx4-nec-superux${UNAME_RELEASE}
1235 exit ;;
1236 SX-5:SUPER-UX:*:*)
1237 echo sx5-nec-superux${UNAME_RELEASE}
@@ -1209,23 +1254,35 @@
1254 *:Rhapsody:*:*)
1255 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1256 exit ;;
1257 *:Darwin:*:*)
1258 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1259 eval $set_cc_for_build
1260 if test "$UNAME_PROCESSOR" = unknown ; then
1261 UNAME_PROCESSOR=powerpc
1262 fi
1263 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1264 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1265 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1266 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1267 grep IS_64BIT_ARCH >/dev/null
1268 then
1269 case $UNAME_PROCESSOR in
1270 i386) UNAME_PROCESSOR=x86_64 ;;
1271 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1272 esac
1273 fi
1274 fi
1275 elif test "$UNAME_PROCESSOR" = i386 ; then
1276 # Avoid executing cc on OS X 10.9, as it ships with a stub
1277 # that puts up a graphical alert prompting to install
1278 # developer tools. Any system running Mac OS X 10.7 or
1279 # later (Darwin 11 and later) is required to have a 64-bit
1280 # processor. This is not true of the ARM version of Darwin
1281 # that Apple uses in portable devices.
1282 UNAME_PROCESSOR=x86_64
1283 fi
1284 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1285 exit ;;
1286 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1287 UNAME_PROCESSOR=`uname -p`
1288 if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1238,11 +1295,11 @@
1295 echo i386-pc-qnx
1296 exit ;;
1297 NEO-?:NONSTOP_KERNEL:*:*)
1298 echo neo-tandem-nsk${UNAME_RELEASE}
1299 exit ;;
1300 NSE-*:NONSTOP_KERNEL:*:*)
1301 echo nse-tandem-nsk${UNAME_RELEASE}
1302 exit ;;
1303 NSR-?:NONSTOP_KERNEL:*:*)
1304 echo nsr-tandem-nsk${UNAME_RELEASE}
1305 exit ;;
@@ -1283,17 +1340,17 @@
1340 exit ;;
1341 *:ITS:*:*)
1342 echo pdp10-unknown-its
1343 exit ;;
1344 SEI:*:*:SEIUX)
1345 echo mips-sei-seiux${UNAME_RELEASE}
1346 exit ;;
1347 *:DragonFly:*:*)
1348 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1349 exit ;;
1350 *:*VMS:*:*)
1351 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1352 case "${UNAME_MACHINE}" in
1353 A*) echo alpha-dec-vms ; exit ;;
1354 I*) echo ia64-dec-vms ; exit ;;
1355 V*) echo vax-dec-vms ; exit ;;
1356 esac ;;
@@ -1307,162 +1364,14 @@
1364 echo ${UNAME_MACHINE}-pc-rdos
1365 exit ;;
1366 i*86:AROS:*:*)
1367 echo ${UNAME_MACHINE}-pc-aros
1368 exit ;;
1369 x86_64:VMkernel:*:*)
1370 echo ${UNAME_MACHINE}-unknown-esx
1371 exit ;;
1372 esac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1373
1374 cat >&2 <<EOF
1375 $0: unable to guess system type
1376
1377 This script, last modified $timestamp, has failed to recognize
1378
+154 -103
--- autosetup/config.sub
+++ autosetup/config.sub
@@ -1,40 +1,33 @@
11
#! /bin/sh
22
# Configuration validation subroutine script.
3
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5
-# Free Software Foundation, Inc.
6
-
7
-timestamp='2010-09-11'
8
-
9
-# This file is (in principle) common to ALL GNU software.
10
-# The presence of a machine in this file suggests that SOME GNU software
11
-# can handle that machine. It does not imply ALL GNU software can.
12
-#
13
-# This file is free software; you can redistribute it and/or modify
14
-# it under the terms of the GNU General Public License as published by
15
-# the Free Software Foundation; either version 2 of the License, or
3
+# Copyright 1992-2014 Free Software Foundation, Inc.
4
+
5
+timestamp='2014-05-01'
6
+
7
+# This file is free software; you can redistribute it and/or modify it
8
+# under the terms of the GNU General Public License as published by
9
+# the Free Software Foundation; either version 3 of the License, or
1610
# (at your option) any later version.
1711
#
18
-# This program is distributed in the hope that it will be useful,
19
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
-# GNU General Public License for more details.
12
+# This program is distributed in the hope that it will be useful, but
13
+# WITHOUT ANY WARRANTY; without even the implied warranty of
14
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+# General Public License for more details.
2216
#
2317
# You should have received a copy of the GNU General Public License
24
-# along with this program; if not, write to the Free Software
25
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26
-# 02110-1301, USA.
18
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
2719
#
2820
# As a special exception to the GNU General Public License, if you
2921
# distribute this file as part of a program that contains a
3022
# configuration script generated by Autoconf, you may include it under
31
-# the same distribution terms that you use for the rest of that program.
23
+# the same distribution terms that you use for the rest of that
24
+# program. This Exception is an additional permission under section 7
25
+# of the GNU General Public License, version 3 ("GPLv3").
3226
3327
34
-# Please send patches to <[email protected]>. Submit a context
35
-# diff and a properly formatted GNU ChangeLog entry.
28
+# Please send patches with a ChangeLog entry to [email protected].
3629
#
3730
# Configuration subroutine to validate and canonicalize a configuration type.
3831
# Supply the specified configuration type as an argument.
3932
# If it is invalid, we print an error message on stderr and exit with code 1.
4033
# Otherwise, we print the canonical config type on stdout and succeed.
@@ -73,13 +66,11 @@
7366
Report bugs and patches to <[email protected]>."
7467
7568
version="\
7669
GNU config.sub ($timestamp)
7770
78
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80
-Software Foundation, Inc.
71
+Copyright 1992-2014 Free Software Foundation, Inc.
8172
8273
This is free software; see the source for copying conditions. There is NO
8374
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8475
8576
help="
@@ -123,17 +114,21 @@
123114
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124115
# Here we must recognize all the valid KERNEL-OS combinations.
125116
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126117
case $maybe_os in
127118
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129120
knetbsd*-gnu* | netbsd*-gnu* | \
130121
kopensolaris*-gnu* | \
131122
storm-chaos* | os2-emx* | rtmk-nova*)
132123
os=-$maybe_os
133124
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
134125
;;
126
+ android-linux)
127
+ os=-linux-android
128
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
129
+ ;;
135130
*)
136131
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
137132
if [ $basic_machine != $1 ]
138133
then os=`echo $1 | sed 's/.*-/-/'`
139134
else os=; fi
@@ -152,16 +147,16 @@
152147
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
153148
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
154149
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
155150
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
156151
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157
- -apple | -axis | -knuth | -cray | -microblaze)
152
+ -apple | -axis | -knuth | -cray | -microblaze*)
158153
os=
159154
basic_machine=$1
160155
;;
161
- -bluegene*)
162
- os=-cnk
156
+ -bluegene*)
157
+ os=-cnk
163158
;;
164159
-sim | -cisco | -oki | -wec | -winbond)
165160
os=
166161
basic_machine=$1
167162
;;
@@ -173,14 +168,14 @@
173168
;;
174169
-chorusos*)
175170
os=-chorusos
176171
basic_machine=$1
177172
;;
178
- -chorusrdb)
179
- os=-chorusrdb
173
+ -chorusrdb)
174
+ os=-chorusrdb
180175
basic_machine=$1
181
- ;;
176
+ ;;
182177
-hiux*)
183178
os=-hiuxwe2
184179
;;
185180
-sco6)
186181
os=-sco5v6
@@ -221,10 +216,16 @@
221216
basic_machine=clipper-intergraph
222217
;;
223218
-isc*)
224219
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
225220
;;
221
+ -lynx*178)
222
+ os=-lynxos178
223
+ ;;
224
+ -lynx*5)
225
+ os=-lynxos5
226
+ ;;
226227
-lynx*)
227228
os=-lynxos
228229
;;
229230
-ptx*)
230231
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
@@ -245,24 +246,32 @@
245246
case $basic_machine in
246247
# Recognize the basic CPU types without company name.
247248
# Some are omitted here because they have special meanings below.
248249
1750a | 580 \
249250
| a29k \
251
+ | aarch64 | aarch64_be \
250252
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
251253
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
252254
| am33_2.0 \
253
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
255
+ | arc | arceb \
256
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
257
+ | avr | avr32 \
258
+ | be32 | be64 \
254259
| bfin \
255
- | c4x | clipper \
260
+ | c4x | c8051 | clipper \
256261
| d10v | d30v | dlx | dsp16xx \
262
+ | epiphany \
257263
| fido | fr30 | frv \
258264
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
265
+ | hexagon \
259266
| i370 | i860 | i960 | ia64 \
260267
| ip2k | iq2000 \
268
+ | k1om \
269
+ | le32 | le64 \
261270
| lm32 \
262271
| m32c | m32r | m32rle | m68000 | m68k | m88k \
263
- | maxq | mb | microblaze | mcore | mep | metag \
272
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
264273
| mips | mipsbe | mipseb | mipsel | mipsle \
265274
| mips16 \
266275
| mips64 | mips64el \
267276
| mips64octeon | mips64octeonel \
268277
| mips64orion | mips64orionel \
@@ -272,38 +281,41 @@
272281
| mips64vr4300 | mips64vr4300el \
273282
| mips64vr5000 | mips64vr5000el \
274283
| mips64vr5900 | mips64vr5900el \
275284
| mipsisa32 | mipsisa32el \
276285
| mipsisa32r2 | mipsisa32r2el \
286
+ | mipsisa32r6 | mipsisa32r6el \
277287
| mipsisa64 | mipsisa64el \
278288
| mipsisa64r2 | mipsisa64r2el \
289
+ | mipsisa64r6 | mipsisa64r6el \
279290
| mipsisa64sb1 | mipsisa64sb1el \
280291
| mipsisa64sr71k | mipsisa64sr71kel \
292
+ | mipsr5900 | mipsr5900el \
281293
| mipstx39 | mipstx39el \
282294
| mn10200 | mn10300 \
283295
| moxie \
284296
| mt \
285297
| msp430 \
286298
| nds32 | nds32le | nds32be \
287
- | nios | nios2 \
299
+ | nios | nios2 | nios2eb | nios2el \
288300
| ns16k | ns32k \
289
- | or32 \
301
+ | open8 | or1k | or1knd | or32 \
290302
| pdp10 | pdp11 | pj | pjl \
291
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
303
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
292304
| pyramid \
293
- | rx \
305
+ | rl78 | rx \
294306
| score \
295307
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
296308
| sh64 | sh64le \
297309
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
298310
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
299
- | spu | strongarm \
300
- | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
311
+ | spu \
312
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
301313
| ubicom32 \
302
- | v850 | v850e \
314
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
303315
| we32k \
304
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
316
+ | x86 | xc16x | xstormy16 | xtensa \
305317
| z8k | z80)
306318
basic_machine=$basic_machine-unknown
307319
;;
308320
c54x)
309321
basic_machine=tic54x-unknown
@@ -312,20 +324,34 @@
312324
basic_machine=tic55x-unknown
313325
;;
314326
c6x)
315327
basic_machine=tic6x-unknown
316328
;;
317
- m6811 | m68hc11 | m6812 | m68hc12 | picochip)
318
- # Motorola 68HC11/12.
329
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
319330
basic_machine=$basic_machine-unknown
320331
os=-none
321332
;;
322333
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
323334
;;
324335
ms1)
325336
basic_machine=mt-unknown
326337
;;
338
+
339
+ strongarm | thumb | xscale)
340
+ basic_machine=arm-unknown
341
+ ;;
342
+ xgate)
343
+ basic_machine=$basic_machine-unknown
344
+ os=-none
345
+ ;;
346
+ xscaleeb)
347
+ basic_machine=armeb-unknown
348
+ ;;
349
+
350
+ xscaleel)
351
+ basic_machine=armel-unknown
352
+ ;;
327353
328354
# We use `pc' rather than `unknown'
329355
# because (1) that's what they normally are, and
330356
# (2) the word "unknown" tends to confuse beginning users.
331357
i*86 | x86_64)
@@ -337,29 +363,35 @@
337363
exit 1
338364
;;
339365
# Recognize the basic CPU types with company name.
340366
580-* \
341367
| a29k-* \
368
+ | aarch64-* | aarch64_be-* \
342369
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
343370
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
344
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
371
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
345372
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
346373
| avr-* | avr32-* \
374
+ | be32-* | be64-* \
347375
| bfin-* | bs2000-* \
348376
| c[123]* | c30-* | [cjt]90-* | c4x-* \
349
- | clipper-* | craynv-* | cydra-* \
377
+ | c8051-* | clipper-* | craynv-* | cydra-* \
350378
| d10v-* | d30v-* | dlx-* \
351379
| elxsi-* \
352380
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
353381
| h8300-* | h8500-* \
354382
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
383
+ | hexagon-* \
355384
| i*86-* | i860-* | i960-* | ia64-* \
356385
| ip2k-* | iq2000-* \
386
+ | k1om-* \
387
+ | le32-* | le64-* \
357388
| lm32-* \
358389
| m32c-* | m32r-* | m32rle-* \
359390
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
360
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
391
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
392
+ | microblaze-* | microblazeel-* \
361393
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
362394
| mips16-* \
363395
| mips64-* | mips64el-* \
364396
| mips64octeon-* | mips64octeonel-* \
365397
| mips64orion-* | mips64orionel-* \
@@ -369,39 +401,45 @@
369401
| mips64vr4300-* | mips64vr4300el-* \
370402
| mips64vr5000-* | mips64vr5000el-* \
371403
| mips64vr5900-* | mips64vr5900el-* \
372404
| mipsisa32-* | mipsisa32el-* \
373405
| mipsisa32r2-* | mipsisa32r2el-* \
406
+ | mipsisa32r6-* | mipsisa32r6el-* \
374407
| mipsisa64-* | mipsisa64el-* \
375408
| mipsisa64r2-* | mipsisa64r2el-* \
409
+ | mipsisa64r6-* | mipsisa64r6el-* \
376410
| mipsisa64sb1-* | mipsisa64sb1el-* \
377411
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
412
+ | mipsr5900-* | mipsr5900el-* \
378413
| mipstx39-* | mipstx39el-* \
379414
| mmix-* \
380415
| mt-* \
381416
| msp430-* \
382417
| nds32-* | nds32le-* | nds32be-* \
383
- | nios-* | nios2-* \
418
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
384419
| none-* | np1-* | ns16k-* | ns32k-* \
420
+ | open8-* \
421
+ | or1k*-* \
385422
| orion-* \
386423
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
387
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
424
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
388425
| pyramid-* \
389
- | romp-* | rs6000-* | rx-* \
426
+ | rl78-* | romp-* | rs6000-* | rx-* \
390427
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
391428
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
392429
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
393430
| sparclite-* \
394
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
395
- | tahoe-* | thumb-* \
431
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
432
+ | tahoe-* \
396433
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
397
- | tile-* | tilegx-* \
434
+ | tile*-* \
398435
| tron-* \
399436
| ubicom32-* \
400
- | v850-* | v850e-* | vax-* \
437
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
438
+ | vax-* \
401439
| we32k-* \
402
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
440
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
403441
| xstormy16-* | xtensa*-* \
404442
| ymp-* \
405443
| z8k-* | z80-*)
406444
;;
407445
# Recognize the basic CPU types without company name, with glob match.
@@ -422,11 +460,11 @@
422460
;;
423461
a29khif)
424462
basic_machine=a29k-amd
425463
os=-udi
426464
;;
427
- abacus)
465
+ abacus)
428466
basic_machine=abacus-unknown
429467
;;
430468
adobe68k)
431469
basic_machine=m68010-adobe
432470
os=-scout
@@ -505,11 +543,11 @@
505543
;;
506544
c90)
507545
basic_machine=c90-cray
508546
os=-unicos
509547
;;
510
- cegcc)
548
+ cegcc)
511549
basic_machine=arm-unknown
512550
os=-cegcc
513551
;;
514552
convex-c1)
515553
basic_machine=c1-convex
@@ -537,11 +575,11 @@
537575
;;
538576
craynv)
539577
basic_machine=craynv-cray
540578
os=-unicosmp
541579
;;
542
- cr16)
580
+ cr16 | cr16-*)
543581
basic_machine=cr16-unknown
544582
os=-elf
545583
;;
546584
crds | unos)
547585
basic_machine=m68k-crds
@@ -695,11 +733,10 @@
695733
os=-proelf
696734
;;
697735
i370-ibm* | ibm*)
698736
basic_machine=i370-ibm
699737
;;
700
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
701738
i*86v32)
702739
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
703740
os=-sysv32
704741
;;
705742
i*86v4*)
@@ -753,15 +790,19 @@
753790
;;
754791
merlin)
755792
basic_machine=ns32k-utek
756793
os=-sysv
757794
;;
758
- microblaze)
795
+ microblaze*)
759796
basic_machine=microblaze-xilinx
760797
;;
798
+ mingw64)
799
+ basic_machine=x86_64-pc
800
+ os=-mingw64
801
+ ;;
761802
mingw32)
762
- basic_machine=i386-pc
803
+ basic_machine=i686-pc
763804
os=-mingw32
764805
;;
765806
mingw32ce)
766807
basic_machine=arm-unknown
767808
os=-mingw32ce
@@ -792,18 +833,22 @@
792833
os=-msdos
793834
;;
794835
ms1-*)
795836
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
796837
;;
838
+ msys)
839
+ basic_machine=i686-pc
840
+ os=-msys
841
+ ;;
797842
mvs)
798843
basic_machine=i370-ibm
799844
os=-mvs
800845
;;
801
- msys)
802
- basic_machine=i386-pc
803
- os=-msys
804
- ;;
846
+ nacl)
847
+ basic_machine=le32-unknown
848
+ os=-nacl
849
+ ;;
805850
ncr3000)
806851
basic_machine=i486-ncr
807852
os=-sysv4
808853
;;
809854
netbsd386)
@@ -864,14 +909,14 @@
864909
os=-nonstopux
865910
;;
866911
np1)
867912
basic_machine=np1-gould
868913
;;
869
- neo-tandem)
914
+ neo-tandem)
870915
basic_machine=neo-tandem
871916
;;
872
- nse-tandem)
917
+ nse-tandem)
873918
basic_machine=nse-tandem
874919
;;
875920
nsr-tandem)
876921
basic_machine=nsr-tandem
877922
;;
@@ -952,13 +997,14 @@
952997
pn)
953998
basic_machine=pn-gould
954999
;;
9551000
power) basic_machine=power-ibm
9561001
;;
957
- ppc) basic_machine=powerpc-unknown
1002
+ ppc | ppcbe) basic_machine=powerpc-unknown
9581003
;;
959
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1004
+ ppc-* | ppcbe-*)
1005
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
9601006
;;
9611007
ppcle | powerpclittle | ppc-le | powerpc-little)
9621008
basic_machine=powerpcle-unknown
9631009
;;
9641010
ppcle-* | powerpclittle-*)
@@ -979,11 +1025,15 @@
9791025
;;
9801026
pw32)
9811027
basic_machine=i586-unknown
9821028
os=-pw32
9831029
;;
984
- rdos)
1030
+ rdos | rdos64)
1031
+ basic_machine=x86_64-pc
1032
+ os=-rdos
1033
+ ;;
1034
+ rdos32)
9851035
basic_machine=i386-pc
9861036
os=-rdos
9871037
;;
9881038
rom68k)
9891039
basic_machine=m68k-rom68k
@@ -1048,10 +1098,13 @@
10481098
;;
10491099
stratus)
10501100
basic_machine=i860-stratus
10511101
os=-sysv4
10521102
;;
1103
+ strongarm-* | thumb-*)
1104
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1105
+ ;;
10531106
sun2)
10541107
basic_machine=m68000-sun
10551108
;;
10561109
sun2os3)
10571110
basic_machine=m68000-sun
@@ -1104,17 +1157,12 @@
11041157
;;
11051158
t90)
11061159
basic_machine=t90-cray
11071160
os=-unicos
11081161
;;
1109
- # This must be matched before tile*.
1110
- tilegx*)
1111
- basic_machine=tilegx-unknown
1112
- os=-linux-gnu
1113
- ;;
11141162
tile*)
1115
- basic_machine=tile-unknown
1163
+ basic_machine=$basic_machine-unknown
11161164
os=-linux-gnu
11171165
;;
11181166
tx39)
11191167
basic_machine=mipstx39-unknown
11201168
;;
@@ -1180,10 +1228,13 @@
11801228
os=-mingw32
11811229
;;
11821230
xps | xps100)
11831231
basic_machine=xps100-honeywell
11841232
;;
1233
+ xscale-* | xscalee[bl]-*)
1234
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1235
+ ;;
11851236
ymp)
11861237
basic_machine=ymp-cray
11871238
os=-unicos
11881239
;;
11891240
z8k-*-coff)
@@ -1277,15 +1328,15 @@
12771328
# Decode manufacturer-specific aliases for certain operating systems.
12781329
12791330
if [ x"$os" != x"" ]
12801331
then
12811332
case $os in
1282
- # First match some system type aliases
1283
- # that might get confused with valid system types.
1333
+ # First match some system type aliases
1334
+ # that might get confused with valid system types.
12841335
# -solaris* is a basic system type, with this one exception.
1285
- -auroraux)
1286
- os=-auroraux
1336
+ -auroraux)
1337
+ os=-auroraux
12871338
;;
12881339
-solaris1 | -solaris1.*)
12891340
os=`echo $os | sed -e 's|solaris1|sunos4|'`
12901341
;;
12911342
-solaris)
@@ -1305,33 +1356,33 @@
13051356
# Each alternative MUST END IN A *, to match a version number.
13061357
# -sysv* is not here because it comes later, after sysvr4.
13071358
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
13081359
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
13091360
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1310
- | -sym* | -kopensolaris* \
1361
+ | -sym* | -kopensolaris* | -plan9* \
13111362
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
13121363
| -aos* | -aros* \
13131364
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13141365
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
13151366
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1316
- | -openbsd* | -solidbsd* \
1367
+ | -bitrig* | -openbsd* | -solidbsd* \
13171368
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13181369
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13191370
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
13201371
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
13211372
| -chorusos* | -chorusrdb* | -cegcc* \
13221373
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1323
- | -mingw32* | -linux-gnu* | -linux-android* \
1324
- | -linux-newlib* | -linux-uclibc* \
1374
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1375
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
13251376
| -uxpv* | -beos* | -mpeix* | -udk* \
13261377
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13271378
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13281379
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13291380
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13301381
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13311382
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1332
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1383
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
13331384
# Remember, each alternative MUST END IN *, to match a version number.
13341385
;;
13351386
-qnx*)
13361387
case $basic_machine in
13371388
x86-* | i*86-*)
@@ -1366,11 +1417,11 @@
13661417
os=`echo $os | sed -e 's|sunos6|solaris3|'`
13671418
;;
13681419
-opened*)
13691420
os=-openedition
13701421
;;
1371
- -os400*)
1422
+ -os400*)
13721423
os=-os400
13731424
;;
13741425
-wince*)
13751426
os=-wince
13761427
;;
@@ -1415,11 +1466,11 @@
14151466
os=`echo $os | sed -e 's|sinix|sysv|'`
14161467
;;
14171468
-sinix*)
14181469
os=-sysv4
14191470
;;
1420
- -tpf*)
1471
+ -tpf*)
14211472
os=-tpf
14221473
;;
14231474
-triton*)
14241475
os=-sysv3
14251476
;;
@@ -1451,21 +1502,18 @@
14511502
os=-mint
14521503
;;
14531504
-aros*)
14541505
os=-aros
14551506
;;
1456
- -kaos*)
1457
- os=-kaos
1458
- ;;
14591507
-zvmoe)
14601508
os=-zvmoe
14611509
;;
14621510
-dicos*)
14631511
os=-dicos
14641512
;;
1465
- -nacl*)
1466
- ;;
1513
+ -nacl*)
1514
+ ;;
14671515
-none)
14681516
;;
14691517
*)
14701518
# Get rid of the `-' at the beginning of $os.
14711519
os=`echo $os | sed 's/[^-]*-//'`
@@ -1484,14 +1532,14 @@
14841532
# that MANUFACTURER isn't an operating system. Otherwise, code above
14851533
# will signal an error saying that MANUFACTURER isn't an operating
14861534
# system, and we'll never get to this point.
14871535
14881536
case $basic_machine in
1489
- score-*)
1537
+ score-*)
14901538
os=-elf
14911539
;;
1492
- spu-*)
1540
+ spu-*)
14931541
os=-elf
14941542
;;
14951543
*-acorn)
14961544
os=-riscix1.2
14971545
;;
@@ -1499,12 +1547,18 @@
14991547
os=-linux
15001548
;;
15011549
arm*-semi)
15021550
os=-aout
15031551
;;
1504
- c4x-* | tic4x-*)
1505
- os=-coff
1552
+ c4x-* | tic4x-*)
1553
+ os=-coff
1554
+ ;;
1555
+ c8051-*)
1556
+ os=-elf
1557
+ ;;
1558
+ hexagon-*)
1559
+ os=-elf
15061560
;;
15071561
tic54x-*)
15081562
os=-coff
15091563
;;
15101564
tic55x-*)
@@ -1529,18 +1583,15 @@
15291583
i386-sun)
15301584
os=-sunos4.0.2
15311585
;;
15321586
m68000-sun)
15331587
os=-sunos3
1534
- # This also exists in the configure program, but was not the
1535
- # default.
1536
- # os=-sunos4
15371588
;;
15381589
m68*-cisco)
15391590
os=-aout
15401591
;;
1541
- mep-*)
1592
+ mep-*)
15421593
os=-elf
15431594
;;
15441595
mips*-cisco)
15451596
os=-elf
15461597
;;
@@ -1563,11 +1614,11 @@
15631614
os=-haiku
15641615
;;
15651616
*-ibm)
15661617
os=-aix
15671618
;;
1568
- *-knuth)
1619
+ *-knuth)
15691620
os=-mmixware
15701621
;;
15711622
*-wec)
15721623
os=-proelf
15731624
;;
15741625
--- autosetup/config.sub
+++ autosetup/config.sub
@@ -1,40 +1,33 @@
1 #! /bin/sh
2 # Configuration validation subroutine script.
3 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5 # Free Software Foundation, Inc.
6
7 timestamp='2010-09-11'
8
9 # This file is (in principle) common to ALL GNU software.
10 # The presence of a machine in this file suggests that SOME GNU software
11 # can handle that machine. It does not imply ALL GNU software can.
12 #
13 # This file is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
17 #
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26 # 02110-1301, USA.
27 #
28 # As a special exception to the GNU General Public License, if you
29 # distribute this file as part of a program that contains a
30 # configuration script generated by Autoconf, you may include it under
31 # the same distribution terms that you use for the rest of that program.
 
 
32
33
34 # Please send patches to <[email protected]>. Submit a context
35 # diff and a properly formatted GNU ChangeLog entry.
36 #
37 # Configuration subroutine to validate and canonicalize a configuration type.
38 # Supply the specified configuration type as an argument.
39 # If it is invalid, we print an error message on stderr and exit with code 1.
40 # Otherwise, we print the canonical config type on stdout and succeed.
@@ -73,13 +66,11 @@
73 Report bugs and patches to <[email protected]>."
74
75 version="\
76 GNU config.sub ($timestamp)
77
78 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80 Software Foundation, Inc.
81
82 This is free software; see the source for copying conditions. There is NO
83 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84
85 help="
@@ -123,17 +114,21 @@
123 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124 # Here we must recognize all the valid KERNEL-OS combinations.
125 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126 case $maybe_os in
127 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128 linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129 knetbsd*-gnu* | netbsd*-gnu* | \
130 kopensolaris*-gnu* | \
131 storm-chaos* | os2-emx* | rtmk-nova*)
132 os=-$maybe_os
133 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
134 ;;
 
 
 
 
135 *)
136 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
137 if [ $basic_machine != $1 ]
138 then os=`echo $1 | sed 's/.*-/-/'`
139 else os=; fi
@@ -152,16 +147,16 @@
152 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
153 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
154 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
155 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
156 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157 -apple | -axis | -knuth | -cray | -microblaze)
158 os=
159 basic_machine=$1
160 ;;
161 -bluegene*)
162 os=-cnk
163 ;;
164 -sim | -cisco | -oki | -wec | -winbond)
165 os=
166 basic_machine=$1
167 ;;
@@ -173,14 +168,14 @@
173 ;;
174 -chorusos*)
175 os=-chorusos
176 basic_machine=$1
177 ;;
178 -chorusrdb)
179 os=-chorusrdb
180 basic_machine=$1
181 ;;
182 -hiux*)
183 os=-hiuxwe2
184 ;;
185 -sco6)
186 os=-sco5v6
@@ -221,10 +216,16 @@
221 basic_machine=clipper-intergraph
222 ;;
223 -isc*)
224 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
225 ;;
 
 
 
 
 
 
226 -lynx*)
227 os=-lynxos
228 ;;
229 -ptx*)
230 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
@@ -245,24 +246,32 @@
245 case $basic_machine in
246 # Recognize the basic CPU types without company name.
247 # Some are omitted here because they have special meanings below.
248 1750a | 580 \
249 | a29k \
 
250 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
251 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
252 | am33_2.0 \
253 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
 
 
 
254 | bfin \
255 | c4x | clipper \
256 | d10v | d30v | dlx | dsp16xx \
 
257 | fido | fr30 | frv \
258 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 
259 | i370 | i860 | i960 | ia64 \
260 | ip2k | iq2000 \
 
 
261 | lm32 \
262 | m32c | m32r | m32rle | m68000 | m68k | m88k \
263 | maxq | mb | microblaze | mcore | mep | metag \
264 | mips | mipsbe | mipseb | mipsel | mipsle \
265 | mips16 \
266 | mips64 | mips64el \
267 | mips64octeon | mips64octeonel \
268 | mips64orion | mips64orionel \
@@ -272,38 +281,41 @@
272 | mips64vr4300 | mips64vr4300el \
273 | mips64vr5000 | mips64vr5000el \
274 | mips64vr5900 | mips64vr5900el \
275 | mipsisa32 | mipsisa32el \
276 | mipsisa32r2 | mipsisa32r2el \
 
277 | mipsisa64 | mipsisa64el \
278 | mipsisa64r2 | mipsisa64r2el \
 
279 | mipsisa64sb1 | mipsisa64sb1el \
280 | mipsisa64sr71k | mipsisa64sr71kel \
 
281 | mipstx39 | mipstx39el \
282 | mn10200 | mn10300 \
283 | moxie \
284 | mt \
285 | msp430 \
286 | nds32 | nds32le | nds32be \
287 | nios | nios2 \
288 | ns16k | ns32k \
289 | or32 \
290 | pdp10 | pdp11 | pj | pjl \
291 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
292 | pyramid \
293 | rx \
294 | score \
295 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
296 | sh64 | sh64le \
297 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
298 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
299 | spu | strongarm \
300 | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
301 | ubicom32 \
302 | v850 | v850e \
303 | we32k \
304 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
305 | z8k | z80)
306 basic_machine=$basic_machine-unknown
307 ;;
308 c54x)
309 basic_machine=tic54x-unknown
@@ -312,20 +324,34 @@
312 basic_machine=tic55x-unknown
313 ;;
314 c6x)
315 basic_machine=tic6x-unknown
316 ;;
317 m6811 | m68hc11 | m6812 | m68hc12 | picochip)
318 # Motorola 68HC11/12.
319 basic_machine=$basic_machine-unknown
320 os=-none
321 ;;
322 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
323 ;;
324 ms1)
325 basic_machine=mt-unknown
326 ;;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
328 # We use `pc' rather than `unknown'
329 # because (1) that's what they normally are, and
330 # (2) the word "unknown" tends to confuse beginning users.
331 i*86 | x86_64)
@@ -337,29 +363,35 @@
337 exit 1
338 ;;
339 # Recognize the basic CPU types with company name.
340 580-* \
341 | a29k-* \
 
342 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
343 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
344 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
345 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
346 | avr-* | avr32-* \
 
347 | bfin-* | bs2000-* \
348 | c[123]* | c30-* | [cjt]90-* | c4x-* \
349 | clipper-* | craynv-* | cydra-* \
350 | d10v-* | d30v-* | dlx-* \
351 | elxsi-* \
352 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
353 | h8300-* | h8500-* \
354 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 
355 | i*86-* | i860-* | i960-* | ia64-* \
356 | ip2k-* | iq2000-* \
 
 
357 | lm32-* \
358 | m32c-* | m32r-* | m32rle-* \
359 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
360 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
 
361 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
362 | mips16-* \
363 | mips64-* | mips64el-* \
364 | mips64octeon-* | mips64octeonel-* \
365 | mips64orion-* | mips64orionel-* \
@@ -369,39 +401,45 @@
369 | mips64vr4300-* | mips64vr4300el-* \
370 | mips64vr5000-* | mips64vr5000el-* \
371 | mips64vr5900-* | mips64vr5900el-* \
372 | mipsisa32-* | mipsisa32el-* \
373 | mipsisa32r2-* | mipsisa32r2el-* \
 
374 | mipsisa64-* | mipsisa64el-* \
375 | mipsisa64r2-* | mipsisa64r2el-* \
 
376 | mipsisa64sb1-* | mipsisa64sb1el-* \
377 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
 
378 | mipstx39-* | mipstx39el-* \
379 | mmix-* \
380 | mt-* \
381 | msp430-* \
382 | nds32-* | nds32le-* | nds32be-* \
383 | nios-* | nios2-* \
384 | none-* | np1-* | ns16k-* | ns32k-* \
 
 
385 | orion-* \
386 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
387 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
388 | pyramid-* \
389 | romp-* | rs6000-* | rx-* \
390 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
391 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
392 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
393 | sparclite-* \
394 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
395 | tahoe-* | thumb-* \
396 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
397 | tile-* | tilegx-* \
398 | tron-* \
399 | ubicom32-* \
400 | v850-* | v850e-* | vax-* \
 
401 | we32k-* \
402 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
403 | xstormy16-* | xtensa*-* \
404 | ymp-* \
405 | z8k-* | z80-*)
406 ;;
407 # Recognize the basic CPU types without company name, with glob match.
@@ -422,11 +460,11 @@
422 ;;
423 a29khif)
424 basic_machine=a29k-amd
425 os=-udi
426 ;;
427 abacus)
428 basic_machine=abacus-unknown
429 ;;
430 adobe68k)
431 basic_machine=m68010-adobe
432 os=-scout
@@ -505,11 +543,11 @@
505 ;;
506 c90)
507 basic_machine=c90-cray
508 os=-unicos
509 ;;
510 cegcc)
511 basic_machine=arm-unknown
512 os=-cegcc
513 ;;
514 convex-c1)
515 basic_machine=c1-convex
@@ -537,11 +575,11 @@
537 ;;
538 craynv)
539 basic_machine=craynv-cray
540 os=-unicosmp
541 ;;
542 cr16)
543 basic_machine=cr16-unknown
544 os=-elf
545 ;;
546 crds | unos)
547 basic_machine=m68k-crds
@@ -695,11 +733,10 @@
695 os=-proelf
696 ;;
697 i370-ibm* | ibm*)
698 basic_machine=i370-ibm
699 ;;
700 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
701 i*86v32)
702 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
703 os=-sysv32
704 ;;
705 i*86v4*)
@@ -753,15 +790,19 @@
753 ;;
754 merlin)
755 basic_machine=ns32k-utek
756 os=-sysv
757 ;;
758 microblaze)
759 basic_machine=microblaze-xilinx
760 ;;
 
 
 
 
761 mingw32)
762 basic_machine=i386-pc
763 os=-mingw32
764 ;;
765 mingw32ce)
766 basic_machine=arm-unknown
767 os=-mingw32ce
@@ -792,18 +833,22 @@
792 os=-msdos
793 ;;
794 ms1-*)
795 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
796 ;;
 
 
 
 
797 mvs)
798 basic_machine=i370-ibm
799 os=-mvs
800 ;;
801 msys)
802 basic_machine=i386-pc
803 os=-msys
804 ;;
805 ncr3000)
806 basic_machine=i486-ncr
807 os=-sysv4
808 ;;
809 netbsd386)
@@ -864,14 +909,14 @@
864 os=-nonstopux
865 ;;
866 np1)
867 basic_machine=np1-gould
868 ;;
869 neo-tandem)
870 basic_machine=neo-tandem
871 ;;
872 nse-tandem)
873 basic_machine=nse-tandem
874 ;;
875 nsr-tandem)
876 basic_machine=nsr-tandem
877 ;;
@@ -952,13 +997,14 @@
952 pn)
953 basic_machine=pn-gould
954 ;;
955 power) basic_machine=power-ibm
956 ;;
957 ppc) basic_machine=powerpc-unknown
958 ;;
959 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 
960 ;;
961 ppcle | powerpclittle | ppc-le | powerpc-little)
962 basic_machine=powerpcle-unknown
963 ;;
964 ppcle-* | powerpclittle-*)
@@ -979,11 +1025,15 @@
979 ;;
980 pw32)
981 basic_machine=i586-unknown
982 os=-pw32
983 ;;
984 rdos)
 
 
 
 
985 basic_machine=i386-pc
986 os=-rdos
987 ;;
988 rom68k)
989 basic_machine=m68k-rom68k
@@ -1048,10 +1098,13 @@
1048 ;;
1049 stratus)
1050 basic_machine=i860-stratus
1051 os=-sysv4
1052 ;;
 
 
 
1053 sun2)
1054 basic_machine=m68000-sun
1055 ;;
1056 sun2os3)
1057 basic_machine=m68000-sun
@@ -1104,17 +1157,12 @@
1104 ;;
1105 t90)
1106 basic_machine=t90-cray
1107 os=-unicos
1108 ;;
1109 # This must be matched before tile*.
1110 tilegx*)
1111 basic_machine=tilegx-unknown
1112 os=-linux-gnu
1113 ;;
1114 tile*)
1115 basic_machine=tile-unknown
1116 os=-linux-gnu
1117 ;;
1118 tx39)
1119 basic_machine=mipstx39-unknown
1120 ;;
@@ -1180,10 +1228,13 @@
1180 os=-mingw32
1181 ;;
1182 xps | xps100)
1183 basic_machine=xps100-honeywell
1184 ;;
 
 
 
1185 ymp)
1186 basic_machine=ymp-cray
1187 os=-unicos
1188 ;;
1189 z8k-*-coff)
@@ -1277,15 +1328,15 @@
1277 # Decode manufacturer-specific aliases for certain operating systems.
1278
1279 if [ x"$os" != x"" ]
1280 then
1281 case $os in
1282 # First match some system type aliases
1283 # that might get confused with valid system types.
1284 # -solaris* is a basic system type, with this one exception.
1285 -auroraux)
1286 os=-auroraux
1287 ;;
1288 -solaris1 | -solaris1.*)
1289 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1290 ;;
1291 -solaris)
@@ -1305,33 +1356,33 @@
1305 # Each alternative MUST END IN A *, to match a version number.
1306 # -sysv* is not here because it comes later, after sysvr4.
1307 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1308 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1309 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1310 | -sym* | -kopensolaris* \
1311 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1312 | -aos* | -aros* \
1313 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1314 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1315 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1316 | -openbsd* | -solidbsd* \
1317 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1318 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1319 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1320 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1321 | -chorusos* | -chorusrdb* | -cegcc* \
1322 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1323 | -mingw32* | -linux-gnu* | -linux-android* \
1324 | -linux-newlib* | -linux-uclibc* \
1325 | -uxpv* | -beos* | -mpeix* | -udk* \
1326 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1327 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1328 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1329 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1330 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1331 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1332 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1333 # Remember, each alternative MUST END IN *, to match a version number.
1334 ;;
1335 -qnx*)
1336 case $basic_machine in
1337 x86-* | i*86-*)
@@ -1366,11 +1417,11 @@
1366 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1367 ;;
1368 -opened*)
1369 os=-openedition
1370 ;;
1371 -os400*)
1372 os=-os400
1373 ;;
1374 -wince*)
1375 os=-wince
1376 ;;
@@ -1415,11 +1466,11 @@
1415 os=`echo $os | sed -e 's|sinix|sysv|'`
1416 ;;
1417 -sinix*)
1418 os=-sysv4
1419 ;;
1420 -tpf*)
1421 os=-tpf
1422 ;;
1423 -triton*)
1424 os=-sysv3
1425 ;;
@@ -1451,21 +1502,18 @@
1451 os=-mint
1452 ;;
1453 -aros*)
1454 os=-aros
1455 ;;
1456 -kaos*)
1457 os=-kaos
1458 ;;
1459 -zvmoe)
1460 os=-zvmoe
1461 ;;
1462 -dicos*)
1463 os=-dicos
1464 ;;
1465 -nacl*)
1466 ;;
1467 -none)
1468 ;;
1469 *)
1470 # Get rid of the `-' at the beginning of $os.
1471 os=`echo $os | sed 's/[^-]*-//'`
@@ -1484,14 +1532,14 @@
1484 # that MANUFACTURER isn't an operating system. Otherwise, code above
1485 # will signal an error saying that MANUFACTURER isn't an operating
1486 # system, and we'll never get to this point.
1487
1488 case $basic_machine in
1489 score-*)
1490 os=-elf
1491 ;;
1492 spu-*)
1493 os=-elf
1494 ;;
1495 *-acorn)
1496 os=-riscix1.2
1497 ;;
@@ -1499,12 +1547,18 @@
1499 os=-linux
1500 ;;
1501 arm*-semi)
1502 os=-aout
1503 ;;
1504 c4x-* | tic4x-*)
1505 os=-coff
 
 
 
 
 
 
1506 ;;
1507 tic54x-*)
1508 os=-coff
1509 ;;
1510 tic55x-*)
@@ -1529,18 +1583,15 @@
1529 i386-sun)
1530 os=-sunos4.0.2
1531 ;;
1532 m68000-sun)
1533 os=-sunos3
1534 # This also exists in the configure program, but was not the
1535 # default.
1536 # os=-sunos4
1537 ;;
1538 m68*-cisco)
1539 os=-aout
1540 ;;
1541 mep-*)
1542 os=-elf
1543 ;;
1544 mips*-cisco)
1545 os=-elf
1546 ;;
@@ -1563,11 +1614,11 @@
1563 os=-haiku
1564 ;;
1565 *-ibm)
1566 os=-aix
1567 ;;
1568 *-knuth)
1569 os=-mmixware
1570 ;;
1571 *-wec)
1572 os=-proelf
1573 ;;
1574
--- autosetup/config.sub
+++ autosetup/config.sub
@@ -1,40 +1,33 @@
1 #! /bin/sh
2 # Configuration validation subroutine script.
3 # Copyright 1992-2014 Free Software Foundation, Inc.
4
5 timestamp='2014-05-01'
6
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
 
 
 
 
 
 
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 
19 #
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that
24 # program. This Exception is an additional permission under section 7
25 # of the GNU General Public License, version 3 ("GPLv3").
26
27
28 # Please send patches with a ChangeLog entry to [email protected].
 
29 #
30 # Configuration subroutine to validate and canonicalize a configuration type.
31 # Supply the specified configuration type as an argument.
32 # If it is invalid, we print an error message on stderr and exit with code 1.
33 # Otherwise, we print the canonical config type on stdout and succeed.
@@ -73,13 +66,11 @@
66 Report bugs and patches to <[email protected]>."
67
68 version="\
69 GNU config.sub ($timestamp)
70
71 Copyright 1992-2014 Free Software Foundation, Inc.
 
 
72
73 This is free software; see the source for copying conditions. There is NO
74 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
75
76 help="
@@ -123,17 +114,21 @@
114 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
115 # Here we must recognize all the valid KERNEL-OS combinations.
116 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
117 case $maybe_os in
118 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
119 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
120 knetbsd*-gnu* | netbsd*-gnu* | \
121 kopensolaris*-gnu* | \
122 storm-chaos* | os2-emx* | rtmk-nova*)
123 os=-$maybe_os
124 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
125 ;;
126 android-linux)
127 os=-linux-android
128 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
129 ;;
130 *)
131 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
132 if [ $basic_machine != $1 ]
133 then os=`echo $1 | sed 's/.*-/-/'`
134 else os=; fi
@@ -152,16 +147,16 @@
147 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
148 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
149 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
150 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
151 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
152 -apple | -axis | -knuth | -cray | -microblaze*)
153 os=
154 basic_machine=$1
155 ;;
156 -bluegene*)
157 os=-cnk
158 ;;
159 -sim | -cisco | -oki | -wec | -winbond)
160 os=
161 basic_machine=$1
162 ;;
@@ -173,14 +168,14 @@
168 ;;
169 -chorusos*)
170 os=-chorusos
171 basic_machine=$1
172 ;;
173 -chorusrdb)
174 os=-chorusrdb
175 basic_machine=$1
176 ;;
177 -hiux*)
178 os=-hiuxwe2
179 ;;
180 -sco6)
181 os=-sco5v6
@@ -221,10 +216,16 @@
216 basic_machine=clipper-intergraph
217 ;;
218 -isc*)
219 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
220 ;;
221 -lynx*178)
222 os=-lynxos178
223 ;;
224 -lynx*5)
225 os=-lynxos5
226 ;;
227 -lynx*)
228 os=-lynxos
229 ;;
230 -ptx*)
231 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
@@ -245,24 +246,32 @@
246 case $basic_machine in
247 # Recognize the basic CPU types without company name.
248 # Some are omitted here because they have special meanings below.
249 1750a | 580 \
250 | a29k \
251 | aarch64 | aarch64_be \
252 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
253 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
254 | am33_2.0 \
255 | arc | arceb \
256 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
257 | avr | avr32 \
258 | be32 | be64 \
259 | bfin \
260 | c4x | c8051 | clipper \
261 | d10v | d30v | dlx | dsp16xx \
262 | epiphany \
263 | fido | fr30 | frv \
264 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
265 | hexagon \
266 | i370 | i860 | i960 | ia64 \
267 | ip2k | iq2000 \
268 | k1om \
269 | le32 | le64 \
270 | lm32 \
271 | m32c | m32r | m32rle | m68000 | m68k | m88k \
272 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
273 | mips | mipsbe | mipseb | mipsel | mipsle \
274 | mips16 \
275 | mips64 | mips64el \
276 | mips64octeon | mips64octeonel \
277 | mips64orion | mips64orionel \
@@ -272,38 +281,41 @@
281 | mips64vr4300 | mips64vr4300el \
282 | mips64vr5000 | mips64vr5000el \
283 | mips64vr5900 | mips64vr5900el \
284 | mipsisa32 | mipsisa32el \
285 | mipsisa32r2 | mipsisa32r2el \
286 | mipsisa32r6 | mipsisa32r6el \
287 | mipsisa64 | mipsisa64el \
288 | mipsisa64r2 | mipsisa64r2el \
289 | mipsisa64r6 | mipsisa64r6el \
290 | mipsisa64sb1 | mipsisa64sb1el \
291 | mipsisa64sr71k | mipsisa64sr71kel \
292 | mipsr5900 | mipsr5900el \
293 | mipstx39 | mipstx39el \
294 | mn10200 | mn10300 \
295 | moxie \
296 | mt \
297 | msp430 \
298 | nds32 | nds32le | nds32be \
299 | nios | nios2 | nios2eb | nios2el \
300 | ns16k | ns32k \
301 | open8 | or1k | or1knd | or32 \
302 | pdp10 | pdp11 | pj | pjl \
303 | powerpc | powerpc64 | powerpc64le | powerpcle \
304 | pyramid \
305 | rl78 | rx \
306 | score \
307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
308 | sh64 | sh64le \
309 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
310 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
311 | spu \
312 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
313 | ubicom32 \
314 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
315 | we32k \
316 | x86 | xc16x | xstormy16 | xtensa \
317 | z8k | z80)
318 basic_machine=$basic_machine-unknown
319 ;;
320 c54x)
321 basic_machine=tic54x-unknown
@@ -312,20 +324,34 @@
324 basic_machine=tic55x-unknown
325 ;;
326 c6x)
327 basic_machine=tic6x-unknown
328 ;;
329 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 
330 basic_machine=$basic_machine-unknown
331 os=-none
332 ;;
333 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
334 ;;
335 ms1)
336 basic_machine=mt-unknown
337 ;;
338
339 strongarm | thumb | xscale)
340 basic_machine=arm-unknown
341 ;;
342 xgate)
343 basic_machine=$basic_machine-unknown
344 os=-none
345 ;;
346 xscaleeb)
347 basic_machine=armeb-unknown
348 ;;
349
350 xscaleel)
351 basic_machine=armel-unknown
352 ;;
353
354 # We use `pc' rather than `unknown'
355 # because (1) that's what they normally are, and
356 # (2) the word "unknown" tends to confuse beginning users.
357 i*86 | x86_64)
@@ -337,29 +363,35 @@
363 exit 1
364 ;;
365 # Recognize the basic CPU types with company name.
366 580-* \
367 | a29k-* \
368 | aarch64-* | aarch64_be-* \
369 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
370 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
371 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
372 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
373 | avr-* | avr32-* \
374 | be32-* | be64-* \
375 | bfin-* | bs2000-* \
376 | c[123]* | c30-* | [cjt]90-* | c4x-* \
377 | c8051-* | clipper-* | craynv-* | cydra-* \
378 | d10v-* | d30v-* | dlx-* \
379 | elxsi-* \
380 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
381 | h8300-* | h8500-* \
382 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
383 | hexagon-* \
384 | i*86-* | i860-* | i960-* | ia64-* \
385 | ip2k-* | iq2000-* \
386 | k1om-* \
387 | le32-* | le64-* \
388 | lm32-* \
389 | m32c-* | m32r-* | m32rle-* \
390 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
391 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
392 | microblaze-* | microblazeel-* \
393 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
394 | mips16-* \
395 | mips64-* | mips64el-* \
396 | mips64octeon-* | mips64octeonel-* \
397 | mips64orion-* | mips64orionel-* \
@@ -369,39 +401,45 @@
401 | mips64vr4300-* | mips64vr4300el-* \
402 | mips64vr5000-* | mips64vr5000el-* \
403 | mips64vr5900-* | mips64vr5900el-* \
404 | mipsisa32-* | mipsisa32el-* \
405 | mipsisa32r2-* | mipsisa32r2el-* \
406 | mipsisa32r6-* | mipsisa32r6el-* \
407 | mipsisa64-* | mipsisa64el-* \
408 | mipsisa64r2-* | mipsisa64r2el-* \
409 | mipsisa64r6-* | mipsisa64r6el-* \
410 | mipsisa64sb1-* | mipsisa64sb1el-* \
411 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
412 | mipsr5900-* | mipsr5900el-* \
413 | mipstx39-* | mipstx39el-* \
414 | mmix-* \
415 | mt-* \
416 | msp430-* \
417 | nds32-* | nds32le-* | nds32be-* \
418 | nios-* | nios2-* | nios2eb-* | nios2el-* \
419 | none-* | np1-* | ns16k-* | ns32k-* \
420 | open8-* \
421 | or1k*-* \
422 | orion-* \
423 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
424 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
425 | pyramid-* \
426 | rl78-* | romp-* | rs6000-* | rx-* \
427 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
428 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
429 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
430 | sparclite-* \
431 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
432 | tahoe-* \
433 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
434 | tile*-* \
435 | tron-* \
436 | ubicom32-* \
437 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
438 | vax-* \
439 | we32k-* \
440 | x86-* | x86_64-* | xc16x-* | xps100-* \
441 | xstormy16-* | xtensa*-* \
442 | ymp-* \
443 | z8k-* | z80-*)
444 ;;
445 # Recognize the basic CPU types without company name, with glob match.
@@ -422,11 +460,11 @@
460 ;;
461 a29khif)
462 basic_machine=a29k-amd
463 os=-udi
464 ;;
465 abacus)
466 basic_machine=abacus-unknown
467 ;;
468 adobe68k)
469 basic_machine=m68010-adobe
470 os=-scout
@@ -505,11 +543,11 @@
543 ;;
544 c90)
545 basic_machine=c90-cray
546 os=-unicos
547 ;;
548 cegcc)
549 basic_machine=arm-unknown
550 os=-cegcc
551 ;;
552 convex-c1)
553 basic_machine=c1-convex
@@ -537,11 +575,11 @@
575 ;;
576 craynv)
577 basic_machine=craynv-cray
578 os=-unicosmp
579 ;;
580 cr16 | cr16-*)
581 basic_machine=cr16-unknown
582 os=-elf
583 ;;
584 crds | unos)
585 basic_machine=m68k-crds
@@ -695,11 +733,10 @@
733 os=-proelf
734 ;;
735 i370-ibm* | ibm*)
736 basic_machine=i370-ibm
737 ;;
 
738 i*86v32)
739 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
740 os=-sysv32
741 ;;
742 i*86v4*)
@@ -753,15 +790,19 @@
790 ;;
791 merlin)
792 basic_machine=ns32k-utek
793 os=-sysv
794 ;;
795 microblaze*)
796 basic_machine=microblaze-xilinx
797 ;;
798 mingw64)
799 basic_machine=x86_64-pc
800 os=-mingw64
801 ;;
802 mingw32)
803 basic_machine=i686-pc
804 os=-mingw32
805 ;;
806 mingw32ce)
807 basic_machine=arm-unknown
808 os=-mingw32ce
@@ -792,18 +833,22 @@
833 os=-msdos
834 ;;
835 ms1-*)
836 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
837 ;;
838 msys)
839 basic_machine=i686-pc
840 os=-msys
841 ;;
842 mvs)
843 basic_machine=i370-ibm
844 os=-mvs
845 ;;
846 nacl)
847 basic_machine=le32-unknown
848 os=-nacl
849 ;;
850 ncr3000)
851 basic_machine=i486-ncr
852 os=-sysv4
853 ;;
854 netbsd386)
@@ -864,14 +909,14 @@
909 os=-nonstopux
910 ;;
911 np1)
912 basic_machine=np1-gould
913 ;;
914 neo-tandem)
915 basic_machine=neo-tandem
916 ;;
917 nse-tandem)
918 basic_machine=nse-tandem
919 ;;
920 nsr-tandem)
921 basic_machine=nsr-tandem
922 ;;
@@ -952,13 +997,14 @@
997 pn)
998 basic_machine=pn-gould
999 ;;
1000 power) basic_machine=power-ibm
1001 ;;
1002 ppc | ppcbe) basic_machine=powerpc-unknown
1003 ;;
1004 ppc-* | ppcbe-*)
1005 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1006 ;;
1007 ppcle | powerpclittle | ppc-le | powerpc-little)
1008 basic_machine=powerpcle-unknown
1009 ;;
1010 ppcle-* | powerpclittle-*)
@@ -979,11 +1025,15 @@
1025 ;;
1026 pw32)
1027 basic_machine=i586-unknown
1028 os=-pw32
1029 ;;
1030 rdos | rdos64)
1031 basic_machine=x86_64-pc
1032 os=-rdos
1033 ;;
1034 rdos32)
1035 basic_machine=i386-pc
1036 os=-rdos
1037 ;;
1038 rom68k)
1039 basic_machine=m68k-rom68k
@@ -1048,10 +1098,13 @@
1098 ;;
1099 stratus)
1100 basic_machine=i860-stratus
1101 os=-sysv4
1102 ;;
1103 strongarm-* | thumb-*)
1104 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1105 ;;
1106 sun2)
1107 basic_machine=m68000-sun
1108 ;;
1109 sun2os3)
1110 basic_machine=m68000-sun
@@ -1104,17 +1157,12 @@
1157 ;;
1158 t90)
1159 basic_machine=t90-cray
1160 os=-unicos
1161 ;;
 
 
 
 
 
1162 tile*)
1163 basic_machine=$basic_machine-unknown
1164 os=-linux-gnu
1165 ;;
1166 tx39)
1167 basic_machine=mipstx39-unknown
1168 ;;
@@ -1180,10 +1228,13 @@
1228 os=-mingw32
1229 ;;
1230 xps | xps100)
1231 basic_machine=xps100-honeywell
1232 ;;
1233 xscale-* | xscalee[bl]-*)
1234 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1235 ;;
1236 ymp)
1237 basic_machine=ymp-cray
1238 os=-unicos
1239 ;;
1240 z8k-*-coff)
@@ -1277,15 +1328,15 @@
1328 # Decode manufacturer-specific aliases for certain operating systems.
1329
1330 if [ x"$os" != x"" ]
1331 then
1332 case $os in
1333 # First match some system type aliases
1334 # that might get confused with valid system types.
1335 # -solaris* is a basic system type, with this one exception.
1336 -auroraux)
1337 os=-auroraux
1338 ;;
1339 -solaris1 | -solaris1.*)
1340 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1341 ;;
1342 -solaris)
@@ -1305,33 +1356,33 @@
1356 # Each alternative MUST END IN A *, to match a version number.
1357 # -sysv* is not here because it comes later, after sysvr4.
1358 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1359 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1360 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1361 | -sym* | -kopensolaris* | -plan9* \
1362 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1363 | -aos* | -aros* \
1364 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1365 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1366 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1367 | -bitrig* | -openbsd* | -solidbsd* \
1368 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1369 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1370 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1371 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1372 | -chorusos* | -chorusrdb* | -cegcc* \
1373 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1374 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1375 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1376 | -uxpv* | -beos* | -mpeix* | -udk* \
1377 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1378 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1379 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1380 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1381 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1382 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1383 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
1384 # Remember, each alternative MUST END IN *, to match a version number.
1385 ;;
1386 -qnx*)
1387 case $basic_machine in
1388 x86-* | i*86-*)
@@ -1366,11 +1417,11 @@
1417 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1418 ;;
1419 -opened*)
1420 os=-openedition
1421 ;;
1422 -os400*)
1423 os=-os400
1424 ;;
1425 -wince*)
1426 os=-wince
1427 ;;
@@ -1415,11 +1466,11 @@
1466 os=`echo $os | sed -e 's|sinix|sysv|'`
1467 ;;
1468 -sinix*)
1469 os=-sysv4
1470 ;;
1471 -tpf*)
1472 os=-tpf
1473 ;;
1474 -triton*)
1475 os=-sysv3
1476 ;;
@@ -1451,21 +1502,18 @@
1502 os=-mint
1503 ;;
1504 -aros*)
1505 os=-aros
1506 ;;
 
 
 
1507 -zvmoe)
1508 os=-zvmoe
1509 ;;
1510 -dicos*)
1511 os=-dicos
1512 ;;
1513 -nacl*)
1514 ;;
1515 -none)
1516 ;;
1517 *)
1518 # Get rid of the `-' at the beginning of $os.
1519 os=`echo $os | sed 's/[^-]*-//'`
@@ -1484,14 +1532,14 @@
1532 # that MANUFACTURER isn't an operating system. Otherwise, code above
1533 # will signal an error saying that MANUFACTURER isn't an operating
1534 # system, and we'll never get to this point.
1535
1536 case $basic_machine in
1537 score-*)
1538 os=-elf
1539 ;;
1540 spu-*)
1541 os=-elf
1542 ;;
1543 *-acorn)
1544 os=-riscix1.2
1545 ;;
@@ -1499,12 +1547,18 @@
1547 os=-linux
1548 ;;
1549 arm*-semi)
1550 os=-aout
1551 ;;
1552 c4x-* | tic4x-*)
1553 os=-coff
1554 ;;
1555 c8051-*)
1556 os=-elf
1557 ;;
1558 hexagon-*)
1559 os=-elf
1560 ;;
1561 tic54x-*)
1562 os=-coff
1563 ;;
1564 tic55x-*)
@@ -1529,18 +1583,15 @@
1583 i386-sun)
1584 os=-sunos4.0.2
1585 ;;
1586 m68000-sun)
1587 os=-sunos3
 
 
 
1588 ;;
1589 m68*-cisco)
1590 os=-aout
1591 ;;
1592 mep-*)
1593 os=-elf
1594 ;;
1595 mips*-cisco)
1596 os=-elf
1597 ;;
@@ -1563,11 +1614,11 @@
1614 os=-haiku
1615 ;;
1616 *-ibm)
1617 os=-aix
1618 ;;
1619 *-knuth)
1620 os=-mmixware
1621 ;;
1622 *-wec)
1623 os=-proelf
1624 ;;
1625
+53 -53
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -42,10 +42,11 @@
4242
#define HAVE_ISATTY
4343
#define HAVE_SYS_TIME_H
4444
#define HAVE_DIRENT_H
4545
#define HAVE_UNISTD_H
4646
#endif
47
+#define JIM_VERSION 75
4748
#ifndef JIM_WIN32COMPAT_H
4849
#define JIM_WIN32COMPAT_H
4950
5051
5152
@@ -185,12 +186,10 @@
185186
#endif
186187
187188
#define UCHAR(c) ((unsigned char)(c))
188189
189190
190
-#define JIM_VERSION 74
191
-
192191
#define JIM_OK 0
193192
#define JIM_ERR 1
194193
#define JIM_RETURN 2
195194
#define JIM_BREAK 3
196195
#define JIM_CONTINUE 4
@@ -832,16 +831,10 @@
832831
double *doublePtr);
833832
JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr,
834833
double doubleValue);
835834
JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue);
836835
837
-
838
-JIM_EXPORT const char * Jim_GetSharedString (Jim_Interp *interp,
839
- const char *str);
840
-JIM_EXPORT void Jim_ReleaseSharedString (Jim_Interp *interp,
841
- const char *str);
842
-
843836
844837
JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc,
845838
Jim_Obj *const *argv, const char *msg);
846839
JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr,
847840
const char * const *tablePtr, int *indexPtr, const char *name, int flags);
@@ -875,11 +868,11 @@
875868
JIM_EXPORT void Jim_HistoryShow(void);
876869
877870
878871
JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp);
879872
JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base);
880
-JIM_EXPORT int Jim_CheckSignal(Jim_Interp *interp);
873
+JIM_EXPORT int Jim_IsBigEndian(void);
881874
#define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask)
882875
883876
884877
JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName);
885878
JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp);
@@ -1775,19 +1768,11 @@
17751768
17761769
Jim_DecrRefCount(interp, af->filename);
17771770
17781771
#ifdef jim_ext_eventloop
17791772
1780
- if (af->rEvent) {
1781
- Jim_DeleteFileHandler(interp, af->fp);
1782
- }
1783
- if (af->wEvent) {
1784
- Jim_DeleteFileHandler(interp, af->fp);
1785
- }
1786
- if (af->eEvent) {
1787
- Jim_DeleteFileHandler(interp, af->fp);
1788
- }
1773
+ Jim_DeleteFileHandler(interp, af->fp, JIM_EVENT_READABLE | JIM_EVENT_WRITABLE | JIM_EVENT_EXCEPTION);
17891774
#endif
17901775
Jim_Free(af);
17911776
}
17921777
17931778
static int JimCheckStreamError(Jim_Interp *interp, AioFile *af)
@@ -2147,27 +2132,26 @@
21472132
}
21482133
21492134
#ifdef jim_ext_eventloop
21502135
static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData)
21512136
{
2152
- Jim_Obj *objPtr = clientData;
2137
+ Jim_Obj **objPtrPtr = clientData;
21532138
2154
- Jim_DecrRefCount(interp, objPtr);
2139
+ Jim_DecrRefCount(interp, *objPtrPtr);
2140
+ *objPtrPtr = NULL;
21552141
}
21562142
21572143
static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask)
21582144
{
2159
- Jim_Obj *objPtr = clientData;
2145
+ Jim_Obj **objPtrPtr = clientData;
21602146
2161
- return Jim_EvalObjBackground(interp, objPtr);
2147
+ return Jim_EvalObjBackground(interp, *objPtrPtr);
21622148
}
21632149
21642150
static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj,
21652151
int argc, Jim_Obj * const *argv)
21662152
{
2167
- int scriptlen = 0;
2168
-
21692153
if (argc == 0) {
21702154
21712155
if (*scriptHandlerObj) {
21722156
Jim_SetResult(interp, *scriptHandlerObj);
21732157
}
@@ -2174,27 +2158,25 @@
21742158
return JIM_OK;
21752159
}
21762160
21772161
if (*scriptHandlerObj) {
21782162
2179
- Jim_DeleteFileHandler(interp, af->fp);
2180
- *scriptHandlerObj = NULL;
2163
+ Jim_DeleteFileHandler(interp, af->fp, mask);
21812164
}
21822165
21832166
2184
- Jim_GetString(argv[0], &scriptlen);
2185
- if (scriptlen == 0) {
2167
+ if (Jim_Length(argv[0]) == 0) {
21862168
21872169
return JIM_OK;
21882170
}
21892171
21902172
21912173
Jim_IncrRefCount(argv[0]);
21922174
*scriptHandlerObj = argv[0];
21932175
21942176
Jim_CreateFileHandler(interp, af->fp, mask,
2195
- JimAioFileEventHandler, *scriptHandlerObj, JimAioFileEventFinalizer);
2177
+ JimAioFileEventHandler, scriptHandlerObj, JimAioFileEventFinalizer);
21962178
21972179
return JIM_OK;
21982180
}
21992181
22002182
static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -4005,11 +3987,11 @@
40053987
static void JimRestoreEnv(char **env);
40063988
static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv,
40073989
pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr);
40083990
static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr);
40093991
static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId);
4010
-static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents);
3992
+static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents, int len);
40113993
static fdtype JimOpenForWrite(const char *filename, int append);
40123994
static int JimRewindFd(fdtype fd);
40133995
40143996
static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg)
40153997
{
@@ -4347,10 +4329,11 @@
43474329
int cmdCount; /* Count of number of distinct commands
43484330
* found in argc/argv. */
43494331
const char *input = NULL; /* Describes input for pipeline, depending
43504332
* on "inputFile". NULL means take input
43514333
* from stdin/pipe. */
4334
+ int input_len = 0;
43524335
43534336
#define FILE_NAME 0
43544337
#define FILE_APPEND 1
43554338
#define FILE_HANDLE 2
43564339
#define FILE_TEXT 3
@@ -4412,19 +4395,20 @@
44124395
if (arg[0] == '<') {
44134396
inputFile = FILE_NAME;
44144397
input = arg + 1;
44154398
if (*input == '<') {
44164399
inputFile = FILE_TEXT;
4400
+ input_len = Jim_Length(argv[i]) - 2;
44174401
input++;
44184402
}
44194403
else if (*input == '@') {
44204404
inputFile = FILE_HANDLE;
44214405
input++;
44224406
}
44234407
44244408
if (!*input && ++i < argc) {
4425
- input = Jim_String(argv[i]);
4409
+ input = Jim_GetString(argv[i], &input_len);
44264410
}
44274411
}
44284412
else if (arg[0] == '>') {
44294413
int dup_error = 0;
44304414
@@ -4498,11 +4482,11 @@
44984482
44994483
save_environ = JimSaveEnv(JimBuildEnv(interp));
45004484
45014485
if (input != NULL) {
45024486
if (inputFile == FILE_TEXT) {
4503
- inputId = JimCreateTemp(interp, input);
4487
+ inputId = JimCreateTemp(interp, input, input_len);
45044488
if (inputId == JIM_BAD_FD) {
45054489
goto error;
45064490
}
45074491
}
45084492
else if (inputFile == FILE_HANDLE) {
@@ -4587,11 +4571,11 @@
45874571
goto error;
45884572
}
45894573
}
45904574
}
45914575
else if (errFilePtr != NULL) {
4592
- errorId = JimCreateTemp(interp, NULL);
4576
+ errorId = JimCreateTemp(interp, NULL, 0);
45934577
if (errorId == JIM_BAD_FD) {
45944578
goto error;
45954579
}
45964580
*errFilePtr = JimDupFd(errorId);
45974581
}
@@ -4953,11 +4937,11 @@
49534937
*status = ret;
49544938
CloseHandle(pid);
49554939
return pid;
49564940
}
49574941
4958
-static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents)
4942
+static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
49594943
{
49604944
char name[MAX_PATH];
49614945
HANDLE handle;
49624946
49634947
if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) {
@@ -4977,11 +4961,11 @@
49774961
FILE *fh = JimFdOpenForWrite(JimDupFd(handle));
49784962
if (fh == NULL) {
49794963
goto error;
49804964
}
49814965
4982
- if (fwrite(contents, strlen(contents), 1, fh) != 1) {
4966
+ if (fwrite(contents, len, 1, fh) != 1) {
49834967
fclose(fh);
49844968
goto error;
49854969
}
49864970
fseek(fh, 0, SEEK_SET);
49874971
fclose(fh);
@@ -5196,11 +5180,11 @@
51965180
static int JimRewindFd(int fd)
51975181
{
51985182
return lseek(fd, 0L, SEEK_SET);
51995183
}
52005184
5201
-static int JimCreateTemp(Jim_Interp *interp, const char *contents)
5185
+static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
52025186
{
52035187
char inName[] = "/tmp/tcl.tmp.XXXXXX";
52045188
52055189
int fd = mkstemp(inName);
52065190
if (fd == JIM_BAD_FD) {
@@ -5207,12 +5191,11 @@
52075191
Jim_SetResultErrno(interp, "couldn't create temp file");
52085192
return -1;
52095193
}
52105194
unlink(inName);
52115195
if (contents) {
5212
- int length = strlen(contents);
5213
- if (write(fd, contents, length) != length) {
5196
+ if (write(fd, contents, len) != len) {
52145197
Jim_SetResultErrno(interp, "couldn't write temp file");
52155198
close(fd);
52165199
return -1;
52175200
}
52185201
lseek(fd, 0L, SEEK_SET);
@@ -5671,10 +5654,11 @@
56715654
#ifdef JIM_MAINTAINER
56725655
#define JIM_DEBUG_COMMAND
56735656
#define JIM_DEBUG_PANIC
56745657
#endif
56755658
5659
+
56765660
56775661
#define JIM_INTEGER_SPACE 24
56785662
56795663
const char *jim_tt_name(int type);
56805664
@@ -6029,11 +6013,12 @@
60296013
if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) {
60306014
60316015
return i;
60326016
}
60336017
6034
- return 10;
6018
+ *base = 10;
6019
+ return 0;
60356020
}
60366021
60376022
static long jim_strtol(const char *str, char **endptr)
60386023
{
60396024
int sign;
@@ -6109,10 +6094,12 @@
61096094
return len;
61106095
}
61116096
61126097
if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') {
61136098
buf[i] = toupper(UCHAR(buf[i]));
6099
+ if (buf[i] == 'n' || buf[i] == 'N')
6100
+ buf[i+2] = toupper(UCHAR(buf[i+2]));
61146101
buf[i + 3] = 0;
61156102
return i + 3;
61166103
}
61176104
}
61186105
@@ -7581,17 +7568,21 @@
75817568
objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr;
75827569
if (objPtr->nextObjPtr)
75837570
objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr;
75847571
if (interp->liveList == objPtr)
75857572
interp->liveList = objPtr->nextObjPtr;
7573
+#ifdef JIM_DISABLE_OBJECT_POOL
7574
+ Jim_Free(objPtr);
7575
+#else
75867576
75877577
objPtr->prevObjPtr = NULL;
75887578
objPtr->nextObjPtr = interp->freeList;
75897579
if (interp->freeList)
75907580
interp->freeList->prevObjPtr = objPtr;
75917581
interp->freeList = objPtr;
75927582
objPtr->refCount = -1;
7583
+#endif
75937584
}
75947585
75957586
75967587
void Jim_InvalidateStringRep(Jim_Obj *objPtr)
75977588
{
@@ -8244,10 +8235,19 @@
82448235
}
82458236
82468237
return strObjPtr;
82478238
}
82488239
8240
+
8241
+#ifdef HAVE_ISASCII
8242
+#define jim_isascii isascii
8243
+#else
8244
+static int jim_isascii(int c)
8245
+{
8246
+ return !(c & ~0x7f);
8247
+}
8248
+#endif
82498249
82508250
static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict)
82518251
{
82528252
static const char * const strclassnames[] = {
82538253
"integer", "alpha", "alnum", "ascii", "digit",
@@ -8291,11 +8291,11 @@
82918291
return JIM_OK;
82928292
}
82938293
82948294
case STR_IS_ALPHA: isclassfunc = isalpha; break;
82958295
case STR_IS_ALNUM: isclassfunc = isalnum; break;
8296
- case STR_IS_ASCII: isclassfunc = isascii; break;
8296
+ case STR_IS_ASCII: isclassfunc = jim_isascii; break;
82978297
case STR_IS_DIGIT: isclassfunc = isdigit; break;
82988298
case STR_IS_LOWER: isclassfunc = islower; break;
82998299
case STR_IS_UPPER: isclassfunc = isupper; break;
83008300
case STR_IS_SPACE: isclassfunc = isspace; break;
83018301
case STR_IS_XDIGIT: isclassfunc = isxdigit; break;
@@ -10213,11 +10213,11 @@
1021310213
Jim_Collect(interp);
1021410214
}
1021510215
}
1021610216
#endif
1021710217
10218
-static int JimIsBigEndian(void)
10218
+int Jim_IsBigEndian(void)
1021910219
{
1022010220
union {
1022110221
unsigned short s;
1022210222
unsigned char c[2];
1022310223
} uval = {0x0102};
@@ -10269,11 +10269,11 @@
1026910269
Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0");
1027010270
1027110271
Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS);
1027210272
Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM);
1027310273
Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR);
10274
- Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", JimIsBigEndian() ? "bigEndian" : "littleEndian");
10274
+ Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", Jim_IsBigEndian() ? "bigEndian" : "littleEndian");
1027510275
Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0");
1027610276
Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *)));
1027710277
Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide)));
1027810278
1027910279
return i;
@@ -10449,17 +10449,11 @@
1044910449
interp->stackTrace = stackTraceObj;
1045010450
interp->errorFlag = 1;
1045110451
1045210452
len = Jim_ListLength(interp, interp->stackTrace);
1045310453
if (len >= 3) {
10454
- Jim_Obj *filenameObj;
10455
-
10456
- Jim_ListIndex(interp, interp->stackTrace, len - 2, &filenameObj, JIM_NONE);
10457
-
10458
- Jim_GetString(filenameObj, &len);
10459
-
10460
- if (!Jim_Length(filenameObj)) {
10454
+ if (Jim_Length(Jim_ListGetIndex(interp, interp->stackTrace, len - 2)) == 0) {
1046110455
interp->addStackTrace = 1;
1046210456
}
1046310457
}
1046410458
}
1046510459
@@ -10485,14 +10479,15 @@
1048510479
if (!*procname && Jim_Length(fileNameObj)) {
1048610480
1048710481
int len = Jim_ListLength(interp, interp->stackTrace);
1048810482
1048910483
if (len >= 3) {
10490
- Jim_Obj *objPtr;
10491
- if (Jim_ListIndex(interp, interp->stackTrace, len - 3, &objPtr, JIM_NONE) == JIM_OK && Jim_Length(objPtr)) {
10484
+ Jim_Obj *objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 3);
10485
+ if (Jim_Length(objPtr)) {
1049210486
10493
- if (Jim_ListIndex(interp, interp->stackTrace, len - 2, &objPtr, JIM_NONE) == JIM_OK && !Jim_Length(objPtr)) {
10487
+ objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 2);
10488
+ if (Jim_Length(objPtr) == 0) {
1049410489
1049510490
ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0);
1049610491
ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0);
1049710492
return;
1049810493
}
@@ -17159,10 +17154,15 @@
1715917154
1716017155
static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
1716117156
{
1716217157
int retcode;
1716317158
17159
+ if (argc < 2) {
17160
+ Jim_WrongNumArgs(interp, 1, argv, "cmd ?args ...?");
17161
+ return JIM_ERR;
17162
+ }
17163
+
1716417164
1716517165
interp->local++;
1716617166
retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1);
1716717167
interp->local--;
1716817168
@@ -19552,11 +19552,11 @@
1955219552
char *num_buffer = NULL;
1955319553
int num_buffer_size = 0;
1955419554
1955519555
span = format = Jim_GetString(fmtObjPtr, &formatLen);
1955619556
formatEnd = format + formatLen;
19557
- resultPtr = Jim_NewStringObj(interp, "", 0);
19557
+ resultPtr = Jim_NewEmptyStringObj(interp);
1955819558
1955919559
while (format != formatEnd) {
1956019560
char *end;
1956119561
int gotMinus, sawFlag;
1956219562
int gotPrecision, useShort;
1956319563
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -42,10 +42,11 @@
42 #define HAVE_ISATTY
43 #define HAVE_SYS_TIME_H
44 #define HAVE_DIRENT_H
45 #define HAVE_UNISTD_H
46 #endif
 
47 #ifndef JIM_WIN32COMPAT_H
48 #define JIM_WIN32COMPAT_H
49
50
51
@@ -185,12 +186,10 @@
185 #endif
186
187 #define UCHAR(c) ((unsigned char)(c))
188
189
190 #define JIM_VERSION 74
191
192 #define JIM_OK 0
193 #define JIM_ERR 1
194 #define JIM_RETURN 2
195 #define JIM_BREAK 3
196 #define JIM_CONTINUE 4
@@ -832,16 +831,10 @@
832 double *doublePtr);
833 JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr,
834 double doubleValue);
835 JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue);
836
837
838 JIM_EXPORT const char * Jim_GetSharedString (Jim_Interp *interp,
839 const char *str);
840 JIM_EXPORT void Jim_ReleaseSharedString (Jim_Interp *interp,
841 const char *str);
842
843
844 JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc,
845 Jim_Obj *const *argv, const char *msg);
846 JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr,
847 const char * const *tablePtr, int *indexPtr, const char *name, int flags);
@@ -875,11 +868,11 @@
875 JIM_EXPORT void Jim_HistoryShow(void);
876
877
878 JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp);
879 JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base);
880 JIM_EXPORT int Jim_CheckSignal(Jim_Interp *interp);
881 #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask)
882
883
884 JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName);
885 JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp);
@@ -1775,19 +1768,11 @@
1775
1776 Jim_DecrRefCount(interp, af->filename);
1777
1778 #ifdef jim_ext_eventloop
1779
1780 if (af->rEvent) {
1781 Jim_DeleteFileHandler(interp, af->fp);
1782 }
1783 if (af->wEvent) {
1784 Jim_DeleteFileHandler(interp, af->fp);
1785 }
1786 if (af->eEvent) {
1787 Jim_DeleteFileHandler(interp, af->fp);
1788 }
1789 #endif
1790 Jim_Free(af);
1791 }
1792
1793 static int JimCheckStreamError(Jim_Interp *interp, AioFile *af)
@@ -2147,27 +2132,26 @@
2147 }
2148
2149 #ifdef jim_ext_eventloop
2150 static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData)
2151 {
2152 Jim_Obj *objPtr = clientData;
2153
2154 Jim_DecrRefCount(interp, objPtr);
 
2155 }
2156
2157 static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask)
2158 {
2159 Jim_Obj *objPtr = clientData;
2160
2161 return Jim_EvalObjBackground(interp, objPtr);
2162 }
2163
2164 static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj,
2165 int argc, Jim_Obj * const *argv)
2166 {
2167 int scriptlen = 0;
2168
2169 if (argc == 0) {
2170
2171 if (*scriptHandlerObj) {
2172 Jim_SetResult(interp, *scriptHandlerObj);
2173 }
@@ -2174,27 +2158,25 @@
2174 return JIM_OK;
2175 }
2176
2177 if (*scriptHandlerObj) {
2178
2179 Jim_DeleteFileHandler(interp, af->fp);
2180 *scriptHandlerObj = NULL;
2181 }
2182
2183
2184 Jim_GetString(argv[0], &scriptlen);
2185 if (scriptlen == 0) {
2186
2187 return JIM_OK;
2188 }
2189
2190
2191 Jim_IncrRefCount(argv[0]);
2192 *scriptHandlerObj = argv[0];
2193
2194 Jim_CreateFileHandler(interp, af->fp, mask,
2195 JimAioFileEventHandler, *scriptHandlerObj, JimAioFileEventFinalizer);
2196
2197 return JIM_OK;
2198 }
2199
2200 static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -4005,11 +3987,11 @@
4005 static void JimRestoreEnv(char **env);
4006 static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv,
4007 pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr);
4008 static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr);
4009 static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId);
4010 static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents);
4011 static fdtype JimOpenForWrite(const char *filename, int append);
4012 static int JimRewindFd(fdtype fd);
4013
4014 static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg)
4015 {
@@ -4347,10 +4329,11 @@
4347 int cmdCount; /* Count of number of distinct commands
4348 * found in argc/argv. */
4349 const char *input = NULL; /* Describes input for pipeline, depending
4350 * on "inputFile". NULL means take input
4351 * from stdin/pipe. */
 
4352
4353 #define FILE_NAME 0
4354 #define FILE_APPEND 1
4355 #define FILE_HANDLE 2
4356 #define FILE_TEXT 3
@@ -4412,19 +4395,20 @@
4412 if (arg[0] == '<') {
4413 inputFile = FILE_NAME;
4414 input = arg + 1;
4415 if (*input == '<') {
4416 inputFile = FILE_TEXT;
 
4417 input++;
4418 }
4419 else if (*input == '@') {
4420 inputFile = FILE_HANDLE;
4421 input++;
4422 }
4423
4424 if (!*input && ++i < argc) {
4425 input = Jim_String(argv[i]);
4426 }
4427 }
4428 else if (arg[0] == '>') {
4429 int dup_error = 0;
4430
@@ -4498,11 +4482,11 @@
4498
4499 save_environ = JimSaveEnv(JimBuildEnv(interp));
4500
4501 if (input != NULL) {
4502 if (inputFile == FILE_TEXT) {
4503 inputId = JimCreateTemp(interp, input);
4504 if (inputId == JIM_BAD_FD) {
4505 goto error;
4506 }
4507 }
4508 else if (inputFile == FILE_HANDLE) {
@@ -4587,11 +4571,11 @@
4587 goto error;
4588 }
4589 }
4590 }
4591 else if (errFilePtr != NULL) {
4592 errorId = JimCreateTemp(interp, NULL);
4593 if (errorId == JIM_BAD_FD) {
4594 goto error;
4595 }
4596 *errFilePtr = JimDupFd(errorId);
4597 }
@@ -4953,11 +4937,11 @@
4953 *status = ret;
4954 CloseHandle(pid);
4955 return pid;
4956 }
4957
4958 static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents)
4959 {
4960 char name[MAX_PATH];
4961 HANDLE handle;
4962
4963 if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) {
@@ -4977,11 +4961,11 @@
4977 FILE *fh = JimFdOpenForWrite(JimDupFd(handle));
4978 if (fh == NULL) {
4979 goto error;
4980 }
4981
4982 if (fwrite(contents, strlen(contents), 1, fh) != 1) {
4983 fclose(fh);
4984 goto error;
4985 }
4986 fseek(fh, 0, SEEK_SET);
4987 fclose(fh);
@@ -5196,11 +5180,11 @@
5196 static int JimRewindFd(int fd)
5197 {
5198 return lseek(fd, 0L, SEEK_SET);
5199 }
5200
5201 static int JimCreateTemp(Jim_Interp *interp, const char *contents)
5202 {
5203 char inName[] = "/tmp/tcl.tmp.XXXXXX";
5204
5205 int fd = mkstemp(inName);
5206 if (fd == JIM_BAD_FD) {
@@ -5207,12 +5191,11 @@
5207 Jim_SetResultErrno(interp, "couldn't create temp file");
5208 return -1;
5209 }
5210 unlink(inName);
5211 if (contents) {
5212 int length = strlen(contents);
5213 if (write(fd, contents, length) != length) {
5214 Jim_SetResultErrno(interp, "couldn't write temp file");
5215 close(fd);
5216 return -1;
5217 }
5218 lseek(fd, 0L, SEEK_SET);
@@ -5671,10 +5654,11 @@
5671 #ifdef JIM_MAINTAINER
5672 #define JIM_DEBUG_COMMAND
5673 #define JIM_DEBUG_PANIC
5674 #endif
5675
 
5676
5677 #define JIM_INTEGER_SPACE 24
5678
5679 const char *jim_tt_name(int type);
5680
@@ -6029,11 +6013,12 @@
6029 if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) {
6030
6031 return i;
6032 }
6033
6034 return 10;
 
6035 }
6036
6037 static long jim_strtol(const char *str, char **endptr)
6038 {
6039 int sign;
@@ -6109,10 +6094,12 @@
6109 return len;
6110 }
6111
6112 if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') {
6113 buf[i] = toupper(UCHAR(buf[i]));
 
 
6114 buf[i + 3] = 0;
6115 return i + 3;
6116 }
6117 }
6118
@@ -7581,17 +7568,21 @@
7581 objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr;
7582 if (objPtr->nextObjPtr)
7583 objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr;
7584 if (interp->liveList == objPtr)
7585 interp->liveList = objPtr->nextObjPtr;
 
 
 
7586
7587 objPtr->prevObjPtr = NULL;
7588 objPtr->nextObjPtr = interp->freeList;
7589 if (interp->freeList)
7590 interp->freeList->prevObjPtr = objPtr;
7591 interp->freeList = objPtr;
7592 objPtr->refCount = -1;
 
7593 }
7594
7595
7596 void Jim_InvalidateStringRep(Jim_Obj *objPtr)
7597 {
@@ -8244,10 +8235,19 @@
8244 }
8245
8246 return strObjPtr;
8247 }
8248
 
 
 
 
 
 
 
 
 
8249
8250 static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict)
8251 {
8252 static const char * const strclassnames[] = {
8253 "integer", "alpha", "alnum", "ascii", "digit",
@@ -8291,11 +8291,11 @@
8291 return JIM_OK;
8292 }
8293
8294 case STR_IS_ALPHA: isclassfunc = isalpha; break;
8295 case STR_IS_ALNUM: isclassfunc = isalnum; break;
8296 case STR_IS_ASCII: isclassfunc = isascii; break;
8297 case STR_IS_DIGIT: isclassfunc = isdigit; break;
8298 case STR_IS_LOWER: isclassfunc = islower; break;
8299 case STR_IS_UPPER: isclassfunc = isupper; break;
8300 case STR_IS_SPACE: isclassfunc = isspace; break;
8301 case STR_IS_XDIGIT: isclassfunc = isxdigit; break;
@@ -10213,11 +10213,11 @@
10213 Jim_Collect(interp);
10214 }
10215 }
10216 #endif
10217
10218 static int JimIsBigEndian(void)
10219 {
10220 union {
10221 unsigned short s;
10222 unsigned char c[2];
10223 } uval = {0x0102};
@@ -10269,11 +10269,11 @@
10269 Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0");
10270
10271 Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS);
10272 Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM);
10273 Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR);
10274 Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", JimIsBigEndian() ? "bigEndian" : "littleEndian");
10275 Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0");
10276 Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *)));
10277 Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide)));
10278
10279 return i;
@@ -10449,17 +10449,11 @@
10449 interp->stackTrace = stackTraceObj;
10450 interp->errorFlag = 1;
10451
10452 len = Jim_ListLength(interp, interp->stackTrace);
10453 if (len >= 3) {
10454 Jim_Obj *filenameObj;
10455
10456 Jim_ListIndex(interp, interp->stackTrace, len - 2, &filenameObj, JIM_NONE);
10457
10458 Jim_GetString(filenameObj, &len);
10459
10460 if (!Jim_Length(filenameObj)) {
10461 interp->addStackTrace = 1;
10462 }
10463 }
10464 }
10465
@@ -10485,14 +10479,15 @@
10485 if (!*procname && Jim_Length(fileNameObj)) {
10486
10487 int len = Jim_ListLength(interp, interp->stackTrace);
10488
10489 if (len >= 3) {
10490 Jim_Obj *objPtr;
10491 if (Jim_ListIndex(interp, interp->stackTrace, len - 3, &objPtr, JIM_NONE) == JIM_OK && Jim_Length(objPtr)) {
10492
10493 if (Jim_ListIndex(interp, interp->stackTrace, len - 2, &objPtr, JIM_NONE) == JIM_OK && !Jim_Length(objPtr)) {
 
10494
10495 ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0);
10496 ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0);
10497 return;
10498 }
@@ -17159,10 +17154,15 @@
17159
17160 static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
17161 {
17162 int retcode;
17163
 
 
 
 
 
17164
17165 interp->local++;
17166 retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1);
17167 interp->local--;
17168
@@ -19552,11 +19552,11 @@
19552 char *num_buffer = NULL;
19553 int num_buffer_size = 0;
19554
19555 span = format = Jim_GetString(fmtObjPtr, &formatLen);
19556 formatEnd = format + formatLen;
19557 resultPtr = Jim_NewStringObj(interp, "", 0);
19558
19559 while (format != formatEnd) {
19560 char *end;
19561 int gotMinus, sawFlag;
19562 int gotPrecision, useShort;
19563
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -42,10 +42,11 @@
42 #define HAVE_ISATTY
43 #define HAVE_SYS_TIME_H
44 #define HAVE_DIRENT_H
45 #define HAVE_UNISTD_H
46 #endif
47 #define JIM_VERSION 75
48 #ifndef JIM_WIN32COMPAT_H
49 #define JIM_WIN32COMPAT_H
50
51
52
@@ -185,12 +186,10 @@
186 #endif
187
188 #define UCHAR(c) ((unsigned char)(c))
189
190
 
 
191 #define JIM_OK 0
192 #define JIM_ERR 1
193 #define JIM_RETURN 2
194 #define JIM_BREAK 3
195 #define JIM_CONTINUE 4
@@ -832,16 +831,10 @@
831 double *doublePtr);
832 JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr,
833 double doubleValue);
834 JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue);
835
 
 
 
 
 
 
836
837 JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc,
838 Jim_Obj *const *argv, const char *msg);
839 JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr,
840 const char * const *tablePtr, int *indexPtr, const char *name, int flags);
@@ -875,11 +868,11 @@
868 JIM_EXPORT void Jim_HistoryShow(void);
869
870
871 JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp);
872 JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base);
873 JIM_EXPORT int Jim_IsBigEndian(void);
874 #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask)
875
876
877 JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName);
878 JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp);
@@ -1775,19 +1768,11 @@
1768
1769 Jim_DecrRefCount(interp, af->filename);
1770
1771 #ifdef jim_ext_eventloop
1772
1773 Jim_DeleteFileHandler(interp, af->fp, JIM_EVENT_READABLE | JIM_EVENT_WRITABLE | JIM_EVENT_EXCEPTION);
 
 
 
 
 
 
 
 
1774 #endif
1775 Jim_Free(af);
1776 }
1777
1778 static int JimCheckStreamError(Jim_Interp *interp, AioFile *af)
@@ -2147,27 +2132,26 @@
2132 }
2133
2134 #ifdef jim_ext_eventloop
2135 static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData)
2136 {
2137 Jim_Obj **objPtrPtr = clientData;
2138
2139 Jim_DecrRefCount(interp, *objPtrPtr);
2140 *objPtrPtr = NULL;
2141 }
2142
2143 static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask)
2144 {
2145 Jim_Obj **objPtrPtr = clientData;
2146
2147 return Jim_EvalObjBackground(interp, *objPtrPtr);
2148 }
2149
2150 static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj,
2151 int argc, Jim_Obj * const *argv)
2152 {
 
 
2153 if (argc == 0) {
2154
2155 if (*scriptHandlerObj) {
2156 Jim_SetResult(interp, *scriptHandlerObj);
2157 }
@@ -2174,27 +2158,25 @@
2158 return JIM_OK;
2159 }
2160
2161 if (*scriptHandlerObj) {
2162
2163 Jim_DeleteFileHandler(interp, af->fp, mask);
 
2164 }
2165
2166
2167 if (Jim_Length(argv[0]) == 0) {
 
2168
2169 return JIM_OK;
2170 }
2171
2172
2173 Jim_IncrRefCount(argv[0]);
2174 *scriptHandlerObj = argv[0];
2175
2176 Jim_CreateFileHandler(interp, af->fp, mask,
2177 JimAioFileEventHandler, scriptHandlerObj, JimAioFileEventFinalizer);
2178
2179 return JIM_OK;
2180 }
2181
2182 static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -4005,11 +3987,11 @@
3987 static void JimRestoreEnv(char **env);
3988 static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv,
3989 pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr);
3990 static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr);
3991 static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId);
3992 static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents, int len);
3993 static fdtype JimOpenForWrite(const char *filename, int append);
3994 static int JimRewindFd(fdtype fd);
3995
3996 static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg)
3997 {
@@ -4347,10 +4329,11 @@
4329 int cmdCount; /* Count of number of distinct commands
4330 * found in argc/argv. */
4331 const char *input = NULL; /* Describes input for pipeline, depending
4332 * on "inputFile". NULL means take input
4333 * from stdin/pipe. */
4334 int input_len = 0;
4335
4336 #define FILE_NAME 0
4337 #define FILE_APPEND 1
4338 #define FILE_HANDLE 2
4339 #define FILE_TEXT 3
@@ -4412,19 +4395,20 @@
4395 if (arg[0] == '<') {
4396 inputFile = FILE_NAME;
4397 input = arg + 1;
4398 if (*input == '<') {
4399 inputFile = FILE_TEXT;
4400 input_len = Jim_Length(argv[i]) - 2;
4401 input++;
4402 }
4403 else if (*input == '@') {
4404 inputFile = FILE_HANDLE;
4405 input++;
4406 }
4407
4408 if (!*input && ++i < argc) {
4409 input = Jim_GetString(argv[i], &input_len);
4410 }
4411 }
4412 else if (arg[0] == '>') {
4413 int dup_error = 0;
4414
@@ -4498,11 +4482,11 @@
4482
4483 save_environ = JimSaveEnv(JimBuildEnv(interp));
4484
4485 if (input != NULL) {
4486 if (inputFile == FILE_TEXT) {
4487 inputId = JimCreateTemp(interp, input, input_len);
4488 if (inputId == JIM_BAD_FD) {
4489 goto error;
4490 }
4491 }
4492 else if (inputFile == FILE_HANDLE) {
@@ -4587,11 +4571,11 @@
4571 goto error;
4572 }
4573 }
4574 }
4575 else if (errFilePtr != NULL) {
4576 errorId = JimCreateTemp(interp, NULL, 0);
4577 if (errorId == JIM_BAD_FD) {
4578 goto error;
4579 }
4580 *errFilePtr = JimDupFd(errorId);
4581 }
@@ -4953,11 +4937,11 @@
4937 *status = ret;
4938 CloseHandle(pid);
4939 return pid;
4940 }
4941
4942 static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
4943 {
4944 char name[MAX_PATH];
4945 HANDLE handle;
4946
4947 if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) {
@@ -4977,11 +4961,11 @@
4961 FILE *fh = JimFdOpenForWrite(JimDupFd(handle));
4962 if (fh == NULL) {
4963 goto error;
4964 }
4965
4966 if (fwrite(contents, len, 1, fh) != 1) {
4967 fclose(fh);
4968 goto error;
4969 }
4970 fseek(fh, 0, SEEK_SET);
4971 fclose(fh);
@@ -5196,11 +5180,11 @@
5180 static int JimRewindFd(int fd)
5181 {
5182 return lseek(fd, 0L, SEEK_SET);
5183 }
5184
5185 static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
5186 {
5187 char inName[] = "/tmp/tcl.tmp.XXXXXX";
5188
5189 int fd = mkstemp(inName);
5190 if (fd == JIM_BAD_FD) {
@@ -5207,12 +5191,11 @@
5191 Jim_SetResultErrno(interp, "couldn't create temp file");
5192 return -1;
5193 }
5194 unlink(inName);
5195 if (contents) {
5196 if (write(fd, contents, len) != len) {
 
5197 Jim_SetResultErrno(interp, "couldn't write temp file");
5198 close(fd);
5199 return -1;
5200 }
5201 lseek(fd, 0L, SEEK_SET);
@@ -5671,10 +5654,11 @@
5654 #ifdef JIM_MAINTAINER
5655 #define JIM_DEBUG_COMMAND
5656 #define JIM_DEBUG_PANIC
5657 #endif
5658
5659
5660
5661 #define JIM_INTEGER_SPACE 24
5662
5663 const char *jim_tt_name(int type);
5664
@@ -6029,11 +6013,12 @@
6013 if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) {
6014
6015 return i;
6016 }
6017
6018 *base = 10;
6019 return 0;
6020 }
6021
6022 static long jim_strtol(const char *str, char **endptr)
6023 {
6024 int sign;
@@ -6109,10 +6094,12 @@
6094 return len;
6095 }
6096
6097 if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') {
6098 buf[i] = toupper(UCHAR(buf[i]));
6099 if (buf[i] == 'n' || buf[i] == 'N')
6100 buf[i+2] = toupper(UCHAR(buf[i+2]));
6101 buf[i + 3] = 0;
6102 return i + 3;
6103 }
6104 }
6105
@@ -7581,17 +7568,21 @@
7568 objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr;
7569 if (objPtr->nextObjPtr)
7570 objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr;
7571 if (interp->liveList == objPtr)
7572 interp->liveList = objPtr->nextObjPtr;
7573 #ifdef JIM_DISABLE_OBJECT_POOL
7574 Jim_Free(objPtr);
7575 #else
7576
7577 objPtr->prevObjPtr = NULL;
7578 objPtr->nextObjPtr = interp->freeList;
7579 if (interp->freeList)
7580 interp->freeList->prevObjPtr = objPtr;
7581 interp->freeList = objPtr;
7582 objPtr->refCount = -1;
7583 #endif
7584 }
7585
7586
7587 void Jim_InvalidateStringRep(Jim_Obj *objPtr)
7588 {
@@ -8244,10 +8235,19 @@
8235 }
8236
8237 return strObjPtr;
8238 }
8239
8240
8241 #ifdef HAVE_ISASCII
8242 #define jim_isascii isascii
8243 #else
8244 static int jim_isascii(int c)
8245 {
8246 return !(c & ~0x7f);
8247 }
8248 #endif
8249
8250 static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict)
8251 {
8252 static const char * const strclassnames[] = {
8253 "integer", "alpha", "alnum", "ascii", "digit",
@@ -8291,11 +8291,11 @@
8291 return JIM_OK;
8292 }
8293
8294 case STR_IS_ALPHA: isclassfunc = isalpha; break;
8295 case STR_IS_ALNUM: isclassfunc = isalnum; break;
8296 case STR_IS_ASCII: isclassfunc = jim_isascii; break;
8297 case STR_IS_DIGIT: isclassfunc = isdigit; break;
8298 case STR_IS_LOWER: isclassfunc = islower; break;
8299 case STR_IS_UPPER: isclassfunc = isupper; break;
8300 case STR_IS_SPACE: isclassfunc = isspace; break;
8301 case STR_IS_XDIGIT: isclassfunc = isxdigit; break;
@@ -10213,11 +10213,11 @@
10213 Jim_Collect(interp);
10214 }
10215 }
10216 #endif
10217
10218 int Jim_IsBigEndian(void)
10219 {
10220 union {
10221 unsigned short s;
10222 unsigned char c[2];
10223 } uval = {0x0102};
@@ -10269,11 +10269,11 @@
10269 Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0");
10270
10271 Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS);
10272 Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM);
10273 Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR);
10274 Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", Jim_IsBigEndian() ? "bigEndian" : "littleEndian");
10275 Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0");
10276 Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *)));
10277 Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide)));
10278
10279 return i;
@@ -10449,17 +10449,11 @@
10449 interp->stackTrace = stackTraceObj;
10450 interp->errorFlag = 1;
10451
10452 len = Jim_ListLength(interp, interp->stackTrace);
10453 if (len >= 3) {
10454 if (Jim_Length(Jim_ListGetIndex(interp, interp->stackTrace, len - 2)) == 0) {
 
 
 
 
 
 
10455 interp->addStackTrace = 1;
10456 }
10457 }
10458 }
10459
@@ -10485,14 +10479,15 @@
10479 if (!*procname && Jim_Length(fileNameObj)) {
10480
10481 int len = Jim_ListLength(interp, interp->stackTrace);
10482
10483 if (len >= 3) {
10484 Jim_Obj *objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 3);
10485 if (Jim_Length(objPtr)) {
10486
10487 objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 2);
10488 if (Jim_Length(objPtr) == 0) {
10489
10490 ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0);
10491 ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0);
10492 return;
10493 }
@@ -17159,10 +17154,15 @@
17154
17155 static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
17156 {
17157 int retcode;
17158
17159 if (argc < 2) {
17160 Jim_WrongNumArgs(interp, 1, argv, "cmd ?args ...?");
17161 return JIM_ERR;
17162 }
17163
17164
17165 interp->local++;
17166 retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1);
17167 interp->local--;
17168
@@ -19552,11 +19552,11 @@
19552 char *num_buffer = NULL;
19553 int num_buffer_size = 0;
19554
19555 span = format = Jim_GetString(fmtObjPtr, &formatLen);
19556 formatEnd = format + formatLen;
19557 resultPtr = Jim_NewEmptyStringObj(interp);
19558
19559 while (format != formatEnd) {
19560 char *end;
19561 int gotMinus, sawFlag;
19562 int gotPrecision, useShort;
19563
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -26,5 +26,200 @@
2626
set tclconfig($name) [string trim $value ']
2727
}
2828
}
2929
return [array get tclconfig]
3030
}
31
+
32
+# The complex extension checking is done here.
33
+
34
+global withinfo
35
+global extdb
36
+
37
+# Final determination of module status
38
+dict set extdb status {}
39
+
40
+# Returns 1 if the extension has the attribute
41
+proc ext-has {ext attr} {
42
+ expr {$attr in [dict get $::extdb attrs $ext]}
43
+}
44
+
45
+# Returns an entry from the extension 'info' table, or $default otherwise
46
+proc ext-get {ext key {default {}}} {
47
+ if {[dict exists $::extdb info $ext $key]} {
48
+ return [dict get $::extdb info $ext $key]
49
+ } else {
50
+ return $default
51
+ }
52
+}
53
+
54
+# Set the status of the extension to the given value, and returns the value
55
+proc ext-set-status {ext value} {
56
+ dict set ::extdb status $ext $value
57
+ return $value
58
+}
59
+
60
+# Returns the status of the extension, or ? if unknown
61
+proc ext-get-status {ext} {
62
+ if {[dict exists $::extdb status $ext]} {
63
+ return [dict get $::extdb status $ext]
64
+ }
65
+ return ?
66
+}
67
+
68
+proc check-extension-status {ext required} {
69
+ global withinfo
70
+
71
+ set status [ext-get-status $ext]
72
+
73
+ if {$ext in $withinfo(without)} {
74
+ # Disabled without further ado
75
+ msg-result "Extension $ext...disabled"
76
+ return [ext-set-status $ext n]
77
+ }
78
+
79
+ if {$status in {m y n}} {
80
+ return $status
81
+ }
82
+
83
+ # required is "required" if this extension *must* be enabled
84
+ # required is "wanted" if it is not fatal for this extension
85
+ # not to be enabled
86
+
87
+ array set depinfo {m 0 y 0 n 0}
88
+
89
+ # Check direct dependencies
90
+ if [ext-get $ext check 1] {
91
+ # "check" conditions are met
92
+ } else {
93
+ # not met
94
+ incr depinfo(n)
95
+ }
96
+
97
+ if {$depinfo(n) == 0} {
98
+ # Now extension dependencies
99
+ foreach i [ext-get $ext dep] {
100
+ set status [check-extension-status $i $required]
101
+ #puts "$ext: dep $i $required => $status"
102
+ incr depinfo($status)
103
+ if {$depinfo(n)} {
104
+ break
105
+ }
106
+ }
107
+ }
108
+
109
+ #parray depinfo
110
+
111
+ if {$depinfo(n)} {
112
+ msg-checking "Extension $ext..."
113
+ if {$required eq "required"} {
114
+ user-error "dependencies not met"
115
+ }
116
+ msg-result "disabled (dependencies)"
117
+ return [ext-set-status $ext n]
118
+ }
119
+
120
+ # Selected as a module?
121
+ if {$ext in $withinfo(mod)} {
122
+ if {[ext-has $ext tcl]} {
123
+ # Easy, a Tcl module
124
+ msg-result "Extension $ext...tcl"
125
+ } elseif {[ext-has $ext static]} {
126
+ user-error "Extension $ext can't be a module"
127
+ } else {
128
+ msg-result "Extension $ext...module"
129
+ foreach i [ext-get $ext libdep] {
130
+ define-append LDLIBS_$ext [get-define $i ""]
131
+ }
132
+ }
133
+ return [ext-set-status $ext m]
134
+ }
135
+
136
+ # Selected as a static extension?
137
+ if {[ext-has $ext shared]} {
138
+ user-error "Extension $ext can only be selected as a module"
139
+ } elseif {$ext in $withinfo(ext) || $required eq "$required"} {
140
+ msg-result "Extension $ext...enabled"
141
+ } elseif {$ext in $withinfo(maybe)} {
142
+ msg-result "Extension $ext...enabled (default)"
143
+ } else {
144
+ # Could be selected, but isn't (yet)
145
+ return [ext-set-status $ext x]
146
+ }
147
+ foreach i [ext-get $ext libdep] {
148
+ define-append LDLIBS [get-define $i ""]
149
+ }
150
+ return [ext-set-status $ext y]
151
+}
152
+
153
+# Examines the user options (the $withinfo array)
154
+# and the extension database ($extdb) to determine
155
+# what is selected, and in what way.
156
+#
157
+# The results are available via ext-get-status
158
+# And a dictionary is returned containing four keys:
159
+# static-c extensions which are static C
160
+# static-tcl extensions which are static Tcl
161
+# module-c extensions which are C modules
162
+# module-tcl extensions which are Tcl modules
163
+proc check-extensions {} {
164
+ global extdb withinfo
165
+
166
+ # Check valid extension names
167
+ foreach i [concat $withinfo(ext) $withinfo(mod)] {
168
+ if {![dict exists $extdb attrs $i]} {
169
+ user-error "Unknown extension: $i"
170
+ }
171
+ }
172
+
173
+ set extlist [lsort [dict keys [dict get $extdb attrs]]]
174
+
175
+ set withinfo(maybe) {}
176
+
177
+ # Now work out the default status. We have.
178
+ # normal case, include !optional if possible
179
+ # --without=default, don't include optional
180
+ if {$withinfo(nodefault)} {
181
+ lappend withinfo(maybe) stdlib
182
+ } else {
183
+ foreach i $extlist {
184
+ if {![ext-has $i optional]} {
185
+ lappend withinfo(maybe) $i
186
+ }
187
+ }
188
+ }
189
+
190
+ foreach i $extlist {
191
+ define LDLIBS_$i ""
192
+ }
193
+
194
+ foreach i [concat $withinfo(ext) $withinfo(mod)] {
195
+ check-extension-status $i required
196
+ }
197
+ foreach i $withinfo(maybe) {
198
+ check-extension-status $i wanted
199
+ }
200
+
201
+ array set extinfo {static-c {} static-tcl {} module-c {} module-tcl {}}
202
+
203
+ foreach i $extlist {
204
+ set status [ext-get-status $i]
205
+ set tcl [ext-has $i tcl]
206
+ switch $status,$tcl {
207
+ y,1 {
208
+ define jim_ext_$i
209
+ lappend extinfo(static-tcl) $i
210
+ }
211
+ y,0 {
212
+ define jim_ext_$i
213
+ lappend extinfo(static-c) $i
214
+ # If there are any static C++ extensions, jimsh must be linked using
215
+ # the C++ compiler
216
+ if {[ext-has $i cpp]} {
217
+ define HAVE_CXX_EXTENSIONS
218
+ }
219
+ }
220
+ m,1 { lappend extinfo(module-tcl) $i }
221
+ m,0 { lappend extinfo(module-c) $i }
222
+ }
223
+ }
224
+ return [array get extinfo]
225
+}
31226
32227
DELETED fossil.nsi
33228
ADDED setup/fossil.iss
34229
ADDED setup/fossil.nsi
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -26,5 +26,200 @@
26 set tclconfig($name) [string trim $value ']
27 }
28 }
29 return [array get tclconfig]
30 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
32 ELETED fossil.nsi
33 DDED setup/fossil.iss
34 DDED setup/fossil.nsi
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -26,5 +26,200 @@
26 set tclconfig($name) [string trim $value ']
27 }
28 }
29 return [array get tclconfig]
30 }
31
32 # The complex extension checking is done here.
33
34 global withinfo
35 global extdb
36
37 # Final determination of module status
38 dict set extdb status {}
39
40 # Returns 1 if the extension has the attribute
41 proc ext-has {ext attr} {
42 expr {$attr in [dict get $::extdb attrs $ext]}
43 }
44
45 # Returns an entry from the extension 'info' table, or $default otherwise
46 proc ext-get {ext key {default {}}} {
47 if {[dict exists $::extdb info $ext $key]} {
48 return [dict get $::extdb info $ext $key]
49 } else {
50 return $default
51 }
52 }
53
54 # Set the status of the extension to the given value, and returns the value
55 proc ext-set-status {ext value} {
56 dict set ::extdb status $ext $value
57 return $value
58 }
59
60 # Returns the status of the extension, or ? if unknown
61 proc ext-get-status {ext} {
62 if {[dict exists $::extdb status $ext]} {
63 return [dict get $::extdb status $ext]
64 }
65 return ?
66 }
67
68 proc check-extension-status {ext required} {
69 global withinfo
70
71 set status [ext-get-status $ext]
72
73 if {$ext in $withinfo(without)} {
74 # Disabled without further ado
75 msg-result "Extension $ext...disabled"
76 return [ext-set-status $ext n]
77 }
78
79 if {$status in {m y n}} {
80 return $status
81 }
82
83 # required is "required" if this extension *must* be enabled
84 # required is "wanted" if it is not fatal for this extension
85 # not to be enabled
86
87 array set depinfo {m 0 y 0 n 0}
88
89 # Check direct dependencies
90 if [ext-get $ext check 1] {
91 # "check" conditions are met
92 } else {
93 # not met
94 incr depinfo(n)
95 }
96
97 if {$depinfo(n) == 0} {
98 # Now extension dependencies
99 foreach i [ext-get $ext dep] {
100 set status [check-extension-status $i $required]
101 #puts "$ext: dep $i $required => $status"
102 incr depinfo($status)
103 if {$depinfo(n)} {
104 break
105 }
106 }
107 }
108
109 #parray depinfo
110
111 if {$depinfo(n)} {
112 msg-checking "Extension $ext..."
113 if {$required eq "required"} {
114 user-error "dependencies not met"
115 }
116 msg-result "disabled (dependencies)"
117 return [ext-set-status $ext n]
118 }
119
120 # Selected as a module?
121 if {$ext in $withinfo(mod)} {
122 if {[ext-has $ext tcl]} {
123 # Easy, a Tcl module
124 msg-result "Extension $ext...tcl"
125 } elseif {[ext-has $ext static]} {
126 user-error "Extension $ext can't be a module"
127 } else {
128 msg-result "Extension $ext...module"
129 foreach i [ext-get $ext libdep] {
130 define-append LDLIBS_$ext [get-define $i ""]
131 }
132 }
133 return [ext-set-status $ext m]
134 }
135
136 # Selected as a static extension?
137 if {[ext-has $ext shared]} {
138 user-error "Extension $ext can only be selected as a module"
139 } elseif {$ext in $withinfo(ext) || $required eq "$required"} {
140 msg-result "Extension $ext...enabled"
141 } elseif {$ext in $withinfo(maybe)} {
142 msg-result "Extension $ext...enabled (default)"
143 } else {
144 # Could be selected, but isn't (yet)
145 return [ext-set-status $ext x]
146 }
147 foreach i [ext-get $ext libdep] {
148 define-append LDLIBS [get-define $i ""]
149 }
150 return [ext-set-status $ext y]
151 }
152
153 # Examines the user options (the $withinfo array)
154 # and the extension database ($extdb) to determine
155 # what is selected, and in what way.
156 #
157 # The results are available via ext-get-status
158 # And a dictionary is returned containing four keys:
159 # static-c extensions which are static C
160 # static-tcl extensions which are static Tcl
161 # module-c extensions which are C modules
162 # module-tcl extensions which are Tcl modules
163 proc check-extensions {} {
164 global extdb withinfo
165
166 # Check valid extension names
167 foreach i [concat $withinfo(ext) $withinfo(mod)] {
168 if {![dict exists $extdb attrs $i]} {
169 user-error "Unknown extension: $i"
170 }
171 }
172
173 set extlist [lsort [dict keys [dict get $extdb attrs]]]
174
175 set withinfo(maybe) {}
176
177 # Now work out the default status. We have.
178 # normal case, include !optional if possible
179 # --without=default, don't include optional
180 if {$withinfo(nodefault)} {
181 lappend withinfo(maybe) stdlib
182 } else {
183 foreach i $extlist {
184 if {![ext-has $i optional]} {
185 lappend withinfo(maybe) $i
186 }
187 }
188 }
189
190 foreach i $extlist {
191 define LDLIBS_$i ""
192 }
193
194 foreach i [concat $withinfo(ext) $withinfo(mod)] {
195 check-extension-status $i required
196 }
197 foreach i $withinfo(maybe) {
198 check-extension-status $i wanted
199 }
200
201 array set extinfo {static-c {} static-tcl {} module-c {} module-tcl {}}
202
203 foreach i $extlist {
204 set status [ext-get-status $i]
205 set tcl [ext-has $i tcl]
206 switch $status,$tcl {
207 y,1 {
208 define jim_ext_$i
209 lappend extinfo(static-tcl) $i
210 }
211 y,0 {
212 define jim_ext_$i
213 lappend extinfo(static-c) $i
214 # If there are any static C++ extensions, jimsh must be linked using
215 # the C++ compiler
216 if {[ext-has $i cpp]} {
217 define HAVE_CXX_EXTENSIONS
218 }
219 }
220 m,1 { lappend extinfo(module-tcl) $i }
221 m,0 { lappend extinfo(module-c) $i }
222 }
223 }
224 return [array get extinfo]
225 }
226
227 ELETED fossil.nsi
228 DDED setup/fossil.iss
229 DDED setup/fossil.nsi
D fossil.nsi
-55
--- a/fossil.nsi
+++ b/fossil.nsi
@@ -1,55 +0,0 @@
1
-; example2.nsi
2
-;
3
-; This script is based on example1.nsi, but adds uninstall support
4
-; and (optionally) start menu shortcuts.
5
-;
6
-; It will install notepad.exe into a directory that the user selects,
7
-;
8
-
9
-; The name of the installer
10
-Name "Fossil"
11
-
12
-; The file to write
13
-OutFile "fossil-setup.exe"
14
-
15
-; The default installation directory
16
-InstallDir $PROGRAMFILES\Fossil
17
-; Registry key to check for directory (so if you install again, it will
18
-; overwrite the old one automatically)
19
-InstallDirRegKey HKLM SOFTWARE\Fossil "Install_Dir"
20
-
21
-; The text to prompt the user to enter a directory
22
-ComponentText "This will install fossil on your computer."
23
-; The text to prompt the user to enter a directory
24
-DirText "Choose a directory to install in to:"
25
-
26
-; The stuff to install
27
-Section "Fossil (required)"
28
- ; Set output path to the installation directory.
29
- SetOutPath $INSTDIR
30
- ; Put file there
31
- File "..\fossil.exe"
32
- ; Write the installation path into the registry
33
- WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
34
- ; Write the uninstall keys for Windows
35
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "DisplayName" "Fossil (remove only)"
36
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "UninstallString" '"$INSTDIR\uninstall.exe"'
37
- WriteUninstaller "uninstall.exe"
38
-SectionEnd
39
-
40
-
41
-; uninstall stuff
42
-
43
-UninstallText "This will uninstall fossil. Hit next to continue."
44
-
45
-; special uninstall section.
46
-Section "Uninstall"
47
- ; remove registry keys
48
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil"
49
- DeleteRegKey HKLM SOFTWARE\Fossil
50
- ; remove files
51
- Delete $INSTDIR\fossil.exe
52
- ; MUST REMOVE UNINSTALLER, too
53
- Delete $INSTDIR\uninstall.exe
54
- ; remove shortcuts, if any.
55
- RMDir "$SM
--- a/fossil.nsi
+++ b/fossil.nsi
@@ -1,55 +0,0 @@
1 ; example2.nsi
2 ;
3 ; This script is based on example1.nsi, but adds uninstall support
4 ; and (optionally) start menu shortcuts.
5 ;
6 ; It will install notepad.exe into a directory that the user selects,
7 ;
8
9 ; The name of the installer
10 Name "Fossil"
11
12 ; The file to write
13 OutFile "fossil-setup.exe"
14
15 ; The default installation directory
16 InstallDir $PROGRAMFILES\Fossil
17 ; Registry key to check for directory (so if you install again, it will
18 ; overwrite the old one automatically)
19 InstallDirRegKey HKLM SOFTWARE\Fossil "Install_Dir"
20
21 ; The text to prompt the user to enter a directory
22 ComponentText "This will install fossil on your computer."
23 ; The text to prompt the user to enter a directory
24 DirText "Choose a directory to install in to:"
25
26 ; The stuff to install
27 Section "Fossil (required)"
28 ; Set output path to the installation directory.
29 SetOutPath $INSTDIR
30 ; Put file there
31 File "..\fossil.exe"
32 ; Write the installation path into the registry
33 WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
34 ; Write the uninstall keys for Windows
35 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "DisplayName" "Fossil (remove only)"
36 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "UninstallString" '"$INSTDIR\uninstall.exe"'
37 WriteUninstaller "uninstall.exe"
38 SectionEnd
39
40
41 ; uninstall stuff
42
43 UninstallText "This will uninstall fossil. Hit next to continue."
44
45 ; special uninstall section.
46 Section "Uninstall"
47 ; remove registry keys
48 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil"
49 DeleteRegKey HKLM SOFTWARE\Fossil
50 ; remove files
51 Delete $INSTDIR\fossil.exe
52 ; MUST REMOVE UNINSTALLER, too
53 Delete $INSTDIR\uninstall.exe
54 ; remove shortcuts, if any.
55 RMDir "$SM
--- a/fossil.nsi
+++ b/fossil.nsi
@@ -1,55 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/setup/fossil.iss
+++ b/setup/fossil.iss
@@ -0,0 +1,66 @@
1
+;
2
+; Copyrig
3
+;
4
+ (c) 2014 D. Richard Hipp
5
+;
6
+; This program is free software; you
7
+ can redistribute it and/or
8
+; modify it under the terms of the S
9
+implified BSD License (also
10
+;
11
+;
12
+; This program is distributed in the hope that it will be useful,
13
+ope that it will be useful,
14
+; but without any warranty; without e
15
+ven the implied warranty of
16
+
17
+;
18
+; Author contact information:
19
+; [email protected]
20
+; http://www.hwaci.com/drh/
21
+;
22
+
23
+[Setup]
24
+w.hwaci.com/drh/
25
+;
26
+
27
+[Setup]
28
+A
29
+AlwaysShowComponentsList=false
30
+aysShowComponentsList=false
31
+AppCopyright=Copyright (c) D. Richard
32
+Hipp. All rights r
33
+AppName=Fossil
34
+314c52f057
35
+AppPublisherURL=https://www.fossil-scm.org/
36
+AppSupportURL=https:////www.fossil-scm.org/
37
+X@DC,1:
38
+P@Di,1:
39
+1S@E6,q:
40
+AppReadmeFile=https://www.fossil-scm.org:
41
+R@Gd,Q:
42
+DefaultGroupNameSupportURL=http:
43
+R@Gd,Q:
44
+Defa:
45
+R@Gd,Q:
46
+DefaultGroupNameY@JM,1:
47
+X@Jt,I:
48
+
49
+
50
+[Components]
51
+1S@Kd,e:
52
+
53
+
54
+[Dirs]
55
+Name: {app}\bin
56
+
57
+
58
+[Files]
59
+1i@Mc,G:
60
+
61
+
62
+[Registry]
63
+Q@Mc,2H@Ow,2:
64
+_~AvY;:
65
+R@Gd,Q:
66
+DefaultGrou
--- a/setup/fossil.iss
+++ b/setup/fossil.iss
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/setup/fossil.iss
+++ b/setup/fossil.iss
@@ -0,0 +1,66 @@
1 ;
2 ; Copyrig
3 ;
4 (c) 2014 D. Richard Hipp
5 ;
6 ; This program is free software; you
7 can redistribute it and/or
8 ; modify it under the terms of the S
9 implified BSD License (also
10 ;
11 ;
12 ; This program is distributed in the hope that it will be useful,
13 ope that it will be useful,
14 ; but without any warranty; without e
15 ven the implied warranty of
16
17 ;
18 ; Author contact information:
19 ; [email protected]
20 ; http://www.hwaci.com/drh/
21 ;
22
23 [Setup]
24 w.hwaci.com/drh/
25 ;
26
27 [Setup]
28 A
29 AlwaysShowComponentsList=false
30 aysShowComponentsList=false
31 AppCopyright=Copyright (c) D. Richard
32 Hipp. All rights r
33 AppName=Fossil
34 314c52f057
35 AppPublisherURL=https://www.fossil-scm.org/
36 AppSupportURL=https:////www.fossil-scm.org/
37 X@DC,1:
38 P@Di,1:
39 1S@E6,q:
40 AppReadmeFile=https://www.fossil-scm.org:
41 R@Gd,Q:
42 DefaultGroupNameSupportURL=http:
43 R@Gd,Q:
44 Defa:
45 R@Gd,Q:
46 DefaultGroupNameY@JM,1:
47 X@Jt,I:
48
49
50 [Components]
51 1S@Kd,e:
52
53
54 [Dirs]
55 Name: {app}\bin
56
57
58 [Files]
59 1i@Mc,G:
60
61
62 [Registry]
63 Q@Mc,2H@Ow,2:
64 _~AvY;:
65 R@Gd,Q:
66 DefaultGrou
--- a/setup/fossil.nsi
+++ b/setup/fossil.nsi
@@ -27,7 +27,7 @@
2727
Section "Fossil (required)"
2828
; Set output path to the installation directory.
2929
SetOutPath $INSTDIR
30
- ; Put file there
30
+ ; Put file there
3131
File "..\fossil.exe"
3232
; Write the installation path into the registry
3333
WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
--- a/setup/fossil.nsi
+++ b/setup/fossil.nsi
@@ -27,7 +27,7 @@
27 Section "Fossil (required)"
28 ; Set output path to the installation directory.
29 SetOutPath $INSTDIR
30 ; Put file there
31 File "..\fossil.exe"
32 ; Write the installation path into the registry
33 WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
--- a/setup/fossil.nsi
+++ b/setup/fossil.nsi
@@ -27,7 +27,7 @@
27 Section "Fossil (required)"
28 ; Set output path to the installation directory.
29 SetOutPath $INSTDIR
30 ; Put file there
31 File "..\fossil.exe"
32 ; Write the installation path into the registry
33 WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
--- a/setup/fossil.nsi
+++ b/setup/fossil.nsi
@@ -0,0 +1,55 @@
1
+; example2.nsi
2
+;
3
+; This script is based on example1.nsi, but adds uninstall support
4
+; and (optionally) start menu shortcuts.
5
+;
6
+; It will install notepad.exe into a directory that the user selects,
7
+;
8
+
9
+; The name of the installer
10
+Name "Fossil"
11
+
12
+; The file to write
13
+OutFile "fossil-setup.exe"
14
+
15
+; The default installation directory
16
+InstallDir $PROGRAMFILES\Fossil
17
+; Registry key to check for directory (so if you install again, it will
18
+; overwrite the old one automatically)
19
+InstallDirRegKey HKLM SOFTWARE\Fossil "Install_Dir"
20
+
21
+; The text to prompt the user to enter a directory
22
+ComponentText "This will install fossil on your computer."
23
+; The text to prompt the user to enter a directory
24
+DirText "Choose a directory to install in to:"
25
+
26
+; The stuff to install
27
+Section "Fossil (required)"
28
+ ; Set output path to the installation directory.
29
+ SetOutPath $INSTDIR
30
+ ; Put file there
31
+ File "..\fossil.exe"
32
+ ; Write the installation path into the registry
33
+ WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
34
+ ; Write the uninstall keys for Windows
35
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "DisplayName" "Fossil (remove only)"
36
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "UninstallString" '"$INSTDIR\uninstall.exe"'
37
+ WriteUninstaller "uninstall.exe"
38
+SectionEnd
39
+
40
+
41
+; uninstall stuff
42
+
43
+UninstallText "This will uninstall fossil. Hit next to continue."
44
+
45
+; special uninstall section.
46
+Section "Uninstall"
47
+ ; remove registry keys
48
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil"
49
+ DeleteRegKey HKLM SOFTWARE\Fossil
50
+ ; remove files
51
+ Delete $INSTDIR\fossil.exe
52
+ ; MUST REMOVE UNINSTALLER, too
53
+ Delete $INSTDIR\uninstall.exe
54
+ ; remove shortcuts, if any.
55
+ RMDir "$SM
--- a/setup/fossil.nsi
+++ b/setup/fossil.nsi
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/setup/fossil.nsi
+++ b/setup/fossil.nsi
@@ -0,0 +1,55 @@
1 ; example2.nsi
2 ;
3 ; This script is based on example1.nsi, but adds uninstall support
4 ; and (optionally) start menu shortcuts.
5 ;
6 ; It will install notepad.exe into a directory that the user selects,
7 ;
8
9 ; The name of the installer
10 Name "Fossil"
11
12 ; The file to write
13 OutFile "fossil-setup.exe"
14
15 ; The default installation directory
16 InstallDir $PROGRAMFILES\Fossil
17 ; Registry key to check for directory (so if you install again, it will
18 ; overwrite the old one automatically)
19 InstallDirRegKey HKLM SOFTWARE\Fossil "Install_Dir"
20
21 ; The text to prompt the user to enter a directory
22 ComponentText "This will install fossil on your computer."
23 ; The text to prompt the user to enter a directory
24 DirText "Choose a directory to install in to:"
25
26 ; The stuff to install
27 Section "Fossil (required)"
28 ; Set output path to the installation directory.
29 SetOutPath $INSTDIR
30 ; Put file there
31 File "..\fossil.exe"
32 ; Write the installation path into the registry
33 WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
34 ; Write the uninstall keys for Windows
35 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "DisplayName" "Fossil (remove only)"
36 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "UninstallString" '"$INSTDIR\uninstall.exe"'
37 WriteUninstaller "uninstall.exe"
38 SectionEnd
39
40
41 ; uninstall stuff
42
43 UninstallText "This will uninstall fossil. Hit next to continue."
44
45 ; special uninstall section.
46 Section "Uninstall"
47 ; remove registry keys
48 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil"
49 DeleteRegKey HKLM SOFTWARE\Fossil
50 ; remove files
51 Delete $INSTDIR\fossil.exe
52 ; MUST REMOVE UNINSTALLER, too
53 Delete $INSTDIR\uninstall.exe
54 ; remove shortcuts, if any.
55 RMDir "$SM
+32 -2
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
2525
#include "cygsup.h"
2626
2727
/*
2828
** This routine returns the names of files in a working checkout that
2929
** are created by Fossil itself, and hence should not be added, deleted,
30
-** or merge, and should be omitted from "clean" and "extra" lists.
30
+** or merge, and should be omitted from "clean" and "extras" lists.
3131
**
3232
** Return the N-th name. The first name has N==0. When all names have
3333
** been used, return 0.
3434
*/
3535
const char *fossil_reserved_name(int N, int omitRepo){
@@ -221,19 +221,24 @@
221221
** The --ignore and --clean options are comma-separate lists of glob patterns
222222
** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore
223223
** option does not appear on the command line then the "ignore-glob" setting
224224
** is used. If the --clean option does not appear on the command line then
225225
** the "clean-glob" setting is used.
226
+**
227
+** If files are attempted to be added explicitly on the command line which
228
+** match "ignore-glob", a confirmation is asked first. This can be prevented
229
+** using the -f|--force option.
226230
**
227231
** The --case-sensitive option determines whether or not filenames should
228232
** be treated case sensitive or not. If the option is not given, the default
229233
** depends on the global setting, or the operating system default, if not set.
230234
**
231235
** Options:
232236
**
233237
** --case-sensitive <BOOL> override case-sensitive setting
234238
** --dotfiles include files beginning with a dot (".")
239
+** -f|--force Add files without prompting
235240
** --ignore <CSG> ignore files matching patterns from the
236241
** comma separated list of glob patterns.
237242
** --clean <CSG> also ignore files matching patterns from
238243
** the comma separated list of glob patterns.
239244
**
@@ -245,13 +250,15 @@
245250
int nRoot; /* Full path characters in g.zLocalRoot */
246251
const char *zCleanFlag; /* The --clean option or clean-glob setting */
247252
const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */
248253
Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */
249254
unsigned scanFlags = 0; /* Flags passed to vfile_scan() */
255
+ int forceFlag;
250256
251257
zCleanFlag = find_option("clean",0,1);
252258
zIgnoreFlag = find_option("ignore",0,1);
259
+ forceFlag = find_option("force","f",0)!=0;
253260
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
254261
capture_case_sensitive_option();
255262
db_must_be_within_tree();
256263
if( zCleanFlag==0 ){
257264
zCleanFlag = db_get("clean-glob", 0);
@@ -287,10 +294,25 @@
287294
fossil_warning("not found: %s", zName);
288295
}else if( file_access(zName, R_OK) ){
289296
fossil_fatal("cannot open %s", zName);
290297
}else{
291298
char *zTreeName = &zName[nRoot];
299
+ if( !forceFlag && glob_match(pIgnore, zTreeName) ){
300
+ Blob ans;
301
+ char cReply;
302
+ char *prompt = mprintf("file \"%s\" matches \"ignore-glob\". "
303
+ "Add it (a=all/y/N)? ", zTreeName);
304
+ prompt_user(prompt, &ans);
305
+ cReply = blob_str(&ans)[0];
306
+ blob_reset(&ans);
307
+ if( cReply=='a' || cReply=='A' ){
308
+ forceFlag = 1;
309
+ }else if( cReply!='y' && cReply!='Y' ){
310
+ blob_reset(&fullName);
311
+ continue;
312
+ }
313
+ }
292314
db_multi_exec(
293315
"INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
294316
zTreeName
295317
);
296318
}
@@ -439,11 +461,11 @@
439461
**
440462
** Do all necessary "add" and "rm" commands to synchronize the repository
441463
** with the content of the working checkout:
442464
**
443465
** * All files in the checkout but not in the repository (that is,
444
-** all files displayed using the "extra" command) are added as
466
+** all files displayed using the "extras" command) are added as
445467
** if by the "add" command.
446468
**
447469
** * All files in the repository but missing from the checkout (that is,
448470
** all files that show as MISSING with the "status" command) are
449471
** removed as if by the "rm" command.
@@ -670,5 +692,13 @@
670692
mv_one_file(vid, zFrom, zTo);
671693
}
672694
db_finalize(&q);
673695
db_end_transaction(0);
674696
}
697
+
698
+/*
699
+** Function for stash_apply to be able to restore a file and indicate
700
+** newly ADDED state.
701
+*/
702
+int stash_add_files_in_sfile(int vid){
703
+ return add_files_in_sfile(vid);
704
+}
675705
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
25 #include "cygsup.h"
26
27 /*
28 ** This routine returns the names of files in a working checkout that
29 ** are created by Fossil itself, and hence should not be added, deleted,
30 ** or merge, and should be omitted from "clean" and "extra" lists.
31 **
32 ** Return the N-th name. The first name has N==0. When all names have
33 ** been used, return 0.
34 */
35 const char *fossil_reserved_name(int N, int omitRepo){
@@ -221,19 +221,24 @@
221 ** The --ignore and --clean options are comma-separate lists of glob patterns
222 ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore
223 ** option does not appear on the command line then the "ignore-glob" setting
224 ** is used. If the --clean option does not appear on the command line then
225 ** the "clean-glob" setting is used.
 
 
 
 
226 **
227 ** The --case-sensitive option determines whether or not filenames should
228 ** be treated case sensitive or not. If the option is not given, the default
229 ** depends on the global setting, or the operating system default, if not set.
230 **
231 ** Options:
232 **
233 ** --case-sensitive <BOOL> override case-sensitive setting
234 ** --dotfiles include files beginning with a dot (".")
 
235 ** --ignore <CSG> ignore files matching patterns from the
236 ** comma separated list of glob patterns.
237 ** --clean <CSG> also ignore files matching patterns from
238 ** the comma separated list of glob patterns.
239 **
@@ -245,13 +250,15 @@
245 int nRoot; /* Full path characters in g.zLocalRoot */
246 const char *zCleanFlag; /* The --clean option or clean-glob setting */
247 const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */
248 Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */
249 unsigned scanFlags = 0; /* Flags passed to vfile_scan() */
 
250
251 zCleanFlag = find_option("clean",0,1);
252 zIgnoreFlag = find_option("ignore",0,1);
 
253 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
254 capture_case_sensitive_option();
255 db_must_be_within_tree();
256 if( zCleanFlag==0 ){
257 zCleanFlag = db_get("clean-glob", 0);
@@ -287,10 +294,25 @@
287 fossil_warning("not found: %s", zName);
288 }else if( file_access(zName, R_OK) ){
289 fossil_fatal("cannot open %s", zName);
290 }else{
291 char *zTreeName = &zName[nRoot];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292 db_multi_exec(
293 "INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
294 zTreeName
295 );
296 }
@@ -439,11 +461,11 @@
439 **
440 ** Do all necessary "add" and "rm" commands to synchronize the repository
441 ** with the content of the working checkout:
442 **
443 ** * All files in the checkout but not in the repository (that is,
444 ** all files displayed using the "extra" command) are added as
445 ** if by the "add" command.
446 **
447 ** * All files in the repository but missing from the checkout (that is,
448 ** all files that show as MISSING with the "status" command) are
449 ** removed as if by the "rm" command.
@@ -670,5 +692,13 @@
670 mv_one_file(vid, zFrom, zTo);
671 }
672 db_finalize(&q);
673 db_end_transaction(0);
674 }
 
 
 
 
 
 
 
 
675
--- src/add.c
+++ src/add.c
@@ -25,11 +25,11 @@
25 #include "cygsup.h"
26
27 /*
28 ** This routine returns the names of files in a working checkout that
29 ** are created by Fossil itself, and hence should not be added, deleted,
30 ** or merge, and should be omitted from "clean" and "extras" lists.
31 **
32 ** Return the N-th name. The first name has N==0. When all names have
33 ** been used, return 0.
34 */
35 const char *fossil_reserved_name(int N, int omitRepo){
@@ -221,19 +221,24 @@
221 ** The --ignore and --clean options are comma-separate lists of glob patterns
222 ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore
223 ** option does not appear on the command line then the "ignore-glob" setting
224 ** is used. If the --clean option does not appear on the command line then
225 ** the "clean-glob" setting is used.
226 **
227 ** If files are attempted to be added explicitly on the command line which
228 ** match "ignore-glob", a confirmation is asked first. This can be prevented
229 ** using the -f|--force option.
230 **
231 ** The --case-sensitive option determines whether or not filenames should
232 ** be treated case sensitive or not. If the option is not given, the default
233 ** depends on the global setting, or the operating system default, if not set.
234 **
235 ** Options:
236 **
237 ** --case-sensitive <BOOL> override case-sensitive setting
238 ** --dotfiles include files beginning with a dot (".")
239 ** -f|--force Add files without prompting
240 ** --ignore <CSG> ignore files matching patterns from the
241 ** comma separated list of glob patterns.
242 ** --clean <CSG> also ignore files matching patterns from
243 ** the comma separated list of glob patterns.
244 **
@@ -245,13 +250,15 @@
250 int nRoot; /* Full path characters in g.zLocalRoot */
251 const char *zCleanFlag; /* The --clean option or clean-glob setting */
252 const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */
253 Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */
254 unsigned scanFlags = 0; /* Flags passed to vfile_scan() */
255 int forceFlag;
256
257 zCleanFlag = find_option("clean",0,1);
258 zIgnoreFlag = find_option("ignore",0,1);
259 forceFlag = find_option("force","f",0)!=0;
260 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
261 capture_case_sensitive_option();
262 db_must_be_within_tree();
263 if( zCleanFlag==0 ){
264 zCleanFlag = db_get("clean-glob", 0);
@@ -287,10 +294,25 @@
294 fossil_warning("not found: %s", zName);
295 }else if( file_access(zName, R_OK) ){
296 fossil_fatal("cannot open %s", zName);
297 }else{
298 char *zTreeName = &zName[nRoot];
299 if( !forceFlag && glob_match(pIgnore, zTreeName) ){
300 Blob ans;
301 char cReply;
302 char *prompt = mprintf("file \"%s\" matches \"ignore-glob\". "
303 "Add it (a=all/y/N)? ", zTreeName);
304 prompt_user(prompt, &ans);
305 cReply = blob_str(&ans)[0];
306 blob_reset(&ans);
307 if( cReply=='a' || cReply=='A' ){
308 forceFlag = 1;
309 }else if( cReply!='y' && cReply!='Y' ){
310 blob_reset(&fullName);
311 continue;
312 }
313 }
314 db_multi_exec(
315 "INSERT OR IGNORE INTO sfile(x) VALUES(%Q)",
316 zTreeName
317 );
318 }
@@ -439,11 +461,11 @@
461 **
462 ** Do all necessary "add" and "rm" commands to synchronize the repository
463 ** with the content of the working checkout:
464 **
465 ** * All files in the checkout but not in the repository (that is,
466 ** all files displayed using the "extras" command) are added as
467 ** if by the "add" command.
468 **
469 ** * All files in the repository but missing from the checkout (that is,
470 ** all files that show as MISSING with the "status" command) are
471 ** removed as if by the "rm" command.
@@ -670,5 +692,13 @@
692 mv_one_file(vid, zFrom, zTo);
693 }
694 db_finalize(&q);
695 db_end_transaction(0);
696 }
697
698 /*
699 ** Function for stash_apply to be able to restore a file and indicate
700 ** newly ADDED state.
701 */
702 int stash_add_files_in_sfile(int vid){
703 return add_files_in_sfile(vid);
704 }
705
+56 -13
--- src/allrepo.c
+++ src/allrepo.c
@@ -65,16 +65,22 @@
6565
}else{
6666
blob_appendf(pExtra, " --%s \"\"", zArg);
6767
}
6868
}
6969
}
70
+static void collect_argv(Blob *pExtra, int iStart){
71
+ int i;
72
+ for(i=iStart; i<g.argc; i++){
73
+ blob_appendf(pExtra, " %s", g.argv[i]);
74
+ }
75
+}
7076
7177
7278
/*
7379
** COMMAND: all
7480
**
75
-** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
81
+** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync)
7682
**
7783
** The ~/.fossil file records the location of all repositories for a
7884
** user. This command performs certain operations on all repositories
7985
** that can be useful before or after a period of disconnected operation.
8086
**
@@ -93,18 +99,20 @@
9399
** and the --whatif option to carefully review the files to
94100
** be deleted beforehand is highly recommended. The command
95101
** line options supported by the clean command itself, if any
96102
** are present, are passed along verbatim.
97103
**
98
-** extra Shows extra files from all local checkouts. The command
104
+** extras Shows "extra" files from all local checkouts. The command
99105
** line options supported by the extra command itself, if any
100106
** are present, are passed along verbatim.
101107
**
102108
** ignore Arguments are repositories that should be ignored by
103
-** subsequent clean, extra, list, pull, push, rebuild, and
109
+** subsequent clean, extras, list, pull, push, rebuild, and
104110
** sync operations. The -c|--ckout option causes the listed
105111
** local checkouts to be ignored instead.
112
+**
113
+** info Run the "info" command on all repositories.
106114
**
107115
** list | ls Display the location of all repositories. The -c|--ckout
108116
** option causes all local checkouts to be listed instead.
109117
**
110118
** pull Run a "pull" operation on all repositories. Only the
@@ -118,17 +126,23 @@
118126
** present, are passed along verbatim. The --force and
119127
** --randomize options are not supported.
120128
**
121129
** sync Run a "sync" on all repositories. Only the --verbose
122130
** option is supported.
131
+**
132
+** setting Run the "setting", "set", or "unset" commands on all
133
+** set repositories. These command are particularly useful in
134
+** unset conjunection with the "max-loadavg" setting which cannot
135
+** otherwise be set globally.
123136
**
124137
** Repositories are automatically added to the set of known repositories
125138
** when one of the following commands are run against the repository:
126139
** clone, info, pull, push, or sync. Even previously ignored repositories
127140
** are added back to the list of repositories by these commands.
128141
**
129142
** Options:
143
+** --showfile Show the repository or checkout being operated upon.
130144
** --dontstop Continue with other repositories even after an error.
131145
** --dry-run If given, display instead of run actions.
132146
*/
133147
void all_cmd(void){
134148
int n;
@@ -139,27 +153,29 @@
139153
char *zQFilename;
140154
Blob extra;
141155
int useCheckouts = 0;
142156
int quiet = 0;
143157
int dryRunFlag = 0;
158
+ int showFile = find_option("showfile",0,0)!=0;
144159
int stopOnError = find_option("dontstop",0,0)==0;
145160
int rc;
146161
int nToDel = 0;
147
-
162
+ int showLabel = 0;
163
+
148164
dryRunFlag = find_option("dry-run","n",0)!=0;
149165
if( !dryRunFlag ){
150166
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
151167
}
152168
153169
if( g.argc<3 ){
154
- usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
170
+ usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync");
155171
}
156172
n = strlen(g.argv[2]);
157173
db_open_config(1);
158174
blob_zero(&extra);
159175
zCmd = g.argv[2];
160
- if( g.zLogin ) blob_appendf(&extra, " -U %s", g.zLogin);
176
+ if( !login_is_nobody() ) blob_appendf(&extra, " -U %s", g.zLogin);
161177
if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
162178
zCmd = "list";
163179
useCheckouts = find_option("ckout","c",0)!=0;
164180
}else if( strncmp(zCmd, "clean", n)==0 ){
165181
zCmd = "clean --chdir";
@@ -174,12 +190,16 @@
174190
collect_argument_value(&extra, "keep");
175191
collect_argument(&extra, "temp",0);
176192
collect_argument(&extra, "verbose","v");
177193
collect_argument(&extra, "whatif",0);
178194
useCheckouts = 1;
179
- }else if( strncmp(zCmd, "extra", n)==0 ){
180
- zCmd = "extra --chdir";
195
+ }else if( strncmp(zCmd, "extras", n)==0 ){
196
+ if( showFile ){
197
+ zCmd = "extras --chdir";
198
+ }else{
199
+ zCmd = "extras --header --chdir";
200
+ }
181201
collect_argument(&extra, "abs-paths",0);
182202
collect_argument_value(&extra, "case-sensitive");
183203
collect_argument(&extra, "dotfiles",0);
184204
collect_argument_value(&extra, "ignore");
185205
collect_argument(&extra, "rel-paths",0);
@@ -201,10 +221,16 @@
201221
collect_argument(&extra, "vacuum",0);
202222
collect_argument(&extra, "deanalyze",0);
203223
collect_argument(&extra, "analyze",0);
204224
collect_argument(&extra, "wal",0);
205225
collect_argument(&extra, "stats",0);
226
+ }else if( strncmp(zCmd, "setting", n)==0 ){
227
+ zCmd = "setting -R";
228
+ collect_argv(&extra, 3);
229
+ }else if( strncmp(zCmd, "unset", n)==0 ){
230
+ zCmd = "unset -R";
231
+ collect_argv(&extra, 3);
206232
}else if( strncmp(zCmd, "sync", n)==0 ){
207233
zCmd = "sync -autourl -R";
208234
collect_argument(&extra, "verbose","v");
209235
}else if( strncmp(zCmd, "test-integrity", n)==0 ){
210236
collect_argument(&extra, "parse", 0);
@@ -235,35 +261,43 @@
235261
}
236262
fossil_free(zSql);
237263
}
238264
db_end_transaction(0);
239265
return;
266
+ }else if( strncmp(zCmd, "info", n)==0 ){
267
+ zCmd = "info";
268
+ showLabel = 1;
269
+ quiet = 1;
240270
}else{
241271
fossil_fatal("\"all\" subcommand should be one of: "
242
- "changes clean extra ignore list ls push pull rebuild sync");
272
+ "changes clean extras ignore list ls push pull rebuild sync");
243273
}
244274
verify_all_options();
245275
zFossil = quoteFilename(g.nameOfExe);
276
+ db_multi_exec("CREATE TEMP TABLE repolist(name,tag);");
246277
if( useCheckouts ){
247
- db_prepare(&q,
278
+ db_multi_exec(
279
+ "INSERT INTO repolist "
248280
"SELECT DISTINCT substr(name, 7), name COLLATE nocase"
249281
" FROM global_config"
250282
" WHERE substr(name, 1, 6)=='ckout:'"
251283
" ORDER BY 1"
252284
);
253285
}else{
254
- db_prepare(&q,
286
+ db_multi_exec(
287
+ "INSERT INTO repolist "
255288
"SELECT DISTINCT substr(name, 6), name COLLATE nocase"
256289
" FROM global_config"
257290
" WHERE substr(name, 1, 5)=='repo:'"
258291
" ORDER BY 1"
259292
);
260293
}
261294
db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
295
+ db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1");
262296
while( db_step(&q)==SQLITE_ROW ){
263297
const char *zFilename = db_column_text(&q, 0);
264
- if( file_access(zFilename, 0)
298
+ if( file_access(zFilename, F_OK)
265299
|| !file_is_canonical(zFilename)
266300
|| (useCheckouts && file_isdir(zFilename)!=1)
267301
){
268302
db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
269303
nToDel++;
@@ -270,14 +304,23 @@
270304
continue;
271305
}
272306
if( zCmd[0]=='l' ){
273307
fossil_print("%s\n", zFilename);
274308
continue;
309
+ }else if( showFile ){
310
+ fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository",
311
+ zFilename);
275312
}
276313
zQFilename = quoteFilename(zFilename);
277314
zSyscmd = mprintf("%s %s %s%s",
278315
zFossil, zCmd, zQFilename, blob_str(&extra));
316
+ if( showLabel ){
317
+ int len = (int)strlen(zFilename);
318
+ int nStar = 80 - (len + 15);
319
+ if( nStar<2 ) nStar = 1;
320
+ fossil_print("%.13c %s %.*c\n", '*', zFilename, nStar, '*');
321
+ }
279322
if( !quiet || dryRunFlag ){
280323
fossil_print("%s\n", zSyscmd);
281324
fflush(stdout);
282325
}
283326
rc = dryRunFlag ? 0 : fossil_system(zSyscmd);
@@ -286,11 +329,11 @@
286329
if( stopOnError && rc ){
287330
break;
288331
}
289332
}
290333
db_finalize(&q);
291
-
334
+
292335
/* If any repositories whose names appear in the ~/.fossil file could not
293336
** be found, remove those names from the ~/.fossil file.
294337
*/
295338
if( nToDel>0 ){
296339
const char *zSql = "DELETE FROM global_config WHERE name IN toDel";
297340
--- src/allrepo.c
+++ src/allrepo.c
@@ -65,16 +65,22 @@
65 }else{
66 blob_appendf(pExtra, " --%s \"\"", zArg);
67 }
68 }
69 }
 
 
 
 
 
 
70
71
72 /*
73 ** COMMAND: all
74 **
75 ** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync)
76 **
77 ** The ~/.fossil file records the location of all repositories for a
78 ** user. This command performs certain operations on all repositories
79 ** that can be useful before or after a period of disconnected operation.
80 **
@@ -93,18 +99,20 @@
93 ** and the --whatif option to carefully review the files to
94 ** be deleted beforehand is highly recommended. The command
95 ** line options supported by the clean command itself, if any
96 ** are present, are passed along verbatim.
97 **
98 ** extra Shows extra files from all local checkouts. The command
99 ** line options supported by the extra command itself, if any
100 ** are present, are passed along verbatim.
101 **
102 ** ignore Arguments are repositories that should be ignored by
103 ** subsequent clean, extra, list, pull, push, rebuild, and
104 ** sync operations. The -c|--ckout option causes the listed
105 ** local checkouts to be ignored instead.
 
 
106 **
107 ** list | ls Display the location of all repositories. The -c|--ckout
108 ** option causes all local checkouts to be listed instead.
109 **
110 ** pull Run a "pull" operation on all repositories. Only the
@@ -118,17 +126,23 @@
118 ** present, are passed along verbatim. The --force and
119 ** --randomize options are not supported.
120 **
121 ** sync Run a "sync" on all repositories. Only the --verbose
122 ** option is supported.
 
 
 
 
 
123 **
124 ** Repositories are automatically added to the set of known repositories
125 ** when one of the following commands are run against the repository:
126 ** clone, info, pull, push, or sync. Even previously ignored repositories
127 ** are added back to the list of repositories by these commands.
128 **
129 ** Options:
 
130 ** --dontstop Continue with other repositories even after an error.
131 ** --dry-run If given, display instead of run actions.
132 */
133 void all_cmd(void){
134 int n;
@@ -139,27 +153,29 @@
139 char *zQFilename;
140 Blob extra;
141 int useCheckouts = 0;
142 int quiet = 0;
143 int dryRunFlag = 0;
 
144 int stopOnError = find_option("dontstop",0,0)==0;
145 int rc;
146 int nToDel = 0;
147
 
148 dryRunFlag = find_option("dry-run","n",0)!=0;
149 if( !dryRunFlag ){
150 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
151 }
152
153 if( g.argc<3 ){
154 usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync");
155 }
156 n = strlen(g.argv[2]);
157 db_open_config(1);
158 blob_zero(&extra);
159 zCmd = g.argv[2];
160 if( g.zLogin ) blob_appendf(&extra, " -U %s", g.zLogin);
161 if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
162 zCmd = "list";
163 useCheckouts = find_option("ckout","c",0)!=0;
164 }else if( strncmp(zCmd, "clean", n)==0 ){
165 zCmd = "clean --chdir";
@@ -174,12 +190,16 @@
174 collect_argument_value(&extra, "keep");
175 collect_argument(&extra, "temp",0);
176 collect_argument(&extra, "verbose","v");
177 collect_argument(&extra, "whatif",0);
178 useCheckouts = 1;
179 }else if( strncmp(zCmd, "extra", n)==0 ){
180 zCmd = "extra --chdir";
 
 
 
 
181 collect_argument(&extra, "abs-paths",0);
182 collect_argument_value(&extra, "case-sensitive");
183 collect_argument(&extra, "dotfiles",0);
184 collect_argument_value(&extra, "ignore");
185 collect_argument(&extra, "rel-paths",0);
@@ -201,10 +221,16 @@
201 collect_argument(&extra, "vacuum",0);
202 collect_argument(&extra, "deanalyze",0);
203 collect_argument(&extra, "analyze",0);
204 collect_argument(&extra, "wal",0);
205 collect_argument(&extra, "stats",0);
 
 
 
 
 
 
206 }else if( strncmp(zCmd, "sync", n)==0 ){
207 zCmd = "sync -autourl -R";
208 collect_argument(&extra, "verbose","v");
209 }else if( strncmp(zCmd, "test-integrity", n)==0 ){
210 collect_argument(&extra, "parse", 0);
@@ -235,35 +261,43 @@
235 }
236 fossil_free(zSql);
237 }
238 db_end_transaction(0);
239 return;
 
 
 
 
240 }else{
241 fossil_fatal("\"all\" subcommand should be one of: "
242 "changes clean extra ignore list ls push pull rebuild sync");
243 }
244 verify_all_options();
245 zFossil = quoteFilename(g.nameOfExe);
 
246 if( useCheckouts ){
247 db_prepare(&q,
 
248 "SELECT DISTINCT substr(name, 7), name COLLATE nocase"
249 " FROM global_config"
250 " WHERE substr(name, 1, 6)=='ckout:'"
251 " ORDER BY 1"
252 );
253 }else{
254 db_prepare(&q,
 
255 "SELECT DISTINCT substr(name, 6), name COLLATE nocase"
256 " FROM global_config"
257 " WHERE substr(name, 1, 5)=='repo:'"
258 " ORDER BY 1"
259 );
260 }
261 db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
 
262 while( db_step(&q)==SQLITE_ROW ){
263 const char *zFilename = db_column_text(&q, 0);
264 if( file_access(zFilename, 0)
265 || !file_is_canonical(zFilename)
266 || (useCheckouts && file_isdir(zFilename)!=1)
267 ){
268 db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
269 nToDel++;
@@ -270,14 +304,23 @@
270 continue;
271 }
272 if( zCmd[0]=='l' ){
273 fossil_print("%s\n", zFilename);
274 continue;
 
 
 
275 }
276 zQFilename = quoteFilename(zFilename);
277 zSyscmd = mprintf("%s %s %s%s",
278 zFossil, zCmd, zQFilename, blob_str(&extra));
 
 
 
 
 
 
279 if( !quiet || dryRunFlag ){
280 fossil_print("%s\n", zSyscmd);
281 fflush(stdout);
282 }
283 rc = dryRunFlag ? 0 : fossil_system(zSyscmd);
@@ -286,11 +329,11 @@
286 if( stopOnError && rc ){
287 break;
288 }
289 }
290 db_finalize(&q);
291
292 /* If any repositories whose names appear in the ~/.fossil file could not
293 ** be found, remove those names from the ~/.fossil file.
294 */
295 if( nToDel>0 ){
296 const char *zSql = "DELETE FROM global_config WHERE name IN toDel";
297
--- src/allrepo.c
+++ src/allrepo.c
@@ -65,16 +65,22 @@
65 }else{
66 blob_appendf(pExtra, " --%s \"\"", zArg);
67 }
68 }
69 }
70 static void collect_argv(Blob *pExtra, int iStart){
71 int i;
72 for(i=iStart; i<g.argc; i++){
73 blob_appendf(pExtra, " %s", g.argv[i]);
74 }
75 }
76
77
78 /*
79 ** COMMAND: all
80 **
81 ** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync)
82 **
83 ** The ~/.fossil file records the location of all repositories for a
84 ** user. This command performs certain operations on all repositories
85 ** that can be useful before or after a period of disconnected operation.
86 **
@@ -93,18 +99,20 @@
99 ** and the --whatif option to carefully review the files to
100 ** be deleted beforehand is highly recommended. The command
101 ** line options supported by the clean command itself, if any
102 ** are present, are passed along verbatim.
103 **
104 ** extras Shows "extra" files from all local checkouts. The command
105 ** line options supported by the extra command itself, if any
106 ** are present, are passed along verbatim.
107 **
108 ** ignore Arguments are repositories that should be ignored by
109 ** subsequent clean, extras, list, pull, push, rebuild, and
110 ** sync operations. The -c|--ckout option causes the listed
111 ** local checkouts to be ignored instead.
112 **
113 ** info Run the "info" command on all repositories.
114 **
115 ** list | ls Display the location of all repositories. The -c|--ckout
116 ** option causes all local checkouts to be listed instead.
117 **
118 ** pull Run a "pull" operation on all repositories. Only the
@@ -118,17 +126,23 @@
126 ** present, are passed along verbatim. The --force and
127 ** --randomize options are not supported.
128 **
129 ** sync Run a "sync" on all repositories. Only the --verbose
130 ** option is supported.
131 **
132 ** setting Run the "setting", "set", or "unset" commands on all
133 ** set repositories. These command are particularly useful in
134 ** unset conjunection with the "max-loadavg" setting which cannot
135 ** otherwise be set globally.
136 **
137 ** Repositories are automatically added to the set of known repositories
138 ** when one of the following commands are run against the repository:
139 ** clone, info, pull, push, or sync. Even previously ignored repositories
140 ** are added back to the list of repositories by these commands.
141 **
142 ** Options:
143 ** --showfile Show the repository or checkout being operated upon.
144 ** --dontstop Continue with other repositories even after an error.
145 ** --dry-run If given, display instead of run actions.
146 */
147 void all_cmd(void){
148 int n;
@@ -139,27 +153,29 @@
153 char *zQFilename;
154 Blob extra;
155 int useCheckouts = 0;
156 int quiet = 0;
157 int dryRunFlag = 0;
158 int showFile = find_option("showfile",0,0)!=0;
159 int stopOnError = find_option("dontstop",0,0)==0;
160 int rc;
161 int nToDel = 0;
162 int showLabel = 0;
163
164 dryRunFlag = find_option("dry-run","n",0)!=0;
165 if( !dryRunFlag ){
166 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
167 }
168
169 if( g.argc<3 ){
170 usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync");
171 }
172 n = strlen(g.argv[2]);
173 db_open_config(1);
174 blob_zero(&extra);
175 zCmd = g.argv[2];
176 if( !login_is_nobody() ) blob_appendf(&extra, " -U %s", g.zLogin);
177 if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
178 zCmd = "list";
179 useCheckouts = find_option("ckout","c",0)!=0;
180 }else if( strncmp(zCmd, "clean", n)==0 ){
181 zCmd = "clean --chdir";
@@ -174,12 +190,16 @@
190 collect_argument_value(&extra, "keep");
191 collect_argument(&extra, "temp",0);
192 collect_argument(&extra, "verbose","v");
193 collect_argument(&extra, "whatif",0);
194 useCheckouts = 1;
195 }else if( strncmp(zCmd, "extras", n)==0 ){
196 if( showFile ){
197 zCmd = "extras --chdir";
198 }else{
199 zCmd = "extras --header --chdir";
200 }
201 collect_argument(&extra, "abs-paths",0);
202 collect_argument_value(&extra, "case-sensitive");
203 collect_argument(&extra, "dotfiles",0);
204 collect_argument_value(&extra, "ignore");
205 collect_argument(&extra, "rel-paths",0);
@@ -201,10 +221,16 @@
221 collect_argument(&extra, "vacuum",0);
222 collect_argument(&extra, "deanalyze",0);
223 collect_argument(&extra, "analyze",0);
224 collect_argument(&extra, "wal",0);
225 collect_argument(&extra, "stats",0);
226 }else if( strncmp(zCmd, "setting", n)==0 ){
227 zCmd = "setting -R";
228 collect_argv(&extra, 3);
229 }else if( strncmp(zCmd, "unset", n)==0 ){
230 zCmd = "unset -R";
231 collect_argv(&extra, 3);
232 }else if( strncmp(zCmd, "sync", n)==0 ){
233 zCmd = "sync -autourl -R";
234 collect_argument(&extra, "verbose","v");
235 }else if( strncmp(zCmd, "test-integrity", n)==0 ){
236 collect_argument(&extra, "parse", 0);
@@ -235,35 +261,43 @@
261 }
262 fossil_free(zSql);
263 }
264 db_end_transaction(0);
265 return;
266 }else if( strncmp(zCmd, "info", n)==0 ){
267 zCmd = "info";
268 showLabel = 1;
269 quiet = 1;
270 }else{
271 fossil_fatal("\"all\" subcommand should be one of: "
272 "changes clean extras ignore list ls push pull rebuild sync");
273 }
274 verify_all_options();
275 zFossil = quoteFilename(g.nameOfExe);
276 db_multi_exec("CREATE TEMP TABLE repolist(name,tag);");
277 if( useCheckouts ){
278 db_multi_exec(
279 "INSERT INTO repolist "
280 "SELECT DISTINCT substr(name, 7), name COLLATE nocase"
281 " FROM global_config"
282 " WHERE substr(name, 1, 6)=='ckout:'"
283 " ORDER BY 1"
284 );
285 }else{
286 db_multi_exec(
287 "INSERT INTO repolist "
288 "SELECT DISTINCT substr(name, 6), name COLLATE nocase"
289 " FROM global_config"
290 " WHERE substr(name, 1, 5)=='repo:'"
291 " ORDER BY 1"
292 );
293 }
294 db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
295 db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1");
296 while( db_step(&q)==SQLITE_ROW ){
297 const char *zFilename = db_column_text(&q, 0);
298 if( file_access(zFilename, F_OK)
299 || !file_is_canonical(zFilename)
300 || (useCheckouts && file_isdir(zFilename)!=1)
301 ){
302 db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
303 nToDel++;
@@ -270,14 +304,23 @@
304 continue;
305 }
306 if( zCmd[0]=='l' ){
307 fossil_print("%s\n", zFilename);
308 continue;
309 }else if( showFile ){
310 fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository",
311 zFilename);
312 }
313 zQFilename = quoteFilename(zFilename);
314 zSyscmd = mprintf("%s %s %s%s",
315 zFossil, zCmd, zQFilename, blob_str(&extra));
316 if( showLabel ){
317 int len = (int)strlen(zFilename);
318 int nStar = 80 - (len + 15);
319 if( nStar<2 ) nStar = 1;
320 fossil_print("%.13c %s %.*c\n", '*', zFilename, nStar, '*');
321 }
322 if( !quiet || dryRunFlag ){
323 fossil_print("%s\n", zSyscmd);
324 fflush(stdout);
325 }
326 rc = dryRunFlag ? 0 : fossil_system(zSyscmd);
@@ -286,11 +329,11 @@
329 if( stopOnError && rc ){
330 break;
331 }
332 }
333 db_finalize(&q);
334
335 /* If any repositories whose names appear in the ~/.fossil file could not
336 ** be found, remove those names from the ~/.fossil file.
337 */
338 if( nToDel>0 ){
339 const char *zSql = "DELETE FROM global_config WHERE name IN toDel";
340
+14 -14
--- src/attach.c
+++ src/attach.c
@@ -29,11 +29,11 @@
2929
**
3030
** List attachments.
3131
** Either one of tkt= or page= are supplied or neither. If neither
3232
** are given, all attachments are listed. If one is given, only
3333
** attachments for the designated ticket or wiki page are shown.
34
-** TICKETUUID must be complete
34
+** TICKETUUID must be complete
3535
*/
3636
void attachlist_page(void){
3737
const char *zPage = P("page");
3838
const char *zTkt = P("tkt");
3939
Blob sql;
@@ -53,11 +53,11 @@
5353
if( g.perm.RdWiki==0 ) login_needed();
5454
style_header("Attachments To %h", zPage);
5555
blob_appendf(&sql, " WHERE target=%Q", zPage);
5656
}else if( zTkt ){
5757
if( g.perm.RdTkt==0 ) login_needed();
58
- style_header("Attachments To Ticket %.10s", zTkt);
58
+ style_header("Attachments To Ticket %S", zTkt);
5959
blob_appendf(&sql, " WHERE target GLOB '%q*'", zTkt);
6060
}else{
6161
if( g.perm.RdTkt==0 && g.perm.RdWiki==0 ) login_needed();
6262
style_header("All Attachments");
6363
}
@@ -75,11 +75,11 @@
7575
int attachid = db_column_int(&q, 7);
7676
const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
7777
int i;
7878
char *zUrlTail;
7979
for(i=0; zFilename[i]; i++){
80
- if( zFilename[i]=='/' && zFilename[i+1]!=0 ){
80
+ if( zFilename[i]=='/' && zFilename[i+1]!=0 ){
8181
zFilename = &zFilename[i+1];
8282
i = -1;
8383
}
8484
}
8585
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
@@ -253,16 +253,16 @@
253253
zTargetType = mprintf("Wiki Page <a href=\"%s/wiki?name=%h\">%h</a>",
254254
g.zTop, zPage, zPage);
255255
}else{
256256
if( g.perm.ApndTkt==0 || g.perm.Attach==0 ) login_needed();
257257
if( !db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", zTkt) ){
258
- zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
258
+ zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
259259
" WHERE tagname GLOB 'tkt-%q*'", zTkt);
260260
if( zTkt==0 ) fossil_redirect_home();
261261
}
262262
zTarget = zTkt;
263
- zTargetType = mprintf("Ticket <a href=\"%s/tktview/%S\">%S</a>",
263
+ zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>",
264264
g.zTop, zTkt, zTkt);
265265
}
266266
if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop);
267267
if( P("cancel") ){
268268
cgi_redirect(zFrom);
@@ -309,11 +309,11 @@
309309
if( n>0 ){
310310
blob_appendf(&manifest, "C %#F\n", n, zComment);
311311
}
312312
zDate = date_in_standard_format("now");
313313
blob_appendf(&manifest, "D %s\n", zDate);
314
- blob_appendf(&manifest, "U %F\n", g.zLogin ? g.zLogin : "nobody");
314
+ blob_appendf(&manifest, "U %F\n", login_name());
315315
md5sum_blob(&manifest, &cksum);
316316
blob_appendf(&manifest, "Z %b\n", &cksum);
317317
attach_put(&manifest, rid, needModerator);
318318
assert( blob_is_reset(&manifest) );
319319
db_end_transaction(0);
@@ -427,11 +427,11 @@
427427
zFile += n;
428428
if( zFile[0]==0 ) zFile = "unknown";
429429
blob_appendf(&manifest, "A %F %F\n", zFile, zTarget);
430430
zDate = date_in_standard_format("now");
431431
blob_appendf(&manifest, "D %s\n", zDate);
432
- blob_appendf(&manifest, "U %F\n", g.zLogin ? g.zLogin : "nobody");
432
+ blob_appendf(&manifest, "U %F\n", login_name());
433433
md5sum_blob(&manifest, &cksum);
434434
blob_appendf(&manifest, "Z %b\n", &cksum);
435435
rid = content_put(&manifest);
436436
manifest_crosslink(rid, &manifest, MC_NONE);
437437
db_end_transaction(0);
@@ -445,11 +445,11 @@
445445
@ <p>Confirm you want to delete the attachment shown below.
446446
@ <input type="submit" name="confirm" value="Confirm">
447447
@ </form>
448448
}
449449
450
- isModerator = g.perm.Admin ||
450
+ isModerator = g.perm.Admin ||
451451
(zTktUuid && g.perm.ModTkt) ||
452452
(zWikiName && g.perm.ModWiki);
453453
if( isModerator && (zModAction = P("modaction"))!=0 ){
454454
if( strcmp(zModAction,"delete")==0 ){
455455
moderation_disapprove(rid);
@@ -463,11 +463,11 @@
463463
if( strcmp(zModAction,"approve")==0 ){
464464
moderation_approve(rid);
465465
}
466466
}
467467
style_header("Attachment Details");
468
- style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid);
468
+ style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid);
469469
470470
@ <div class="section">Overview</div>
471471
@ <p><table class="label-value">
472472
@ <tr><th>Artifact&nbsp;ID:</th>
473473
@ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a>
@@ -500,11 +500,11 @@
500500
if( g.perm.Setup ){
501501
@ <tr><th>MIME-Type:</th><td>%h(zMime)</td></tr>
502502
}
503503
@ <tr><th valign="top">Description:</th><td valign="top">%h(zDesc)</td></tr>
504504
@ </table>
505
-
505
+
506506
if( isModerator && modPending ){
507507
@ <div class="section">Moderation</div>
508508
@ <blockquote>
509509
form_begin(0, "%R/ainfo/%s", zUuid);
510510
@ <label><input type="radio" name="modaction" value="delete">
@@ -531,12 +531,12 @@
531531
@ <pre>
532532
@ %h(z)
533533
@ </pre>
534534
}
535535
}else if( strncmp(zMime, "image/", 6)==0 ){
536
- @ <img src="%R/raw/%S(zSrc)?m=%s(zMime)"></img>
537
- style_submenu_element("Image", "Image", "%R/raw/%S?m=%s", zSrc, zMime);
536
+ @ <img src="%R/raw/%s(zSrc)?m=%s(zMime)"></img>
537
+ style_submenu_element("Image", "Image", "%R/raw/%s?m=%s", zSrc, zMime);
538538
}else{
539539
int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
540540
@ <i>(file is %d(sz) bytes of binary data)</i>
541541
}
542542
@ </blockquote>
@@ -557,11 +557,11 @@
557557
db_prepare(&q,
558558
"SELECT datetime(mtime%s), filename, user,"
559559
" (SELECT uuid FROM blob WHERE rid=attachid), src"
560560
" FROM attachment"
561561
" WHERE isLatest AND src!='' AND target=%Q"
562
- " ORDER BY mtime DESC",
562
+ " ORDER BY mtime DESC",
563563
timeline_utc(), zTarget
564564
);
565565
while( db_step(&q)==SQLITE_ROW ){
566566
const char *zDate = db_column_text(&q, 0);
567567
const char *zFile = db_column_text(&q, 1);
@@ -582,7 +582,7 @@
582582
}
583583
if( cnt ){
584584
@ </ul>
585585
}
586586
db_finalize(&q);
587
-
587
+
588588
}
589589
--- src/attach.c
+++ src/attach.c
@@ -29,11 +29,11 @@
29 **
30 ** List attachments.
31 ** Either one of tkt= or page= are supplied or neither. If neither
32 ** are given, all attachments are listed. If one is given, only
33 ** attachments for the designated ticket or wiki page are shown.
34 ** TICKETUUID must be complete
35 */
36 void attachlist_page(void){
37 const char *zPage = P("page");
38 const char *zTkt = P("tkt");
39 Blob sql;
@@ -53,11 +53,11 @@
53 if( g.perm.RdWiki==0 ) login_needed();
54 style_header("Attachments To %h", zPage);
55 blob_appendf(&sql, " WHERE target=%Q", zPage);
56 }else if( zTkt ){
57 if( g.perm.RdTkt==0 ) login_needed();
58 style_header("Attachments To Ticket %.10s", zTkt);
59 blob_appendf(&sql, " WHERE target GLOB '%q*'", zTkt);
60 }else{
61 if( g.perm.RdTkt==0 && g.perm.RdWiki==0 ) login_needed();
62 style_header("All Attachments");
63 }
@@ -75,11 +75,11 @@
75 int attachid = db_column_int(&q, 7);
76 const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
77 int i;
78 char *zUrlTail;
79 for(i=0; zFilename[i]; i++){
80 if( zFilename[i]=='/' && zFilename[i+1]!=0 ){
81 zFilename = &zFilename[i+1];
82 i = -1;
83 }
84 }
85 if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
@@ -253,16 +253,16 @@
253 zTargetType = mprintf("Wiki Page <a href=\"%s/wiki?name=%h\">%h</a>",
254 g.zTop, zPage, zPage);
255 }else{
256 if( g.perm.ApndTkt==0 || g.perm.Attach==0 ) login_needed();
257 if( !db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", zTkt) ){
258 zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
259 " WHERE tagname GLOB 'tkt-%q*'", zTkt);
260 if( zTkt==0 ) fossil_redirect_home();
261 }
262 zTarget = zTkt;
263 zTargetType = mprintf("Ticket <a href=\"%s/tktview/%S\">%S</a>",
264 g.zTop, zTkt, zTkt);
265 }
266 if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop);
267 if( P("cancel") ){
268 cgi_redirect(zFrom);
@@ -309,11 +309,11 @@
309 if( n>0 ){
310 blob_appendf(&manifest, "C %#F\n", n, zComment);
311 }
312 zDate = date_in_standard_format("now");
313 blob_appendf(&manifest, "D %s\n", zDate);
314 blob_appendf(&manifest, "U %F\n", g.zLogin ? g.zLogin : "nobody");
315 md5sum_blob(&manifest, &cksum);
316 blob_appendf(&manifest, "Z %b\n", &cksum);
317 attach_put(&manifest, rid, needModerator);
318 assert( blob_is_reset(&manifest) );
319 db_end_transaction(0);
@@ -427,11 +427,11 @@
427 zFile += n;
428 if( zFile[0]==0 ) zFile = "unknown";
429 blob_appendf(&manifest, "A %F %F\n", zFile, zTarget);
430 zDate = date_in_standard_format("now");
431 blob_appendf(&manifest, "D %s\n", zDate);
432 blob_appendf(&manifest, "U %F\n", g.zLogin ? g.zLogin : "nobody");
433 md5sum_blob(&manifest, &cksum);
434 blob_appendf(&manifest, "Z %b\n", &cksum);
435 rid = content_put(&manifest);
436 manifest_crosslink(rid, &manifest, MC_NONE);
437 db_end_transaction(0);
@@ -445,11 +445,11 @@
445 @ <p>Confirm you want to delete the attachment shown below.
446 @ <input type="submit" name="confirm" value="Confirm">
447 @ </form>
448 }
449
450 isModerator = g.perm.Admin ||
451 (zTktUuid && g.perm.ModTkt) ||
452 (zWikiName && g.perm.ModWiki);
453 if( isModerator && (zModAction = P("modaction"))!=0 ){
454 if( strcmp(zModAction,"delete")==0 ){
455 moderation_disapprove(rid);
@@ -463,11 +463,11 @@
463 if( strcmp(zModAction,"approve")==0 ){
464 moderation_approve(rid);
465 }
466 }
467 style_header("Attachment Details");
468 style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid);
469
470 @ <div class="section">Overview</div>
471 @ <p><table class="label-value">
472 @ <tr><th>Artifact&nbsp;ID:</th>
473 @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a>
@@ -500,11 +500,11 @@
500 if( g.perm.Setup ){
501 @ <tr><th>MIME-Type:</th><td>%h(zMime)</td></tr>
502 }
503 @ <tr><th valign="top">Description:</th><td valign="top">%h(zDesc)</td></tr>
504 @ </table>
505
506 if( isModerator && modPending ){
507 @ <div class="section">Moderation</div>
508 @ <blockquote>
509 form_begin(0, "%R/ainfo/%s", zUuid);
510 @ <label><input type="radio" name="modaction" value="delete">
@@ -531,12 +531,12 @@
531 @ <pre>
532 @ %h(z)
533 @ </pre>
534 }
535 }else if( strncmp(zMime, "image/", 6)==0 ){
536 @ <img src="%R/raw/%S(zSrc)?m=%s(zMime)"></img>
537 style_submenu_element("Image", "Image", "%R/raw/%S?m=%s", zSrc, zMime);
538 }else{
539 int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
540 @ <i>(file is %d(sz) bytes of binary data)</i>
541 }
542 @ </blockquote>
@@ -557,11 +557,11 @@
557 db_prepare(&q,
558 "SELECT datetime(mtime%s), filename, user,"
559 " (SELECT uuid FROM blob WHERE rid=attachid), src"
560 " FROM attachment"
561 " WHERE isLatest AND src!='' AND target=%Q"
562 " ORDER BY mtime DESC",
563 timeline_utc(), zTarget
564 );
565 while( db_step(&q)==SQLITE_ROW ){
566 const char *zDate = db_column_text(&q, 0);
567 const char *zFile = db_column_text(&q, 1);
@@ -582,7 +582,7 @@
582 }
583 if( cnt ){
584 @ </ul>
585 }
586 db_finalize(&q);
587
588 }
589
--- src/attach.c
+++ src/attach.c
@@ -29,11 +29,11 @@
29 **
30 ** List attachments.
31 ** Either one of tkt= or page= are supplied or neither. If neither
32 ** are given, all attachments are listed. If one is given, only
33 ** attachments for the designated ticket or wiki page are shown.
34 ** TICKETUUID must be complete
35 */
36 void attachlist_page(void){
37 const char *zPage = P("page");
38 const char *zTkt = P("tkt");
39 Blob sql;
@@ -53,11 +53,11 @@
53 if( g.perm.RdWiki==0 ) login_needed();
54 style_header("Attachments To %h", zPage);
55 blob_appendf(&sql, " WHERE target=%Q", zPage);
56 }else if( zTkt ){
57 if( g.perm.RdTkt==0 ) login_needed();
58 style_header("Attachments To Ticket %S", zTkt);
59 blob_appendf(&sql, " WHERE target GLOB '%q*'", zTkt);
60 }else{
61 if( g.perm.RdTkt==0 && g.perm.RdWiki==0 ) login_needed();
62 style_header("All Attachments");
63 }
@@ -75,11 +75,11 @@
75 int attachid = db_column_int(&q, 7);
76 const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous";
77 int i;
78 char *zUrlTail;
79 for(i=0; zFilename[i]; i++){
80 if( zFilename[i]=='/' && zFilename[i+1]!=0 ){
81 zFilename = &zFilename[i+1];
82 i = -1;
83 }
84 }
85 if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
@@ -253,16 +253,16 @@
253 zTargetType = mprintf("Wiki Page <a href=\"%s/wiki?name=%h\">%h</a>",
254 g.zTop, zPage, zPage);
255 }else{
256 if( g.perm.ApndTkt==0 || g.perm.Attach==0 ) login_needed();
257 if( !db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", zTkt) ){
258 zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
259 " WHERE tagname GLOB 'tkt-%q*'", zTkt);
260 if( zTkt==0 ) fossil_redirect_home();
261 }
262 zTarget = zTkt;
263 zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>",
264 g.zTop, zTkt, zTkt);
265 }
266 if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop);
267 if( P("cancel") ){
268 cgi_redirect(zFrom);
@@ -309,11 +309,11 @@
309 if( n>0 ){
310 blob_appendf(&manifest, "C %#F\n", n, zComment);
311 }
312 zDate = date_in_standard_format("now");
313 blob_appendf(&manifest, "D %s\n", zDate);
314 blob_appendf(&manifest, "U %F\n", login_name());
315 md5sum_blob(&manifest, &cksum);
316 blob_appendf(&manifest, "Z %b\n", &cksum);
317 attach_put(&manifest, rid, needModerator);
318 assert( blob_is_reset(&manifest) );
319 db_end_transaction(0);
@@ -427,11 +427,11 @@
427 zFile += n;
428 if( zFile[0]==0 ) zFile = "unknown";
429 blob_appendf(&manifest, "A %F %F\n", zFile, zTarget);
430 zDate = date_in_standard_format("now");
431 blob_appendf(&manifest, "D %s\n", zDate);
432 blob_appendf(&manifest, "U %F\n", login_name());
433 md5sum_blob(&manifest, &cksum);
434 blob_appendf(&manifest, "Z %b\n", &cksum);
435 rid = content_put(&manifest);
436 manifest_crosslink(rid, &manifest, MC_NONE);
437 db_end_transaction(0);
@@ -445,11 +445,11 @@
445 @ <p>Confirm you want to delete the attachment shown below.
446 @ <input type="submit" name="confirm" value="Confirm">
447 @ </form>
448 }
449
450 isModerator = g.perm.Admin ||
451 (zTktUuid && g.perm.ModTkt) ||
452 (zWikiName && g.perm.ModWiki);
453 if( isModerator && (zModAction = P("modaction"))!=0 ){
454 if( strcmp(zModAction,"delete")==0 ){
455 moderation_disapprove(rid);
@@ -463,11 +463,11 @@
463 if( strcmp(zModAction,"approve")==0 ){
464 moderation_approve(rid);
465 }
466 }
467 style_header("Attachment Details");
468 style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid);
469
470 @ <div class="section">Overview</div>
471 @ <p><table class="label-value">
472 @ <tr><th>Artifact&nbsp;ID:</th>
473 @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a>
@@ -500,11 +500,11 @@
500 if( g.perm.Setup ){
501 @ <tr><th>MIME-Type:</th><td>%h(zMime)</td></tr>
502 }
503 @ <tr><th valign="top">Description:</th><td valign="top">%h(zDesc)</td></tr>
504 @ </table>
505
506 if( isModerator && modPending ){
507 @ <div class="section">Moderation</div>
508 @ <blockquote>
509 form_begin(0, "%R/ainfo/%s", zUuid);
510 @ <label><input type="radio" name="modaction" value="delete">
@@ -531,12 +531,12 @@
531 @ <pre>
532 @ %h(z)
533 @ </pre>
534 }
535 }else if( strncmp(zMime, "image/", 6)==0 ){
536 @ <img src="%R/raw/%s(zSrc)?m=%s(zMime)"></img>
537 style_submenu_element("Image", "Image", "%R/raw/%s?m=%s", zSrc, zMime);
538 }else{
539 int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
540 @ <i>(file is %d(sz) bytes of binary data)</i>
541 }
542 @ </blockquote>
@@ -557,11 +557,11 @@
557 db_prepare(&q,
558 "SELECT datetime(mtime%s), filename, user,"
559 " (SELECT uuid FROM blob WHERE rid=attachid), src"
560 " FROM attachment"
561 " WHERE isLatest AND src!='' AND target=%Q"
562 " ORDER BY mtime DESC",
563 timeline_utc(), zTarget
564 );
565 while( db_step(&q)==SQLITE_ROW ){
566 const char *zDate = db_column_text(&q, 0);
567 const char *zFile = db_column_text(&q, 1);
@@ -582,7 +582,7 @@
582 }
583 if( cnt ){
584 @ </ul>
585 }
586 db_finalize(&q);
587
588 }
589
+1 -1
--- src/bag.c
+++ src/bag.c
@@ -75,11 +75,11 @@
7575
/*
7676
** Change the size of the hash table on a bag so that
7777
** it contains N slots
7878
**
7979
** Completely reconstruct the hash table from scratch. Deleted
80
-** entries (indicated by a -1) are removed. When finished, it
80
+** entries (indicated by a -1) are removed. When finished, it
8181
** should be the case that p->cnt==p->used.
8282
*/
8383
static void bag_resize(Bag *p, int newSize){
8484
int i;
8585
Bag old;
8686
--- src/bag.c
+++ src/bag.c
@@ -75,11 +75,11 @@
75 /*
76 ** Change the size of the hash table on a bag so that
77 ** it contains N slots
78 **
79 ** Completely reconstruct the hash table from scratch. Deleted
80 ** entries (indicated by a -1) are removed. When finished, it
81 ** should be the case that p->cnt==p->used.
82 */
83 static void bag_resize(Bag *p, int newSize){
84 int i;
85 Bag old;
86
--- src/bag.c
+++ src/bag.c
@@ -75,11 +75,11 @@
75 /*
76 ** Change the size of the hash table on a bag so that
77 ** it contains N slots
78 **
79 ** Completely reconstruct the hash table from scratch. Deleted
80 ** entries (indicated by a -1) are removed. When finished, it
81 ** should be the case that p->cnt==p->used.
82 */
83 static void bag_resize(Bag *p, int newSize){
84 int i;
85 Bag old;
86
+2 -2
--- src/bisect.c
+++ src/bisect.c
@@ -370,11 +370,11 @@
370370
g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid);
371371
g.argc = 3;
372372
g.fNoSync = 1;
373373
update_cmd();
374374
}
375
-
375
+
376376
if( strncmp(zDisplay,"chart",m)==0 ){
377377
bisect_chart(1);
378378
}else if( strncmp(zDisplay, "log", m)==0 ){
379379
bisect_chart(0);
380380
}else if( strncmp(zDisplay, "status", m)==0 ){
@@ -390,11 +390,11 @@
390390
for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391391
char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392392
fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393393
db_lget(z, (char*)aBisectOption[i].zDefault));
394394
fossil_free(z);
395
- comment_print(aBisectOption[i].zDesc, 27, 79);
395
+ comment_print(aBisectOption[i].zDesc, 27, -1);
396396
}
397397
}else if( g.argc==4 || g.argc==5 ){
398398
unsigned int i;
399399
n = strlen(g.argv[3]);
400400
for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401401
--- src/bisect.c
+++ src/bisect.c
@@ -370,11 +370,11 @@
370 g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid);
371 g.argc = 3;
372 g.fNoSync = 1;
373 update_cmd();
374 }
375
376 if( strncmp(zDisplay,"chart",m)==0 ){
377 bisect_chart(1);
378 }else if( strncmp(zDisplay, "log", m)==0 ){
379 bisect_chart(0);
380 }else if( strncmp(zDisplay, "status", m)==0 ){
@@ -390,11 +390,11 @@
390 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391 char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392 fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393 db_lget(z, (char*)aBisectOption[i].zDefault));
394 fossil_free(z);
395 comment_print(aBisectOption[i].zDesc, 27, 79);
396 }
397 }else if( g.argc==4 || g.argc==5 ){
398 unsigned int i;
399 n = strlen(g.argv[3]);
400 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401
--- src/bisect.c
+++ src/bisect.c
@@ -370,11 +370,11 @@
370 g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid);
371 g.argc = 3;
372 g.fNoSync = 1;
373 update_cmd();
374 }
375
376 if( strncmp(zDisplay,"chart",m)==0 ){
377 bisect_chart(1);
378 }else if( strncmp(zDisplay, "log", m)==0 ){
379 bisect_chart(0);
380 }else if( strncmp(zDisplay, "status", m)==0 ){
@@ -390,11 +390,11 @@
390 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391 char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392 fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393 db_lget(z, (char*)aBisectOption[i].zDefault));
394 fossil_free(z);
395 comment_print(aBisectOption[i].zDesc, 27, -1);
396 }
397 }else if( g.argc==4 || g.argc==5 ){
398 unsigned int i;
399 n = strlen(g.argv[3]);
400 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401
+62 -38
--- src/blob.c
+++ src/blob.c
@@ -786,48 +786,17 @@
786786
return nWrote;
787787
}
788788
#endif
789789
fwrite(blob_buffer(pBlob), 1, nWrote, stdout);
790790
}else{
791
- int i, nName;
792
- char *zName, zBuf[1000];
793
-
794
- nName = strlen(zFilename);
795
- if( nName>=sizeof(zBuf) ){
796
- zName = mprintf("%s", zFilename);
797
- }else{
798
- zName = zBuf;
799
- memcpy(zName, zFilename, nName+1);
800
- }
801
- nName = file_simplify_name(zName, nName, 0);
802
- for(i=1; i<nName; i++){
803
- if( zName[i]=='/' ){
804
- zName[i] = 0;
805
-#if defined(_WIN32) || defined(__CYGWIN__)
806
- /*
807
- ** On Windows, local path looks like: C:/develop/project/file.txt
808
- ** The if stops us from trying to create a directory of a drive letter
809
- ** C: in this example.
810
- */
811
- if( !(i==2 && zName[1]==':') ){
812
-#endif
813
- if( file_mkdir(zName, 1) && file_isdir(zName)!=1 ){
814
- fossil_fatal_recursive("unable to create directory %s", zName);
815
- return 0;
816
- }
817
-#if defined(_WIN32) || defined(__CYGWIN__)
818
- }
819
-#endif
820
- zName[i] = '/';
821
- }
822
- }
823
- out = fossil_fopen(zName, "wb");
824
- if( out==0 ){
825
- fossil_fatal_recursive("unable to open file \"%s\" for writing", zName);
826
- return 0;
827
- }
828
- if( zName!=zBuf ) free(zName);
791
+ file_mkfolder(zFilename, 1);
792
+ out = fossil_fopen(zFilename, "wb");
793
+ if( out==0 ){
794
+ fossil_fatal_recursive("unable to open file \"%s\" for writing",
795
+ zFilename);
796
+ return 0;
797
+ }
829798
blob_is_init(pBlob);
830799
nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out);
831800
fclose(out);
832801
if( nWrote!=blob_size(pBlob) ){
833802
fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote,
@@ -1035,10 +1004,65 @@
10351004
else if( z[i+1]!='\n' ) z[j++] = '\n';
10361005
}
10371006
z[j] = 0;
10381007
p->nUsed = j;
10391008
}
1009
+
1010
+/*
1011
+** Convert blob from cp1252 to UTF-8. As cp1252 is a superset
1012
+** of iso8859-1, this is useful on UNIX as well.
1013
+**
1014
+** This table contains the character translations for 0x80..0xA0.
1015
+*/
1016
+
1017
+static const unsigned short cp1252[32] = {
1018
+ 0x20ac, 0x81, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
1019
+ 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x8D, 0x017D, 0x8F,
1020
+ 0x90, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
1021
+ 0x2DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x9D, 0x017E, 0x0178
1022
+};
1023
+
1024
+void blob_cp1252_to_utf8(Blob *p){
1025
+ unsigned char *z = (unsigned char *)p->aData;
1026
+ int j = p->nUsed;
1027
+ int i, n;
1028
+ for(i=n=0; i<j; i++){
1029
+ if( z[i]>=0x80 ){
1030
+ if( (z[i]<0xa0) && (cp1252[z[i]&0x1f]>=0x800) ){
1031
+ n++;
1032
+ }
1033
+ n++;
1034
+ }
1035
+ }
1036
+ j += n;
1037
+ if( j>=p->nAlloc ){
1038
+ blob_resize(p, j);
1039
+ z = (unsigned char *)p->aData;
1040
+ }
1041
+ p->nUsed = j;
1042
+ z[j] = 0;
1043
+ while( j>i ){
1044
+ if( z[--i]>=0x80 ){
1045
+ if( z[i]<0xa0 ){
1046
+ unsigned short sym = cp1252[z[i]&0x1f];
1047
+ if( sym>=0x800 ){
1048
+ z[--j] = 0x80 | (sym&0x3f);
1049
+ z[--j] = 0x80 | ((sym>>6)&0x3f);
1050
+ z[--j] = 0xe0 | (sym>>12);
1051
+ }else{
1052
+ z[--j] = 0x80 | (sym&0x3f);
1053
+ z[--j] = 0xc0 | (sym>>6);
1054
+ }
1055
+ }else{
1056
+ z[--j] = 0x80 | (z[i]&0x3f);
1057
+ z[--j] = 0xC0 | (z[i]>>6);
1058
+ }
1059
+ }else{
1060
+ z[--j] = z[i];
1061
+ }
1062
+ }
1063
+}
10401064
10411065
/*
10421066
** Shell-escape the given string. Append the result to a blob.
10431067
*/
10441068
void shell_escape(Blob *pBlob, const char *zIn){
10451069
--- src/blob.c
+++ src/blob.c
@@ -786,48 +786,17 @@
786 return nWrote;
787 }
788 #endif
789 fwrite(blob_buffer(pBlob), 1, nWrote, stdout);
790 }else{
791 int i, nName;
792 char *zName, zBuf[1000];
793
794 nName = strlen(zFilename);
795 if( nName>=sizeof(zBuf) ){
796 zName = mprintf("%s", zFilename);
797 }else{
798 zName = zBuf;
799 memcpy(zName, zFilename, nName+1);
800 }
801 nName = file_simplify_name(zName, nName, 0);
802 for(i=1; i<nName; i++){
803 if( zName[i]=='/' ){
804 zName[i] = 0;
805 #if defined(_WIN32) || defined(__CYGWIN__)
806 /*
807 ** On Windows, local path looks like: C:/develop/project/file.txt
808 ** The if stops us from trying to create a directory of a drive letter
809 ** C: in this example.
810 */
811 if( !(i==2 && zName[1]==':') ){
812 #endif
813 if( file_mkdir(zName, 1) && file_isdir(zName)!=1 ){
814 fossil_fatal_recursive("unable to create directory %s", zName);
815 return 0;
816 }
817 #if defined(_WIN32) || defined(__CYGWIN__)
818 }
819 #endif
820 zName[i] = '/';
821 }
822 }
823 out = fossil_fopen(zName, "wb");
824 if( out==0 ){
825 fossil_fatal_recursive("unable to open file \"%s\" for writing", zName);
826 return 0;
827 }
828 if( zName!=zBuf ) free(zName);
829 blob_is_init(pBlob);
830 nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out);
831 fclose(out);
832 if( nWrote!=blob_size(pBlob) ){
833 fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote,
@@ -1035,10 +1004,65 @@
1035 else if( z[i+1]!='\n' ) z[j++] = '\n';
1036 }
1037 z[j] = 0;
1038 p->nUsed = j;
1039 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1040
1041 /*
1042 ** Shell-escape the given string. Append the result to a blob.
1043 */
1044 void shell_escape(Blob *pBlob, const char *zIn){
1045
--- src/blob.c
+++ src/blob.c
@@ -786,48 +786,17 @@
786 return nWrote;
787 }
788 #endif
789 fwrite(blob_buffer(pBlob), 1, nWrote, stdout);
790 }else{
791 file_mkfolder(zFilename, 1);
792 out = fossil_fopen(zFilename, "wb");
793 if( out==0 ){
794 fossil_fatal_recursive("unable to open file \"%s\" for writing",
795 zFilename);
796 return 0;
797 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
798 blob_is_init(pBlob);
799 nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out);
800 fclose(out);
801 if( nWrote!=blob_size(pBlob) ){
802 fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote,
@@ -1035,10 +1004,65 @@
1004 else if( z[i+1]!='\n' ) z[j++] = '\n';
1005 }
1006 z[j] = 0;
1007 p->nUsed = j;
1008 }
1009
1010 /*
1011 ** Convert blob from cp1252 to UTF-8. As cp1252 is a superset
1012 ** of iso8859-1, this is useful on UNIX as well.
1013 **
1014 ** This table contains the character translations for 0x80..0xA0.
1015 */
1016
1017 static const unsigned short cp1252[32] = {
1018 0x20ac, 0x81, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
1019 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x8D, 0x017D, 0x8F,
1020 0x90, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
1021 0x2DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x9D, 0x017E, 0x0178
1022 };
1023
1024 void blob_cp1252_to_utf8(Blob *p){
1025 unsigned char *z = (unsigned char *)p->aData;
1026 int j = p->nUsed;
1027 int i, n;
1028 for(i=n=0; i<j; i++){
1029 if( z[i]>=0x80 ){
1030 if( (z[i]<0xa0) && (cp1252[z[i]&0x1f]>=0x800) ){
1031 n++;
1032 }
1033 n++;
1034 }
1035 }
1036 j += n;
1037 if( j>=p->nAlloc ){
1038 blob_resize(p, j);
1039 z = (unsigned char *)p->aData;
1040 }
1041 p->nUsed = j;
1042 z[j] = 0;
1043 while( j>i ){
1044 if( z[--i]>=0x80 ){
1045 if( z[i]<0xa0 ){
1046 unsigned short sym = cp1252[z[i]&0x1f];
1047 if( sym>=0x800 ){
1048 z[--j] = 0x80 | (sym&0x3f);
1049 z[--j] = 0x80 | ((sym>>6)&0x3f);
1050 z[--j] = 0xe0 | (sym>>12);
1051 }else{
1052 z[--j] = 0x80 | (sym&0x3f);
1053 z[--j] = 0xc0 | (sym>>6);
1054 }
1055 }else{
1056 z[--j] = 0x80 | (z[i]&0x3f);
1057 z[--j] = 0xC0 | (z[i]>>6);
1058 }
1059 }else{
1060 z[--j] = z[i];
1061 }
1062 }
1063 }
1064
1065 /*
1066 ** Shell-escape the given string. Append the result to a blob.
1067 */
1068 void shell_escape(Blob *pBlob, const char *zIn){
1069
+5 -17
--- src/branch.c
+++ src/branch.c
@@ -51,11 +51,12 @@
5151
verify_all_options();
5252
if( g.argc<5 ){
5353
usage("new BRANCH-NAME BASIS ?OPTIONS?");
5454
}
5555
db_find_and_open_repository(0, 0);
56
- noSign = db_get_int("omitsign", 0)|noSign;
56
+ noSign = db_get_boolean("omitsign", 0)|noSign;
57
+ if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
5758
5859
/* fossil branch new name */
5960
zBranch = g.argv[3];
6061
if( zBranch==0 || zBranch[0]==0 ){
6162
fossil_fatal("branch name cannot be empty");
@@ -133,17 +134,16 @@
133134
const char *zTag = db_column_text(&q, 0);
134135
blob_appendf(&branch, "T -%F *\n", zTag);
135136
}
136137
db_finalize(&q);
137138
138
- blob_appendf(&branch, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
139
+ blob_appendf(&branch, "U %F\n", zUserOvrd ? zUserOvrd : login_name());
139140
md5sum_blob(&branch, &mcksum);
140141
blob_appendf(&branch, "Z %b\n", &mcksum);
141142
if( !noSign && clearsign(&branch, &branch) ){
142143
Blob ans;
143144
char cReply;
144
- blob_zero(&ans);
145145
prompt_user("unable to sign manifest. continue (y/N)? ", &ans);
146146
cReply = blob_str(&ans)[0];
147147
if( cReply!='y' && cReply!='Y'){
148148
db_end_transaction(1);
149149
fossil_exit(1);
@@ -176,11 +176,11 @@
176176
177177
/* Commit */
178178
db_end_transaction(0);
179179
180180
/* Do an autosync push, if requested */
181
- if( !isPrivate ) autosync(SYNC_PUSH);
181
+ if( !isPrivate ) autosync_loop(SYNC_PUSH, db_get_int("autosync-tries", 1));
182182
}
183183
184184
/*
185185
** Prepare a query that will list branches.
186186
**
@@ -334,11 +334,11 @@
334334
@ <li> A <div class="sideboxDescribed">%z(href("brlist?closed"))
335335
@ closed branch</a></div> is a branch with only
336336
@ <div class="sideboxDescribed">%z(href("leaves?closed"))
337337
@ closed leaves</a></div>.
338338
@ Closed branches are fixed and do not change (unless they are first
339
- @ reopened)</li>
339
+ @ reopened).</li>
340340
@ </ol>
341341
style_sidebox_end();
342342
343343
branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0));
344344
cnt = 0;
@@ -367,16 +367,10 @@
367367
}
368368
if( cnt ){
369369
@ </ul>
370370
}
371371
db_finalize(&q);
372
- @ <script type="text/JavaScript">
373
- @ function xin(id){
374
- @ }
375
- @ function xout(id){
376
- @ }
377
- @ </script>
378372
style_footer();
379373
}
380374
381375
/*
382376
** This routine is called while for each check-in that is rendered by
@@ -422,13 +416,7 @@
422416
" ORDER BY event.mtime DESC",
423417
timeline_query_for_www(), TAG_BRANCH
424418
);
425419
www_print_timeline(&q, 0, 0, 0, brtimeline_extra);
426420
db_finalize(&q);
427
- @ <script type="text/JavaScript">
428
- @ function xin(id){
429
- @ }
430
- @ function xout(id){
431
- @ }
432
- @ </script>
433421
style_footer();
434422
}
435423
--- src/branch.c
+++ src/branch.c
@@ -51,11 +51,12 @@
51 verify_all_options();
52 if( g.argc<5 ){
53 usage("new BRANCH-NAME BASIS ?OPTIONS?");
54 }
55 db_find_and_open_repository(0, 0);
56 noSign = db_get_int("omitsign", 0)|noSign;
 
57
58 /* fossil branch new name */
59 zBranch = g.argv[3];
60 if( zBranch==0 || zBranch[0]==0 ){
61 fossil_fatal("branch name cannot be empty");
@@ -133,17 +134,16 @@
133 const char *zTag = db_column_text(&q, 0);
134 blob_appendf(&branch, "T -%F *\n", zTag);
135 }
136 db_finalize(&q);
137
138 blob_appendf(&branch, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin);
139 md5sum_blob(&branch, &mcksum);
140 blob_appendf(&branch, "Z %b\n", &mcksum);
141 if( !noSign && clearsign(&branch, &branch) ){
142 Blob ans;
143 char cReply;
144 blob_zero(&ans);
145 prompt_user("unable to sign manifest. continue (y/N)? ", &ans);
146 cReply = blob_str(&ans)[0];
147 if( cReply!='y' && cReply!='Y'){
148 db_end_transaction(1);
149 fossil_exit(1);
@@ -176,11 +176,11 @@
176
177 /* Commit */
178 db_end_transaction(0);
179
180 /* Do an autosync push, if requested */
181 if( !isPrivate ) autosync(SYNC_PUSH);
182 }
183
184 /*
185 ** Prepare a query that will list branches.
186 **
@@ -334,11 +334,11 @@
334 @ <li> A <div class="sideboxDescribed">%z(href("brlist?closed"))
335 @ closed branch</a></div> is a branch with only
336 @ <div class="sideboxDescribed">%z(href("leaves?closed"))
337 @ closed leaves</a></div>.
338 @ Closed branches are fixed and do not change (unless they are first
339 @ reopened)</li>
340 @ </ol>
341 style_sidebox_end();
342
343 branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0));
344 cnt = 0;
@@ -367,16 +367,10 @@
367 }
368 if( cnt ){
369 @ </ul>
370 }
371 db_finalize(&q);
372 @ <script type="text/JavaScript">
373 @ function xin(id){
374 @ }
375 @ function xout(id){
376 @ }
377 @ </script>
378 style_footer();
379 }
380
381 /*
382 ** This routine is called while for each check-in that is rendered by
@@ -422,13 +416,7 @@
422 " ORDER BY event.mtime DESC",
423 timeline_query_for_www(), TAG_BRANCH
424 );
425 www_print_timeline(&q, 0, 0, 0, brtimeline_extra);
426 db_finalize(&q);
427 @ <script type="text/JavaScript">
428 @ function xin(id){
429 @ }
430 @ function xout(id){
431 @ }
432 @ </script>
433 style_footer();
434 }
435
--- src/branch.c
+++ src/branch.c
@@ -51,11 +51,12 @@
51 verify_all_options();
52 if( g.argc<5 ){
53 usage("new BRANCH-NAME BASIS ?OPTIONS?");
54 }
55 db_find_and_open_repository(0, 0);
56 noSign = db_get_boolean("omitsign", 0)|noSign;
57 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
58
59 /* fossil branch new name */
60 zBranch = g.argv[3];
61 if( zBranch==0 || zBranch[0]==0 ){
62 fossil_fatal("branch name cannot be empty");
@@ -133,17 +134,16 @@
134 const char *zTag = db_column_text(&q, 0);
135 blob_appendf(&branch, "T -%F *\n", zTag);
136 }
137 db_finalize(&q);
138
139 blob_appendf(&branch, "U %F\n", zUserOvrd ? zUserOvrd : login_name());
140 md5sum_blob(&branch, &mcksum);
141 blob_appendf(&branch, "Z %b\n", &mcksum);
142 if( !noSign && clearsign(&branch, &branch) ){
143 Blob ans;
144 char cReply;
 
145 prompt_user("unable to sign manifest. continue (y/N)? ", &ans);
146 cReply = blob_str(&ans)[0];
147 if( cReply!='y' && cReply!='Y'){
148 db_end_transaction(1);
149 fossil_exit(1);
@@ -176,11 +176,11 @@
176
177 /* Commit */
178 db_end_transaction(0);
179
180 /* Do an autosync push, if requested */
181 if( !isPrivate ) autosync_loop(SYNC_PUSH, db_get_int("autosync-tries", 1));
182 }
183
184 /*
185 ** Prepare a query that will list branches.
186 **
@@ -334,11 +334,11 @@
334 @ <li> A <div class="sideboxDescribed">%z(href("brlist?closed"))
335 @ closed branch</a></div> is a branch with only
336 @ <div class="sideboxDescribed">%z(href("leaves?closed"))
337 @ closed leaves</a></div>.
338 @ Closed branches are fixed and do not change (unless they are first
339 @ reopened).</li>
340 @ </ol>
341 style_sidebox_end();
342
343 branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0));
344 cnt = 0;
@@ -367,16 +367,10 @@
367 }
368 if( cnt ){
369 @ </ul>
370 }
371 db_finalize(&q);
 
 
 
 
 
 
372 style_footer();
373 }
374
375 /*
376 ** This routine is called while for each check-in that is rendered by
@@ -422,13 +416,7 @@
416 " ORDER BY event.mtime DESC",
417 timeline_query_for_www(), TAG_BRANCH
418 );
419 www_print_timeline(&q, 0, 0, 0, brtimeline_extra);
420 db_finalize(&q);
 
 
 
 
 
 
421 style_footer();
422 }
423
+45 -37
--- src/browse.c
+++ src/browse.c
@@ -85,11 +85,11 @@
8585
8686
for(i=0; zPath[i]; i=j){
8787
for(j=i; zPath[j] && zPath[j]!='/'; j++){}
8888
if( zPath[j] && g.perm.Hyperlink ){
8989
if( zCI ){
90
- char *zLink = href("%R/%s?ci=%S&name=%#T%s", zURI, zCI, j, zPath,zREx);
90
+ char *zLink = href("%R/%s?name=%#T%s&ci=%s", zURI, j, zPath, zREx, zCI);
9191
blob_appendf(pOut, "%s%z%#h</a>",
9292
zSep, zLink, j-i, &zPath[i]);
9393
}else{
9494
char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx);
9595
blob_appendf(pOut, "%s%z%#h</a>",
@@ -179,18 +179,15 @@
179179
if( linkTip ){
180180
style_submenu_element("Tip", "Tip", "%s",
181181
url_render(&sURI, "ci", "tip", 0, 0));
182182
}
183183
if( zCI ){
184
- char zShort[20];
185
- memcpy(zShort, zUuid, 10);
186
- zShort[10] = 0;
187
- @ <h2>Files of check-in [%z(href("vinfo?name=%T",zUuid))%s(zShort)</a>]
184
+ @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>]
188185
@ %s(blob_str(&dirname))</h2>
189
- zSubdirLink = mprintf("%R/dir?ci=%S&name=%T", zUuid, zPrefix);
186
+ zSubdirLink = mprintf("%R/dir?ci=%s&name=%T", zUuid, zPrefix);
190187
if( nD==0 ){
191
- style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
188
+ style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
192189
zUuid);
193190
}
194191
}else{
195192
@ <h2>The union of all files from all check-ins
196193
@ %s(blob_str(&dirname))</h2>
@@ -490,11 +487,11 @@
490487
}
491488
if( zCI ){
492489
style_submenu_element("All", "All", "%s",
493490
url_render(&sURI, "ci", 0, 0, 0));
494491
if( nD==0 && !showDirOnly ){
495
- style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
492
+ style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
496493
zUuid);
497494
}
498495
}
499496
if( linkTrunk ){
500497
style_submenu_element("Trunk", "Trunk", "%s",
@@ -517,13 +514,11 @@
517514
518515
db_multi_exec(
519516
"CREATE TEMP TABLE filelist("
520517
" x TEXT PRIMARY KEY COLLATE nocase,"
521518
" uuid TEXT"
522
- ")%s;",
523
- /* Can be removed as soon as SQLite 3.8.2 is sufficiently wide-spread */
524
- sqlite3_libversion_number()>=3008002 ? " WITHOUT ROWID" : ""
519
+ ") WITHOUT ROWID;"
525520
);
526521
db_prepare(&ins, "INSERT OR IGNORE INTO filelist VALUES(:f,:u)");
527522
manifest_file_rewind(pM);
528523
while( (pFile = manifest_file_next(pM,0))!=0 ){
529524
if( nD>0
@@ -576,11 +571,11 @@
576571
if( zCI ){
577572
@ <h2>%d(nFile) %s(zObjType) of check-in
578573
if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){
579574
@ "%h(zCI)"
580575
}
581
- @ [%z(href("vinfo?name=%T",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
576
+ @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
582577
}else{
583578
int n = db_int(0, "SELECT count(*) FROM plink");
584579
@ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins
585580
@ %s(blob_str(&dirname))</h2>
586581
}
@@ -597,38 +592,37 @@
597592
** The <li> element for directories also contains a sublist <ul>
598593
** for the contents of that directory.
599594
*/
600595
@ <div class="filetree"><ul>
601596
if( nD ){
602
- @ <li class="dir">
597
+ @ <li class="dir last">
603598
}else{
604
- @ <li class="dir subdir">
599
+ @ <li class="dir subdir last">
605600
}
606601
@ %z(href("%s",url_render(&sURI,"name",0,0,0)))%h(zProjectName)</a>
607602
@ <ul>
608603
for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
604
+ const char *zLastClass = p->isLast ? " last" : "";
609605
if( p->isDir ){
610
- if( p->nFullName==nD-1 ){
611
- @ <li class="dir subdir">
612
- }else{
613
- @ <li class="dir">
614
- }
606
+ const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : "";
607
+ @ <li class="dir%s(zSubdirClass)%s(zLastClass)">
615608
@ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
616609
if( startExpanded || p->nFullName<=nD ){
617610
@ <ul id="dir%d(nDir)">
618611
}else{
619
- @ <ul id="dir%d(nDir)" style='display:none;'>
612
+ @ <ul id="dir%d(nDir)" class="collapsed">
620613
}
621614
nDir++;
622615
}else if( !showDirOnly ){
616
+ const char *zFileClass = fileext_class(p->zName);
623617
char *zLink;
624618
if( zCI ){
625
- zLink = href("%R/artifact/%S",p->zUuid);
619
+ zLink = href("%R/artifact/%s",p->zUuid);
626620
}else{
627621
zLink = href("%R/finfo?name=%T",p->zFullName);
628622
}
629
- @ <li class="%z(fileext_class(p->zName))">%z(zLink)%h(p->zName)</a>
623
+ @ <li class="%z(zFileClass)%s(zLastClass)">%z(zLink)%h(p->zName)</a>
630624
}
631625
if( p->isLast ){
632626
int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0);
633627
while( nClose-- > 0 ){
634628
@ </ul>
@@ -637,20 +631,19 @@
637631
}
638632
@ </ul>
639633
@ </ul></div>
640634
@ <script>(function(){
641635
@ function isExpanded(ul){
642
- @ var display = window.getComputedStyle(ul).getPropertyValue('display');
643
- @ return display!='none';
636
+ @ return ul.className=='';
644637
@ }
645638
@
646639
@ function toggleDir(ul, useInitValue){
647640
@ if( !useInitValue ){
648641
@ expandMap[ul.id] = !isExpanded(ul);
649642
@ history.replaceState(expandMap, '');
650643
@ }
651
- @ ul.style.display = expandMap[ul.id] ? 'block' : 'none';
644
+ @ ul.className = expandMap[ul.id] ? '' : 'collapsed';
652645
@ }
653646
@
654647
@ function toggleAll(tree, useInitValue){
655648
@ var lists = tree.querySelectorAll('.subdir > ul > li ul');
656649
@ if( !useInitValue ){
@@ -662,38 +655,47 @@
662655
@ }
663656
@ }
664657
@ expandMap = {'*': expand};
665658
@ history.replaceState(expandMap, '');
666659
@ }
667
- @ var display = expandMap['*'] ? 'block' : 'none';
660
+ @ var className = expandMap['*'] ? '' : 'collapsed';
668661
@ for( var i=0; lists[i]; i++ ){
669
- @ lists[i].style.display = display;
662
+ @ lists[i].className = className;
670663
@ }
671664
@ }
672665
@
673666
@ function checkState(){
674667
@ expandMap = history.state || {};
675
- @ if( expandMap['*'] ) toggleAll(outer_ul, true);
668
+ @ if( '*' in expandMap ) toggleAll(outer_ul, true);
676669
@ for( var id in expandMap ){
677670
@ if( id!=='*' ) toggleDir(gebi(id), true);
678671
@ }
679672
@ }
680673
@
681
- @ /* No-op shim for IE9 */
674
+ @ function belowSubdir(node){
675
+ @ do{
676
+ @ node = node.parentNode;
677
+ @ if( node==subdir ) return true;
678
+ @ } while( node && node!=outer_ul );
679
+ @ return false;
680
+ @ }
681
+ @
682
+ @ var history = window.history || {};
682683
@ if( !history.replaceState ) history.replaceState = function(){};
683684
@ var outer_ul = document.querySelector('.filetree > ul');
684685
@ var subdir = outer_ul.querySelector('.subdir');
685686
@ var expandMap = {};
686687
@ checkState();
687688
@ outer_ul.onclick = function(e){
688
- @ var a = e.target;
689
+ @ e = e || window.event;
690
+ @ var a = e.target || e.srcElement;
689691
@ if( a.nodeName!='A' ) return true;
690692
@ if( a.parentNode==subdir ){
691693
@ toggleAll(outer_ul);
692694
@ return false;
693695
@ }
694
- @ if( !subdir.contains(a) ) return true;
696
+ @ if( !belowSubdir(a) ) return true;
695697
@ var ul = a.nextSibling;
696698
@ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
697699
@ if( !ul ) return true; /* This is a file link, not a directory */
698700
@ toggleDir(ul);
699701
@ return false;
@@ -727,20 +729,22 @@
727729
728730
/*
729731
** Look at all file containing in the version "vid". Construct a
730732
** temporary table named "fileage" that contains the file-id for each
731733
** files, the pathname, the check-in where the file was added, and the
732
-** mtime on that checkin.
734
+** mtime on that checkin. If zGlob and *zGlob then only files matching
735
+** the given glob are computed.
733736
*/
734
-int compute_fileage(int vid){
737
+int compute_fileage(int vid, char const * zGlob){
735738
Manifest *pManifest;
736739
ManifestFile *pFile;
737740
int nFile = 0;
738741
double vmtime;
739742
Stmt ins;
740743
Stmt q1, q2, q3;
741744
Stmt upd;
745
+ if(zGlob && !*zGlob) zGlob = NULL;
742746
db_multi_exec(
743747
/*"DROP TABLE IF EXISTS temp.fileage;"*/
744748
"CREATE TEMP TABLE fileage("
745749
" fid INTEGER,"
746750
" mid INTEGER,"
@@ -755,10 +759,11 @@
755759
db_prepare(&ins,
756760
"INSERT INTO temp.fileage(fid, pathname)"
757761
" SELECT rid, :path FROM blob WHERE uuid=:uuid"
758762
);
759763
while( (pFile = manifest_file_next(pManifest, 0))!=0 ){
764
+ if(zGlob && !strglob(zGlob, pFile->zName)) continue;
760765
db_bind_text(&ins, ":uuid", pFile->zUuid);
761766
db_bind_text(&ins, ":path", pFile->zName);
762767
db_step(&ins);
763768
db_reset(&ins);
764769
nFile++;
@@ -802,20 +807,22 @@
802807
803808
/*
804809
** WEBPAGE: fileage
805810
**
806811
** Parameters:
807
-** name=VERSION
812
+** name=VERSION Selects the checkin version (default=tip).
813
+** glob=STRING Only shows files matching this glob pattern
814
+** (e.g. *.c or *.txt).
808815
*/
809816
void fileage_page(void){
810817
int rid;
811818
const char *zName;
812819
char *zBaseTime;
820
+ char const * zGlob;
813821
Stmt q;
814822
double baseTime;
815823
int lastMid = -1;
816
-
817824
login_check_credentials();
818825
if( !g.perm.Read ){ login_needed(); return; }
819826
zName = P("name");
820827
if( zName==0 ) zName = "tip";
821828
rid = symbolic_name_to_rid(zName, "ci");
@@ -822,11 +829,12 @@
822829
if( rid==0 ){
823830
fossil_fatal("not a valid check-in: %s", zName);
824831
}
825832
style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T", zName);
826833
style_header("File Ages", zName);
827
- compute_fileage(rid);
834
+ zGlob = P("glob");
835
+ compute_fileage(rid,zGlob);
828836
baseTime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
829837
zBaseTime = db_text("","SELECT datetime(%.20g%s)", baseTime, timeline_utc());
830838
@ <h2>File Ages For Check-in
831839
@ %z(href("%R/info?name=%T",zName))%h(zName)</a></h2>
832840
@
@@ -864,14 +872,14 @@
864872
zAge[0] = 0;
865873
}
866874
@ <tr>
867875
@ <td>%s(zAge)
868876
@ <td width="25">
869
- @ <td>%z(href("%R/artifact/%S?ln", zFUuid))%h(db_column_text(&q, 3))</a>
877
+ @ <td>%z(href("%R/artifact/%s?ln", zFUuid))%h(db_column_text(&q, 3))</a>
870878
@ </tr>
871879
@
872880
}
873881
@ <tr><td colspan=3><hr></tr>
874882
@ </table>
875883
db_finalize(&q);
876884
style_footer();
877885
}
878886
879887
ADDED src/cache.c
--- src/browse.c
+++ src/browse.c
@@ -85,11 +85,11 @@
85
86 for(i=0; zPath[i]; i=j){
87 for(j=i; zPath[j] && zPath[j]!='/'; j++){}
88 if( zPath[j] && g.perm.Hyperlink ){
89 if( zCI ){
90 char *zLink = href("%R/%s?ci=%S&name=%#T%s", zURI, zCI, j, zPath,zREx);
91 blob_appendf(pOut, "%s%z%#h</a>",
92 zSep, zLink, j-i, &zPath[i]);
93 }else{
94 char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx);
95 blob_appendf(pOut, "%s%z%#h</a>",
@@ -179,18 +179,15 @@
179 if( linkTip ){
180 style_submenu_element("Tip", "Tip", "%s",
181 url_render(&sURI, "ci", "tip", 0, 0));
182 }
183 if( zCI ){
184 char zShort[20];
185 memcpy(zShort, zUuid, 10);
186 zShort[10] = 0;
187 @ <h2>Files of check-in [%z(href("vinfo?name=%T",zUuid))%s(zShort)</a>]
188 @ %s(blob_str(&dirname))</h2>
189 zSubdirLink = mprintf("%R/dir?ci=%S&name=%T", zUuid, zPrefix);
190 if( nD==0 ){
191 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
192 zUuid);
193 }
194 }else{
195 @ <h2>The union of all files from all check-ins
196 @ %s(blob_str(&dirname))</h2>
@@ -490,11 +487,11 @@
490 }
491 if( zCI ){
492 style_submenu_element("All", "All", "%s",
493 url_render(&sURI, "ci", 0, 0, 0));
494 if( nD==0 && !showDirOnly ){
495 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
496 zUuid);
497 }
498 }
499 if( linkTrunk ){
500 style_submenu_element("Trunk", "Trunk", "%s",
@@ -517,13 +514,11 @@
517
518 db_multi_exec(
519 "CREATE TEMP TABLE filelist("
520 " x TEXT PRIMARY KEY COLLATE nocase,"
521 " uuid TEXT"
522 ")%s;",
523 /* Can be removed as soon as SQLite 3.8.2 is sufficiently wide-spread */
524 sqlite3_libversion_number()>=3008002 ? " WITHOUT ROWID" : ""
525 );
526 db_prepare(&ins, "INSERT OR IGNORE INTO filelist VALUES(:f,:u)");
527 manifest_file_rewind(pM);
528 while( (pFile = manifest_file_next(pM,0))!=0 ){
529 if( nD>0
@@ -576,11 +571,11 @@
576 if( zCI ){
577 @ <h2>%d(nFile) %s(zObjType) of check-in
578 if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){
579 @ "%h(zCI)"
580 }
581 @ [%z(href("vinfo?name=%T",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
582 }else{
583 int n = db_int(0, "SELECT count(*) FROM plink");
584 @ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins
585 @ %s(blob_str(&dirname))</h2>
586 }
@@ -597,38 +592,37 @@
597 ** The <li> element for directories also contains a sublist <ul>
598 ** for the contents of that directory.
599 */
600 @ <div class="filetree"><ul>
601 if( nD ){
602 @ <li class="dir">
603 }else{
604 @ <li class="dir subdir">
605 }
606 @ %z(href("%s",url_render(&sURI,"name",0,0,0)))%h(zProjectName)</a>
607 @ <ul>
608 for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
 
609 if( p->isDir ){
610 if( p->nFullName==nD-1 ){
611 @ <li class="dir subdir">
612 }else{
613 @ <li class="dir">
614 }
615 @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
616 if( startExpanded || p->nFullName<=nD ){
617 @ <ul id="dir%d(nDir)">
618 }else{
619 @ <ul id="dir%d(nDir)" style='display:none;'>
620 }
621 nDir++;
622 }else if( !showDirOnly ){
 
623 char *zLink;
624 if( zCI ){
625 zLink = href("%R/artifact/%S",p->zUuid);
626 }else{
627 zLink = href("%R/finfo?name=%T",p->zFullName);
628 }
629 @ <li class="%z(fileext_class(p->zName))">%z(zLink)%h(p->zName)</a>
630 }
631 if( p->isLast ){
632 int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0);
633 while( nClose-- > 0 ){
634 @ </ul>
@@ -637,20 +631,19 @@
637 }
638 @ </ul>
639 @ </ul></div>
640 @ <script>(function(){
641 @ function isExpanded(ul){
642 @ var display = window.getComputedStyle(ul).getPropertyValue('display');
643 @ return display!='none';
644 @ }
645 @
646 @ function toggleDir(ul, useInitValue){
647 @ if( !useInitValue ){
648 @ expandMap[ul.id] = !isExpanded(ul);
649 @ history.replaceState(expandMap, '');
650 @ }
651 @ ul.style.display = expandMap[ul.id] ? 'block' : 'none';
652 @ }
653 @
654 @ function toggleAll(tree, useInitValue){
655 @ var lists = tree.querySelectorAll('.subdir > ul > li ul');
656 @ if( !useInitValue ){
@@ -662,38 +655,47 @@
662 @ }
663 @ }
664 @ expandMap = {'*': expand};
665 @ history.replaceState(expandMap, '');
666 @ }
667 @ var display = expandMap['*'] ? 'block' : 'none';
668 @ for( var i=0; lists[i]; i++ ){
669 @ lists[i].style.display = display;
670 @ }
671 @ }
672 @
673 @ function checkState(){
674 @ expandMap = history.state || {};
675 @ if( expandMap['*'] ) toggleAll(outer_ul, true);
676 @ for( var id in expandMap ){
677 @ if( id!=='*' ) toggleDir(gebi(id), true);
678 @ }
679 @ }
680 @
681 @ /* No-op shim for IE9 */
 
 
 
 
 
 
 
 
682 @ if( !history.replaceState ) history.replaceState = function(){};
683 @ var outer_ul = document.querySelector('.filetree > ul');
684 @ var subdir = outer_ul.querySelector('.subdir');
685 @ var expandMap = {};
686 @ checkState();
687 @ outer_ul.onclick = function(e){
688 @ var a = e.target;
 
689 @ if( a.nodeName!='A' ) return true;
690 @ if( a.parentNode==subdir ){
691 @ toggleAll(outer_ul);
692 @ return false;
693 @ }
694 @ if( !subdir.contains(a) ) return true;
695 @ var ul = a.nextSibling;
696 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
697 @ if( !ul ) return true; /* This is a file link, not a directory */
698 @ toggleDir(ul);
699 @ return false;
@@ -727,20 +729,22 @@
727
728 /*
729 ** Look at all file containing in the version "vid". Construct a
730 ** temporary table named "fileage" that contains the file-id for each
731 ** files, the pathname, the check-in where the file was added, and the
732 ** mtime on that checkin.
 
733 */
734 int compute_fileage(int vid){
735 Manifest *pManifest;
736 ManifestFile *pFile;
737 int nFile = 0;
738 double vmtime;
739 Stmt ins;
740 Stmt q1, q2, q3;
741 Stmt upd;
 
742 db_multi_exec(
743 /*"DROP TABLE IF EXISTS temp.fileage;"*/
744 "CREATE TEMP TABLE fileage("
745 " fid INTEGER,"
746 " mid INTEGER,"
@@ -755,10 +759,11 @@
755 db_prepare(&ins,
756 "INSERT INTO temp.fileage(fid, pathname)"
757 " SELECT rid, :path FROM blob WHERE uuid=:uuid"
758 );
759 while( (pFile = manifest_file_next(pManifest, 0))!=0 ){
 
760 db_bind_text(&ins, ":uuid", pFile->zUuid);
761 db_bind_text(&ins, ":path", pFile->zName);
762 db_step(&ins);
763 db_reset(&ins);
764 nFile++;
@@ -802,20 +807,22 @@
802
803 /*
804 ** WEBPAGE: fileage
805 **
806 ** Parameters:
807 ** name=VERSION
 
 
808 */
809 void fileage_page(void){
810 int rid;
811 const char *zName;
812 char *zBaseTime;
 
813 Stmt q;
814 double baseTime;
815 int lastMid = -1;
816
817 login_check_credentials();
818 if( !g.perm.Read ){ login_needed(); return; }
819 zName = P("name");
820 if( zName==0 ) zName = "tip";
821 rid = symbolic_name_to_rid(zName, "ci");
@@ -822,11 +829,12 @@
822 if( rid==0 ){
823 fossil_fatal("not a valid check-in: %s", zName);
824 }
825 style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T", zName);
826 style_header("File Ages", zName);
827 compute_fileage(rid);
 
828 baseTime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
829 zBaseTime = db_text("","SELECT datetime(%.20g%s)", baseTime, timeline_utc());
830 @ <h2>File Ages For Check-in
831 @ %z(href("%R/info?name=%T",zName))%h(zName)</a></h2>
832 @
@@ -864,14 +872,14 @@
864 zAge[0] = 0;
865 }
866 @ <tr>
867 @ <td>%s(zAge)
868 @ <td width="25">
869 @ <td>%z(href("%R/artifact/%S?ln", zFUuid))%h(db_column_text(&q, 3))</a>
870 @ </tr>
871 @
872 }
873 @ <tr><td colspan=3><hr></tr>
874 @ </table>
875 db_finalize(&q);
876 style_footer();
877 }
878
879 DDED src/cache.c
--- src/browse.c
+++ src/browse.c
@@ -85,11 +85,11 @@
85
86 for(i=0; zPath[i]; i=j){
87 for(j=i; zPath[j] && zPath[j]!='/'; j++){}
88 if( zPath[j] && g.perm.Hyperlink ){
89 if( zCI ){
90 char *zLink = href("%R/%s?name=%#T%s&ci=%s", zURI, j, zPath, zREx, zCI);
91 blob_appendf(pOut, "%s%z%#h</a>",
92 zSep, zLink, j-i, &zPath[i]);
93 }else{
94 char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx);
95 blob_appendf(pOut, "%s%z%#h</a>",
@@ -179,18 +179,15 @@
179 if( linkTip ){
180 style_submenu_element("Tip", "Tip", "%s",
181 url_render(&sURI, "ci", "tip", 0, 0));
182 }
183 if( zCI ){
184 @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>]
 
 
 
185 @ %s(blob_str(&dirname))</h2>
186 zSubdirLink = mprintf("%R/dir?ci=%s&name=%T", zUuid, zPrefix);
187 if( nD==0 ){
188 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
189 zUuid);
190 }
191 }else{
192 @ <h2>The union of all files from all check-ins
193 @ %s(blob_str(&dirname))</h2>
@@ -490,11 +487,11 @@
487 }
488 if( zCI ){
489 style_submenu_element("All", "All", "%s",
490 url_render(&sURI, "ci", 0, 0, 0));
491 if( nD==0 && !showDirOnly ){
492 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
493 zUuid);
494 }
495 }
496 if( linkTrunk ){
497 style_submenu_element("Trunk", "Trunk", "%s",
@@ -517,13 +514,11 @@
514
515 db_multi_exec(
516 "CREATE TEMP TABLE filelist("
517 " x TEXT PRIMARY KEY COLLATE nocase,"
518 " uuid TEXT"
519 ") WITHOUT ROWID;"
 
 
520 );
521 db_prepare(&ins, "INSERT OR IGNORE INTO filelist VALUES(:f,:u)");
522 manifest_file_rewind(pM);
523 while( (pFile = manifest_file_next(pM,0))!=0 ){
524 if( nD>0
@@ -576,11 +571,11 @@
571 if( zCI ){
572 @ <h2>%d(nFile) %s(zObjType) of check-in
573 if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){
574 @ "%h(zCI)"
575 }
576 @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
577 }else{
578 int n = db_int(0, "SELECT count(*) FROM plink");
579 @ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins
580 @ %s(blob_str(&dirname))</h2>
581 }
@@ -597,38 +592,37 @@
592 ** The <li> element for directories also contains a sublist <ul>
593 ** for the contents of that directory.
594 */
595 @ <div class="filetree"><ul>
596 if( nD ){
597 @ <li class="dir last">
598 }else{
599 @ <li class="dir subdir last">
600 }
601 @ %z(href("%s",url_render(&sURI,"name",0,0,0)))%h(zProjectName)</a>
602 @ <ul>
603 for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
604 const char *zLastClass = p->isLast ? " last" : "";
605 if( p->isDir ){
606 const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : "";
607 @ <li class="dir%s(zSubdirClass)%s(zLastClass)">
 
 
 
608 @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
609 if( startExpanded || p->nFullName<=nD ){
610 @ <ul id="dir%d(nDir)">
611 }else{
612 @ <ul id="dir%d(nDir)" class="collapsed">
613 }
614 nDir++;
615 }else if( !showDirOnly ){
616 const char *zFileClass = fileext_class(p->zName);
617 char *zLink;
618 if( zCI ){
619 zLink = href("%R/artifact/%s",p->zUuid);
620 }else{
621 zLink = href("%R/finfo?name=%T",p->zFullName);
622 }
623 @ <li class="%z(zFileClass)%s(zLastClass)">%z(zLink)%h(p->zName)</a>
624 }
625 if( p->isLast ){
626 int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0);
627 while( nClose-- > 0 ){
628 @ </ul>
@@ -637,20 +631,19 @@
631 }
632 @ </ul>
633 @ </ul></div>
634 @ <script>(function(){
635 @ function isExpanded(ul){
636 @ return ul.className=='';
 
637 @ }
638 @
639 @ function toggleDir(ul, useInitValue){
640 @ if( !useInitValue ){
641 @ expandMap[ul.id] = !isExpanded(ul);
642 @ history.replaceState(expandMap, '');
643 @ }
644 @ ul.className = expandMap[ul.id] ? '' : 'collapsed';
645 @ }
646 @
647 @ function toggleAll(tree, useInitValue){
648 @ var lists = tree.querySelectorAll('.subdir > ul > li ul');
649 @ if( !useInitValue ){
@@ -662,38 +655,47 @@
655 @ }
656 @ }
657 @ expandMap = {'*': expand};
658 @ history.replaceState(expandMap, '');
659 @ }
660 @ var className = expandMap['*'] ? '' : 'collapsed';
661 @ for( var i=0; lists[i]; i++ ){
662 @ lists[i].className = className;
663 @ }
664 @ }
665 @
666 @ function checkState(){
667 @ expandMap = history.state || {};
668 @ if( '*' in expandMap ) toggleAll(outer_ul, true);
669 @ for( var id in expandMap ){
670 @ if( id!=='*' ) toggleDir(gebi(id), true);
671 @ }
672 @ }
673 @
674 @ function belowSubdir(node){
675 @ do{
676 @ node = node.parentNode;
677 @ if( node==subdir ) return true;
678 @ } while( node && node!=outer_ul );
679 @ return false;
680 @ }
681 @
682 @ var history = window.history || {};
683 @ if( !history.replaceState ) history.replaceState = function(){};
684 @ var outer_ul = document.querySelector('.filetree > ul');
685 @ var subdir = outer_ul.querySelector('.subdir');
686 @ var expandMap = {};
687 @ checkState();
688 @ outer_ul.onclick = function(e){
689 @ e = e || window.event;
690 @ var a = e.target || e.srcElement;
691 @ if( a.nodeName!='A' ) return true;
692 @ if( a.parentNode==subdir ){
693 @ toggleAll(outer_ul);
694 @ return false;
695 @ }
696 @ if( !belowSubdir(a) ) return true;
697 @ var ul = a.nextSibling;
698 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
699 @ if( !ul ) return true; /* This is a file link, not a directory */
700 @ toggleDir(ul);
701 @ return false;
@@ -727,20 +729,22 @@
729
730 /*
731 ** Look at all file containing in the version "vid". Construct a
732 ** temporary table named "fileage" that contains the file-id for each
733 ** files, the pathname, the check-in where the file was added, and the
734 ** mtime on that checkin. If zGlob and *zGlob then only files matching
735 ** the given glob are computed.
736 */
737 int compute_fileage(int vid, char const * zGlob){
738 Manifest *pManifest;
739 ManifestFile *pFile;
740 int nFile = 0;
741 double vmtime;
742 Stmt ins;
743 Stmt q1, q2, q3;
744 Stmt upd;
745 if(zGlob && !*zGlob) zGlob = NULL;
746 db_multi_exec(
747 /*"DROP TABLE IF EXISTS temp.fileage;"*/
748 "CREATE TEMP TABLE fileage("
749 " fid INTEGER,"
750 " mid INTEGER,"
@@ -755,10 +759,11 @@
759 db_prepare(&ins,
760 "INSERT INTO temp.fileage(fid, pathname)"
761 " SELECT rid, :path FROM blob WHERE uuid=:uuid"
762 );
763 while( (pFile = manifest_file_next(pManifest, 0))!=0 ){
764 if(zGlob && !strglob(zGlob, pFile->zName)) continue;
765 db_bind_text(&ins, ":uuid", pFile->zUuid);
766 db_bind_text(&ins, ":path", pFile->zName);
767 db_step(&ins);
768 db_reset(&ins);
769 nFile++;
@@ -802,20 +807,22 @@
807
808 /*
809 ** WEBPAGE: fileage
810 **
811 ** Parameters:
812 ** name=VERSION Selects the checkin version (default=tip).
813 ** glob=STRING Only shows files matching this glob pattern
814 ** (e.g. *.c or *.txt).
815 */
816 void fileage_page(void){
817 int rid;
818 const char *zName;
819 char *zBaseTime;
820 char const * zGlob;
821 Stmt q;
822 double baseTime;
823 int lastMid = -1;
 
824 login_check_credentials();
825 if( !g.perm.Read ){ login_needed(); return; }
826 zName = P("name");
827 if( zName==0 ) zName = "tip";
828 rid = symbolic_name_to_rid(zName, "ci");
@@ -822,11 +829,12 @@
829 if( rid==0 ){
830 fossil_fatal("not a valid check-in: %s", zName);
831 }
832 style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T", zName);
833 style_header("File Ages", zName);
834 zGlob = P("glob");
835 compute_fileage(rid,zGlob);
836 baseTime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
837 zBaseTime = db_text("","SELECT datetime(%.20g%s)", baseTime, timeline_utc());
838 @ <h2>File Ages For Check-in
839 @ %z(href("%R/info?name=%T",zName))%h(zName)</a></h2>
840 @
@@ -864,14 +872,14 @@
872 zAge[0] = 0;
873 }
874 @ <tr>
875 @ <td>%s(zAge)
876 @ <td width="25">
877 @ <td>%z(href("%R/artifact/%s?ln", zFUuid))%h(db_column_text(&q, 3))</a>
878 @ </tr>
879 @
880 }
881 @ <tr><td colspan=3><hr></tr>
882 @ </table>
883 db_finalize(&q);
884 style_footer();
885 }
886
887 DDED src/cache.c
--- a/src/cache.c
+++ b/src/cache.c
@@ -0,0 +1,7 @@
1
+ S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
2
+ ");"
3
+ S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get__ooter so S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
4
+ ");"
5
+ S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter so
6
+ ;S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get S"cache""cache"sta t {
7
+ @ <li><p>%h()
--- a/src/cache.c
+++ b/src/cache.c
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
--- a/src/cache.c
+++ b/src/cache.c
@@ -0,0 +1,7 @@
1 S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
2 ");"
3 S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get__ooter so S"cache""cache"statooter(get_ooter(_getpagerc = S"cache""cache"s "sz INT,""tm INT,""nref INT"Number of uses */
4 ");"
5 S"cache""cache"(_getpage */tm));S"cache""cache"statooter(get__ooter so
6 ;S"cache""cache"statooter(get__ooter soge */tm));S"cache""cache"statooter(get S"cache""cache"sta t {
7 @ <li><p>%h()
+21 -22
--- src/captcha.c
+++ src/captcha.c
@@ -92,11 +92,11 @@
9292
z[k++] = ' ';
9393
}
9494
z[k++] = '\n';
9595
}
9696
z[k] = 0;
97
- return z;
97
+ return z;
9898
}
9999
#endif /* CAPTCHA==1 */
100100
101101
102102
#if CAPTCHA==2
@@ -148,11 +148,11 @@
148148
"|__ |",
149149
" / / ",
150150
" /_/ ",
151151
152152
/* 8 */
153
- " ___ ",
153
+ " ___ ",
154154
"( _ )",
155155
"/ _ \\",
156156
"\\___/",
157157
158158
/* 9 */
@@ -218,11 +218,11 @@
218218
}
219219
}
220220
z[k++] = '\n';
221221
}
222222
z[k] = 0;
223
- return z;
223
+ return z;
224224
}
225225
#endif /* CAPTCHA==2 */
226226
227227
#if CAPTCHA==3
228228
static const char *const azFont3[] = {
@@ -231,123 +231,123 @@
231231
" / _ \\ ",
232232
"| | | |",
233233
"| | | |",
234234
"| |_| |",
235235
" \\___/ ",
236
-
236
+
237237
/* 1 */
238238
" __ ",
239239
"/_ |",
240240
" | |",
241241
" | |",
242242
" | |",
243243
" |_|",
244
-
244
+
245245
/* 2 */
246246
" ___ ",
247247
"|__ \\ ",
248248
" ) |",
249249
" / / ",
250250
" / /_ ",
251251
"|____|",
252
-
252
+
253253
/* 3 */
254254
" ____ ",
255255
"|___ \\ ",
256256
" __) |",
257257
" |__ < ",
258258
" ___) |",
259259
"|____/ ",
260
-
260
+
261261
/* 4 */
262262
" _ _ ",
263263
"| || | ",
264264
"| || |_ ",
265265
"|__ _|",
266266
" | | ",
267267
" |_| ",
268
-
268
+
269269
/* 5 */
270270
" _____ ",
271271
"| ____|",
272272
"| |__ ",
273273
"|___ \\ ",
274274
" ___) |",
275275
"|____/ ",
276
-
276
+
277277
/* 6 */
278278
" __ ",
279279
" / / ",
280280
" / /_ ",
281281
"| '_ \\ ",
282282
"| (_) |",
283283
" \\___/ ",
284
-
284
+
285285
/* 7 */
286286
" ______ ",
287287
"|____ |",
288288
" / / ",
289289
" / / ",
290290
" / / ",
291291
" /_/ ",
292
-
292
+
293293
/* 8 */
294294
" ___ ",
295295
" / _ \\ ",
296296
"| (_) |",
297297
" > _ < ",
298298
"| (_) |",
299299
" \\___/ ",
300
-
300
+
301301
/* 9 */
302302
" ___ ",
303303
" / _ \\ ",
304304
"| (_) |",
305305
" \\__, |",
306306
" / / ",
307307
" /_/ ",
308
-
308
+
309309
/* A */
310310
" ",
311311
" /\\ ",
312312
" / \\ ",
313313
" / /\\ \\ ",
314314
" / ____ \\ ",
315315
"/_/ \\_\\",
316
-
316
+
317317
/* B */
318318
" ____ ",
319319
"| _ \\ ",
320320
"| |_) |",
321321
"| _ < ",
322322
"| |_) |",
323323
"|____/ ",
324
-
324
+
325325
/* C */
326326
" _____ ",
327327
" / ____|",
328328
"| | ",
329329
"| | ",
330330
"| |____ ",
331331
" \\_____|",
332
-
332
+
333333
/* D */
334334
" _____ ",
335335
"| __ \\ ",
336336
"| | | |",
337337
"| | | |",
338338
"| |__| |",
339339
"|_____/ ",
340
-
340
+
341341
/* E */
342342
" ______ ",
343343
"| ____|",
344344
"| |__ ",
345345
"| __| ",
346346
"| |____ ",
347347
"|______|",
348
-
348
+
349349
/* F */
350350
" ______ ",
351351
"| ____|",
352352
"| |__ ",
353353
"| __| ",
@@ -408,11 +408,11 @@
408408
}
409409
}
410410
z[k++] = '\n';
411411
}
412412
z[k] = 0;
413
- return z;
413
+ return z;
414414
}
415415
#endif /* CAPTCHA==3 */
416416
417417
/*
418418
** COMMAND: test-captcha
@@ -478,16 +478,15 @@
478478
** Return true if a CAPTCHA is required for editing wiki or tickets or for
479479
** adding attachments.
480480
**
481481
** A CAPTCHA is required in those cases if the user is not logged in (if they
482482
** are user "nobody") and if the "require-captcha" setting is true. The
483
-** "require-captcha" setting is controlled on the Admin/Access page. It
483
+** "require-captcha" setting is controlled on the Admin/Access page. It
484484
** defaults to true.
485485
*/
486486
int captcha_needed(void){
487
- if( g.zLogin!=0 ) return 0;
488
- return db_get_boolean("require-captcha", 1);
487
+ return login_is_nobody() && db_get_boolean("require-captcha", 1);
489488
}
490489
491490
/*
492491
** If a captcha is required but the correct captcha code is not supplied
493492
** in the query parameters, then return false (0).
494493
--- src/captcha.c
+++ src/captcha.c
@@ -92,11 +92,11 @@
92 z[k++] = ' ';
93 }
94 z[k++] = '\n';
95 }
96 z[k] = 0;
97 return z;
98 }
99 #endif /* CAPTCHA==1 */
100
101
102 #if CAPTCHA==2
@@ -148,11 +148,11 @@
148 "|__ |",
149 " / / ",
150 " /_/ ",
151
152 /* 8 */
153 " ___ ",
154 "( _ )",
155 "/ _ \\",
156 "\\___/",
157
158 /* 9 */
@@ -218,11 +218,11 @@
218 }
219 }
220 z[k++] = '\n';
221 }
222 z[k] = 0;
223 return z;
224 }
225 #endif /* CAPTCHA==2 */
226
227 #if CAPTCHA==3
228 static const char *const azFont3[] = {
@@ -231,123 +231,123 @@
231 " / _ \\ ",
232 "| | | |",
233 "| | | |",
234 "| |_| |",
235 " \\___/ ",
236
237 /* 1 */
238 " __ ",
239 "/_ |",
240 " | |",
241 " | |",
242 " | |",
243 " |_|",
244
245 /* 2 */
246 " ___ ",
247 "|__ \\ ",
248 " ) |",
249 " / / ",
250 " / /_ ",
251 "|____|",
252
253 /* 3 */
254 " ____ ",
255 "|___ \\ ",
256 " __) |",
257 " |__ < ",
258 " ___) |",
259 "|____/ ",
260
261 /* 4 */
262 " _ _ ",
263 "| || | ",
264 "| || |_ ",
265 "|__ _|",
266 " | | ",
267 " |_| ",
268
269 /* 5 */
270 " _____ ",
271 "| ____|",
272 "| |__ ",
273 "|___ \\ ",
274 " ___) |",
275 "|____/ ",
276
277 /* 6 */
278 " __ ",
279 " / / ",
280 " / /_ ",
281 "| '_ \\ ",
282 "| (_) |",
283 " \\___/ ",
284
285 /* 7 */
286 " ______ ",
287 "|____ |",
288 " / / ",
289 " / / ",
290 " / / ",
291 " /_/ ",
292
293 /* 8 */
294 " ___ ",
295 " / _ \\ ",
296 "| (_) |",
297 " > _ < ",
298 "| (_) |",
299 " \\___/ ",
300
301 /* 9 */
302 " ___ ",
303 " / _ \\ ",
304 "| (_) |",
305 " \\__, |",
306 " / / ",
307 " /_/ ",
308
309 /* A */
310 " ",
311 " /\\ ",
312 " / \\ ",
313 " / /\\ \\ ",
314 " / ____ \\ ",
315 "/_/ \\_\\",
316
317 /* B */
318 " ____ ",
319 "| _ \\ ",
320 "| |_) |",
321 "| _ < ",
322 "| |_) |",
323 "|____/ ",
324
325 /* C */
326 " _____ ",
327 " / ____|",
328 "| | ",
329 "| | ",
330 "| |____ ",
331 " \\_____|",
332
333 /* D */
334 " _____ ",
335 "| __ \\ ",
336 "| | | |",
337 "| | | |",
338 "| |__| |",
339 "|_____/ ",
340
341 /* E */
342 " ______ ",
343 "| ____|",
344 "| |__ ",
345 "| __| ",
346 "| |____ ",
347 "|______|",
348
349 /* F */
350 " ______ ",
351 "| ____|",
352 "| |__ ",
353 "| __| ",
@@ -408,11 +408,11 @@
408 }
409 }
410 z[k++] = '\n';
411 }
412 z[k] = 0;
413 return z;
414 }
415 #endif /* CAPTCHA==3 */
416
417 /*
418 ** COMMAND: test-captcha
@@ -478,16 +478,15 @@
478 ** Return true if a CAPTCHA is required for editing wiki or tickets or for
479 ** adding attachments.
480 **
481 ** A CAPTCHA is required in those cases if the user is not logged in (if they
482 ** are user "nobody") and if the "require-captcha" setting is true. The
483 ** "require-captcha" setting is controlled on the Admin/Access page. It
484 ** defaults to true.
485 */
486 int captcha_needed(void){
487 if( g.zLogin!=0 ) return 0;
488 return db_get_boolean("require-captcha", 1);
489 }
490
491 /*
492 ** If a captcha is required but the correct captcha code is not supplied
493 ** in the query parameters, then return false (0).
494
--- src/captcha.c
+++ src/captcha.c
@@ -92,11 +92,11 @@
92 z[k++] = ' ';
93 }
94 z[k++] = '\n';
95 }
96 z[k] = 0;
97 return z;
98 }
99 #endif /* CAPTCHA==1 */
100
101
102 #if CAPTCHA==2
@@ -148,11 +148,11 @@
148 "|__ |",
149 " / / ",
150 " /_/ ",
151
152 /* 8 */
153 " ___ ",
154 "( _ )",
155 "/ _ \\",
156 "\\___/",
157
158 /* 9 */
@@ -218,11 +218,11 @@
218 }
219 }
220 z[k++] = '\n';
221 }
222 z[k] = 0;
223 return z;
224 }
225 #endif /* CAPTCHA==2 */
226
227 #if CAPTCHA==3
228 static const char *const azFont3[] = {
@@ -231,123 +231,123 @@
231 " / _ \\ ",
232 "| | | |",
233 "| | | |",
234 "| |_| |",
235 " \\___/ ",
236
237 /* 1 */
238 " __ ",
239 "/_ |",
240 " | |",
241 " | |",
242 " | |",
243 " |_|",
244
245 /* 2 */
246 " ___ ",
247 "|__ \\ ",
248 " ) |",
249 " / / ",
250 " / /_ ",
251 "|____|",
252
253 /* 3 */
254 " ____ ",
255 "|___ \\ ",
256 " __) |",
257 " |__ < ",
258 " ___) |",
259 "|____/ ",
260
261 /* 4 */
262 " _ _ ",
263 "| || | ",
264 "| || |_ ",
265 "|__ _|",
266 " | | ",
267 " |_| ",
268
269 /* 5 */
270 " _____ ",
271 "| ____|",
272 "| |__ ",
273 "|___ \\ ",
274 " ___) |",
275 "|____/ ",
276
277 /* 6 */
278 " __ ",
279 " / / ",
280 " / /_ ",
281 "| '_ \\ ",
282 "| (_) |",
283 " \\___/ ",
284
285 /* 7 */
286 " ______ ",
287 "|____ |",
288 " / / ",
289 " / / ",
290 " / / ",
291 " /_/ ",
292
293 /* 8 */
294 " ___ ",
295 " / _ \\ ",
296 "| (_) |",
297 " > _ < ",
298 "| (_) |",
299 " \\___/ ",
300
301 /* 9 */
302 " ___ ",
303 " / _ \\ ",
304 "| (_) |",
305 " \\__, |",
306 " / / ",
307 " /_/ ",
308
309 /* A */
310 " ",
311 " /\\ ",
312 " / \\ ",
313 " / /\\ \\ ",
314 " / ____ \\ ",
315 "/_/ \\_\\",
316
317 /* B */
318 " ____ ",
319 "| _ \\ ",
320 "| |_) |",
321 "| _ < ",
322 "| |_) |",
323 "|____/ ",
324
325 /* C */
326 " _____ ",
327 " / ____|",
328 "| | ",
329 "| | ",
330 "| |____ ",
331 " \\_____|",
332
333 /* D */
334 " _____ ",
335 "| __ \\ ",
336 "| | | |",
337 "| | | |",
338 "| |__| |",
339 "|_____/ ",
340
341 /* E */
342 " ______ ",
343 "| ____|",
344 "| |__ ",
345 "| __| ",
346 "| |____ ",
347 "|______|",
348
349 /* F */
350 " ______ ",
351 "| ____|",
352 "| |__ ",
353 "| __| ",
@@ -408,11 +408,11 @@
408 }
409 }
410 z[k++] = '\n';
411 }
412 z[k] = 0;
413 return z;
414 }
415 #endif /* CAPTCHA==3 */
416
417 /*
418 ** COMMAND: test-captcha
@@ -478,16 +478,15 @@
478 ** Return true if a CAPTCHA is required for editing wiki or tickets or for
479 ** adding attachments.
480 **
481 ** A CAPTCHA is required in those cases if the user is not logged in (if they
482 ** are user "nobody") and if the "require-captcha" setting is true. The
483 ** "require-captcha" setting is controlled on the Admin/Access page. It
484 ** defaults to true.
485 */
486 int captcha_needed(void){
487 return login_is_nobody() && db_get_boolean("require-captcha", 1);
 
488 }
489
490 /*
491 ** If a captcha is required but the correct captcha code is not supplied
492 ** in the query parameters, then return false (0).
493
+18 -31
--- src/cgi.c
+++ src/cgi.c
@@ -267,11 +267,11 @@
267267
zTok = strtok_r(0, ",\"",&zPos)){}
268268
fossil_free(zBuf);
269269
if(zTok) return 1;
270270
}
271271
}
272
-
272
+
273273
return 0;
274274
}
275275
#endif
276276
277277
/*
@@ -498,11 +498,11 @@
498498
** must be made of zValue.
499499
*/
500500
void cgi_setenv(const char *zName, const char *zValue){
501501
cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0);
502502
}
503
-
503
+
504504
505505
/*
506506
** Add a list of query parameters or cookies to the parameter set.
507507
**
508508
** Each parameter is of the form NAME=VALUE. Both the NAME and the
@@ -616,11 +616,11 @@
616616
break;
617617
}
618618
}
619619
*pz = &z[i];
620620
get_line_from_string(pz, pLen);
621
- return z;
621
+ return z;
622622
}
623623
624624
/*
625625
** Tokenize a line of text into as many as nArg tokens. Make
626626
** azArg[] point to the start of each token.
@@ -723,11 +723,11 @@
723723
cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z, 1);
724724
}
725725
}
726726
}
727727
}
728
- }
728
+ }
729729
}
730730
731731
732732
#ifdef FOSSIL_ENABLE_JSON
733733
/*
@@ -875,11 +875,11 @@
875875
char *z;
876876
const char *zType;
877877
int len;
878878
const char *zRequestUri = cgi_parameter("REQUEST_URI",0);
879879
const char *zScriptName = cgi_parameter("SCRIPT_NAME",0);
880
- const char *zPathInfo = cgi_parameter("PATH_INFO","");
880
+ const char *zPathInfo = cgi_parameter("PATH_INFO",0);
881881
882882
#ifdef FOSSIL_ENABLE_JSON
883883
json_main_bootstrap();
884884
#endif
885885
g.isHTTP = 1;
@@ -904,11 +904,11 @@
904904
z = (char*)P("HTTP_COOKIE");
905905
if( z ){
906906
z = mprintf("%s",z);
907907
add_param_list(z, ';');
908908
}
909
-
909
+
910910
z = (char*)P("QUERY_STRING");
911911
if( z ){
912912
z = mprintf("%s",z);
913913
add_param_list(z, '&');
914914
}
@@ -920,11 +920,11 @@
920920
921921
len = atoi(PD("CONTENT_LENGTH", "0"));
922922
g.zContentType = zType = P("CONTENT_TYPE");
923923
blob_zero(&g.cgiIn);
924924
if( len>0 && zType ){
925
- if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
925
+ if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
926926
|| strncmp(zType,"multipart/form-data",19)==0 ){
927927
z = fossil_malloc( len+1 );
928928
len = fread(z, 1, len, g.httpIn);
929929
z[len] = 0;
930930
cgi_trace(z);
@@ -950,11 +950,11 @@
950950
/* FIXMEs:
951951
952952
- See if fossil really needs g.cgiIn to be set for this purpose
953953
(i don't think it does). If it does then fill g.cgiIn and
954954
refactor to parse the JSON from there.
955
-
955
+
956956
- After parsing POST JSON, copy the "first layer" of keys/values
957957
to cgi_setenv(), honoring the upper-case distinction used
958958
in add_param_list(). However...
959959
960960
- If we do that then we might get a disconnect in precedence of
@@ -1226,11 +1226,11 @@
12261226
** loaded into g.zIpAddr.
12271227
*/
12281228
static const char *cgi_accept_forwarded_for(const char *z){
12291229
int i;
12301230
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")!=0 ) return 0;
1231
-
1231
+
12321232
i = strlen(z)-1;
12331233
while( i>=0 && z[i]!=',' && !fossil_isspace(z[i]) ) i--;
12341234
return &z[++i];
12351235
}
12361236
@@ -1297,11 +1297,11 @@
12971297
cgi_setenv("SCRIPT_NAME", "");
12981298
for(i=0; zToken[i] && zToken[i]!='?'; i++){}
12991299
if( zToken[i] ) zToken[i++] = 0;
13001300
cgi_setenv("PATH_INFO", zToken);
13011301
cgi_setenv("QUERY_STRING", &zToken[i]);
1302
-
1302
+
13031303
/* Get all the optional fields that follow the first line.
13041304
*/
13051305
while( fgets(zLine,sizeof(zLine),g.httpIn) ){
13061306
char *zFieldName;
13071307
char *zVal;
@@ -1331,23 +1331,12 @@
13311331
cgi_setenv("HTTP_HOST", zVal);
13321332
}else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
13331333
cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
13341334
}else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
13351335
cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
1336
- }else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){
1337
- char* p = zVal;
1338
- /*
1339
- ** x-forwarded-for header is a list of comma-separated addresses,
1340
- ** with leftmost address corresponding to the client
1341
- */
1342
- while(*p && *p != ',') p++;
1343
- *p = '\0';
1344
- zIpAddr = mprintf( "%s", zVal );
1345
-#if 0
13461336
}else if( fossil_strcmp(zFieldName,"referer:")==0 ){
13471337
cgi_setenv("HTTP_REFERER", zVal);
1348
-#endif
13491338
}else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
13501339
cgi_setenv("HTTP_USER_AGENT", zVal);
13511340
}else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){
13521341
const char *zIpAddr = cgi_accept_forwarded_for(zVal);
13531342
if( zIpAddr!=0 ){
@@ -1403,11 +1392,11 @@
14031392
const char *zType = 0;
14041393
int i, content_length = 0;
14051394
char zLine[2000]; /* A single line of input. */
14061395
14071396
if( zIpAddr ){
1408
- if( nCycles==0 ){
1397
+ if( nCycles==0 ){
14091398
cgi_setenv("REMOTE_ADDR", zIpAddr);
14101399
g.zIpAddr = mprintf("%s", zIpAddr);
14111400
}
14121401
}else{
14131402
fossil_panic("missing SSH IP address");
@@ -1469,11 +1458,11 @@
14691458
if( nCycles==0 ){
14701459
cgi_setenv("PATH_INFO", zToken);
14711460
}else{
14721461
cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
14731462
}
1474
-
1463
+
14751464
/* Get all the optional fields that follow the first line.
14761465
*/
14771466
while( fgets(zLine,sizeof(zLine),g.httpIn) ){
14781467
char *zFieldName;
14791468
char *zVal;
@@ -1650,11 +1639,11 @@
16501639
cgi_init();
16511640
}
16521641
16531642
16541643
#if INTERFACE
1655
-/*
1644
+/*
16561645
** Bitmap values for the flags parameter to cgi_http_server().
16571646
*/
16581647
#define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
16591648
#define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
16601649
@@ -1829,15 +1818,13 @@
18291818
" port in the range %d..%d", mnPort, mxPort);
18301819
}
18311820
}
18321821
if( iPort>mxPort ) return 1;
18331822
listen(listener,10);
1834
- if( iPort>mnPort ){
1835
- fossil_print("Listening for %s requests on TCP port %d\n",
1836
- (flags & HTTP_SERVER_SCGI)!=0?"SCGI":"HTTP", iPort);
1837
- fflush(stdout);
1838
- }
1823
+ fossil_print("Listening for %s requests on TCP port %d\n",
1824
+ (flags & HTTP_SERVER_SCGI)!=0?"SCGI":"HTTP", iPort);
1825
+ fflush(stdout);
18391826
if( zBrowser ){
18401827
zBrowser = mprintf(zBrowser, iPort);
18411828
#if defined(__CYGWIN__)
18421829
/* On Cygwin, we can do better than "echo" */
18431830
if( memcmp(zBrowser, "echo ", 5)==0 ){
@@ -1892,11 +1879,11 @@
18921879
/* Bury dead children */
18931880
while( waitpid(0, 0, WNOHANG)>0 ){
18941881
nchildren--;
18951882
}
18961883
}
1897
- /* NOT REACHED */
1884
+ /* NOT REACHED */
18981885
fossil_exit(1);
18991886
#endif // WIN32
19001887
/* NOT REACHED */
19011888
return 0;
19021889
}
@@ -1980,11 +1967,11 @@
19801967
p->tm_mon %= 12;
19811968
}
19821969
isLeapYr = p->tm_year%4==0 && (p->tm_year%100!=0 || (p->tm_year+300)%400==0);
19831970
p->tm_yday = priorDays[p->tm_mon] + p->tm_mday - 1;
19841971
if( isLeapYr && p->tm_mon>1 ) p->tm_yday++;
1985
- nDay = (p->tm_year-70)*365 + (p->tm_year-69)/4 -p->tm_year/100 +
1972
+ nDay = (p->tm_year-70)*365 + (p->tm_year-69)/4 -p->tm_year/100 +
19861973
(p->tm_year+300)/400 + p->tm_yday;
19871974
t = ((nDay*24 + p->tm_hour)*60 + p->tm_min)*60 + p->tm_sec;
19881975
return t;
19891976
}
19901977
19911978
--- src/cgi.c
+++ src/cgi.c
@@ -267,11 +267,11 @@
267 zTok = strtok_r(0, ",\"",&zPos)){}
268 fossil_free(zBuf);
269 if(zTok) return 1;
270 }
271 }
272
273 return 0;
274 }
275 #endif
276
277 /*
@@ -498,11 +498,11 @@
498 ** must be made of zValue.
499 */
500 void cgi_setenv(const char *zName, const char *zValue){
501 cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0);
502 }
503
504
505 /*
506 ** Add a list of query parameters or cookies to the parameter set.
507 **
508 ** Each parameter is of the form NAME=VALUE. Both the NAME and the
@@ -616,11 +616,11 @@
616 break;
617 }
618 }
619 *pz = &z[i];
620 get_line_from_string(pz, pLen);
621 return z;
622 }
623
624 /*
625 ** Tokenize a line of text into as many as nArg tokens. Make
626 ** azArg[] point to the start of each token.
@@ -723,11 +723,11 @@
723 cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z, 1);
724 }
725 }
726 }
727 }
728 }
729 }
730
731
732 #ifdef FOSSIL_ENABLE_JSON
733 /*
@@ -875,11 +875,11 @@
875 char *z;
876 const char *zType;
877 int len;
878 const char *zRequestUri = cgi_parameter("REQUEST_URI",0);
879 const char *zScriptName = cgi_parameter("SCRIPT_NAME",0);
880 const char *zPathInfo = cgi_parameter("PATH_INFO","");
881
882 #ifdef FOSSIL_ENABLE_JSON
883 json_main_bootstrap();
884 #endif
885 g.isHTTP = 1;
@@ -904,11 +904,11 @@
904 z = (char*)P("HTTP_COOKIE");
905 if( z ){
906 z = mprintf("%s",z);
907 add_param_list(z, ';');
908 }
909
910 z = (char*)P("QUERY_STRING");
911 if( z ){
912 z = mprintf("%s",z);
913 add_param_list(z, '&');
914 }
@@ -920,11 +920,11 @@
920
921 len = atoi(PD("CONTENT_LENGTH", "0"));
922 g.zContentType = zType = P("CONTENT_TYPE");
923 blob_zero(&g.cgiIn);
924 if( len>0 && zType ){
925 if( fossil_strcmp(zType,"application/x-www-form-urlencoded")==0
926 || strncmp(zType,"multipart/form-data",19)==0 ){
927 z = fossil_malloc( len+1 );
928 len = fread(z, 1, len, g.httpIn);
929 z[len] = 0;
930 cgi_trace(z);
@@ -950,11 +950,11 @@
950 /* FIXMEs:
951
952 - See if fossil really needs g.cgiIn to be set for this purpose
953 (i don't think it does). If it does then fill g.cgiIn and
954 refactor to parse the JSON from there.
955
956 - After parsing POST JSON, copy the "first layer" of keys/values
957 to cgi_setenv(), honoring the upper-case distinction used
958 in add_param_list(). However...
959
960 - If we do that then we might get a disconnect in precedence of
@@ -1226,11 +1226,11 @@
1226 ** loaded into g.zIpAddr.
1227 */
1228 static const char *cgi_accept_forwarded_for(const char *z){
1229 int i;
1230 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")!=0 ) return 0;
1231
1232 i = strlen(z)-1;
1233 while( i>=0 && z[i]!=',' && !fossil_isspace(z[i]) ) i--;
1234 return &z[++i];
1235 }
1236
@@ -1297,11 +1297,11 @@
1297 cgi_setenv("SCRIPT_NAME", "");
1298 for(i=0; zToken[i] && zToken[i]!='?'; i++){}
1299 if( zToken[i] ) zToken[i++] = 0;
1300 cgi_setenv("PATH_INFO", zToken);
1301 cgi_setenv("QUERY_STRING", &zToken[i]);
1302
1303 /* Get all the optional fields that follow the first line.
1304 */
1305 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1306 char *zFieldName;
1307 char *zVal;
@@ -1331,23 +1331,12 @@
1331 cgi_setenv("HTTP_HOST", zVal);
1332 }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
1333 cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
1334 }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
1335 cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
1336 }else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){
1337 char* p = zVal;
1338 /*
1339 ** x-forwarded-for header is a list of comma-separated addresses,
1340 ** with leftmost address corresponding to the client
1341 */
1342 while(*p && *p != ',') p++;
1343 *p = '\0';
1344 zIpAddr = mprintf( "%s", zVal );
1345 #if 0
1346 }else if( fossil_strcmp(zFieldName,"referer:")==0 ){
1347 cgi_setenv("HTTP_REFERER", zVal);
1348 #endif
1349 }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
1350 cgi_setenv("HTTP_USER_AGENT", zVal);
1351 }else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){
1352 const char *zIpAddr = cgi_accept_forwarded_for(zVal);
1353 if( zIpAddr!=0 ){
@@ -1403,11 +1392,11 @@
1403 const char *zType = 0;
1404 int i, content_length = 0;
1405 char zLine[2000]; /* A single line of input. */
1406
1407 if( zIpAddr ){
1408 if( nCycles==0 ){
1409 cgi_setenv("REMOTE_ADDR", zIpAddr);
1410 g.zIpAddr = mprintf("%s", zIpAddr);
1411 }
1412 }else{
1413 fossil_panic("missing SSH IP address");
@@ -1469,11 +1458,11 @@
1469 if( nCycles==0 ){
1470 cgi_setenv("PATH_INFO", zToken);
1471 }else{
1472 cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
1473 }
1474
1475 /* Get all the optional fields that follow the first line.
1476 */
1477 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1478 char *zFieldName;
1479 char *zVal;
@@ -1650,11 +1639,11 @@
1650 cgi_init();
1651 }
1652
1653
1654 #if INTERFACE
1655 /*
1656 ** Bitmap values for the flags parameter to cgi_http_server().
1657 */
1658 #define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
1659 #define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
1660
@@ -1829,15 +1818,13 @@
1829 " port in the range %d..%d", mnPort, mxPort);
1830 }
1831 }
1832 if( iPort>mxPort ) return 1;
1833 listen(listener,10);
1834 if( iPort>mnPort ){
1835 fossil_print("Listening for %s requests on TCP port %d\n",
1836 (flags & HTTP_SERVER_SCGI)!=0?"SCGI":"HTTP", iPort);
1837 fflush(stdout);
1838 }
1839 if( zBrowser ){
1840 zBrowser = mprintf(zBrowser, iPort);
1841 #if defined(__CYGWIN__)
1842 /* On Cygwin, we can do better than "echo" */
1843 if( memcmp(zBrowser, "echo ", 5)==0 ){
@@ -1892,11 +1879,11 @@
1892 /* Bury dead children */
1893 while( waitpid(0, 0, WNOHANG)>0 ){
1894 nchildren--;
1895 }
1896 }
1897 /* NOT REACHED */
1898 fossil_exit(1);
1899 #endif // WIN32
1900 /* NOT REACHED */