-
Notifications
You must be signed in to change notification settings - Fork 25
/
buildall
235 lines (191 loc) · 6.31 KB
/
buildall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#!/bin/sh
# ==++==
#
#
# Copyright (c) 2006 Microsoft Corporation. All rights reserved.
#
# The use and distribution terms for this software are contained in the file
# named license.txt, which can be found in the root of this distribution.
# By using this software in any fashion, you are agreeing to be bound by the
# terms of this license.
#
# You must not remove this notice, or any other, from this software.
#
#
# ==--==
if test X"${_NTTREE}" = "X"
then
echo "ERROR: The _NTTREE environment variable isn't set."
echo "Please source the appropriate env.sh or env.csh file."
exit 1
fi
CLEANOPTION=$1
VTTYOPTION=$2
BUILDOPTIONS=$*
if test -r ${ROTOR_DIR}/buildall.out; then rm -f ${ROTOR_DIR}/buildall.out;fi
ReportError()
{
echo \*\*\* Error while building ${BUILDALL_BUILDING}
echo Open ${BUILDALL_ERRORLOG} to see the error log.
if test X"${BUILDITALL}" != "X"
then
echo setenv BUILDALL_BUILDING ${BUILDALL_BUILDING} > ${ROTOR_DIR}/buildall.out
echo setenv BUILDALL_ERRORLOG ${BUILDALL_ERRORLOG} >>${ROTOR_DIR}/buildall.out
echo setenv BUILDALL_WARNINGLOG ${BUILDALL_WARNINGLOG} >>${ROTOR_DIR}/buildall.out
fi
exit 1
}
ReportBuildError()
{
BUILDALL_ERRORLOG=${BUILDALL_BUILDING}/${LOGBASENAME}.err
BUILDALL_WARNINGLOG=${BUILDALL_BUILDING}/${LOGBASENAME}.wrn
ReportError
}
RunMake()
{
BUILDALL_BUILDING=$1
echo Building $2
BUILDALL_ERRORLOG=${BUILDALL_BUILDING}/${LOGBASENAME}.log
BUILDALL_WARNINGLOG=
if test -r ${BUILDALL_ERRORLOG}; then rm -f ${BUILDALL_ERRORLOG};fi
cd ${BUILDALL_BUILDING}
if test X"${CLEANOPTION}" = "X-c"
then
echo $MAKE clean:>>${BUILDALL_ERRORLOG}
$MAKE clean >>${BUILDALL_ERRORLOG} 2>&1
if test $? != 0 ; then ReportError; fi
fi
echo $MAKE: >>${BUILDALL_ERRORLOG}
$MAKE >${BUILDALL_ERRORLOG} 2>&1
if test $? != 0 ; then ReportError; fi
return 0
}
RunBuild()
{
BUILDALL_BUILDING=$1
echo Building $2
cd ${BUILDALL_BUILDING}
if test X"${VTTYOPTION}" = "X-vtty"; then BUILDOPTIONS = "$BUILDOPTIONS -vtty"; fi
build $3 $4 $5 $BUILDOPTIONS
if test $? != 0 ; then ReportBuildError; fi
}
RunSetup()
{
BUILDALL_BUILDING="${BUILDALL_SETUP_SCRIPT}"
echo Setting up $1
BUILDALL_ERRORLOG="${BUILDALL_SETUP_LOG}"
BUILDALL_WARNINGLOG=
perl ${BUILDALL_BUILDING} $2 $3 >>${BUILDALL_ERRORLOG}
if test $? != 0 ; then ReportError; fi
}
RunConfigure()
{
BUILDALL_BUILDING="${ROTOR_DIR}/make configure"
BUILDALL_ERRORLOG=${ROTOR_DIR}/obj${BUILD_ALT_DIR}/${_BUILDARCH}/${LOGBASENAME}.log
mkdir -p ${ROTOR_DIR}/obj${BUILD_ALT_DIR}/${_BUILDARCH}
if [ X"${_BUILDTYPE}" = "Xprf" ] || [ X"${CLEANOPTION}" = "X-c" ]
then
$MAKE clean_configure >>${BUILDALL_ERRORLOG} 2>&1
if test $? != 0 ; then ReportError; fi
fi
$MAKE configure >>${BUILDALL_ERRORLOG} 2>&1
if test $? != 0; then ReportError; fi
}
MakeClean()
{
echo $MAKE clean:>>${BUILDALL_ERRORLOG}
$MAKE clean >>${BUILDALL_ERRORLOG} 2>&1
if test $? != 0 ; then ReportError; fi
echo $MAKE depend: >>${BUILDALL_ERRORLOG}
$MAKE depend >>${BUILDALL_ERRORLOG} 2>&1
if test $? != 0 ; then ReportError; fi
}
BuildPAL()
{
if test $1 = perf
then
echo Building the PAL performance library...
else
echo Building the PAL library...
fi
BUILDALL_BUILDING=${ROTOR_DIR}/pal/${PAL_UNIX_DIR}
BUILDALL_ERRORLOG=${BUILDALL_BUILDING}/${LOGBASENAME}.log
if [ "$1" != "pass2" ]
then
if test -r ${BUILDALL_ERRORLOG}; then rm -f ${BUILDALL_ERRORLOG}; fi
fi
cd ${BUILDALL_BUILDING}
if [ X"${CLEANOPTION}" = "X-c" ]
then
MakeClean
fi
echo $MAKE: >>${BUILDALL_ERRORLOG}
$MAKE >>${BUILDALL_ERRORLOG} 2>&1
if test $? != 0 ; then ReportError; fi
}
BuildBaseTools()
{
RunMake ${ROTOR_DIR}/tools/nmake "nmake tool"
RunMake ${ROTOR_DIR}/tools/cppmunge "cppmunge tool"
RunMake ${ROTOR_DIR}/tools/binplace "binplace tool"
RunMake ${ROTOR_DIR}/tools/build "build tool"
RunBuild ${ROTOR_DIR}/tools/resourcecompiler "Resource Compiler"
}
BuildPalRT()
{
RunBuild ${ROTOR_DIR}/palrt "PAL RT"
RunBuild ${ROTOR_DIR}/palrt/msgs "PAL Resources"
if test -r ${ROTOR_DIR}/palrt/unilib/sources; then RunBuild ${ROTOR_DIR}/palrt/unilib "UniLib"; fi
}
if test X"${CLEANOPTION}" = "X-c" ; then
rm -r -f ${_NTTREE};
fi
mkdir -p ${_NTTREE}
mkdir -p ${_NTTREE}/sdk/pal/lib/${_BUILDTYPE}/${_BUILDARCH}
mkdir -p ${NDPDIR}/clr/lib/${_BUILDTYPE}/${_BUILDARCH}
# Allow custom makes. We can use bsdmake on Mac OS X, for example.
if test X"$MAKE" = "X"
then
MAKE=make
export MAKE
fi
# Run the configure for the rotor directory
echo Running configure...
RunConfigure $1
BuildPAL normal
BUILDALL_SETUP_SCRIPT=${ROTOR_DIR}/env/bin/setup.pl
BUILDALL_SETUP_LOG=${_NTTREE}/setup${BUILD_ALT_DIR}_${_BUILDARCH}.log
echo Copy prebuilt files.
mkdir -p ${ROTOR_DIR}/prebuilt/idl/obj${BUILD_ALT_DIR}/${_BUILDARCH}
cp -p -f ${ROTOR_DIR}/prebuilt/idl/*.h ${ROTOR_DIR}/prebuilt/idl/obj${BUILD_ALT_DIR}/${_BUILDARCH}/
cp -p -f ${ROTOR_DIR}/prebuilt/idl/*_i.c ${ROTOR_DIR}/prebuilt/idl/obj${BUILD_ALT_DIR}/${_BUILDARCH}/
mkdir -p ${ROTOR_DIR}/prebuilt/yacc/obj${BUILD_ALT_DIR}/${_BUILDARCH}
cp -p -f ${ROTOR_DIR}/prebuilt/yacc/*.c ${ROTOR_DIR}/prebuilt/yacc/obj${BUILD_ALT_DIR}/${_BUILDARCH}/
BuildBaseTools
BuildPalRT
RunBuild ${BASEDIR}/csharp "C# Compiler"
RunBuild ${NDPDIR}/clr/src "CLR"
BUILD_OPTIONS="~misc"
export BUILD_OPTIONS
RunBuild ${NDPDIR}/fx/src "FX - pass1 only" -L
BUILD_OPTIONS=""
export BUILD_OPTIONS
RunBuild ${NDPDIR}/clr/src/managedlibraries "Remoting - pass1 only" -L
RunBuild ${VSADIR} "JScript - pass1 only" -L
RunBuild ${NDPDIR}/fx/src/sys "FX - System.dll"
RunSetup "System.dll" GAC System.dll
BUILD_OPTIONS="~sys ~misc"
export BUILD_OPTIONS
RunBuild ${NDPDIR}/fx/src "FX"
RunSetup "System.Configuration.dll" GAC System.Configuration.dll
BUILD_OPTIONS=""
export BUILD_OPTIONS
RunSetup "System.Configuration.dll" GAC System.Configuration.dll
RunSetup "System.Xml.dll" GAC System.Xml.dll
RunSetup "System.Data.SqlXml.dll" GAC System.Data.SqlXml.dll
RunBuild ${NDPDIR}/fx/src/misc "FX - Misc"
RunBuild ${NDPDIR}/clr/src/managedlibraries "Remoting"
RunBuild ${VSADIR} "JScript"
RunSetup "everything"
RunBuild ${ROTOR_DIR}/samples "the samples"
exit 0