Changes In Branch merge-kitdll-kitsh-common Through [3510b6d25d] Excluding Merge-Ins
This is equivalent to a diff from 4fa3b7d3ea to 3510b6d25d
2011-05-23
| ||
21:10 | Corrected typo check-in: 58e2899b04 user: rkeene tags: merge-kitdll-kitsh-common | |
17:55 | Removed kitdll pre code check-in: 3510b6d25d user: rkeene tags: merge-kitdll-kitsh-common | |
17:50 | Updated to load vfs files from initial VFS check-in: 0d35af4b22 user: rkeene tags: merge-kitdll-kitsh-common | |
2011-05-19
| ||
23:00 |
Updated to try harder to look for a working Tcl interpreter for building KitDLL
Updated to return in failure if installvfs fails check-in: 3f354ca762 user: rkeene tags: trunk | |
18:04 | Merged trunk check-in: b7c6c8232c user: rkeene tags: merge-kitdll-kitsh-common | |
2011-05-17
| ||
01:33 | Updated to pull user-specified (or default) kit.ico and kit.rc into Tk, if built and not include KitSH's own resource file when including Tk's since they conflict check-in: 4fa3b7d3ea user: rkeene tags: trunk | |
2011-05-08
| ||
19:16 | Added basic Incr Tcl test check-in: 36e900cf16 user: rkeene tags: trunk | |
Modified README from [6e46265709] to [f55796d36b].
57 58 59 60 61 62 63 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | + + + - + | a. KITCREATOR_PKGS='tk itcl' b. export KITCREATOR_PKGS c. ./kitcreator 9. Create a Tclkit with Metakit4 support, but using Zip for storage: a. $ ./kitcreator --enable-kit-storage=zip 10. Create a Tclkit with Metakit4 support, but using C-VFS for storage a. $ ./kitcreator --enable-kit-storage=cvfs |
Modified build/pre.sh from [6536148eb0] to [2ce5e55131].
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 | - - - - - - - - - - - - - - - | rm -rf autom4te.cache rm -f *~ ./configure || exit 1 make boot.tcl.h make zipvfs.tcl.h |
Modified build/test/test from [5b64a8c9ab] to [38851b5a2a].
259 260 261 262 263 264 265 | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | - + | ( echo "" echo "" echo "" echo " *** Building KitDLL test driver (tclsh)" echo "" |
Modified kitcreator from [fb76c24536] to [2e933cc686].
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + | if [ "$1" = "distclean" ]; then shift mode="distclean" fi # Define the list of all packages, for cleaning purposes |
98 99 100 101 102 103 104 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + | else KITCREATOR_RC="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.rc)" fi export KITCREATOR_ICON KITCREATOR_RC failedpkgs="" buildfailed="0" |
135 136 137 138 139 140 141 | 135 136 137 138 139 140 141 142 143 144 145 | - + | echo "Failed to build:${failedpkgs}" fi if [ "${buildfailed}" != "0" ]; then echo 'WARNING: Build is likely incomplete or failed.' >&2 fi |
Deleted kitdll/build.sh version [9d057a0710].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/Makefile.in version [54a46a52d1].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/aclocal.m4 version [0c2240a08b].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/boot.tcl version [fdb0ceb95b].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/config.guess version [23da712e9c].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/config.sub version [1f0ad14050].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/configure.ac version [ae66df7b9e].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/dir2c.tcl version [28f9b94a91].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/install-sh version [82b003ed45].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/kitInit.c version [d13061de12].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/pwb.c version [d3bbfc6849].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/rechan.c version [95be374a42].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/stringify.tcl version [07e25e6903].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/tclsh.c version [5950dce536].
| - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/vfs_kitdll.tcl version [662da588b0].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/vfs_kitdll_data.c version [e51d57abbf].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/wish.c version [59698e12d8].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted kitdll/buildsrc/kitdll-0.0/zlib.c version [d3ecfd237b].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Modified kitsh/build.sh from [9ac6c7313f] to [670c8d17c7].
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + - - + + + + - - - + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + - - + + - + - + | rm -rf 'build' 'out' 'inst' mkdir 'out' 'inst' || exit 1 ( cp -r 'buildsrc' 'build' cd "${BUILDDIR}" || exit 1 # Fix up archives that Tcl gets wrong for archive in ../../../tcl/inst/lib/dde*/tcldde*.a ../../../tcl/inst/lib/reg*/tclreg*.a; do if [ ! -f "${archive}" ]; then continue fi rm -rf __TEMP__ ( mkdir __TEMP__ || exit 1 cd __TEMP__ ## Patch archive name archive="../${archive}" "${AR:-ar}" x "${archive}" || exit 1 rm -f "${archive}" "${AR:-ar}" cr "${archive}" *.o || exit 1 "${RANLIB:-ranlib}" "${archive}" || true ) done # Determine how we invoke a Tcl interpreter for testsh in "${TCLSH_NATIVE:-false}" tclsh tclsh8.4 tclsh8.5 tclsh8.6 "${TCLKIT:-tclkit}"; do if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then TCLSH_NATIVE="${testsh}" break fi done # Cleanup, just incase the incoming directory was not pre-cleaned ${MAKE:-make} distclean >/dev/null 2>/dev/null rm -rf 'starpack.vfs' # Create VFS directory mkdir "starpack.vfs" mkdir "starpack.vfs/lib" ## Copy in all built directories cp -r "${OTHERPKGSDIR}"/*/out/* 'starpack.vfs/' ## Rename the "vfs" package directory to what "boot.tcl" expects mv 'starpack.vfs/lib'/vfs* 'starpack.vfs/lib/vfs' ## Install "boot.tcl" cp 'boot.tcl' 'starpack.vfs/' # Figure out if zlib compiled (if not, the system zlib will be used and we # will need to have that present) ZLIBDIR="$(cd "${OTHERPKGSDIR}/zlib/inst" 2>/dev/null && pwd)" export ZLIBDIR if [ -z "${ZLIBDIR}" -o ! -f "${ZLIBDIR}/lib/libz.a" ]; then unset ZLIBDIR fi # Copy user specified kit.rc and kit.ico in to build directory, if found cp "${KITCREATOR_ICON}" "${BUILDDIR}/kit.ico" cp "${KITCREATOR_RC}" "${BUILDDIR}/kit.rc" # Include extra objects as required ## Initialize list of extra objects EXTRA_OBJS="" export EXTRA_OBJS ## Tk Resources (needed for Win32 support) -- remove kit-found resources to prevent the symbols from being in conflict TKDIR="$(cd "${OTHERPKGSDIR}/tk/inst" && pwd)" TKRSRC="${TKDIR}/lib/tkbase.res.o" if [ -n "${TKDIR}" -a -f "${TKRSRC}" ]; then EXTRA_OBJS="${EXTRA_OBJS} ${TKRSRC}" echo ' *** Removing "kit.rc" since we have Tk with its own resource file' rm -f "${BUILDDIR}/kit.rc" fi |
Added kitsh/buildsrc/kitsh-0.0/Makefile.common.in version [6640ec3deb].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | CC = @CC@ RC = @RC@ OBJCOPY = @OBJCOPY@ CFLAGS = @CFLAGS@ @SHOBJFLAGS@ CPPFLAGS = @CPPFLAGS@ @DEFS@ WISH_CFLAGS = @WISH_CFLAGS@ LDFLAGS = @LDFLAGS@ SHOBJLDFLAGS = @SHOBJLDFLAGS@ LIBS = @LIBS@ ARCHS = @ARCHS@ STRIPLIBS = @STRIPLIBS@ @EXTRA_OBJS@ EXTRA_OBJS = @EXTRA_OBJS@ LDRUNPATH = @LDRUNPATH@ EXTRA_KIT_DEPS = @EXTRA_KIT_DEPS@ EXTRA_VFS_OBJS = @EXTRA_VFS_OBJS@ TCLSH_NATIVE = tclsh # Build targets ## VFS Build vfs_kitdll_data_tcl.o: vfs_kitdll_data_tcl.c vfs_kitdll_data_tcl.c: dir2c.tcl starpack.vfs vfs_kitdll_data.c "$(TCLSH_NATIVE)" dir2c.tcl tcl starpack.vfs > vfs_kitdll_data_tcl.c ## Tcl scripts that need to be converted to C headers vfs_kitdll.tcl.h: vfs_kitdll.tcl "$(TCLSH_NATIVE)" ./stringify.tcl vfs_kitdll.tcl > vfs_kitdll.tcl.h boot.tcl.h: boot.tcl "$(TCLSH_NATIVE)" ./stringify.tcl boot.tcl > boot.tcl.h zipvfs.tcl.h: zipvfs.tcl "$(TCLSH_NATIVE)" ./stringify.tcl zipvfs.tcl > zipvfs.tcl.h ## Objects kitInit.o: kitInit.c boot.tcl.h $(EXTRA_KIT_DEPS) rechan.o: rechan.c pwb.o: pwb.c zlib.o: zlib.c ### Windows resources kit.res.o: kit.rc kit.ico $(RC) -o kit.res.o $(CPPFLAGS) kit.rc # Cleanup routines clean: rm -f kit kit.res.o rm -f libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ rm -f $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) rm -f vfs_kitdll_data_tcl.c rm -f vfs_kitdll.tcl.h rm -f tclsh.o tclsh tclsh.exe rm -f wish.o wish wish.exe distclean: clean rm -f Makefile Makefile.in Makefile.common rm -f config.status config.log rm -f *~ rm -rf autom4te.cache rm -rf starpack.vfs mrproper: distclean rm -f configure config.h boot.tcl.h zipvfs.tcl.h .PHONY: all clean distclean mrproper |
Deleted kitsh/buildsrc/kitsh-0.0/Makefile.in version [6f33927faa].
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Added kitsh/buildsrc/kitsh-0.0/Makefile.kitdll.in version [291ff89745].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | + + + + + + + + + + + + + + + + + + + + | OBJS = kitInit.o rechan.o pwb.o zlib.o # Default target all: libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ -include Makefile.common ## DLL Build libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@: $(OBJS) $(EXTRA_KIT_DEPS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) -for striplib in $(STRIPLIBS); do $(OBJCOPY) --weaken "$${striplib}"; done $(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) @WHOLEARCHIVE@ $(ARCHS) @NOWHOLEARCHIVE@ $(LIBS) # Test driver tclsh.o: tclsh.c tclsh: tclsh.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH) wish.o: wish.c wish: wish.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(CC) $(CPPFLAGS) $(CFLAGS) $(WISH_CFLAGS) -o wish wish.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH) |
Added kitsh/buildsrc/kitsh-0.0/Makefile.tclkit.in version [b723314153].
1 2 3 4 5 6 7 8 | + + + + + + + + | OBJS = kitInit.o main.o pwb.o rechan.o zlib.o winMain.o all: kit -include Makefile.common kit: $(OBJS) $(EXTRA_OBJS) $(EXTRA_KIT_DEPS) $(EXTRA_VFS_OBJS) $(ARCHS) $(CC) $(CPPFLAGS) $(CFLAGS) -o kit $(OBJS) $(EXTRA_OBJS $(EXTRA_VFS_OBJS)) $(ARCHS) $(LDFLAGS) $(LIBS) |
Modified kitsh/buildsrc/kitsh-0.0/aclocal.m4 from [9a1977c3cc] to [1f1678240f].
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | + + + | if test -f "${tclconfigsh}"; then . "${tclconfigsh}" CFLAGS="${CFLAGS} ${TCL_INCLUDE_SPEC} -I${TCL_SRC_DIR}/generic -I${tclconfigshdir}" CPPFLAGS="${CPPFLAGS} ${TCL_INCLUDE_SPEC} -I${TCL_SRC_DIR}/generic -I${tclconfigshdir}" LIBS="${LIBS} ${TCL_LIBS}" KITDLL_LIB_VERSION=`echo "${TCL_VERSION}${TCL_PATCH_LEVEL}" | sed 's@\.@@g'` fi AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LIBS) AC_SUBST(KITDLL_LIB_VERSION) AC_MSG_RESULT([$tclconfigsh]) ]) AC_DEFUN(DC_DO_TK, [ AC_MSG_CHECKING([path to tk]) AC_ARG_WITH(tk, AC_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), [], [ |
150 151 152 153 154 155 156 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | + + + - + - - - + + + + - + + + + + + + - + + + + + - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | DC_DO_STATIC_LINK_LIB([C++ Library (UNIX)], [-lstdc++]) ]) ]) AC_DEFUN(DC_FIND_TCLKIT_LIBS, [ DC_SETUP_TCL_PLAT_DEFS dnl We will need this for the Tcl project, which we will always have DC_CHECK_FOR_WHOLE_ARCHIVE |
256 257 258 259 260 261 262 | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | AC_MSG_RESULT([found]) AC_DEFINE(HAVE_ACCEPTABLE_DLADDR, [1], [Define to 1 if you have an acceptable dladdr implementation with dli_fname]) ], [ AC_MSG_RESULT([not found]) ] ) ]) dnl Usage: dnl DC_TEST_SHOBJFLAGS(shobjflags, shobjldflags, action-if-not-found) dnl AC_DEFUN(DC_TEST_SHOBJFLAGS, [ AC_SUBST(SHOBJFLAGS) AC_SUBST(SHOBJLDFLAGS) OLD_LDFLAGS="$LDFLAGS" SHOBJFLAGS="" LDFLAGS="$OLD_LDFLAGS $1 $2" AC_TRY_LINK([#include <stdio.h> int unrestst(void);], [ printf("okay\n"); unrestst(); return(0); ], [ SHOBJFLAGS="$1"; SHOBJLDFLAGS="$2" ], [ LDFLAGS="$OLD_LDFLAGS" $3 ]) LDFLAGS="$OLD_LDFLAGS" ]) AC_DEFUN(DC_GET_SHOBJFLAGS, [ AC_SUBST(SHOBJFLAGS) AC_SUBST(SHOBJLDFLAGS) AC_MSG_CHECKING(how to create shared objects) if test -z "$SHOBJFLAGS" -a -z "$SHOBJLDFLAGS"; then DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -rdynamic], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -rdynamic -mimpure-text], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -mimpure-text], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -rdynamic -Wl,-G,-z,textoff], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -Wl,-G,-z,textoff], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-shared -dynamiclib -flat_namespace -undefined suppress -bind_at_load], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-dynamiclib -flat_namespace -undefined suppress -bind_at_load], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-Wl,-dynamiclib -Wl,-flat_namespace -Wl,-undefined,suppress -Wl,-bind_at_load], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-dynamiclib -flat_namespace -undefined suppress], [ DC_TEST_SHOBJFLAGS([-fPIC -DPIC], [-dynamiclib], [ AC_MSG_RESULT(cant) AC_MSG_ERROR([We are unable to make shared objects.]) ]) ]) ]) ]) ]) ]) ]) ]) ]) ]) ]) fi AC_MSG_RESULT($SHOBJLDFLAGS $SHOBJFLAGS) ]) AC_DEFUN(DC_CHK_OS_INFO, [ AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_SUBST(SHOBJEXT) AC_SUBST(AREXT) AC_SUBST(SHOBJFLAGS) AC_SUBST(SHOBJLDFLAGS) AC_MSG_CHECKING(host operating system) AC_MSG_RESULT($host_os) SHOBJEXT="so" AREXT="a" case $host_os in darwin*) SHOBJEXT="dylib" ;; hpux*) SHOBJEXT="sl" ;; mingw*) SHOBJEXT="dll" SHOBJFLAGS="-mno-cygwin -mms-bitfields -DPIC" SHOBJLDFLAGS='-shared -Wl,--dll -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a -Wl,--export-all-symbols -Wl,--add-stdcall-alias' ;; esac ]) AC_DEFUN(DC_TEST_WHOLE_ARCHIVE_SHARED_LIB, [ SAVE_LIBS="${LIBS}" LIBS="${WHOLEARCHIVE} $1 ${NOWHOLEARCHIVE} ${SAVE_LIBS}" AC_LINK_IFELSE( AC_LANG_PROGRAM([[ ]], [[ ]] ), [ LIBS="${SAVE_LIBS}" $2 ], [ LIBS="${SAVE_LIBS}" $3 ] ) ]) AC_DEFUN(DC_CHECK_FOR_WHOLE_ARCHIVE, [ AC_MSG_CHECKING([for how to link whole archive]) SAVE_CFLAGS="${CFLAGS}" wholearchive="" for check in "-Wl,--whole-archive -Wl,--no-whole-archive" "-Wl,-z,allextract -Wl,-z,defaultextract"; do CFLAGS="${SAVE_CFLAGS} ${check}" AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [ wholearchive="${check}" break ] ) done CFLAGS="${SAVE_CFLAGS}" if test -z "${wholearchive}"; then AC_MSG_RESULT([not found]) else AC_MSG_RESULT([${wholearchive}]) WHOLEARCHIVE=`echo "${wholearchive}" | cut -f 1 -d ' '` NOWHOLEARCHIVE=`echo "${wholearchive}" | cut -f 2 -d ' '` fi AC_SUBST(WHOLEARCHIVE) AC_SUBST(NOWHOLEARCHIVE) ]) AC_DEFUN(DC_SETLDRUNPATH, [ OLD_LDFLAGS="${LDFLAGS}" for testldflags in "-Wl,-rpath -Wl,$1" "-Wl,-R -Wl,$1"; do LDFLAGS="${OLD_LDFLAGS} ${testldflags}" AC_TRY_LINK([#include <stdio.h>], [ return(0); ], [ LDRUNPATH="$LDRUNPATH $testldflags" break ]) done LDFLAGS="${OLD_LDFLAGS}" AC_SUBST(LDRUNPATH) ]) |
Modified kitsh/buildsrc/kitsh-0.0/boot.tcl from [6dee5fa1e9] to [29ebce96a4].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + - + - - + + - - - - + + + + + - - | proc tclInit {} { rename tclInit {} global auto_path tcl_library tcl_libPath global tcl_version tcl_rcFileName |
70 71 72 73 74 75 76 77 78 79 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | + + + + + + + + + + + + + + + + + + - + - + + + - - - + - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + | } } seek $::tclKitStorage_fd 0 set vfsHandler [list ::vfs::zip::handler $::tclKitStorage_fd] unset ::tclKitStorage_fd } "cvfs" { set vfsHandler [list ::vfs::kitdll::vfshandler tcl] # Load these, the original Tclkit does so it should be safe. foreach vfsfile [list vfsUtils vfslib] { unset -nocomplain s catch { set s [::vfs::kitdll::data::getData tcl "lib/vfs/${vfsfile}.tcl"] } if {![info exists s]} { continue } uplevel #0 $s } } } # mount the executable, i.e. make all runtime files available |
Modified kitsh/buildsrc/kitsh-0.0/configure.ac from [da08c3d389] to [501466d9c8].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + + + - - - - + + + + - - - - - + + + + + + - - + + - + - - + + - + - - + + - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | dnl What are we running AC_INIT(kitsh, 0.0) dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_AIX AC_GNU_SOURCE dnl Find out if we should build a DLL or an Executable TARGET="tclkit" EXTRA_KIT_DEPS="" AC_MSG_CHECKING([what target to build]) AC_ARG_ENABLE(kitdll, AC_HELP_STRING([--enable-kitdll], [Enable building KitDLL instead of Tclkit (default: no)]), [ AS_CASE([$enableval], [yes|kitdll], [ TARGET="kitdll" ], no, [ true ], [ AC_MSG_RESULT([unknown]) AC_MSG_ERROR([Invalid option: $enableval]) ] ) ]) AC_MSG_RESULT([$TARGET]) dnl Find the appropriate libraries to link to AC_SEARCH_LIBS(acos, m,, [ AC_MSG_WARN([Couldn't find acos (normally in libm)!]) ]) AC_SEARCH_LIBS(dlsym, dl,, [ AC_MSG_WARN([Couldn't find dlsym (normally in libdl)!]) ]) AS_IF([test "$TARGET" = "tclkit"], [ dnl We have Tclkit |
Added kitsh/buildsrc/kitsh-0.0/dir2c.tcl version [28f9b94a91].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #! /usr/bin/env tclsh if {[llength $argv] != 2} { puts stderr "Usage: kitdll <hashkey> <startdir>" exit 1 } set hashkey [lindex $argv 0] set startdir [lindex $argv 1] proc shorten_file {dir file} { set dirNameLen [string length $dir] if {[string range $file 0 [expr {$dirNameLen - 1}]] == $dir} { set file [string range $file $dirNameLen end] } if {[string index $file 0] == "/"} { set file [string range $file 1 end] } return $file } proc recursive_glob {dir} { set children [glob -nocomplain -directory $dir *] set ret [list $dir] foreach child $children { unset -nocomplain childinfo catch { file stat $child childinfo } if {![info exists childinfo(type)]} { continue } if {$childinfo(type) == "directory"} { foreach add [recursive_glob $child] { lappend ret $add } continue } if {$childinfo(type) != "file"} { continue } lappend ret $child } return $ret } # Convert a string into a C-style binary string ## XXX: This function needs to be optimized proc stringify {data} { set ret "\"" for {set idx 0} {$idx < [string length $data]} {incr idx} { binary scan [string index $data $idx] H* char append ret "\\x${char}" if {($idx % 20) == 0 && $idx != 0} { append ret "\"\n\"" } } set ret [string trim $ret "\n\""] set ret "\"$ret\"" return $ret } # This function must be kept in-sync with the generated C function below proc kitdll_hash {path} { set h 0 set g 0 for {set idx 0} {$idx < [string length $path]} {incr idx} { binary scan [string index $path $idx] H* char set char "0x$char" set h [expr {($h << 4) + $char}] set g [expr {$h & 0xf0000000}] if {$g != 0} { set h [expr {($h & 0xffffffff) ^ ($g >> 24)}] } set h [expr {$h & ((~$g) & 0xffffffff)}] } return $h } # Generate list of files to include in output set files [recursive_glob $startdir] # Insert dummy entry cooresponding to C dummy entry set files [linsert $files 0 "__DUMMY__"] # Produce C89 compatible header set cpp_tag "KITDLL_[string toupper $hashkey]" set code_tag "kitdll_[string tolower $hashkey]" set hashkey [string tolower $hashkey] puts "#ifndef $cpp_tag" puts "# define $cpp_tag 1" puts { # ifdef HAVE_STDC # ifndef HAVE_UNISTD_H # define HAVE_UNISTD_H 1 # endif # ifndef HAVE_STRING_H # define HAVE_STRING_H 1 # endif # endif # ifdef HAVE_UNISTD_H # include <unistd.h> # endif # ifdef HAVE_STRING_H # include <string.h> # endif # ifndef LOADED_KITDLL_COMMON # define LOADED_KITDLL_COMMON 1 typedef enum { KITDLL_FILETYPE_FILE, KITDLL_FILETYPE_DIR } kitdll_filetype_t; struct kitdll_data { const char * name; unsigned long index; unsigned long size; kitdll_filetype_t type; const unsigned char * data; }; static unsigned long kitdll_hash(const unsigned char *path) { unsigned long i, h = 0, g = 0; for (i = 0; path[i]; i++) { h = (h << 4) + path[i]; g = h & 0xf0000000; if (g) { h ^= (g >> 24); } h &= ((~g) & 0xffffffffLU); } return(h); } # endif /* !LOADED_KITDLL_COMMON */} puts "" puts "static struct kitdll_data ${code_tag}_data\[\] = {" puts "\t{" puts "\t\t.name = NULL," puts "\t\t.index = 0," puts "\t\t.type = 0," puts "\t\t.size = 0," puts "\t\t.data = NULL," puts "\t}," for {set idx 1} {$idx < [llength $files]} {incr idx} { set file [lindex $files $idx] set shortfile [shorten_file $startdir $file] unset -nocomplain finfo type file stat $file finfo switch -- $finfo(type) { "file" { set type "KITDLL_FILETYPE_FILE" set size $finfo(size) set fd [open $file] fconfigure $fd -translation binary set data [read $fd] close $fd set data "(unsigned char *) [stringify $data]" } "directory" { set type "KITDLL_FILETYPE_DIR" set data "NULL" set size 0 } } puts "\t{" puts "\t\t.name = \"$shortfile\"," puts "\t\t.index = $idx," puts "\t\t.type = $type," puts "\t\t.size = $size," puts "\t\t.data = $data," puts "\t}," } puts "};" puts "" puts "static unsigned long ${code_tag}_lookup_index(const char *path) {" puts "\tswitch (kitdll_hash((unsigned char *) path)) {" for {set idx 1} {$idx < [llength $files]} {incr idx} { set file [lindex $files $idx] set shortfile [shorten_file $startdir $file] set hash [kitdll_hash $shortfile] lappend indexes_per_hash($hash) [list $shortfile $idx] } foreach {hash idx_list} [array get indexes_per_hash] { puts "\t\tcase $hash:" if {[llength $idx_list] == 1} { set idx [lindex $idx_list 0 1] puts "\t\t\treturn($idx);" } else { foreach idx_ent $idx_list { set shortfile [lindex $idx_ent 0] set idx [lindex $idx_ent 1] puts "\t\t\tif (strcmp(path, \"$shortfile\") == 0) return($idx);" } puts "\t\t\tbreak;" } } puts "\t}" puts "\treturn(0);" puts "}" puts "" puts "static struct kitdll_data *${code_tag}_getData(const char *path, unsigned long index) {" puts "\tif (path != NULL) {" puts "\t\tindex = ${code_tag}_lookup_index(path);" puts "\t}" puts "" puts "\tif (index == 0) {" puts "\t\treturn(NULL);" puts "\t}" puts "" puts "\tif (path != NULL) {" puts "\t\tif (strcmp(path, ${code_tag}_data\[index\].name) != 0) {" puts "\t\t\treturn(NULL);" puts "\t\t}" puts "\t}" puts "" puts "\treturn(&${code_tag}_data\[index\]);" puts "}" puts "" puts "static unsigned long ${code_tag}_getChildren(const char *path, unsigned long *outbuf, unsigned long outbuf_count) {" puts "\tunsigned long index;" puts "\tunsigned long num_children = 0;" puts "" puts "\tindex = ${code_tag}_lookup_index(path);" puts "\tif (index == 0) {" puts "\t\treturn(0);" puts "\t}" puts "" puts "\tif (${code_tag}_data\[index\].type != KITDLL_FILETYPE_DIR) {" puts "\t\treturn(0);" puts "\t}" puts "" puts "\tif (strcmp(path, ${code_tag}_data\[index\].name) != 0) {" puts "\t\treturn(0);" puts "\t}" puts "" puts "\tswitch (index) {" unset -nocomplain children array set children [list] for {set idx 1} {$idx < [llength $files]} {incr idx} { set file [lindex $files $idx] set shortfile [shorten_file $startdir $file] unset -nocomplain finfo type file stat $file finfo if {$finfo(type) != "directory"} { continue; } # Determine which children are under this directory ## Convert the current pathname to a regular expression that matches exactly set file_regexp [string map [list "\\" "\\\\" "." "\\." "\{" "\\\{" "\}" "\\\}" "*" "\\*"] $file] ## Search for pathnames which start with exactly our name, followed by a slash ## followed by no more slashes (direct descendants) set child_idx_list [lsearch -regexp -all $files "^${file_regexp}/\[^/\]*$"] set children($idx) $child_idx_list puts "\t\tcase $idx:" puts "\t\t\tnum_children = [llength $child_idx_list];" puts "\t\t\tbreak;" } puts "\t}" puts "" puts "\tif (outbuf == NULL) {" puts "\t\treturn(num_children);" puts "\t}" puts "" puts "\tif (num_children > outbuf_count) {" puts "\t\tnum_children = outbuf_count;" puts "\t}" puts "" puts "\tif (num_children == 0) {" puts "\t\treturn(num_children);" puts "\t}" puts "" puts "\tif (outbuf_count > num_children) {" puts "\t\toutbuf_count = num_children;" puts "\t}" puts "" puts "\tswitch (index) {" foreach {idx child_idx_list} [array get children] { if {[llength $child_idx_list] == 0} { continue } puts "\t\tcase $idx:" puts "\t\t\tswitch(outbuf_count) {" for {set child_idx_idx [expr {[llength $child_idx_list] - 1}]} {$child_idx_idx >= 0} {incr child_idx_idx -1} { set child_idx [lindex $child_idx_list $child_idx_idx] puts "\t\t\t\tcase [expr {$child_idx_idx + 1}]:" puts "\t\t\t\t\toutbuf\[$child_idx_idx\] = $child_idx;" } puts "\t\t\t}" puts "\t\t\tbreak;" } puts "\t}" puts "" puts "\treturn(num_children);" puts "}" puts "" puts "# ifdef KITDLL_MAKE_LOADABLE" set fd [open "vfs_kitdll_data.c"] puts [read $fd] close $fd puts "static cmd_getData_t *getCmdData(const char *hashkey) {" puts "\treturn(${code_tag}_getData);" puts "}" puts "" puts "static cmd_getChildren_t *getCmdChildren(const char *hashkey) {" puts "\treturn(${code_tag}_getChildren);" puts "}" puts "" puts "int Vfs_kitdll_data_${hashkey}_Init(Tcl_Interp *interp) {" puts "\tTcl_Command tclCreatComm_ret;" puts "\tint tclPkgProv_ret;" puts "" puts "\ttclCreatComm_ret = Tcl_CreateObjCommand(interp, \"::vfs::kitdll::data::${hashkey}::getMetadata\", getMetadata, NULL, NULL);" puts "\tif (!tclCreatComm_ret) {" puts "\t\treturn(TCL_ERROR);" puts "\t}" puts "" puts "\ttclCreatComm_ret = Tcl_CreateObjCommand(interp, \"::vfs::kitdll::data::${hashkey}::getData\", getData, NULL, NULL);" puts "\tif (!tclCreatComm_ret) {" puts "\t\treturn(TCL_ERROR);" puts "\t}" puts "" puts "\ttclCreatComm_ret = Tcl_CreateObjCommand(interp, \"::vfs::kitdll::data::${hashkey}::getChildren\", getChildren, NULL, NULL);" puts "\tif (!tclCreatComm_ret) {" puts "\t\treturn(TCL_ERROR);" puts "\t}" puts "" puts "\ttclPkgProv_ret = Tcl_PkgProvide(interp, \"vfs::kitdll::data::${hashkey}\", \"1.0\");" puts "" puts "\treturn(tclPkgProv_ret);" puts "\t}" puts "# endif /* KITDLL_MAKE_LOADABLE */" puts "#endif /* !$cpp_tag */" |
Modified kitsh/buildsrc/kitsh-0.0/installvfs.tcl from [01a4e2e7f2] to [b17724e7c3].
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - - + - - - - + + - - - | set kitfile [lindex $argv 0] set vfsdir [lindex $argv 1] if {[lindex $argv 2] != ""} { set opt_compression [lindex $argv 2] } # Determine what storage mechanism is being used |
113 114 115 116 117 118 119 120 | 107 108 109 110 111 112 113 114 115 116 117 118 | + + - + + | if {[catch { close $zipfd } err]} { puts stderr "Error while updating executable: $err" exit 1 } } "cvfs" { # No-op |
Modified kitsh/buildsrc/kitsh-0.0/kitInit.c from [2ea4599da9] to [108a80f35a].
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - - + | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id$ */ #ifdef KIT_INCLUDES_TK # include <tk.h> |
71 72 73 74 75 76 77 78 79 80 81 82 83 84 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + | Tcl_AppInitProc Vfs_Init, Rechan_Init; #ifdef KIT_INCLUDES_PWB Tcl_AppInitProc Pwb_Init; #endif #ifdef KIT_INCLUDES_ZLIB Tcl_AppInitProc Zlib_Init; #endif #ifdef KIT_STORAGE_CVFS Tcl_AppInitProc Vfs_kitdll_data_tcl_Init; #endif #ifdef TCL_THREADS Tcl_AppInitProc Thread_Init; #endif #ifdef _WIN32 Tcl_AppInitProc Dde_Init, Registry_Init; #endif |
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + + - + + - + + + - + + + + + + + + + + + + + + + + | return; } } } #endif /* HAVE_READLINK */ #ifdef HAVE_ACCEPTABLE_DLADDR # ifndef TCLKIT_DLL if (Tcl_GetNameOfExecutable() == NULL) { dladdr_ret = dladdr(&SetExecName, &syminfo); if (dladdr_ret != 0) { SetExecName(interp, syminfo.dli_fname); return; } } # endif /* !TCLKIT_DLL */ # ifdef KITSH_NEED_WINMAIN if (Tcl_GetNameOfExecutable() == NULL) { # ifdef _WIN32_WCE dladdr_ret = dladdr(&WinMain, &syminfo); # else dladdr_ret = dladdr(&wWinMain, &syminfo); # endif /* _WIN32_WCE */ if (dladdr_ret != 0) { SetExecName(interp, syminfo.dli_fname); return; } } # endif /* KITSH_NEED_WINMAIN */ if (Tcl_GetNameOfExecutable() == NULL) { dladdr_ret = dladdr(&main, &syminfo); if (dladdr_ret != 0) { SetExecName(interp, syminfo.dli_fname); return; } } #endif /* HAVE_ACCEPTABLE_DLADDR */ if (Tcl_GetNameOfExecutable() == NULL) { lobjv[0] = Tcl_GetVar2Ex(interp, "argv0", NULL, TCL_GLOBAL_ONLY); execNameObj = Tcl_FSJoinToPath(Tcl_FSGetCwd(interp), 1, lobjv); SetExecName(interp, Tcl_GetStringFromObj(execNameObj, &len)); return; } return; } |
376 377 378 379 380 381 382 | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # endif /* !_WIN32_WCE */ /* we won't reach this, but we need the return */ # endif /* _WIN32 */ #endif /* KIT_INCLUDES_TK */ return TCL_ERROR; } #endif /* !TCLKIT_DLL */ #ifdef TCLKIT_DLL # ifdef HAVE_ACCEPTABLE_DLADDR /* Symbol to resolve against dladdr() */ static void _tclkit_dummy_func(void) { return; } # endif /* HAVE_ACCEPTABLE_DLADDR */ /* * This function will return a pathname we can open() to treat as a VFS, * hopefully */ static char *find_tclkit_dll_path(void) { #ifdef HAVE_ACCEPTABLE_DLADDR Dl_info syminfo; int dladdr_ret; #endif /* HAVE_ACCEPTABLE_DLADDR */ #ifdef _WIN32 TCHAR modulename[8192]; DWORD gmfn_ret; #endif /* _WIN32 */ #ifdef HAVE_ACCEPTABLE_DLADDR dladdr_ret = dladdr(&_tclkit_dummy_func, &syminfo); if (dladdr_ret != 0) { if (syminfo.dli_fname && syminfo.dli_fname[0] != '\0') { return(strdup(syminfo.dli_fname)); } } #endif /* HAVE_ACCEPTABLE_DLADDR */ #ifdef _WIN32 gmfn_ret = GetModuleFileName(TclWinGetTclInstance(), modulename, sizeof(modulename) / sizeof(modulename[0]) - 1); if (gmfn_ret != 0) { return(strdup(modulename)); } #endif /* _WIN32 */ return(NULL); } /* * This function exists to allow C code to initialize a particular * interpreter. */ static int tclkit_init_initinterp(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { char *kitdll_path; kitdll_path = find_tclkit_dll_path(); if (kitdll_path != NULL) { Tcl_SetVar(interp, "tclKitFilename", kitdll_path, TCL_GLOBAL_ONLY); free(kitdll_path); } _Tclkit_Interp_Init(interp); return(TCL_OK); } /* * Create a package for initializing a particular interpreter. This is * our hook to have Tcl invoke C commands when creating an interpreter. * The preInitCmd will load the package in the new interpreter and invoke * this function. */ int Tclkit_init_Init(Tcl_Interp *interp) { Tcl_Command tclCreatComm_ret; int tclPkgProv_ret; tclCreatComm_ret = Tcl_CreateObjCommand(interp, "::tclkit::init::initInterp", tclkit_init_initinterp, NULL, NULL); if (!tclCreatComm_ret) { return(TCL_ERROR); } tclPkgProv_ret = Tcl_PkgProvide(interp, "tclkit::init", "1.0"); return(tclPkgProv_ret); } /* * Initialize the Tcl system when we are loaded, that way Tcl functions * are ready to be used when invoked. */ void __attribute__((constructor)) _Tclkit_Init(void) { Tcl_StaticPackage(0, "tclkit::init", Tclkit_init_Init, NULL); _Tclkit_Generic_Init(); return; } #endif |
Added kitsh/buildsrc/kitsh-0.0/tclsh.c version [5950dce536].
1 2 3 4 5 6 7 8 9 10 11 | + + + + + + + + + + + | #include <tcl.h> int Tcl_AppInit(Tcl_Interp *interp) { return(Tcl_Init(interp)); } int main(int argc, char **argv) { Tcl_Main(argc, argv, Tcl_AppInit); return(1); } |
Added kitsh/buildsrc/kitsh-0.0/vfs_kitdll.tcl version [662da588b0].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #! /usr/bin/env tcl package require vfs namespace eval ::vfs::kitdll {} # Convience functions proc ::vfs::kitdll::Mount {hashkey local} { vfs::filesystem mount $local [list ::vfs::kitdll::vfshandler $hashkey] catch { vfs::RegisterMount $local [list ::vfs::kitdll::Unmount] } } proc ::vfs::kitdll::Unmount {local} { vfs::filesystem unmount $local } # Implementation ## I/O Handlers (pass to appropriate hashkey) namespace eval ::vfs::kitdll::data {} proc ::vfs::kitdll::data::getChildren args { set hashkey [lindex $args 0] set cmd "::vfs::kitdll::data::${hashkey}::getChildren" set cmd [linsert $args 0 $cmd] eval $cmd } proc ::vfs::kitdll::data::getMetadata args { set hashkey [lindex $args 0] set cmd "::vfs::kitdll::data::${hashkey}::getMetadata" set cmd [linsert $args 0 $cmd] eval $cmd } proc ::vfs::kitdll::data::getData args { set hashkey [lindex $args 0] set cmd "::vfs::kitdll::data::${hashkey}::getData" set cmd [linsert $args 0 $cmd] eval $cmd } ## VFS and Chan I/O ### Dispatchers proc ::vfs::kitdll::vfshandler {hashkey subcmd args} { set cmd $args set cmd [linsert $cmd 0 "::vfs::kitdll::vfsop_${subcmd}" $hashkey] return [eval $cmd] } proc ::vfs::kitdll::chanhandler {hashkey subcmd args} { set cmd $args set cmd [linsert $cmd 0 "::vfs::kitdll::chanop_${subcmd}" $hashkey] return [eval $cmd] } ### Actual handlers #### Channel operation handlers proc ::vfs::kitdll::chanop_initialize {hashkey chanId mode} { return [list initialize finalize watch read seek] } proc ::vfs::kitdll::chanop_finalize {hashkey chanId} { unset -nocomplain ::vfs::kitdll::chandata([list $hashkey $chanId]) return } proc ::vfs::kitdll::chanop_watch {hashkey chanId eventSpec} { array set chaninfo $::vfs::kitdll::chandata([list $hashkey $chanId]) set chaninfo(watching) $eventSpec set ::vfs::kitdll::chandata([list $hashkey $chanId]) [array get chaninfo] if {[lsearch -exact $chaninfo(watching) "read"] != -1} { after 0 [list catch "chan postevent $chanId [list {read}]"] } return } proc ::vfs::kitdll::chanop_read {hashkey chanId bytes} { array set chaninfo $::vfs::kitdll::chandata([list $hashkey $chanId]) set pos $chaninfo(pos) set len $chaninfo(len) if {[lsearch -exact $chaninfo(watching) "read"] != -1} { after 0 [list catch "chan postevent $chanId [list {read}]"] } if {$pos == $len} { return "" } set end [expr {$pos + $bytes}] if {$end > $len} { set end $len } set data [::vfs::kitdll::data::getData $hashkey $chaninfo(file) $pos $end] set dataLen [string length $data] incr pos $dataLen set chaninfo(pos) $pos set ::vfs::kitdll::chandata([list $hashkey $chanId]) [array get chaninfo] return $data } proc ::vfs::kitdll::chanop_seek {hashkey chanId offset origin} { array set chaninfo $::vfs::kitdll::chandata([list $hashkey $chanId]) set pos $chaninfo(pos) set len $chaninfo(len) switch -- $origin { "start" - "0" { set pos $offset } "current" - "1" { set pos [expr {$pos + $offset}] } "end" - "2" { set pos [expr {$len + $offset}] } } if {$pos < 0} { set pos 0 } if {$pos > $len} { set pos $len } set chaninfo(pos) $pos set ::vfs::kitdll::chandata([list $hashkey $chanId]) [array get chaninfo] return $pos } #### VFS operation handlers proc ::vfs::kitdll::vfsop_stat {hashkey root relative actualpath} { catch { set ret [::vfs::kitdll::data::getMetadata $hashkey $relative] } if {![info exists ret]} { vfs::filesystem posixerror $::vfs::posix(ENOENT) } return $ret } proc ::vfs::kitdll::vfsop_access {hashkey root relative actualpath mode} { set ret [::vfs::kitdll::data::getMetadata $hashkey $relative] if {$mode & 0x2} { vfs::filesystem posixerror $::vfs::posix(EROFS) } return 1 } proc ::vfs::kitdll::vfsop_matchindirectory {hashkey root relative actualpath pattern types} { set ret [list] catch { array set metadata [::vfs::kitdll::data::getMetadata $hashkey $relative] } if {![info exists metadata]} { return [list] } if {$pattern == ""} { set children [list $relative] } else { set children [::vfs::kitdll::data::getChildren $hashkey $relative] } foreach child $children { if {$pattern != ""} { if {![string match $pattern $child]} { continue } } unset -nocomplain metadata catch { array set metadata [::vfs::kitdll::data::getMetadata $hashkey $child] } if {[string index $root end] == "/"} { set child "${root}${child}" } else { set child "${root}/${child}" } if {[string index $child end] == "/"} { set child [string range $child 0 end-1] } if {![info exists metadata(type)]} { continue } set filetype 0 switch -- $metadata(type) { "directory" { set filetype [expr {$filetype | 0x04}] } "file" { set filetype [expr {$filetype | 0x10}] } "link" { set filetype [expr {$filetype | 0x20}] } default { continue } } if {($filetype & $types) != $types} { continue } lappend ret $child } return $ret } proc ::vfs::kitdll::vfsop_fileattributes {hashkey root relative actualpath {index -1} {value ""}} { set attrs [list -owner -group -permissions] if {$value != ""} { vfs::filesystem posixerror $::vfs::posix(EROFS) } if {$index == -1} { return $attrs } array set metadata [::vfs::kitdll::data::getMetadata $hashkey $relative] set attr [lindex $attrs $index] switch -- $attr { "-owner" { return $metadata(uid) } "-group" { return $metadata(gid) } "-permissions" { if {$metadata(type) == "directory"} { set metadata(mode) [expr {$metadata(mode) | 040000}] } return [format {0%o} $metadata(mode)] } } return -code error "Invalid index" } proc ::vfs::kitdll::vfsop_open {hashkey root relative actualpath mode permissions} { if {$mode != "" && $mode != "r"} { vfs::filesystem posixerror $::vfs::posix(EROFS) } catch { array set metadata [::vfs::kitdll::data::getMetadata $hashkey $relative] } if {![info exists metadata]} { vfs::filesystem posixerror $::vfs::posix(ENOENT) } if {$metadata(type) == "directory"} { vfs::filesystem posixerror $::vfs::posix(EISDIR) } if {[info command chan] != ""} { set chan [chan create [list "read"] [list ::vfs::kitdll::chanhandler $hashkey]] set ::vfs::kitdll::chandata([list $hashkey $chan]) [list file $relative pos 0 len $metadata(size) watching ""] return [list $chan] } if {[info command rechan] == ""} { catch { package require rechan } } if {[info command rechan] != ""} { set chan [rechan [list ::vfs::kitdll::chanhandler $hashkey] 2] set ::vfs::kitdll::chandata([list $hashkey $chan]) [list file $relative pos 0 len $metadata(size) watching ""] return [list $chan] } return -code error "No way to generate a channel, need either Tcl 8.5+, \"rechan\"" } ##### No-Ops since we are a readonly filesystem proc ::vfs::kitdll::vfsop_createdirectory {args} { vfs::filesystem posixerror $::vfs::posix(EROFS) } proc ::vfs::kitdll::vfsop_deletefile {args} { vfs::filesystem posixerror $::vfs::posix(EROFS) } proc ::vfs::kitdll::vfsop_removedirectory {args} { vfs::filesystem posixerror $::vfs::posix(EROFS) } proc ::vfs::kitdll::vfsop_utime {} { vfs::filesystem posixerror $::vfs::posix(EROFS) } package provide vfs::kitdll 1.0 |
Added kitsh/buildsrc/kitsh-0.0/vfs_kitdll_data.c version [e51d57abbf].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #include <tcl.h> #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif typedef struct kitdll_data *(cmd_getData_t)(const char *, unsigned long); typedef unsigned long (cmd_getChildren_t)(const char *, unsigned long *, unsigned long); /* Your implementation must provide these */ static cmd_getData_t *getCmdData(const char *hashkey); static cmd_getChildren_t *getCmdChildren(const char *hashkey); /* Tcl Commands */ static int getMetadata(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { cmd_getData_t *cmd_getData; cmd_getChildren_t *cmd_getChildren; struct kitdll_data *finfo = NULL; Tcl_Obj *ret_list, *ret_list_items[20]; unsigned long num_children; const char *hashkey; const char *file; if (objc != 3) { Tcl_SetResult(interp, "wrong # args: should be \"getMetadata hashKey fileName\"", TCL_STATIC); return(TCL_ERROR); } hashkey = Tcl_GetString(objv[1]); file = Tcl_GetString(objv[2]); cmd_getData = getCmdData(hashkey); cmd_getChildren = getCmdChildren(hashkey); if (cmd_getData == NULL || cmd_getChildren == NULL) { Tcl_SetResult(interp, "No such hashkey", TCL_STATIC); return(TCL_ERROR); } finfo = cmd_getData(file, 0); if (finfo == NULL) { Tcl_SetResult(interp, "No such file or directory", TCL_STATIC); return(TCL_ERROR); } /* Values that can be derived from "finfo" */ ret_list_items[0] = Tcl_NewStringObj("type", 4); ret_list_items[2] = Tcl_NewStringObj("mode", 4); ret_list_items[4] = Tcl_NewStringObj("nlink", 5); if (finfo->type == KITDLL_FILETYPE_DIR) { num_children = cmd_getChildren(file, NULL, 0); ret_list_items[1] = Tcl_NewStringObj("directory", 9); ret_list_items[3] = Tcl_NewLongObj(040555); ret_list_items[5] = Tcl_NewLongObj(num_children); } else { ret_list_items[1] = Tcl_NewStringObj("file", 4); ret_list_items[3] = Tcl_NewLongObj(0444); ret_list_items[5] = Tcl_NewLongObj(1); } ret_list_items[6] = Tcl_NewStringObj("ino", 3); ret_list_items[7] = Tcl_NewLongObj(finfo->index); ret_list_items[8] = Tcl_NewStringObj("size", 4); ret_list_items[9] = Tcl_NewLongObj(finfo->size); /* Dummy values */ ret_list_items[10] = Tcl_NewStringObj("uid", 3); ret_list_items[11] = Tcl_NewStringObj("0", 1); ret_list_items[12] = Tcl_NewStringObj("gid", 3); ret_list_items[13] = Tcl_NewStringObj("0", 1); ret_list_items[14] = Tcl_NewStringObj("atime", 5); ret_list_items[15] = Tcl_NewStringObj("0", 1); ret_list_items[16] = Tcl_NewStringObj("mtime", 5); ret_list_items[17] = Tcl_NewStringObj("0", 1); ret_list_items[18] = Tcl_NewStringObj("ctime", 5); ret_list_items[19] = Tcl_NewStringObj("0", 1); ret_list = Tcl_NewListObj(sizeof(ret_list_items) / sizeof(ret_list_items[0]), ret_list_items); Tcl_SetObjResult(interp, ret_list); return(TCL_OK); } static int getData(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { struct kitdll_data *finfo = NULL; cmd_getData_t *cmd_getData; const char *hashkey; const char *file; const char *end_str; Tcl_Obj *ret_str; long start = 0; long end = -1; int tclGetLFO_ret; if (objc < 3 || objc > 5) { Tcl_SetResult(interp, "wrong # args: should be \"getData hashKey fileName ?start? ?end?\"", TCL_STATIC); return(TCL_ERROR); } hashkey = Tcl_GetString(objv[1]); file = Tcl_GetString(objv[2]); if (objc > 3) { tclGetLFO_ret = Tcl_GetLongFromObj(interp, objv[3], &start); if (tclGetLFO_ret != TCL_OK) { return(tclGetLFO_ret); } } if (objc > 4) { end_str = Tcl_GetString(objv[4]); if (strcmp(end_str, "end") == 0) { end = -1; } else { tclGetLFO_ret = Tcl_GetLongFromObj(interp, objv[4], &end); if (tclGetLFO_ret != TCL_OK) { return(tclGetLFO_ret); } } } cmd_getData = getCmdData(hashkey); if (cmd_getData == NULL) { Tcl_SetResult(interp, "No such hashkey", TCL_STATIC); return(TCL_ERROR); } finfo = cmd_getData(file, 0); if (finfo == NULL) { Tcl_SetResult(interp, "No such file or directory", TCL_STATIC); return(TCL_ERROR); } if (finfo->type != KITDLL_FILETYPE_FILE) { Tcl_SetResult(interp, "Not a file", TCL_STATIC); return(TCL_ERROR); } if (end == -1) { end = finfo->size; } if (end > finfo->size) { end = finfo->size; } if (start < 0) { start = 0; } if (end < 0) { end = 0; } if (end < start) { Tcl_SetResult(interp, "Invalid arguments, start must be less than end", TCL_STATIC); return(TCL_ERROR); } ret_str = Tcl_NewByteArrayObj(finfo->data + start, (end - start)); Tcl_SetObjResult(interp, ret_str); return(TCL_OK); } static int getChildren(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { struct kitdll_data *finfo = NULL; cmd_getChildren_t *cmd_getChildren; cmd_getData_t *cmd_getData; unsigned long num_children, idx; unsigned long *children; const char *hashkey; const char *file; const char *child; Tcl_Obj *ret_list, *ret_curr_obj; if (objc != 3) { Tcl_SetResult(interp, "wrong # args: should be \"getChildren hashKey fileName\"", TCL_STATIC); return(TCL_ERROR); } hashkey = Tcl_GetString(objv[1]); file = Tcl_GetString(objv[2]); cmd_getData = getCmdData(hashkey); cmd_getChildren = getCmdChildren(hashkey); if (cmd_getData == NULL || cmd_getChildren == NULL) { Tcl_SetResult(interp, "No such hashkey", TCL_STATIC); return(TCL_ERROR); } finfo = cmd_getData(file, 0); if (finfo == NULL) { Tcl_SetResult(interp, "No such file or directory", TCL_STATIC); return(TCL_ERROR); } if (finfo->type != KITDLL_FILETYPE_DIR) { Tcl_SetResult(interp, "Not a directory", TCL_STATIC); return(TCL_ERROR); } num_children = cmd_getChildren(file, NULL, 0); if (num_children == 0) { /* Return immediately if there are no children */ Tcl_SetResult(interp, "", TCL_STATIC); return(TCL_OK); } ret_list = Tcl_NewObj(); if (ret_list == NULL) { Tcl_SetResult(interp, "Failed to allocate new object", TCL_STATIC); return(TCL_ERROR); } children = malloc(sizeof(*children) * num_children); num_children = cmd_getChildren(file, children, num_children); for (idx = 0; idx < num_children; idx++) { finfo = cmd_getData(NULL, children[idx]); if (finfo == NULL || finfo->name == NULL) { continue; } child = finfo->name; ret_curr_obj = Tcl_NewStringObj(child, strlen(child)); Tcl_ListObjAppendList(interp, ret_list, ret_curr_obj); } free(children); Tcl_SetObjResult(interp, ret_list); return(TCL_OK); } |
Added kitsh/buildsrc/kitsh-0.0/wish.c version [59698e12d8].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #include <tk.h> int Tcl_AppInit(Tcl_Interp *interp) { int tcl_ret; tcl_ret = Tcl_Init(interp); if (tcl_ret == TCL_ERROR) { return(tcl_ret); } tcl_ret = Tk_Init(interp); if (tcl_ret == TCL_ERROR) { return(tcl_ret); } #ifdef _WIN32 tcl_ret = Tk_CreateConsoleWindow(interp); if (tcl_ret == TCL_ERROR) { return(tcl_ret); } #endif return(TCL_OK); } int main(int argc, char **argv) { Tk_Main(argc, argv, Tcl_AppInit); return(1); } |