1 | #!/usr/bin/env kmk_ash
|
---|
2 | # $Id: gen-slickedit-workspace.sh 100825 2023-08-09 00:40:36Z vboxsync $
|
---|
3 | ## @file
|
---|
4 | # Script for generating a SlickEdit workspace.
|
---|
5 | #
|
---|
6 | # The gen-vscode-workspace.sh script is derived from this one, so fixes here
|
---|
7 | # may apply there too.
|
---|
8 | #
|
---|
9 |
|
---|
10 | #
|
---|
11 | # Copyright (C) 2009-2023 Oracle and/or its affiliates.
|
---|
12 | #
|
---|
13 | # This file is part of VirtualBox base platform packages, as
|
---|
14 | # available from https://www.virtualbox.org.
|
---|
15 | #
|
---|
16 | # This program is free software; you can redistribute it and/or
|
---|
17 | # modify it under the terms of the GNU General Public License
|
---|
18 | # as published by the Free Software Foundation, in version 3 of the
|
---|
19 | # License.
|
---|
20 | #
|
---|
21 | # This program is distributed in the hope that it will be useful, but
|
---|
22 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
23 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
24 | # General Public License for more details.
|
---|
25 | #
|
---|
26 | # You should have received a copy of the GNU General Public License
|
---|
27 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
28 | #
|
---|
29 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
30 | #
|
---|
31 |
|
---|
32 | #
|
---|
33 | # Include code we share with gen-vscode-workspace.sh
|
---|
34 | #
|
---|
35 | MY_SCRIPT_DIR=.
|
---|
36 | case "$0" in
|
---|
37 | */*|*\\*)
|
---|
38 | MY_SCRIPT_DIR=$(echo "$0" | kmk_sed -e 's,[/\][^/\][^/\]*$,,')
|
---|
39 | ;;
|
---|
40 | esac
|
---|
41 | . "${MY_SCRIPT_DIR}/common-gen-workspace.inc.sh"
|
---|
42 |
|
---|
43 |
|
---|
44 | #
|
---|
45 | # Globals.
|
---|
46 | #
|
---|
47 | MY_PROJECT_FILES=""
|
---|
48 |
|
---|
49 |
|
---|
50 | #
|
---|
51 | # Parameters w/ defaults.
|
---|
52 | #
|
---|
53 | MY_OUT_DIR="SlickEdit"
|
---|
54 | MY_PRJ_PRF="VBox-"
|
---|
55 | MY_WS_NAME="VirtualBox.vpw"
|
---|
56 | MY_DBG=""
|
---|
57 | MY_WINDOWS_HOST=""
|
---|
58 | MY_OPT_MINIMAL=""
|
---|
59 | MY_OPT_USE_WILDCARDS="yes"
|
---|
60 |
|
---|
61 |
|
---|
62 | ##
|
---|
63 | # Generate folders for the specified directories and files.
|
---|
64 | #
|
---|
65 | # @param $1 The output (base) file name.
|
---|
66 | # @param $2+ The files and directories to traverse.
|
---|
67 | my_generate_folder()
|
---|
68 | {
|
---|
69 | MY_FILE="$1"
|
---|
70 | shift
|
---|
71 |
|
---|
72 | # Zap existing file collections.
|
---|
73 | > "${MY_FILE}-All.lst"
|
---|
74 | > "${MY_FILE}-Sources.lst"
|
---|
75 | > "${MY_FILE}-Headers.lst"
|
---|
76 | > "${MY_FILE}-Assembly.lst"
|
---|
77 | > "${MY_FILE}-Testcases.lst"
|
---|
78 | > "${MY_FILE}-Others.lst"
|
---|
79 |
|
---|
80 | # Traverse the directories and files.
|
---|
81 | while test $# -ge 1 -a -n "${1}";
|
---|
82 | do
|
---|
83 | for f in ${MY_ROOT_DIR}/$1;
|
---|
84 | do
|
---|
85 | if test -d "${f}";
|
---|
86 | then
|
---|
87 | if test -z "${MY_OPT_USE_WILDCARDS}";
|
---|
88 | then
|
---|
89 | my_sub_tree "${MY_FILE}" "${f}"
|
---|
90 | else
|
---|
91 | case "${f}" in
|
---|
92 | ${MY_ROOT_DIR}/include*)
|
---|
93 | #my_sub_tree "${MY_FILE}" "${f}" "Headers"
|
---|
94 | my_wildcard "${MY_FILE}" "${f}" "Headers"
|
---|
95 | ;;
|
---|
96 | *) my_wildcard "${MY_FILE}" "${f}"
|
---|
97 | ;;
|
---|
98 | esac
|
---|
99 | fi
|
---|
100 | else
|
---|
101 | my_file "${MY_FILE}" "${f}"
|
---|
102 | fi
|
---|
103 | done
|
---|
104 | shift
|
---|
105 | done
|
---|
106 |
|
---|
107 | # Generate the folders.
|
---|
108 | if test -s "${MY_FILE}-All.lst";
|
---|
109 | then
|
---|
110 | ${MY_SORT} "${MY_FILE}-All.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
111 | fi
|
---|
112 | if test -s "${MY_FILE}-Sources.lst";
|
---|
113 | then
|
---|
114 | echo ' <Folder Name="Sources" Filters="*.c;*.cpp;*.cpp.h;*.c.h;*.m;*.mm;*.pl;*.py;*.as">' >> "${MY_FILE}"
|
---|
115 | ${MY_SORT} "${MY_FILE}-Sources.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
116 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
117 | fi
|
---|
118 | if test -s "${MY_FILE}-Headers.lst";
|
---|
119 | then
|
---|
120 | if test -z "${MY_OPT_USE_WILDCARDS}";
|
---|
121 | then
|
---|
122 | echo ' <Folder Name="Headers" Filters="*.h;*.hpp">' >> "${MY_FILE}"
|
---|
123 | else
|
---|
124 | echo ' <Folder Name="Headers" Filters="">' >> "${MY_FILE}"
|
---|
125 | fi
|
---|
126 | ${MY_SORT} "${MY_FILE}-Headers.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
127 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
128 | fi
|
---|
129 | if test -s "${MY_FILE}-Assembly.lst";
|
---|
130 | then
|
---|
131 | echo ' <Folder Name="Assembly" Filters="*.asm;*.s;*.S;*.inc;*.mac">' >> "${MY_FILE}"
|
---|
132 | ${MY_SORT} "${MY_FILE}-Assembly.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
133 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
134 | fi
|
---|
135 | if test -s "${MY_FILE}-Testcases.lst";
|
---|
136 | then
|
---|
137 | echo ' <Folder Name="Testcases" Filters="tst*;">' >> "${MY_FILE}"
|
---|
138 | ${MY_SORT} "${MY_FILE}-Testcases.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
139 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
140 | fi
|
---|
141 | if test -s "${MY_FILE}-Others.lst";
|
---|
142 | then
|
---|
143 | echo ' <Folder Name="Others" Filters="">' >> "${MY_FILE}"
|
---|
144 | ${MY_SORT} "${MY_FILE}-Others.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
145 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
146 | fi
|
---|
147 |
|
---|
148 | # Cleanup
|
---|
149 | ${MY_RM} "${MY_FILE}-All.lst" "${MY_FILE}-Sources.lst" "${MY_FILE}-Headers.lst" "${MY_FILE}-Assembly.lst" \
|
---|
150 | "${MY_FILE}-Testcases.lst" "${MY_FILE}-Others.lst"
|
---|
151 | }
|
---|
152 |
|
---|
153 | ##
|
---|
154 | # Function generating a project build config.
|
---|
155 | #
|
---|
156 | # @param $1 The project file name.
|
---|
157 | # @param $2 Build config name.
|
---|
158 | # @param $3 Extra kBuild command line options, variant 1.
|
---|
159 | # @param $4 Extra kBuild command line options, variant 2.
|
---|
160 | # @param $4+ Include directories.
|
---|
161 | # @param $N --end-includes
|
---|
162 | my_generate_project_config()
|
---|
163 | {
|
---|
164 | MY_FILE="${1}";
|
---|
165 | MY_CFG_NAME="${2}";
|
---|
166 | MY_KMK_EXTRAS1="${3}";
|
---|
167 | MY_KMK_EXTRAS2="${4}";
|
---|
168 | MY_KMK_EXTRAS3="${5}";
|
---|
169 | MY_KMK_EXTRAS4="${6}";
|
---|
170 | shift; shift; shift; shift; shift; shift;
|
---|
171 |
|
---|
172 | echo ' <Config Name="'"${MY_CFG_NAME}"'" OutputFile="" CompilerConfigName="Latest Version">' >> "${MY_FILE}"
|
---|
173 | echo ' <Menu>' >> "${MY_FILE}"
|
---|
174 |
|
---|
175 | echo ' <Target Name="Compile" MenuCaption="&Compile" CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
176 | echo ' SaveOption="SaveCurrent" RunFromDir="%p" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
177 | echo -n ' <Exec CmdLine="'"${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS1}"' -C %p %n.o' >> "${MY_FILE}"
|
---|
178 | if test -n "${MY_KMK_EXTRAS2}"; then
|
---|
179 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS2} -C %p %n.o" >> "${MY_FILE}"
|
---|
180 | fi
|
---|
181 | if test -n "${MY_KMK_EXTRAS3}"; then
|
---|
182 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS3} -C %p %n.o" >> "${MY_FILE}"
|
---|
183 | fi
|
---|
184 | if test -n "${MY_KMK_EXTRAS4}"; then
|
---|
185 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS4} -C %p %n.o" >> "${MY_FILE}"
|
---|
186 | fi
|
---|
187 | echo '"/>' >> "${MY_FILE}"
|
---|
188 | echo ' </Target>' >> "${MY_FILE}"
|
---|
189 |
|
---|
190 | echo ' <Target Name="Build" MenuCaption="&Build"CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
191 | echo ' SaveOption="SaveWorkspaceFiles" RunFromDir="%rw" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
192 | echo -n ' <Exec CmdLine="'"${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS1}"' -C %rw' >> "${MY_FILE}"
|
---|
193 | if test -n "${MY_KMK_EXTRAS2}"; then
|
---|
194 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS2} -C %rw" >> "${MY_FILE}"
|
---|
195 | fi
|
---|
196 | if test -n "${MY_KMK_EXTRAS3}"; then
|
---|
197 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS3} -C %rw" >> "${MY_FILE}"
|
---|
198 | fi
|
---|
199 | if test -n "${MY_KMK_EXTRAS4}"; then
|
---|
200 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS4} -C %rw" >> "${MY_FILE}"
|
---|
201 | fi
|
---|
202 | echo '"/>' >> "${MY_FILE}"
|
---|
203 | echo ' </Target>' >> "${MY_FILE}"
|
---|
204 |
|
---|
205 | echo ' <Target Name="Rebuild" MenuCaption="&Rebuild" CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
206 | echo ' SaveOption="SaveWorkspaceFiles" RunFromDir="%rw" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
207 | echo -n ' <Exec CmdLine="'"${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS1}"' -C %rw' >> "${MY_FILE}"
|
---|
208 | if test -n "${MY_KMK_EXTRAS2}"; then
|
---|
209 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS2} -C %rw rebuild" >> "${MY_FILE}"
|
---|
210 | fi
|
---|
211 | if test -n "${MY_KMK_EXTRAS3}"; then
|
---|
212 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS3} -C %rw rebuild" >> "${MY_FILE}"
|
---|
213 | fi
|
---|
214 | if test -n "${MY_KMK_EXTRAS4}"; then
|
---|
215 | echo -n " && ${MY_KMK_INVOCATION} ${MY_KMK_EXTRAS4} -C %rw rebuild" >> "${MY_FILE}"
|
---|
216 | fi
|
---|
217 | echo '"/>' >> "${MY_FILE}"
|
---|
218 | echo ' </Target>' >> "${MY_FILE}"
|
---|
219 |
|
---|
220 | #echo ' <Target Name="Debug" MenuCaption="&Debug" SaveOption="SaveNone" RunFromDir="%rw">' >> "${MY_FILE}"
|
---|
221 | #echo ' <Exec/>' >> "${MY_FILE}"
|
---|
222 | #echo ' </Target>' >> "${MY_FILE}"
|
---|
223 | #echo ' <Target Name="Execute" MenuCaption="E&xecute" SaveOption="SaveNone" RunFromDir="%rw">'>> "${MY_FILE}"
|
---|
224 | #echo ' <Exec/>' >> "${MY_FILE}"
|
---|
225 | #echo ' </Target>' >> "${MY_FILE}"
|
---|
226 | echo ' </Menu>' >> "${MY_FILE}"
|
---|
227 |
|
---|
228 | #
|
---|
229 | # Include directories.
|
---|
230 | #
|
---|
231 | echo ' <Includes>' >> "${MY_FILE}"
|
---|
232 | while test $# -ge 1 -a "${1}" != "--end-includes";
|
---|
233 | do
|
---|
234 | for f in $1;
|
---|
235 | do
|
---|
236 | my_abs_dir ${f}
|
---|
237 | echo ' <Include Dir="'"${MY_ABS_DIR}/"'"/>' >> "${MY_FILE}"
|
---|
238 | done
|
---|
239 | shift
|
---|
240 | done
|
---|
241 | shift
|
---|
242 | echo ' </Includes>' >> "${MY_FILE}"
|
---|
243 | echo ' </Config>' >> "${MY_FILE}"
|
---|
244 | }
|
---|
245 |
|
---|
246 |
|
---|
247 | ##
|
---|
248 | # Function generating a project.
|
---|
249 | #
|
---|
250 | # This is called from my_generate_all_projects() in the common code.
|
---|
251 | #
|
---|
252 | # @param $1 The project file name.
|
---|
253 | # @param $2 The project working directory.
|
---|
254 | # @param $3 Dummy separator.
|
---|
255 | # @param $4+ Include directories.
|
---|
256 | # @param $N --end-includes
|
---|
257 | # @param $N+1 Directory sub-trees and files to include in the project.
|
---|
258 | #
|
---|
259 | my_generate_project()
|
---|
260 | {
|
---|
261 | MY_FILE="${MY_PRJ_PRF}${1}.vpj";
|
---|
262 | echo "Generating ${MY_FILE}..."
|
---|
263 | MY_WRK_DIR="${2}"
|
---|
264 | shift
|
---|
265 | shift
|
---|
266 | shift
|
---|
267 |
|
---|
268 | # Add it to the project list for workspace construction later on.
|
---|
269 | MY_PROJECT_FILES="${MY_PROJECT_FILES} ${MY_FILE}"
|
---|
270 |
|
---|
271 |
|
---|
272 | #
|
---|
273 | # Generate the head bits.
|
---|
274 | #
|
---|
275 | echo '<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">' > "${MY_FILE}"
|
---|
276 | echo '<Project' >> "${MY_FILE}"
|
---|
277 | echo ' Version="10.0"' >> "${MY_FILE}"
|
---|
278 | echo ' VendorName="SlickEdit"' >> "${MY_FILE}"
|
---|
279 | echo ' VCSProject="Subversion:"' >> "${MY_FILE}"
|
---|
280 | # echo ' Customized="1"' >> "${MY_FILE}"
|
---|
281 | # echo ' WorkingDir="."' >> "${MY_FILE}"
|
---|
282 | my_abs_dir "${MY_WRK_DIR}" >> "${MY_FILE}"
|
---|
283 | echo ' WorkingDir="'"${MY_ABS_DIR}"'"' >> "${MY_FILE}"
|
---|
284 | echo ' >' >> "${MY_FILE}"
|
---|
285 | my_generate_project_config "${MY_FILE}" "Default" "" "" "" "" $*
|
---|
286 | my_generate_project_config "${MY_FILE}" "Debug + hardening" "KBUILD_TYPE=debug VBOX_WITH_HARDENING=1" "" "" "" $*
|
---|
287 | my_generate_project_config "${MY_FILE}" "Release + hardening" "KBUILD_TYPE=release VBOX_WITH_HARDENING=1" "" "" "" $*
|
---|
288 | my_generate_project_config "${MY_FILE}" "Debug+Release + hardening" \
|
---|
289 | "KBUILD_TYPE=debug VBOX_WITH_HARDENING=1" \
|
---|
290 | "KBUILD_TYPE=release VBOX_WITH_HARDENING=1" \
|
---|
291 | "" "" $*
|
---|
292 | my_generate_project_config "${MY_FILE}" "Debug w/o hardening" "KBUILD_TYPE=debug VBOX_WITHOUT_HARDENING=1" "" "" $*
|
---|
293 | my_generate_project_config "${MY_FILE}" "Release w/o hardening" "KBUILD_TYPE=release VBOX_WITHOUT_HARDENING=1" "" "" $*
|
---|
294 | my_generate_project_config "${MY_FILE}" "Debug+Release w/o hardening" \
|
---|
295 | "KBUILD_TYPE=debug VBOX_WITHOUT_HARDENING=1" \
|
---|
296 | "KBUILD_TYPE=release VBOX_WITHOUT_HARDENING=1" \
|
---|
297 | "" "" $*
|
---|
298 | my_generate_project_config "${MY_FILE}" "Debug+Release with and without hardening" \
|
---|
299 | "KBUILD_TYPE=debug VBOX_WITH_HARDENING=1" \
|
---|
300 | "KBUILD_TYPE=release VBOX_WITH_HARDENING=1" \
|
---|
301 | "KBUILD_TYPE=debug VBOX_WITHOUT_HARDENING=1" \
|
---|
302 | "KBUILD_TYPE=release VBOX_WITHOUT_HARDENING=1" \
|
---|
303 | $*
|
---|
304 |
|
---|
305 | while test $# -ge 1 -a "${1}" != "--end-includes";
|
---|
306 | do
|
---|
307 | shift;
|
---|
308 | done;
|
---|
309 | shift;
|
---|
310 |
|
---|
311 | #
|
---|
312 | # Process directories+files and create folders.
|
---|
313 | #
|
---|
314 | echo ' <Files>' >> "${MY_FILE}"
|
---|
315 | my_generate_folder "${MY_FILE}" $*
|
---|
316 | echo ' </Files>' >> "${MY_FILE}"
|
---|
317 |
|
---|
318 | #
|
---|
319 | # The tail.
|
---|
320 | #
|
---|
321 | echo '</Project>' >> "${MY_FILE}"
|
---|
322 |
|
---|
323 | return 0
|
---|
324 | }
|
---|
325 |
|
---|
326 |
|
---|
327 | ##
|
---|
328 | # Generate the workspace
|
---|
329 | #
|
---|
330 | my_generate_workspace()
|
---|
331 | {
|
---|
332 | MY_FILE="${MY_WS_NAME}"
|
---|
333 | echo "Generating ${MY_FILE}..."
|
---|
334 | echo '<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">' > "${MY_FILE}"
|
---|
335 | echo '<Workspace Version="10.0" VendorName="SlickEdit">' >> "${MY_FILE}"
|
---|
336 | echo ' <Projects>' >> "${MY_FILE}"
|
---|
337 | for i in ${MY_PROJECT_FILES};
|
---|
338 | do
|
---|
339 | echo ' <Project File="'"${i}"'" />' >> "${MY_FILE}"
|
---|
340 | done
|
---|
341 | echo ' </Projects>' >> "${MY_FILE}"
|
---|
342 | echo '</Workspace>' >> "${MY_FILE}"
|
---|
343 | return 0;
|
---|
344 | }
|
---|
345 |
|
---|
346 |
|
---|
347 | ##
|
---|
348 | # Generate stuff
|
---|
349 | #
|
---|
350 | my_generate_usercpp_h()
|
---|
351 | {
|
---|
352 | #
|
---|
353 | # Probe the slickedit user config, picking the most recent version.
|
---|
354 | #
|
---|
355 | MY_VSLICK_DB_OLD=
|
---|
356 | if test -z "${MY_SLICK_CONFIG}"; then
|
---|
357 | if test -d "${HOME}/Library/Application Support/SlickEdit"; then
|
---|
358 | MY_SLICKDIR_="${HOME}/Library/Application Support/SlickEdit"
|
---|
359 | MY_USERCPP_H="unxcpp.h"
|
---|
360 | MY_VSLICK_DB="vslick.sta" # was .stu earlier, 24 is using .sta.
|
---|
361 | MY_VSLICK_DB_OLD="vslick.stu"
|
---|
362 | elif test -d "${HOMEDRIVE}${HOMEPATH}/Documents/My SlickEdit Config"; then
|
---|
363 | MY_SLICKDIR_="${HOMEDRIVE}${HOMEPATH}/Documents/My SlickEdit Config"
|
---|
364 | MY_USERCPP_H="usercpp.h"
|
---|
365 | MY_VSLICK_DB="vslick.sta"
|
---|
366 | else
|
---|
367 | MY_SLICKDIR_="${HOME}/.slickedit"
|
---|
368 | MY_USERCPP_H="unxcpp.h"
|
---|
369 | MY_VSLICK_DB="vslick.sta"
|
---|
370 | MY_VSLICK_DB_OLD="vslick.stu"
|
---|
371 | fi
|
---|
372 | else
|
---|
373 | MY_SLICKDIR_="${MY_SLICK_CONFIG}"
|
---|
374 | if test -n "${MY_WINDOWS_HOST}"; then
|
---|
375 | MY_USERCPP_H="usercpp.h"
|
---|
376 | MY_VSLICK_DB="vslick.sta"
|
---|
377 | else
|
---|
378 | MY_USERCPP_H="unxcpp.h"
|
---|
379 | MY_VSLICK_DB="vslick.sta"
|
---|
380 | MY_VSLICK_DB_OLD="vslick.stu"
|
---|
381 | fi
|
---|
382 | # MacOS: Implement me!
|
---|
383 | fi
|
---|
384 |
|
---|
385 | MY_VER_NUM="0"
|
---|
386 | MY_VER="0.0.0"
|
---|
387 | for subdir in "${MY_SLICKDIR_}/"*;
|
---|
388 | do
|
---|
389 | if test -f "${subdir}/${MY_USERCPP_H}" \
|
---|
390 | -o -f "${subdir}/${MY_VSLICK_DB}" \
|
---|
391 | -o '(' -n "${MY_VSLICK_DB_OLD}" -a -f "${subdir}/${MY_VSLICK_DB_OLD}" ')'; then
|
---|
392 | MY_CUR_VER_NUM=0
|
---|
393 | MY_CUR_VER=`echo "${subdir}" | ${MY_SED} -e 's,^.*/,,g'`
|
---|
394 |
|
---|
395 | # Convert the dotted version number to an integer, checking that
|
---|
396 | # it is all numbers in the process.
|
---|
397 | set `echo "${MY_CUR_VER}" | ${MY_SED} 's/\./ /g' `
|
---|
398 | i=24010000 # == 70*70*70*70; max major version 89.
|
---|
399 | while test $# -gt 0;
|
---|
400 | do
|
---|
401 | if ! ${MY_EXPR} "$1" + 1 > /dev/null 2> /dev/null; then
|
---|
402 | MY_CUR_VER_NUM=0;
|
---|
403 | break
|
---|
404 | fi
|
---|
405 | if test "$i" -gt 0; then
|
---|
406 | MY_CUR_VER_NUM=$((${MY_CUR_VER_NUM} + $1 * $i))
|
---|
407 | i=$(($i / 70))
|
---|
408 | fi
|
---|
409 | shift
|
---|
410 | done
|
---|
411 |
|
---|
412 | # More recent that what we have?
|
---|
413 | if test "${MY_CUR_VER_NUM}" -gt "${MY_VER_NUM}"; then
|
---|
414 | MY_VER_NUM="${MY_CUR_VER_NUM}"
|
---|
415 | MY_VER="${MY_CUR_VER}"
|
---|
416 | fi
|
---|
417 | fi
|
---|
418 | done
|
---|
419 |
|
---|
420 | MY_SLICKDIR="${MY_SLICKDIR_}/${MY_VER}"
|
---|
421 | MY_USERCPP_H_FULL="${MY_SLICKDIR}/${MY_USERCPP_H}"
|
---|
422 | if test -d "${MY_SLICKDIR}"; then
|
---|
423 | echo "Found SlickEdit v${MY_VER} preprocessor file: ${MY_USERCPP_H_FULL}"
|
---|
424 | else
|
---|
425 | echo "Failed to locate SlickEdit preprocessor file. You need to manually merge ${MY_USERCPP_H}."
|
---|
426 | echo "dbg: MY_SLICKDIR=${MY_SLICKDIR} MY_USERCPP_H_FULL=${MY_USERCPP_H_FULL}"
|
---|
427 | MY_USERCPP_H_FULL=""
|
---|
428 | fi
|
---|
429 |
|
---|
430 | # Generate our
|
---|
431 | MY_FILE="${MY_USERCPP_H}"
|
---|
432 | ${MY_CAT} > ${MY_FILE} <<EOF
|
---|
433 | #define IN_SLICKEDIT
|
---|
434 | #define RT_C_DECLS_BEGIN
|
---|
435 | #define RT_C_DECLS_END
|
---|
436 | #define RT_NOTHROW_PROTO
|
---|
437 | #define RT_NOTHROW_DEF
|
---|
438 | #define RT_NO_THROW_PROTO
|
---|
439 | #define RT_NO_THROW_DEF
|
---|
440 | #define RT_NOEXCEPT
|
---|
441 | #define RT_OVERRIDE
|
---|
442 | #define RT_THROW(type) throw(type)
|
---|
443 | #define RT_GCC_EXTENSION
|
---|
444 | #define RT_COMPILER_GROKS_64BIT_BITFIELDS
|
---|
445 | #define RT_COMPILER_WITH_80BIT_LONG_DOUBLE
|
---|
446 | #define RT_DECL_NTAPI(type) type
|
---|
447 | #define RT_CONCAT(a,b) a##b
|
---|
448 | #define RT_CONCAT3(a,b,c) a##b##c
|
---|
449 | #define RT_CONCAT4(a,b,c,d) a##b##c##d
|
---|
450 |
|
---|
451 | #define ATL_NO_VTABLE
|
---|
452 | #define BEGIN_COM_MAP(a)
|
---|
453 | #define COM_INTERFACE_ENTRY(a)
|
---|
454 | #define COM_INTERFACE_ENTRY2(a,b)
|
---|
455 | #define COM_INTERFACE_ENTRY3(a,b,c)
|
---|
456 | #define COM_INTERFACE_ENTRY4(a,b,c,d)
|
---|
457 | #define END_COM_MAP(a)
|
---|
458 |
|
---|
459 | #define COM_DECL_READONLY_ENUM_AND_COLLECTION(a)
|
---|
460 | #define COMGETTER(n) n
|
---|
461 | #define COMSETTER(n) n
|
---|
462 | #define ComSafeArrayIn(t,a) t a[]
|
---|
463 | #define ComSafeArrayOut(t,a) t * a[]
|
---|
464 | #define DECLARE_CLASSFACTORY(a)
|
---|
465 | #define DECLARE_CLASSFACTORY_SINGLETON(a)
|
---|
466 | #define DECLARE_REGISTRY_RESOURCEID(a)
|
---|
467 | #define DECLARE_NOT_AGGREGATABLE(a)
|
---|
468 | #define DECLARE_PROTECT_FINAL_CONSTRUCT(a)
|
---|
469 | #define DECLARE_EMPTY_CTOR_DTOR(a) a(); ~a();
|
---|
470 | #define DEFINE_EMPTY_CTOR_DTOR(a) a::a() {} a::~a() {}
|
---|
471 | #define DECLARE_TRANSLATE_METHODS(cls) \
|
---|
472 | static inline const char *tr(const char *aSourceText, \
|
---|
473 | const char *aComment = NULL, \
|
---|
474 | const int aNum = -1) \
|
---|
475 | { \
|
---|
476 | return VirtualBoxTranslator::translate(#cls, aSourceText, aComment, aNum); \
|
---|
477 | }
|
---|
478 | #define DECLARE_COMMON_CLASS_METHODS(cls) \
|
---|
479 | DECLARE_EMPTY_CTOR_DTOR(cls) \
|
---|
480 | DECLARE_TRANSLATE_METHODS(cls)
|
---|
481 | #define NS_DECL_ISUPPORTS
|
---|
482 | #define NS_IMETHOD virtual nsresult
|
---|
483 | #define NS_IMETHOD_(type) virtual type
|
---|
484 | #define NS_IMETHODIMP nsresult
|
---|
485 | #define NS_IMETHODIMP_(type) type
|
---|
486 | #define PARSERS_EXPORT
|
---|
487 | EOF
|
---|
488 | if test -n "${MY_WINDOWS_HOST}"; then
|
---|
489 | ${MY_CAT} >> ${MY_FILE} <<EOF
|
---|
490 | #define COM_STRUCT_OR_CLASS(I) struct I
|
---|
491 | #define STDMETHOD(m) virtual HRESULT m
|
---|
492 | #define STDMETHOD_(type,m) virtual type m
|
---|
493 | #define STDMETHODIMP HRESULT
|
---|
494 | #define STDMETHODIMP_(type) type
|
---|
495 | EOF
|
---|
496 | else
|
---|
497 | ${MY_CAT} >> ${MY_FILE} <<EOF
|
---|
498 | #define COM_STRUCT_OR_CLASS(I) class I
|
---|
499 | #define STDMETHOD(m) virtual nsresult m
|
---|
500 | #define STDMETHOD_(type,m) virtual type m
|
---|
501 | #define STDMETHODIMP nsresult
|
---|
502 | #define STDMETHODIMP_(type) type
|
---|
503 | EOF
|
---|
504 | fi
|
---|
505 | ${MY_CAT} >> ${MY_FILE} <<EOF
|
---|
506 | #define VBOX_SCRIPTABLE(a) public a
|
---|
507 | #define VBOX_SCRIPTABLE_IMPL(a)
|
---|
508 | #define VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(a)
|
---|
509 |
|
---|
510 | #define CTX_SUFF(var) var##R3
|
---|
511 | #define CTXAllSUFF(var) var##R3
|
---|
512 | #define CTXSUFF(var) var##HC
|
---|
513 | #define OTHERCTXSUFF(var) var##GC
|
---|
514 | #define CTXALLMID(first, last) first##R3##last
|
---|
515 | #define CTXMID(first, last) first##HC##last
|
---|
516 | #define OTHERCTXMID(first, last) first##GC##last
|
---|
517 | #define CTXTYPE(GCType, R3Type, R0Type) R3Type
|
---|
518 | #define RCTYPE(RCType, HCType) RCType
|
---|
519 | #define GCTYPE(GCType, HCType) GCType
|
---|
520 | #define RCPTRTYPE(RCType) RCType
|
---|
521 | #define GCPTRTYPE(GCType) GCType
|
---|
522 | #define HCPTRTYPE(HCType) HCType
|
---|
523 | #define R3R0PTRTYPE(HCType) HCType
|
---|
524 | #define R0PTRTYPE(R3Type) R3Type
|
---|
525 | #define R3PTRTYPE(R0Type) R0Type
|
---|
526 | #define RT_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__
|
---|
527 | #define RT_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction
|
---|
528 | #define RT_SRC_POS_ARGS pszFile, iLine, pszFunction
|
---|
529 | #define RTCALL
|
---|
530 | #define RT_IPRT_FORMAT_ATTR(a_iFmt, a_iArgs)
|
---|
531 | #define RT_IPRT_FORMAT_ATTR_MAYBE_NULL(a_iFmt, a_iArgs)
|
---|
532 | #define RT_NOCRT(a_Name) a_Name
|
---|
533 | #define DECLINLINE(type) inline type
|
---|
534 | #define DECL_INLINE_THROW(type) inline type
|
---|
535 | #define DECL_FORCE_INLINE(type) inline type
|
---|
536 | #define DECL_INVALID(type) type
|
---|
537 |
|
---|
538 | #define PDMDEVINSINT_DECLARED 1
|
---|
539 | #define VBOX_WITH_HGCM 1
|
---|
540 | #define VBOXCALL
|
---|
541 |
|
---|
542 | #define HM_NAMELESS_UNION_TAG(a_Tag)
|
---|
543 | #define HM_UNION_NM(a_Nm)
|
---|
544 | #define HM_STRUCT_NM(a_Nm)
|
---|
545 |
|
---|
546 | #define PGM_ALL_CB_DECL(type) type
|
---|
547 | #define PGM_ALL_CB2_DECL(type) type
|
---|
548 | #define PGM_CTX(a,b) b
|
---|
549 | #define PGM_CTX3(a,b,c) c
|
---|
550 | #define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name)
|
---|
551 | #define PGM_GST_NAME_REAL(name) pgmGstReal##name
|
---|
552 | #define PGM_GST_NAME_PROT(name) pgmGstProt##name
|
---|
553 | #define PGM_GST_NAME_32BIT(name) pgmGst32Bit##name
|
---|
554 | #define PGM_GST_NAME_PAE(name) pgmGstPAE##name
|
---|
555 | #define PGM_GST_NAME_AMD64(name) pgmGstAMD64##name
|
---|
556 | #define PGM_GST_DECL(type, name) type PGM_GST_NAME(name)
|
---|
557 | #define PGM_SHW_NAME(name) PGM_GST_NAME_AMD64(name)
|
---|
558 | #define PGM_SHW_NAME_32BIT(name) pgmShw32Bit##name
|
---|
559 | #define PGM_SHW_NAME_PAE(name) pgmShwPAE##name
|
---|
560 | #define PGM_SHW_NAME_AMD64(name) pgmShwAMD64##name
|
---|
561 | #define PGM_SHW_NAME_NESTED(name) pgmShwNested##name
|
---|
562 | #define PGM_SHW_NAME_EPT(name) pgmShwEPT##name
|
---|
563 | #define PGM_SHW_DECL(type, name) type PGM_SHW_NAME(name)
|
---|
564 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64(name)
|
---|
565 | #define PGM_BTH_NAME_32BIT_REAL(name) pgmBth##name
|
---|
566 | #define PGM_BTH_NAME_32BIT_PROT(name) pgmBth##name
|
---|
567 | #define PGM_BTH_NAME_32BIT_32BIT(name) pgmBth##name
|
---|
568 | #define PGM_BTH_NAME_PAE_REAL(name) pgmBth##name
|
---|
569 | #define PGM_BTH_NAME_PAE_PROT(name) pgmBth##name
|
---|
570 | #define PGM_BTH_NAME_PAE_32BIT(name) pgmBth##name
|
---|
571 | #define PGM_BTH_NAME_PAE_PAE(name) pgmBth##name
|
---|
572 | #define PGM_BTH_NAME_AMD64_PROT(name) pgmBth##name
|
---|
573 | #define PGM_BTH_NAME_AMD64_AMD64(name) pgmBth##name
|
---|
574 | #define PGM_BTH_NAME_NESTED_REAL(name) pgmBth##name
|
---|
575 | #define PGM_BTH_NAME_NESTED_PROT(name) pgmBth##name
|
---|
576 | #define PGM_BTH_NAME_NESTED_32BIT(name) pgmBth##name
|
---|
577 | #define PGM_BTH_NAME_NESTED_PAE(name) pgmBth##name
|
---|
578 | #define PGM_BTH_NAME_NESTED_AMD64(name) pgmBth##name
|
---|
579 | #define PGM_BTH_NAME_EPT_REAL(name) pgmBth##name
|
---|
580 | #define PGM_BTH_NAME_EPT_PROT(name) pgmBth##name
|
---|
581 | #define PGM_BTH_NAME_EPT_32BIT(name) pgmBth##name
|
---|
582 | #define PGM_BTH_NAME_EPT_PAE(name) pgmBth##name
|
---|
583 | #define PGM_BTH_NAME_EPT_AMD64(name) pgmBth##name
|
---|
584 | #define PGM_BTH_DECL(type, name) type PGM_BTH_NAME(name)
|
---|
585 |
|
---|
586 | #define FNIEMOP_STUB(a_Name) VBOXSTRICTRC a_Name(PIEMCPU pIemCpu) { return VERR_NOT_IMPLEMENTED; }
|
---|
587 | #define FNIEMOP_DEF(a_Name) VBOXSTRICTRC a_Name(PIEMCPU pIemCpu)
|
---|
588 | #define FNIEMOP_DEF_1(a_Name, a_Type0, a_Name0) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0)
|
---|
589 | #define FNIEMOP_DEF_2(a_Name, a_Type0, a_Name0, a_Type1, a_Name1) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1)
|
---|
590 | #define FNIEMOPRM_DEF(a_Name) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, uint8_t bBm)
|
---|
591 | #define IEM_CIMPL_DEF_0(a_Name) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu)
|
---|
592 | #define IEM_CIMPL_DEF_1(a_Name, a_Type0, a_Name0) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, , a_Type0 a_Name0)
|
---|
593 | #define IEM_CIMPL_DEF_2(a_Name, a_Type0, a_Name0, a_Type1, a_Name1) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1)
|
---|
594 | #define IEM_CIMPL_DEF_3(a_Name, a_Type0, a_Name0, a_Type1, a_Name1, a_Type2, a_Name2) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1, a_Type2 a_Name2)
|
---|
595 | #define IEM_CIMPL_DEF_4(a_Name, a_Type0, a_Name0, a_Type1, a_Name1, a_Type2, a_Name2, a_Type3, a_Name3) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1, a_Type2 a_Name2, a_Type3 a_Name3)
|
---|
596 | #define IEM_DECL_IMPL_DEF(a_RetType, a_Name, a_ArgList) a_RetType a_Name a_ArgList
|
---|
597 | #define IEM_DECL_IEMTHREADEDFUNC_DEF(a_Name) VBOXSTRICTRC a_Name(PVMCPU pVCpu, uint64_t uParam0, uint64_t uParam1, uint64_t uParam2)
|
---|
598 | #define IEM_DECL_IEMTHREADEDFUNC_PROTO(a_Name) VBOXSTRICTRC a_Name(PVMCPU pVCpu, uint64_t uParam0, uint64_t uParam1, uint64_t uParam2)
|
---|
599 | #define IEM_MC_LOCAL(a_Type, a_Name) a_Type a_Name
|
---|
600 | #define IEM_MC_ARG(a_Type, a_Name, a_iArg) a_Type a_Name
|
---|
601 | #define IEM_MC_ARG_CONST(a_Type, a_Name, a_Value, a_iArg) a_Type const a_Name = a_Value
|
---|
602 | #define IEM_STATIC
|
---|
603 |
|
---|
604 | #define RTASN1_IMPL_GEN_SEQ_OF_TYPEDEFS_AND_PROTOS(a_SeqOfType, a_ItemType, a_DeclMacro, a_ImplExtNm) typedef struct a_SeqOfType { RTASN1SEQUENCECORE SeqCore; RTASN1ALLOCATION Allocation; uint32_t cItems; RT_CONCAT(P,a_ItemType) paItems; } a_SeqOfType; typedef a_SeqOfType *P##a_SeqOfType, const *PC##a_SeqOfType; int a_ImplExtNm##_DecodeAsn1(struct RTASN1CURSOR *pCursor, uint32_t fFlags, P##a_SeqOfType pThis, const char *pszErrorTag); int a_ImplExtNm##_Compare(PC##a_SeqOfType pLeft, PC##a_SeqOfType pRight)
|
---|
605 | #define RTASN1_IMPL_GEN_SET_OF_TYPEDEFS_AND_PROTOS(a_SetOfType, a_ItemType, a_DeclMacro, a_ImplExtNm) typedef struct a_SetOfType { RTASN1SETCORE SetCore; RTASN1ALLOCATION Allocation; uint32_t cItems; RT_CONCAT(P,a_ItemType) paItems; } a_SetOfType; typedef a_SetOfType *P##a_SetOfType, const *PC##a_SetOfType; int a_ImplExtNm##_DecodeAsn1(struct RTASN1CURSOR *pCursor, uint32_t fFlags, P##a_SetOfType pThis, const char *pszErrorTag); int a_ImplExtNm##_Compare(PC##a_SetOfType pLeft, PC##a_SetOfType pRight)
|
---|
606 | #define RTASN1TYPE_STANDARD_PROTOTYPES_NO_GET_CORE(a_TypeNm, a_DeclMacro, a_ImplExtNm) int a_ImplExtNm##_Init(P##a_TypeNm pThis, PCRTASN1ALLOCATORVTABLE pAllocator); int a_ImplExtNm##_Clone(P##a_TypeNm pThis, PC##a_TypeNm) pSrc, PCRTASN1ALLOCATORVTABLE pAllocator); void a_ImplExtNm##_Delete(P##a_TypeNm pThis); int a_ImplExtNm##_Enum(P##a_TypeNm pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser); int a_ImplExtNm##_Compare(PC##a_TypeNm) pLeft, PC##a_TypeNm pRight); int a_ImplExtNm##_DecodeAsn1(PRTASN1CURSOR pCursor, uint32_t fFlags, P##a_TypeNm pThis, const char *pszErrorTag); int a_ImplExtNm##_CheckSanity(PC##a_TypeNm pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag)
|
---|
607 | #define RTASN1TYPE_STANDARD_PROTOTYPES(a_TypeNm, a_DeclMacro, a_ImplExtNm, a_Asn1CoreNm) inline PRTASN1CORE a_ImplExtNm##_GetAsn1Core(PC##a_TypeNm pThis) { return (PRTASN1CORE)&pThis->a_Asn1CoreNm; } inline bool a_ImplExtNm##_IsPresent(PC##a_TypeNm pThis) { return pThis && RTASN1CORE_IS_PRESENT(&pThis->a_Asn1CoreNm); } RTASN1TYPE_STANDARD_PROTOTYPES_NO_GET_CORE(a_TypeNm, a_DeclMacro, a_ImplExtNm)
|
---|
608 |
|
---|
609 | #define RTLDRELF_NAME(name) rtldrELF64##name
|
---|
610 | #define RTLDRELF_SUFF(name) name##64
|
---|
611 | #define RTLDRELF_MID(pre,suff) pre##64##suff
|
---|
612 |
|
---|
613 | #define BS3_DECL(type) type
|
---|
614 | #define BS3_DECL_CALLBACK(type) type
|
---|
615 | #define TMPL_NM(name) name##_mmm
|
---|
616 | #define TMPL_FAR_NM(name) name##_mmm_far
|
---|
617 | #define BS3_CMN_NM(name) name
|
---|
618 | #define BS3_CMN_FAR_NM(name) name
|
---|
619 | #define BS3_CMN_FN_NM(name) name
|
---|
620 | #define BS3_DATA_NM(name) name
|
---|
621 | #define BS3_FAR
|
---|
622 | #define BS3_FAR_CODE
|
---|
623 | #define BS3_FAR_DATA
|
---|
624 | #define BS3_NEAR
|
---|
625 | #define BS3_NEAR_CODE
|
---|
626 | #define BS3_CMN_PROTO_STUB(a_RetType, a_Name, a_Params) a_RetType a_Name a_Params
|
---|
627 | #define BS3_CMN_PROTO_NOSB(a_RetType, a_Name, a_Params) a_RetType a_Name a_Params
|
---|
628 | #define BS3_CMN_DEF( a_RetType, a_Name, a_Params) a_RetType a_Name a_Params
|
---|
629 | #define BS3_MODE_PROTO_STUB(a_RetType, a_Name, a_Params) \
|
---|
630 | a_RetType a_Name##_mmm a_Params; \
|
---|
631 | a_RetType a_Name##_mmm_far a_Params; \
|
---|
632 | a_RetType a_Name##_rm a_Params; \
|
---|
633 | a_RetType a_Name##_pe16 a_Params; \
|
---|
634 | a_RetType a_Name##_pe16_32 a_Params; \
|
---|
635 | a_RetType a_Name##_pe16_v86 a_Params; \
|
---|
636 | a_RetType a_Name##_pe32 a_Params; \
|
---|
637 | a_RetType a_Name##_pe32_16 a_Params; \
|
---|
638 | a_RetType a_Name##_pev86 a_Params; \
|
---|
639 | a_RetType a_Name##_pp16 a_Params; \
|
---|
640 | a_RetType a_Name##_pp16_32 a_Params; \
|
---|
641 | a_RetType a_Name##_pp16_v86 a_Params; \
|
---|
642 | a_RetType a_Name##_pp32 a_Params; \
|
---|
643 | a_RetType a_Name##_pp32_16 a_Params; \
|
---|
644 | a_RetType a_Name##_ppv86 a_Params; \
|
---|
645 | a_RetType a_Name##_pae16 a_Params; \
|
---|
646 | a_RetType a_Name##_pae16_32 a_Params; \
|
---|
647 | a_RetType a_Name##_pae16_v86 a_Params; \
|
---|
648 | a_RetType a_Name##_pae32 a_Params; \
|
---|
649 | a_RetType a_Name##_pae32_16 a_Params; \
|
---|
650 | a_RetType a_Name##_paev86 a_Params; \
|
---|
651 | a_RetType a_Name##_lm16 a_Params; \
|
---|
652 | a_RetType a_Name##_lm32 a_Params; \
|
---|
653 | a_RetType a_Name##_lm64 a_Params; \
|
---|
654 | a_RetType a_Name##_rm_far a_Params; \
|
---|
655 | a_RetType a_Name##_pe16_far a_Params; \
|
---|
656 | a_RetType a_Name##_pe16_v86_far a_Params; \
|
---|
657 | a_RetType a_Name##_pe32_16_far a_Params; \
|
---|
658 | a_RetType a_Name##_pev86_far a_Params; \
|
---|
659 | a_RetType a_Name##_pp16_far a_Params; \
|
---|
660 | a_RetType a_Name##_pp16_v86_far a_Params; \
|
---|
661 | a_RetType a_Name##_pp32_16_far a_Params; \
|
---|
662 | a_RetType a_Name##_ppv86_far a_Params; \
|
---|
663 | a_RetType a_Name##_pae16_far a_Params; \
|
---|
664 | a_RetType a_Name##_pae16_v86_far a_Params; \
|
---|
665 | a_RetType a_Name##_pae32_16_far a_Params; \
|
---|
666 | a_RetType a_Name##_paev86_far a_Params; \
|
---|
667 | a_RetType a_Name##_lm16_far a_Params
|
---|
668 | #define BS3_MODE_PROTO_NOSB(a_RetType, a_Name, a_Params) \
|
---|
669 | a_RetType a_Name##_mmm a_Params; \
|
---|
670 | a_RetType a_Name##_mmm_far a_Params; \
|
---|
671 | a_RetType a_Name##_rm a_Params; \
|
---|
672 | a_RetType a_Name##_pe16 a_Params; \
|
---|
673 | a_RetType a_Name##_pe16_32 a_Params; \
|
---|
674 | a_RetType a_Name##_pe16_v86 a_Params; \
|
---|
675 | a_RetType a_Name##_pe32 a_Params; \
|
---|
676 | a_RetType a_Name##_pe32_16 a_Params; \
|
---|
677 | a_RetType a_Name##_pev86 a_Params; \
|
---|
678 | a_RetType a_Name##_pp16 a_Params; \
|
---|
679 | a_RetType a_Name##_pp16_32 a_Params; \
|
---|
680 | a_RetType a_Name##_pp16_v86 a_Params; \
|
---|
681 | a_RetType a_Name##_pp32 a_Params; \
|
---|
682 | a_RetType a_Name##_pp32_16 a_Params; \
|
---|
683 | a_RetType a_Name##_ppv86 a_Params; \
|
---|
684 | a_RetType a_Name##_pae16 a_Params; \
|
---|
685 | a_RetType a_Name##_pae16_32 a_Params; \
|
---|
686 | a_RetType a_Name##_pae16_v86 a_Params; \
|
---|
687 | a_RetType a_Name##_pae32 a_Params; \
|
---|
688 | a_RetType a_Name##_pae32_16 a_Params; \
|
---|
689 | a_RetType a_Name##_paev86 a_Params; \
|
---|
690 | a_RetType a_Name##_lm16 a_Params; \
|
---|
691 | a_RetType a_Name##_lm32 a_Params; \
|
---|
692 | a_RetType a_Name##_lm64 a_Params; \
|
---|
693 | a_RetType a_Name##_rm_far a_Params; \
|
---|
694 | a_RetType a_Name##_pe16_far a_Params; \
|
---|
695 | a_RetType a_Name##_pe16_v86_far a_Params; \
|
---|
696 | a_RetType a_Name##_pe32_16_far a_Params; \
|
---|
697 | a_RetType a_Name##_pev86_far a_Params; \
|
---|
698 | a_RetType a_Name##_pp16_far a_Params; \
|
---|
699 | a_RetType a_Name##_pp16_v86_far a_Params; \
|
---|
700 | a_RetType a_Name##_pp32_16_far a_Params; \
|
---|
701 | a_RetType a_Name##_ppv86_far a_Params; \
|
---|
702 | a_RetType a_Name##_pae16_far a_Params; \
|
---|
703 | a_RetType a_Name##_pae16_v86_far a_Params; \
|
---|
704 | a_RetType a_Name##_pae32_16_far a_Params; \
|
---|
705 | a_RetType a_Name##_paev86_far a_Params; \
|
---|
706 | a_RetType a_Name##_lm16_far a_Params
|
---|
707 | #define BS3_MODE_EXPAND_EXTERN_DATA16(a_VarType, a_VarName, a_Suffix) \
|
---|
708 | extern a_VarType a_VarName##_rm a_Suffix; \
|
---|
709 | extern a_VarType a_VarName##_pe16 a_Suffix; \
|
---|
710 | extern a_VarType a_VarName##_pe16_32 a_Suffix; \
|
---|
711 | extern a_VarType a_VarName##_pe16_v86 a_Suffix; \
|
---|
712 | extern a_VarType a_VarName##_pe32 a_Suffix; \
|
---|
713 | extern a_VarType a_VarName##_pe32_16 a_Suffix; \
|
---|
714 | extern a_VarType a_VarName##_pev86 a_Suffix; \
|
---|
715 | extern a_VarType a_VarName##_pp16 a_Suffix; \
|
---|
716 | extern a_VarType a_VarName##_pp16_32 a_Suffix; \
|
---|
717 | extern a_VarType a_VarName##_pp16_v86 a_Suffix; \
|
---|
718 | extern a_VarType a_VarName##_pp32 a_Suffix; \
|
---|
719 | extern a_VarType a_VarName##_pp32_16 a_Suffix; \
|
---|
720 | extern a_VarType a_VarName##_ppv86 a_Suffix; \
|
---|
721 | extern a_VarType a_VarName##_pae16 a_Suffix; \
|
---|
722 | extern a_VarType a_VarName##_pae16_32 a_Suffix; \
|
---|
723 | extern a_VarType a_VarName##_pae16_v86 a_Suffix; \
|
---|
724 | extern a_VarType a_VarName##_pae32 a_Suffix; \
|
---|
725 | extern a_VarType a_VarName##_pae32_16 a_Suffix; \
|
---|
726 | extern a_VarType a_VarName##_paev86 a_Suffix; \
|
---|
727 | extern a_VarType a_VarName##_lm16 a_Suffix; \
|
---|
728 | extern a_VarType a_VarName##_lm32 a_Suffix; \
|
---|
729 | extern a_VarType a_VarName##_lm64 a_Suffix
|
---|
730 |
|
---|
731 | EOF
|
---|
732 |
|
---|
733 | MY_HDR_FILES=` echo ${MY_ROOT_DIR}/include/VBox/*.h ${MY_ROOT_DIR}/include/VBox/vmm/*.h \
|
---|
734 | | ${MY_SED} -e 's,${MY_ROOT_DIR}/include/VBox/err.h,,' `
|
---|
735 | MY_HDR_FILES="${MY_HDR_FILES} ${MY_ROOT_DIR}/include/iprt/cdefs.h"
|
---|
736 | ${MY_SED} \
|
---|
737 | -e '/__cdecl/d' \
|
---|
738 | -e '/^ *# *define.*DECL/!d' \
|
---|
739 | -e '/DECLS/d' \
|
---|
740 | -e '/DECLARE_CLS_/d' \
|
---|
741 | -e '/_SRC_POS_DECL/d' \
|
---|
742 | -e '/declspec/d' \
|
---|
743 | -e '/__attribute__/d' \
|
---|
744 | -e 's/# */#/g' \
|
---|
745 | -e 's/ */ /g' \
|
---|
746 | -e '/ DECLEXPORT_CLASS/d' \
|
---|
747 | -e 's/ *VBOXCALL//' \
|
---|
748 | -e 's/ *RTCALL//' \
|
---|
749 | -e '/ DECLASM(type) type/d' \
|
---|
750 | -e '/define *DECL..CALLBACKMEMBER(type[^)]*) *RT/d' \
|
---|
751 | -e '/define *DECLINLINE(type)/d' \
|
---|
752 | -e '/define *DECL_FORCE_INLINE(type)/d' \
|
---|
753 | -e '/ *DECL_INVALID(/d' \
|
---|
754 | \
|
---|
755 | -e 's/(type) DECLHIDDEN(type)/(type) type/' \
|
---|
756 | -e 's/(type) DECLEXPORT(type)/(type) type/' \
|
---|
757 | -e 's/(type) DECLIMPORT(type)/(type) type/' \
|
---|
758 | -e 's/(type) DECL_HIDDEN_NOTHROW(type)/(type) type/' \
|
---|
759 | -e 's/(type) DECL_EXPORT_NOTHROW(type)/(type) type/' \
|
---|
760 | -e 's/(type) DECL_IMPORT_NOTHROW(type)/(type) type/' \
|
---|
761 | -e 's/(a_Type) DECLHIDDEN(a_Type)/(a_Type) a_Type/' \
|
---|
762 | -e 's/(a_Type) DECLEXPORT(a_Type)/(a_Type) a_Type/' \
|
---|
763 | -e 's/(a_Type) DECLIMPORT(a_Type)/(a_Type) a_Type/' \
|
---|
764 | -e 's/(a_Type) DECL_HIDDEN_NOTHROW(a_Type)/(a_Type) a_Type/' \
|
---|
765 | -e 's/(a_Type) DECL_EXPORT_NOTHROW(a_Type)/(a_Type) a_Type/' \
|
---|
766 | -e 's/(a_Type) DECL_IMPORT_NOTHROW(a_Type)/(a_Type) a_Type/' \
|
---|
767 | \
|
---|
768 | --append "${MY_FILE}" \
|
---|
769 | ${MY_HDR_FILES}
|
---|
770 |
|
---|
771 | ${MY_CAT} "${MY_FILE}" \
|
---|
772 | | ${MY_SED} -e 's/_/\x1F/g' -e 's/(/\x1E/g' -e 's/[[:space:]][[:space:]]*/\x1C/g' \
|
---|
773 | | ${MY_SED} -e 's/\x1F/_/g' -e 's/\x1E/(/g' -e 's/\x1C/ /g' \
|
---|
774 | | ${MY_SORT} \
|
---|
775 | | ${MY_SED} -e '/#define/s/$/ \/\/ vbox/' --output "${MY_FILE}.2"
|
---|
776 |
|
---|
777 | # Eliminate duplicates.
|
---|
778 | > "${MY_FILE}.3"
|
---|
779 | exec < "${MY_FILE}.2"
|
---|
780 | MY_PREV_DEFINE=""
|
---|
781 | while read MY_LINE;
|
---|
782 | do
|
---|
783 | MY_DEFINE=`echo "${MY_LINE}" | ${MY_SED} -e 's/^#define \([^ ()]*\).*$/\1/' `
|
---|
784 | if test "${MY_DEFINE}" != "${MY_PREV_DEFINE}"; then
|
---|
785 | MY_PREV_DEFINE=${MY_DEFINE}
|
---|
786 | echo "${MY_LINE}" >> "${MY_FILE}.3"
|
---|
787 | fi
|
---|
788 | done
|
---|
789 |
|
---|
790 | # Append non-vbox bits from the current user config.
|
---|
791 | if test -n "${MY_USERCPP_H_FULL}" -a -f "${MY_USERCPP_H_FULL}"; then
|
---|
792 | ${MY_SED} -e '/ \/\/ vbox$/d' -e '/^[[:space:]]*$/d' --append "${MY_FILE}.3" "${MY_USERCPP_H_FULL}"
|
---|
793 | fi
|
---|
794 |
|
---|
795 | # Finalize the file (sort + blank lines).
|
---|
796 | ${MY_CAT} "${MY_FILE}.3" \
|
---|
797 | | ${MY_SED} -e 's/$/\n/' --output "${MY_FILE}"
|
---|
798 | ${MY_RM} -f "${MY_FILE}.2" "${MY_FILE}.3"
|
---|
799 |
|
---|
800 | # Install it.
|
---|
801 | if test -n "${MY_USERCPP_H_FULL}" -a -d "${MY_SLICKDIR}"; then
|
---|
802 | if test -f "${MY_USERCPP_H_FULL}"; then
|
---|
803 | ${MY_MV} -vf "${MY_USERCPP_H_FULL}" "${MY_USERCPP_H_FULL}.bak"
|
---|
804 | ${MY_CP} "${MY_FILE}" "${MY_USERCPP_H_FULL}"
|
---|
805 | echo "Updated the SlickEdit preprocessor file. (Previous version renamed to .bak.)"
|
---|
806 | else
|
---|
807 | ${MY_CP} "${MY_FILE}" "${MY_USERCPP_H_FULL}"
|
---|
808 | echo "Created the SlickEdit preprocessor file."
|
---|
809 | fi
|
---|
810 | fi
|
---|
811 | }
|
---|
812 |
|
---|
813 | ###### end of functions ####
|
---|
814 |
|
---|
815 |
|
---|
816 | #
|
---|
817 | # Parse arguments.
|
---|
818 | #
|
---|
819 | while test $# -ge 1;
|
---|
820 | do
|
---|
821 | ARG=$1
|
---|
822 | shift
|
---|
823 | case "$ARG" in
|
---|
824 |
|
---|
825 | --rootdir)
|
---|
826 | if test $# -eq 0; then
|
---|
827 | echo "error: missing --rootdir argument." 1>&2
|
---|
828 | exit 1;
|
---|
829 | fi
|
---|
830 | MY_ROOT_DIR="$1"
|
---|
831 | shift
|
---|
832 | ;;
|
---|
833 |
|
---|
834 | --outdir)
|
---|
835 | if test $# -eq 0; then
|
---|
836 | echo "error: missing --outdir argument." 1>&2
|
---|
837 | exit 1;
|
---|
838 | fi
|
---|
839 | MY_OUT_DIR="$1"
|
---|
840 | shift
|
---|
841 | ;;
|
---|
842 |
|
---|
843 | --project-base)
|
---|
844 | if test $# -eq 0; then
|
---|
845 | echo "error: missing --project-base argument." 1>&2
|
---|
846 | exit 1;
|
---|
847 | fi
|
---|
848 | MY_PRJ_PRF="$1"
|
---|
849 | shift
|
---|
850 | ;;
|
---|
851 |
|
---|
852 | --workspace)
|
---|
853 | if test $# -eq 0; then
|
---|
854 | echo "error: missing --workspace argument." 1>&2
|
---|
855 | exit 1;
|
---|
856 | fi
|
---|
857 | MY_WS_NAME="$1"
|
---|
858 | shift
|
---|
859 | ;;
|
---|
860 |
|
---|
861 | --windows-host)
|
---|
862 | MY_WINDOWS_HOST=1
|
---|
863 | ;;
|
---|
864 |
|
---|
865 | --minimal)
|
---|
866 | MY_OPT_MINIMAL=1
|
---|
867 | ;;
|
---|
868 |
|
---|
869 | --slickedit-config)
|
---|
870 | MY_SLICK_CONFIG="$1"
|
---|
871 | shift
|
---|
872 | ;;
|
---|
873 |
|
---|
874 | # usage
|
---|
875 | --h*|-h*|-?|--?)
|
---|
876 | echo "usage: $0 [--rootdir <rootdir>] [--outdir <outdir>] [--project-base <prefix>] [--workspace <name>] [--minimal] [--slickedit-config <DIR>]"
|
---|
877 | echo ""
|
---|
878 | echo "If --outdir is specified, you must specify a --rootdir relative to it as well."
|
---|
879 | exit 1;
|
---|
880 | ;;
|
---|
881 |
|
---|
882 | # default
|
---|
883 | *)
|
---|
884 | echo "error: Invalid parameter '$ARG'" 1>&2
|
---|
885 | exit 1;
|
---|
886 |
|
---|
887 | esac
|
---|
888 | done
|
---|
889 |
|
---|
890 |
|
---|
891 | #
|
---|
892 | # From now on everything *MUST* succeed.
|
---|
893 | #
|
---|
894 | set -e
|
---|
895 |
|
---|
896 |
|
---|
897 | #
|
---|
898 | # Make sure the output directory exists, is valid and clean.
|
---|
899 | #
|
---|
900 | ${MY_RM} -f \
|
---|
901 | "${MY_OUT_DIR}/${MY_PRJ_PRF}"*.vpj \
|
---|
902 | "${MY_OUT_DIR}/${MY_WS_NAME}" \
|
---|
903 | "${MY_OUT_DIR}/`echo ${MY_WS_NAME} | ${MY_SED} -e 's/\.vpw$/.vtg/'`"
|
---|
904 | ${MY_MKDIR} -p "${MY_OUT_DIR}"
|
---|
905 | cd "${MY_OUT_DIR}"
|
---|
906 |
|
---|
907 |
|
---|
908 | #
|
---|
909 | # Determine the invocation to conjure up kmk.
|
---|
910 | #
|
---|
911 | my_abs_dir "tools"
|
---|
912 | if test -n "${MY_WINDOWS_HOST}"; then
|
---|
913 | MY_KMK_INVOCATION="cscript.exe /Nologo ${MY_ABS_DIR}/envSub.vbs --quiet -- kmk.exe"
|
---|
914 | else
|
---|
915 | MY_KMK_INVOCATION="/usr/bin/env LANG=C ${MY_ABS_DIR}/env.sh --quiet --no-wine kmk"
|
---|
916 | fi
|
---|
917 |
|
---|
918 |
|
---|
919 | #
|
---|
920 | # Generate the projects (common code) and workspace.
|
---|
921 | #
|
---|
922 | my_generate_all_projects # in common-gen-workspace-projects.inc.sh
|
---|
923 | my_generate_workspace
|
---|
924 |
|
---|
925 |
|
---|
926 | #
|
---|
927 | # Update the history file if present.
|
---|
928 | #
|
---|
929 | MY_FILE="${MY_WS_NAME}histu"
|
---|
930 | if test -f "${MY_FILE}"; then
|
---|
931 | echo "Updating ${MY_FILE}..."
|
---|
932 | ${MY_MV} -f "${MY_FILE}" "${MY_FILE}.old"
|
---|
933 | ${MY_SED} -n \
|
---|
934 | -e '/PROJECT_CACHE/d' \
|
---|
935 | -e '/\[TreeExpansion2\]/d' \
|
---|
936 | -e '/^\[/p' \
|
---|
937 | -e '/: /p' \
|
---|
938 | -e '/^CurrentProject/p' \
|
---|
939 | "${MY_FILE}.old" > "${MY_FILE}"
|
---|
940 | fi
|
---|
941 |
|
---|
942 |
|
---|
943 | #
|
---|
944 | # Generate and update the usercpp.h/unxcpp.h file.
|
---|
945 | #
|
---|
946 | my_generate_usercpp_h
|
---|
947 |
|
---|
948 |
|
---|
949 | echo "done"
|
---|