-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmxqs.cmd
More file actions
executable file
·112 lines (84 loc) · 3.08 KB
/
Copy pathsmxqs.cmd
File metadata and controls
executable file
·112 lines (84 loc) · 3.08 KB
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
/*****************************************************************************/
/* smxqs.cmd - creates .xqs files for Seamonkey */
/* placed in the Public Domain 2010-08-07 by the author Richard L Walsh */
/*****************************************************************************/
/* change these 3 lines to match your setup */
srcRoot = 'G:\cc-release-10\obj-i386-pc-os2-emx'
srcExe = 'suite\app\seamonkey.exe'
dst = 'G:\cc-release-10\obj-i386-pc-os2-emx\mozilla\dist\bin'
/*****************************************************************************/
Main:
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
oldDir = directory()
newDir = directory(dst)
noSym.0 = 0
/* process all the subdirectories in 'srcRoot' except "mozilla" */
call SysFileTree srcRoot || '\*', 'dirs', 'DO'
do ctr = 1 to dirs.0
parse upper var dirs.ctr curDir
if right(curDir,8) = '\MOZILLA' then
iterate
call ProcessDir(dirs.ctr)
end
/* process all the subdirectories in "mozilla" except for "dist" */
call SysFileTree srcRoot || '\mozilla\*', 'dirs', 'DO'
do ctr = 1 to dirs.0
parse upper var dirs.ctr curDir
if right(curDir,5) = '\DIST' then
iterate
call ProcessDir(dirs.ctr)
end
/* create an .xqs file for the executable */
call ProcessFile(srcRoot || '\' || srcExe)
/* list failures at the end so people can see them */
if noSym.0 > 0 then do
say
say '** Error: an .xqs file could not be created for these files:'
do ctr = 1 to noSym.0
say noSym.ctr
end
end
oldDir = directory(oldDir)
exit
/*****************************************************************************/
ProcessDir: procedure expose dst noSym.
parse arg curDir
/* get a list of all the dlls in 'curDir' and its subdirectories */
call SysFileTree curDir || '\*.dll', 'files', 'FSO'
if files.0 = 0 then
return
do ctr = 1 to files.0
call ProcessFile(files.ctr)
end
return
/*****************************************************************************/
ProcessFile: procedure expose dst noSym.
parse arg srcFile
srcMap = overlay('map', srcFile, length(srcFile) - 2)
/* confirm that a .map file exists for this binary */
if stream(srcMap,'c','query exists') = '' then do
ctr = noSym.0 + 1
noSym.ctr = ' Mapfile not found for' srcFile
noSym.0 = ctr
return
end
dstFile = dst || '\' || filespec('name', srcFile)
dstSym = overlay('xqs', dstFile, length(dstFile) - 2)
say ' Creating' filespec('name', dstSym)
/* use mapxqs to generate a demangled XQS symbol file in 'dst' */
'@mapxqs -o' dstSym srcMap
if rc <> 0 then do
ctr = noSym.0 + 1
noSym.ctr = ' mapxqs failed for' srcFile
noSym.0 = ctr
return
end
/* if the binary doesn't exist in 'dst', assume it's in dst/components;
copy the .xqs file there, then delete the original */
if stream(dstFile, 'c', 'query exists') = '' then do
'@copy' dstSym dst || '\components\* > NUL'
'@del' dstSym
end
return
/*****************************************************************************/