3 #####################################################################
4 # install_ace: distill the minimal stuff out of the ACE+TAO distribution
5 # alias cpio 'xargs -i echo {}'; # just for testing the script
7 # according to David Levine <levine@cs.wustl.edu> on 1999/01/09:
9 # An even better way would be to only build what you need.
10 # These directories are probably a good start:
18 # netsvcs ? - not built in here, probably useful
20 #####################################################################
32 # this script name without path
33 this_script
=$
(basename $0)
35 #####################################################################
36 # check for install_ace options
37 #####################################################################
39 while [ $# -gt 0 ]; do
43 ##########################################
48 echo "$this_script [options]"
51 echo " -h, --help show brief help"
53 echo "required options:"
54 echo " -r, --aceroot=ACE_ROOT use ACE_ROOT directory for build/install"
56 echo "extracting and configuring options:"
57 echo " -z, --archive=FILE unpack specified source archive"
58 echo " -p, --platform=HEADER,MAKE use HEADER,MAKE as config.h, platform_macros"
60 echo "compiling options:"
61 echo " -c, --compile=ACE_OPTS compile with make options (e.g. debug=0)"
63 echo "installing options:"
64 echo " -i, --install=ACE_DEST install into ACE_DEST directory"
65 echo " -a, --arch=ACE_ARCH use ACE_ARCH subdirs for arch-dependent files"
67 echo "miscellaneous options:"
68 echo " -f, --force don't ask for confirmation before proceeding"
73 ##########################################
79 ACE_ROOT
=$1; export ACE_ROOT
81 echo "no ACE_ROOT specified"
88 ACE_ROOT
=$
(echo $1 |
sed -e 's/^[^=]*=//g'); export ACE_ROOT
92 ##########################################
93 # extracting and configuring options
98 ACE_ARCHIVE
=$1; export ACE_ARCHIVE
101 echo "no archive specified"
108 ACE_ARCHIVE
=$
(echo $1 |
sed -e 's/^[^=]*=//g'); export ACE_ARCHIVE
115 if [ $# -gt 0 ]; then
116 ACE_HEADER
=$
(echo $1 | cut
-f 1 -d ,); export ACE_HEADER
117 ACE_MAKE
=$
(echo $1 | cut
-f 2 -d ,); export ACE_MAKE
119 echo "no header,make files specified"
127 stuff
=$
(echo $1 |
sed -e 's/^[^=]*=//g')
128 ACE_HEADER
=$
(echo $stuff | cut
-f 1 -d ,); export ACE_HEADER
129 ACE_MAKE
=$
(echo $stuff | cut
-f 2 -d ,); export ACE_MAKE
134 ##########################################
139 if [ $# -gt 0 ]; then
140 ACE_OPTS
="$1"; export ACE_OPTS
143 echo "no compilation options specified (e.g. debug=0)"
150 ACE_OPTS
=$
(echo $1 |
sed -e 's/^[^=]*=//g'); export ACE_OPTS
155 ##########################################
160 if [ $# -gt 0 ]; then
161 ACE_DEST
=$1; export ACE_DEST
164 echo "no installation target directory specified (e.g. /tools/ace)"
171 ACE_DEST
=$
(echo $1 |
sed -e 's/^[^=]*=//g'); export ACE_DEST
178 if [ $# -gt 0 ]; then
179 ACE_ARCH
=$1; export ACE_ARCH
181 echo "no installation target architecture specified"
188 ACE_ARCH
=$
(echo $1 |
sed -e 's/^[^=]*=//g'); export ACE_ARCH
192 ##########################################
193 # miscellaneous options
201 # no more options, get on with life
202 if [ $# -gt 0 ]; then
203 echo "unrecognized option: $1"
211 #####################################################################
212 # sanity checks for required variables
213 #####################################################################
215 if [ $install -ne 0 ] && [ $compile -ne 0 ] && [ $unpack -eq 0 ]; then
216 echo "- No actions specified."
220 if [ $unpack -ne 0 ] && [ $compile -ne 0 ] && [ $config -eq 0 ] \
221 ||
[ $unpack -ne 0 ] && [ $install -ne 0 ] && [ $config -eq 0 ]; then
222 echo "- Must set platform config options with --platform option"
223 echo " ($this_script -h for help) to unpack and compile/install"
227 if [ -z "$ACE_ROOT" ]; then
228 echo "- Must set ACE_ROOT directory before proceeding..."
229 echo " The directory may be set with the ACE_ROOT environment"
230 echo " variable or the --aceroot option ($this_script -h for help)"
234 if [ $install -eq 1 ] && [ -z "$ACE_ARCH" ]; then
235 # just set it to blank if we want to flatten this level of subdirectory
239 if [ $die -ne 0 ]; then
240 echo "- terminating $this_script script"
245 #####################################################################
246 # announce intentions
247 #####################################################################
249 echo "This script will perform the following actions:"
251 echo "using ACE_ROOT directory: $ACE_ROOT"
253 if [ $unpack -ne 0 ]; then
256 echo "- unpack source archive: $ACE_ARCHIVE"
259 if [ $config -ne 0 ]; then
262 echo "- platform config.h header: $ACE_HEADER"
263 echo "- platform makefile macros: $ACE_MAKE"
266 if [ $compile -ne 0 ]; then
269 echo "- ACE/TAO compile options: $ACE_OPTS"
272 if [ $install -ne 0 ]; then
275 echo "- install target directory: $ACE_DEST"
276 echo "- install target arch: $ACE_ARCH"
282 #####################################################################
283 # confirm desire to proceed
284 #####################################################################
286 if [ $force -eq 0 ]; then
288 echo "Type 'yes' to proceed, anything else to exit"
291 if [ "$ready" != "yes" ]; then
292 echo "Terminating install script. Thank you for playing."
293 echo "We have some lovely parting gifts for you. =)"
299 #####################################################################
300 # extract ACE and TAO
301 #####################################################################
303 if [ $unpack -ne 0 ]; then
305 echo "Unpacking $ACE_ARCHIVE..."
307 cd $
(dirname $ACE_ROOT)
308 gzip -dc $ACE_ARCHIVE |
tar xvf
-
313 #####################################################################
314 # configure ACE and TAO
315 #####################################################################
317 if [ $config -ne 0 ]; then
319 echo "Configuring: $ACE_HEADER,$ACE_MAKE..."
321 # copy the files if they exist
322 test -f $ACE_ROOT/ace
/$ACE_HEADER \
323 && cp $ACE_ROOT/ace
/$ACE_HEADER $ACE_ROOT/ace
/config.h
324 test -f $ACE_ROOT/include
/makeinclude
/$ACE_MAKE \
325 && cp $ACE_ROOT/include
/makeinclude
/$ACE_MAKE \
326 $ACE_ROOT/include
/makeinclude
/platform_macros.GNU
328 # print error message and die if they don't
329 if [ ! -f $ACE_ROOT/ace
/$ACE_HEADER ]; then
330 echo "error: $ACE_HEADER doesn't exist"
333 if [ ! -f $ACE_ROOT/include
/makeinclude
/$ACE_MAKE ]; then
334 echo "error: $ACE_MAKE doesn't exist"
338 if [ $die -ne 0 ]; then
345 #####################################################################
346 # compile ACE and TAO
347 #####################################################################
349 if [ $compile -ne 0 ]; then
351 echo "Compiling: $ACE_OPTS..."
353 ##########################################
354 # add ACE_ROOT/ace to LD_LIBRARY_PATH so tao_idl can find libACE.so
355 if [ "$(uname -s)" = "HP-UX" ]; then
356 if [ ! -z "$SHLIB_PATH" ]; then
357 SHLIB_PATH
=$ACE_ROOT/ace
:$SHLIB_PATH
359 SHLIB_PATH
=$ACE_ROOT/ace
; export SHLIB_PATH
362 if [ ! -z "$LD_LIBRARY_PATH" ]; then
363 LD_LIBRARY_PATH
=$ACE_ROOT/ace
:$LD_LIBRARY_PATH
365 LD_LIBRARY_PATH
=$ACE_ROOT/ace
; export LD_LIBRARY_PATH
369 ##########################################
370 # compile a few select directories
371 for d
in ace apps
/gperf
/src TAO
/tao TAO
/TAO_IDL TAO
/orbsvcs TAO
/utils
; do
372 echo --- Building
in $d.
375 if [ $?
-ne 0 ]; then
376 echo --- Error during build
: $?
383 #####################################################################
384 # install ACE and TAO
385 #####################################################################
387 if [ $install -ne 0 ]; then
389 echo "Installing: $ACE_DEST..."
391 ##########################################
392 # determine final target directories
394 ACE_VER
=$
(head -n 1 $ACE_ROOT/VERSION.txt |
sed -e 's/^[^0-9]*//' -e 's/[, ].*//')
395 ACE_DIR
="$ACE_DEST/ACE-$ACE_VER"; export ACE_DIR
397 TAO_VER
=$
(head -n 1 $ACE_ROOT/TAO
/VERSION.txt |
sed -e 's/^[^0-9]*//' -e 's/[, ].*//')
398 TAO_DIR
="$ACE_DEST/TAO-$TAO_VER"; export ACE_DIR
400 ##########################################
401 # create target directories as needed
402 echo "creating target directories..."
404 ace_dirs
="$ACE_DIR $ACE_DIR/include $ACE_DIR/man"
405 ace_arch_dirs
="$ACE_DIR/$ACE_ARCH/include/ace \
406 $ACE_DIR/$ACE_ARCH/bin $ACE_DIR/$ACE_ARCH/lib"
407 tao_dirs
="$TAO_DIR $TAO_DIR/include $TAO_DIR/include/orbsvcs"
408 tao_arch_dirs
="$TAO_DIR/$ACE_ARCH/include \
409 $TAO_DIR/$ACE_ARCH/bin $TAO_DIR/$ACE_ARCH/lib"
411 for dir
in $ace_dirs $ace_arch_dirs $tao_dirs $tao_arch_dirs; do
412 if [ ! -d $dir ]; then
418 ##########################################
422 cp VERSION.txt
$TAO_DIR/$ACE_ARCH/TAO-VERSION
425 echo "Copying include files..."
426 find tao
-type f
-name "*.idl" -print |
cpio -p -d -V $TAO_DIR/include
427 find tao
-type f
-name "*.pidl" -print |
cpio -p -d -V $TAO_DIR/include
428 find tao
-type f
-name "*.h" -print |
grep -v "^config\.h" |
cpio -p -d -V $TAO_DIR/include
429 find tao
-type f \
( -name "*.i" -o -name "*.inl" \
) -print |
cpio -p -d -V $TAO_DIR/include
430 find tao
-type f
-name "*.cpp" -print |
cpio -p -d -V $TAO_DIR/include
432 # NOTE: may need all .h, .i and .cpp under TAO/orbsvcs, instead of just TAO/orbsvcs/orbsvcs
434 find orbsvcs
-type f
-name "*.idl" -print |
cpio -p -d -V $TAO_DIR/include
435 find orbsvcs
-type f
-name "*.pidl" -print |
cpio -p -d -V $TAO_DIR/include
436 find orbsvcs
-type f
-name "*.h" -print |
grep -v "^config\.h" |
cpio -p -d -V $TAO_DIR/include
437 find orbsvcs
-type f \
( -name "*.i" -o -name "*.inl" \
) -print |
cpio -p -d -V $TAO_DIR/include
438 find orbsvcs
-type f
-name "*.cpp" -print |
cpio -p -d -V $TAO_DIR/include
442 echo "Copying libraries..."
443 for f
in $
(find .
-type f \
( -name "lib?*.so*" -o -name "lib?*.a" -o -name "lib?*.dll" -o -name "*.dylib" \
) -print); do
445 cp $f $TAO_DIR/$ACE_ARCH/lib
448 # copy TAO executables
449 echo "Copying executables..."
451 ALL_PROGS
=$
(find orbsvcs
-type f
-perm /a
+x
-print |
grep -v ".*lib.*" |
grep -v ".\.pl" |
grep -v test |
grep -v example
)
452 ALL_PROGS
="$(find utils -type f -perm /a+x -print) $ALL_PROGS"
453 PROGS
=$
(echo $ALL_PROGS |
tr " " "\n" |
grep -v test |
grep -v default.bld |
grep -v README |
grep -v GNUmakefile
)
455 for f
in TAO_IDL
/tao_idl
$PROGS; do
457 cp $f $TAO_DIR/$ACE_ARCH/bin
460 ##########################################
464 cp VERSION.txt
$ACE_DIR/$ACE_ARCH/ACE-VERSION
467 echo "Copying include files..."
468 find ace
-type f
-name "*.h" -print |
grep -v "^config\.h" |
cpio -p -d -V $ACE_DIR/include
469 find ace
-type f \
( -name "*.i" -o -name "*.inl" \
) -print |
cpio -p -d -V $ACE_DIR/include
470 find ace
-type f
-name "*.cpp" -print |
cpio -p -d -V $ACE_DIR/include
471 cp ace
/config.h
$ACE_DIR/$ACE_ARCH/include
/ace
/config.h
472 chmod -R a
+r
$ACE_DIR/$ACE_ARCH/include
475 echo "Copying libraries..."
476 for f
in $
(find .
-type f \
( -name "lib?*.so*" -o -name "lib?*.a" -o -name "lib?*.dll" -o -name "*.dylib" \
) -print); do
477 # only copy libs if they're not already in $TAO_DIR/$ACE_ARCH/lib
478 maybe_tao_lib
=$TAO_DIR/$ACE_ARCH/lib
/$
(basename $f)
479 if [ ! -f $maybe_tao_lib ]; then
481 cp $f $ACE_DIR/$ACE_ARCH/lib
483 test -f $maybe_tao_lib && echo "library $f already installed with TAO"
486 # copy ACE executables
487 echo "Copying executables..."
488 ACE_PROGS
=apps
/gperf
/src
/ace_gperf
490 for f
in $ACE_PROGS; do
492 cp $f $ACE_DIR/$ACE_ARCH/bin
496 echo "Copying man pages..."
497 find man
-type f
-print |
cpio -p -d -V $ACE_DIR
501 chmod -R a
+r
$ACE_DEST
502 find $ACE_DEST -type d
-exec chmod a
+x
{} \
;
503 find $ACE_DEST -type f
-perm /a
+x
-exec chmod a
+x
{} \
;
505 fi # if [ $install -ne 0 ]
508 #####################################################################
510 #####################################################################
512 echo "$this_script: done."