aboutsummaryrefslogtreecommitdiff
path: root/cvs/cvsweb.cgi/code/tool/build/build?rev=1.5&content-type=text/x-cvsweb-markup/index.html
blob: ddc6672bdd000363a3d387407523f9163591f679 (plain)
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD><style>		A { color:black }</style>
<!-- hennerik CVSweb $Revision: 1.93 $ -->
<TITLE>code/tool/build/build - view - 1.5</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee">
<table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="#aaaaaa"><tr valign=bottom><td><a href="build"><IMG SRC="/inc/img/picto-up.gif" ALT="[BACK]" BORDER="0" WIDTH="14" HEIGHT="13"></a> <b>Return to <A HREF="build">build</A>
 CVS log</b> <IMG SRC="/inc/img/picto-news.gif" ALT="[TXT]" BORDER="0" WIDTH="13" HEIGHT="15"></td><td align=right><IMG SRC="/inc/img/picto-dir.gif" ALT="[DIR]" BORDER="0" WIDTH="15" HEIGHT="13"> <b>Up to  <a href="/cvs/cvsweb.cgi/">Nevrax</a> / <a href="/cvs/cvsweb.cgi/code/">code</a> / <a href="/cvs/cvsweb.cgi/code/tool/">tool</a> / <a href="/cvs/cvsweb.cgi/code/tool/build/">build</a></b></td></tr></table><HR noshade><table width="100%"><tr><td bgcolor="#ffffff">File:  <a href="/cvs/cvsweb.cgi/">Nevrax</a> / <a href="/cvs/cvsweb.cgi/code/">code</a> / <a href="/cvs/cvsweb.cgi/code/tool/">tool</a> / <a href="/cvs/cvsweb.cgi/code/tool/build/">build</a> / <a href="/cvs/cvsweb.cgi/code/tool/build/build">build</a>&nbsp;(<A HREF="/cvs/cvsweb.cgi/~checkout~/code/tool/build/build?rev=1.5" target="cvs_checkout" onClick="window.open('/cvs/cvsweb.cgi/~checkout~/code/tool/build/build?rev=1.5','cvs_checkout','resizeable,scrollbars');"><b>download</b></A>)<BR>
Revision <B>1.5</B>, <i>Tue May 21 15:44:16 2002 UTC</i> (6 weeks ago) by <i>valignat</i>
<BR>Branch: <b>MAIN</b>
<BR>CVS Tags: <b>HEAD</b><BR>Changes since <b>1.4: +3 -3
 lines</b><PRE>
#small cleanups
</PRE>
</td></tr></table><HR noshade><PRE>#!/bin/sh

###########################################################################
# $Id: build,v 1.5 2002/05/21 15:44:16 valignat Exp $
###########################################################################
###########################################################################
###########################################################################
# BUILD:
#
# &nbsp; &nbsp; This tool is aimed to help Nevrax programmers to manage the
# &nbsp; &nbsp; compilation of a &quot;debug&quot; and a &quot;release&quot; version of NeL, NeLNS,
# &nbsp; &nbsp; and Snowballs2 (<A HREF=""></A>) based on the same source
# &nbsp; &nbsp; code and with the possibility to not having to re-compile everything
# &nbsp; &nbsp; each time the compilation mode (debug/release) change.
#
# &nbsp; &nbsp; This script is a simple wrapper around the 'bootstrap'/'configure'
# &nbsp; &nbsp; commands ('build init nel/nelns/snowballs ...'), and the 'make'
# &nbsp; &nbsp; command ('build nel/nelns/snowballs ...').
#
# &nbsp; &nbsp; Example of use:
#
# &nbsp; &nbsp; &nbsp; &nbsp; $ build mode debug dynamic quiet
# &nbsp; &nbsp; &nbsp; &nbsp; $ build init nel --enable-sound --enable-georges --enable-ai
# &nbsp; &nbsp; &nbsp; &nbsp; $ build nel all install
# &nbsp; &nbsp; &nbsp; &nbsp; $ build init nelns
# &nbsp; &nbsp; &nbsp; &nbsp; $ build nelns all install
# &nbsp; &nbsp; &nbsp; &nbsp; $ build init snowballs
# &nbsp; &nbsp; &nbsp; &nbsp; $ build snowballs all install
#
# &nbsp; &nbsp; As you can see there is no need to specify the installed directory
# &nbsp; &nbsp; of NeL, etc ... These informations are automaticly provided to the
# &nbsp; &nbsp; configure script.
#
# &nbsp; &nbsp; Check the following variables to get an idea of the place of the
# &nbsp; &nbsp; source code, object, and installed files.
#
# &nbsp; &nbsp; In quiet mode it use a perl script named 'buildquiet' which
# &nbsp; &nbsp; &quot;cleanup&quot; the 'make' command output to only print the compiled
# &nbsp; &nbsp; file name instead of the compilation command line.
#
###########################################################################


###########################################################################
###########################################################################
###########################################################################
# VARIABLES

# Set the source directory. Use the environment SRC_DIR variable, if it's
# not set, use $HOME/cvs as a default value
SRC_DIR=&quot;$HOME/cvs&quot;

# Build diretories
BUILD_DEBUG=&quot;$HOME/build/debug&quot;
BUILD_RELEASE=&quot;$HOME/build/release&quot;

# Install directories
INSTALL_DEBUG=&quot;$HOME/install/debug&quot;
INSTALL_RELEASE=&quot;$HOME/install/release&quot;

# PKG config
STLPORT_DIR='/home/installs/STLport-4.5.3'
PYTHON_VERSION=2

# Compiler options
BUILD_CFLAGS=&quot;$CFLAGS -pipe&quot;
BUILD_CXXFLAGS=&quot;$CXXFLAGS -pipe&quot;

# Configure options
CONFIGURE_OPT=&quot;--disable-xmltest --enable-maintainer-mode&quot;

###########################################################################

# Flag files associated to each mode
DEBUG_FILE=&quot;$HOME/.mode_debug&quot;
STATIC_FILE=&quot;$HOME/.mode_static&quot;
DYNAMIC_FILE=&quot;$HOME/.mode_dynamic&quot;
SILENT_FILE=&quot;$HOME/.mode_silent&quot;

# Specify the source code directory of each projects
NEL_SRC=&quot;$SRC_DIR/code/nel&quot;
SNOWBALLS_SRC=&quot;$SRC_DIR/code/snowballs2&quot;
NELNS_SRC=&quot;$SRC_DIR/code/nelns&quot;


###########################################################################
###########################################################################
###########################################################################
# FUNCTIONS


###########################################################################
# Print command usage
printUsage()
{
 &nbsp; &nbsp;echo &quot;&quot;
 &nbsp; &nbsp;echo &quot;Usage: $BUILD_CMD mode [debug] [static] [dynamic] [quiet]&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug &nbsp; -&gt; turn ON/OFF debug compilation&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; static &nbsp;-&gt; turn ON/OFF static linking&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dynamic -&gt; turn ON/OFF dynamic linking&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quiet &nbsp; -&gt; turn ON/OFF quiet &nbsp;compilation&quot;
 &nbsp; &nbsp;echo &quot;&quot;
 &nbsp; &nbsp;echo &quot;Usage: $BUILD_CMD [init] [nel | nelns | snowballs] [ARGS]&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; init &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-&gt; init. the build system&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nel, nelns, snowballs -&gt; module to init./compile&quot;
 &nbsp; &nbsp;echo &quot;&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ARGS with init are passed to the 'configure' script&quot;
 &nbsp; &nbsp;echo &quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;otherwise they are passed to 'make'&quot;
 &nbsp; &nbsp;echo &quot;&quot;
}


###########################################################################
# Print status
printMode()
{
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;Compilation modes :&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot; &nbsp; Debug mode &nbsp; &nbsp; &nbsp;: $DEBUG_MODE&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot; &nbsp; Static linking &nbsp;: $STATIC_MODE&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot; &nbsp; Dynamic linking : $DYNAMIC_MODE&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot; &nbsp; Quiet compilation &nbsp;: $SILENT_MODE&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;&quot;
}


###########################################################################
# Print a message error (given in argument) and exit.
printError()
{
 &nbsp; &nbsp;local MSG=$1

 &nbsp; &nbsp;echo &quot;*** ERROR: $MSG ***&quot; &gt;&amp;2

 &nbsp; &nbsp;exit 1
}


###########################################################################
# Get the specific mode value and set the corresponding variable
getMode()
{
 &nbsp; &nbsp;local VAR=$1
 &nbsp; &nbsp;local FILE=$2

 &nbsp; &nbsp;if test -f &quot;$FILE&quot;
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;eval $VAR=ON
 &nbsp; &nbsp;else
 &nbsp; &nbsp; &nbsp; &nbsp;eval $VAR=OFF
 &nbsp; &nbsp;fi
}


###########################################################################
# Set a specific mode to ON if it's OFF, and to OFF if its ON
setMode()
{
 &nbsp; &nbsp;local VAR=$1
 &nbsp; &nbsp;local FILE=$2
 &nbsp; &nbsp;local OLD_VALUE NEW_VALUE

 &nbsp; &nbsp;# Get the current mode value
 &nbsp; &nbsp;OLD_VALUE=$(eval echo \$$VAR)

 &nbsp; &nbsp;if test X&quot;$OLD_VALUE&quot; = &quot;XOFF&quot;
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;# Set the MODE to ON in case it's OFF
 &nbsp; &nbsp; &nbsp; &nbsp;NEW_VALUE=ON
 &nbsp; &nbsp; &nbsp; &nbsp;touch -f $FILE || printError &quot;cannot create mode file: $FILE&quot;
 &nbsp; &nbsp;else
 &nbsp; &nbsp; &nbsp; &nbsp;# Set the MODE to OFF in case it's ON
 &nbsp; &nbsp; &nbsp; &nbsp;NEW_VALUE=OFF
 &nbsp; &nbsp; &nbsp; &nbsp;rm -f $FILE || printError &quot;cannot delete mode file: $FILE&quot;
 &nbsp; &nbsp;fi 

 &nbsp; &nbsp;eval $VAR=$NEW_VALUE
}


###########################################################################
###########################################################################
###########################################################################

BUILD_CMD=`basename $0`

###########################################################################
# Get current the mode settings
getMode DEBUG_MODE &nbsp; $DEBUG_FILE
getMode STATIC_MODE &nbsp;$STATIC_FILE
getMode DYNAMIC_MODE $DYNAMIC_FILE
getMode SILENT_MODE &nbsp;$SILENT_FILE


###########################################################################
###########################################################################
###########################################################################
# BUILDMODE / BUILD MODE call

if test &quot;$BUILD_CMD&quot; = 'buildmode' -o &quot;$1&quot; = 'mode'
then

 &nbsp; &nbsp;if test &quot;$1&quot; = 'mode'
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;shift
 &nbsp; &nbsp;fi

 &nbsp; &nbsp;# Print the mode values and exit if there is no argument
 &nbsp; &nbsp;if test $# -eq 0
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;printMode
 &nbsp; &nbsp; &nbsp; &nbsp;exit 0
 &nbsp; &nbsp;fi

 &nbsp; &nbsp;while test $# -gt 0
 &nbsp; &nbsp;do
 &nbsp; &nbsp; &nbsp; &nbsp;case $1 in

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setMode DEBUG_MODE &nbsp; $DEBUG_FILE
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; static) 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setMode STATIC_MODE &nbsp;$STATIC_FILE
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dynamic)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setMode DYNAMIC_MODE $DYNAMIC_FILE
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quiet|silent)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setMode SILENT_MODE $SILENT_FILE
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *) &nbsp;echo &quot;*** ERROR : $1 : Unknown building mode ***&quot; &gt;&amp;2
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printUsage
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit 1
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;

 &nbsp; &nbsp; &nbsp; &nbsp;esac

 &nbsp; &nbsp; &nbsp; &nbsp;shift

 &nbsp; &nbsp;done

 &nbsp; &nbsp;printMode

 &nbsp; &nbsp;exit 0 

fi


###########################################################################
###########################################################################
# Default call: BUILD


###########################################################################
# Set the LD_LIBRARY_PATH variable to use the STLPORT
if test -n &quot;$STLPORT_DIR&quot;
then
 &nbsp; &nbsp;CONFIGURE_OPT=&quot;$CONFIGURE_OPT --with-stlport=$STLPORT_DIR&quot;

 &nbsp; &nbsp;if test -z &quot;$LD_LIBRARY_PATH&quot;
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;LD_LIBRARY_PATH=&quot;$STLPORT_DIR/lib&quot;
 &nbsp; &nbsp;else
 &nbsp; &nbsp; &nbsp; &nbsp;LD_LIBRARY_PATH=&quot;$STLPORT_DIR/lib:$LD_LIBRARY_PATH&quot;
 &nbsp; &nbsp;fi
fi

# Set the configure option to use the rigth python version
if test -n &quot;$PYTHON_VERSION&quot;
then
 &nbsp; &nbsp;CONFIGURE_OPT=&quot;$CONFIGURE_OPT --with-python-version=$PYTHON_VERSION&quot;
fi


###########################################################################

echo &quot;&quot;
echo &quot;Using source directory : $SRC_DIR&quot;

# If we are in debug mode we use the debug build and install directories
# Otherwise we use the release build and install directories
if test &quot;$DEBUG_MODE&quot; = 'ON'
then
 &nbsp; &nbsp;BUILD_DIR=$BUILD_DEBUG
 &nbsp; &nbsp;INSTALL_DIR=$INSTALL_DEBUG
 &nbsp; &nbsp;CONFIGURE_OPT=&quot;$CONFIGURE_OPT --with-debug&quot;
 &nbsp; &nbsp;PATH=&quot;$INSTALL_DEBUG/bin:$PATH&quot;
 &nbsp; &nbsp;LD_LIBRARY_PATH=&quot;$INSTALL_DEBUG/lib:LD_LIBRARY_PATH&quot;
else
 &nbsp; &nbsp;BUILD_DIR=$BUILD_RELEASE
 &nbsp; &nbsp;INSTALL_DIR=$INSTALL_RELEASE
 &nbsp; &nbsp;BUILD_CFLAGS=&quot;$BUILD_CFLAGS -march=pentium&quot;
 &nbsp; &nbsp;BUILD_CXXFLAGS=&quot;$BUILD_CXXFLAGS -march=pentium&quot;
 &nbsp; &nbsp;PATH=&quot;$INSTALL_RELEASE/bin:$PATH&quot;
 &nbsp; &nbsp;LD_LIBRARY_PATH=&quot;$INSTALL_RELEASE/lib:$LD_LIBRARY_PATH&quot;
fi
export PATH
export LD_LIBRARY_PATH

# Set where to install and where find NeL library files
CONFIGURE_OPT=&quot;$CONFIGURE_OPT --prefix=$INSTALL_DIR --with-nel=$INSTALL_DIR&quot;

# Get if it's a static and/or a dynamic compilation
if test &quot;$STATIC_MODE&quot; != &quot;$DYNAMIC_MODE&quot;
then
 &nbsp; &nbsp;if test &quot;$STATIC_MODE&quot; = 'ON'
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;CONFIGURE_OPT=&quot;--enable-static=yes --enable-shared=no $CONFIGURE_OPT&quot;
 &nbsp; &nbsp;fi

 &nbsp; &nbsp;if test &quot;$DYNAMIC_MODE&quot; = 'ON'
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;CONFIGURE_OPT=&quot;--enable-static=no --enable-shared=yes $CONFIGURE_OPT&quot;
 &nbsp; &nbsp;fi
else
 &nbsp; &nbsp;if test &quot;$DYNAMIC_MODE&quot; = 'OFF' -a &quot;$STATIC_MODE&quot; = 'OFF'
 &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;*** ERROR: You must set building of static and/or dynamic libraries ***&quot; &gt;&amp;2
 &nbsp; &nbsp; &nbsp; &nbsp;printUsage
 &nbsp; &nbsp; &nbsp; &nbsp;exit 1
 &nbsp; &nbsp;else
 &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;*** WARNING: Building both static and dynamic libraries ***&quot; &gt;&amp;2
 &nbsp; &nbsp;fi
fi

if test $# -eq 0
then
 &nbsp; &nbsp;echo &quot;*** ERROR: You have to decide what to do !... ***&quot; &gt;&amp;2
 &nbsp; &nbsp;printUsage
 &nbsp; &nbsp;exit 1
fi


case $1 in

 &nbsp; &nbsp;# Modules initialisation
 &nbsp; &nbsp;init)
 &nbsp; &nbsp; &nbsp; &nbsp;BUILD_ARG=$2

 &nbsp; &nbsp; &nbsp; &nbsp;buildmode

 &nbsp; &nbsp; &nbsp; &nbsp;case &quot;$BUILD_ARG&quot; in

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nel|nelns|snowballs)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Create the build directories
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if test ! -d $BUILD_DIR/$BUILD_ARG
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo -n &quot;Creating $BUILD_DIR/$ARG ...&quot;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mkdir -p $BUILD_DIR/$BUILD_ARG \
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| printError &quot;cannot create the $BUILD_DIR/$BUILD_ARG directory&quot;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo &quot; done&quot;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fi

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Erase the already existing configuration cache
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rm -f $BUILD_DIR/$BUILD_ARG/config.cache \
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$BUILD_DIR/$BUILD_ARG/config.h

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shift
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shift

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Run the bootstrap script
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cd &nbsp;$SRC_DIR/code/$BUILD_ARG \
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| printError &quot;You must get the source files first !...&quot;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;./bootstrap

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Run the configure script
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cd $BUILD_DIR/$BUILD_ARG 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CFLAGS=&quot;$BUILD_CFLAGS&quot; CXXFLAGS=&quot;$BUILD_CXXFLAGS&quot; \
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$SRC_DIR/code/$BUILD_ARG/configure $CONFIGURE_OPT $* || exit 1
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;;

 &nbsp; &nbsp; &nbsp; &nbsp;*) &nbsp;echo &quot;*** ERROR: $BUILD_ARG : Unknown module ***&quot; &gt;&amp;2
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printUsage
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit 1
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;;

 &nbsp; &nbsp; &nbsp; &nbsp;esac
 &nbsp; &nbsp; &nbsp; &nbsp;;;

 &nbsp; &nbsp;# Modules compilation
 &nbsp; &nbsp;nel|nelns|snowballs)
 &nbsp; &nbsp; &nbsp; &nbsp;BUILD_MODULE=$1
 &nbsp; &nbsp; &nbsp; &nbsp;shift

 &nbsp; &nbsp; &nbsp; &nbsp;# VPATH compilation and NeL include's Makefile.am command
 &nbsp; &nbsp; &nbsp; &nbsp;# '$(wildcard *.h)' doesn't like each other very much. So the
 &nbsp; &nbsp; &nbsp; &nbsp;# include files must be copied in NeL's compilation directory
 &nbsp; &nbsp; &nbsp; &nbsp;# before each build (in case one or several header files changed).
 &nbsp; &nbsp; &nbsp; &nbsp;if test &quot;$BUILD_MODULE&quot; = &quot;nel&quot;
 &nbsp; &nbsp; &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Delete any existing include file in the compilation
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# directory to avoid any kind of conflict
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if test -d $BUILD_DIR/nel/include/nel
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cd $BUILD_DIR/nel/include/nel
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;find . -type f -name \*.h -exec rm -rf \{\} \;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printError &quot;You must get the source files first !...&quot;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fi

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Copy the headers
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mkdir -p $BUILD_DIR/nel \
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;&amp; cp -Rfdp $NEL_SRC/include $BUILD_DIR/nel

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Remove from the compilation directory the useless CVS
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# informations
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cd $BUILD_DIR/nel/include \
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;&amp; find . -prune -type d -name CVS -exec rm -rf \{\} \;

 &nbsp; &nbsp; &nbsp; &nbsp;fi

 &nbsp; &nbsp; &nbsp; &nbsp;cd $BUILD_DIR/$BUILD_MODULE || exit 1

 &nbsp; &nbsp; &nbsp; &nbsp;# Launch make in silent mode or not, depending of the config.
 &nbsp; &nbsp; &nbsp; &nbsp;if test $SILENT_MODE = 'ON'
 &nbsp; &nbsp; &nbsp; &nbsp;then
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;make $* | buildquiet
 &nbsp; &nbsp; &nbsp; &nbsp;else
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;make $*
 &nbsp; &nbsp; &nbsp; &nbsp;fi
 &nbsp; &nbsp; &nbsp; &nbsp;;;

 &nbsp; &nbsp;*) &nbsp;echo &quot;*** ERROR: $1 : Unknown argument ***&quot; &gt;&amp;2
 &nbsp; &nbsp; &nbsp; &nbsp;printUsage
 &nbsp; &nbsp; &nbsp; &nbsp;exit 1
 &nbsp; &nbsp; &nbsp; &nbsp;;;

esac

exit 0

# End of file

</PRE>