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 ###############################################################################
34 PATH=/bin:/usr/bin:/usr/sbin
38 RETCODE=${RETCODE:-$?} ;\
40 ' 0 1 2 3 4 5 6 7 8 10 12 15
42 ###############################################################################
44 # Environment variables that this shell script sets/changes:
46 ###############################################################################
48 export ARCH DTINFO_HOME OTK_NAME PATH
51 ###############################################################################
54 # err_f - reports an error message and exits
55 # msg_f - reports messages
56 # mybasename_f - returns a basename using expr in BASE
57 # mydirname_f - returns a path using expr in HEAD
59 # warn_f - reports a warning message
61 ###############################################################################
63 ###############################################################################
68 msg_f "${OTK_NAME:-$0}: *** ERROR - $@"
73 ###############################################################################
83 ###############################################################################
88 err_f "mybasename_f() passed an empty argument."
92 $1 : '.*/\([^/][^/]*\)$' \| \
93 $1 : '\([^/][^/]*\)$' \| \
96 if [ "$BASE" = "\/" ] ; then
97 warn_f "mybasename_f() passed a path [$1]."
103 ###############################################################################
107 if [ -z "$1" ] ; then
108 err_f "mydirname_f() passed an empty path."
112 $1 : '\(.*[^/]\)//*[^/]*$' \| \
113 $1 : '\(/\)[^/]*$' \| \
116 if [ "$HEAD" = "$1" ] ; then
118 elif [ -z "$HEAD" ] ; then
124 ###############################################################################
128 msg_f "${OTK_NAME:-$0}: *** WARNING - $@"
132 ###############################################################################
134 ###############################################################################
136 # Initialize some useful variables
138 ###############################################################################
141 DTINFO_HOME=${DTINFO_HOME:-""}
144 while [ $# -gt 0 ] ; do
145 if [ -n "`echo $1 | egrep ' '`" ] ; then
146 ARGUMENT="$ARGUMENT \"$1\""
148 ARGUMENT="$ARGUMENT $1"
155 HERE=`(cd $HEAD ; pwd)`
159 ###############################################################################
161 # Determine the OS running to see if the binary will run at all,
162 # also provide a mechanism to choose the correct binary for a
163 # particular architecture automagically.
165 ###############################################################################
283 err_f "Does not run under [$OS]"
288 ###############################################################################
290 # Find the toolkit's real home.
292 ###############################################################################
294 if [ $LINKTESTFLAG $CMD -a -z "$DTINFO_HOME" ] ; then
296 while [ $LINKTESTFLAG $OTK_NAME ] ; do
298 CMD=`ls -l $OTK_NAME | sed -e 's/.*->[ ]*//g'`
308 elif [ -z "$DTINFO_HOME" ] ; then
310 #######################################################################
312 # An explicit path has been given, but the environment variable
315 #######################################################################
317 if [ "$HERE" = "." ] ; then
319 elif [ `expr $HERE : '.*\.\..*'` -gt 0 ] ; then
327 if [ -d $DTINFO_HOME ] ; then
334 err_f "The DtInfo ToolKit does not appear to be installed
335 correctly in [$DTINFO_HOME]. Set the environment variable,
336 DTINFO_HOME, to the directory where the DtInfo ToolKit is installed,
337 or use a fully qualified path when invoking [otk]."
343 ###############################################################################
345 # Look in a default place if DTINFO_HOME not set.
346 # Set path to default information library
347 # Add DTINFO_BIN to path
349 ###############################################################################
351 DTINFO_HOME=${DTINFO_HOME:-$HEAD}
352 DTINFO_BIN=${DTINFO_BIN:-$DTINFO_HOME/bin}
353 # the infolib/etc dir contains most library and bin type files
354 DTINFO_LIB=${DTINFO_LIB:-$DTINFO_HOME/infolib/etc}
355 PATH=${DTINFO_BIN}:${DTINFO_LIB}:${PATH}
357 if [ ! -d $DTINFO_LIB ] ; then
359 err_f "The $ARCH binaries were not installed in
364 PATH=${PATH}:${USERPATH}
366 ###############################################################################
368 # Create the command line and invoke the DtInfo build tools
370 ###############################################################################
373 eval $DTINFO_LIB/dtinfogen_worker $ARGUMENT