Fossil SCM
Merge from trunk
Commit
c4fca467f727745c95c61bfc2e725e2ddce3a433
Parent
eb5a49f83500c79…
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 @@ | ||
| 22 | 22 | |
| 23 | 23 | cd win; nmake /f Makefile.msc |
| 24 | 24 | |
| 25 | 25 | If you have trouble, or you want to do something fancy, just look at |
| 26 | 26 | 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 | |
| 28 | 28 | Makefile.classic to an alternative name such as "GNUMakefile", |
| 29 | 29 | "BSDMakefile", or "makefile" and editing the copy. |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | BUILDING OUTSIDE THE SOURCE TREE |
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | Do not edit src/main.mk directly. Update src/makemake.tcl and |
| 62 | 62 | then rerun it. |
| 63 | 63 | |
| 64 | 64 | * The *.h header files are automatically generated using a program |
| 65 | 65 | 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 | |
| 67 | 67 | src/makeheaders.html. |
| 68 | 68 | |
| 69 | 69 | * Most *.c source files are preprocessed using a program called |
| 70 | 70 | "translate". The sources to translate are found in src/translate.c. |
| 71 | 71 | A header comment in src/translate.c explains in detail what it does. |
| 72 | 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 |
| --- 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 @@ | ||
| 1 | 1 | Copyright 2007 D. Richard Hipp. All rights reserved. |
| 2 | 2 | |
| 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 | |
| 5 | 5 | following conditions are met: |
| 6 | 6 | |
| 7 | 7 | 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 | |
| 9 | 9 | following disclaimer. |
| 10 | 10 | |
| 11 | 11 | 2. Redistributions in binary form must reproduce the above |
| 12 | 12 | copyright notice, this list of conditions and the |
| 13 | 13 | following disclaimer in the documentation and/or other |
| 14 | 14 | materials provided with the distribution. |
| 15 | 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 | |
| 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 | 18 | 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 | |
| 20 | 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 | |
| 21 | +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| 22 | +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | |
| 23 | 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, | |
| 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 | 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 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 | |
| 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 | 30 | as representing official policies, either expressed or implied, of anybody |
| 31 | 31 | else. |
| 32 | 32 | |
| 33 | 33 | 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 @@ | ||
| 37 | 37 | # care about testing the end result, this can be blank. |
| 38 | 38 | # |
| 39 | 39 | TCLSH = tclsh |
| 40 | 40 | |
| 41 | 41 | 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 | |
| 43 | 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | 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 | 45 | |
| 49 | 46 | include $(SRCDIR)/main.mk |
| 50 | 47 | |
| 51 | 48 | distclean: clean |
| 52 | 49 | rm -f autoconfig.h config.log Makefile |
| 53 | 50 |
| --- 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 |
M
VERSION
+1
-1
| --- VERSION | ||
| +++ VERSION | ||
| @@ -1,1 +1,1 @@ | ||
| 1 | -1.28 | |
| 1 | +1.30 | |
| 2 | 2 |
| --- VERSION | |
| +++ VERSION | |
| @@ -1,1 +1,1 @@ | |
| 1 | 1.28 |
| 2 |
| --- VERSION | |
| +++ VERSION | |
| @@ -1,1 +1,1 @@ | |
| 1 | 1.30 |
| 2 |
M
auto.def
+46
-6
| --- auto.def | ||
| +++ auto.def | ||
| @@ -4,17 +4,19 @@ | ||
| 4 | 4 | |
| 5 | 5 | options { |
| 6 | 6 | with-openssl:path|auto|none |
| 7 | 7 | => {Look for openssl in the given path, or auto or none} |
| 8 | 8 | with-zlib:path => {Look for zlib in the given path} |
| 9 | + with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages} | |
| 9 | 10 | with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} |
| 10 | 11 | with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism} |
| 11 | 12 | with-tcl-private-stubs=0 |
| 12 | 13 | => {Enable Tcl integration via private stubs mechanism} |
| 13 | 14 | internal-sqlite=1 => {Don't use the internal SQLite, use the system one} |
| 14 | 15 | static=0 => {Link a static executable} |
| 15 | 16 | lineedit=1 => {Disable line editing} |
| 17 | + fusefs=1 => {Disable the Fuse Filesystem} | |
| 16 | 18 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 17 | 19 | ipv6=1 => {Disable IPv6 support} |
| 18 | 20 | json=0 => {Build with fossil JSON API enabled} |
| 19 | 21 | } |
| 20 | 22 | |
| @@ -42,17 +44,17 @@ | ||
| 42 | 44 | # the code below will append -ldl to LIBS. |
| 43 | 45 | # |
| 44 | 46 | foreach extralibs {{} {-ldl}} { |
| 45 | 47 | |
| 46 | 48 | # 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. | |
| 50 | 52 | # |
| 51 | 53 | 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)" | |
| 54 | 56 | } |
| 55 | 57 | |
| 56 | 58 | # Success. Update symbols and return. |
| 57 | 59 | # |
| 58 | 60 | define USE_SYSTEM_SQLITE 1 |
| @@ -70,28 +72,38 @@ | ||
| 70 | 72 | define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500 |
| 71 | 73 | } |
| 72 | 74 | |
| 73 | 75 | if {[opt-bool fossil-debug]} { |
| 74 | 76 | define-append EXTRA_CFLAGS -DFOSSIL_DEBUG |
| 77 | + msg-result "Debugging support enabled" | |
| 75 | 78 | } |
| 76 | 79 | |
| 77 | 80 | if {[opt-bool json]} { |
| 78 | 81 | # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON |
| 79 | 82 | # is required in the CFLAGS because json*.c |
| 80 | 83 | # have #ifdef guards around the whole file without |
| 81 | 84 | # reading config.h first. |
| 82 | 85 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 83 | 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" | |
| 84 | 94 | } |
| 85 | 95 | |
| 86 | 96 | #if {[opt-bool markdown]} { |
| 87 | 97 | # # no-op. Markdown is now enabled by default. |
| 98 | +# msg-result "Markdown support enabled" | |
| 88 | 99 | #} |
| 89 | 100 | |
| 90 | 101 | if {[opt-bool static]} { |
| 91 | 102 | # XXX: This will not work on all systems. |
| 92 | 103 | define-append EXTRA_LDFLAGS -static |
| 104 | + msg-result "Trying to link statically" | |
| 93 | 105 | } |
| 94 | 106 | |
| 95 | 107 | if {[opt-bool ipv6]} { |
| 96 | 108 | define-append EXTRA_CFLAGS -DWITH_IPV6 |
| 97 | 109 | msg-result "IPv6 support enabled" |
| @@ -236,10 +248,22 @@ | ||
| 236 | 248 | } |
| 237 | 249 | } else { |
| 238 | 250 | user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support" |
| 239 | 251 | } |
| 240 | 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 | +} | |
| 241 | 265 | |
| 242 | 266 | if {[opt-bool lineedit]} { |
| 243 | 267 | # Need readline-compatible line editing |
| 244 | 268 | cc-with {-includes stdio.h} { |
| 245 | 269 | if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} { |
| @@ -258,16 +282,32 @@ | ||
| 258 | 282 | if {[string match *mingw* [get-define host]]} { |
| 259 | 283 | define-append LIBS -lwsock32 |
| 260 | 284 | } |
| 261 | 285 | } |
| 262 | 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 | +} | |
| 263 | 295 | |
| 264 | 296 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 265 | 297 | if {![cc-check-functions getpassphrase]} { |
| 266 | 298 | # Haiku needs this |
| 267 | 299 | cc-check-function-in-lib getpass bsd |
| 268 | 300 | } |
| 269 | 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 | +} | |
| 270 | 311 | |
| 271 | 312 | make-template Makefile.in |
| 272 | -make-template Makefile.Cygwin.in | |
| 273 | 313 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 274 | 314 |
| --- 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 |
M
auto.def
+46
-6
| --- auto.def | ||
| +++ auto.def | ||
| @@ -4,17 +4,19 @@ | ||
| 4 | 4 | |
| 5 | 5 | options { |
| 6 | 6 | with-openssl:path|auto|none |
| 7 | 7 | => {Look for openssl in the given path, or auto or none} |
| 8 | 8 | with-zlib:path => {Look for zlib in the given path} |
| 9 | + with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages} | |
| 9 | 10 | with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} |
| 10 | 11 | with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism} |
| 11 | 12 | with-tcl-private-stubs=0 |
| 12 | 13 | => {Enable Tcl integration via private stubs mechanism} |
| 13 | 14 | internal-sqlite=1 => {Don't use the internal SQLite, use the system one} |
| 14 | 15 | static=0 => {Link a static executable} |
| 15 | 16 | lineedit=1 => {Disable line editing} |
| 17 | + fusefs=1 => {Disable the Fuse Filesystem} | |
| 16 | 18 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 17 | 19 | ipv6=1 => {Disable IPv6 support} |
| 18 | 20 | json=0 => {Build with fossil JSON API enabled} |
| 19 | 21 | } |
| 20 | 22 | |
| @@ -42,17 +44,17 @@ | ||
| 42 | 44 | # the code below will append -ldl to LIBS. |
| 43 | 45 | # |
| 44 | 46 | foreach extralibs {{} {-ldl}} { |
| 45 | 47 | |
| 46 | 48 | # 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. | |
| 50 | 52 | # |
| 51 | 53 | 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)" | |
| 54 | 56 | } |
| 55 | 57 | |
| 56 | 58 | # Success. Update symbols and return. |
| 57 | 59 | # |
| 58 | 60 | define USE_SYSTEM_SQLITE 1 |
| @@ -70,28 +72,38 @@ | ||
| 70 | 72 | define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500 |
| 71 | 73 | } |
| 72 | 74 | |
| 73 | 75 | if {[opt-bool fossil-debug]} { |
| 74 | 76 | define-append EXTRA_CFLAGS -DFOSSIL_DEBUG |
| 77 | + msg-result "Debugging support enabled" | |
| 75 | 78 | } |
| 76 | 79 | |
| 77 | 80 | if {[opt-bool json]} { |
| 78 | 81 | # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON |
| 79 | 82 | # is required in the CFLAGS because json*.c |
| 80 | 83 | # have #ifdef guards around the whole file without |
| 81 | 84 | # reading config.h first. |
| 82 | 85 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 83 | 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" | |
| 84 | 94 | } |
| 85 | 95 | |
| 86 | 96 | #if {[opt-bool markdown]} { |
| 87 | 97 | # # no-op. Markdown is now enabled by default. |
| 98 | +# msg-result "Markdown support enabled" | |
| 88 | 99 | #} |
| 89 | 100 | |
| 90 | 101 | if {[opt-bool static]} { |
| 91 | 102 | # XXX: This will not work on all systems. |
| 92 | 103 | define-append EXTRA_LDFLAGS -static |
| 104 | + msg-result "Trying to link statically" | |
| 93 | 105 | } |
| 94 | 106 | |
| 95 | 107 | if {[opt-bool ipv6]} { |
| 96 | 108 | define-append EXTRA_CFLAGS -DWITH_IPV6 |
| 97 | 109 | msg-result "IPv6 support enabled" |
| @@ -236,10 +248,22 @@ | ||
| 236 | 248 | } |
| 237 | 249 | } else { |
| 238 | 250 | user-error "OpenSSL not found. Consider --with-openssl=none to disable HTTPS support" |
| 239 | 251 | } |
| 240 | 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 | +} | |
| 241 | 265 | |
| 242 | 266 | if {[opt-bool lineedit]} { |
| 243 | 267 | # Need readline-compatible line editing |
| 244 | 268 | cc-with {-includes stdio.h} { |
| 245 | 269 | if {[cc-check-includes readline/readline.h] && [cc-check-function-in-lib readline readline]} { |
| @@ -258,16 +282,32 @@ | ||
| 258 | 282 | if {[string match *mingw* [get-define host]]} { |
| 259 | 283 | define-append LIBS -lwsock32 |
| 260 | 284 | } |
| 261 | 285 | } |
| 262 | 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 | +} | |
| 263 | 295 | |
| 264 | 296 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 265 | 297 | if {![cc-check-functions getpassphrase]} { |
| 266 | 298 | # Haiku needs this |
| 267 | 299 | cc-check-function-in-lib getpass bsd |
| 268 | 300 | } |
| 269 | 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 | +} | |
| 270 | 311 | |
| 271 | 312 | make-template Makefile.in |
| 272 | -make-template Makefile.Cygwin.in | |
| 273 | 313 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 274 | 314 |
| --- 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 |
+25
-8
| --- autosetup/autosetup | ||
| +++ autosetup/autosetup | ||
| @@ -925,11 +925,11 @@ | ||
| 925 | 925 | } |
| 926 | 926 | |
| 927 | 927 | # Load module source in the global scope by executing the given command |
| 928 | 928 | proc automf_load {args} { |
| 929 | 929 | 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)] | |
| 931 | 931 | } |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | # Initial settings |
| 935 | 935 | set autosetup(exe) $::argv0 |
| @@ -1706,18 +1706,35 @@ | ||
| 1706 | 1706 | return $msg |
| 1707 | 1707 | } |
| 1708 | 1708 | |
| 1709 | 1709 | # Given the return from [catch {...} msg opts], returns an appropriate |
| 1710 | 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. | |
| 1711 | 1713 | # |
| 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 | +# | |
| 1713 | 1716 | # |
| 1714 | -proc error-dump {msg opts} { | |
| 1717 | +proc error-dump {msg opts fulltrace} { | |
| 1715 | 1718 | 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 | + } | |
| 1717 | 1724 | } 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 | |
| 1719 | 1736 | } |
| 1720 | 1737 | } |
| 1721 | 1738 | } |
| 1722 | 1739 | |
| 1723 | 1740 | # ----- module text-formatting ----- |
| @@ -1886,13 +1903,13 @@ | ||
| 1886 | 1903 | # Entry/Exit |
| 1887 | 1904 | # |
| 1888 | 1905 | if {$autosetup(debug)} { |
| 1889 | 1906 | main $argv |
| 1890 | 1907 | } |
| 1891 | -if {[catch {main $argv} msg] == 1} { | |
| 1908 | +if {[catch {main $argv} msg opts] == 1} { | |
| 1892 | 1909 | 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)} { | |
| 1895 | 1912 | puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace" |
| 1896 | 1913 | } |
| 1897 | 1914 | exit 1 |
| 1898 | 1915 | } |
| 1899 | 1916 |
| --- 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 @@ | ||
| 94 | 94 | define SHOBJ_LDFLAGS -b |
| 95 | 95 | define SH_CFLAGS +z |
| 96 | 96 | define SH_LINKFLAGS -Wl,+s |
| 97 | 97 | define LD_LIBRARY_PATH SHLIB_PATH |
| 98 | 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 | + } | |
| 99 | 108 | } |
| 100 | 109 | |
| 101 | 110 | if {![is-defined SHOBJ_LDFLAGS_R]} { |
| 102 | 111 | define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS] |
| 103 | 112 | } |
| 104 | 113 |
| --- 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 |
+9
-7
| --- autosetup/cc.tcl | ||
| +++ autosetup/cc.tcl | ||
| @@ -333,11 +333,11 @@ | ||
| 333 | 333 | } |
| 334 | 334 | -libs { |
| 335 | 335 | # Note that new libraries are added before previous libraries |
| 336 | 336 | set new($name) [list {*}$value {*}$new($name)] |
| 337 | 337 | } |
| 338 | - -link - -lang { | |
| 338 | + -link - -lang - -nooutput { | |
| 339 | 339 | set new($name) $value |
| 340 | 340 | } |
| 341 | 341 | -source - -sourcefile - -code { |
| 342 | 342 | # XXX: These probably are only valid directly from cctest |
| 343 | 343 | set new($name) $value |
| @@ -428,10 +428,11 @@ | ||
| 428 | 428 | ## -lang c|c++ Use the C (default) or C++ compiler |
| 429 | 429 | ## -libs liblist List of libraries to link, e.g. {-ldl -lm} |
| 430 | 430 | ## -code code Code to compile in the body of main() |
| 431 | 431 | ## -source code Compile a complete program. Ignore -includes, -declare and -code |
| 432 | 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 | |
| 433 | 434 | # |
| 434 | 435 | # Unless -source or -sourcefile is specified, the C program looks like: |
| 435 | 436 | # |
| 436 | 437 | ## #include <firstinclude> /* same for remaining includes in the list */ |
| 437 | 438 | ## |
| @@ -521,11 +522,12 @@ | ||
| 521 | 522 | } |
| 522 | 523 | |
| 523 | 524 | writefile $src $lines\n |
| 524 | 525 | |
| 525 | 526 | 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])} { | |
| 527 | 529 | configlog "Failed: [join $cmdline]" |
| 528 | 530 | configlog $result |
| 529 | 531 | configlog "============" |
| 530 | 532 | configlog "The failed code was:" |
| 531 | 533 | configlog $lines |
| @@ -671,27 +673,27 @@ | ||
| 671 | 673 | } |
| 672 | 674 | |
| 673 | 675 | define CCACHE [find-an-executable [get-env CCACHE ccache]] |
| 674 | 676 | |
| 675 | 677 | # 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} | |
| 677 | 679 | set autosetup(cc-include-deps) {} |
| 678 | 680 | |
| 679 | 681 | msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]" |
| 680 | 682 | if {[get-define CXX] ne "false"} { |
| 681 | 683 | msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]" |
| 682 | 684 | } |
| 683 | 685 | msg-result "Build C compiler...[get-define CC_FOR_BUILD]" |
| 684 | 686 | |
| 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. | |
| 687 | 689 | switch -glob -- [get-define host] { |
| 688 | 690 | *-*-darwin* { |
| 689 | - if {[cctest -cflags {-gstabs}]} { | |
| 690 | - define cc-default-debug -gstabs | |
| 691 | + if {[cctest -cflags {-g0}]} { | |
| 692 | + define cc-default-debug -g0 | |
| 691 | 693 | } |
| 692 | 694 | } |
| 693 | 695 | } |
| 694 | 696 | |
| 695 | 697 | if {![cc-check-includes stdlib.h]} { |
| 696 | 698 | user-error "Compiler does not work. See config.log" |
| 697 | 699 | } |
| 698 | 700 |
| --- 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 |
+240
-331
| --- autosetup/config.guess | ||
| +++ autosetup/config.guess | ||
| @@ -1,44 +1,38 @@ | ||
| 1 | 1 | #! /bin/sh |
| 2 | 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. | |
| 3 | +# Copyright 1992-2014 Free Software Foundation, Inc. | |
| 6 | 4 | |
| 7 | -timestamp='2010-09-24' | |
| 5 | +timestamp='2014-03-23' | |
| 8 | 6 | |
| 9 | 7 | # This file is free software; you can redistribute it and/or modify it |
| 10 | 8 | # 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 | |
| 12 | 10 | # (at your option) any later version. |
| 13 | 11 | # |
| 14 | 12 | # This program is distributed in the hope that it will be useful, but |
| 15 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | 15 | # General Public License for more details. |
| 18 | 16 | # |
| 19 | 17 | # 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/>. | |
| 23 | 19 | # |
| 24 | 20 | # As a special exception to the GNU General Public License, if you |
| 25 | 21 | # distribute this file as part of a program that contains a |
| 26 | 22 | # 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. | |
| 37 | 28 | # |
| 38 | 29 | # You can get the latest version of this script from: |
| 39 | 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 | + | |
| 40 | 34 | |
| 41 | 35 | me=`echo "$0" | sed -e 's,.*/,,'` |
| 42 | 36 | |
| 43 | 37 | usage="\ |
| 44 | 38 | Usage: $0 [OPTION] |
| @@ -54,13 +48,11 @@ | ||
| 54 | 48 | |
| 55 | 49 | version="\ |
| 56 | 50 | GNU config.guess ($timestamp) |
| 57 | 51 | |
| 58 | 52 | 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. | |
| 62 | 54 | |
| 63 | 55 | This is free software; see the source for copying conditions. There is NO |
| 64 | 56 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 65 | 57 | |
| 66 | 58 | help=" |
| @@ -90,11 +82,11 @@ | ||
| 90 | 82 | if test $# != 0; then |
| 91 | 83 | echo "$me: too many arguments$help" >&2 |
| 92 | 84 | exit 1 |
| 93 | 85 | fi |
| 94 | 86 | |
| 95 | -trap 'exit 1' HUP INT TERM | |
| 87 | +trap 'exit 1' 1 2 15 | |
| 96 | 88 | |
| 97 | 89 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
| 98 | 90 | # compiler to aid in system detection is discouraged as it requires |
| 99 | 91 | # temporary files to be created and, as you can see below, it is a |
| 100 | 92 | # headache to deal with in a portable fashion. |
| @@ -104,11 +96,11 @@ | ||
| 104 | 96 | |
| 105 | 97 | # Portable tmp directory creation inspired by the Autoconf team. |
| 106 | 98 | |
| 107 | 99 | set_cc_for_build=' |
| 108 | 100 | 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 ; | |
| 110 | 102 | : ${TMPDIR=/tmp} ; |
| 111 | 103 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
| 112 | 104 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
| 113 | 105 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || |
| 114 | 106 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
| @@ -137,17 +129,38 @@ | ||
| 137 | 129 | |
| 138 | 130 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
| 139 | 131 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
| 140 | 132 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
| 141 | 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 | |
| 142 | 155 | |
| 143 | 156 | # Note: order is significant - the case branches are not exclusive. |
| 144 | 157 | |
| 145 | 158 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in |
| 146 | 159 | *:NetBSD:*:*) |
| 147 | 160 | # NetBSD (nbsd) targets should (where applicable) match one or |
| 148 | - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, | |
| 161 | + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, | |
| 149 | 162 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently |
| 150 | 163 | # switched to ELF, *-*-netbsd* would select the old |
| 151 | 164 | # object file format. This provides both forward |
| 152 | 165 | # compatibility and a consistent mechanism for selecting the |
| 153 | 166 | # object file format. |
| @@ -179,11 +192,11 @@ | ||
| 179 | 192 | else |
| 180 | 193 | os=netbsdelf |
| 181 | 194 | fi |
| 182 | 195 | ;; |
| 183 | 196 | *) |
| 184 | - os=netbsd | |
| 197 | + os=netbsd | |
| 185 | 198 | ;; |
| 186 | 199 | esac |
| 187 | 200 | # The OS release |
| 188 | 201 | # Debian GNU/NetBSD machines have a different userland, and |
| 189 | 202 | # thus, need a distinct triplet. However, they do not need |
| @@ -200,10 +213,14 @@ | ||
| 200 | 213 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
| 201 | 214 | # contains redundant information, the shorter form: |
| 202 | 215 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
| 203 | 216 | echo "${machine}-${os}${release}" |
| 204 | 217 | exit ;; |
| 218 | + *:Bitrig:*:*) | |
| 219 | + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` | |
| 220 | + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} | |
| 221 | + exit ;; | |
| 205 | 222 | *:OpenBSD:*:*) |
| 206 | 223 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
| 207 | 224 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
| 208 | 225 | exit ;; |
| 209 | 226 | *:ekkoBSD:*:*) |
| @@ -222,11 +239,11 @@ | ||
| 222 | 239 | case $UNAME_RELEASE in |
| 223 | 240 | *4.0) |
| 224 | 241 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
| 225 | 242 | ;; |
| 226 | 243 | *5.*) |
| 227 | - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` | |
| 244 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` | |
| 228 | 245 | ;; |
| 229 | 246 | esac |
| 230 | 247 | # According to Compaq, /usr/sbin/psrinfo has been available on |
| 231 | 248 | # OSF/1 and Tru64 systems produced since 1995. I hope that |
| 232 | 249 | # covers most systems running today. This code pipes the CPU |
| @@ -268,11 +285,14 @@ | ||
| 268 | 285 | # A Vn.n version is a released version. |
| 269 | 286 | # A Tn.n version is a released field test version. |
| 270 | 287 | # A Xn.n version is an unreleased experimental baselevel. |
| 271 | 288 | # 1.2 uses "1.2" for uname -r. |
| 272 | 289 | 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 ;; | |
| 274 | 294 | Alpha\ *:Windows_NT*:*) |
| 275 | 295 | # How do we know it's Interix rather than the generic POSIX subsystem? |
| 276 | 296 | # Should we change UNAME_MACHINE based on the output of uname instead |
| 277 | 297 | # of the specific Alpha model? |
| 278 | 298 | echo alpha-pc-interix |
| @@ -294,16 +314,16 @@ | ||
| 294 | 314 | exit ;; |
| 295 | 315 | *:z/VM:*:*) |
| 296 | 316 | echo s390-ibm-zvmoe |
| 297 | 317 | exit ;; |
| 298 | 318 | *:OS400:*:*) |
| 299 | - echo powerpc-ibm-os400 | |
| 319 | + echo powerpc-ibm-os400 | |
| 300 | 320 | exit ;; |
| 301 | 321 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
| 302 | 322 | echo arm-acorn-riscix${UNAME_RELEASE} |
| 303 | 323 | exit ;; |
| 304 | - arm:riscos:*:*|arm:RISCOS:*:*) | |
| 324 | + arm*:riscos:*:*|arm*:RISCOS:*:*) | |
| 305 | 325 | echo arm-unknown-riscos |
| 306 | 326 | exit ;; |
| 307 | 327 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
| 308 | 328 | echo hppa1.1-hitachi-hiuxmpp |
| 309 | 329 | exit ;; |
| @@ -393,27 +413,27 @@ | ||
| 393 | 413 | # to the lowercase version "mint" (or "freemint"). Finally |
| 394 | 414 | # the system name "TOS" denotes a system which is actually not |
| 395 | 415 | # MiNT. But MiNT is downward compatible to TOS, so this should |
| 396 | 416 | # be no problem. |
| 397 | 417 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) |
| 398 | - echo m68k-atari-mint${UNAME_RELEASE} | |
| 418 | + echo m68k-atari-mint${UNAME_RELEASE} | |
| 399 | 419 | exit ;; |
| 400 | 420 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) |
| 401 | 421 | echo m68k-atari-mint${UNAME_RELEASE} |
| 402 | - exit ;; | |
| 422 | + exit ;; | |
| 403 | 423 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) |
| 404 | - echo m68k-atari-mint${UNAME_RELEASE} | |
| 424 | + echo m68k-atari-mint${UNAME_RELEASE} | |
| 405 | 425 | exit ;; |
| 406 | 426 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) |
| 407 | - echo m68k-milan-mint${UNAME_RELEASE} | |
| 408 | - exit ;; | |
| 427 | + echo m68k-milan-mint${UNAME_RELEASE} | |
| 428 | + exit ;; | |
| 409 | 429 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) |
| 410 | - echo m68k-hades-mint${UNAME_RELEASE} | |
| 411 | - exit ;; | |
| 430 | + echo m68k-hades-mint${UNAME_RELEASE} | |
| 431 | + exit ;; | |
| 412 | 432 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) |
| 413 | - echo m68k-unknown-mint${UNAME_RELEASE} | |
| 414 | - exit ;; | |
| 433 | + echo m68k-unknown-mint${UNAME_RELEASE} | |
| 434 | + exit ;; | |
| 415 | 435 | m68k:machten:*:*) |
| 416 | 436 | echo m68k-apple-machten${UNAME_RELEASE} |
| 417 | 437 | exit ;; |
| 418 | 438 | powerpc:machten:*:*) |
| 419 | 439 | echo powerpc-apple-machten${UNAME_RELEASE} |
| @@ -479,12 +499,12 @@ | ||
| 479 | 499 | exit ;; |
| 480 | 500 | m88k:*:3*:R3*) |
| 481 | 501 | echo m88k-motorola-sysv3 |
| 482 | 502 | exit ;; |
| 483 | 503 | 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` | |
| 486 | 506 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] |
| 487 | 507 | then |
| 488 | 508 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ |
| 489 | 509 | [ ${TARGET_BINARY_INTERFACE}x = x ] |
| 490 | 510 | then |
| @@ -493,11 +513,11 @@ | ||
| 493 | 513 | echo m88k-dg-dguxbcs${UNAME_RELEASE} |
| 494 | 514 | fi |
| 495 | 515 | else |
| 496 | 516 | echo i586-dg-dgux${UNAME_RELEASE} |
| 497 | 517 | fi |
| 498 | - exit ;; | |
| 518 | + exit ;; | |
| 499 | 519 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) |
| 500 | 520 | echo m88k-dolphin-sysv3 |
| 501 | 521 | exit ;; |
| 502 | 522 | M88*:*:R3*:*) |
| 503 | 523 | # Delta 88k system running SVR3 |
| @@ -593,56 +613,56 @@ | ||
| 593 | 613 | 9000/31? ) HP_ARCH=m68000 ;; |
| 594 | 614 | 9000/[34]?? ) HP_ARCH=m68k ;; |
| 595 | 615 | 9000/[678][0-9][0-9]) |
| 596 | 616 | if [ -x /usr/bin/getconf ]; then |
| 597 | 617 | 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" ;; | |
| 606 | 626 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 |
| 607 | - esac ;; | |
| 608 | - esac | |
| 627 | + esac ;; | |
| 628 | + esac | |
| 609 | 629 | fi |
| 610 | 630 | if [ "${HP_ARCH}" = "" ]; then |
| 611 | 631 | 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 | + } | |
| 644 | 664 | EOF |
| 645 | 665 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` |
| 646 | 666 | test -z "$HP_ARCH" && HP_ARCH=hppa |
| 647 | 667 | fi ;; |
| 648 | 668 | esac |
| @@ -729,26 +749,26 @@ | ||
| 729 | 749 | parisc*:Lites*:*:*) |
| 730 | 750 | echo hppa1.1-hp-lites |
| 731 | 751 | exit ;; |
| 732 | 752 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) |
| 733 | 753 | echo c1-convex-bsd |
| 734 | - exit ;; | |
| 754 | + exit ;; | |
| 735 | 755 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) |
| 736 | 756 | if getsysinfo -f scalar_acc |
| 737 | 757 | then echo c32-convex-bsd |
| 738 | 758 | else echo c2-convex-bsd |
| 739 | 759 | fi |
| 740 | - exit ;; | |
| 760 | + exit ;; | |
| 741 | 761 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) |
| 742 | 762 | echo c34-convex-bsd |
| 743 | - exit ;; | |
| 763 | + exit ;; | |
| 744 | 764 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) |
| 745 | 765 | echo c38-convex-bsd |
| 746 | - exit ;; | |
| 766 | + exit ;; | |
| 747 | 767 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) |
| 748 | 768 | echo c4-convex-bsd |
| 749 | - exit ;; | |
| 769 | + exit ;; | |
| 750 | 770 | CRAY*Y-MP:*:*:*) |
| 751 | 771 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 752 | 772 | exit ;; |
| 753 | 773 | CRAY*[A-Z]90:*:*:*) |
| 754 | 774 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ |
| @@ -768,18 +788,18 @@ | ||
| 768 | 788 | *:UNICOS/mp:*:*) |
| 769 | 789 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
| 770 | 790 | exit ;; |
| 771 | 791 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
| 772 | 792 | 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 ;; | |
| 777 | 797 | 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}" | |
| 781 | 801 | exit ;; |
| 782 | 802 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) |
| 783 | 803 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} |
| 784 | 804 | exit ;; |
| 785 | 805 | sparc*:BSD/OS:*:*) |
| @@ -787,37 +807,39 @@ | ||
| 787 | 807 | exit ;; |
| 788 | 808 | *:BSD/OS:*:*) |
| 789 | 809 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
| 790 | 810 | exit ;; |
| 791 | 811 | *: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 | |
| 795 | 814 | amd64) |
| 796 | 815 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 797 | 816 | *) |
| 798 | - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
| 817 | + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
| 799 | 818 | esac |
| 800 | 819 | exit ;; |
| 801 | 820 | i*:CYGWIN*:*) |
| 802 | 821 | echo ${UNAME_MACHINE}-pc-cygwin |
| 803 | 822 | exit ;; |
| 823 | + *:MINGW64*:*) | |
| 824 | + echo ${UNAME_MACHINE}-pc-mingw64 | |
| 825 | + exit ;; | |
| 804 | 826 | *:MINGW*:*) |
| 805 | 827 | echo ${UNAME_MACHINE}-pc-mingw32 |
| 806 | 828 | exit ;; |
| 807 | - i*:MSYS*:*) | |
| 808 | - echo ${UNAME_MACHINE}-pc-msys | |
| 809 | - exit ;; | |
| 829 | + *:MSYS*:*) | |
| 830 | + echo ${UNAME_MACHINE}-pc-msys | |
| 831 | + exit ;; | |
| 810 | 832 | 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 | |
| 813 | 835 | exit ;; |
| 814 | 836 | i*:PW*:*) |
| 815 | 837 | echo ${UNAME_MACHINE}-pc-pw32 |
| 816 | 838 | exit ;; |
| 817 | 839 | *:Interix*:*) |
| 818 | - case ${UNAME_MACHINE} in | |
| 840 | + case ${UNAME_MACHINE} in | |
| 819 | 841 | x86) |
| 820 | 842 | echo i586-pc-interix${UNAME_RELEASE} |
| 821 | 843 | exit ;; |
| 822 | 844 | authenticamd | genuineintel | EM64T) |
| 823 | 845 | echo x86_64-unknown-interix${UNAME_RELEASE} |
| @@ -850,74 +872,85 @@ | ||
| 850 | 872 | prep*:SunOS:5.*:*) |
| 851 | 873 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
| 852 | 874 | exit ;; |
| 853 | 875 | *:GNU:*:*) |
| 854 | 876 | # 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,/.*$,,'` | |
| 856 | 878 | exit ;; |
| 857 | 879 | *:GNU/*:*:*) |
| 858 | 880 | # 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} | |
| 860 | 882 | exit ;; |
| 861 | 883 | i*86:Minix:*:*) |
| 862 | 884 | echo ${UNAME_MACHINE}-pc-minix |
| 863 | 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 ;; | |
| 864 | 893 | alpha:Linux:*:*) |
| 865 | 894 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
| 866 | 895 | EV5) UNAME_MACHINE=alphaev5 ;; |
| 867 | 896 | EV56) UNAME_MACHINE=alphaev56 ;; |
| 868 | 897 | PCA56) UNAME_MACHINE=alphapca56 ;; |
| 869 | 898 | PCA57) UNAME_MACHINE=alphapca56 ;; |
| 870 | 899 | EV6) UNAME_MACHINE=alphaev6 ;; |
| 871 | 900 | EV67) UNAME_MACHINE=alphaev67 ;; |
| 872 | 901 | EV68*) UNAME_MACHINE=alphaev68 ;; |
| 873 | - esac | |
| 902 | + esac | |
| 874 | 903 | 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} | |
| 877 | 909 | exit ;; |
| 878 | 910 | arm*:Linux:*:*) |
| 879 | 911 | eval $set_cc_for_build |
| 880 | 912 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
| 881 | 913 | | grep -q __ARM_EABI__ |
| 882 | 914 | then |
| 883 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 915 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 884 | 916 | 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 | |
| 886 | 924 | fi |
| 887 | 925 | exit ;; |
| 888 | 926 | avr32*:Linux:*:*) |
| 889 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 927 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 890 | 928 | exit ;; |
| 891 | 929 | cris:Linux:*:*) |
| 892 | - echo cris-axis-linux-gnu | |
| 930 | + echo ${UNAME_MACHINE}-axis-linux-${LIBC} | |
| 893 | 931 | exit ;; |
| 894 | 932 | crisv32:Linux:*:*) |
| 895 | - echo crisv32-axis-linux-gnu | |
| 933 | + echo ${UNAME_MACHINE}-axis-linux-${LIBC} | |
| 896 | 934 | exit ;; |
| 897 | 935 | 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} | |
| 899 | 940 | exit ;; |
| 900 | 941 | 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} | |
| 910 | 943 | exit ;; |
| 911 | 944 | ia64:Linux:*:*) |
| 912 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 945 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 913 | 946 | exit ;; |
| 914 | 947 | m32r*:Linux:*:*) |
| 915 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 948 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 916 | 949 | exit ;; |
| 917 | 950 | m68*:Linux:*:*) |
| 918 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 951 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 919 | 952 | exit ;; |
| 920 | 953 | mips:Linux:*:* | mips64:Linux:*:*) |
| 921 | 954 | eval $set_cc_for_build |
| 922 | 955 | sed 's/^ //' << EOF >$dummy.c |
| 923 | 956 | #undef CPU |
| @@ -932,71 +965,80 @@ | ||
| 932 | 965 | CPU= |
| 933 | 966 | #endif |
| 934 | 967 | #endif |
| 935 | 968 | EOF |
| 936 | 969 | 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; } | |
| 938 | 971 | ;; |
| 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} | |
| 941 | 977 | exit ;; |
| 942 | 978 | padre:Linux:*:*) |
| 943 | - echo sparc-unknown-linux-gnu | |
| 979 | + echo sparc-unknown-linux-${LIBC} | |
| 944 | 980 | exit ;; |
| 945 | 981 | parisc64:Linux:*:* | hppa64:Linux:*:*) |
| 946 | - echo hppa64-unknown-linux-gnu | |
| 982 | + echo hppa64-unknown-linux-${LIBC} | |
| 947 | 983 | exit ;; |
| 948 | 984 | parisc:Linux:*:* | hppa:Linux:*:*) |
| 949 | 985 | # Look for CPU level |
| 950 | 986 | 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} ;; | |
| 954 | 990 | esac |
| 955 | 991 | exit ;; |
| 956 | 992 | ppc64:Linux:*:*) |
| 957 | - echo powerpc64-unknown-linux-gnu | |
| 993 | + echo powerpc64-unknown-linux-${LIBC} | |
| 958 | 994 | exit ;; |
| 959 | 995 | 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} | |
| 961 | 1003 | exit ;; |
| 962 | 1004 | s390:Linux:*:* | s390x:Linux:*:*) |
| 963 | - echo ${UNAME_MACHINE}-ibm-linux | |
| 1005 | + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} | |
| 964 | 1006 | exit ;; |
| 965 | 1007 | sh64*:Linux:*:*) |
| 966 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1008 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 967 | 1009 | exit ;; |
| 968 | 1010 | sh*:Linux:*:*) |
| 969 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1011 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 970 | 1012 | exit ;; |
| 971 | 1013 | sparc:Linux:*:* | sparc64:Linux:*:*) |
| 972 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1014 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 973 | 1015 | exit ;; |
| 974 | 1016 | tile*:Linux:*:*) |
| 975 | - echo ${UNAME_MACHINE}-tilera-linux-gnu | |
| 1017 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 976 | 1018 | exit ;; |
| 977 | 1019 | vax:Linux:*:*) |
| 978 | - echo ${UNAME_MACHINE}-dec-linux-gnu | |
| 1020 | + echo ${UNAME_MACHINE}-dec-linux-${LIBC} | |
| 979 | 1021 | exit ;; |
| 980 | 1022 | x86_64:Linux:*:*) |
| 981 | - echo x86_64-unknown-linux-gnu | |
| 1023 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 982 | 1024 | exit ;; |
| 983 | 1025 | xtensa*:Linux:*:*) |
| 984 | - echo ${UNAME_MACHINE}-unknown-linux-gnu | |
| 1026 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | |
| 985 | 1027 | exit ;; |
| 986 | 1028 | i*86:DYNIX/ptx:4*:*) |
| 987 | 1029 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. |
| 988 | 1030 | # earlier versions are messed up and put the nodename in both |
| 989 | 1031 | # sysname and nodename. |
| 990 | 1032 | echo i386-sequent-sysv4 |
| 991 | 1033 | exit ;; |
| 992 | 1034 | 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, | |
| 996 | 1038 | # I just have to hope. -- rms. |
| 997 | - # Use sysv4.2uw... so that sysv4* matches it. | |
| 1039 | + # Use sysv4.2uw... so that sysv4* matches it. | |
| 998 | 1040 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} |
| 999 | 1041 | exit ;; |
| 1000 | 1042 | i*86:OS/2:*:*) |
| 1001 | 1043 | # If we were able to find `uname', then EMX Unix compatibility |
| 1002 | 1044 | # is probably installed. |
| @@ -1024,11 +1066,11 @@ | ||
| 1024 | 1066 | else |
| 1025 | 1067 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} |
| 1026 | 1068 | fi |
| 1027 | 1069 | exit ;; |
| 1028 | 1070 | i*86:*:5:[678]*) |
| 1029 | - # UnixWare 7.x, OpenUNIX and OpenServer 6. | |
| 1071 | + # UnixWare 7.x, OpenUNIX and OpenServer 6. | |
| 1030 | 1072 | case `/bin/uname -X | grep "^Machine"` in |
| 1031 | 1073 | *486*) UNAME_MACHINE=i486 ;; |
| 1032 | 1074 | *Pentium) UNAME_MACHINE=i586 ;; |
| 1033 | 1075 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
| 1034 | 1076 | esac |
| @@ -1052,17 +1094,17 @@ | ||
| 1052 | 1094 | echo ${UNAME_MACHINE}-pc-sysv32 |
| 1053 | 1095 | fi |
| 1054 | 1096 | exit ;; |
| 1055 | 1097 | pc:*:*:*) |
| 1056 | 1098 | # 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. | |
| 1059 | 1101 | # Note: whatever this is, it MUST be the same as what config.sub |
| 1060 | 1102 | # prints for the "djgpp" host, or else GDB configury will decide that |
| 1061 | 1103 | # this is a cross-build. |
| 1062 | 1104 | echo i586-pc-msdosdjgpp |
| 1063 | - exit ;; | |
| 1105 | + exit ;; | |
| 1064 | 1106 | Intel:Mach:3*:*) |
| 1065 | 1107 | echo i386-pc-mach3 |
| 1066 | 1108 | exit ;; |
| 1067 | 1109 | paragon:*:*:*) |
| 1068 | 1110 | echo i860-intel-osf1 |
| @@ -1093,12 +1135,12 @@ | ||
| 1093 | 1135 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| 1094 | 1136 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } |
| 1095 | 1137 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ |
| 1096 | 1138 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; |
| 1097 | 1139 | 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; } ;; | |
| 1100 | 1142 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) |
| 1101 | 1143 | OS_REL='.3' |
| 1102 | 1144 | test -r /etc/.relid \ |
| 1103 | 1145 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
| 1104 | 1146 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ |
| @@ -1137,14 +1179,14 @@ | ||
| 1137 | 1179 | echo ${UNAME_MACHINE}-sni-sysv4 |
| 1138 | 1180 | else |
| 1139 | 1181 | echo ns32k-sni-sysv |
| 1140 | 1182 | fi |
| 1141 | 1183 | 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 ;; | |
| 1146 | 1188 | *:UNIX_System_V:4*:FTX*) |
| 1147 | 1189 | # From Gerald Hewes <[email protected]>. |
| 1148 | 1190 | # How about differentiating between stratus architectures? -djm |
| 1149 | 1191 | echo hppa1.1-stratus-sysv4 |
| 1150 | 1192 | exit ;; |
| @@ -1166,15 +1208,15 @@ | ||
| 1166 | 1208 | news*:NEWS-OS:6*:*) |
| 1167 | 1209 | echo mips-sony-newsos6 |
| 1168 | 1210 | exit ;; |
| 1169 | 1211 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) |
| 1170 | 1212 | if [ -d /usr/nec ]; then |
| 1171 | - echo mips-nec-sysv${UNAME_RELEASE} | |
| 1213 | + echo mips-nec-sysv${UNAME_RELEASE} | |
| 1172 | 1214 | else |
| 1173 | - echo mips-unknown-sysv${UNAME_RELEASE} | |
| 1215 | + echo mips-unknown-sysv${UNAME_RELEASE} | |
| 1174 | 1216 | fi |
| 1175 | - exit ;; | |
| 1217 | + exit ;; | |
| 1176 | 1218 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. |
| 1177 | 1219 | echo powerpc-be-beos |
| 1178 | 1220 | exit ;; |
| 1179 | 1221 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. |
| 1180 | 1222 | echo powerpc-apple-beos |
| @@ -1183,10 +1225,13 @@ | ||
| 1183 | 1225 | echo i586-pc-beos |
| 1184 | 1226 | exit ;; |
| 1185 | 1227 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. |
| 1186 | 1228 | echo i586-pc-haiku |
| 1187 | 1229 | exit ;; |
| 1230 | + x86_64:Haiku:*:*) | |
| 1231 | + echo x86_64-unknown-haiku | |
| 1232 | + exit ;; | |
| 1188 | 1233 | SX-4:SUPER-UX:*:*) |
| 1189 | 1234 | echo sx4-nec-superux${UNAME_RELEASE} |
| 1190 | 1235 | exit ;; |
| 1191 | 1236 | SX-5:SUPER-UX:*:*) |
| 1192 | 1237 | echo sx5-nec-superux${UNAME_RELEASE} |
| @@ -1209,23 +1254,35 @@ | ||
| 1209 | 1254 | *:Rhapsody:*:*) |
| 1210 | 1255 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
| 1211 | 1256 | exit ;; |
| 1212 | 1257 | *:Darwin:*:*) |
| 1213 | 1258 | 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 | |
| 1227 | 1284 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
| 1228 | 1285 | exit ;; |
| 1229 | 1286 | *:procnto*:*:* | *:QNX:[0123456789]*:*) |
| 1230 | 1287 | UNAME_PROCESSOR=`uname -p` |
| 1231 | 1288 | if test "$UNAME_PROCESSOR" = "x86"; then |
| @@ -1238,11 +1295,11 @@ | ||
| 1238 | 1295 | echo i386-pc-qnx |
| 1239 | 1296 | exit ;; |
| 1240 | 1297 | NEO-?:NONSTOP_KERNEL:*:*) |
| 1241 | 1298 | echo neo-tandem-nsk${UNAME_RELEASE} |
| 1242 | 1299 | exit ;; |
| 1243 | - NSE-?:NONSTOP_KERNEL:*:*) | |
| 1300 | + NSE-*:NONSTOP_KERNEL:*:*) | |
| 1244 | 1301 | echo nse-tandem-nsk${UNAME_RELEASE} |
| 1245 | 1302 | exit ;; |
| 1246 | 1303 | NSR-?:NONSTOP_KERNEL:*:*) |
| 1247 | 1304 | echo nsr-tandem-nsk${UNAME_RELEASE} |
| 1248 | 1305 | exit ;; |
| @@ -1283,17 +1340,17 @@ | ||
| 1283 | 1340 | exit ;; |
| 1284 | 1341 | *:ITS:*:*) |
| 1285 | 1342 | echo pdp10-unknown-its |
| 1286 | 1343 | exit ;; |
| 1287 | 1344 | SEI:*:*:SEIUX) |
| 1288 | - echo mips-sei-seiux${UNAME_RELEASE} | |
| 1345 | + echo mips-sei-seiux${UNAME_RELEASE} | |
| 1289 | 1346 | exit ;; |
| 1290 | 1347 | *:DragonFly:*:*) |
| 1291 | 1348 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` |
| 1292 | 1349 | exit ;; |
| 1293 | 1350 | *:*VMS:*:*) |
| 1294 | - UNAME_MACHINE=`(uname -p) 2>/dev/null` | |
| 1351 | + UNAME_MACHINE=`(uname -p) 2>/dev/null` | |
| 1295 | 1352 | case "${UNAME_MACHINE}" in |
| 1296 | 1353 | A*) echo alpha-dec-vms ; exit ;; |
| 1297 | 1354 | I*) echo ia64-dec-vms ; exit ;; |
| 1298 | 1355 | V*) echo vax-dec-vms ; exit ;; |
| 1299 | 1356 | esac ;; |
| @@ -1307,162 +1364,14 @@ | ||
| 1307 | 1364 | echo ${UNAME_MACHINE}-pc-rdos |
| 1308 | 1365 | exit ;; |
| 1309 | 1366 | i*86:AROS:*:*) |
| 1310 | 1367 | echo ${UNAME_MACHINE}-pc-aros |
| 1311 | 1368 | 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 | |
| 1464 | 1373 | |
| 1465 | 1374 | cat >&2 <<EOF |
| 1466 | 1375 | $0: unable to guess system type |
| 1467 | 1376 | |
| 1468 | 1377 | This script, last modified $timestamp, has failed to recognize |
| 1469 | 1378 |
| --- 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 @@ | ||
| 1 | 1 | #! /bin/sh |
| 2 | 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 | |
| 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 | |
| 16 | 10 | # (at your option) any later version. |
| 17 | 11 | # |
| 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. | |
| 22 | 16 | # |
| 23 | 17 | # 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/>. | |
| 27 | 19 | # |
| 28 | 20 | # As a special exception to the GNU General Public License, if you |
| 29 | 21 | # distribute this file as part of a program that contains a |
| 30 | 22 | # 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"). | |
| 32 | 26 | |
| 33 | 27 | |
| 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]. | |
| 36 | 29 | # |
| 37 | 30 | # Configuration subroutine to validate and canonicalize a configuration type. |
| 38 | 31 | # Supply the specified configuration type as an argument. |
| 39 | 32 | # If it is invalid, we print an error message on stderr and exit with code 1. |
| 40 | 33 | # Otherwise, we print the canonical config type on stdout and succeed. |
| @@ -73,13 +66,11 @@ | ||
| 73 | 66 | Report bugs and patches to <[email protected]>." |
| 74 | 67 | |
| 75 | 68 | version="\ |
| 76 | 69 | GNU config.sub ($timestamp) |
| 77 | 70 | |
| 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. | |
| 81 | 72 | |
| 82 | 73 | This is free software; see the source for copying conditions. There is NO |
| 83 | 74 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 84 | 75 | |
| 85 | 76 | help=" |
| @@ -123,17 +114,21 @@ | ||
| 123 | 114 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). |
| 124 | 115 | # Here we must recognize all the valid KERNEL-OS combinations. |
| 125 | 116 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` |
| 126 | 117 | case $maybe_os in |
| 127 | 118 | 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* | \ | |
| 129 | 120 | knetbsd*-gnu* | netbsd*-gnu* | \ |
| 130 | 121 | kopensolaris*-gnu* | \ |
| 131 | 122 | storm-chaos* | os2-emx* | rtmk-nova*) |
| 132 | 123 | os=-$maybe_os |
| 133 | 124 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` |
| 134 | 125 | ;; |
| 126 | + android-linux) | |
| 127 | + os=-linux-android | |
| 128 | + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown | |
| 129 | + ;; | |
| 135 | 130 | *) |
| 136 | 131 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` |
| 137 | 132 | if [ $basic_machine != $1 ] |
| 138 | 133 | then os=`echo $1 | sed 's/.*-/-/'` |
| 139 | 134 | else os=; fi |
| @@ -152,16 +147,16 @@ | ||
| 152 | 147 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ |
| 153 | 148 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ |
| 154 | 149 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ |
| 155 | 150 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ |
| 156 | 151 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ |
| 157 | - -apple | -axis | -knuth | -cray | -microblaze) | |
| 152 | + -apple | -axis | -knuth | -cray | -microblaze*) | |
| 158 | 153 | os= |
| 159 | 154 | basic_machine=$1 |
| 160 | 155 | ;; |
| 161 | - -bluegene*) | |
| 162 | - os=-cnk | |
| 156 | + -bluegene*) | |
| 157 | + os=-cnk | |
| 163 | 158 | ;; |
| 164 | 159 | -sim | -cisco | -oki | -wec | -winbond) |
| 165 | 160 | os= |
| 166 | 161 | basic_machine=$1 |
| 167 | 162 | ;; |
| @@ -173,14 +168,14 @@ | ||
| 173 | 168 | ;; |
| 174 | 169 | -chorusos*) |
| 175 | 170 | os=-chorusos |
| 176 | 171 | basic_machine=$1 |
| 177 | 172 | ;; |
| 178 | - -chorusrdb) | |
| 179 | - os=-chorusrdb | |
| 173 | + -chorusrdb) | |
| 174 | + os=-chorusrdb | |
| 180 | 175 | basic_machine=$1 |
| 181 | - ;; | |
| 176 | + ;; | |
| 182 | 177 | -hiux*) |
| 183 | 178 | os=-hiuxwe2 |
| 184 | 179 | ;; |
| 185 | 180 | -sco6) |
| 186 | 181 | os=-sco5v6 |
| @@ -221,10 +216,16 @@ | ||
| 221 | 216 | basic_machine=clipper-intergraph |
| 222 | 217 | ;; |
| 223 | 218 | -isc*) |
| 224 | 219 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
| 225 | 220 | ;; |
| 221 | + -lynx*178) | |
| 222 | + os=-lynxos178 | |
| 223 | + ;; | |
| 224 | + -lynx*5) | |
| 225 | + os=-lynxos5 | |
| 226 | + ;; | |
| 226 | 227 | -lynx*) |
| 227 | 228 | os=-lynxos |
| 228 | 229 | ;; |
| 229 | 230 | -ptx*) |
| 230 | 231 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` |
| @@ -245,24 +246,32 @@ | ||
| 245 | 246 | case $basic_machine in |
| 246 | 247 | # Recognize the basic CPU types without company name. |
| 247 | 248 | # Some are omitted here because they have special meanings below. |
| 248 | 249 | 1750a | 580 \ |
| 249 | 250 | | a29k \ |
| 251 | + | aarch64 | aarch64_be \ | |
| 250 | 252 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ |
| 251 | 253 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ |
| 252 | 254 | | 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 \ | |
| 254 | 259 | | bfin \ |
| 255 | - | c4x | clipper \ | |
| 260 | + | c4x | c8051 | clipper \ | |
| 256 | 261 | | d10v | d30v | dlx | dsp16xx \ |
| 262 | + | epiphany \ | |
| 257 | 263 | | fido | fr30 | frv \ |
| 258 | 264 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ |
| 265 | + | hexagon \ | |
| 259 | 266 | | i370 | i860 | i960 | ia64 \ |
| 260 | 267 | | ip2k | iq2000 \ |
| 268 | + | k1om \ | |
| 269 | + | le32 | le64 \ | |
| 261 | 270 | | lm32 \ |
| 262 | 271 | | m32c | m32r | m32rle | m68000 | m68k | m88k \ |
| 263 | - | maxq | mb | microblaze | mcore | mep | metag \ | |
| 272 | + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | |
| 264 | 273 | | mips | mipsbe | mipseb | mipsel | mipsle \ |
| 265 | 274 | | mips16 \ |
| 266 | 275 | | mips64 | mips64el \ |
| 267 | 276 | | mips64octeon | mips64octeonel \ |
| 268 | 277 | | mips64orion | mips64orionel \ |
| @@ -272,38 +281,41 @@ | ||
| 272 | 281 | | mips64vr4300 | mips64vr4300el \ |
| 273 | 282 | | mips64vr5000 | mips64vr5000el \ |
| 274 | 283 | | mips64vr5900 | mips64vr5900el \ |
| 275 | 284 | | mipsisa32 | mipsisa32el \ |
| 276 | 285 | | mipsisa32r2 | mipsisa32r2el \ |
| 286 | + | mipsisa32r6 | mipsisa32r6el \ | |
| 277 | 287 | | mipsisa64 | mipsisa64el \ |
| 278 | 288 | | mipsisa64r2 | mipsisa64r2el \ |
| 289 | + | mipsisa64r6 | mipsisa64r6el \ | |
| 279 | 290 | | mipsisa64sb1 | mipsisa64sb1el \ |
| 280 | 291 | | mipsisa64sr71k | mipsisa64sr71kel \ |
| 292 | + | mipsr5900 | mipsr5900el \ | |
| 281 | 293 | | mipstx39 | mipstx39el \ |
| 282 | 294 | | mn10200 | mn10300 \ |
| 283 | 295 | | moxie \ |
| 284 | 296 | | mt \ |
| 285 | 297 | | msp430 \ |
| 286 | 298 | | nds32 | nds32le | nds32be \ |
| 287 | - | nios | nios2 \ | |
| 299 | + | nios | nios2 | nios2eb | nios2el \ | |
| 288 | 300 | | ns16k | ns32k \ |
| 289 | - | or32 \ | |
| 301 | + | open8 | or1k | or1knd | or32 \ | |
| 290 | 302 | | pdp10 | pdp11 | pj | pjl \ |
| 291 | - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | |
| 303 | + | powerpc | powerpc64 | powerpc64le | powerpcle \ | |
| 292 | 304 | | pyramid \ |
| 293 | - | rx \ | |
| 305 | + | rl78 | rx \ | |
| 294 | 306 | | score \ |
| 295 | 307 | | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ |
| 296 | 308 | | sh64 | sh64le \ |
| 297 | 309 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ |
| 298 | 310 | | 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 \ | |
| 301 | 313 | | ubicom32 \ |
| 302 | - | v850 | v850e \ | |
| 314 | + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | |
| 303 | 315 | | we32k \ |
| 304 | - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | |
| 316 | + | x86 | xc16x | xstormy16 | xtensa \ | |
| 305 | 317 | | z8k | z80) |
| 306 | 318 | basic_machine=$basic_machine-unknown |
| 307 | 319 | ;; |
| 308 | 320 | c54x) |
| 309 | 321 | basic_machine=tic54x-unknown |
| @@ -312,20 +324,34 @@ | ||
| 312 | 324 | basic_machine=tic55x-unknown |
| 313 | 325 | ;; |
| 314 | 326 | c6x) |
| 315 | 327 | basic_machine=tic6x-unknown |
| 316 | 328 | ;; |
| 317 | - m6811 | m68hc11 | m6812 | m68hc12 | picochip) | |
| 318 | - # Motorola 68HC11/12. | |
| 329 | + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) | |
| 319 | 330 | basic_machine=$basic_machine-unknown |
| 320 | 331 | os=-none |
| 321 | 332 | ;; |
| 322 | 333 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) |
| 323 | 334 | ;; |
| 324 | 335 | ms1) |
| 325 | 336 | basic_machine=mt-unknown |
| 326 | 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 | + ;; | |
| 327 | 353 | |
| 328 | 354 | # We use `pc' rather than `unknown' |
| 329 | 355 | # because (1) that's what they normally are, and |
| 330 | 356 | # (2) the word "unknown" tends to confuse beginning users. |
| 331 | 357 | i*86 | x86_64) |
| @@ -337,29 +363,35 @@ | ||
| 337 | 363 | exit 1 |
| 338 | 364 | ;; |
| 339 | 365 | # Recognize the basic CPU types with company name. |
| 340 | 366 | 580-* \ |
| 341 | 367 | | a29k-* \ |
| 368 | + | aarch64-* | aarch64_be-* \ | |
| 342 | 369 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ |
| 343 | 370 | | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ |
| 344 | - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | |
| 371 | + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | |
| 345 | 372 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ |
| 346 | 373 | | avr-* | avr32-* \ |
| 374 | + | be32-* | be64-* \ | |
| 347 | 375 | | bfin-* | bs2000-* \ |
| 348 | 376 | | c[123]* | c30-* | [cjt]90-* | c4x-* \ |
| 349 | - | clipper-* | craynv-* | cydra-* \ | |
| 377 | + | c8051-* | clipper-* | craynv-* | cydra-* \ | |
| 350 | 378 | | d10v-* | d30v-* | dlx-* \ |
| 351 | 379 | | elxsi-* \ |
| 352 | 380 | | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ |
| 353 | 381 | | h8300-* | h8500-* \ |
| 354 | 382 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ |
| 383 | + | hexagon-* \ | |
| 355 | 384 | | i*86-* | i860-* | i960-* | ia64-* \ |
| 356 | 385 | | ip2k-* | iq2000-* \ |
| 386 | + | k1om-* \ | |
| 387 | + | le32-* | le64-* \ | |
| 357 | 388 | | lm32-* \ |
| 358 | 389 | | m32c-* | m32r-* | m32rle-* \ |
| 359 | 390 | | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ |
| 360 | - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | |
| 391 | + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | |
| 392 | + | microblaze-* | microblazeel-* \ | |
| 361 | 393 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ |
| 362 | 394 | | mips16-* \ |
| 363 | 395 | | mips64-* | mips64el-* \ |
| 364 | 396 | | mips64octeon-* | mips64octeonel-* \ |
| 365 | 397 | | mips64orion-* | mips64orionel-* \ |
| @@ -369,39 +401,45 @@ | ||
| 369 | 401 | | mips64vr4300-* | mips64vr4300el-* \ |
| 370 | 402 | | mips64vr5000-* | mips64vr5000el-* \ |
| 371 | 403 | | mips64vr5900-* | mips64vr5900el-* \ |
| 372 | 404 | | mipsisa32-* | mipsisa32el-* \ |
| 373 | 405 | | mipsisa32r2-* | mipsisa32r2el-* \ |
| 406 | + | mipsisa32r6-* | mipsisa32r6el-* \ | |
| 374 | 407 | | mipsisa64-* | mipsisa64el-* \ |
| 375 | 408 | | mipsisa64r2-* | mipsisa64r2el-* \ |
| 409 | + | mipsisa64r6-* | mipsisa64r6el-* \ | |
| 376 | 410 | | mipsisa64sb1-* | mipsisa64sb1el-* \ |
| 377 | 411 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ |
| 412 | + | mipsr5900-* | mipsr5900el-* \ | |
| 378 | 413 | | mipstx39-* | mipstx39el-* \ |
| 379 | 414 | | mmix-* \ |
| 380 | 415 | | mt-* \ |
| 381 | 416 | | msp430-* \ |
| 382 | 417 | | nds32-* | nds32le-* | nds32be-* \ |
| 383 | - | nios-* | nios2-* \ | |
| 418 | + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | |
| 384 | 419 | | none-* | np1-* | ns16k-* | ns32k-* \ |
| 420 | + | open8-* \ | |
| 421 | + | or1k*-* \ | |
| 385 | 422 | | orion-* \ |
| 386 | 423 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ |
| 387 | - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | |
| 424 | + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | |
| 388 | 425 | | pyramid-* \ |
| 389 | - | romp-* | rs6000-* | rx-* \ | |
| 426 | + | rl78-* | romp-* | rs6000-* | rx-* \ | |
| 390 | 427 | | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ |
| 391 | 428 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ |
| 392 | 429 | | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ |
| 393 | 430 | | sparclite-* \ |
| 394 | - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | |
| 395 | - | tahoe-* | thumb-* \ | |
| 431 | + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | |
| 432 | + | tahoe-* \ | |
| 396 | 433 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ |
| 397 | - | tile-* | tilegx-* \ | |
| 434 | + | tile*-* \ | |
| 398 | 435 | | tron-* \ |
| 399 | 436 | | ubicom32-* \ |
| 400 | - | v850-* | v850e-* | vax-* \ | |
| 437 | + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | |
| 438 | + | vax-* \ | |
| 401 | 439 | | we32k-* \ |
| 402 | - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | |
| 440 | + | x86-* | x86_64-* | xc16x-* | xps100-* \ | |
| 403 | 441 | | xstormy16-* | xtensa*-* \ |
| 404 | 442 | | ymp-* \ |
| 405 | 443 | | z8k-* | z80-*) |
| 406 | 444 | ;; |
| 407 | 445 | # Recognize the basic CPU types without company name, with glob match. |
| @@ -422,11 +460,11 @@ | ||
| 422 | 460 | ;; |
| 423 | 461 | a29khif) |
| 424 | 462 | basic_machine=a29k-amd |
| 425 | 463 | os=-udi |
| 426 | 464 | ;; |
| 427 | - abacus) | |
| 465 | + abacus) | |
| 428 | 466 | basic_machine=abacus-unknown |
| 429 | 467 | ;; |
| 430 | 468 | adobe68k) |
| 431 | 469 | basic_machine=m68010-adobe |
| 432 | 470 | os=-scout |
| @@ -505,11 +543,11 @@ | ||
| 505 | 543 | ;; |
| 506 | 544 | c90) |
| 507 | 545 | basic_machine=c90-cray |
| 508 | 546 | os=-unicos |
| 509 | 547 | ;; |
| 510 | - cegcc) | |
| 548 | + cegcc) | |
| 511 | 549 | basic_machine=arm-unknown |
| 512 | 550 | os=-cegcc |
| 513 | 551 | ;; |
| 514 | 552 | convex-c1) |
| 515 | 553 | basic_machine=c1-convex |
| @@ -537,11 +575,11 @@ | ||
| 537 | 575 | ;; |
| 538 | 576 | craynv) |
| 539 | 577 | basic_machine=craynv-cray |
| 540 | 578 | os=-unicosmp |
| 541 | 579 | ;; |
| 542 | - cr16) | |
| 580 | + cr16 | cr16-*) | |
| 543 | 581 | basic_machine=cr16-unknown |
| 544 | 582 | os=-elf |
| 545 | 583 | ;; |
| 546 | 584 | crds | unos) |
| 547 | 585 | basic_machine=m68k-crds |
| @@ -695,11 +733,10 @@ | ||
| 695 | 733 | os=-proelf |
| 696 | 734 | ;; |
| 697 | 735 | i370-ibm* | ibm*) |
| 698 | 736 | basic_machine=i370-ibm |
| 699 | 737 | ;; |
| 700 | -# I'm not sure what "Sysv32" means. Should this be sysv3.2? | |
| 701 | 738 | i*86v32) |
| 702 | 739 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` |
| 703 | 740 | os=-sysv32 |
| 704 | 741 | ;; |
| 705 | 742 | i*86v4*) |
| @@ -753,15 +790,19 @@ | ||
| 753 | 790 | ;; |
| 754 | 791 | merlin) |
| 755 | 792 | basic_machine=ns32k-utek |
| 756 | 793 | os=-sysv |
| 757 | 794 | ;; |
| 758 | - microblaze) | |
| 795 | + microblaze*) | |
| 759 | 796 | basic_machine=microblaze-xilinx |
| 760 | 797 | ;; |
| 798 | + mingw64) | |
| 799 | + basic_machine=x86_64-pc | |
| 800 | + os=-mingw64 | |
| 801 | + ;; | |
| 761 | 802 | mingw32) |
| 762 | - basic_machine=i386-pc | |
| 803 | + basic_machine=i686-pc | |
| 763 | 804 | os=-mingw32 |
| 764 | 805 | ;; |
| 765 | 806 | mingw32ce) |
| 766 | 807 | basic_machine=arm-unknown |
| 767 | 808 | os=-mingw32ce |
| @@ -792,18 +833,22 @@ | ||
| 792 | 833 | os=-msdos |
| 793 | 834 | ;; |
| 794 | 835 | ms1-*) |
| 795 | 836 | basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` |
| 796 | 837 | ;; |
| 838 | + msys) | |
| 839 | + basic_machine=i686-pc | |
| 840 | + os=-msys | |
| 841 | + ;; | |
| 797 | 842 | mvs) |
| 798 | 843 | basic_machine=i370-ibm |
| 799 | 844 | os=-mvs |
| 800 | 845 | ;; |
| 801 | - msys) | |
| 802 | - basic_machine=i386-pc | |
| 803 | - os=-msys | |
| 804 | - ;; | |
| 846 | + nacl) | |
| 847 | + basic_machine=le32-unknown | |
| 848 | + os=-nacl | |
| 849 | + ;; | |
| 805 | 850 | ncr3000) |
| 806 | 851 | basic_machine=i486-ncr |
| 807 | 852 | os=-sysv4 |
| 808 | 853 | ;; |
| 809 | 854 | netbsd386) |
| @@ -864,14 +909,14 @@ | ||
| 864 | 909 | os=-nonstopux |
| 865 | 910 | ;; |
| 866 | 911 | np1) |
| 867 | 912 | basic_machine=np1-gould |
| 868 | 913 | ;; |
| 869 | - neo-tandem) | |
| 914 | + neo-tandem) | |
| 870 | 915 | basic_machine=neo-tandem |
| 871 | 916 | ;; |
| 872 | - nse-tandem) | |
| 917 | + nse-tandem) | |
| 873 | 918 | basic_machine=nse-tandem |
| 874 | 919 | ;; |
| 875 | 920 | nsr-tandem) |
| 876 | 921 | basic_machine=nsr-tandem |
| 877 | 922 | ;; |
| @@ -952,13 +997,14 @@ | ||
| 952 | 997 | pn) |
| 953 | 998 | basic_machine=pn-gould |
| 954 | 999 | ;; |
| 955 | 1000 | power) basic_machine=power-ibm |
| 956 | 1001 | ;; |
| 957 | - ppc) basic_machine=powerpc-unknown | |
| 1002 | + ppc | ppcbe) basic_machine=powerpc-unknown | |
| 958 | 1003 | ;; |
| 959 | - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
| 1004 | + ppc-* | ppcbe-*) | |
| 1005 | + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
| 960 | 1006 | ;; |
| 961 | 1007 | ppcle | powerpclittle | ppc-le | powerpc-little) |
| 962 | 1008 | basic_machine=powerpcle-unknown |
| 963 | 1009 | ;; |
| 964 | 1010 | ppcle-* | powerpclittle-*) |
| @@ -979,11 +1025,15 @@ | ||
| 979 | 1025 | ;; |
| 980 | 1026 | pw32) |
| 981 | 1027 | basic_machine=i586-unknown |
| 982 | 1028 | os=-pw32 |
| 983 | 1029 | ;; |
| 984 | - rdos) | |
| 1030 | + rdos | rdos64) | |
| 1031 | + basic_machine=x86_64-pc | |
| 1032 | + os=-rdos | |
| 1033 | + ;; | |
| 1034 | + rdos32) | |
| 985 | 1035 | basic_machine=i386-pc |
| 986 | 1036 | os=-rdos |
| 987 | 1037 | ;; |
| 988 | 1038 | rom68k) |
| 989 | 1039 | basic_machine=m68k-rom68k |
| @@ -1048,10 +1098,13 @@ | ||
| 1048 | 1098 | ;; |
| 1049 | 1099 | stratus) |
| 1050 | 1100 | basic_machine=i860-stratus |
| 1051 | 1101 | os=-sysv4 |
| 1052 | 1102 | ;; |
| 1103 | + strongarm-* | thumb-*) | |
| 1104 | + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` | |
| 1105 | + ;; | |
| 1053 | 1106 | sun2) |
| 1054 | 1107 | basic_machine=m68000-sun |
| 1055 | 1108 | ;; |
| 1056 | 1109 | sun2os3) |
| 1057 | 1110 | basic_machine=m68000-sun |
| @@ -1104,17 +1157,12 @@ | ||
| 1104 | 1157 | ;; |
| 1105 | 1158 | t90) |
| 1106 | 1159 | basic_machine=t90-cray |
| 1107 | 1160 | os=-unicos |
| 1108 | 1161 | ;; |
| 1109 | - # This must be matched before tile*. | |
| 1110 | - tilegx*) | |
| 1111 | - basic_machine=tilegx-unknown | |
| 1112 | - os=-linux-gnu | |
| 1113 | - ;; | |
| 1114 | 1162 | tile*) |
| 1115 | - basic_machine=tile-unknown | |
| 1163 | + basic_machine=$basic_machine-unknown | |
| 1116 | 1164 | os=-linux-gnu |
| 1117 | 1165 | ;; |
| 1118 | 1166 | tx39) |
| 1119 | 1167 | basic_machine=mipstx39-unknown |
| 1120 | 1168 | ;; |
| @@ -1180,10 +1228,13 @@ | ||
| 1180 | 1228 | os=-mingw32 |
| 1181 | 1229 | ;; |
| 1182 | 1230 | xps | xps100) |
| 1183 | 1231 | basic_machine=xps100-honeywell |
| 1184 | 1232 | ;; |
| 1233 | + xscale-* | xscalee[bl]-*) | |
| 1234 | + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` | |
| 1235 | + ;; | |
| 1185 | 1236 | ymp) |
| 1186 | 1237 | basic_machine=ymp-cray |
| 1187 | 1238 | os=-unicos |
| 1188 | 1239 | ;; |
| 1189 | 1240 | z8k-*-coff) |
| @@ -1277,15 +1328,15 @@ | ||
| 1277 | 1328 | # Decode manufacturer-specific aliases for certain operating systems. |
| 1278 | 1329 | |
| 1279 | 1330 | if [ x"$os" != x"" ] |
| 1280 | 1331 | then |
| 1281 | 1332 | 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. | |
| 1284 | 1335 | # -solaris* is a basic system type, with this one exception. |
| 1285 | - -auroraux) | |
| 1286 | - os=-auroraux | |
| 1336 | + -auroraux) | |
| 1337 | + os=-auroraux | |
| 1287 | 1338 | ;; |
| 1288 | 1339 | -solaris1 | -solaris1.*) |
| 1289 | 1340 | os=`echo $os | sed -e 's|solaris1|sunos4|'` |
| 1290 | 1341 | ;; |
| 1291 | 1342 | -solaris) |
| @@ -1305,33 +1356,33 @@ | ||
| 1305 | 1356 | # Each alternative MUST END IN A *, to match a version number. |
| 1306 | 1357 | # -sysv* is not here because it comes later, after sysvr4. |
| 1307 | 1358 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ |
| 1308 | 1359 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ |
| 1309 | 1360 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ |
| 1310 | - | -sym* | -kopensolaris* \ | |
| 1361 | + | -sym* | -kopensolaris* | -plan9* \ | |
| 1311 | 1362 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ |
| 1312 | 1363 | | -aos* | -aros* \ |
| 1313 | 1364 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ |
| 1314 | 1365 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ |
| 1315 | 1366 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ |
| 1316 | - | -openbsd* | -solidbsd* \ | |
| 1367 | + | -bitrig* | -openbsd* | -solidbsd* \ | |
| 1317 | 1368 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ |
| 1318 | 1369 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ |
| 1319 | 1370 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ |
| 1320 | 1371 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
| 1321 | 1372 | | -chorusos* | -chorusrdb* | -cegcc* \ |
| 1322 | 1373 | | -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* \ | |
| 1325 | 1376 | | -uxpv* | -beos* | -mpeix* | -udk* \ |
| 1326 | 1377 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ |
| 1327 | 1378 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
| 1328 | 1379 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ |
| 1329 | 1380 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
| 1330 | 1381 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
| 1331 | 1382 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
| 1332 | - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) | |
| 1383 | + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) | |
| 1333 | 1384 | # Remember, each alternative MUST END IN *, to match a version number. |
| 1334 | 1385 | ;; |
| 1335 | 1386 | -qnx*) |
| 1336 | 1387 | case $basic_machine in |
| 1337 | 1388 | x86-* | i*86-*) |
| @@ -1366,11 +1417,11 @@ | ||
| 1366 | 1417 | os=`echo $os | sed -e 's|sunos6|solaris3|'` |
| 1367 | 1418 | ;; |
| 1368 | 1419 | -opened*) |
| 1369 | 1420 | os=-openedition |
| 1370 | 1421 | ;; |
| 1371 | - -os400*) | |
| 1422 | + -os400*) | |
| 1372 | 1423 | os=-os400 |
| 1373 | 1424 | ;; |
| 1374 | 1425 | -wince*) |
| 1375 | 1426 | os=-wince |
| 1376 | 1427 | ;; |
| @@ -1415,11 +1466,11 @@ | ||
| 1415 | 1466 | os=`echo $os | sed -e 's|sinix|sysv|'` |
| 1416 | 1467 | ;; |
| 1417 | 1468 | -sinix*) |
| 1418 | 1469 | os=-sysv4 |
| 1419 | 1470 | ;; |
| 1420 | - -tpf*) | |
| 1471 | + -tpf*) | |
| 1421 | 1472 | os=-tpf |
| 1422 | 1473 | ;; |
| 1423 | 1474 | -triton*) |
| 1424 | 1475 | os=-sysv3 |
| 1425 | 1476 | ;; |
| @@ -1451,21 +1502,18 @@ | ||
| 1451 | 1502 | os=-mint |
| 1452 | 1503 | ;; |
| 1453 | 1504 | -aros*) |
| 1454 | 1505 | os=-aros |
| 1455 | 1506 | ;; |
| 1456 | - -kaos*) | |
| 1457 | - os=-kaos | |
| 1458 | - ;; | |
| 1459 | 1507 | -zvmoe) |
| 1460 | 1508 | os=-zvmoe |
| 1461 | 1509 | ;; |
| 1462 | 1510 | -dicos*) |
| 1463 | 1511 | os=-dicos |
| 1464 | 1512 | ;; |
| 1465 | - -nacl*) | |
| 1466 | - ;; | |
| 1513 | + -nacl*) | |
| 1514 | + ;; | |
| 1467 | 1515 | -none) |
| 1468 | 1516 | ;; |
| 1469 | 1517 | *) |
| 1470 | 1518 | # Get rid of the `-' at the beginning of $os. |
| 1471 | 1519 | os=`echo $os | sed 's/[^-]*-//'` |
| @@ -1484,14 +1532,14 @@ | ||
| 1484 | 1532 | # that MANUFACTURER isn't an operating system. Otherwise, code above |
| 1485 | 1533 | # will signal an error saying that MANUFACTURER isn't an operating |
| 1486 | 1534 | # system, and we'll never get to this point. |
| 1487 | 1535 | |
| 1488 | 1536 | case $basic_machine in |
| 1489 | - score-*) | |
| 1537 | + score-*) | |
| 1490 | 1538 | os=-elf |
| 1491 | 1539 | ;; |
| 1492 | - spu-*) | |
| 1540 | + spu-*) | |
| 1493 | 1541 | os=-elf |
| 1494 | 1542 | ;; |
| 1495 | 1543 | *-acorn) |
| 1496 | 1544 | os=-riscix1.2 |
| 1497 | 1545 | ;; |
| @@ -1499,12 +1547,18 @@ | ||
| 1499 | 1547 | os=-linux |
| 1500 | 1548 | ;; |
| 1501 | 1549 | arm*-semi) |
| 1502 | 1550 | os=-aout |
| 1503 | 1551 | ;; |
| 1504 | - c4x-* | tic4x-*) | |
| 1505 | - os=-coff | |
| 1552 | + c4x-* | tic4x-*) | |
| 1553 | + os=-coff | |
| 1554 | + ;; | |
| 1555 | + c8051-*) | |
| 1556 | + os=-elf | |
| 1557 | + ;; | |
| 1558 | + hexagon-*) | |
| 1559 | + os=-elf | |
| 1506 | 1560 | ;; |
| 1507 | 1561 | tic54x-*) |
| 1508 | 1562 | os=-coff |
| 1509 | 1563 | ;; |
| 1510 | 1564 | tic55x-*) |
| @@ -1529,18 +1583,15 @@ | ||
| 1529 | 1583 | i386-sun) |
| 1530 | 1584 | os=-sunos4.0.2 |
| 1531 | 1585 | ;; |
| 1532 | 1586 | m68000-sun) |
| 1533 | 1587 | os=-sunos3 |
| 1534 | - # This also exists in the configure program, but was not the | |
| 1535 | - # default. | |
| 1536 | - # os=-sunos4 | |
| 1537 | 1588 | ;; |
| 1538 | 1589 | m68*-cisco) |
| 1539 | 1590 | os=-aout |
| 1540 | 1591 | ;; |
| 1541 | - mep-*) | |
| 1592 | + mep-*) | |
| 1542 | 1593 | os=-elf |
| 1543 | 1594 | ;; |
| 1544 | 1595 | mips*-cisco) |
| 1545 | 1596 | os=-elf |
| 1546 | 1597 | ;; |
| @@ -1563,11 +1614,11 @@ | ||
| 1563 | 1614 | os=-haiku |
| 1564 | 1615 | ;; |
| 1565 | 1616 | *-ibm) |
| 1566 | 1617 | os=-aix |
| 1567 | 1618 | ;; |
| 1568 | - *-knuth) | |
| 1619 | + *-knuth) | |
| 1569 | 1620 | os=-mmixware |
| 1570 | 1621 | ;; |
| 1571 | 1622 | *-wec) |
| 1572 | 1623 | os=-proelf |
| 1573 | 1624 | ;; |
| 1574 | 1625 |
| --- 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 @@ | ||
| 42 | 42 | #define HAVE_ISATTY |
| 43 | 43 | #define HAVE_SYS_TIME_H |
| 44 | 44 | #define HAVE_DIRENT_H |
| 45 | 45 | #define HAVE_UNISTD_H |
| 46 | 46 | #endif |
| 47 | +#define JIM_VERSION 75 | |
| 47 | 48 | #ifndef JIM_WIN32COMPAT_H |
| 48 | 49 | #define JIM_WIN32COMPAT_H |
| 49 | 50 | |
| 50 | 51 | |
| 51 | 52 | |
| @@ -185,12 +186,10 @@ | ||
| 185 | 186 | #endif |
| 186 | 187 | |
| 187 | 188 | #define UCHAR(c) ((unsigned char)(c)) |
| 188 | 189 | |
| 189 | 190 | |
| 190 | -#define JIM_VERSION 74 | |
| 191 | - | |
| 192 | 191 | #define JIM_OK 0 |
| 193 | 192 | #define JIM_ERR 1 |
| 194 | 193 | #define JIM_RETURN 2 |
| 195 | 194 | #define JIM_BREAK 3 |
| 196 | 195 | #define JIM_CONTINUE 4 |
| @@ -832,16 +831,10 @@ | ||
| 832 | 831 | double *doublePtr); |
| 833 | 832 | JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr, |
| 834 | 833 | double doubleValue); |
| 835 | 834 | JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue); |
| 836 | 835 | |
| 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 | 836 | |
| 844 | 837 | JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc, |
| 845 | 838 | Jim_Obj *const *argv, const char *msg); |
| 846 | 839 | JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr, |
| 847 | 840 | const char * const *tablePtr, int *indexPtr, const char *name, int flags); |
| @@ -875,11 +868,11 @@ | ||
| 875 | 868 | JIM_EXPORT void Jim_HistoryShow(void); |
| 876 | 869 | |
| 877 | 870 | |
| 878 | 871 | JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp); |
| 879 | 872 | 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); | |
| 881 | 874 | #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask) |
| 882 | 875 | |
| 883 | 876 | |
| 884 | 877 | JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName); |
| 885 | 878 | JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp); |
| @@ -1775,19 +1768,11 @@ | ||
| 1775 | 1768 | |
| 1776 | 1769 | Jim_DecrRefCount(interp, af->filename); |
| 1777 | 1770 | |
| 1778 | 1771 | #ifdef jim_ext_eventloop |
| 1779 | 1772 | |
| 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); | |
| 1789 | 1774 | #endif |
| 1790 | 1775 | Jim_Free(af); |
| 1791 | 1776 | } |
| 1792 | 1777 | |
| 1793 | 1778 | static int JimCheckStreamError(Jim_Interp *interp, AioFile *af) |
| @@ -2147,27 +2132,26 @@ | ||
| 2147 | 2132 | } |
| 2148 | 2133 | |
| 2149 | 2134 | #ifdef jim_ext_eventloop |
| 2150 | 2135 | static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData) |
| 2151 | 2136 | { |
| 2152 | - Jim_Obj *objPtr = clientData; | |
| 2137 | + Jim_Obj **objPtrPtr = clientData; | |
| 2153 | 2138 | |
| 2154 | - Jim_DecrRefCount(interp, objPtr); | |
| 2139 | + Jim_DecrRefCount(interp, *objPtrPtr); | |
| 2140 | + *objPtrPtr = NULL; | |
| 2155 | 2141 | } |
| 2156 | 2142 | |
| 2157 | 2143 | static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask) |
| 2158 | 2144 | { |
| 2159 | - Jim_Obj *objPtr = clientData; | |
| 2145 | + Jim_Obj **objPtrPtr = clientData; | |
| 2160 | 2146 | |
| 2161 | - return Jim_EvalObjBackground(interp, objPtr); | |
| 2147 | + return Jim_EvalObjBackground(interp, *objPtrPtr); | |
| 2162 | 2148 | } |
| 2163 | 2149 | |
| 2164 | 2150 | static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj, |
| 2165 | 2151 | int argc, Jim_Obj * const *argv) |
| 2166 | 2152 | { |
| 2167 | - int scriptlen = 0; | |
| 2168 | - | |
| 2169 | 2153 | if (argc == 0) { |
| 2170 | 2154 | |
| 2171 | 2155 | if (*scriptHandlerObj) { |
| 2172 | 2156 | Jim_SetResult(interp, *scriptHandlerObj); |
| 2173 | 2157 | } |
| @@ -2174,27 +2158,25 @@ | ||
| 2174 | 2158 | return JIM_OK; |
| 2175 | 2159 | } |
| 2176 | 2160 | |
| 2177 | 2161 | if (*scriptHandlerObj) { |
| 2178 | 2162 | |
| 2179 | - Jim_DeleteFileHandler(interp, af->fp); | |
| 2180 | - *scriptHandlerObj = NULL; | |
| 2163 | + Jim_DeleteFileHandler(interp, af->fp, mask); | |
| 2181 | 2164 | } |
| 2182 | 2165 | |
| 2183 | 2166 | |
| 2184 | - Jim_GetString(argv[0], &scriptlen); | |
| 2185 | - if (scriptlen == 0) { | |
| 2167 | + if (Jim_Length(argv[0]) == 0) { | |
| 2186 | 2168 | |
| 2187 | 2169 | return JIM_OK; |
| 2188 | 2170 | } |
| 2189 | 2171 | |
| 2190 | 2172 | |
| 2191 | 2173 | Jim_IncrRefCount(argv[0]); |
| 2192 | 2174 | *scriptHandlerObj = argv[0]; |
| 2193 | 2175 | |
| 2194 | 2176 | Jim_CreateFileHandler(interp, af->fp, mask, |
| 2195 | - JimAioFileEventHandler, *scriptHandlerObj, JimAioFileEventFinalizer); | |
| 2177 | + JimAioFileEventHandler, scriptHandlerObj, JimAioFileEventFinalizer); | |
| 2196 | 2178 | |
| 2197 | 2179 | return JIM_OK; |
| 2198 | 2180 | } |
| 2199 | 2181 | |
| 2200 | 2182 | static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| @@ -4005,11 +3987,11 @@ | ||
| 4005 | 3987 | static void JimRestoreEnv(char **env); |
| 4006 | 3988 | static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv, |
| 4007 | 3989 | pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr); |
| 4008 | 3990 | static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr); |
| 4009 | 3991 | 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); | |
| 4011 | 3993 | static fdtype JimOpenForWrite(const char *filename, int append); |
| 4012 | 3994 | static int JimRewindFd(fdtype fd); |
| 4013 | 3995 | |
| 4014 | 3996 | static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg) |
| 4015 | 3997 | { |
| @@ -4347,10 +4329,11 @@ | ||
| 4347 | 4329 | int cmdCount; /* Count of number of distinct commands |
| 4348 | 4330 | * found in argc/argv. */ |
| 4349 | 4331 | const char *input = NULL; /* Describes input for pipeline, depending |
| 4350 | 4332 | * on "inputFile". NULL means take input |
| 4351 | 4333 | * from stdin/pipe. */ |
| 4334 | + int input_len = 0; | |
| 4352 | 4335 | |
| 4353 | 4336 | #define FILE_NAME 0 |
| 4354 | 4337 | #define FILE_APPEND 1 |
| 4355 | 4338 | #define FILE_HANDLE 2 |
| 4356 | 4339 | #define FILE_TEXT 3 |
| @@ -4412,19 +4395,20 @@ | ||
| 4412 | 4395 | if (arg[0] == '<') { |
| 4413 | 4396 | inputFile = FILE_NAME; |
| 4414 | 4397 | input = arg + 1; |
| 4415 | 4398 | if (*input == '<') { |
| 4416 | 4399 | inputFile = FILE_TEXT; |
| 4400 | + input_len = Jim_Length(argv[i]) - 2; | |
| 4417 | 4401 | input++; |
| 4418 | 4402 | } |
| 4419 | 4403 | else if (*input == '@') { |
| 4420 | 4404 | inputFile = FILE_HANDLE; |
| 4421 | 4405 | input++; |
| 4422 | 4406 | } |
| 4423 | 4407 | |
| 4424 | 4408 | if (!*input && ++i < argc) { |
| 4425 | - input = Jim_String(argv[i]); | |
| 4409 | + input = Jim_GetString(argv[i], &input_len); | |
| 4426 | 4410 | } |
| 4427 | 4411 | } |
| 4428 | 4412 | else if (arg[0] == '>') { |
| 4429 | 4413 | int dup_error = 0; |
| 4430 | 4414 | |
| @@ -4498,11 +4482,11 @@ | ||
| 4498 | 4482 | |
| 4499 | 4483 | save_environ = JimSaveEnv(JimBuildEnv(interp)); |
| 4500 | 4484 | |
| 4501 | 4485 | if (input != NULL) { |
| 4502 | 4486 | if (inputFile == FILE_TEXT) { |
| 4503 | - inputId = JimCreateTemp(interp, input); | |
| 4487 | + inputId = JimCreateTemp(interp, input, input_len); | |
| 4504 | 4488 | if (inputId == JIM_BAD_FD) { |
| 4505 | 4489 | goto error; |
| 4506 | 4490 | } |
| 4507 | 4491 | } |
| 4508 | 4492 | else if (inputFile == FILE_HANDLE) { |
| @@ -4587,11 +4571,11 @@ | ||
| 4587 | 4571 | goto error; |
| 4588 | 4572 | } |
| 4589 | 4573 | } |
| 4590 | 4574 | } |
| 4591 | 4575 | else if (errFilePtr != NULL) { |
| 4592 | - errorId = JimCreateTemp(interp, NULL); | |
| 4576 | + errorId = JimCreateTemp(interp, NULL, 0); | |
| 4593 | 4577 | if (errorId == JIM_BAD_FD) { |
| 4594 | 4578 | goto error; |
| 4595 | 4579 | } |
| 4596 | 4580 | *errFilePtr = JimDupFd(errorId); |
| 4597 | 4581 | } |
| @@ -4953,11 +4937,11 @@ | ||
| 4953 | 4937 | *status = ret; |
| 4954 | 4938 | CloseHandle(pid); |
| 4955 | 4939 | return pid; |
| 4956 | 4940 | } |
| 4957 | 4941 | |
| 4958 | -static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents) | |
| 4942 | +static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents, int len) | |
| 4959 | 4943 | { |
| 4960 | 4944 | char name[MAX_PATH]; |
| 4961 | 4945 | HANDLE handle; |
| 4962 | 4946 | |
| 4963 | 4947 | if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) { |
| @@ -4977,11 +4961,11 @@ | ||
| 4977 | 4961 | FILE *fh = JimFdOpenForWrite(JimDupFd(handle)); |
| 4978 | 4962 | if (fh == NULL) { |
| 4979 | 4963 | goto error; |
| 4980 | 4964 | } |
| 4981 | 4965 | |
| 4982 | - if (fwrite(contents, strlen(contents), 1, fh) != 1) { | |
| 4966 | + if (fwrite(contents, len, 1, fh) != 1) { | |
| 4983 | 4967 | fclose(fh); |
| 4984 | 4968 | goto error; |
| 4985 | 4969 | } |
| 4986 | 4970 | fseek(fh, 0, SEEK_SET); |
| 4987 | 4971 | fclose(fh); |
| @@ -5196,11 +5180,11 @@ | ||
| 5196 | 5180 | static int JimRewindFd(int fd) |
| 5197 | 5181 | { |
| 5198 | 5182 | return lseek(fd, 0L, SEEK_SET); |
| 5199 | 5183 | } |
| 5200 | 5184 | |
| 5201 | -static int JimCreateTemp(Jim_Interp *interp, const char *contents) | |
| 5185 | +static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len) | |
| 5202 | 5186 | { |
| 5203 | 5187 | char inName[] = "/tmp/tcl.tmp.XXXXXX"; |
| 5204 | 5188 | |
| 5205 | 5189 | int fd = mkstemp(inName); |
| 5206 | 5190 | if (fd == JIM_BAD_FD) { |
| @@ -5207,12 +5191,11 @@ | ||
| 5207 | 5191 | Jim_SetResultErrno(interp, "couldn't create temp file"); |
| 5208 | 5192 | return -1; |
| 5209 | 5193 | } |
| 5210 | 5194 | unlink(inName); |
| 5211 | 5195 | if (contents) { |
| 5212 | - int length = strlen(contents); | |
| 5213 | - if (write(fd, contents, length) != length) { | |
| 5196 | + if (write(fd, contents, len) != len) { | |
| 5214 | 5197 | Jim_SetResultErrno(interp, "couldn't write temp file"); |
| 5215 | 5198 | close(fd); |
| 5216 | 5199 | return -1; |
| 5217 | 5200 | } |
| 5218 | 5201 | lseek(fd, 0L, SEEK_SET); |
| @@ -5671,10 +5654,11 @@ | ||
| 5671 | 5654 | #ifdef JIM_MAINTAINER |
| 5672 | 5655 | #define JIM_DEBUG_COMMAND |
| 5673 | 5656 | #define JIM_DEBUG_PANIC |
| 5674 | 5657 | #endif |
| 5675 | 5658 | |
| 5659 | + | |
| 5676 | 5660 | |
| 5677 | 5661 | #define JIM_INTEGER_SPACE 24 |
| 5678 | 5662 | |
| 5679 | 5663 | const char *jim_tt_name(int type); |
| 5680 | 5664 | |
| @@ -6029,11 +6013,12 @@ | ||
| 6029 | 6013 | if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) { |
| 6030 | 6014 | |
| 6031 | 6015 | return i; |
| 6032 | 6016 | } |
| 6033 | 6017 | |
| 6034 | - return 10; | |
| 6018 | + *base = 10; | |
| 6019 | + return 0; | |
| 6035 | 6020 | } |
| 6036 | 6021 | |
| 6037 | 6022 | static long jim_strtol(const char *str, char **endptr) |
| 6038 | 6023 | { |
| 6039 | 6024 | int sign; |
| @@ -6109,10 +6094,12 @@ | ||
| 6109 | 6094 | return len; |
| 6110 | 6095 | } |
| 6111 | 6096 | |
| 6112 | 6097 | if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') { |
| 6113 | 6098 | buf[i] = toupper(UCHAR(buf[i])); |
| 6099 | + if (buf[i] == 'n' || buf[i] == 'N') | |
| 6100 | + buf[i+2] = toupper(UCHAR(buf[i+2])); | |
| 6114 | 6101 | buf[i + 3] = 0; |
| 6115 | 6102 | return i + 3; |
| 6116 | 6103 | } |
| 6117 | 6104 | } |
| 6118 | 6105 | |
| @@ -7581,17 +7568,21 @@ | ||
| 7581 | 7568 | objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr; |
| 7582 | 7569 | if (objPtr->nextObjPtr) |
| 7583 | 7570 | objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr; |
| 7584 | 7571 | if (interp->liveList == objPtr) |
| 7585 | 7572 | interp->liveList = objPtr->nextObjPtr; |
| 7573 | +#ifdef JIM_DISABLE_OBJECT_POOL | |
| 7574 | + Jim_Free(objPtr); | |
| 7575 | +#else | |
| 7586 | 7576 | |
| 7587 | 7577 | objPtr->prevObjPtr = NULL; |
| 7588 | 7578 | objPtr->nextObjPtr = interp->freeList; |
| 7589 | 7579 | if (interp->freeList) |
| 7590 | 7580 | interp->freeList->prevObjPtr = objPtr; |
| 7591 | 7581 | interp->freeList = objPtr; |
| 7592 | 7582 | objPtr->refCount = -1; |
| 7583 | +#endif | |
| 7593 | 7584 | } |
| 7594 | 7585 | |
| 7595 | 7586 | |
| 7596 | 7587 | void Jim_InvalidateStringRep(Jim_Obj *objPtr) |
| 7597 | 7588 | { |
| @@ -8244,10 +8235,19 @@ | ||
| 8244 | 8235 | } |
| 8245 | 8236 | |
| 8246 | 8237 | return strObjPtr; |
| 8247 | 8238 | } |
| 8248 | 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 | 8249 | |
| 8250 | 8250 | static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict) |
| 8251 | 8251 | { |
| 8252 | 8252 | static const char * const strclassnames[] = { |
| 8253 | 8253 | "integer", "alpha", "alnum", "ascii", "digit", |
| @@ -8291,11 +8291,11 @@ | ||
| 8291 | 8291 | return JIM_OK; |
| 8292 | 8292 | } |
| 8293 | 8293 | |
| 8294 | 8294 | case STR_IS_ALPHA: isclassfunc = isalpha; break; |
| 8295 | 8295 | case STR_IS_ALNUM: isclassfunc = isalnum; break; |
| 8296 | - case STR_IS_ASCII: isclassfunc = isascii; break; | |
| 8296 | + case STR_IS_ASCII: isclassfunc = jim_isascii; break; | |
| 8297 | 8297 | case STR_IS_DIGIT: isclassfunc = isdigit; break; |
| 8298 | 8298 | case STR_IS_LOWER: isclassfunc = islower; break; |
| 8299 | 8299 | case STR_IS_UPPER: isclassfunc = isupper; break; |
| 8300 | 8300 | case STR_IS_SPACE: isclassfunc = isspace; break; |
| 8301 | 8301 | case STR_IS_XDIGIT: isclassfunc = isxdigit; break; |
| @@ -10213,11 +10213,11 @@ | ||
| 10213 | 10213 | Jim_Collect(interp); |
| 10214 | 10214 | } |
| 10215 | 10215 | } |
| 10216 | 10216 | #endif |
| 10217 | 10217 | |
| 10218 | -static int JimIsBigEndian(void) | |
| 10218 | +int Jim_IsBigEndian(void) | |
| 10219 | 10219 | { |
| 10220 | 10220 | union { |
| 10221 | 10221 | unsigned short s; |
| 10222 | 10222 | unsigned char c[2]; |
| 10223 | 10223 | } uval = {0x0102}; |
| @@ -10269,11 +10269,11 @@ | ||
| 10269 | 10269 | Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0"); |
| 10270 | 10270 | |
| 10271 | 10271 | Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS); |
| 10272 | 10272 | Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM); |
| 10273 | 10273 | 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"); | |
| 10275 | 10275 | Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0"); |
| 10276 | 10276 | Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *))); |
| 10277 | 10277 | Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide))); |
| 10278 | 10278 | |
| 10279 | 10279 | return i; |
| @@ -10449,17 +10449,11 @@ | ||
| 10449 | 10449 | interp->stackTrace = stackTraceObj; |
| 10450 | 10450 | interp->errorFlag = 1; |
| 10451 | 10451 | |
| 10452 | 10452 | len = Jim_ListLength(interp, interp->stackTrace); |
| 10453 | 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)) { | |
| 10454 | + if (Jim_Length(Jim_ListGetIndex(interp, interp->stackTrace, len - 2)) == 0) { | |
| 10461 | 10455 | interp->addStackTrace = 1; |
| 10462 | 10456 | } |
| 10463 | 10457 | } |
| 10464 | 10458 | } |
| 10465 | 10459 | |
| @@ -10485,14 +10479,15 @@ | ||
| 10485 | 10479 | if (!*procname && Jim_Length(fileNameObj)) { |
| 10486 | 10480 | |
| 10487 | 10481 | int len = Jim_ListLength(interp, interp->stackTrace); |
| 10488 | 10482 | |
| 10489 | 10483 | 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)) { | |
| 10492 | 10486 | |
| 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) { | |
| 10494 | 10489 | |
| 10495 | 10490 | ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0); |
| 10496 | 10491 | ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0); |
| 10497 | 10492 | return; |
| 10498 | 10493 | } |
| @@ -17159,10 +17154,15 @@ | ||
| 17159 | 17154 | |
| 17160 | 17155 | static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| 17161 | 17156 | { |
| 17162 | 17157 | int retcode; |
| 17163 | 17158 | |
| 17159 | + if (argc < 2) { | |
| 17160 | + Jim_WrongNumArgs(interp, 1, argv, "cmd ?args ...?"); | |
| 17161 | + return JIM_ERR; | |
| 17162 | + } | |
| 17163 | + | |
| 17164 | 17164 | |
| 17165 | 17165 | interp->local++; |
| 17166 | 17166 | retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1); |
| 17167 | 17167 | interp->local--; |
| 17168 | 17168 | |
| @@ -19552,11 +19552,11 @@ | ||
| 19552 | 19552 | char *num_buffer = NULL; |
| 19553 | 19553 | int num_buffer_size = 0; |
| 19554 | 19554 | |
| 19555 | 19555 | span = format = Jim_GetString(fmtObjPtr, &formatLen); |
| 19556 | 19556 | formatEnd = format + formatLen; |
| 19557 | - resultPtr = Jim_NewStringObj(interp, "", 0); | |
| 19557 | + resultPtr = Jim_NewEmptyStringObj(interp); | |
| 19558 | 19558 | |
| 19559 | 19559 | while (format != formatEnd) { |
| 19560 | 19560 | char *end; |
| 19561 | 19561 | int gotMinus, sawFlag; |
| 19562 | 19562 | int gotPrecision, useShort; |
| 19563 | 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 | #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 |
+195
| --- autosetup/local.tcl | ||
| +++ autosetup/local.tcl | ||
| @@ -26,5 +26,200 @@ | ||
| 26 | 26 | set tclconfig($name) [string trim $value '] |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | return [array get tclconfig] |
| 30 | 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 | +} | |
| 31 | 226 | |
| 32 | 227 | DELETED fossil.nsi |
| 33 | 228 | ADDED setup/fossil.iss |
| 34 | 229 | 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 @@ | |
+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.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 |
+1
-1
| --- a/setup/fossil.nsi | ||
| +++ b/setup/fossil.nsi | ||
| @@ -27,7 +27,7 @@ | ||
| 27 | 27 | Section "Fossil (required)" |
| 28 | 28 | ; Set output path to the installation directory. |
| 29 | 29 | SetOutPath $INSTDIR |
| 30 | - ; Put file there | |
| 30 | + ; Put file there | |
| 31 | 31 | File "..\fossil.exe" |
| 32 | 32 | ; Write the installation path into the registry |
| 33 | 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 | |
| @@ -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" |
+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 |
| --- 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 @@ | ||
| 25 | 25 | #include "cygsup.h" |
| 26 | 26 | |
| 27 | 27 | /* |
| 28 | 28 | ** This routine returns the names of files in a working checkout that |
| 29 | 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. | |
| 30 | +** or merge, and should be omitted from "clean" and "extras" lists. | |
| 31 | 31 | ** |
| 32 | 32 | ** Return the N-th name. The first name has N==0. When all names have |
| 33 | 33 | ** been used, return 0. |
| 34 | 34 | */ |
| 35 | 35 | const char *fossil_reserved_name(int N, int omitRepo){ |
| @@ -221,19 +221,24 @@ | ||
| 221 | 221 | ** The --ignore and --clean options are comma-separate lists of glob patterns |
| 222 | 222 | ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore |
| 223 | 223 | ** option does not appear on the command line then the "ignore-glob" setting |
| 224 | 224 | ** is used. If the --clean option does not appear on the command line then |
| 225 | 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. | |
| 226 | 230 | ** |
| 227 | 231 | ** The --case-sensitive option determines whether or not filenames should |
| 228 | 232 | ** be treated case sensitive or not. If the option is not given, the default |
| 229 | 233 | ** depends on the global setting, or the operating system default, if not set. |
| 230 | 234 | ** |
| 231 | 235 | ** Options: |
| 232 | 236 | ** |
| 233 | 237 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 234 | 238 | ** --dotfiles include files beginning with a dot (".") |
| 239 | +** -f|--force Add files without prompting | |
| 235 | 240 | ** --ignore <CSG> ignore files matching patterns from the |
| 236 | 241 | ** comma separated list of glob patterns. |
| 237 | 242 | ** --clean <CSG> also ignore files matching patterns from |
| 238 | 243 | ** the comma separated list of glob patterns. |
| 239 | 244 | ** |
| @@ -245,13 +250,15 @@ | ||
| 245 | 250 | int nRoot; /* Full path characters in g.zLocalRoot */ |
| 246 | 251 | const char *zCleanFlag; /* The --clean option or clean-glob setting */ |
| 247 | 252 | const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */ |
| 248 | 253 | Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */ |
| 249 | 254 | unsigned scanFlags = 0; /* Flags passed to vfile_scan() */ |
| 255 | + int forceFlag; | |
| 250 | 256 | |
| 251 | 257 | zCleanFlag = find_option("clean",0,1); |
| 252 | 258 | zIgnoreFlag = find_option("ignore",0,1); |
| 259 | + forceFlag = find_option("force","f",0)!=0; | |
| 253 | 260 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 254 | 261 | capture_case_sensitive_option(); |
| 255 | 262 | db_must_be_within_tree(); |
| 256 | 263 | if( zCleanFlag==0 ){ |
| 257 | 264 | zCleanFlag = db_get("clean-glob", 0); |
| @@ -287,10 +294,25 @@ | ||
| 287 | 294 | fossil_warning("not found: %s", zName); |
| 288 | 295 | }else if( file_access(zName, R_OK) ){ |
| 289 | 296 | fossil_fatal("cannot open %s", zName); |
| 290 | 297 | }else{ |
| 291 | 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 | + } | |
| 292 | 314 | db_multi_exec( |
| 293 | 315 | "INSERT OR IGNORE INTO sfile(x) VALUES(%Q)", |
| 294 | 316 | zTreeName |
| 295 | 317 | ); |
| 296 | 318 | } |
| @@ -439,11 +461,11 @@ | ||
| 439 | 461 | ** |
| 440 | 462 | ** Do all necessary "add" and "rm" commands to synchronize the repository |
| 441 | 463 | ** with the content of the working checkout: |
| 442 | 464 | ** |
| 443 | 465 | ** * 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 | |
| 445 | 467 | ** if by the "add" command. |
| 446 | 468 | ** |
| 447 | 469 | ** * All files in the repository but missing from the checkout (that is, |
| 448 | 470 | ** all files that show as MISSING with the "status" command) are |
| 449 | 471 | ** removed as if by the "rm" command. |
| @@ -670,5 +692,13 @@ | ||
| 670 | 692 | mv_one_file(vid, zFrom, zTo); |
| 671 | 693 | } |
| 672 | 694 | db_finalize(&q); |
| 673 | 695 | db_end_transaction(0); |
| 674 | 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 | +} | |
| 675 | 705 |
| --- 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 @@ | ||
| 65 | 65 | }else{ |
| 66 | 66 | blob_appendf(pExtra, " --%s \"\"", zArg); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 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 | +} | |
| 70 | 76 | |
| 71 | 77 | |
| 72 | 78 | /* |
| 73 | 79 | ** COMMAND: all |
| 74 | 80 | ** |
| 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) | |
| 76 | 82 | ** |
| 77 | 83 | ** The ~/.fossil file records the location of all repositories for a |
| 78 | 84 | ** user. This command performs certain operations on all repositories |
| 79 | 85 | ** that can be useful before or after a period of disconnected operation. |
| 80 | 86 | ** |
| @@ -93,18 +99,20 @@ | ||
| 93 | 99 | ** and the --whatif option to carefully review the files to |
| 94 | 100 | ** be deleted beforehand is highly recommended. The command |
| 95 | 101 | ** line options supported by the clean command itself, if any |
| 96 | 102 | ** are present, are passed along verbatim. |
| 97 | 103 | ** |
| 98 | -** extra Shows extra files from all local checkouts. The command | |
| 104 | +** extras Shows "extra" files from all local checkouts. The command | |
| 99 | 105 | ** line options supported by the extra command itself, if any |
| 100 | 106 | ** are present, are passed along verbatim. |
| 101 | 107 | ** |
| 102 | 108 | ** 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 | |
| 104 | 110 | ** sync operations. The -c|--ckout option causes the listed |
| 105 | 111 | ** local checkouts to be ignored instead. |
| 112 | +** | |
| 113 | +** info Run the "info" command on all repositories. | |
| 106 | 114 | ** |
| 107 | 115 | ** list | ls Display the location of all repositories. The -c|--ckout |
| 108 | 116 | ** option causes all local checkouts to be listed instead. |
| 109 | 117 | ** |
| 110 | 118 | ** pull Run a "pull" operation on all repositories. Only the |
| @@ -118,17 +126,23 @@ | ||
| 118 | 126 | ** present, are passed along verbatim. The --force and |
| 119 | 127 | ** --randomize options are not supported. |
| 120 | 128 | ** |
| 121 | 129 | ** sync Run a "sync" on all repositories. Only the --verbose |
| 122 | 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. | |
| 123 | 136 | ** |
| 124 | 137 | ** Repositories are automatically added to the set of known repositories |
| 125 | 138 | ** when one of the following commands are run against the repository: |
| 126 | 139 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 127 | 140 | ** are added back to the list of repositories by these commands. |
| 128 | 141 | ** |
| 129 | 142 | ** Options: |
| 143 | +** --showfile Show the repository or checkout being operated upon. | |
| 130 | 144 | ** --dontstop Continue with other repositories even after an error. |
| 131 | 145 | ** --dry-run If given, display instead of run actions. |
| 132 | 146 | */ |
| 133 | 147 | void all_cmd(void){ |
| 134 | 148 | int n; |
| @@ -139,27 +153,29 @@ | ||
| 139 | 153 | char *zQFilename; |
| 140 | 154 | Blob extra; |
| 141 | 155 | int useCheckouts = 0; |
| 142 | 156 | int quiet = 0; |
| 143 | 157 | int dryRunFlag = 0; |
| 158 | + int showFile = find_option("showfile",0,0)!=0; | |
| 144 | 159 | int stopOnError = find_option("dontstop",0,0)==0; |
| 145 | 160 | int rc; |
| 146 | 161 | int nToDel = 0; |
| 147 | - | |
| 162 | + int showLabel = 0; | |
| 163 | + | |
| 148 | 164 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 149 | 165 | if( !dryRunFlag ){ |
| 150 | 166 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 151 | 167 | } |
| 152 | 168 | |
| 153 | 169 | 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"); | |
| 155 | 171 | } |
| 156 | 172 | n = strlen(g.argv[2]); |
| 157 | 173 | db_open_config(1); |
| 158 | 174 | blob_zero(&extra); |
| 159 | 175 | 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); | |
| 161 | 177 | if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){ |
| 162 | 178 | zCmd = "list"; |
| 163 | 179 | useCheckouts = find_option("ckout","c",0)!=0; |
| 164 | 180 | }else if( strncmp(zCmd, "clean", n)==0 ){ |
| 165 | 181 | zCmd = "clean --chdir"; |
| @@ -174,12 +190,16 @@ | ||
| 174 | 190 | collect_argument_value(&extra, "keep"); |
| 175 | 191 | collect_argument(&extra, "temp",0); |
| 176 | 192 | collect_argument(&extra, "verbose","v"); |
| 177 | 193 | collect_argument(&extra, "whatif",0); |
| 178 | 194 | 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 | + } | |
| 181 | 201 | collect_argument(&extra, "abs-paths",0); |
| 182 | 202 | collect_argument_value(&extra, "case-sensitive"); |
| 183 | 203 | collect_argument(&extra, "dotfiles",0); |
| 184 | 204 | collect_argument_value(&extra, "ignore"); |
| 185 | 205 | collect_argument(&extra, "rel-paths",0); |
| @@ -201,10 +221,16 @@ | ||
| 201 | 221 | collect_argument(&extra, "vacuum",0); |
| 202 | 222 | collect_argument(&extra, "deanalyze",0); |
| 203 | 223 | collect_argument(&extra, "analyze",0); |
| 204 | 224 | collect_argument(&extra, "wal",0); |
| 205 | 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); | |
| 206 | 232 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 207 | 233 | zCmd = "sync -autourl -R"; |
| 208 | 234 | collect_argument(&extra, "verbose","v"); |
| 209 | 235 | }else if( strncmp(zCmd, "test-integrity", n)==0 ){ |
| 210 | 236 | collect_argument(&extra, "parse", 0); |
| @@ -235,35 +261,43 @@ | ||
| 235 | 261 | } |
| 236 | 262 | fossil_free(zSql); |
| 237 | 263 | } |
| 238 | 264 | db_end_transaction(0); |
| 239 | 265 | return; |
| 266 | + }else if( strncmp(zCmd, "info", n)==0 ){ | |
| 267 | + zCmd = "info"; | |
| 268 | + showLabel = 1; | |
| 269 | + quiet = 1; | |
| 240 | 270 | }else{ |
| 241 | 271 | 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"); | |
| 243 | 273 | } |
| 244 | 274 | verify_all_options(); |
| 245 | 275 | zFossil = quoteFilename(g.nameOfExe); |
| 276 | + db_multi_exec("CREATE TEMP TABLE repolist(name,tag);"); | |
| 246 | 277 | if( useCheckouts ){ |
| 247 | - db_prepare(&q, | |
| 278 | + db_multi_exec( | |
| 279 | + "INSERT INTO repolist " | |
| 248 | 280 | "SELECT DISTINCT substr(name, 7), name COLLATE nocase" |
| 249 | 281 | " FROM global_config" |
| 250 | 282 | " WHERE substr(name, 1, 6)=='ckout:'" |
| 251 | 283 | " ORDER BY 1" |
| 252 | 284 | ); |
| 253 | 285 | }else{ |
| 254 | - db_prepare(&q, | |
| 286 | + db_multi_exec( | |
| 287 | + "INSERT INTO repolist " | |
| 255 | 288 | "SELECT DISTINCT substr(name, 6), name COLLATE nocase" |
| 256 | 289 | " FROM global_config" |
| 257 | 290 | " WHERE substr(name, 1, 5)=='repo:'" |
| 258 | 291 | " ORDER BY 1" |
| 259 | 292 | ); |
| 260 | 293 | } |
| 261 | 294 | db_multi_exec("CREATE TEMP TABLE todel(x TEXT)"); |
| 295 | + db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1"); | |
| 262 | 296 | while( db_step(&q)==SQLITE_ROW ){ |
| 263 | 297 | const char *zFilename = db_column_text(&q, 0); |
| 264 | - if( file_access(zFilename, 0) | |
| 298 | + if( file_access(zFilename, F_OK) | |
| 265 | 299 | || !file_is_canonical(zFilename) |
| 266 | 300 | || (useCheckouts && file_isdir(zFilename)!=1) |
| 267 | 301 | ){ |
| 268 | 302 | db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1)); |
| 269 | 303 | nToDel++; |
| @@ -270,14 +304,23 @@ | ||
| 270 | 304 | continue; |
| 271 | 305 | } |
| 272 | 306 | if( zCmd[0]=='l' ){ |
| 273 | 307 | fossil_print("%s\n", zFilename); |
| 274 | 308 | continue; |
| 309 | + }else if( showFile ){ | |
| 310 | + fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository", | |
| 311 | + zFilename); | |
| 275 | 312 | } |
| 276 | 313 | zQFilename = quoteFilename(zFilename); |
| 277 | 314 | zSyscmd = mprintf("%s %s %s%s", |
| 278 | 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 | + } | |
| 279 | 322 | if( !quiet || dryRunFlag ){ |
| 280 | 323 | fossil_print("%s\n", zSyscmd); |
| 281 | 324 | fflush(stdout); |
| 282 | 325 | } |
| 283 | 326 | rc = dryRunFlag ? 0 : fossil_system(zSyscmd); |
| @@ -286,11 +329,11 @@ | ||
| 286 | 329 | if( stopOnError && rc ){ |
| 287 | 330 | break; |
| 288 | 331 | } |
| 289 | 332 | } |
| 290 | 333 | db_finalize(&q); |
| 291 | - | |
| 334 | + | |
| 292 | 335 | /* If any repositories whose names appear in the ~/.fossil file could not |
| 293 | 336 | ** be found, remove those names from the ~/.fossil file. |
| 294 | 337 | */ |
| 295 | 338 | if( nToDel>0 ){ |
| 296 | 339 | const char *zSql = "DELETE FROM global_config WHERE name IN toDel"; |
| 297 | 340 |
| --- 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 @@ | ||
| 29 | 29 | ** |
| 30 | 30 | ** List attachments. |
| 31 | 31 | ** Either one of tkt= or page= are supplied or neither. If neither |
| 32 | 32 | ** are given, all attachments are listed. If one is given, only |
| 33 | 33 | ** attachments for the designated ticket or wiki page are shown. |
| 34 | -** TICKETUUID must be complete | |
| 34 | +** TICKETUUID must be complete | |
| 35 | 35 | */ |
| 36 | 36 | void attachlist_page(void){ |
| 37 | 37 | const char *zPage = P("page"); |
| 38 | 38 | const char *zTkt = P("tkt"); |
| 39 | 39 | Blob sql; |
| @@ -53,11 +53,11 @@ | ||
| 53 | 53 | if( g.perm.RdWiki==0 ) login_needed(); |
| 54 | 54 | style_header("Attachments To %h", zPage); |
| 55 | 55 | blob_appendf(&sql, " WHERE target=%Q", zPage); |
| 56 | 56 | }else if( zTkt ){ |
| 57 | 57 | if( g.perm.RdTkt==0 ) login_needed(); |
| 58 | - style_header("Attachments To Ticket %.10s", zTkt); | |
| 58 | + style_header("Attachments To Ticket %S", zTkt); | |
| 59 | 59 | blob_appendf(&sql, " WHERE target GLOB '%q*'", zTkt); |
| 60 | 60 | }else{ |
| 61 | 61 | if( g.perm.RdTkt==0 && g.perm.RdWiki==0 ) login_needed(); |
| 62 | 62 | style_header("All Attachments"); |
| 63 | 63 | } |
| @@ -75,11 +75,11 @@ | ||
| 75 | 75 | int attachid = db_column_int(&q, 7); |
| 76 | 76 | const char *zDispUser = zUser && zUser[0] ? zUser : "anonymous"; |
| 77 | 77 | int i; |
| 78 | 78 | char *zUrlTail; |
| 79 | 79 | for(i=0; zFilename[i]; i++){ |
| 80 | - if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ | |
| 80 | + if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ | |
| 81 | 81 | zFilename = &zFilename[i+1]; |
| 82 | 82 | i = -1; |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| @@ -253,16 +253,16 @@ | ||
| 253 | 253 | zTargetType = mprintf("Wiki Page <a href=\"%s/wiki?name=%h\">%h</a>", |
| 254 | 254 | g.zTop, zPage, zPage); |
| 255 | 255 | }else{ |
| 256 | 256 | if( g.perm.ApndTkt==0 || g.perm.Attach==0 ) login_needed(); |
| 257 | 257 | 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" | |
| 259 | 259 | " WHERE tagname GLOB 'tkt-%q*'", zTkt); |
| 260 | 260 | if( zTkt==0 ) fossil_redirect_home(); |
| 261 | 261 | } |
| 262 | 262 | zTarget = zTkt; |
| 263 | - zTargetType = mprintf("Ticket <a href=\"%s/tktview/%S\">%S</a>", | |
| 263 | + zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>", | |
| 264 | 264 | g.zTop, zTkt, zTkt); |
| 265 | 265 | } |
| 266 | 266 | if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop); |
| 267 | 267 | if( P("cancel") ){ |
| 268 | 268 | cgi_redirect(zFrom); |
| @@ -309,11 +309,11 @@ | ||
| 309 | 309 | if( n>0 ){ |
| 310 | 310 | blob_appendf(&manifest, "C %#F\n", n, zComment); |
| 311 | 311 | } |
| 312 | 312 | zDate = date_in_standard_format("now"); |
| 313 | 313 | 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()); | |
| 315 | 315 | md5sum_blob(&manifest, &cksum); |
| 316 | 316 | blob_appendf(&manifest, "Z %b\n", &cksum); |
| 317 | 317 | attach_put(&manifest, rid, needModerator); |
| 318 | 318 | assert( blob_is_reset(&manifest) ); |
| 319 | 319 | db_end_transaction(0); |
| @@ -427,11 +427,11 @@ | ||
| 427 | 427 | zFile += n; |
| 428 | 428 | if( zFile[0]==0 ) zFile = "unknown"; |
| 429 | 429 | blob_appendf(&manifest, "A %F %F\n", zFile, zTarget); |
| 430 | 430 | zDate = date_in_standard_format("now"); |
| 431 | 431 | 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()); | |
| 433 | 433 | md5sum_blob(&manifest, &cksum); |
| 434 | 434 | blob_appendf(&manifest, "Z %b\n", &cksum); |
| 435 | 435 | rid = content_put(&manifest); |
| 436 | 436 | manifest_crosslink(rid, &manifest, MC_NONE); |
| 437 | 437 | db_end_transaction(0); |
| @@ -445,11 +445,11 @@ | ||
| 445 | 445 | @ <p>Confirm you want to delete the attachment shown below. |
| 446 | 446 | @ <input type="submit" name="confirm" value="Confirm"> |
| 447 | 447 | @ </form> |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | - isModerator = g.perm.Admin || | |
| 450 | + isModerator = g.perm.Admin || | |
| 451 | 451 | (zTktUuid && g.perm.ModTkt) || |
| 452 | 452 | (zWikiName && g.perm.ModWiki); |
| 453 | 453 | if( isModerator && (zModAction = P("modaction"))!=0 ){ |
| 454 | 454 | if( strcmp(zModAction,"delete")==0 ){ |
| 455 | 455 | moderation_disapprove(rid); |
| @@ -463,11 +463,11 @@ | ||
| 463 | 463 | if( strcmp(zModAction,"approve")==0 ){ |
| 464 | 464 | moderation_approve(rid); |
| 465 | 465 | } |
| 466 | 466 | } |
| 467 | 467 | style_header("Attachment Details"); |
| 468 | - style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid); | |
| 468 | + style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid); | |
| 469 | 469 | |
| 470 | 470 | @ <div class="section">Overview</div> |
| 471 | 471 | @ <p><table class="label-value"> |
| 472 | 472 | @ <tr><th>Artifact ID:</th> |
| 473 | 473 | @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a> |
| @@ -500,11 +500,11 @@ | ||
| 500 | 500 | if( g.perm.Setup ){ |
| 501 | 501 | @ <tr><th>MIME-Type:</th><td>%h(zMime)</td></tr> |
| 502 | 502 | } |
| 503 | 503 | @ <tr><th valign="top">Description:</th><td valign="top">%h(zDesc)</td></tr> |
| 504 | 504 | @ </table> |
| 505 | - | |
| 505 | + | |
| 506 | 506 | if( isModerator && modPending ){ |
| 507 | 507 | @ <div class="section">Moderation</div> |
| 508 | 508 | @ <blockquote> |
| 509 | 509 | form_begin(0, "%R/ainfo/%s", zUuid); |
| 510 | 510 | @ <label><input type="radio" name="modaction" value="delete"> |
| @@ -531,12 +531,12 @@ | ||
| 531 | 531 | @ <pre> |
| 532 | 532 | @ %h(z) |
| 533 | 533 | @ </pre> |
| 534 | 534 | } |
| 535 | 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); | |
| 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 | 538 | }else{ |
| 539 | 539 | int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc); |
| 540 | 540 | @ <i>(file is %d(sz) bytes of binary data)</i> |
| 541 | 541 | } |
| 542 | 542 | @ </blockquote> |
| @@ -557,11 +557,11 @@ | ||
| 557 | 557 | db_prepare(&q, |
| 558 | 558 | "SELECT datetime(mtime%s), filename, user," |
| 559 | 559 | " (SELECT uuid FROM blob WHERE rid=attachid), src" |
| 560 | 560 | " FROM attachment" |
| 561 | 561 | " WHERE isLatest AND src!='' AND target=%Q" |
| 562 | - " ORDER BY mtime DESC", | |
| 562 | + " ORDER BY mtime DESC", | |
| 563 | 563 | timeline_utc(), zTarget |
| 564 | 564 | ); |
| 565 | 565 | while( db_step(&q)==SQLITE_ROW ){ |
| 566 | 566 | const char *zDate = db_column_text(&q, 0); |
| 567 | 567 | const char *zFile = db_column_text(&q, 1); |
| @@ -582,7 +582,7 @@ | ||
| 582 | 582 | } |
| 583 | 583 | if( cnt ){ |
| 584 | 584 | @ </ul> |
| 585 | 585 | } |
| 586 | 586 | db_finalize(&q); |
| 587 | - | |
| 587 | + | |
| 588 | 588 | } |
| 589 | 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 %.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 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 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 @@ | ||
| 75 | 75 | /* |
| 76 | 76 | ** Change the size of the hash table on a bag so that |
| 77 | 77 | ** it contains N slots |
| 78 | 78 | ** |
| 79 | 79 | ** 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 | |
| 81 | 81 | ** should be the case that p->cnt==p->used. |
| 82 | 82 | */ |
| 83 | 83 | static void bag_resize(Bag *p, int newSize){ |
| 84 | 84 | int i; |
| 85 | 85 | Bag old; |
| 86 | 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 |
| --- 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 @@ | ||
| 370 | 370 | g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid); |
| 371 | 371 | g.argc = 3; |
| 372 | 372 | g.fNoSync = 1; |
| 373 | 373 | update_cmd(); |
| 374 | 374 | } |
| 375 | - | |
| 375 | + | |
| 376 | 376 | if( strncmp(zDisplay,"chart",m)==0 ){ |
| 377 | 377 | bisect_chart(1); |
| 378 | 378 | }else if( strncmp(zDisplay, "log", m)==0 ){ |
| 379 | 379 | bisect_chart(0); |
| 380 | 380 | }else if( strncmp(zDisplay, "status", m)==0 ){ |
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | 394 | fossil_free(z); |
| 395 | - comment_print(aBisectOption[i].zDesc, 27, 79); | |
| 395 | + comment_print(aBisectOption[i].zDesc, 27, -1); | |
| 396 | 396 | } |
| 397 | 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | 398 | unsigned int i; |
| 399 | 399 | n = strlen(g.argv[3]); |
| 400 | 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 | 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, 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 @@ | ||
| 786 | 786 | return nWrote; |
| 787 | 787 | } |
| 788 | 788 | #endif |
| 789 | 789 | fwrite(blob_buffer(pBlob), 1, nWrote, stdout); |
| 790 | 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); | |
| 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 | + } | |
| 829 | 798 | blob_is_init(pBlob); |
| 830 | 799 | nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out); |
| 831 | 800 | fclose(out); |
| 832 | 801 | if( nWrote!=blob_size(pBlob) ){ |
| 833 | 802 | fossil_fatal_recursive("short write: %d of %d bytes to %s", nWrote, |
| @@ -1035,10 +1004,65 @@ | ||
| 1035 | 1004 | else if( z[i+1]!='\n' ) z[j++] = '\n'; |
| 1036 | 1005 | } |
| 1037 | 1006 | z[j] = 0; |
| 1038 | 1007 | p->nUsed = j; |
| 1039 | 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 | +} | |
| 1040 | 1064 | |
| 1041 | 1065 | /* |
| 1042 | 1066 | ** Shell-escape the given string. Append the result to a blob. |
| 1043 | 1067 | */ |
| 1044 | 1068 | void shell_escape(Blob *pBlob, const char *zIn){ |
| 1045 | 1069 |
| --- 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 @@ | ||
| 51 | 51 | verify_all_options(); |
| 52 | 52 | if( g.argc<5 ){ |
| 53 | 53 | usage("new BRANCH-NAME BASIS ?OPTIONS?"); |
| 54 | 54 | } |
| 55 | 55 | 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; } | |
| 57 | 58 | |
| 58 | 59 | /* fossil branch new name */ |
| 59 | 60 | zBranch = g.argv[3]; |
| 60 | 61 | if( zBranch==0 || zBranch[0]==0 ){ |
| 61 | 62 | fossil_fatal("branch name cannot be empty"); |
| @@ -133,17 +134,16 @@ | ||
| 133 | 134 | const char *zTag = db_column_text(&q, 0); |
| 134 | 135 | blob_appendf(&branch, "T -%F *\n", zTag); |
| 135 | 136 | } |
| 136 | 137 | db_finalize(&q); |
| 137 | 138 | |
| 138 | - blob_appendf(&branch, "U %F\n", zUserOvrd ? zUserOvrd : g.zLogin); | |
| 139 | + blob_appendf(&branch, "U %F\n", zUserOvrd ? zUserOvrd : login_name()); | |
| 139 | 140 | md5sum_blob(&branch, &mcksum); |
| 140 | 141 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 141 | 142 | if( !noSign && clearsign(&branch, &branch) ){ |
| 142 | 143 | Blob ans; |
| 143 | 144 | char cReply; |
| 144 | - blob_zero(&ans); | |
| 145 | 145 | prompt_user("unable to sign manifest. continue (y/N)? ", &ans); |
| 146 | 146 | cReply = blob_str(&ans)[0]; |
| 147 | 147 | if( cReply!='y' && cReply!='Y'){ |
| 148 | 148 | db_end_transaction(1); |
| 149 | 149 | fossil_exit(1); |
| @@ -176,11 +176,11 @@ | ||
| 176 | 176 | |
| 177 | 177 | /* Commit */ |
| 178 | 178 | db_end_transaction(0); |
| 179 | 179 | |
| 180 | 180 | /* 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)); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /* |
| 185 | 185 | ** Prepare a query that will list branches. |
| 186 | 186 | ** |
| @@ -334,11 +334,11 @@ | ||
| 334 | 334 | @ <li> A <div class="sideboxDescribed">%z(href("brlist?closed")) |
| 335 | 335 | @ closed branch</a></div> is a branch with only |
| 336 | 336 | @ <div class="sideboxDescribed">%z(href("leaves?closed")) |
| 337 | 337 | @ closed leaves</a></div>. |
| 338 | 338 | @ Closed branches are fixed and do not change (unless they are first |
| 339 | - @ reopened)</li> | |
| 339 | + @ reopened).</li> | |
| 340 | 340 | @ </ol> |
| 341 | 341 | style_sidebox_end(); |
| 342 | 342 | |
| 343 | 343 | branch_prepare_list_query(&q, showAll?1:(showClosed?-1:0)); |
| 344 | 344 | cnt = 0; |
| @@ -367,16 +367,10 @@ | ||
| 367 | 367 | } |
| 368 | 368 | if( cnt ){ |
| 369 | 369 | @ </ul> |
| 370 | 370 | } |
| 371 | 371 | db_finalize(&q); |
| 372 | - @ <script type="text/JavaScript"> | |
| 373 | - @ function xin(id){ | |
| 374 | - @ } | |
| 375 | - @ function xout(id){ | |
| 376 | - @ } | |
| 377 | - @ </script> | |
| 378 | 372 | style_footer(); |
| 379 | 373 | } |
| 380 | 374 | |
| 381 | 375 | /* |
| 382 | 376 | ** This routine is called while for each check-in that is rendered by |
| @@ -422,13 +416,7 @@ | ||
| 422 | 416 | " ORDER BY event.mtime DESC", |
| 423 | 417 | timeline_query_for_www(), TAG_BRANCH |
| 424 | 418 | ); |
| 425 | 419 | www_print_timeline(&q, 0, 0, 0, brtimeline_extra); |
| 426 | 420 | db_finalize(&q); |
| 427 | - @ <script type="text/JavaScript"> | |
| 428 | - @ function xin(id){ | |
| 429 | - @ } | |
| 430 | - @ function xout(id){ | |
| 431 | - @ } | |
| 432 | - @ </script> | |
| 433 | 421 | style_footer(); |
| 434 | 422 | } |
| 435 | 423 |
| --- 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 @@ | ||
| 85 | 85 | |
| 86 | 86 | for(i=0; zPath[i]; i=j){ |
| 87 | 87 | for(j=i; zPath[j] && zPath[j]!='/'; j++){} |
| 88 | 88 | if( zPath[j] && g.perm.Hyperlink ){ |
| 89 | 89 | 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); | |
| 91 | 91 | blob_appendf(pOut, "%s%z%#h</a>", |
| 92 | 92 | zSep, zLink, j-i, &zPath[i]); |
| 93 | 93 | }else{ |
| 94 | 94 | char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx); |
| 95 | 95 | blob_appendf(pOut, "%s%z%#h</a>", |
| @@ -179,18 +179,15 @@ | ||
| 179 | 179 | if( linkTip ){ |
| 180 | 180 | style_submenu_element("Tip", "Tip", "%s", |
| 181 | 181 | url_render(&sURI, "ci", "tip", 0, 0)); |
| 182 | 182 | } |
| 183 | 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>] | |
| 184 | + @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] | |
| 188 | 185 | @ %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); | |
| 190 | 187 | 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", | |
| 192 | 189 | zUuid); |
| 193 | 190 | } |
| 194 | 191 | }else{ |
| 195 | 192 | @ <h2>The union of all files from all check-ins |
| 196 | 193 | @ %s(blob_str(&dirname))</h2> |
| @@ -490,11 +487,11 @@ | ||
| 490 | 487 | } |
| 491 | 488 | if( zCI ){ |
| 492 | 489 | style_submenu_element("All", "All", "%s", |
| 493 | 490 | url_render(&sURI, "ci", 0, 0, 0)); |
| 494 | 491 | 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", | |
| 496 | 493 | zUuid); |
| 497 | 494 | } |
| 498 | 495 | } |
| 499 | 496 | if( linkTrunk ){ |
| 500 | 497 | style_submenu_element("Trunk", "Trunk", "%s", |
| @@ -517,13 +514,11 @@ | ||
| 517 | 514 | |
| 518 | 515 | db_multi_exec( |
| 519 | 516 | "CREATE TEMP TABLE filelist(" |
| 520 | 517 | " x TEXT PRIMARY KEY COLLATE nocase," |
| 521 | 518 | " 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;" | |
| 525 | 520 | ); |
| 526 | 521 | db_prepare(&ins, "INSERT OR IGNORE INTO filelist VALUES(:f,:u)"); |
| 527 | 522 | manifest_file_rewind(pM); |
| 528 | 523 | while( (pFile = manifest_file_next(pM,0))!=0 ){ |
| 529 | 524 | if( nD>0 |
| @@ -576,11 +571,11 @@ | ||
| 576 | 571 | if( zCI ){ |
| 577 | 572 | @ <h2>%d(nFile) %s(zObjType) of check-in |
| 578 | 573 | if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 579 | 574 | @ "%h(zCI)" |
| 580 | 575 | } |
| 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> | |
| 582 | 577 | }else{ |
| 583 | 578 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 584 | 579 | @ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins |
| 585 | 580 | @ %s(blob_str(&dirname))</h2> |
| 586 | 581 | } |
| @@ -597,38 +592,37 @@ | ||
| 597 | 592 | ** The <li> element for directories also contains a sublist <ul> |
| 598 | 593 | ** for the contents of that directory. |
| 599 | 594 | */ |
| 600 | 595 | @ <div class="filetree"><ul> |
| 601 | 596 | if( nD ){ |
| 602 | - @ <li class="dir"> | |
| 597 | + @ <li class="dir last"> | |
| 603 | 598 | }else{ |
| 604 | - @ <li class="dir subdir"> | |
| 599 | + @ <li class="dir subdir last"> | |
| 605 | 600 | } |
| 606 | 601 | @ %z(href("%s",url_render(&sURI,"name",0,0,0)))%h(zProjectName)</a> |
| 607 | 602 | @ <ul> |
| 608 | 603 | for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ |
| 604 | + const char *zLastClass = p->isLast ? " last" : ""; | |
| 609 | 605 | 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)"> | |
| 615 | 608 | @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a> |
| 616 | 609 | if( startExpanded || p->nFullName<=nD ){ |
| 617 | 610 | @ <ul id="dir%d(nDir)"> |
| 618 | 611 | }else{ |
| 619 | - @ <ul id="dir%d(nDir)" style='display:none;'> | |
| 612 | + @ <ul id="dir%d(nDir)" class="collapsed"> | |
| 620 | 613 | } |
| 621 | 614 | nDir++; |
| 622 | 615 | }else if( !showDirOnly ){ |
| 616 | + const char *zFileClass = fileext_class(p->zName); | |
| 623 | 617 | char *zLink; |
| 624 | 618 | if( zCI ){ |
| 625 | - zLink = href("%R/artifact/%S",p->zUuid); | |
| 619 | + zLink = href("%R/artifact/%s",p->zUuid); | |
| 626 | 620 | }else{ |
| 627 | 621 | zLink = href("%R/finfo?name=%T",p->zFullName); |
| 628 | 622 | } |
| 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> | |
| 630 | 624 | } |
| 631 | 625 | if( p->isLast ){ |
| 632 | 626 | int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0); |
| 633 | 627 | while( nClose-- > 0 ){ |
| 634 | 628 | @ </ul> |
| @@ -637,20 +631,19 @@ | ||
| 637 | 631 | } |
| 638 | 632 | @ </ul> |
| 639 | 633 | @ </ul></div> |
| 640 | 634 | @ <script>(function(){ |
| 641 | 635 | @ function isExpanded(ul){ |
| 642 | - @ var display = window.getComputedStyle(ul).getPropertyValue('display'); | |
| 643 | - @ return display!='none'; | |
| 636 | + @ return ul.className==''; | |
| 644 | 637 | @ } |
| 645 | 638 | @ |
| 646 | 639 | @ function toggleDir(ul, useInitValue){ |
| 647 | 640 | @ if( !useInitValue ){ |
| 648 | 641 | @ expandMap[ul.id] = !isExpanded(ul); |
| 649 | 642 | @ history.replaceState(expandMap, ''); |
| 650 | 643 | @ } |
| 651 | - @ ul.style.display = expandMap[ul.id] ? 'block' : 'none'; | |
| 644 | + @ ul.className = expandMap[ul.id] ? '' : 'collapsed'; | |
| 652 | 645 | @ } |
| 653 | 646 | @ |
| 654 | 647 | @ function toggleAll(tree, useInitValue){ |
| 655 | 648 | @ var lists = tree.querySelectorAll('.subdir > ul > li ul'); |
| 656 | 649 | @ if( !useInitValue ){ |
| @@ -662,38 +655,47 @@ | ||
| 662 | 655 | @ } |
| 663 | 656 | @ } |
| 664 | 657 | @ expandMap = {'*': expand}; |
| 665 | 658 | @ history.replaceState(expandMap, ''); |
| 666 | 659 | @ } |
| 667 | - @ var display = expandMap['*'] ? 'block' : 'none'; | |
| 660 | + @ var className = expandMap['*'] ? '' : 'collapsed'; | |
| 668 | 661 | @ for( var i=0; lists[i]; i++ ){ |
| 669 | - @ lists[i].style.display = display; | |
| 662 | + @ lists[i].className = className; | |
| 670 | 663 | @ } |
| 671 | 664 | @ } |
| 672 | 665 | @ |
| 673 | 666 | @ function checkState(){ |
| 674 | 667 | @ expandMap = history.state || {}; |
| 675 | - @ if( expandMap['*'] ) toggleAll(outer_ul, true); | |
| 668 | + @ if( '*' in expandMap ) toggleAll(outer_ul, true); | |
| 676 | 669 | @ for( var id in expandMap ){ |
| 677 | 670 | @ if( id!=='*' ) toggleDir(gebi(id), true); |
| 678 | 671 | @ } |
| 679 | 672 | @ } |
| 680 | 673 | @ |
| 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 || {}; | |
| 682 | 683 | @ if( !history.replaceState ) history.replaceState = function(){}; |
| 683 | 684 | @ var outer_ul = document.querySelector('.filetree > ul'); |
| 684 | 685 | @ var subdir = outer_ul.querySelector('.subdir'); |
| 685 | 686 | @ var expandMap = {}; |
| 686 | 687 | @ checkState(); |
| 687 | 688 | @ outer_ul.onclick = function(e){ |
| 688 | - @ var a = e.target; | |
| 689 | + @ e = e || window.event; | |
| 690 | + @ var a = e.target || e.srcElement; | |
| 689 | 691 | @ if( a.nodeName!='A' ) return true; |
| 690 | 692 | @ if( a.parentNode==subdir ){ |
| 691 | 693 | @ toggleAll(outer_ul); |
| 692 | 694 | @ return false; |
| 693 | 695 | @ } |
| 694 | - @ if( !subdir.contains(a) ) return true; | |
| 696 | + @ if( !belowSubdir(a) ) return true; | |
| 695 | 697 | @ var ul = a.nextSibling; |
| 696 | 698 | @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling; |
| 697 | 699 | @ if( !ul ) return true; /* This is a file link, not a directory */ |
| 698 | 700 | @ toggleDir(ul); |
| 699 | 701 | @ return false; |
| @@ -727,20 +729,22 @@ | ||
| 727 | 729 | |
| 728 | 730 | /* |
| 729 | 731 | ** Look at all file containing in the version "vid". Construct a |
| 730 | 732 | ** temporary table named "fileage" that contains the file-id for each |
| 731 | 733 | ** 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. | |
| 733 | 736 | */ |
| 734 | -int compute_fileage(int vid){ | |
| 737 | +int compute_fileage(int vid, char const * zGlob){ | |
| 735 | 738 | Manifest *pManifest; |
| 736 | 739 | ManifestFile *pFile; |
| 737 | 740 | int nFile = 0; |
| 738 | 741 | double vmtime; |
| 739 | 742 | Stmt ins; |
| 740 | 743 | Stmt q1, q2, q3; |
| 741 | 744 | Stmt upd; |
| 745 | + if(zGlob && !*zGlob) zGlob = NULL; | |
| 742 | 746 | db_multi_exec( |
| 743 | 747 | /*"DROP TABLE IF EXISTS temp.fileage;"*/ |
| 744 | 748 | "CREATE TEMP TABLE fileage(" |
| 745 | 749 | " fid INTEGER," |
| 746 | 750 | " mid INTEGER," |
| @@ -755,10 +759,11 @@ | ||
| 755 | 759 | db_prepare(&ins, |
| 756 | 760 | "INSERT INTO temp.fileage(fid, pathname)" |
| 757 | 761 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 758 | 762 | ); |
| 759 | 763 | while( (pFile = manifest_file_next(pManifest, 0))!=0 ){ |
| 764 | + if(zGlob && !strglob(zGlob, pFile->zName)) continue; | |
| 760 | 765 | db_bind_text(&ins, ":uuid", pFile->zUuid); |
| 761 | 766 | db_bind_text(&ins, ":path", pFile->zName); |
| 762 | 767 | db_step(&ins); |
| 763 | 768 | db_reset(&ins); |
| 764 | 769 | nFile++; |
| @@ -802,20 +807,22 @@ | ||
| 802 | 807 | |
| 803 | 808 | /* |
| 804 | 809 | ** WEBPAGE: fileage |
| 805 | 810 | ** |
| 806 | 811 | ** 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). | |
| 808 | 815 | */ |
| 809 | 816 | void fileage_page(void){ |
| 810 | 817 | int rid; |
| 811 | 818 | const char *zName; |
| 812 | 819 | char *zBaseTime; |
| 820 | + char const * zGlob; | |
| 813 | 821 | Stmt q; |
| 814 | 822 | double baseTime; |
| 815 | 823 | int lastMid = -1; |
| 816 | - | |
| 817 | 824 | login_check_credentials(); |
| 818 | 825 | if( !g.perm.Read ){ login_needed(); return; } |
| 819 | 826 | zName = P("name"); |
| 820 | 827 | if( zName==0 ) zName = "tip"; |
| 821 | 828 | rid = symbolic_name_to_rid(zName, "ci"); |
| @@ -822,11 +829,12 @@ | ||
| 822 | 829 | if( rid==0 ){ |
| 823 | 830 | fossil_fatal("not a valid check-in: %s", zName); |
| 824 | 831 | } |
| 825 | 832 | style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T", zName); |
| 826 | 833 | style_header("File Ages", zName); |
| 827 | - compute_fileage(rid); | |
| 834 | + zGlob = P("glob"); | |
| 835 | + compute_fileage(rid,zGlob); | |
| 828 | 836 | baseTime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid); |
| 829 | 837 | zBaseTime = db_text("","SELECT datetime(%.20g%s)", baseTime, timeline_utc()); |
| 830 | 838 | @ <h2>File Ages For Check-in |
| 831 | 839 | @ %z(href("%R/info?name=%T",zName))%h(zName)</a></h2> |
| 832 | 840 | @ |
| @@ -864,14 +872,14 @@ | ||
| 864 | 872 | zAge[0] = 0; |
| 865 | 873 | } |
| 866 | 874 | @ <tr> |
| 867 | 875 | @ <td>%s(zAge) |
| 868 | 876 | @ <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> | |
| 870 | 878 | @ </tr> |
| 871 | 879 | @ |
| 872 | 880 | } |
| 873 | 881 | @ <tr><td colspan=3><hr></tr> |
| 874 | 882 | @ </table> |
| 875 | 883 | db_finalize(&q); |
| 876 | 884 | style_footer(); |
| 877 | 885 | } |
| 878 | 886 | |
| 879 | 887 | 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 |
+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() |
| --- 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 @@ | ||
| 92 | 92 | z[k++] = ' '; |
| 93 | 93 | } |
| 94 | 94 | z[k++] = '\n'; |
| 95 | 95 | } |
| 96 | 96 | z[k] = 0; |
| 97 | - return z; | |
| 97 | + return z; | |
| 98 | 98 | } |
| 99 | 99 | #endif /* CAPTCHA==1 */ |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | #if CAPTCHA==2 |
| @@ -148,11 +148,11 @@ | ||
| 148 | 148 | "|__ |", |
| 149 | 149 | " / / ", |
| 150 | 150 | " /_/ ", |
| 151 | 151 | |
| 152 | 152 | /* 8 */ |
| 153 | - " ___ ", | |
| 153 | + " ___ ", | |
| 154 | 154 | "( _ )", |
| 155 | 155 | "/ _ \\", |
| 156 | 156 | "\\___/", |
| 157 | 157 | |
| 158 | 158 | /* 9 */ |
| @@ -218,11 +218,11 @@ | ||
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | z[k++] = '\n'; |
| 221 | 221 | } |
| 222 | 222 | z[k] = 0; |
| 223 | - return z; | |
| 223 | + return z; | |
| 224 | 224 | } |
| 225 | 225 | #endif /* CAPTCHA==2 */ |
| 226 | 226 | |
| 227 | 227 | #if CAPTCHA==3 |
| 228 | 228 | static const char *const azFont3[] = { |
| @@ -231,123 +231,123 @@ | ||
| 231 | 231 | " / _ \\ ", |
| 232 | 232 | "| | | |", |
| 233 | 233 | "| | | |", |
| 234 | 234 | "| |_| |", |
| 235 | 235 | " \\___/ ", |
| 236 | - | |
| 236 | + | |
| 237 | 237 | /* 1 */ |
| 238 | 238 | " __ ", |
| 239 | 239 | "/_ |", |
| 240 | 240 | " | |", |
| 241 | 241 | " | |", |
| 242 | 242 | " | |", |
| 243 | 243 | " |_|", |
| 244 | - | |
| 244 | + | |
| 245 | 245 | /* 2 */ |
| 246 | 246 | " ___ ", |
| 247 | 247 | "|__ \\ ", |
| 248 | 248 | " ) |", |
| 249 | 249 | " / / ", |
| 250 | 250 | " / /_ ", |
| 251 | 251 | "|____|", |
| 252 | - | |
| 252 | + | |
| 253 | 253 | /* 3 */ |
| 254 | 254 | " ____ ", |
| 255 | 255 | "|___ \\ ", |
| 256 | 256 | " __) |", |
| 257 | 257 | " |__ < ", |
| 258 | 258 | " ___) |", |
| 259 | 259 | "|____/ ", |
| 260 | - | |
| 260 | + | |
| 261 | 261 | /* 4 */ |
| 262 | 262 | " _ _ ", |
| 263 | 263 | "| || | ", |
| 264 | 264 | "| || |_ ", |
| 265 | 265 | "|__ _|", |
| 266 | 266 | " | | ", |
| 267 | 267 | " |_| ", |
| 268 | - | |
| 268 | + | |
| 269 | 269 | /* 5 */ |
| 270 | 270 | " _____ ", |
| 271 | 271 | "| ____|", |
| 272 | 272 | "| |__ ", |
| 273 | 273 | "|___ \\ ", |
| 274 | 274 | " ___) |", |
| 275 | 275 | "|____/ ", |
| 276 | - | |
| 276 | + | |
| 277 | 277 | /* 6 */ |
| 278 | 278 | " __ ", |
| 279 | 279 | " / / ", |
| 280 | 280 | " / /_ ", |
| 281 | 281 | "| '_ \\ ", |
| 282 | 282 | "| (_) |", |
| 283 | 283 | " \\___/ ", |
| 284 | - | |
| 284 | + | |
| 285 | 285 | /* 7 */ |
| 286 | 286 | " ______ ", |
| 287 | 287 | "|____ |", |
| 288 | 288 | " / / ", |
| 289 | 289 | " / / ", |
| 290 | 290 | " / / ", |
| 291 | 291 | " /_/ ", |
| 292 | - | |
| 292 | + | |
| 293 | 293 | /* 8 */ |
| 294 | 294 | " ___ ", |
| 295 | 295 | " / _ \\ ", |
| 296 | 296 | "| (_) |", |
| 297 | 297 | " > _ < ", |
| 298 | 298 | "| (_) |", |
| 299 | 299 | " \\___/ ", |
| 300 | - | |
| 300 | + | |
| 301 | 301 | /* 9 */ |
| 302 | 302 | " ___ ", |
| 303 | 303 | " / _ \\ ", |
| 304 | 304 | "| (_) |", |
| 305 | 305 | " \\__, |", |
| 306 | 306 | " / / ", |
| 307 | 307 | " /_/ ", |
| 308 | - | |
| 308 | + | |
| 309 | 309 | /* A */ |
| 310 | 310 | " ", |
| 311 | 311 | " /\\ ", |
| 312 | 312 | " / \\ ", |
| 313 | 313 | " / /\\ \\ ", |
| 314 | 314 | " / ____ \\ ", |
| 315 | 315 | "/_/ \\_\\", |
| 316 | - | |
| 316 | + | |
| 317 | 317 | /* B */ |
| 318 | 318 | " ____ ", |
| 319 | 319 | "| _ \\ ", |
| 320 | 320 | "| |_) |", |
| 321 | 321 | "| _ < ", |
| 322 | 322 | "| |_) |", |
| 323 | 323 | "|____/ ", |
| 324 | - | |
| 324 | + | |
| 325 | 325 | /* C */ |
| 326 | 326 | " _____ ", |
| 327 | 327 | " / ____|", |
| 328 | 328 | "| | ", |
| 329 | 329 | "| | ", |
| 330 | 330 | "| |____ ", |
| 331 | 331 | " \\_____|", |
| 332 | - | |
| 332 | + | |
| 333 | 333 | /* D */ |
| 334 | 334 | " _____ ", |
| 335 | 335 | "| __ \\ ", |
| 336 | 336 | "| | | |", |
| 337 | 337 | "| | | |", |
| 338 | 338 | "| |__| |", |
| 339 | 339 | "|_____/ ", |
| 340 | - | |
| 340 | + | |
| 341 | 341 | /* E */ |
| 342 | 342 | " ______ ", |
| 343 | 343 | "| ____|", |
| 344 | 344 | "| |__ ", |
| 345 | 345 | "| __| ", |
| 346 | 346 | "| |____ ", |
| 347 | 347 | "|______|", |
| 348 | - | |
| 348 | + | |
| 349 | 349 | /* F */ |
| 350 | 350 | " ______ ", |
| 351 | 351 | "| ____|", |
| 352 | 352 | "| |__ ", |
| 353 | 353 | "| __| ", |
| @@ -408,11 +408,11 @@ | ||
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | z[k++] = '\n'; |
| 411 | 411 | } |
| 412 | 412 | z[k] = 0; |
| 413 | - return z; | |
| 413 | + return z; | |
| 414 | 414 | } |
| 415 | 415 | #endif /* CAPTCHA==3 */ |
| 416 | 416 | |
| 417 | 417 | /* |
| 418 | 418 | ** COMMAND: test-captcha |
| @@ -478,16 +478,15 @@ | ||
| 478 | 478 | ** Return true if a CAPTCHA is required for editing wiki or tickets or for |
| 479 | 479 | ** adding attachments. |
| 480 | 480 | ** |
| 481 | 481 | ** A CAPTCHA is required in those cases if the user is not logged in (if they |
| 482 | 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 | |
| 483 | +** "require-captcha" setting is controlled on the Admin/Access page. It | |
| 484 | 484 | ** defaults to true. |
| 485 | 485 | */ |
| 486 | 486 | 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); | |
| 489 | 488 | } |
| 490 | 489 | |
| 491 | 490 | /* |
| 492 | 491 | ** If a captcha is required but the correct captcha code is not supplied |
| 493 | 492 | ** in the query parameters, then return false (0). |
| 494 | 493 |
| --- 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 @@ | ||
| 267 | 267 | zTok = strtok_r(0, ",\"",&zPos)){} |
| 268 | 268 | fossil_free(zBuf); |
| 269 | 269 | if(zTok) return 1; |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | - | |
| 272 | + | |
| 273 | 273 | return 0; |
| 274 | 274 | } |
| 275 | 275 | #endif |
| 276 | 276 | |
| 277 | 277 | /* |
| @@ -498,11 +498,11 @@ | ||
| 498 | 498 | ** must be made of zValue. |
| 499 | 499 | */ |
| 500 | 500 | void cgi_setenv(const char *zName, const char *zValue){ |
| 501 | 501 | cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0); |
| 502 | 502 | } |
| 503 | - | |
| 503 | + | |
| 504 | 504 | |
| 505 | 505 | /* |
| 506 | 506 | ** Add a list of query parameters or cookies to the parameter set. |
| 507 | 507 | ** |
| 508 | 508 | ** Each parameter is of the form NAME=VALUE. Both the NAME and the |
| @@ -616,11 +616,11 @@ | ||
| 616 | 616 | break; |
| 617 | 617 | } |
| 618 | 618 | } |
| 619 | 619 | *pz = &z[i]; |
| 620 | 620 | get_line_from_string(pz, pLen); |
| 621 | - return z; | |
| 621 | + return z; | |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /* |
| 625 | 625 | ** Tokenize a line of text into as many as nArg tokens. Make |
| 626 | 626 | ** azArg[] point to the start of each token. |
| @@ -723,11 +723,11 @@ | ||
| 723 | 723 | cgi_set_parameter_nocopy(mprintf("%s:mimetype",zName), z, 1); |
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | } |
| 727 | 727 | } |
| 728 | - } | |
| 728 | + } | |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | |
| 732 | 732 | #ifdef FOSSIL_ENABLE_JSON |
| 733 | 733 | /* |
| @@ -875,11 +875,11 @@ | ||
| 875 | 875 | char *z; |
| 876 | 876 | const char *zType; |
| 877 | 877 | int len; |
| 878 | 878 | const char *zRequestUri = cgi_parameter("REQUEST_URI",0); |
| 879 | 879 | 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); | |
| 881 | 881 | |
| 882 | 882 | #ifdef FOSSIL_ENABLE_JSON |
| 883 | 883 | json_main_bootstrap(); |
| 884 | 884 | #endif |
| 885 | 885 | g.isHTTP = 1; |
| @@ -904,11 +904,11 @@ | ||
| 904 | 904 | z = (char*)P("HTTP_COOKIE"); |
| 905 | 905 | if( z ){ |
| 906 | 906 | z = mprintf("%s",z); |
| 907 | 907 | add_param_list(z, ';'); |
| 908 | 908 | } |
| 909 | - | |
| 909 | + | |
| 910 | 910 | z = (char*)P("QUERY_STRING"); |
| 911 | 911 | if( z ){ |
| 912 | 912 | z = mprintf("%s",z); |
| 913 | 913 | add_param_list(z, '&'); |
| 914 | 914 | } |
| @@ -920,11 +920,11 @@ | ||
| 920 | 920 | |
| 921 | 921 | len = atoi(PD("CONTENT_LENGTH", "0")); |
| 922 | 922 | g.zContentType = zType = P("CONTENT_TYPE"); |
| 923 | 923 | blob_zero(&g.cgiIn); |
| 924 | 924 | 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 | |
| 926 | 926 | || strncmp(zType,"multipart/form-data",19)==0 ){ |
| 927 | 927 | z = fossil_malloc( len+1 ); |
| 928 | 928 | len = fread(z, 1, len, g.httpIn); |
| 929 | 929 | z[len] = 0; |
| 930 | 930 | cgi_trace(z); |
| @@ -950,11 +950,11 @@ | ||
| 950 | 950 | /* FIXMEs: |
| 951 | 951 | |
| 952 | 952 | - See if fossil really needs g.cgiIn to be set for this purpose |
| 953 | 953 | (i don't think it does). If it does then fill g.cgiIn and |
| 954 | 954 | refactor to parse the JSON from there. |
| 955 | - | |
| 955 | + | |
| 956 | 956 | - After parsing POST JSON, copy the "first layer" of keys/values |
| 957 | 957 | to cgi_setenv(), honoring the upper-case distinction used |
| 958 | 958 | in add_param_list(). However... |
| 959 | 959 | |
| 960 | 960 | - If we do that then we might get a disconnect in precedence of |
| @@ -1226,11 +1226,11 @@ | ||
| 1226 | 1226 | ** loaded into g.zIpAddr. |
| 1227 | 1227 | */ |
| 1228 | 1228 | static const char *cgi_accept_forwarded_for(const char *z){ |
| 1229 | 1229 | int i; |
| 1230 | 1230 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")!=0 ) return 0; |
| 1231 | - | |
| 1231 | + | |
| 1232 | 1232 | i = strlen(z)-1; |
| 1233 | 1233 | while( i>=0 && z[i]!=',' && !fossil_isspace(z[i]) ) i--; |
| 1234 | 1234 | return &z[++i]; |
| 1235 | 1235 | } |
| 1236 | 1236 | |
| @@ -1297,11 +1297,11 @@ | ||
| 1297 | 1297 | cgi_setenv("SCRIPT_NAME", ""); |
| 1298 | 1298 | for(i=0; zToken[i] && zToken[i]!='?'; i++){} |
| 1299 | 1299 | if( zToken[i] ) zToken[i++] = 0; |
| 1300 | 1300 | cgi_setenv("PATH_INFO", zToken); |
| 1301 | 1301 | cgi_setenv("QUERY_STRING", &zToken[i]); |
| 1302 | - | |
| 1302 | + | |
| 1303 | 1303 | /* Get all the optional fields that follow the first line. |
| 1304 | 1304 | */ |
| 1305 | 1305 | while( fgets(zLine,sizeof(zLine),g.httpIn) ){ |
| 1306 | 1306 | char *zFieldName; |
| 1307 | 1307 | char *zVal; |
| @@ -1331,23 +1331,12 @@ | ||
| 1331 | 1331 | cgi_setenv("HTTP_HOST", zVal); |
| 1332 | 1332 | }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){ |
| 1333 | 1333 | cgi_setenv("HTTP_IF_NONE_MATCH", zVal); |
| 1334 | 1334 | }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){ |
| 1335 | 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 | 1336 | }else if( fossil_strcmp(zFieldName,"referer:")==0 ){ |
| 1347 | 1337 | cgi_setenv("HTTP_REFERER", zVal); |
| 1348 | -#endif | |
| 1349 | 1338 | }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){ |
| 1350 | 1339 | cgi_setenv("HTTP_USER_AGENT", zVal); |
| 1351 | 1340 | }else if( fossil_strcmp(zFieldName,"x-forwarded-for:")==0 ){ |
| 1352 | 1341 | const char *zIpAddr = cgi_accept_forwarded_for(zVal); |
| 1353 | 1342 | if( zIpAddr!=0 ){ |
| @@ -1403,11 +1392,11 @@ | ||
| 1403 | 1392 | const char *zType = 0; |
| 1404 | 1393 | int i, content_length = 0; |
| 1405 | 1394 | char zLine[2000]; /* A single line of input. */ |
| 1406 | 1395 | |
| 1407 | 1396 | if( zIpAddr ){ |
| 1408 | - if( nCycles==0 ){ | |
| 1397 | + if( nCycles==0 ){ | |
| 1409 | 1398 | cgi_setenv("REMOTE_ADDR", zIpAddr); |
| 1410 | 1399 | g.zIpAddr = mprintf("%s", zIpAddr); |
| 1411 | 1400 | } |
| 1412 | 1401 | }else{ |
| 1413 | 1402 | fossil_panic("missing SSH IP address"); |
| @@ -1469,11 +1458,11 @@ | ||
| 1469 | 1458 | if( nCycles==0 ){ |
| 1470 | 1459 | cgi_setenv("PATH_INFO", zToken); |
| 1471 | 1460 | }else{ |
| 1472 | 1461 | cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken)); |
| 1473 | 1462 | } |
| 1474 | - | |
| 1463 | + | |
| 1475 | 1464 | /* Get all the optional fields that follow the first line. |
| 1476 | 1465 | */ |
| 1477 | 1466 | while( fgets(zLine,sizeof(zLine),g.httpIn) ){ |
| 1478 | 1467 | char *zFieldName; |
| 1479 | 1468 | char *zVal; |
| @@ -1650,11 +1639,11 @@ | ||
| 1650 | 1639 | cgi_init(); |
| 1651 | 1640 | } |
| 1652 | 1641 | |
| 1653 | 1642 | |
| 1654 | 1643 | #if INTERFACE |
| 1655 | -/* | |
| 1644 | +/* | |
| 1656 | 1645 | ** Bitmap values for the flags parameter to cgi_http_server(). |
| 1657 | 1646 | */ |
| 1658 | 1647 | #define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */ |
| 1659 | 1648 | #define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */ |
| 1660 | 1649 | |
| @@ -1829,15 +1818,13 @@ | ||
| 1829 | 1818 | " port in the range %d..%d", mnPort, mxPort); |
| 1830 | 1819 | } |
| 1831 | 1820 | } |
| 1832 | 1821 | if( iPort>mxPort ) return 1; |
| 1833 | 1822 | 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); | |
| 1839 | 1826 | if( zBrowser ){ |
| 1840 | 1827 | zBrowser = mprintf(zBrowser, iPort); |
| 1841 | 1828 | #if defined(__CYGWIN__) |
| 1842 | 1829 | /* On Cygwin, we can do better than "echo" */ |
| 1843 | 1830 | if( memcmp(zBrowser, "echo ", 5)==0 ){ |
| @@ -1892,11 +1879,11 @@ | ||
| 1892 | 1879 | /* Bury dead children */ |
| 1893 | 1880 | while( waitpid(0, 0, WNOHANG)>0 ){ |
| 1894 | 1881 | nchildren--; |
| 1895 | 1882 | } |
| 1896 | 1883 | } |
| 1897 | - /* NOT REACHED */ | |
| 1884 | + /* NOT REACHED */ | |
| 1898 | 1885 | fossil_exit(1); |
| 1899 | 1886 | #endif // WIN32 |
| 1900 | 1887 | /* NOT REACHED */ |
| 1901 | 1888 | return 0; |
| 1902 | 1889 | } |
| @@ -1980,11 +1967,11 @@ | ||
| 1980 | 1967 | p->tm_mon %= 12; |
| 1981 | 1968 | } |
| 1982 | 1969 | isLeapYr = p->tm_year%4==0 && (p->tm_year%100!=0 || (p->tm_year+300)%400==0); |
| 1983 | 1970 | p->tm_yday = priorDays[p->tm_mon] + p->tm_mday - 1; |
| 1984 | 1971 | 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 + | |
| 1986 | 1973 | (p->tm_year+300)/400 + p->tm_yday; |
| 1987 | 1974 | t = ((nDay*24 + p->tm_hour)*60 + p->tm_min)*60 + p->tm_sec; |
| 1988 | 1975 | return t; |
| 1989 | 1976 | } |
| 1990 | 1977 | |
| 1991 | 1978 |
| --- 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 */ |