-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject-shell
executable file
·44 lines (36 loc) · 1.18 KB
/
project-shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
TOP_DIR=$( readlink -n -f $(dirname $BASH_SOURCE) )
if [ "$1" = "--do-not-start-shell" ] ; then
START_SHELL="no"
shift 1
elif [ "$BASH_SOURCE" != "$0" ] ; then
START_SHELL="no"
else
START_SHELL="yes"
fi;
# detect whether boost/bootstrap.sh has been executed yet and if not, do so
if test -f "${TOP_DIR}/boost/bjam" -a \
-x "${TOP_DIR}/boost/bjam" ; then
echo boost/bjam already built
else
echo Note: any options passed in on the command line will be passed to
echo boost/bootstrap.sh
echo building boost/bjam...
pushd ${TOP_DIR}/boost 2> /dev/null
./bootstrap.sh "$@"
popd 2> /dev/null
fi
#need to make sure that the boost-build path is set
export BOOST_BUILD_PATH=${TOP_DIR}/boost/tools/build/v2/
# put the boost sub-project into the path so that we can get bjam correctly
export PATH=${TOP_DIR}/boost:$PATH
SHELL_ARGS=""
# some coolness for bash:
if [ "$( echo $SHELL|grep bash )" != "" ] ; then
export PROJECT_SHELL_DIR="${TOP_DIR}"
SHELL_ARGS="--rcfile ${TOP_DIR}/.bashrc"
fi
if [ "$START_SHELL" = "yes" ] ; then
echo "Entering login shell with the proper environment changes"
exec $SHELL ${SHELL_ARGS}
fi;