3 ###############################################################################
5 # $XConsortium: dtinfogen /main/10 1996/09/06 14:24:23 cde-hal $
7 # $XConsortium: dtinfogen /main/10 1996/09/06 14:24:23 cde-hal $
9 # Copyright (c) 1994 HaL Computer Systems, Inc. All rights reserved.
10 # UNPUBLISHED -- rights reserved under the Copyright Laws of the United
11 # States. Use of a copyright notice is precautionary only and does not
12 # imply publication or disclosure.
14 # This software contains confidential information and trade secrets of HaL
15 # Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
16 # without the prior express written permission of HaL Computer Systems, Inc.
18 # RESTRICTED RIGHTS LEGEND
19 # Use, duplication, or disclosure by the Government is subject to
20 # restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
21 # Technical Data and Computer Software clause at DFARS 252.227-7013.
22 # HaL Computer Systems, Inc.
23 # 1315 Dell Avenue, Campbell, CA 95008 $
25 ###############################################################################
27 ###############################################################################
31 ###############################################################################
36 RETCODE=${RETCODE:-$?} ;\
38 ' 0 1 2 3 4 5 6 7 8 10 12 15
40 ###############################################################################
42 # Environment variables that this shell script sets/changes:
44 ###############################################################################
46 export ARCH DTINFO_HOME OTK_NAME
49 ###############################################################################
52 # err_f - reports an error message and exits
53 # msg_f - reports messages
54 # mybasename_f - returns a basename using expr in BASE
55 # mydirname_f - returns a path using expr in HEAD
57 # warn_f - reports a warning message
59 ###############################################################################
61 ###############################################################################
66 msg_f "${OTK_NAME:-$0}: *** ERROR - $@"
71 ###############################################################################
81 ###############################################################################
86 err_f "mybasename_f() passed an empty argument."
90 $1 : '.*/\([^/][^/]*\)$' \| \
91 $1 : '\([^/][^/]*\)$' \| \
94 if [ "$BASE" = "\/" ] ; then
95 warn_f "mybasename_f() passed a path [$1]."
101 ###############################################################################
105 if [ -z "$1" ] ; then
106 err_f "mydirname_f() passed an empty path."
110 $1 : '\(.*[^/]\)//*[^/]*$' \| \
111 $1 : '\(/\)[^/]*$' \| \
114 if [ "$HEAD" = "$1" ] ; then
116 elif [ -z "$HEAD" ] ; then
122 ###############################################################################
126 msg_f "${OTK_NAME:-$0}: *** WARNING - $@"
130 ###############################################################################
132 ###############################################################################
134 # Initialize some useful variables
136 ###############################################################################
139 DTINFO_HOME=${DTINFO_HOME:-""}
142 while [ $# -gt 0 ] ; do
143 if [ -n "`echo $1 | egrep ' '`" ] ; then
144 ARGUMENT="$ARGUMENT \"$1\""
146 ARGUMENT="$ARGUMENT $1"
153 HERE=`(cd $HEAD ; pwd)`
157 ###############################################################################
159 # Determine the OS running to see if the binary will run at all,
160 # also provide a mechanism to choose the correct binary for a
161 # particular architecture automagically.
163 ###############################################################################
281 err_f "Does not run under [$OS]"
286 ###############################################################################
288 # Find the toolkit's real home.
290 ###############################################################################
292 if [ $LINKTESTFLAG $CMD -a -z "$DTINFO_HOME" ] ; then
294 while [ $LINKTESTFLAG $OTK_NAME ] ; do
296 CMD=`ls -l $OTK_NAME | sed -e 's/.*->[ ]*//g'`
306 elif [ -z "$DTINFO_HOME" ] ; then
308 #######################################################################
310 # An explicit path has been given, but the environment variable
313 #######################################################################
315 if [ "$HERE" = "." ] ; then
317 elif [ `expr $HERE : '.*\.\..*'` -gt 0 ] ; then
325 if [ -d $DTINFO_HOME ] ; then
332 err_f "The DtInfo ToolKit does not appear to be installed
333 correctly in [$DTINFO_HOME]. Set the environment variable,
334 DTINFO_HOME, to the directory where the DtInfo ToolKit is installed,
335 or use a fully qualified path when invoking [otk]."
341 ###############################################################################
343 # Look in a default place if DTINFO_HOME not set.
344 # Set path to default information library
345 # Add DTINFO_BIN to path
347 ###############################################################################
349 DTINFO_HOME=${DTINFO_HOME:-$HEAD}
350 DTINFO_BIN=${DTINFO_BIN:-$DTINFO_HOME/bin}
351 # the infolib/etc dir contains most library and bin type files
352 DTINFO_LIB=${DTINFO_LIB:-$DTINFO_HOME/infolib/etc}
353 PATH=${DTINFO_BIN}:${DTINFO_LIB}:${PATH}
355 if [ ! -d $DTINFO_LIB ] ; then
357 err_f "The $ARCH binaries were not installed in
362 ###############################################################################
364 # Create the command line and invoke the DtInfo build tools
366 ###############################################################################
369 eval $DTINFO_LIB/dtinfogen_worker $ARGUMENT