1*7c478bd9Sstevel@tonic-gate#!/bin/ksh -p 2*7c478bd9Sstevel@tonic-gate# 3*7c478bd9Sstevel@tonic-gate# CDDL HEADER START 4*7c478bd9Sstevel@tonic-gate# 5*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 6*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 7*7c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 8*7c478bd9Sstevel@tonic-gate# with the License. 9*7c478bd9Sstevel@tonic-gate# 10*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 12*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 13*7c478bd9Sstevel@tonic-gate# and limitations under the License. 14*7c478bd9Sstevel@tonic-gate# 15*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 16*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 18*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 19*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 20*7c478bd9Sstevel@tonic-gate# 21*7c478bd9Sstevel@tonic-gate# CDDL HEADER END 22*7c478bd9Sstevel@tonic-gate# 23*7c478bd9Sstevel@tonic-gate# 24*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 25*7c478bd9Sstevel@tonic-gate# Use is subject to license terms. 26*7c478bd9Sstevel@tonic-gate# 27*7c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 28*7c478bd9Sstevel@tonic-gate# 29*7c478bd9Sstevel@tonic-gate# Uses supplied "env" file, based on /opt/onbld/etc/env, to set shell variables 30*7c478bd9Sstevel@tonic-gate# before spawning a shell for doing a release-style builds interactively 31*7c478bd9Sstevel@tonic-gate# and incrementally. 32*7c478bd9Sstevel@tonic-gate# 33*7c478bd9Sstevel@tonic-gateUSAGE='Usage: bldenv [-fdt] [ -S E|D|H ] <env_file> [ command ] 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gateWhere: 36*7c478bd9Sstevel@tonic-gate -c Force the use of csh - ignore $SHELL 37*7c478bd9Sstevel@tonic-gate -f Invoke csh with -f 38*7c478bd9Sstevel@tonic-gate -d Setup a DEBUG build (default: non-DEBUG) 39*7c478bd9Sstevel@tonic-gate -t use the tools in $SRC/tools 40*7c478bd9Sstevel@tonic-gate -S Build a variant of the source product 41*7c478bd9Sstevel@tonic-gate E - build exportable source 42*7c478bd9Sstevel@tonic-gate D - build domestic source (exportable + crypt) 43*7c478bd9Sstevel@tonic-gate H - build hybrid source (binaries + deleted source) 44*7c478bd9Sstevel@tonic-gate' 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gatec_FLAG=n 47*7c478bd9Sstevel@tonic-gatef_FLAG=n 48*7c478bd9Sstevel@tonic-gated_FLAG=n 49*7c478bd9Sstevel@tonic-gateo_FLAG=n 50*7c478bd9Sstevel@tonic-gatet_FLAG=n 51*7c478bd9Sstevel@tonic-gateSE_FLAG=n 52*7c478bd9Sstevel@tonic-gateSH_FLAG=n 53*7c478bd9Sstevel@tonic-gateSD_FLAG=n 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gateOPTIND=1 56*7c478bd9Sstevel@tonic-gateSUFFIX="-nd" 57*7c478bd9Sstevel@tonic-gatewhile getopts cdfS:t FLAG 58*7c478bd9Sstevel@tonic-gatedo 59*7c478bd9Sstevel@tonic-gate case $FLAG in 60*7c478bd9Sstevel@tonic-gate c ) c_FLAG=y 61*7c478bd9Sstevel@tonic-gate ;; 62*7c478bd9Sstevel@tonic-gate f ) f_FLAG=y 63*7c478bd9Sstevel@tonic-gate ;; 64*7c478bd9Sstevel@tonic-gate d ) d_FLAG=y 65*7c478bd9Sstevel@tonic-gate SUFFIX="" 66*7c478bd9Sstevel@tonic-gate ;; 67*7c478bd9Sstevel@tonic-gate t ) t_FLAG=y 68*7c478bd9Sstevel@tonic-gate ;; 69*7c478bd9Sstevel@tonic-gate S ) 70*7c478bd9Sstevel@tonic-gate if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then 71*7c478bd9Sstevel@tonic-gate echo "Can only build one source variant at a time." 72*7c478bd9Sstevel@tonic-gate exit 1 73*7c478bd9Sstevel@tonic-gate fi 74*7c478bd9Sstevel@tonic-gate if [ "${OPTARG}" = "E" ]; then 75*7c478bd9Sstevel@tonic-gate SE_FLAG=y 76*7c478bd9Sstevel@tonic-gate elif [ "${OPTARG}" = "D" ]; then 77*7c478bd9Sstevel@tonic-gate SD_FLAG=y 78*7c478bd9Sstevel@tonic-gate elif [ "${OPTARG}" = "H" ]; then 79*7c478bd9Sstevel@tonic-gate SH_FLAG=y 80*7c478bd9Sstevel@tonic-gate else 81*7c478bd9Sstevel@tonic-gate echo "$USAGE" 82*7c478bd9Sstevel@tonic-gate exit 1 83*7c478bd9Sstevel@tonic-gate fi 84*7c478bd9Sstevel@tonic-gate ;; 85*7c478bd9Sstevel@tonic-gate \?) echo "$USAGE" 86*7c478bd9Sstevel@tonic-gate exit 1 87*7c478bd9Sstevel@tonic-gate ;; 88*7c478bd9Sstevel@tonic-gate esac 89*7c478bd9Sstevel@tonic-gatedone 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate# correct argument count after options 92*7c478bd9Sstevel@tonic-gateshift `expr $OPTIND - 1` 93*7c478bd9Sstevel@tonic-gate 94*7c478bd9Sstevel@tonic-gate# test that the path to the environment-setting file was given 95*7c478bd9Sstevel@tonic-gateif [ $# -lt 1 ] 96*7c478bd9Sstevel@tonic-gatethen 97*7c478bd9Sstevel@tonic-gate echo "$USAGE" 98*7c478bd9Sstevel@tonic-gate exit 1 99*7c478bd9Sstevel@tonic-gatefi 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate# force locale to C 102*7c478bd9Sstevel@tonic-gateLC_COLLATE=C; export LC_COLLATE 103*7c478bd9Sstevel@tonic-gateLC_CTYPE=C; export LC_CTYPE 104*7c478bd9Sstevel@tonic-gateLC_MESSAGES=C; export LC_MESSAGES 105*7c478bd9Sstevel@tonic-gateLC_MONETARY=C; export LC_MONETARY 106*7c478bd9Sstevel@tonic-gateLC_NUMERIC=C; export LC_NUMERIC 107*7c478bd9Sstevel@tonic-gateLC_TIME=C; export LC_TIME 108*7c478bd9Sstevel@tonic-gate 109*7c478bd9Sstevel@tonic-gate# clear environment variables we know to be bad for the build 110*7c478bd9Sstevel@tonic-gateunset LD_OPTIONS LD_LIBRARY_PATH LD_AUDIT LD_BIND_NOW LD_BREADTH LD_CONFIG 111*7c478bd9Sstevel@tonic-gateunset LD_DEBUG LD_FLAGS LD_LIBRARY_PATH_64 LD_NOVERSION LD_ORIGIN 112*7c478bd9Sstevel@tonic-gateunset LD_LOADFLTR LD_NOAUXFLTR LD_NOCONFIG LD_NODIRCONFIG LD_NOOBJALTER 113*7c478bd9Sstevel@tonic-gateunset LD_PRELOAD LD_PROFILE 114*7c478bd9Sstevel@tonic-gateunset CONFIG 115*7c478bd9Sstevel@tonic-gateunset GROUP 116*7c478bd9Sstevel@tonic-gateunset OWNER 117*7c478bd9Sstevel@tonic-gateunset REMOTE 118*7c478bd9Sstevel@tonic-gateunset ENV 119*7c478bd9Sstevel@tonic-gateunset ARCH 120*7c478bd9Sstevel@tonic-gateunset CLASSPATH 121*7c478bd9Sstevel@tonic-gate 122*7c478bd9Sstevel@tonic-gate# setup environmental variables 123*7c478bd9Sstevel@tonic-gateif [ -f $1 ]; then 124*7c478bd9Sstevel@tonic-gate if [[ $1 = */* ]]; then 125*7c478bd9Sstevel@tonic-gate . $1 126*7c478bd9Sstevel@tonic-gate else 127*7c478bd9Sstevel@tonic-gate . ./$1 128*7c478bd9Sstevel@tonic-gate fi 129*7c478bd9Sstevel@tonic-gateelse 130*7c478bd9Sstevel@tonic-gate if [ -f /opt/onbld/env/$1 ]; then 131*7c478bd9Sstevel@tonic-gate . /opt/onbld/env/$1 132*7c478bd9Sstevel@tonic-gate else 133*7c478bd9Sstevel@tonic-gate echo "Cannot find env file as either $1 or /opt/onbld/env/$1" 134*7c478bd9Sstevel@tonic-gate exit 1 135*7c478bd9Sstevel@tonic-gate fi 136*7c478bd9Sstevel@tonic-gatefi 137*7c478bd9Sstevel@tonic-gateshift 138*7c478bd9Sstevel@tonic-gate 139*7c478bd9Sstevel@tonic-gate#MACH=`uname -p` 140*7c478bd9Sstevel@tonic-gate 141*7c478bd9Sstevel@tonic-gate# must match the getopts in nightly.sh 142*7c478bd9Sstevel@tonic-gateOPTIND=1 143*7c478bd9Sstevel@tonic-gatewhile getopts ABDFMNPTCGIRafinlmoptuUxdrtzWS:X FLAG $NIGHTLY_OPTIONS 144*7c478bd9Sstevel@tonic-gatedo 145*7c478bd9Sstevel@tonic-gate case $FLAG in 146*7c478bd9Sstevel@tonic-gate t ) t_FLAG=y 147*7c478bd9Sstevel@tonic-gate ;; 148*7c478bd9Sstevel@tonic-gate S ) 149*7c478bd9Sstevel@tonic-gate if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then 150*7c478bd9Sstevel@tonic-gate echo "Can only build one source variant at a time." 151*7c478bd9Sstevel@tonic-gate exit 1 152*7c478bd9Sstevel@tonic-gate fi 153*7c478bd9Sstevel@tonic-gate if [ "${OPTARG}" = "E" ]; then 154*7c478bd9Sstevel@tonic-gate SE_FLAG=y 155*7c478bd9Sstevel@tonic-gate elif [ "${OPTARG}" = "D" ]; then 156*7c478bd9Sstevel@tonic-gate SD_FLAG=y 157*7c478bd9Sstevel@tonic-gate elif [ "${OPTARG}" = "H" ]; then 158*7c478bd9Sstevel@tonic-gate SH_FLAG=y 159*7c478bd9Sstevel@tonic-gate else 160*7c478bd9Sstevel@tonic-gate echo "$USAGE" 161*7c478bd9Sstevel@tonic-gate exit 1 162*7c478bd9Sstevel@tonic-gate fi 163*7c478bd9Sstevel@tonic-gate ;; 164*7c478bd9Sstevel@tonic-gate o) o_FLAG=y 165*7c478bd9Sstevel@tonic-gate ;; 166*7c478bd9Sstevel@tonic-gate *) ;; 167*7c478bd9Sstevel@tonic-gate esac 168*7c478bd9Sstevel@tonic-gatedone 169*7c478bd9Sstevel@tonic-gate 170*7c478bd9Sstevel@tonic-gateecho "Build type is \c" 171*7c478bd9Sstevel@tonic-gateif [ ${d_FLAG} = "y" ]; then 172*7c478bd9Sstevel@tonic-gate echo "DEBUG" 173*7c478bd9Sstevel@tonic-gate export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= 174*7c478bd9Sstevel@tonic-gate unset RELEASE_BUILD 175*7c478bd9Sstevel@tonic-gate unset EXTRA_OPTIONS 176*7c478bd9Sstevel@tonic-gate unset EXTRA_CFLAGS 177*7c478bd9Sstevel@tonic-gateelse 178*7c478bd9Sstevel@tonic-gate # default is a non-DEBUG build 179*7c478bd9Sstevel@tonic-gate echo "non-DEBUG" 180*7c478bd9Sstevel@tonic-gate export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= 181*7c478bd9Sstevel@tonic-gate export RELEASE_BUILD ; RELEASE_BUILD= 182*7c478bd9Sstevel@tonic-gate unset EXTRA_OPTIONS 183*7c478bd9Sstevel@tonic-gate unset EXTRA_CFLAGS 184*7c478bd9Sstevel@tonic-gatefi 185*7c478bd9Sstevel@tonic-gate 186*7c478bd9Sstevel@tonic-gate# update build-type variables 187*7c478bd9Sstevel@tonic-gateCPIODIR=${CPIODIR}${SUFFIX} 188*7c478bd9Sstevel@tonic-gatePKGARCHIVE=${PKGARCHIVE}${SUFFIX} 189*7c478bd9Sstevel@tonic-gate 190*7c478bd9Sstevel@tonic-gateif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" ]; then 191*7c478bd9Sstevel@tonic-gate if [ -z "${EXPORT_SRC}" ]; then 192*7c478bd9Sstevel@tonic-gate echo "EXPORT_SRC must be set for a source build." 193*7c478bd9Sstevel@tonic-gate exit 1 194*7c478bd9Sstevel@tonic-gate fi 195*7c478bd9Sstevel@tonic-gate if [ -z "${CRYPT_SRC}" ]; then 196*7c478bd9Sstevel@tonic-gate echo "CRYPT_SRC must be set for a source build." 197*7c478bd9Sstevel@tonic-gate exit 1 198*7c478bd9Sstevel@tonic-gate fi 199*7c478bd9Sstevel@tonic-gatefi 200*7c478bd9Sstevel@tonic-gate 201*7c478bd9Sstevel@tonic-gateif [ "$SH_FLAG" = "y" ]; then 202*7c478bd9Sstevel@tonic-gate if [ -z "${EXPORT_SRC}" ]; then 203*7c478bd9Sstevel@tonic-gate echo "EXPORT_SRC must be set for a source build." 204*7c478bd9Sstevel@tonic-gate exit 1 205*7c478bd9Sstevel@tonic-gate fi 206*7c478bd9Sstevel@tonic-gatefi 207*7c478bd9Sstevel@tonic-gate 208*7c478bd9Sstevel@tonic-gate# Append source version 209*7c478bd9Sstevel@tonic-gateif [ "$SE_FLAG" = "y" ]; then 210*7c478bd9Sstevel@tonic-gate VERSION="${VERSION}:EXPORT" 211*7c478bd9Sstevel@tonic-gate SRC=${EXPORT_SRC}/usr/src 212*7c478bd9Sstevel@tonic-gatefi 213*7c478bd9Sstevel@tonic-gate 214*7c478bd9Sstevel@tonic-gateif [ "$SD_FLAG" = "y" ]; then 215*7c478bd9Sstevel@tonic-gate VERSION="${VERSION}:DOMESTIC" 216*7c478bd9Sstevel@tonic-gate SRC=${EXPORT_SRC}/usr/src 217*7c478bd9Sstevel@tonic-gatefi 218*7c478bd9Sstevel@tonic-gate 219*7c478bd9Sstevel@tonic-gateif [ "$SH_FLAG" = "y" ]; then 220*7c478bd9Sstevel@tonic-gate VERSION="${VERSION}:HYBRID" 221*7c478bd9Sstevel@tonic-gate SRC=${EXPORT_SRC}/usr/src 222*7c478bd9Sstevel@tonic-gatefi 223*7c478bd9Sstevel@tonic-gate 224*7c478bd9Sstevel@tonic-gate# Set PATH for a build 225*7c478bd9Sstevel@tonic-gatePATH="/opt/onbld/bin:/opt/onbld/bin/${MACH}:/opt/SUNWspro/bin:/opt/teamware/ParallelMake/bin:/usr/ccs/bin:/usr/bin:/usr/sbin:/usr/ucb:/usr/etc:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:." 226*7c478bd9Sstevel@tonic-gateif [ "${SUNWSPRO}" != "" ]; then 227*7c478bd9Sstevel@tonic-gate PATH="${SUNWSPRO}/bin:$PATH" 228*7c478bd9Sstevel@tonic-gate export PATH 229*7c478bd9Sstevel@tonic-gatefi 230*7c478bd9Sstevel@tonic-gate 231*7c478bd9Sstevel@tonic-gateTOOLS=${SRC}/tools 232*7c478bd9Sstevel@tonic-gateTOOLS_PROTO=${TOOLS}/proto 233*7c478bd9Sstevel@tonic-gate 234*7c478bd9Sstevel@tonic-gateif [ "$t_FLAG" = "y" ]; then 235*7c478bd9Sstevel@tonic-gate export ONBLD_TOOLS=${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld} 236*7c478bd9Sstevel@tonic-gate 237*7c478bd9Sstevel@tonic-gate STABS=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/stabs 238*7c478bd9Sstevel@tonic-gate export STABS 239*7c478bd9Sstevel@tonic-gate CTFSTABS=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfstabs 240*7c478bd9Sstevel@tonic-gate export CTFSTABS 241*7c478bd9Sstevel@tonic-gate GENOFFSETS=${TOOLS_PROTO}/opt/onbld/bin/genoffsets 242*7c478bd9Sstevel@tonic-gate export GENOFFSETS 243*7c478bd9Sstevel@tonic-gate 244*7c478bd9Sstevel@tonic-gate CTFCONVERT=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfconvert 245*7c478bd9Sstevel@tonic-gate export CTFCONVERT 246*7c478bd9Sstevel@tonic-gate CTFMERGE=${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfmerge 247*7c478bd9Sstevel@tonic-gate export CTFMERGE 248*7c478bd9Sstevel@tonic-gate 249*7c478bd9Sstevel@tonic-gate CTFCVTPTBL=${TOOLS_PROTO}/opt/onbld/bin/ctfcvtptbl 250*7c478bd9Sstevel@tonic-gate export CTFCVTPTBL 251*7c478bd9Sstevel@tonic-gate CTFFINDMOD=${TOOLS_PROTO}/opt/onbld/bin/ctffindmod 252*7c478bd9Sstevel@tonic-gate export CTFFINDMOD 253*7c478bd9Sstevel@tonic-gate 254*7c478bd9Sstevel@tonic-gate PATH="${TOOLS_PROTO}/opt/onbld/bin/${MACH}:${PATH}" 255*7c478bd9Sstevel@tonic-gate PATH="${TOOLS_PROTO}/opt/onbld/bin:${PATH}" 256*7c478bd9Sstevel@tonic-gate export PATH 257*7c478bd9Sstevel@tonic-gatefi 258*7c478bd9Sstevel@tonic-gate 259*7c478bd9Sstevel@tonic-gateunset CH 260*7c478bd9Sstevel@tonic-gateif [ "$o_FLAG" = "y" ]; then 261*7c478bd9Sstevel@tonic-gate CH= 262*7c478bd9Sstevel@tonic-gate export CH 263*7c478bd9Sstevel@tonic-gatefi 264*7c478bd9Sstevel@tonic-gatePOUND_SIGN="#" 265*7c478bd9Sstevel@tonic-gateDEF_STRIPFLAG="-s" 266*7c478bd9Sstevel@tonic-gate 267*7c478bd9Sstevel@tonic-gateTMPDIR="/tmp" 268*7c478bd9Sstevel@tonic-gate 269*7c478bd9Sstevel@tonic-gateexport PATH TMPDIR o_FLAG POUND_SIGN DEF_STRIPFLAG 270*7c478bd9Sstevel@tonic-gateunset CFLAGS LD_LIBRARY_PATH 271*7c478bd9Sstevel@tonic-gate 272*7c478bd9Sstevel@tonic-gate# a la ws 273*7c478bd9Sstevel@tonic-gateENVLDLIBS1= 274*7c478bd9Sstevel@tonic-gateENVLDLIBS2= 275*7c478bd9Sstevel@tonic-gateENVLDLIBS3= 276*7c478bd9Sstevel@tonic-gateENVCPPFLAGS1= 277*7c478bd9Sstevel@tonic-gateENVCPPFLAGS2= 278*7c478bd9Sstevel@tonic-gateENVCPPFLAGS3= 279*7c478bd9Sstevel@tonic-gateENVCPPFLAGS4= 280*7c478bd9Sstevel@tonic-gatePARENT_ROOT= 281*7c478bd9Sstevel@tonic-gate 282*7c478bd9Sstevel@tonic-gateENVLDLIBS1="-L$ROOT/lib -L$ROOT/usr/lib" 283*7c478bd9Sstevel@tonic-gateENVCPPFLAGS1="-I$ROOT/usr/include" 284*7c478bd9Sstevel@tonic-gateMAKEFLAGS=e 285*7c478bd9Sstevel@tonic-gate 286*7c478bd9Sstevel@tonic-gateexport ENVLDLIBS1 ENVLDLIBS2 ENVLDLIBS3 \ 287*7c478bd9Sstevel@tonic-gate ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 \ 288*7c478bd9Sstevel@tonic-gate ENVCPPFLAGS4 MAKEFLAGS PARENT_ROOT 289*7c478bd9Sstevel@tonic-gate 290*7c478bd9Sstevel@tonic-gateecho "RELEASE is $RELEASE" 291*7c478bd9Sstevel@tonic-gateecho "VERSION is $VERSION" 292*7c478bd9Sstevel@tonic-gateecho "RELEASE_DATE is $RELEASE_DATE" 293*7c478bd9Sstevel@tonic-gateecho "" 294*7c478bd9Sstevel@tonic-gate 295*7c478bd9Sstevel@tonic-gateif [[ -f $SRC/Makefile ]] && egrep -s '^setup:' $SRC/Makefile; then 296*7c478bd9Sstevel@tonic-gate echo "The top-level 'setup' target is available \c" 297*7c478bd9Sstevel@tonic-gate echo "to build headers and tools." 298*7c478bd9Sstevel@tonic-gate echo "" 299*7c478bd9Sstevel@tonic-gate 300*7c478bd9Sstevel@tonic-gateelif [[ "$t_FLAG" = "y" ]]; then 301*7c478bd9Sstevel@tonic-gate echo "The tools can be (re)built with the install target in ${TOOLS}." 302*7c478bd9Sstevel@tonic-gate echo "" 303*7c478bd9Sstevel@tonic-gatefi 304*7c478bd9Sstevel@tonic-gate 305*7c478bd9Sstevel@tonic-gate 306*7c478bd9Sstevel@tonic-gateif [[ "$c_FLAG" = "n" && -x "$SHELL" && `basename $SHELL` != "csh" ]]; then 307*7c478bd9Sstevel@tonic-gate # $SHELL is set, and it's not csh. 308*7c478bd9Sstevel@tonic-gate 309*7c478bd9Sstevel@tonic-gate if [[ "$f_FLAG" != "n" ]]; then 310*7c478bd9Sstevel@tonic-gate echo "WARNING: -f is ignored when \$SHELL is not csh" 311*7c478bd9Sstevel@tonic-gate fi 312*7c478bd9Sstevel@tonic-gate 313*7c478bd9Sstevel@tonic-gate echo "Using $SHELL as shell." 314*7c478bd9Sstevel@tonic-gate exec $SHELL ${@:+-c "$@"} 315*7c478bd9Sstevel@tonic-gate 316*7c478bd9Sstevel@tonic-gateelif [[ "$f_FLAG" = "y" ]]; then 317*7c478bd9Sstevel@tonic-gate echo "Using csh -f as shell." 318*7c478bd9Sstevel@tonic-gate exec csh -f ${@:+-c "$@"} 319*7c478bd9Sstevel@tonic-gate 320*7c478bd9Sstevel@tonic-gateelse 321*7c478bd9Sstevel@tonic-gate echo "Using csh as shell." 322*7c478bd9Sstevel@tonic-gate exec csh ${@:+-c "$@"} 323*7c478bd9Sstevel@tonic-gatefi 324