VirtualBox

source: vbox/trunk/tools/bin/gen-slickedit-workspace.sh@ 98123

Last change on this file since 98123 was 98105, checked in by vboxsync, 23 months ago

tools/bin: Use correct hash-bang so zsh/macOS doesn't give us a 'sh' w/o the support for '-n' option in the echo command.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 39.5 KB
Line 
1#!/usr/bin/env kmk_ash
2# $Id: gen-slickedit-workspace.sh 98105 2023-01-17 15:17:40Z 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#
35MY_SCRIPT_DIR=.
36case "$0" in
37 */*|*\\*)
38 MY_SCRIPT_DIR=$(echo "$0" | kmk_sed -e 's,[/\][^/\][^/\]*$,,')
39 ;;
40esac
41. "${MY_SCRIPT_DIR}/common-gen-workspace.inc.sh"
42
43
44#
45# Globals.
46#
47MY_PROJECT_FILES=""
48
49
50#
51# Parameters w/ defaults.
52#
53MY_OUT_DIR="SlickEdit"
54MY_PRJ_PRF="VBox-"
55MY_WS_NAME="VirtualBox.vpw"
56MY_DBG=""
57MY_WINDOWS_HOST=""
58MY_OPT_MINIMAL=""
59MY_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.
67my_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
162my_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="&amp;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="&amp;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="&amp;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="&amp;Debug" SaveOption="SaveNone" RunFromDir="%rw">' >> "${MY_FILE}"
221 #echo ' <Exec/>' >> "${MY_FILE}"
222 #echo ' </Target>' >> "${MY_FILE}"
223 #echo ' <Target Name="Execute" MenuCaption="E&amp;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#
259my_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#
330my_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#
350my_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
487EOF
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
495EOF
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
503EOF
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_DECL_IMPL_DEF(a_RetType, a_Name, a_ArgList) a_RetType a_Name a_ArgList
596#define IEM_MC_LOCAL(a_Type, a_Name) a_Type a_Name
597#define IEM_MC_ARG(a_Type, a_Name, a_iArg) a_Type a_Name
598#define IEM_MC_ARG_CONST(a_Type, a_Name, a_Value, a_iArg) a_Type const a_Name = a_Value
599#define IEM_STATIC
600
601#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)
602#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)
603#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)
604#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)
605
606#define RTLDRELF_NAME(name) rtldrELF64##name
607#define RTLDRELF_SUFF(name) name##64
608#define RTLDRELF_MID(pre,suff) pre##64##suff
609
610#define BS3_DECL(type) type
611#define BS3_DECL_CALLBACK(type) type
612#define TMPL_NM(name) name##_mmm
613#define TMPL_FAR_NM(name) name##_mmm_far
614#define BS3_CMN_NM(name) name
615#define BS3_CMN_FAR_NM(name) name
616#define BS3_CMN_FN_NM(name) name
617#define BS3_DATA_NM(name) name
618#define BS3_FAR
619#define BS3_FAR_CODE
620#define BS3_FAR_DATA
621#define BS3_NEAR
622#define BS3_NEAR_CODE
623#define BS3_CMN_PROTO_STUB(a_RetType, a_Name, a_Params) a_RetType a_Name a_Params
624#define BS3_CMN_PROTO_NOSB(a_RetType, a_Name, a_Params) a_RetType a_Name a_Params
625#define BS3_CMN_DEF( a_RetType, a_Name, a_Params) a_RetType a_Name a_Params
626#define BS3_MODE_PROTO_STUB(a_RetType, a_Name, a_Params) \
627 a_RetType a_Name##_mmm a_Params; \
628 a_RetType a_Name##_mmm_far a_Params; \
629 a_RetType a_Name##_rm a_Params; \
630 a_RetType a_Name##_pe16 a_Params; \
631 a_RetType a_Name##_pe16_32 a_Params; \
632 a_RetType a_Name##_pe16_v86 a_Params; \
633 a_RetType a_Name##_pe32 a_Params; \
634 a_RetType a_Name##_pe32_16 a_Params; \
635 a_RetType a_Name##_pev86 a_Params; \
636 a_RetType a_Name##_pp16 a_Params; \
637 a_RetType a_Name##_pp16_32 a_Params; \
638 a_RetType a_Name##_pp16_v86 a_Params; \
639 a_RetType a_Name##_pp32 a_Params; \
640 a_RetType a_Name##_pp32_16 a_Params; \
641 a_RetType a_Name##_ppv86 a_Params; \
642 a_RetType a_Name##_pae16 a_Params; \
643 a_RetType a_Name##_pae16_32 a_Params; \
644 a_RetType a_Name##_pae16_v86 a_Params; \
645 a_RetType a_Name##_pae32 a_Params; \
646 a_RetType a_Name##_pae32_16 a_Params; \
647 a_RetType a_Name##_paev86 a_Params; \
648 a_RetType a_Name##_lm16 a_Params; \
649 a_RetType a_Name##_lm32 a_Params; \
650 a_RetType a_Name##_lm64 a_Params; \
651 a_RetType a_Name##_rm_far a_Params; \
652 a_RetType a_Name##_pe16_far a_Params; \
653 a_RetType a_Name##_pe16_v86_far a_Params; \
654 a_RetType a_Name##_pe32_16_far a_Params; \
655 a_RetType a_Name##_pev86_far a_Params; \
656 a_RetType a_Name##_pp16_far a_Params; \
657 a_RetType a_Name##_pp16_v86_far a_Params; \
658 a_RetType a_Name##_pp32_16_far a_Params; \
659 a_RetType a_Name##_ppv86_far a_Params; \
660 a_RetType a_Name##_pae16_far a_Params; \
661 a_RetType a_Name##_pae16_v86_far a_Params; \
662 a_RetType a_Name##_pae32_16_far a_Params; \
663 a_RetType a_Name##_paev86_far a_Params; \
664 a_RetType a_Name##_lm16_far a_Params
665#define BS3_MODE_PROTO_NOSB(a_RetType, a_Name, a_Params) \
666 a_RetType a_Name##_mmm a_Params; \
667 a_RetType a_Name##_mmm_far a_Params; \
668 a_RetType a_Name##_rm a_Params; \
669 a_RetType a_Name##_pe16 a_Params; \
670 a_RetType a_Name##_pe16_32 a_Params; \
671 a_RetType a_Name##_pe16_v86 a_Params; \
672 a_RetType a_Name##_pe32 a_Params; \
673 a_RetType a_Name##_pe32_16 a_Params; \
674 a_RetType a_Name##_pev86 a_Params; \
675 a_RetType a_Name##_pp16 a_Params; \
676 a_RetType a_Name##_pp16_32 a_Params; \
677 a_RetType a_Name##_pp16_v86 a_Params; \
678 a_RetType a_Name##_pp32 a_Params; \
679 a_RetType a_Name##_pp32_16 a_Params; \
680 a_RetType a_Name##_ppv86 a_Params; \
681 a_RetType a_Name##_pae16 a_Params; \
682 a_RetType a_Name##_pae16_32 a_Params; \
683 a_RetType a_Name##_pae16_v86 a_Params; \
684 a_RetType a_Name##_pae32 a_Params; \
685 a_RetType a_Name##_pae32_16 a_Params; \
686 a_RetType a_Name##_paev86 a_Params; \
687 a_RetType a_Name##_lm16 a_Params; \
688 a_RetType a_Name##_lm32 a_Params; \
689 a_RetType a_Name##_lm64 a_Params; \
690 a_RetType a_Name##_rm_far a_Params; \
691 a_RetType a_Name##_pe16_far a_Params; \
692 a_RetType a_Name##_pe16_v86_far a_Params; \
693 a_RetType a_Name##_pe32_16_far a_Params; \
694 a_RetType a_Name##_pev86_far a_Params; \
695 a_RetType a_Name##_pp16_far a_Params; \
696 a_RetType a_Name##_pp16_v86_far a_Params; \
697 a_RetType a_Name##_pp32_16_far a_Params; \
698 a_RetType a_Name##_ppv86_far a_Params; \
699 a_RetType a_Name##_pae16_far a_Params; \
700 a_RetType a_Name##_pae16_v86_far a_Params; \
701 a_RetType a_Name##_pae32_16_far a_Params; \
702 a_RetType a_Name##_paev86_far a_Params; \
703 a_RetType a_Name##_lm16_far a_Params
704#define BS3_MODE_EXPAND_EXTERN_DATA16(a_VarType, a_VarName, a_Suffix) \
705 extern a_VarType a_VarName##_rm a_Suffix; \
706 extern a_VarType a_VarName##_pe16 a_Suffix; \
707 extern a_VarType a_VarName##_pe16_32 a_Suffix; \
708 extern a_VarType a_VarName##_pe16_v86 a_Suffix; \
709 extern a_VarType a_VarName##_pe32 a_Suffix; \
710 extern a_VarType a_VarName##_pe32_16 a_Suffix; \
711 extern a_VarType a_VarName##_pev86 a_Suffix; \
712 extern a_VarType a_VarName##_pp16 a_Suffix; \
713 extern a_VarType a_VarName##_pp16_32 a_Suffix; \
714 extern a_VarType a_VarName##_pp16_v86 a_Suffix; \
715 extern a_VarType a_VarName##_pp32 a_Suffix; \
716 extern a_VarType a_VarName##_pp32_16 a_Suffix; \
717 extern a_VarType a_VarName##_ppv86 a_Suffix; \
718 extern a_VarType a_VarName##_pae16 a_Suffix; \
719 extern a_VarType a_VarName##_pae16_32 a_Suffix; \
720 extern a_VarType a_VarName##_pae16_v86 a_Suffix; \
721 extern a_VarType a_VarName##_pae32 a_Suffix; \
722 extern a_VarType a_VarName##_pae32_16 a_Suffix; \
723 extern a_VarType a_VarName##_paev86 a_Suffix; \
724 extern a_VarType a_VarName##_lm16 a_Suffix; \
725 extern a_VarType a_VarName##_lm32 a_Suffix; \
726 extern a_VarType a_VarName##_lm64 a_Suffix
727
728EOF
729
730 MY_HDR_FILES=` echo ${MY_ROOT_DIR}/include/VBox/*.h ${MY_ROOT_DIR}/include/VBox/vmm/*.h \
731 | ${MY_SED} -e 's,${MY_ROOT_DIR}/include/VBox/err.h,,' `
732 MY_HDR_FILES="${MY_HDR_FILES} ${MY_ROOT_DIR}/include/iprt/cdefs.h"
733 ${MY_SED} \
734 -e '/__cdecl/d' \
735 -e '/^ *# *define.*DECL/!d' \
736 -e '/DECLS/d' \
737 -e '/DECLARE_CLS_/d' \
738 -e '/_SRC_POS_DECL/d' \
739 -e '/declspec/d' \
740 -e '/__attribute__/d' \
741 -e 's/# */#/g' \
742 -e 's/ */ /g' \
743 -e '/ DECLEXPORT_CLASS/d' \
744 -e 's/ *VBOXCALL//' \
745 -e 's/ *RTCALL//' \
746 -e '/ DECLASM(type) type/d' \
747 -e '/define *DECL..CALLBACKMEMBER(type[^)]*) *RT/d' \
748 -e '/define *DECLINLINE(type)/d' \
749 -e '/define *DECL_FORCE_INLINE(type)/d' \
750 -e '/ *DECL_INVALID(/d' \
751 \
752 -e 's/(type) DECLHIDDEN(type)/(type) type/' \
753 -e 's/(type) DECLEXPORT(type)/(type) type/' \
754 -e 's/(type) DECLIMPORT(type)/(type) type/' \
755 -e 's/(type) DECL_HIDDEN_NOTHROW(type)/(type) type/' \
756 -e 's/(type) DECL_EXPORT_NOTHROW(type)/(type) type/' \
757 -e 's/(type) DECL_IMPORT_NOTHROW(type)/(type) type/' \
758 -e 's/(a_Type) DECLHIDDEN(a_Type)/(a_Type) a_Type/' \
759 -e 's/(a_Type) DECLEXPORT(a_Type)/(a_Type) a_Type/' \
760 -e 's/(a_Type) DECLIMPORT(a_Type)/(a_Type) a_Type/' \
761 -e 's/(a_Type) DECL_HIDDEN_NOTHROW(a_Type)/(a_Type) a_Type/' \
762 -e 's/(a_Type) DECL_EXPORT_NOTHROW(a_Type)/(a_Type) a_Type/' \
763 -e 's/(a_Type) DECL_IMPORT_NOTHROW(a_Type)/(a_Type) a_Type/' \
764 \
765 --append "${MY_FILE}" \
766 ${MY_HDR_FILES}
767
768 ${MY_CAT} "${MY_FILE}" \
769 | ${MY_SED} -e 's/_/\x1F/g' -e 's/(/\x1E/g' -e 's/[[:space:]][[:space:]]*/\x1C/g' \
770 | ${MY_SED} -e 's/\x1F/_/g' -e 's/\x1E/(/g' -e 's/\x1C/ /g' \
771 | ${MY_SORT} \
772 | ${MY_SED} -e '/#define/s/$/ \/\/ vbox/' --output "${MY_FILE}.2"
773
774 # Eliminate duplicates.
775 > "${MY_FILE}.3"
776 exec < "${MY_FILE}.2"
777 MY_PREV_DEFINE=""
778 while read MY_LINE;
779 do
780 MY_DEFINE=`echo "${MY_LINE}" | ${MY_SED} -e 's/^#define \([^ ()]*\).*$/\1/' `
781 if test "${MY_DEFINE}" != "${MY_PREV_DEFINE}"; then
782 MY_PREV_DEFINE=${MY_DEFINE}
783 echo "${MY_LINE}" >> "${MY_FILE}.3"
784 fi
785 done
786
787 # Append non-vbox bits from the current user config.
788 if test -n "${MY_USERCPP_H_FULL}" -a -f "${MY_USERCPP_H_FULL}"; then
789 ${MY_SED} -e '/ \/\/ vbox$/d' -e '/^[[:space:]]*$/d' --append "${MY_FILE}.3" "${MY_USERCPP_H_FULL}"
790 fi
791
792 # Finalize the file (sort + blank lines).
793 ${MY_CAT} "${MY_FILE}.3" \
794 | ${MY_SED} -e 's/$/\n/' --output "${MY_FILE}"
795 ${MY_RM} -f "${MY_FILE}.2" "${MY_FILE}.3"
796
797 # Install it.
798 if test -n "${MY_USERCPP_H_FULL}" -a -d "${MY_SLICKDIR}"; then
799 if test -f "${MY_USERCPP_H_FULL}"; then
800 ${MY_MV} -vf "${MY_USERCPP_H_FULL}" "${MY_USERCPP_H_FULL}.bak"
801 ${MY_CP} "${MY_FILE}" "${MY_USERCPP_H_FULL}"
802 echo "Updated the SlickEdit preprocessor file. (Previous version renamed to .bak.)"
803 else
804 ${MY_CP} "${MY_FILE}" "${MY_USERCPP_H_FULL}"
805 echo "Created the SlickEdit preprocessor file."
806 fi
807 fi
808}
809
810###### end of functions ####
811
812
813#
814# Parse arguments.
815#
816while test $# -ge 1;
817do
818 ARG=$1
819 shift
820 case "$ARG" in
821
822 --rootdir)
823 if test $# -eq 0; then
824 echo "error: missing --rootdir argument." 1>&2
825 exit 1;
826 fi
827 MY_ROOT_DIR="$1"
828 shift
829 ;;
830
831 --outdir)
832 if test $# -eq 0; then
833 echo "error: missing --outdir argument." 1>&2
834 exit 1;
835 fi
836 MY_OUT_DIR="$1"
837 shift
838 ;;
839
840 --project-base)
841 if test $# -eq 0; then
842 echo "error: missing --project-base argument." 1>&2
843 exit 1;
844 fi
845 MY_PRJ_PRF="$1"
846 shift
847 ;;
848
849 --workspace)
850 if test $# -eq 0; then
851 echo "error: missing --workspace argument." 1>&2
852 exit 1;
853 fi
854 MY_WS_NAME="$1"
855 shift
856 ;;
857
858 --windows-host)
859 MY_WINDOWS_HOST=1
860 ;;
861
862 --minimal)
863 MY_OPT_MINIMAL=1
864 ;;
865
866 --slickedit-config)
867 MY_SLICK_CONFIG="$1"
868 shift
869 ;;
870
871 # usage
872 --h*|-h*|-?|--?)
873 echo "usage: $0 [--rootdir <rootdir>] [--outdir <outdir>] [--project-base <prefix>] [--workspace <name>] [--minimal] [--slickedit-config <DIR>]"
874 echo ""
875 echo "If --outdir is specified, you must specify a --rootdir relative to it as well."
876 exit 1;
877 ;;
878
879 # default
880 *)
881 echo "error: Invalid parameter '$ARG'" 1>&2
882 exit 1;
883
884 esac
885done
886
887
888#
889# From now on everything *MUST* succeed.
890#
891set -e
892
893
894#
895# Make sure the output directory exists, is valid and clean.
896#
897${MY_RM} -f \
898 "${MY_OUT_DIR}/${MY_PRJ_PRF}"*.vpj \
899 "${MY_OUT_DIR}/${MY_WS_NAME}" \
900 "${MY_OUT_DIR}/`echo ${MY_WS_NAME} | ${MY_SED} -e 's/\.vpw$/.vtg/'`"
901${MY_MKDIR} -p "${MY_OUT_DIR}"
902cd "${MY_OUT_DIR}"
903
904
905#
906# Determine the invocation to conjure up kmk.
907#
908my_abs_dir "tools"
909if test -n "${MY_WINDOWS_HOST}"; then
910 MY_KMK_INVOCATION="cscript.exe /Nologo ${MY_ABS_DIR}/envSub.vbs --quiet -- kmk.exe"
911else
912 MY_KMK_INVOCATION="/usr/bin/env LANG=C ${MY_ABS_DIR}/env.sh --quiet --no-wine kmk"
913fi
914
915
916#
917# Generate the projects (common code) and workspace.
918#
919my_generate_all_projects # in common-gen-workspace-projects.inc.sh
920my_generate_workspace
921
922
923#
924# Update the history file if present.
925#
926MY_FILE="${MY_WS_NAME}histu"
927if test -f "${MY_FILE}"; then
928 echo "Updating ${MY_FILE}..."
929 ${MY_MV} -f "${MY_FILE}" "${MY_FILE}.old"
930 ${MY_SED} -n \
931 -e '/PROJECT_CACHE/d' \
932 -e '/\[TreeExpansion2\]/d' \
933 -e '/^\[/p' \
934 -e '/: /p' \
935 -e '/^CurrentProject/p' \
936 "${MY_FILE}.old" > "${MY_FILE}"
937fi
938
939
940#
941# Generate and update the usercpp.h/unxcpp.h file.
942#
943my_generate_usercpp_h
944
945
946echo "done"
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette