3 dirname=$(dirname -- "${0}")
4 if cd "${dirname}"; then
9 if [ -z "$XSEG_HOME" ]; then
10 echo 'Cannot set $XSEG_HOME'
14 PEERS=${XSEG_HOME}/peers
15 TOOLS=${XSEG_HOME}/tools
18 if [ ! -d "${LIBS}" ] || [ ! -d "${PEERS}" ]; then
19 echo "Cannot find basic xseg layout"
23 if ! echo ${PATH} | grep -E -e '(^|:)'"${PEERS}"'(:|$)' > /dev/null 2>&1; then
27 if ! echo ${PATH} | grep -E -e '(^|:)'"${TOOLS}"'(:|$)' > /dev/null 2>&1; then
31 if ! echo ${LD_LIBRARY_PATH} | grep -E -e '(^|:)'"${LIBS}"'(:|$)' > /dev/null 2>&1; then
32 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LIBS}
35 export PATH LD_LIBRARY_PATH XSEG_HOME
37 [ -z "$SHELL" ] && SHELL=/bin/bash
39 selfname=$(basename -- "${0}")
40 [ "$selfname" = "envsetup" ] && exec "$SHELL"