mkmodules.sh revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 1998-2001 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "%Z%%M% %I% %E% SMI"
#
# Script to build the MDB modules present in a workspace against the set of
# include files saved in an MDB "root" (created with mkroot.sh), and install
# resulting modules into this tree so that it can be used as the argument
# to ``mdb -R'' or by mdb's auto-detect code, used by the mdb.sh wrapper.
# We use the ``make dmods'' target to do the build -- this is equivalent to
# make install, but does not build the debugger itself, and pass a special
# define (_MDB_BLDID) into the compilation environment so that the module
# source can detect the various changes in header files, etc. This is only
# used for module source kept on mdb.eng that needs to compile against
# legacy builds of the operating system.
#
opt_R=false
umask 022
opt_R=true
shift
fi
echo "Usage: $PNAME [-R] root-dir"
exit 2
fi
if $opt_R; then
export ROOT
fi
if [ -z "$SRC" -a -z "$CODEMGR_WS" ]; then
echo "$PNAME: \$SRC or \$CODEMGR_WS must be set" >& 2
exit 1
fi
if [ -z "$ROOT" ]; then
echo "$PNAME: \$ROOT must be set" >& 2
exit 1
fi
if [ -z "$SRC" ]; then
SRC="$CODEMGR_WS/usr/src"
export SRC
fi
#
# Derive a build-id based on the name of the $ROOT directory. The build-id
# is passed into the compilation environment as _MDB_BLDID, and consists of
# a 4-digit hexadecimal number whose first two digits are the release number
# (e.g. 0x27XX for Solaris 2.7) and whose last two digits are the build number.
#
esac
#
# Set up the necessary environment variables to perform a build. Basically
# we need to do the same stuff as bld_env or bfmenv.
#
PATH="$PUBLIC/bin:$PUBLIC/bin/$MACH:/opt/onbld/bin:/opt/onbld/bin/$MACH:/opt/SUNWspro/bin:/opt/teamware/ParallelMake/bin:/usr/ccs/bin:/usr/bin:/usr/sbin:/usr/openwin/bin:."; export PATH
#
# We need to export $BLDID into the compilation environment, and make sure
#
ENVCPPFLAGS3=; export ENVCPPFLAGS3
ENVCPPFLAGS4=; export ENVCPPFLAGS4
ENVLDLIBS1=; export ENVLDLIBS1
ENVLDLIBS2=; export ENVLDLIBS2
ENVLDLIBS3=; export ENVLDLIBS3