Artifact
f2b56bad0ff2c62f593c4f661cb98ffd4fdf0c63c734bcf028276e5ae160825f :
0000: 69 66 20 7b 24 61 72 67 63 20 21 3d 20 31 7d 20 if {$argc != 1}
0010: 7b 0a 20 20 20 20 70 75 74 73 20 73 74 64 65 72 {. puts stder
0020: 72 20 22 55 73 61 67 65 3a 20 5b 69 6e 66 6f 20 r "Usage: [info
0030: 73 63 72 69 70 74 5d 20 3c 70 61 74 68 2d 74 6f script] <path-to
0040: 2d 74 63 6c 73 68 3e 22 0a 20 20 20 20 65 78 69 -tclsh>". exi
0050: 74 20 31 0a 7d 0a 0a 73 65 74 20 74 63 6c 73 68 t 1.}..set tclsh
0060: 5f 70 61 74 68 20 5b 6c 69 6e 64 65 78 20 24 61 _path [lindex $a
0070: 72 67 76 20 30 5d 0a 0a 23 20 4e 6f 72 6d 61 6c rgv 0]..# Normal
0080: 69 7a 65 20 70 61 74 68 20 73 65 70 61 72 61 74 ize path separat
0090: 6f 72 73 20 74 6f 20 66 6f 72 77 61 72 64 20 73 ors to forward s
00a0: 6c 61 73 68 65 73 20 66 6f 72 20 6d 61 6e 69 70 lashes for manip
00b0: 75 6c 61 74 69 6f 6e 0a 73 65 74 20 6e 6f 72 6d ulation.set norm
00c0: 61 6c 69 7a 65 64 20 5b 66 69 6c 65 20 6e 6f 72 alized [file nor
00d0: 6d 61 6c 69 7a 65 20 24 74 63 6c 73 68 5f 70 61 malize $tclsh_pa
00e0: 74 68 5d 0a 0a 23 20 47 65 74 20 74 68 65 20 64 th]..# Get the d
00f0: 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e irectory contain
0100: 69 6e 67 20 74 68 65 20 65 78 65 63 75 74 61 62 ing the executab
0110: 6c 65 20 28 72 65 6d 6f 76 65 73 20 62 69 6e 5c le (removes bin\
0120: 74 63 6c 73 68 39 31 2e 65 78 65 29 0a 73 65 74 tclsh91.exe).set
0130: 20 62 69 6e 5f 64 69 72 20 5b 66 69 6c 65 20 64 bin_dir [file d
0140: 69 72 6e 61 6d 65 20 24 6e 6f 72 6d 61 6c 69 7a irname $normaliz
0150: 65 64 5d 0a 73 65 74 20 69 6e 73 74 61 6c 6c 5f ed].set install_
0160: 64 69 72 20 5b 66 69 6c 65 20 64 69 72 6e 61 6d dir [file dirnam
0170: 65 20 24 62 69 6e 5f 64 69 72 5d 0a 0a 23 20 42 e $bin_dir]..# B
0180: 75 69 6c 64 20 74 68 65 20 74 61 72 67 65 74 20 uild the target
0190: 70 61 74 68 3a 20 3c 69 6e 73 74 61 6c 6c 5f 64 path: <install_d
01a0: 69 72 3e 2f 6c 69 62 2f 6e 6d 61 6b 65 2f 6e 6d ir>/lib/nmake/nm
01b0: 61 6b 65 68 6c 70 2e 65 78 65 0a 73 65 74 20 6e akehlp.exe.set n
01c0: 6d 61 6b 65 68 6c 70 5f 70 61 74 68 20 5b 66 69 makehlp_path [fi
01d0: 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 20 5b 66 le nativename [f
01e0: 69 6c 65 20 6a 6f 69 6e 20 24 69 6e 73 74 61 6c ile join $instal
01f0: 6c 5f 64 69 72 20 6c 69 62 20 6e 6d 61 6b 65 20 l_dir lib nmake
0200: 6e 6d 61 6b 65 68 6c 70 2e 65 78 65 5d 5d 0a 0a nmakehlp.exe]]..
0210: 69 66 20 7b 5b 66 69 6c 65 20 65 78 69 73 74 73 if {[file exists
0220: 20 24 6e 6d 61 6b 65 68 6c 70 5f 70 61 74 68 5d $nmakehlp_path]
0230: 7d 20 7b 0a 20 20 20 20 70 75 74 73 20 22 4e 4d } {. puts "NM
0240: 41 4b 45 48 4c 50 5f 4e 41 54 49 56 45 3d 24 6e AKEHLP_NATIVE=$n
0250: 6d 61 6b 65 68 6c 70 5f 70 61 74 68 22 0a 20 20 makehlp_path".
0260: 20 20 65 78 69 74 20 30 0a 7d 20 65 6c 73 65 20 exit 0.} else
0270: 7b 0a 20 20 20 20 70 75 74 73 20 73 74 64 65 72 {. puts stder
0280: 72 20 22 45 72 72 6f 72 3a 20 6e 6d 61 6b 65 68 r "Error: nmakeh
0290: 6c 70 2e 65 78 65 20 6e 6f 74 20 66 6f 75 6e 64 lp.exe not found
02a0: 20 61 74 3a 20 24 6e 6d 61 6b 65 68 6c 70 5f 70 at: $nmakehlp_p
02b0: 61 74 68 22 0a 20 20 20 20 65 78 69 74 20 31 0a ath". exit 1.
02c0: 7d 0a }.