xref: /titanic_44/usr/src/tools/scripts/bldenv.sh (revision 1fe696781bd9d06b5745b19d0c5161dfa09736de)
17c478bd9Sstevel@tonic-gate#!/bin/ksh -p
27c478bd9Sstevel@tonic-gate#
37c478bd9Sstevel@tonic-gate# CDDL HEADER START
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
6b84bdc30Smeem# Common Development and Distribution License (the "License").
7b84bdc30Smeem# You may not use this file except in compliance with the License.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate# and limitations under the License.
137c478bd9Sstevel@tonic-gate#
147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate# CDDL HEADER END
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate#
23b84bdc30Smeem# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate# Uses supplied "env" file, based on /opt/onbld/etc/env, to set shell variables
297c478bd9Sstevel@tonic-gate# before spawning a shell for doing a release-style builds interactively
307c478bd9Sstevel@tonic-gate# and incrementally.
317c478bd9Sstevel@tonic-gate#
32*1fe69678SkupferUSAGE='Usage: bldenv [-fdt] [ -S E|D|H|O ] <env_file> [ command ]
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gateWhere:
357c478bd9Sstevel@tonic-gate	-c	Force the use of csh - ignore $SHELL
367c478bd9Sstevel@tonic-gate	-f	Invoke csh with -f
377c478bd9Sstevel@tonic-gate	-d	Setup a DEBUG build (default: non-DEBUG)
387c478bd9Sstevel@tonic-gate	-t	use the tools in $SRC/tools
397c478bd9Sstevel@tonic-gate	-S	Build a variant of the source product
407c478bd9Sstevel@tonic-gate		E - build exportable source
417c478bd9Sstevel@tonic-gate		D - build domestic source (exportable + crypt)
427c478bd9Sstevel@tonic-gate		H - build hybrid source (binaries + deleted source)
43*1fe69678Skupfer		O - simulate OpenSolaris build
447c478bd9Sstevel@tonic-gate'
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gatec_FLAG=n
477c478bd9Sstevel@tonic-gatef_FLAG=n
487c478bd9Sstevel@tonic-gated_FLAG=n
497c478bd9Sstevel@tonic-gateo_FLAG=n
507c478bd9Sstevel@tonic-gatet_FLAG=n
517c478bd9Sstevel@tonic-gateSE_FLAG=n
527c478bd9Sstevel@tonic-gateSH_FLAG=n
537c478bd9Sstevel@tonic-gateSD_FLAG=n
54*1fe69678SkupferSO_FLAG=n
55*1fe69678Skupfer
56*1fe69678Skupferis_source_build() {
57*1fe69678Skupfer	[ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o \
58*1fe69678Skupfer	    "$SH_FLAG" = "y" -o "$SO_FLAG" = "y" ]
59*1fe69678Skupfer	return $?
60*1fe69678Skupfer}
61*1fe69678Skupfer
62*1fe69678Skupfer#
63*1fe69678Skupfer# single function for setting -S flag and doing error checking.
64*1fe69678Skupfer# usage: set_S_flag <type>
65*1fe69678Skupfer# where <type> is the source build type ("E", "D", ...).
66*1fe69678Skupfer#
67*1fe69678Skupferset_S_flag() {
68*1fe69678Skupfer	if is_source_build; then
69*1fe69678Skupfer		echo "Can only build one source variant at a time."
70*1fe69678Skupfer		exit 1
71*1fe69678Skupfer	fi
72*1fe69678Skupfer	if [ "$1" = "E" ]; then
73*1fe69678Skupfer		SE_FLAG=y
74*1fe69678Skupfer	elif [ "$1" = "D" ]; then
75*1fe69678Skupfer		SD_FLAG=y
76*1fe69678Skupfer	elif [ "$1" = "H" ]; then
77*1fe69678Skupfer		SH_FLAG=y
78*1fe69678Skupfer	elif [ "$1" = "O" ]; then
79*1fe69678Skupfer		SO_FLAG=y
80*1fe69678Skupfer	else
81*1fe69678Skupfer		echo "$USAGE"
82*1fe69678Skupfer		exit 1
83*1fe69678Skupfer	fi
84*1fe69678Skupfer}
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gateOPTIND=1
877c478bd9Sstevel@tonic-gateSUFFIX="-nd"
887c478bd9Sstevel@tonic-gatewhile getopts cdfS:t FLAG
897c478bd9Sstevel@tonic-gatedo
907c478bd9Sstevel@tonic-gate	case $FLAG in
917c478bd9Sstevel@tonic-gate	  c )	c_FLAG=y
927c478bd9Sstevel@tonic-gate		;;
937c478bd9Sstevel@tonic-gate	  f )	f_FLAG=y
947c478bd9Sstevel@tonic-gate		;;
957c478bd9Sstevel@tonic-gate	  d )	d_FLAG=y
967c478bd9Sstevel@tonic-gate		SUFFIX=""
977c478bd9Sstevel@tonic-gate		;;
987c478bd9Sstevel@tonic-gate	  t )	t_FLAG=y
997c478bd9Sstevel@tonic-gate		;;
1007c478bd9Sstevel@tonic-gate	  S )
101*1fe69678Skupfer		set_S_flag $OPTARG
1027c478bd9Sstevel@tonic-gate		;;
1037c478bd9Sstevel@tonic-gate	  \?)	echo "$USAGE"
1047c478bd9Sstevel@tonic-gate		exit 1
1057c478bd9Sstevel@tonic-gate		;;
1067c478bd9Sstevel@tonic-gate	esac
1077c478bd9Sstevel@tonic-gatedone
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate# correct argument count after options
1107c478bd9Sstevel@tonic-gateshift `expr $OPTIND - 1`
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gate# test that the path to the environment-setting file was given
1137c478bd9Sstevel@tonic-gateif [ $# -lt 1 ]
1147c478bd9Sstevel@tonic-gatethen
1157c478bd9Sstevel@tonic-gate	echo "$USAGE"
1167c478bd9Sstevel@tonic-gate	exit 1
1177c478bd9Sstevel@tonic-gatefi
1187c478bd9Sstevel@tonic-gate
1197c478bd9Sstevel@tonic-gate# force locale to C
1207c478bd9Sstevel@tonic-gateLC_COLLATE=C;   export LC_COLLATE
1217c478bd9Sstevel@tonic-gateLC_CTYPE=C;     export LC_CTYPE
1227c478bd9Sstevel@tonic-gateLC_MESSAGES=C;  export LC_MESSAGES
1237c478bd9Sstevel@tonic-gateLC_MONETARY=C;  export LC_MONETARY
1247c478bd9Sstevel@tonic-gateLC_NUMERIC=C;   export LC_NUMERIC
1257c478bd9Sstevel@tonic-gateLC_TIME=C;      export LC_TIME
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate# clear environment variables we know to be bad for the build
1287c478bd9Sstevel@tonic-gateunset LD_OPTIONS LD_LIBRARY_PATH LD_AUDIT LD_BIND_NOW LD_BREADTH LD_CONFIG
1297c478bd9Sstevel@tonic-gateunset LD_DEBUG LD_FLAGS LD_LIBRARY_PATH_64 LD_NOVERSION LD_ORIGIN
1307c478bd9Sstevel@tonic-gateunset LD_LOADFLTR LD_NOAUXFLTR LD_NOCONFIG LD_NODIRCONFIG LD_NOOBJALTER
1317c478bd9Sstevel@tonic-gateunset LD_PRELOAD LD_PROFILE
1327c478bd9Sstevel@tonic-gateunset CONFIG
1337c478bd9Sstevel@tonic-gateunset GROUP
1347c478bd9Sstevel@tonic-gateunset OWNER
1357c478bd9Sstevel@tonic-gateunset REMOTE
1367c478bd9Sstevel@tonic-gateunset ENV
1377c478bd9Sstevel@tonic-gateunset ARCH
1387c478bd9Sstevel@tonic-gateunset CLASSPATH
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gate# setup environmental variables
1417c478bd9Sstevel@tonic-gateif [ -f $1 ]; then
1427c478bd9Sstevel@tonic-gate	if [[ $1 = */* ]]; then
1437c478bd9Sstevel@tonic-gate		. $1
1447c478bd9Sstevel@tonic-gate	else
1457c478bd9Sstevel@tonic-gate		. ./$1
1467c478bd9Sstevel@tonic-gate	fi
1477c478bd9Sstevel@tonic-gateelse
1487c478bd9Sstevel@tonic-gate	if [ -f /opt/onbld/env/$1 ]; then
1497c478bd9Sstevel@tonic-gate		. /opt/onbld/env/$1
1507c478bd9Sstevel@tonic-gate	else
1517c478bd9Sstevel@tonic-gate		echo "Cannot find env file as either $1 or /opt/onbld/env/$1"
1527c478bd9Sstevel@tonic-gate		exit 1
1537c478bd9Sstevel@tonic-gate	fi
1547c478bd9Sstevel@tonic-gatefi
1557c478bd9Sstevel@tonic-gateshift
1567c478bd9Sstevel@tonic-gate
157*1fe69678Skupfer# contents of stdenv.sh inserted after next line:
158*1fe69678Skupfer# STDENV_START
159*1fe69678Skupfer# STDENV_END
1607c478bd9Sstevel@tonic-gate
161*1fe69678Skupfer#MACH=`uname -p`
162fb9f9b97Skupfer
1637c478bd9Sstevel@tonic-gate# must match the getopts in nightly.sh
1647c478bd9Sstevel@tonic-gateOPTIND=1
165d77e7149SsommerfeNIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
1662d2eda05Sesaxewhile getopts ABDFMNCGIRafinlmoptuUxdrtwzWS:X FLAG $NIGHTLY_OPTIONS
1677c478bd9Sstevel@tonic-gatedo
1687c478bd9Sstevel@tonic-gate	case $FLAG in
1697c478bd9Sstevel@tonic-gate	  t )	t_FLAG=y
1707c478bd9Sstevel@tonic-gate		;;
1717c478bd9Sstevel@tonic-gate	  S )
172*1fe69678Skupfer		set_S_flag $OPTARG
1737c478bd9Sstevel@tonic-gate		;;
1747c478bd9Sstevel@tonic-gate	  o)	o_FLAG=y
1757c478bd9Sstevel@tonic-gate		;;
1767c478bd9Sstevel@tonic-gate	  *)    ;;
1777c478bd9Sstevel@tonic-gate	esac
1787c478bd9Sstevel@tonic-gatedone
1797c478bd9Sstevel@tonic-gate
1807c478bd9Sstevel@tonic-gateecho "Build type   is  \c"
1817c478bd9Sstevel@tonic-gateif [ ${d_FLAG} = "y" ]; then
1827c478bd9Sstevel@tonic-gate	echo "DEBUG"
1837c478bd9Sstevel@tonic-gate	export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
1847c478bd9Sstevel@tonic-gate	unset RELEASE_BUILD
1857c478bd9Sstevel@tonic-gate	unset EXTRA_OPTIONS
1867c478bd9Sstevel@tonic-gate	unset EXTRA_CFLAGS
1877c478bd9Sstevel@tonic-gateelse
1887c478bd9Sstevel@tonic-gate	# default is a non-DEBUG build
1897c478bd9Sstevel@tonic-gate	echo "non-DEBUG"
1907c478bd9Sstevel@tonic-gate	export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
1917c478bd9Sstevel@tonic-gate	export RELEASE_BUILD ; RELEASE_BUILD=
1927c478bd9Sstevel@tonic-gate	unset EXTRA_OPTIONS
1937c478bd9Sstevel@tonic-gate	unset EXTRA_CFLAGS
1947c478bd9Sstevel@tonic-gatefi
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate# update build-type variables
1977c478bd9Sstevel@tonic-gateCPIODIR=${CPIODIR}${SUFFIX}
1987c478bd9Sstevel@tonic-gatePKGARCHIVE=${PKGARCHIVE}${SUFFIX}
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gate# Append source version
2017c478bd9Sstevel@tonic-gateif [ "$SE_FLAG" = "y" ]; then
2027c478bd9Sstevel@tonic-gate        VERSION="${VERSION}:EXPORT"
2037c478bd9Sstevel@tonic-gate	SRC=${EXPORT_SRC}/usr/src
2047c478bd9Sstevel@tonic-gatefi
2057c478bd9Sstevel@tonic-gate
2067c478bd9Sstevel@tonic-gateif [ "$SD_FLAG" = "y" ]; then
2077c478bd9Sstevel@tonic-gate        VERSION="${VERSION}:DOMESTIC"
2087c478bd9Sstevel@tonic-gate	SRC=${EXPORT_SRC}/usr/src
2097c478bd9Sstevel@tonic-gatefi
2107c478bd9Sstevel@tonic-gate
2117c478bd9Sstevel@tonic-gateif [ "$SH_FLAG" = "y" ]; then
2127c478bd9Sstevel@tonic-gate        VERSION="${VERSION}:HYBRID"
2137c478bd9Sstevel@tonic-gate	SRC=${EXPORT_SRC}/usr/src
2147c478bd9Sstevel@tonic-gatefi
2157c478bd9Sstevel@tonic-gate
216*1fe69678Skupferif [ "$SO_FLAG" = "y" ]; then
217*1fe69678Skupfer        VERSION="${VERSION}:OPEN_ONLY"
218*1fe69678Skupfer	SRC=${OPEN_SRCDIR}/usr/src
219*1fe69678Skupferfi
220*1fe69678Skupfer
2217c478bd9Sstevel@tonic-gate# 	Set PATH for a build
222b84bdc30SmeemPATH="/opt/onbld/bin:/opt/onbld/bin/${MACH}:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/bin:/usr/sbin:/usr/ucb:/usr/etc:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:."
2237c478bd9Sstevel@tonic-gateif [ "${SUNWSPRO}" != "" ]; then
2247c478bd9Sstevel@tonic-gate	PATH="${SUNWSPRO}/bin:$PATH"
2257c478bd9Sstevel@tonic-gate	export PATH
2267c478bd9Sstevel@tonic-gatefi
2277c478bd9Sstevel@tonic-gate
228*1fe69678Skupferif [[ "$SO_FLAG" = "y" && "$CLOSED_IS_PRESENT" = "yes" ]]; then
229*1fe69678Skupfer	echo "CLOSED_IS_PRESENT is 'no' (because of '-S O')"
230*1fe69678Skupfer	CLOSED_IS_PRESENT=no
231*1fe69678Skupfer	export CLOSED_IS_PRESENT
232*1fe69678Skupferfi
233*1fe69678Skupfer
234*1fe69678Skupferif [ -z "$CLOSED_IS_PRESENT" ]; then
235*1fe69678Skupfer	if [ -d $SRC/../closed ]; then
236*1fe69678Skupfer		CLOSED_IS_PRESENT="yes"
237*1fe69678Skupfer	else
238*1fe69678Skupfer		CLOSED_IS_PRESENT="no"
239*1fe69678Skupfer	fi
240*1fe69678Skupfer	export CLOSED_IS_PRESENT
241*1fe69678Skupferfi
242*1fe69678Skupfer
2437c478bd9Sstevel@tonic-gateTOOLS=${SRC}/tools
2447c478bd9Sstevel@tonic-gateTOOLS_PROTO=${TOOLS}/proto
2457c478bd9Sstevel@tonic-gate
2467c478bd9Sstevel@tonic-gateif [ "$t_FLAG" = "y" ]; then
2477c478bd9Sstevel@tonic-gate	export ONBLD_TOOLS=${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld}
2487c478bd9Sstevel@tonic-gate
2497c478bd9Sstevel@tonic-gate	STABS=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/stabs
2507c478bd9Sstevel@tonic-gate	export STABS
2517c478bd9Sstevel@tonic-gate	CTFSTABS=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfstabs
2527c478bd9Sstevel@tonic-gate	export CTFSTABS
2537c478bd9Sstevel@tonic-gate	GENOFFSETS=${TOOLS_PROTO}/opt/onbld/bin/genoffsets
2547c478bd9Sstevel@tonic-gate	export GENOFFSETS
2557c478bd9Sstevel@tonic-gate
2567c478bd9Sstevel@tonic-gate	CTFCONVERT=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfconvert
2577c478bd9Sstevel@tonic-gate	export CTFCONVERT
2587c478bd9Sstevel@tonic-gate	CTFMERGE=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfmerge
2597c478bd9Sstevel@tonic-gate	export CTFMERGE
2607c478bd9Sstevel@tonic-gate
2617c478bd9Sstevel@tonic-gate	CTFCVTPTBL=${TOOLS_PROTO}/opt/onbld/bin/ctfcvtptbl
2627c478bd9Sstevel@tonic-gate	export CTFCVTPTBL
2637c478bd9Sstevel@tonic-gate	CTFFINDMOD=${TOOLS_PROTO}/opt/onbld/bin/ctffindmod
2647c478bd9Sstevel@tonic-gate	export CTFFINDMOD
2657c478bd9Sstevel@tonic-gate
2667c478bd9Sstevel@tonic-gate	PATH="${TOOLS_PROTO}/opt/onbld/bin/${MACH}:${PATH}"
2677c478bd9Sstevel@tonic-gate	PATH="${TOOLS_PROTO}/opt/onbld/bin:${PATH}"
2687c478bd9Sstevel@tonic-gate	export PATH
2697c478bd9Sstevel@tonic-gatefi
2707c478bd9Sstevel@tonic-gate
2717c478bd9Sstevel@tonic-gateunset CH
2727c478bd9Sstevel@tonic-gateif [ "$o_FLAG" = "y" ]; then
2737c478bd9Sstevel@tonic-gate	CH=
2747c478bd9Sstevel@tonic-gate	export CH
2757c478bd9Sstevel@tonic-gatefi
2767c478bd9Sstevel@tonic-gatePOUND_SIGN="#"
2777c478bd9Sstevel@tonic-gateDEF_STRIPFLAG="-s"
2787c478bd9Sstevel@tonic-gate
2797c478bd9Sstevel@tonic-gateTMPDIR="/tmp"
2807c478bd9Sstevel@tonic-gate
2817c478bd9Sstevel@tonic-gateexport	PATH TMPDIR o_FLAG POUND_SIGN DEF_STRIPFLAG
2827c478bd9Sstevel@tonic-gateunset	CFLAGS LD_LIBRARY_PATH
2837c478bd9Sstevel@tonic-gate
2847c478bd9Sstevel@tonic-gate# a la ws
2857c478bd9Sstevel@tonic-gateENVLDLIBS1=
2867c478bd9Sstevel@tonic-gateENVLDLIBS2=
2877c478bd9Sstevel@tonic-gateENVLDLIBS3=
2887c478bd9Sstevel@tonic-gateENVCPPFLAGS1=
2897c478bd9Sstevel@tonic-gateENVCPPFLAGS2=
2907c478bd9Sstevel@tonic-gateENVCPPFLAGS3=
2917c478bd9Sstevel@tonic-gateENVCPPFLAGS4=
2927c478bd9Sstevel@tonic-gatePARENT_ROOT=
2937c478bd9Sstevel@tonic-gate
2947c478bd9Sstevel@tonic-gateENVLDLIBS1="-L$ROOT/lib -L$ROOT/usr/lib"
2957c478bd9Sstevel@tonic-gateENVCPPFLAGS1="-I$ROOT/usr/include"
2967c478bd9Sstevel@tonic-gateMAKEFLAGS=e
2977c478bd9Sstevel@tonic-gate
2987c478bd9Sstevel@tonic-gateexport ENVLDLIBS1 ENVLDLIBS2 ENVLDLIBS3 \
2997c478bd9Sstevel@tonic-gate	ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 \
3007c478bd9Sstevel@tonic-gate	ENVCPPFLAGS4 MAKEFLAGS PARENT_ROOT
3017c478bd9Sstevel@tonic-gate
3027c478bd9Sstevel@tonic-gateecho "RELEASE      is  $RELEASE"
3037c478bd9Sstevel@tonic-gateecho "VERSION      is  $VERSION"
3047c478bd9Sstevel@tonic-gateecho "RELEASE_DATE is  $RELEASE_DATE"
3057c478bd9Sstevel@tonic-gateecho ""
3067c478bd9Sstevel@tonic-gate
3077c478bd9Sstevel@tonic-gateif [[ -f $SRC/Makefile ]] && egrep -s '^setup:' $SRC/Makefile; then
3087c478bd9Sstevel@tonic-gate	echo "The top-level 'setup' target is available \c"
3097c478bd9Sstevel@tonic-gate	echo "to build headers and tools."
3107c478bd9Sstevel@tonic-gate	echo ""
3117c478bd9Sstevel@tonic-gate
3127c478bd9Sstevel@tonic-gateelif [[ "$t_FLAG" = "y" ]]; then
3137c478bd9Sstevel@tonic-gate	echo "The tools can be (re)built with the install target in ${TOOLS}."
3147c478bd9Sstevel@tonic-gate	echo ""
3157c478bd9Sstevel@tonic-gatefi
3167c478bd9Sstevel@tonic-gate
3177c478bd9Sstevel@tonic-gate
3187c478bd9Sstevel@tonic-gateif [[ "$c_FLAG" = "n" && -x "$SHELL" && `basename $SHELL` != "csh" ]]; then
3197c478bd9Sstevel@tonic-gate	# $SHELL is set, and it's not csh.
3207c478bd9Sstevel@tonic-gate
3217c478bd9Sstevel@tonic-gate	if [[ "$f_FLAG" != "n" ]]; then
3227c478bd9Sstevel@tonic-gate		echo "WARNING: -f is ignored when \$SHELL is not csh"
3237c478bd9Sstevel@tonic-gate	fi
3247c478bd9Sstevel@tonic-gate
3257c478bd9Sstevel@tonic-gate	echo "Using $SHELL as shell."
3267c478bd9Sstevel@tonic-gate	exec $SHELL ${@:+-c "$@"}
3277c478bd9Sstevel@tonic-gate
3287c478bd9Sstevel@tonic-gateelif [[ "$f_FLAG" = "y" ]]; then
3297c478bd9Sstevel@tonic-gate	echo "Using csh -f as shell."
3307c478bd9Sstevel@tonic-gate	exec csh -f ${@:+-c "$@"}
3317c478bd9Sstevel@tonic-gate
3327c478bd9Sstevel@tonic-gateelse
3337c478bd9Sstevel@tonic-gate	echo "Using csh as shell."
3347c478bd9Sstevel@tonic-gate	exec csh ${@:+-c "$@"}
3357c478bd9Sstevel@tonic-gatefi
336