1 | # !kmk_ash
|
---|
2 | # $Id: gen-slickedit-workspace.sh 43632 2012-10-12 12:11:01Z vboxsync $
|
---|
3 | ## @file
|
---|
4 | # Script for generating a SlickEdit workspace.
|
---|
5 | #
|
---|
6 |
|
---|
7 | #
|
---|
8 | # Copyright (C) 2009-2011 Oracle Corporation
|
---|
9 | #
|
---|
10 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | # available from http://www.virtualbox.org. This file is free software;
|
---|
12 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | # General Public License (GPL) as published by the Free Software
|
---|
14 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | #
|
---|
18 |
|
---|
19 | #
|
---|
20 | # Some constants.
|
---|
21 | #
|
---|
22 | MY_CAT="kmk_cat"
|
---|
23 | MY_CP="kmk_cp"
|
---|
24 | MY_MKDIR="kmk_mkdir"
|
---|
25 | MY_MV="kmk_mv"
|
---|
26 | MY_SED="kmk_sed"
|
---|
27 | MY_RM="kmk_rm"
|
---|
28 | MY_SLEEP="kmk_sleep"
|
---|
29 | MY_EXPR="kmk_expr"
|
---|
30 | MY_SVN="svn"
|
---|
31 |
|
---|
32 | #MY_SORT="kmk_cat"
|
---|
33 | MY_SORT="sort"
|
---|
34 |
|
---|
35 | #
|
---|
36 | # Globals.
|
---|
37 | #
|
---|
38 | MY_PROJECT_FILES=""
|
---|
39 | MY_OUT_DIRS="\
|
---|
40 | out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/${KBUILD_TYPE} \
|
---|
41 | out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/${BUILD_TYPE} \
|
---|
42 | out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/debug \
|
---|
43 | out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/debug \
|
---|
44 | out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/release \
|
---|
45 | out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/release \
|
---|
46 | out/linux.amd64/debug \
|
---|
47 | out/linux.x86/debug \
|
---|
48 | out/win.amd64/debug \
|
---|
49 | out/win.x86/debug \
|
---|
50 | out/darwin.amd64/debug \
|
---|
51 | out/darwin.x86/debug \
|
---|
52 | out/haiku.amd64/debug \
|
---|
53 | out/haiku.x86/debug \
|
---|
54 | out/solaris.amd64/debug \
|
---|
55 | out/solaris.x86/debug";
|
---|
56 |
|
---|
57 |
|
---|
58 | #
|
---|
59 | # Parameters w/ defaults.
|
---|
60 | #
|
---|
61 | MY_ROOT_DIR=".."
|
---|
62 | MY_OUT_DIR="SlickEdit"
|
---|
63 | MY_PRJ_PRF="VBox-"
|
---|
64 | MY_WS_NAME="VirtualBox.vpw"
|
---|
65 | MY_DBG=""
|
---|
66 | MY_WINDOWS_HOST=""
|
---|
67 | MY_OPT_MINIMAL=""
|
---|
68 | MY_OPT_USE_WILDCARDS="yes"
|
---|
69 |
|
---|
70 | #MY_KBUILD_PATH="${KBUILD_PATH}"
|
---|
71 | #test -z "${MY_KBUILD_PATH}" && MY_KBUILD_PATH="${PATH_KBUILD}"
|
---|
72 | #MY_KBUILD=""
|
---|
73 |
|
---|
74 |
|
---|
75 | ##
|
---|
76 | # Gets the absolute path to an existing directory.
|
---|
77 | #
|
---|
78 | # @param $1 The path.
|
---|
79 | my_abs_dir()
|
---|
80 | {
|
---|
81 | if test -n "${PWD}"; then
|
---|
82 | MY_ABS_DIR=`cd ${MY_ROOT_DIR}/${1} && echo ${PWD}`
|
---|
83 | else
|
---|
84 | # old cygwin shell has no PWD and need adjusting.
|
---|
85 | MY_ABS_DIR=`cd ${MY_ROOT_DIR}/${1} && pwd | ${MY_SED} -e 's,^/cygdrive/\(.\)/,\1:/,'`
|
---|
86 | fi
|
---|
87 | if test -z "${MY_ABS_DIR}"; then
|
---|
88 | MY_ABS_DIR="${1}"
|
---|
89 | fi
|
---|
90 | }
|
---|
91 |
|
---|
92 | ##
|
---|
93 | # Gets the file name part of a path.
|
---|
94 | #
|
---|
95 | # @param $1 The path.
|
---|
96 | my_get_name()
|
---|
97 | {
|
---|
98 | SAVED_IFS=$IFS
|
---|
99 | IFS=":/ "
|
---|
100 | set $1
|
---|
101 | while test $# -gt 1 -a -n "${2}";
|
---|
102 | do
|
---|
103 | shift;
|
---|
104 | done
|
---|
105 |
|
---|
106 | IFS=$SAVED_IFS
|
---|
107 | #echo "$1"
|
---|
108 | export MY_GET_NAME=$1
|
---|
109 | }
|
---|
110 |
|
---|
111 | ##
|
---|
112 | # Generate file entry for the specified file if it was found to be of interest.
|
---|
113 | #
|
---|
114 | # @param $1 The output file name base.
|
---|
115 | # @param $2 The file name.
|
---|
116 | # @param $3 Optional folder override.
|
---|
117 | my_file()
|
---|
118 | {
|
---|
119 | # sort and filter by file type.
|
---|
120 | case "$2" in
|
---|
121 | # drop these.
|
---|
122 | *.kup|*~|*.pyc|*.exe|*.sys|*.dll|*.o|*.obj|*.lib|*.a|*.ko)
|
---|
123 | return 0
|
---|
124 | ;;
|
---|
125 |
|
---|
126 | # by prefix or directory component.
|
---|
127 | tst*|*/testcase/*)
|
---|
128 | MY_FOLDER="$1-Testcases.lst"
|
---|
129 | ;;
|
---|
130 |
|
---|
131 | # by extension.
|
---|
132 | *.c|*.cpp|*.m|*.mm|*.pl|*.py|*.as|*.c.h|*.cpp.h|*.java)
|
---|
133 | MY_FOLDER="$1-Sources.lst"
|
---|
134 | ;;
|
---|
135 |
|
---|
136 | *.h|*.hpp|*.mm)
|
---|
137 | MY_FOLDER="$1-Headers.lst"
|
---|
138 | ;;
|
---|
139 |
|
---|
140 | *.asm|*.s|*.S|*.inc|*.mac)
|
---|
141 | MY_FOLDER="$1-Assembly.lst"
|
---|
142 | ;;
|
---|
143 |
|
---|
144 | *)
|
---|
145 | MY_FOLDER="$1-Others.lst"
|
---|
146 | ;;
|
---|
147 | esac
|
---|
148 | if test -n "$3";
|
---|
149 | then
|
---|
150 | MY_FOLDER="$1-$3.lst"
|
---|
151 | fi
|
---|
152 |
|
---|
153 | ## @todo only files which are in subversion.
|
---|
154 | # if ${MY_SVN} info "${2}" > /dev/null 2>&1; then
|
---|
155 | my_get_name "${2}"
|
---|
156 | echo ' <!-- sortkey: '"${MY_GET_NAME}"' --> <F N="'"${2}"'"/>' >> "${MY_FOLDER}"
|
---|
157 | # fi
|
---|
158 | }
|
---|
159 |
|
---|
160 | ##
|
---|
161 | # Generate file entry for the specified file if it was found to be of interest.
|
---|
162 | #
|
---|
163 | # @param $1 The output file name base.
|
---|
164 | # @param $2 The wildcard spec.
|
---|
165 | my_wildcard()
|
---|
166 | {
|
---|
167 | EXCLUDES="*.log;*.kup;*~;*.pyc;*.exe;*.sys;*.dll;*.o;*.obj;*.lib;*.a;*.ko;*.class;.svn/*"
|
---|
168 | echo ' <F N="'"${2}"'/*" Recurse="1" Excludes="'"${EXCLUDES}"'"/>' >> "$1-All.lst"
|
---|
169 | }
|
---|
170 |
|
---|
171 | ##
|
---|
172 | # Generate file entries for the specified sub-directory tree.
|
---|
173 | #
|
---|
174 | # @param $1 The output filename.
|
---|
175 | # @param $2 The sub-directory.
|
---|
176 | # @param $3 Optional folder override.
|
---|
177 | my_sub_tree()
|
---|
178 | {
|
---|
179 | if test -n "$MY_DBG"; then echo "dbg: my_sub_tree: ${2}"; fi
|
---|
180 |
|
---|
181 | # Skip .svn directories.
|
---|
182 | case "$2" in
|
---|
183 | */.svn|*/.svn)
|
---|
184 | return 0
|
---|
185 | ;;
|
---|
186 | esac
|
---|
187 |
|
---|
188 | # Process the files in the directory.
|
---|
189 | for f in $2/*;
|
---|
190 | do
|
---|
191 | if test -d "${f}";
|
---|
192 | then
|
---|
193 | my_sub_tree "${1}" "${f}" "${3}"
|
---|
194 | else
|
---|
195 | my_file "${1}" "${f}" "${3}"
|
---|
196 | fi
|
---|
197 | done
|
---|
198 | return 0;
|
---|
199 | }
|
---|
200 |
|
---|
201 |
|
---|
202 | ##
|
---|
203 | # Generate folders for the specified directories and files.
|
---|
204 | #
|
---|
205 | # @param $1 The output (base) file name.
|
---|
206 | # @param $2+ The files and directories to traverse.
|
---|
207 | my_generate_folder()
|
---|
208 | {
|
---|
209 | MY_FILE="$1"
|
---|
210 | shift
|
---|
211 |
|
---|
212 | # Zap existing file collections.
|
---|
213 | > "${MY_FILE}-All.lst"
|
---|
214 | > "${MY_FILE}-Sources.lst"
|
---|
215 | > "${MY_FILE}-Headers.lst"
|
---|
216 | > "${MY_FILE}-Assembly.lst"
|
---|
217 | > "${MY_FILE}-Testcases.lst"
|
---|
218 | > "${MY_FILE}-Others.lst"
|
---|
219 |
|
---|
220 | # Traverse the directories and files.
|
---|
221 | while test $# -ge 1 -a -n "${1}";
|
---|
222 | do
|
---|
223 | for f in ${MY_ROOT_DIR}/$1;
|
---|
224 | do
|
---|
225 | if test -d "${f}";
|
---|
226 | then
|
---|
227 | if test -z "${MY_OPT_USE_WILDCARDS}";
|
---|
228 | then
|
---|
229 | my_sub_tree "${MY_FILE}" "${f}"
|
---|
230 | else
|
---|
231 | case "${f}" in
|
---|
232 | ${MY_ROOT_DIR}/include*)
|
---|
233 | my_sub_tree "${MY_FILE}" "${f}" "Headers"
|
---|
234 | ;;
|
---|
235 | *) my_wildcard "${MY_FILE}" "${f}"
|
---|
236 | ;;
|
---|
237 | esac
|
---|
238 | fi
|
---|
239 | else
|
---|
240 | my_file "${MY_FILE}" "${f}"
|
---|
241 | fi
|
---|
242 | done
|
---|
243 | shift
|
---|
244 | done
|
---|
245 |
|
---|
246 | # Generate the folders.
|
---|
247 | if test -s "${MY_FILE}-All.lst";
|
---|
248 | then
|
---|
249 | ${MY_SORT} "${MY_FILE}-All.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
250 | fi
|
---|
251 | if test -s "${MY_FILE}-Sources.lst";
|
---|
252 | then
|
---|
253 | echo ' <Folder Name="Sources" Filters="*.c;*.cpp;*.cpp.h;*.c.h;*.m;*.mm;*.pl;*.py;*.as">' >> "${MY_FILE}"
|
---|
254 | ${MY_SORT} "${MY_FILE}-Sources.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
255 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
256 | fi
|
---|
257 | if test -s "${MY_FILE}-Headers.lst";
|
---|
258 | then
|
---|
259 | if test -z "${MY_OPT_USE_WILDCARDS}";
|
---|
260 | then
|
---|
261 | echo ' <Folder Name="Headers" Filters="*.h;*.hpp">' >> "${MY_FILE}"
|
---|
262 | else
|
---|
263 | echo ' <Folder Name="Headers" Filters="">' >> "${MY_FILE}"
|
---|
264 | fi
|
---|
265 | ${MY_SORT} "${MY_FILE}-Headers.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
266 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
267 | fi
|
---|
268 | if test -s "${MY_FILE}-Assembly.lst";
|
---|
269 | then
|
---|
270 | echo ' <Folder Name="Assembly" Filters="*.asm;*.s;*.S;*.inc;*.mac">' >> "${MY_FILE}"
|
---|
271 | ${MY_SORT} "${MY_FILE}-Assembly.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
272 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
273 | fi
|
---|
274 | if test -s "${MY_FILE}-Testcases.lst";
|
---|
275 | then
|
---|
276 | echo ' <Folder Name="Testcases" Filters="tst*;">' >> "${MY_FILE}"
|
---|
277 | ${MY_SORT} "${MY_FILE}-Testcases.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
278 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
279 | fi
|
---|
280 | if test -s "${MY_FILE}-Others.lst";
|
---|
281 | then
|
---|
282 | echo ' <Folder Name="Others" Filters="">' >> "${MY_FILE}"
|
---|
283 | ${MY_SORT} "${MY_FILE}-Others.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
284 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
285 | fi
|
---|
286 |
|
---|
287 | # Cleanup
|
---|
288 | ${MY_RM} "${MY_FILE}-All.lst" "${MY_FILE}-Sources.lst" "${MY_FILE}-Headers.lst" "${MY_FILE}-Assembly.lst" \
|
---|
289 | "${MY_FILE}-Testcases.lst" "${MY_FILE}-Others.lst"
|
---|
290 | }
|
---|
291 |
|
---|
292 |
|
---|
293 | ##
|
---|
294 | # Function generating a project.
|
---|
295 | #
|
---|
296 | # @param $1 The project file name.
|
---|
297 | # @param $2 The project working directory.
|
---|
298 | # @param $3 Dummy separator.
|
---|
299 | # @param $4+ Include directories.
|
---|
300 | # @param $N --end-includes
|
---|
301 | # @param $N+1 Directory sub-trees and files to include in the project.
|
---|
302 | #
|
---|
303 | my_generate_project()
|
---|
304 | {
|
---|
305 | MY_FILE="${MY_PRJ_PRF}${1}.vpj";
|
---|
306 | echo "Generating ${MY_FILE}..."
|
---|
307 | MY_WRK_DIR="${2}"
|
---|
308 | shift
|
---|
309 | shift
|
---|
310 | shift
|
---|
311 |
|
---|
312 | # Add it to the project list for workspace construction later on.
|
---|
313 | MY_PROJECT_FILES="${MY_PROJECT_FILES} ${MY_FILE}"
|
---|
314 |
|
---|
315 |
|
---|
316 | #
|
---|
317 | # Generate the head bits.
|
---|
318 | #
|
---|
319 | echo '<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">' > "${MY_FILE}"
|
---|
320 | echo '<Project' >> "${MY_FILE}"
|
---|
321 | echo ' Version="10.0"' >> "${MY_FILE}"
|
---|
322 | echo ' VendorName="SlickEdit"' >> "${MY_FILE}"
|
---|
323 | echo ' VCSProject="Subversion:"' >> "${MY_FILE}"
|
---|
324 | # echo ' Customized="1"' >> "${MY_FILE}"
|
---|
325 | # echo ' WorkingDir="."' >> "${MY_FILE}"
|
---|
326 | my_abs_dir "${MY_WRK_DIR}" >> "${MY_FILE}"
|
---|
327 | echo ' WorkingDir="'"${MY_ABS_DIR}"'"' >> "${MY_FILE}"
|
---|
328 | echo ' >' >> "${MY_FILE}"
|
---|
329 | echo ' <Config Name="Release" OutputFile="" CompilerConfigName="Latest Version">' >> "${MY_FILE}"
|
---|
330 | echo ' <Menu>' >> "${MY_FILE}"
|
---|
331 | echo ' <Target Name="Compile" MenuCaption="&Compile" CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
332 | echo ' SaveOption="SaveCurrent" RunFromDir="%p" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
333 | echo ' <Exec CmdLine="'"${MY_KMK_INVOCATION}"' -C %p %n.o"/>' >> "${MY_FILE}"
|
---|
334 | echo ' </Target>' >> "${MY_FILE}"
|
---|
335 | echo ' <Target Name="Build" MenuCaption="&Build"CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
336 | echo ' SaveOption="SaveWorkspaceFiles" RunFromDir="%rw" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
337 | echo ' <Exec CmdLine="'"${MY_KMK_INVOCATION}"' -C %rw"/>' >> "${MY_FILE}"
|
---|
338 | echo ' </Target>' >> "${MY_FILE}"
|
---|
339 | echo ' <Target Name="Rebuild" MenuCaption="&Rebuild" CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
340 | echo ' SaveOption="SaveWorkspaceFiles" RunFromDir="%rw" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
341 | echo ' <Exec CmdLine="'"${MY_KMK_INVOCATION}"' -C %rw rebuild"/>' >> "${MY_FILE}"
|
---|
342 | echo ' </Target>' >> "${MY_FILE}"
|
---|
343 | echo ' <Target Name="Debug" MenuCaption="&Debug" SaveOption="SaveNone" RunFromDir="%rw">' >> "${MY_FILE}"
|
---|
344 | echo ' <Exec/>' >> "${MY_FILE}"
|
---|
345 | echo ' </Target>' >> "${MY_FILE}"
|
---|
346 | echo ' <Target Name="Execute" MenuCaption="E&xecute" SaveOption="SaveNone" RunFromDir="%rw">' >> "${MY_FILE}"
|
---|
347 | echo ' <Exec/>' >> "${MY_FILE}"
|
---|
348 | echo ' </Target>' >> "${MY_FILE}"
|
---|
349 | echo ' </Menu>' >> "${MY_FILE}"
|
---|
350 |
|
---|
351 | #
|
---|
352 | # Include directories.
|
---|
353 | #
|
---|
354 | echo ' <Includes>' >> "${MY_FILE}"
|
---|
355 | while test $# -ge 1 -a "${1}" != "--end-includes";
|
---|
356 | do
|
---|
357 | for f in $1;
|
---|
358 | do
|
---|
359 | my_abs_dir ${f}
|
---|
360 | echo ' <Include Dir="'"${MY_ABS_DIR}/"'"/>' >> "${MY_FILE}"
|
---|
361 | done
|
---|
362 | shift
|
---|
363 | done
|
---|
364 | shift
|
---|
365 | echo ' </Includes>' >> "${MY_FILE}"
|
---|
366 | echo ' </Config>' >> "${MY_FILE}"
|
---|
367 |
|
---|
368 |
|
---|
369 | #
|
---|
370 | # Process directories+files and create folders.
|
---|
371 | #
|
---|
372 | echo ' <Files>' >> "${MY_FILE}"
|
---|
373 | my_generate_folder "${MY_FILE}" $*
|
---|
374 | echo ' </Files>' >> "${MY_FILE}"
|
---|
375 |
|
---|
376 | #
|
---|
377 | # The tail.
|
---|
378 | #
|
---|
379 | echo '</Project>' >> "${MY_FILE}"
|
---|
380 |
|
---|
381 | return 0
|
---|
382 | }
|
---|
383 |
|
---|
384 |
|
---|
385 | ##
|
---|
386 | # Generate the workspace
|
---|
387 | #
|
---|
388 | my_generate_workspace()
|
---|
389 | {
|
---|
390 | MY_FILE="${MY_WS_NAME}"
|
---|
391 | echo "Generating ${MY_FILE}..."
|
---|
392 | echo '<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">' > "${MY_FILE}"
|
---|
393 | echo '<Workspace Version="10.0" VendorName="SlickEdit">' >> "${MY_FILE}"
|
---|
394 | echo ' <Projects>' >> "${MY_FILE}"
|
---|
395 | for i in ${MY_PROJECT_FILES};
|
---|
396 | do
|
---|
397 | echo ' <Project File="'"${i}"'" />' >> "${MY_FILE}"
|
---|
398 | done
|
---|
399 | echo ' </Projects>' >> "${MY_FILE}"
|
---|
400 | echo '</Workspace>' >> "${MY_FILE}"
|
---|
401 | return 0;
|
---|
402 | }
|
---|
403 |
|
---|
404 |
|
---|
405 | ##
|
---|
406 | # Generate stuff
|
---|
407 | #
|
---|
408 | my_generate_usercpp_h()
|
---|
409 | {
|
---|
410 | #
|
---|
411 | # Probe the slickedit user config, picking the most recent version.
|
---|
412 | #
|
---|
413 | if test -z "${MY_SLICK_CONFIG}"; then
|
---|
414 | if test -d "${HOME}/Library/Application Support/Slickedit"; then
|
---|
415 | MY_SLICKDIR_="${HOME}/Library/Application Support/Slickedit"
|
---|
416 | MY_USERCPP_H="unxcpp.h"
|
---|
417 | MY_VSLICK_DB="vslick.stu"
|
---|
418 | elif test -d "${HOMEDRIVE}${HOMEPATH}/Documents/My SlickEdit Config"; then
|
---|
419 | MY_SLICKDIR_="${HOMEDRIVE}${HOMEPATH}/Documents/My SlickEdit Config"
|
---|
420 | MY_USERCPP_H="usercpp.h"
|
---|
421 | MY_VSLICK_DB="vslick.sta"
|
---|
422 | else
|
---|
423 | MY_SLICKDIR_="${HOME}/.slickedit"
|
---|
424 | MY_USERCPP_H="unxcpp.h"
|
---|
425 | MY_VSLICK_DB="vslick.stu"
|
---|
426 | fi
|
---|
427 | else
|
---|
428 | MY_SLICKDIR_="${MY_SLICK_CONFIG}"
|
---|
429 | if test -n "${MY_WINDOWS_HOST}"; then
|
---|
430 | MY_USERCPP_H="usercpp.h"
|
---|
431 | MY_VSLICK_DB="vslick.sta"
|
---|
432 | else
|
---|
433 | MY_USERCPP_H="unxcpp.h"
|
---|
434 | MY_VSLICK_DB="vslick.stu"
|
---|
435 | fi
|
---|
436 | # MacOS: Implement me!
|
---|
437 | fi
|
---|
438 |
|
---|
439 | MY_VER_NUM="0"
|
---|
440 | MY_VER="0.0.0"
|
---|
441 | for subdir in "${MY_SLICKDIR_}/"*;
|
---|
442 | do
|
---|
443 | if test -f "${subdir}/${MY_USERCPP_H}" -o -f "${subdir}/${MY_VSLICK_DB}"; then
|
---|
444 | MY_CUR_VER_NUM=0
|
---|
445 | MY_CUR_VER=`echo "${subdir}" | ${MY_SED} -e 's,^.*/,,g'`
|
---|
446 |
|
---|
447 | # Convert the dotted version number to an integer, checking that
|
---|
448 | # it is all numbers in the process.
|
---|
449 | set `echo "${MY_CUR_VER}" | ${MY_SED} 's/\./ /g' `
|
---|
450 | i=100000000
|
---|
451 | while test $# -gt 0;
|
---|
452 | do
|
---|
453 | if ! ${MY_EXPR} "$1" + 1 > /dev/null 2> /dev/null; then
|
---|
454 | MY_CUR_VER_NUM=0;
|
---|
455 | break
|
---|
456 | fi
|
---|
457 | if test "$i" -gt 0; then
|
---|
458 | MY_CUR_VER_NUM=$((${MY_CUR_VER_NUM} + $1 * $i))
|
---|
459 | i=$(($i / 100))
|
---|
460 | fi
|
---|
461 | shift
|
---|
462 | done
|
---|
463 |
|
---|
464 | # More recent that what we have?
|
---|
465 | if test "${MY_CUR_VER_NUM}" -gt "${MY_VER_NUM}"; then
|
---|
466 | MY_VER_NUM="${MY_CUR_VER_NUM}"
|
---|
467 | MY_VER="${MY_CUR_VER}"
|
---|
468 | fi
|
---|
469 | fi
|
---|
470 | done
|
---|
471 |
|
---|
472 | MY_SLICKDIR="${MY_SLICKDIR_}/${MY_VER}"
|
---|
473 | MY_USERCPP_H_FULL="${MY_SLICKDIR}/${MY_USERCPP_H}"
|
---|
474 | if test -d "${MY_SLICKDIR}"; then
|
---|
475 | echo "Found SlickEdit v${MY_VER} preprocessor file: ${MY_USERCPP_H_FULL}"
|
---|
476 | else
|
---|
477 | echo "Failed to locate SlickEdit preprocessor file. You need to manually merge ${MY_USERCPP_H}."
|
---|
478 | MY_USERCPP_H_FULL=""
|
---|
479 | fi
|
---|
480 |
|
---|
481 | # Generate our
|
---|
482 | MY_FILE="${MY_USERCPP_H}"
|
---|
483 | ${MY_CAT} > ${MY_FILE} <<EOF
|
---|
484 | #define IN_SLICKEDIT
|
---|
485 | #define RT_C_DECLS_BEGIN
|
---|
486 | #define RT_C_DECLS_END
|
---|
487 | #define RT_NO_THROW
|
---|
488 | #define RT_THROW(type) throw(type)
|
---|
489 | #define RT_GCC_EXTENSION'
|
---|
490 | #define RT_COMPILER_GROKS_64BIT_BITFIELDS'
|
---|
491 | #define RT_COMPILER_WITH_80BIT_LONG_DOUBLE'
|
---|
492 |
|
---|
493 | #define ATL_NO_VTABLE
|
---|
494 | #define BEGIN_COM_MAP(a)
|
---|
495 | #define COM_INTERFACE_ENTRY(a)
|
---|
496 | #define COM_INTERFACE_ENTRY2(a,b)
|
---|
497 | #define COM_INTERFACE_ENTRY3(a,b,c)
|
---|
498 | #define COM_INTERFACE_ENTRY4(a,b,c,d)
|
---|
499 | #define END_COM_MAP(a)
|
---|
500 |
|
---|
501 | #define COM_DECL_READONLY_ENUM_AND_COLLECTION(a)
|
---|
502 | #define COMGETTER(n) n
|
---|
503 | #define COMSETTER(n) n
|
---|
504 | #define ComSafeArrayIn(t,a) t a[]
|
---|
505 | #define ComSafeArrayOut(t,a) t * a[]
|
---|
506 | #define DECLARE_CLASSFACTORY(a)
|
---|
507 | #define DECLARE_CLASSFACTORY_SINGLETON(a)
|
---|
508 | #define DECLARE_REGISTRY_RESOURCEID(a)
|
---|
509 | #define DECLARE_NOT_AGGREGATABLE(a)
|
---|
510 | #define DECLARE_PROTECT_FINAL_CONSTRUCT(a)
|
---|
511 | #define DECLARE_EMPTY_CTOR_DTOR(a) a(); ~a();
|
---|
512 | #define DEFINE_EMPTY_CTOR_DTOR(a) a::a() {} a::~a() {}
|
---|
513 | #define NS_DECL_ISUPPORTS
|
---|
514 | #define NS_IMETHOD virtual nsresult
|
---|
515 | #define NS_IMETHOD_(type) virtual type
|
---|
516 | #define NS_IMETHODIMP nsresult
|
---|
517 | #define NS_IMETHODIMP_(type) type
|
---|
518 | #define PARSERS_EXPORT
|
---|
519 | EOF
|
---|
520 | if test -n "${MY_WINDOWS_HOST}"; then
|
---|
521 | ${MY_CAT} >> ${MY_FILE} <<EOF
|
---|
522 | #define COM_STRUCT_OR_CLASS(I) struct I
|
---|
523 | #define STDMETHOD(m) virtual HRESULT m
|
---|
524 | #define STDMETHOD_(type,m) virtual type m
|
---|
525 | #define STDMETHODIMP HRESULT
|
---|
526 | #define STDMETHODIMP_(type) type
|
---|
527 | EOF
|
---|
528 | else
|
---|
529 | ${MY_CAT} >> ${MY_FILE} <<EOF
|
---|
530 | #define COM_STRUCT_OR_CLASS(I) class I
|
---|
531 | #define STDMETHOD(m) virtual nsresult m
|
---|
532 | #define STDMETHOD_(type,m) virtual type m
|
---|
533 | #define STDMETHODIMP nsresult
|
---|
534 | #define STDMETHODIMP_(type) type
|
---|
535 | EOF
|
---|
536 | fi
|
---|
537 | ${MY_CAT} >> ${MY_FILE} <<EOF
|
---|
538 | #define VBOX_SCRIPTABLE(a) public a
|
---|
539 | #define VBOX_SCRIPTABLE_IMPL(a)
|
---|
540 | #define VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(a)
|
---|
541 |
|
---|
542 | #define CTX_SUFF(var) var##R3
|
---|
543 | #define CTXAllSUFF(var) var##R3
|
---|
544 | #define CTXSUFF(var) var##HC
|
---|
545 | #define OTHERCTXSUFF(var) var##GC
|
---|
546 | #define CTXALLMID(first, last) first##R3##last
|
---|
547 | #define CTXMID(first, last) first##HC##last
|
---|
548 | #define OTHERCTXMID(first, last) first##GC##last
|
---|
549 | #define CTXTYPE(GCType, R3Type, R0Type) R3Type
|
---|
550 | #define RCTYPE(RCType, HCType) RCType
|
---|
551 | #define GCTYPE(GCType, HCType) GCType
|
---|
552 | #define RCPTRTYPE(RCType) RCType
|
---|
553 | #define GCPTRTYPE(GCType) GCType
|
---|
554 | #define HCPTRTYPE(HCType) HCType
|
---|
555 | #define R3R0PTRTYPE(HCType) HCType
|
---|
556 | #define R0PTRTYPE(R3Type) R3Type
|
---|
557 | #define R3PTRTYPE(R0Type) R0Type
|
---|
558 | #define RT_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__
|
---|
559 | #define RT_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction
|
---|
560 | #define RT_SRC_POS_ARGS pszFile, iLine, pszFunction
|
---|
561 | #define RTCALL
|
---|
562 | #define DECLINLINE(type) inline type
|
---|
563 | #define DECL_FORCE_INLINE(type) inline type
|
---|
564 | #define DECL_INVALID(type) type
|
---|
565 |
|
---|
566 | #define PDMDEVINSINT_DECLARED 1
|
---|
567 | #define VBOX_WITH_HGCM 1
|
---|
568 | #define VBOXCALL
|
---|
569 |
|
---|
570 | #define PGM_CTX(a,b) b
|
---|
571 | #define PGM_CTX3(a,b,c) c
|
---|
572 | #define PGM_GST_NAME(name) PGM_GST_NAME_AMD64(name)
|
---|
573 | #define PGM_GST_NAME_REAL(name) PGM_CTX3(name)
|
---|
574 | #define PGM_GST_NAME_PROT(name) PGM_CTX3(pgm,GstProt,name)
|
---|
575 | #define PGM_GST_NAME_32BIT(name) PGM_CTX3(pgm,Gst32Bit,name)
|
---|
576 | #define PGM_GST_NAME_PAE(name) PGM_CTX3(pgm,GstPAE,name)
|
---|
577 | #define PGM_GST_NAME_AMD64(name) PGM_CTX3(pgm,GstAMD64,name)
|
---|
578 | #define PGM_GST_DECL(type, name) type PGM_GST_NAME(name)
|
---|
579 | #define PGM_SHW_NAME(name) PGM_GST_NAME_AMD64(name)
|
---|
580 | #define PGM_SHW_NAME_32BIT(name) PGM_CTX3(pgm,Shw32Bit,name)
|
---|
581 | #define PGM_SHW_NAME_PAE(name) PGM_CTX3(pgm,ShwPAE,name)
|
---|
582 | #define PGM_SHW_NAME_AMD64(name) PGM_CTX3(pgm,ShwAMD64,name)
|
---|
583 | #define PGM_SHW_NAME_NESTED(name) PGM_CTX3(pgm,ShwNested,name)
|
---|
584 | #define PGM_SHW_NAME_EPT(name) PGM_CTX3(pgm,ShwEPT,name)
|
---|
585 | #define PGM_SHW_DECL(type, name) type PGM_SHW_NAME(name)
|
---|
586 | #define PGM_BTH_NAME(name) PGM_BTH_NAME_NESTED_AMD64(name)
|
---|
587 | #define PGM_BTH_NAME_32BIT_REAL(name) PGM_CTX3(pgm,Bth,name)
|
---|
588 | #define PGM_BTH_NAME_32BIT_PROT(name) PGM_CTX3(pgm,Bth,name)
|
---|
589 | #define PGM_BTH_NAME_32BIT_32BIT(name) PGM_CTX3(pgm,Bth,name)
|
---|
590 | #define PGM_BTH_NAME_PAE_REAL(name) PGM_CTX3(pgm,Bth,name)
|
---|
591 | #define PGM_BTH_NAME_PAE_PROT(name) PGM_CTX3(pgm,Bth,name)
|
---|
592 | #define PGM_BTH_NAME_PAE_32BIT(name) PGM_CTX3(pgm,Bth,name)
|
---|
593 | #define PGM_BTH_NAME_PAE_PAE(name) PGM_CTX3(pgm,Bth,name)
|
---|
594 | #define PGM_BTH_NAME_AMD64_PROT(name) PGM_CTX3(pgm,Bth,name)
|
---|
595 | #define PGM_BTH_NAME_AMD64_AMD64(name) PGM_CTX3(pgm,Bth,name)
|
---|
596 | #define PGM_BTH_NAME_NESTED_REAL(name) PGM_CTX3(pgm,Bth,name)
|
---|
597 | #define PGM_BTH_NAME_NESTED_PROT(name) PGM_CTX3(pgm,Bth,name)
|
---|
598 | #define PGM_BTH_NAME_NESTED_32BIT(name) PGM_CTX3(pgm,Bth,name)
|
---|
599 | #define PGM_BTH_NAME_NESTED_PAE(name) PGM_CTX3(pgm,Bth,name)
|
---|
600 | #define PGM_BTH_NAME_NESTED_AMD64(name) PGM_CTX3(pgm,Bth,name)
|
---|
601 | #define PGM_BTH_NAME_EPT_REAL(name) PGM_CTX3(pgm,Bth,name)
|
---|
602 | #define PGM_BTH_NAME_EPT_PROT(name) PGM_CTX3(pgm,Bth,name)
|
---|
603 | #define PGM_BTH_NAME_EPT_32BIT(name) PGM_CTX3(pgm,Bth,name)
|
---|
604 | #define PGM_BTH_NAME_EPT_PAE(name) PGM_CTX3(pgm,Bth,name)
|
---|
605 | #define PGM_BTH_NAME_EPT_AMD64(name) PGM_CTX3(pgm,Bth,name)
|
---|
606 | #define PGM_BTH_DECL(type, name) type PGM_BTH_NAME(name)
|
---|
607 |
|
---|
608 | #define FNIEMOP_STUB(a_Name) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu) { return VERR_NOT_IMPLEMENTED; }
|
---|
609 | #define FNIEMOP_DEF(a_Name) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu)
|
---|
610 | #define FNIEMOP_DEF_1(a_Name, a_Type0, a_Name0) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0)
|
---|
611 | #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)
|
---|
612 | #define IEM_CIMPL_DEF_0(a_Name) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu)
|
---|
613 | #define IEM_CIMPL_DEF_1(a_Name, a_Type0, a_Name0) static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, , a_Type0 a_Name0)
|
---|
614 | #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)
|
---|
615 | #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)
|
---|
616 | #define IEM_MC_LOCAL(a_Type, a_Name) a_Type a_Name
|
---|
617 | #define IEM_MC_ARG(a_Type, a_Name, a_iArg) a_Type a_Name
|
---|
618 | #define IEM_MC_ARG_CONST(a_Type, a_Name, a_Value, a_iArg) a_Type const a_Name = a_Value
|
---|
619 | EOF
|
---|
620 |
|
---|
621 | MY_HDR_FILES=` echo ${MY_ROOT_DIR}/include/VBox/*.h ${MY_ROOT_DIR}/include/VBox/vmm/*.h \
|
---|
622 | | ${MY_SED} -e 's,${MY_ROOT_DIR}/include/VBox/err.h,,' `
|
---|
623 | MY_HDR_FILES="${MY_HDR_FILES} ${MY_ROOT_DIR}/include/iprt/cdefs.h"
|
---|
624 | ${MY_SED} \
|
---|
625 | -e '/__cdecl/d' \
|
---|
626 | -e '/^ *# *define.*DECL/!d' \
|
---|
627 | -e '/DECLS/d' \
|
---|
628 | -e '/DECLARE_CLS_/d' \
|
---|
629 | -e '/_SRC_POS_DECL/d' \
|
---|
630 | -e '/declspec/d' \
|
---|
631 | -e '/__attribute__/d' \
|
---|
632 | -e 's/# */#/g' \
|
---|
633 | -e 's/ */ /g' \
|
---|
634 | -e '/ DECLEXPORT_CLASS/d' \
|
---|
635 | -e 's/ *VBOXCALL//' \
|
---|
636 | -e 's/ *RTCALL//' \
|
---|
637 | -e '/ DECLASM(type) type/d' \
|
---|
638 | -e '/define *DECL..CALLBACKMEMBER(type[^)]*) *RT/d' \
|
---|
639 | -e '/define *DECLINLINE(type)/d' \
|
---|
640 | -e '/define *DECL_FORCE_INLINE(type)/d' \
|
---|
641 | -e '/ *DECL_INVALID(/d' \
|
---|
642 | \
|
---|
643 | -e 's/(type) DECLHIDDEN(type)/(type) type/' \
|
---|
644 | -e 's/(type) DECLEXPORT(type)/(type) type/' \
|
---|
645 | -e 's/(type) DECLIMPORT(type)/(type) type/' \
|
---|
646 | -e 's/(a_Type) DECLHIDDEN(a_Type)/(a_Type) a_Type/' \
|
---|
647 | -e 's/(a_Type) DECLEXPORT(a_Type)/(a_Type) a_Type/' \
|
---|
648 | -e 's/(a_Type) DECLIMPORT(a_Type)/(a_Type) a_Type/' \
|
---|
649 | \
|
---|
650 | --append "${MY_FILE}" \
|
---|
651 | ${MY_HDR_FILES}
|
---|
652 |
|
---|
653 | ${MY_CAT} "${MY_FILE}" \
|
---|
654 | | ${MY_SED} -e 's/_/\x1F/g' -e 's/(/\x1E/g' -e 's/[[:space:]][[:space:]]*/\x1C/g' \
|
---|
655 | | ${MY_SED} -e 's/\x1F/_/g' -e 's/\x1E/(/g' -e 's/\x1C/ /g' \
|
---|
656 | | ${MY_SORT} \
|
---|
657 | | ${MY_SED} -e '/#define/s/$/ \/\/ vbox/' --output "${MY_FILE}.2"
|
---|
658 |
|
---|
659 | # Eliminate duplicates.
|
---|
660 | > "${MY_FILE}.3"
|
---|
661 | exec < "${MY_FILE}.2"
|
---|
662 | MY_PREV_DEFINE=""
|
---|
663 | while read MY_LINE;
|
---|
664 | do
|
---|
665 | MY_DEFINE=`echo "${MY_LINE}" | ${MY_SED} -e 's/^#define \([^ ()]*\).*$/\1/' `
|
---|
666 | if test "${MY_DEFINE}" != "${MY_PREV_DEFINE}"; then
|
---|
667 | MY_PREV_DEFINE=${MY_DEFINE}
|
---|
668 | echo "${MY_LINE}" >> "${MY_FILE}.3"
|
---|
669 | fi
|
---|
670 | done
|
---|
671 |
|
---|
672 | # Append non-vbox bits from the current user config.
|
---|
673 | if test -n "${MY_USERCPP_H_FULL}" -a -f "${MY_USERCPP_H_FULL}"; then
|
---|
674 | ${MY_SED} -e '/ \/\/ vbox$/d' -e '/^[[:space:]]*$/d' --append "${MY_FILE}.3" "${MY_USERCPP_H_FULL}"
|
---|
675 | fi
|
---|
676 |
|
---|
677 | # Finalize the file (sort + blank lines).
|
---|
678 | ${MY_CAT} "${MY_FILE}.3" \
|
---|
679 | | ${MY_SED} -e 's/$/\n/' --output "${MY_FILE}"
|
---|
680 | ${MY_RM} -f "${MY_FILE}.2" "${MY_FILE}.3"
|
---|
681 |
|
---|
682 | # Install it.
|
---|
683 | if test -n "${MY_USERCPP_H_FULL}" -a -d "${MY_SLICKDIR}"; then
|
---|
684 | if test -f "${MY_USERCPP_H_FULL}"; then
|
---|
685 | ${MY_MV} -vf "${MY_USERCPP_H_FULL}" "${MY_USERCPP_H_FULL}.bak"
|
---|
686 | ${MY_CP} "${MY_FILE}" "${MY_USERCPP_H_FULL}"
|
---|
687 | echo "Updated the SlickEdit preprocessor file. (Previous version renamed to .bak.)"
|
---|
688 | else
|
---|
689 | ${MY_CP} "${MY_FILE}" "${MY_USERCPP_H_FULL}"
|
---|
690 | echo "Created the SlickEdit preprocessor file."
|
---|
691 | fi
|
---|
692 | fi
|
---|
693 | }
|
---|
694 |
|
---|
695 | ###### end of functions ####
|
---|
696 |
|
---|
697 |
|
---|
698 | #
|
---|
699 | # Parse arguments.
|
---|
700 | #
|
---|
701 | while test $# -ge 1;
|
---|
702 | do
|
---|
703 | ARG=$1
|
---|
704 | shift
|
---|
705 | case "$ARG" in
|
---|
706 |
|
---|
707 | --rootdir)
|
---|
708 | if test $# -eq 0; then
|
---|
709 | echo "error: missing --rootdir argument." 1>&2
|
---|
710 | exit 1;
|
---|
711 | fi
|
---|
712 | MY_ROOT_DIR="$1"
|
---|
713 | shift
|
---|
714 | ;;
|
---|
715 |
|
---|
716 | --outdir)
|
---|
717 | if test $# -eq 0; then
|
---|
718 | echo "error: missing --outdir argument." 1>&2
|
---|
719 | exit 1;
|
---|
720 | fi
|
---|
721 | MY_OUT_DIR="$1"
|
---|
722 | shift
|
---|
723 | ;;
|
---|
724 |
|
---|
725 | --project-base)
|
---|
726 | if test $# -eq 0; then
|
---|
727 | echo "error: missing --project-base argument." 1>&2
|
---|
728 | exit 1;
|
---|
729 | fi
|
---|
730 | MY_PRJ_PRF="$1"
|
---|
731 | shift
|
---|
732 | ;;
|
---|
733 |
|
---|
734 | --workspace)
|
---|
735 | if test $# -eq 0; then
|
---|
736 | echo "error: missing --workspace argument." 1>&2
|
---|
737 | exit 1;
|
---|
738 | fi
|
---|
739 | MY_WS_NAME="$1"
|
---|
740 | shift
|
---|
741 | ;;
|
---|
742 |
|
---|
743 | --windows-host)
|
---|
744 | MY_WINDOWS_HOST=1
|
---|
745 | ;;
|
---|
746 |
|
---|
747 | --minimal)
|
---|
748 | MY_OPT_MINIMAL=1
|
---|
749 | ;;
|
---|
750 |
|
---|
751 | --slickedit-config)
|
---|
752 | MY_SLICK_CONFIG="$1"
|
---|
753 | shift
|
---|
754 | ;;
|
---|
755 |
|
---|
756 | # usage
|
---|
757 | --h*|-h*|-?|--?)
|
---|
758 | echo "usage: $0 [--rootdir <rootdir>] [--outdir <outdir>] [--project-base <prefix>] [--workspace <name>] [--minimal] [--slickedit-config <DIR>]"
|
---|
759 | echo ""
|
---|
760 | echo "If --outdir is specified, you must specify a --rootdir relative to it as well."
|
---|
761 | exit 1;
|
---|
762 | ;;
|
---|
763 |
|
---|
764 | # default
|
---|
765 | *)
|
---|
766 | echo "error: Invalid parameter '$ARG'" 1>&2
|
---|
767 | exit 1;
|
---|
768 |
|
---|
769 | esac
|
---|
770 | done
|
---|
771 |
|
---|
772 |
|
---|
773 | #
|
---|
774 | # From now on everything *MUST* succeed.
|
---|
775 | #
|
---|
776 | set -e
|
---|
777 |
|
---|
778 |
|
---|
779 | #
|
---|
780 | # Make sure the output directory exists, is valid and clean.
|
---|
781 | #
|
---|
782 | ${MY_RM} -f \
|
---|
783 | "${MY_OUT_DIR}/${MY_PRJ_PRF}"*.vpj \
|
---|
784 | "${MY_OUT_DIR}/${MY_WS_NAME}" \
|
---|
785 | "${MY_OUT_DIR}/`echo ${MY_WS_NAME} | ${MY_SED} -e 's/\.vpw$/.vtg/'`"
|
---|
786 | ${MY_MKDIR} -p "${MY_OUT_DIR}"
|
---|
787 | cd "${MY_OUT_DIR}"
|
---|
788 |
|
---|
789 |
|
---|
790 | #
|
---|
791 | # Determine the invocation to conjure up kmk.
|
---|
792 | #
|
---|
793 | my_abs_dir "tools"
|
---|
794 | if test -n "${MY_WINDOWS_HOST}"; then
|
---|
795 | MY_KMK_INVOCATION="${MY_ABS_DIR}/win.x86/bin/rexx.exe ${MY_ABS_DIR}/envSub.cmd kmk.exe"
|
---|
796 | else
|
---|
797 | MY_KMK_INVOCATION="LANG=C ${MY_ABS_DIR}/env.sh --quiet --no-wine kmk"
|
---|
798 | fi
|
---|
799 |
|
---|
800 |
|
---|
801 | #
|
---|
802 | # Generate the projects and workspace.
|
---|
803 | #
|
---|
804 | # Note! The configs aren't optimal yet, lots of adjustment wrt headers left to be done.
|
---|
805 | #
|
---|
806 |
|
---|
807 | # src/VBox/Runtime
|
---|
808 | my_generate_project "IPRT" "src/VBox/Runtime" --begin-incs "include" "src/VBox/Runtime/include" --end-includes "include/iprt" "src/VBox/Runtime"
|
---|
809 |
|
---|
810 | # src/VBox/VMM
|
---|
811 | my_generate_project "VMM" "src/VBox/VMM" --begin-incs "include" "src/VBox/VMM" --end-includes "src/VBox/VMM" \
|
---|
812 | "include/VBox/vmm/cfgm.h" \
|
---|
813 | "include/VBox/vmm/cpum.*" \
|
---|
814 | "include/VBox/vmm/dbgf.h" \
|
---|
815 | "include/VBox/vmm/em.h" \
|
---|
816 | "include/VBox/vmm/gmm.*" \
|
---|
817 | "include/VBox/vmm/gvm.*" \
|
---|
818 | "include/VBox/vmm/hw*.*" \
|
---|
819 | "include/VBox/vmm/iom.h" \
|
---|
820 | "include/VBox/vmm/mm.h" \
|
---|
821 | "include/VBox/vmm/patm.*" \
|
---|
822 | "include/VBox/vmm/pdm*.h" \
|
---|
823 | "include/VBox/vmm/pgm.*" \
|
---|
824 | "include/VBox/vmm/rem.h" \
|
---|
825 | "include/VBox/vmm/selm.*" \
|
---|
826 | "include/VBox/vmm/ssm.h" \
|
---|
827 | "include/VBox/vmm/stam.*" \
|
---|
828 | "include/VBox/vmm/tm.h" \
|
---|
829 | "include/VBox/vmm/trpm.*" \
|
---|
830 | "include/VBox/vmm/vm.*" \
|
---|
831 | "include/VBox/vmm/vmm.*"
|
---|
832 |
|
---|
833 | # src/recompiler
|
---|
834 | my_generate_project "REM" "src/recompiler" --begin-incs \
|
---|
835 | "include" \
|
---|
836 | "src/recompiler" \
|
---|
837 | "src/recompiler/target-i386" \
|
---|
838 | "src/recompiler/tcg/i386" \
|
---|
839 | "src/recompiler/Sun/crt" \
|
---|
840 | --end-includes \
|
---|
841 | "src/recompiler" \
|
---|
842 | "src/VBox/VMM/include/REMInternal.h" \
|
---|
843 | "src/VBox/VMM/VMMAll/REMAll.cpp"
|
---|
844 |
|
---|
845 | # src/VBox/Additions
|
---|
846 | my_generate_project "Add-freebsd" "src/VBox/Additions/freebsd" --begin-incs "include" "src/VBox/Additions/freebsd" --end-includes "src/VBox/Additions/freebsd"
|
---|
847 | my_generate_project "Add-linux" "src/VBox/Additions/linux" --begin-incs "include" "src/VBox/Additions/linux" --end-includes "src/VBox/Additions/linux"
|
---|
848 | my_generate_project "Add-os2" "src/VBox/Additions/os2" --begin-incs "include" "src/VBox/Additions/os2" --end-includes "src/VBox/Additions/os2"
|
---|
849 | my_generate_project "Add-solaris" "src/VBox/Additions/solaris" --begin-incs "include" "src/VBox/Additions/solaris" --end-includes "src/VBox/Additions/solaris"
|
---|
850 | my_generate_project "Add-haiku" "src/VBox/Additions/haiku" --begin-incs "include" "src/VBox/Additions/haiku" --end-includes "src/VBox/Additions/haiku"
|
---|
851 | my_generate_project "Add-win" "src/VBox/Additions/WINNT" --begin-incs "include" "src/VBox/Additions/WINNT" --end-includes "src/VBox/Additions/WINNT"
|
---|
852 | test -z "$MY_OPT_MINIMAL" && \
|
---|
853 | my_generate_project "Add-x11" "src/VBox/Additions/x11" --begin-incs "include" "src/VBox/Additions/x11" --end-includes "src/VBox/Additions/x11"
|
---|
854 | my_generate_project "Add-Control" "src/VBox/Additions/common/VBoxControl" --begin-incs "include" "src/VBox/Additions/common/VBoxControl" --end-includes "src/VBox/Additions/common/VBoxControl"
|
---|
855 | my_generate_project "Add-GuestDrv" "src/VBox/Additions/common/VBoxGuest" --begin-incs "include" "src/VBox/Additions/common/VBoxGuest" --end-includes "src/VBox/Additions/common/VBoxGuest" "include/VBox/VBoxGuest*.*"
|
---|
856 | my_generate_project "Add-Lib" "src/VBox/Additions/common/VBoxGuestLib" --begin-incs "include" "src/VBox/Additions/common/VBoxGuestLib" --end-includes "src/VBox/Additions/common/VBoxGuestLib" "include/VBox/VBoxGuest*.*"
|
---|
857 | my_generate_project "Add-Service" "src/VBox/Additions/common/VBoxService" --begin-incs "include" "src/VBox/Additions/common/VBoxService" --end-includes "src/VBox/Additions/common/VBoxService"
|
---|
858 | if test -z "$MY_OPT_MINIMAL"; then
|
---|
859 | my_generate_project "Add-crOpenGL" "src/VBox/Additions/common/crOpenGL" --begin-incs "include" "src/VBox/Additions/common/crOpenGL" --end-includes "src/VBox/Additions/common/crOpenGL"
|
---|
860 | my_generate_project "Add-CredProv" "src/VBox/Additions/WINNT/VBoxCredProv" --begin-incs "include" "src/VBox/Additions/WINNT/VBoxCredProv" --end-includes "src/VBox/Additions/WINNT/VBoxCredProv"
|
---|
861 | my_generate_project "Add-GINA" "src/VBox/Additions/WINNT/VBoxGINA" --begin-incs "include" "src/VBox/Additions/WINNT/VBoxGINA" --end-includes "src/VBox/Additions/WINNT/VBoxGINA"
|
---|
862 | fi
|
---|
863 |
|
---|
864 | # src/VBox/Debugger
|
---|
865 | my_generate_project "Debugger" "src/VBox/Debugger" --begin-incs "include" "src/VBox/Debugger" --end-includes "src/VBox/Debugger" "include/VBox/dbggui.h" "include/VBox/dbg.h"
|
---|
866 |
|
---|
867 | # src/VBox/Devices
|
---|
868 | my_generate_project "Devices" "src/VBox/Devices" --begin-incs "include" "src/VBox/Devices" --end-includes "src/VBox/Devices" "include/VBox/pci.h" "include/VBox/pdm*.h"
|
---|
869 | ## @todo split this up.
|
---|
870 |
|
---|
871 | # src/VBox/Disassembler
|
---|
872 | my_generate_project "DIS" "src/VBox/Disassembler" --begin-incs "include" "src/VBox/Disassembler" --end-includes "src/VBox/Disassembler" "include/VBox/dis*.h"
|
---|
873 |
|
---|
874 | # src/VBox/Frontends
|
---|
875 | test -z "$MY_OPT_MINIMAL" && \
|
---|
876 | my_generate_project "FE-VBoxBalloonCtrl" "src/VBox/Frontends/VBoxBalloonCtrl" --begin-incs "include" "src/VBox/Frontends/VBoxBalloonCtrl" --end-includes "src/VBox/Frontends/VBoxBalloonCtrl"
|
---|
877 | my_generate_project "FE-VBoxManage" "src/VBox/Frontends/VBoxManage" --begin-incs "include" "src/VBox/Frontends/VBoxManage" --end-includes "src/VBox/Frontends/VBoxManage"
|
---|
878 | my_generate_project "FE-VBoxHeadless" "src/VBox/Frontends/VBoxHeadless" --begin-incs "include" "src/VBox/Frontends/VBoxHeadless" --end-includes "src/VBox/Frontends/VBoxHeadless"
|
---|
879 | my_generate_project "FE-VBoxSDL" "src/VBox/Frontends/VBoxSDL" --begin-incs "include" "src/VBox/Frontends/VBoxSDL" --end-includes "src/VBox/Frontends/VBoxSDL"
|
---|
880 | my_generate_project "FE-VBoxShell" "src/VBox/Frontends/VBoxShell" --begin-incs "include" "src/VBox/Frontends/VBoxShell" --end-includes "src/VBox/Frontends/VBoxShell"
|
---|
881 | # noise - my_generate_project "FE-VBoxBFE" "src/VBox/Frontends/VBoxBFE" --begin-incs "include" "src/VBox/Frontends/VBoxBFE" --end-includes "src/VBox/Frontends/VBoxBFE"
|
---|
882 | FE_VBOX_WRAPPERS=""
|
---|
883 | for d in ${MY_OUT_DIRS};
|
---|
884 | do
|
---|
885 | if test -d "${MY_ROOT_DIR}/${d}/obj/VirtualBox/include"; then
|
---|
886 | FE_VBOX_WRAPPERS="${d}/obj/VirtualBox/include"
|
---|
887 | break
|
---|
888 | fi
|
---|
889 | done
|
---|
890 | if test -n "${FE_VBOX_WRAPPERS}"; then
|
---|
891 | my_generate_project "FE-VirtualBox" "src/VBox/Frontends/VirtualBox" --begin-incs "include" "${FE_VBOX_WRAPPERS}" --end-includes "src/VBox/Frontends/VirtualBox" "${FE_VBOX_WRAPPERS}/COMWrappers.cpp" "${FE_VBOX_WRAPPERS}/COMWrappers.h"
|
---|
892 | else
|
---|
893 | my_generate_project "FE-VirtualBox" "src/VBox/Frontends/VirtualBox" --begin-incs "include" --end-includes "src/VBox/Frontends/VirtualBox"
|
---|
894 | fi
|
---|
895 |
|
---|
896 | # src/VBox/GuestHost
|
---|
897 | my_generate_project "HGSMI-GH" "src/VBox/GuestHost/HGSMI" --begin-incs "include" --end-includes "src/VBox/GuestHost/HGSMI"
|
---|
898 | test -z "$MY_OPT_MINIMAL" && \
|
---|
899 | my_generate_project "OpenGL-GH" "src/VBox/GuestHost/OpenGL" --begin-incs "include" "src/VBox/GuestHost/OpenGL" --end-includes "src/VBox/GuestHost/OpenGL"
|
---|
900 | my_generate_project "ShClip-GH" "src/VBox/GuestHost/SharedClipboard" --begin-incs "include" --end-includes "src/VBox/GuestHost/SharedClipboard"
|
---|
901 |
|
---|
902 | # src/VBox/HostDrivers
|
---|
903 | my_generate_project "SUP" "src/VBox/HostDrivers/Support" --begin-incs "include" "src/VBox/HostDrivers/Support" --end-includes "src/VBox/HostDrivers/Support" "include/VBox/sup.h" "include/VBox/sup.mac"
|
---|
904 | my_generate_project "VBoxNetAdp" "src/VBox/HostDrivers/VBoxNetAdp" --begin-incs "include" "src/VBox/HostDrivers/VBoxNetAdp" --end-includes "src/VBox/HostDrivers/VBoxNetAdp" "include/VBox/intnet.h"
|
---|
905 | my_generate_project "VBoxNetFlt" "src/VBox/HostDrivers/VBoxNetFlt" --begin-incs "include" "src/VBox/HostDrivers/VBoxNetFlt" --end-includes "src/VBox/HostDrivers/VBoxNetFlt" "include/VBox/intnet.h"
|
---|
906 | my_generate_project "VBoxUSB" "src/VBox/HostDrivers/VBoxUSB" --begin-incs "include" "src/VBox/HostDrivers/VBoxUSB" --end-includes "src/VBox/HostDrivers/VBoxUSB" "include/VBox/usblib*.h" "include/VBox/usbfilter.h"
|
---|
907 |
|
---|
908 | # src/VBox/HostServices
|
---|
909 | my_generate_project "GuestCntl" "src/VBox/HostServices/GuestControl" --begin-incs "include" "src/VBox/HostServices/GuestControl" --end-includes "src/VBox/HostServices/GuestControl"
|
---|
910 | my_generate_project "GuestProps" "src/VBox/HostServices/GuestProperties" --begin-incs "include" "src/VBox/HostServices/GuestProperties" --end-includes "src/VBox/HostServices/GuestProperties"
|
---|
911 | my_generate_project "ShClip-HS" "src/VBox/HostServices/SharedClipboard" --begin-incs "include" "src/VBox/HostServices/SharedClipboard" --end-includes "src/VBox/HostServices/SharedClipboard"
|
---|
912 | my_generate_project "SharedFolders" "src/VBox/HostServices/SharedFolders" --begin-incs "include" "src/VBox/HostServices/SharedFolders" --end-includes "src/VBox/HostServices/SharedFolders" "include/VBox/shflsvc.h"
|
---|
913 | my_generate_project "OpenGL-HS" "src/VBox/HostServices/SharedOpenGL" --begin-incs "include" "src/VBox/HostServices/SharedOpenGL" --end-includes "src/VBox/HostServices/SharedOpenGL"
|
---|
914 |
|
---|
915 | # src/VBox/ImageMounter
|
---|
916 | my_generate_project "ImageMounter" "src/VBox/ImageMounter" --begin-incs "include" "src/VBox/ImageMounter" --end-includes "src/VBox/ImageMounter"
|
---|
917 |
|
---|
918 | # src/VBox/Installer
|
---|
919 | my_generate_project "Installers" "src/VBox/Installer" --begin-incs "include" --end-includes "src/VBox/Installer"
|
---|
920 |
|
---|
921 | # src/VBox/Main
|
---|
922 | my_generate_project "Main" "src/VBox/Main" --begin-incs "include" "src/VBox/Main/include" --end-includes "src/VBox/Main" "include/VBox/com" "include/VBox/settings.h"
|
---|
923 | ## @todo seperate webservices and Main. pick the right headers. added generated headers.
|
---|
924 |
|
---|
925 | # src/VBox/Network
|
---|
926 | my_generate_project "Net-DHCP" "src/VBox/NetworkServices/DHCP" --begin-incs "include" "src/VBox/NetworkServices/NetLib" --end-includes "src/VBox/NetworkServices/DHCP"
|
---|
927 | my_generate_project "Net-NAT" "src/VBox/NetworkServices/NAT" --begin-incs "include" "src/VBox/NetworkServices/NAT" --end-includes "src/VBox/NetworkServices/NAT" "src/VBox/Devices/Network/slirp"
|
---|
928 | my_generate_project "Net-NetLib" "src/VBox/NetworkServices/NetLib" --begin-incs "include" "src/VBox/NetworkServices/NetLib" --end-includes "src/VBox/NetworkServices/NetLib"
|
---|
929 |
|
---|
930 | # src/VBox/RDP
|
---|
931 | my_generate_project "RDP-Client" "src/VBox/RDP/client" --begin-incs "include" "src/VBox/RDP/client" --end-includes "src/VBox/RDP/client"
|
---|
932 | my_generate_project "RDP-Server" "src/VBox/RDP/server" --begin-incs "include" "src/VBox/RDP/server" --end-includes "src/VBox/RDP/server"
|
---|
933 | my_generate_project "RDP-WebClient" "src/VBox/RDP/webclient" --begin-incs "include" "src/VBox/RDP/webclient" --end-includes "src/VBox/RDP/webclient"
|
---|
934 | my_generate_project "RDP-Misc" "src/VBox/RDP" --begin-incs "include" --end-includes "src/VBox/RDP/auth" "src/VBox/RDP/tscpasswd" "src/VBox/RDP/x11server"
|
---|
935 |
|
---|
936 | # src/VBox/Testsuite
|
---|
937 | my_generate_project "Testsuite" "src/VBox/Testsuite" --begin-incs "include" --end-includes "src/VBox/Testsuite"
|
---|
938 |
|
---|
939 | # src/VBox/ExtPacks
|
---|
940 | my_generate_project "ExtPacks" "src/VBox/ExtPacks" --begin-incs "include" --end-includes "src/VBox/ExtPacks"
|
---|
941 |
|
---|
942 | # src/apps/adpctl - misplaced.
|
---|
943 | my_generate_project "adpctl" "src/apps/adpctl" --begin-incs "include" --end-includes "src/apps/adpctl"
|
---|
944 |
|
---|
945 | # src/bldprogs
|
---|
946 | my_generate_project "bldprogs" "src/bldprogs" --begin-incs "include" --end-includes "src/bldprogs"
|
---|
947 |
|
---|
948 | # A few things from src/lib
|
---|
949 | my_generate_project "zlib" "src/libs/zlib-1.2.6" --begin-incs "include" --end-includes "src/libs/zlib-1.2.6/*.c" "src/libs/zlib-1.2.6/*.h"
|
---|
950 | my_generate_project "liblzf" "src/libs/liblzf-3.4" --begin-incs "include" --end-includes "src/libs/liblzf-3.4"
|
---|
951 | my_generate_project "libpng" "src/libs/libpng-1.2.8" --begin-incs "include" --end-includes "src/libs/libpng-1.2.8/*.c" "src/libs/libpng-1.2.8/*.h"
|
---|
952 | my_generate_project "openssl" "src/libs/openssl-0.9.8t" --begin-incs "include" "src/libs/openssl-0.9.8t/crypto" --end-includes "src/libs/openssl-0.9.8t"
|
---|
953 | my_generate_project "kStuff" "src/libs/kStuff" --begin-incs "include" "src/libs/kStuff/kStuff/include" --end-includes "src/libs/kStuff"
|
---|
954 |
|
---|
955 |
|
---|
956 | # include/VBox
|
---|
957 | my_generate_project "VBoxHeaders" "include" --begin-incs "include" --end-includes "include/VBox"
|
---|
958 |
|
---|
959 | # Misc
|
---|
960 | my_generate_project "misc" "src/testcase" --begin-incs "include" --end-includes \
|
---|
961 | "src/testcase" \
|
---|
962 | "configure" \
|
---|
963 | "configure.vbs" \
|
---|
964 | "Config.kmk" \
|
---|
965 | "Makefile.kmk" \
|
---|
966 | "src/Makefile.kmk" \
|
---|
967 | "src/VBox/Makefile.kmk"
|
---|
968 |
|
---|
969 |
|
---|
970 | # out/x.y/z/bin/sdk/bindings/xpcom
|
---|
971 | XPCOM_INCS="src/libs/xpcom18a4"
|
---|
972 | for d in \
|
---|
973 | "out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/${KBUILD_TYPE}/dist/sdk/bindings/xpcom" \
|
---|
974 | "out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/${BUILD_TYPE}/dist/sdk/bindings/xpcom" \
|
---|
975 | "out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/${KBUILD_TYPE}/bin/sdk/bindings/xpcom" \
|
---|
976 | "out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/${BUILD_TYPE}/bin/sdk/bindings/xpcom" \
|
---|
977 | "out/linux.amd64/debug/bin/sdk/bindings/xpcom" \
|
---|
978 | "out/linux.x86/debug/bin/sdk/bindings/xpcom" \
|
---|
979 | "out/darwin.amd64/debug/dist/sdk/bindings/xpcom" \
|
---|
980 | "out/darwin.x86/debug/bin/dist/bindings/xpcom" \
|
---|
981 | "out/haiku.amd64/debug/bin/sdk/bindings/xpcom" \
|
---|
982 | "out/haiku.x86/debug/bin/sdk/bindings/xpcom" \
|
---|
983 | "out/solaris.amd64/debug/bin/sdk/bindings/xpcom" \
|
---|
984 | "out/solaris.x86/debug/bin/sdk/bindings/xpcom";
|
---|
985 | do
|
---|
986 | if test -d "${MY_ROOT_DIR}/${d}"; then
|
---|
987 | my_generate_project "SDK-xpcom" "${d}" --begin-incs "include" "${d}/include" --end-includes "${d}"
|
---|
988 | XPCOM_INCS="${d}/include"
|
---|
989 | break
|
---|
990 | fi
|
---|
991 | done
|
---|
992 |
|
---|
993 | # lib/xpcom
|
---|
994 | my_generate_project "xpcom" "src/libs/xpcom18a4" --begin-incs "include" "${XPCOM_INCS}" --end-includes "src/libs/xpcom18a4"
|
---|
995 |
|
---|
996 | my_generate_workspace
|
---|
997 |
|
---|
998 |
|
---|
999 | #
|
---|
1000 | # Update the history file if present.
|
---|
1001 | #
|
---|
1002 | MY_FILE="${MY_WS_NAME}histu"
|
---|
1003 | if test -f "${MY_FILE}"; then
|
---|
1004 | echo "Updating ${MY_FILE}..."
|
---|
1005 | ${MY_MV} -f "${MY_FILE}" "${MY_FILE}.old"
|
---|
1006 | ${MY_SED} -n \
|
---|
1007 | -e '/PROJECT_CACHE/d' \
|
---|
1008 | -e '/\[TreeExpansion2\]/d' \
|
---|
1009 | -e '/^\[/p' \
|
---|
1010 | -e '/: /p' \
|
---|
1011 | -e '/^CurrentProject/p' \
|
---|
1012 | "${MY_FILE}.old" > "${MY_FILE}"
|
---|
1013 | fi
|
---|
1014 |
|
---|
1015 |
|
---|
1016 | #
|
---|
1017 | # Generate and update the usercpp.h/unxcpp.h file.
|
---|
1018 | #
|
---|
1019 | my_generate_usercpp_h
|
---|
1020 |
|
---|
1021 |
|
---|
1022 | echo "done"
|
---|
1023 |
|
---|