1 |
#!/bin/bash |
2 |
# |
3 |
# ccf-setup.sh |
4 |
# |
5 |
# Setup to build CCF from user's home |
6 |
# |
7 |
# $Id: ccf-setup.sh,v 1.4 2014/12/12 13:47:39 ccflib Exp $ |
8 |
|
9 |
|
10 |
host=`hostname | cut -d. -f1` |
11 |
|
12 |
# Identify machine OS name and kernel type |
13 |
|
14 |
osname=`uname -s` |
15 |
|
16 |
cputype=`uname -m` |
17 |
|
18 |
case "$cputype" in |
19 |
i[3,4,5,6]86) kernelbits=32 ; refhost="sasbld01" ;; |
20 |
x86_64) kernelbits=64 ; refhost="sasbld02" ;; |
21 |
esac |
22 |
|
23 |
# Define CCFLIB_HOME |
24 |
|
25 |
case "$host" in |
26 |
sasbld01) export CCFLIB_HOME=/home/ccflib ;; |
27 |
*) export CCFLIB_HOME=/ccfbuild ;; |
28 |
esac |
29 |
|
30 |
# Define where is the CCF development software |
31 |
|
32 |
export CCFDEV=${CCFLIB_HOME}/ccfdev |
33 |
|
34 |
if [ ! -d "${CCFDEV}" ] ; then |
35 |
echo "ccf-setup.sh: ${CCFDEV} not found ! - Abort" |
36 |
return |
37 |
fi |
38 |
|
39 |
# Set the CVS access to CCF package repository |
40 |
|
41 |
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
42 |
|
43 |
# Heasoft |
44 |
|
45 |
export HEADAS=/sasbuild/local/${refhost}/headas/architecture |
46 |
if [ ! -d "$HEADAS" ] ; then |
47 |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
48 |
return |
49 |
fi |
50 |
. ${HEADAS}/headas-init.sh |
51 |
|
52 |
# SAS |
53 |
|
54 |
[ ! -f "$HOME/setsas.sh" ] && /sas/bin/confsas |
55 |
. $HOME/setsas.sh 1> /dev/null |
56 |
export SAS_MEMORY_MODEL=Low |
57 |
|
58 |
# Adds some useful perl modules. |
59 |
|
60 |
if [ ! -z $PERL5LIB ]; then |
61 |
export PERL5LIB=${CCFLIB_HOME}/perl\:$PERL5LIB |
62 |
else |
63 |
export PERL5LIB=${CCFLIB_HOME}/perl |
64 |
fi |
65 |
|
66 |
# From CCFDEV/setup.sh |
67 |
|
68 |
export PERL5LIB=${CCFDEV}/lib/perl5:$PERL5LIB |
69 |
|
70 |
|
71 |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
72 |
|
73 |
export PATH=${CCFLIB_HOME}/bin\:$PATH |
74 |
|
75 |
# Unset MAKE if set |
76 |
|
77 |
if [ ! -z "$MAKE" ] ; then |
78 |
echo "ccf-setup.sh, WARNING: Your environment sets MAKE=$MAKE. It will be unset." |
79 |
unset MAKE |
80 |
fi |
81 |
|
82 |
# Show it |
83 |
|
84 |
echo |
85 |
echo "SAS build reference information" |
86 |
echo "===============================" |
87 |
echo |
88 |
sasversion -V 2 |
89 |
|
90 |
echo |
91 |
echo "CCF building tools" |
92 |
echo "==================" |
93 |
echo |
94 |
deceit -v |
95 |
ccfextseq -v |
96 |
echo |
97 |
echo "CCF development environment" |
98 |
echo "===========================" |
99 |
echo |
100 |
echo "CCFLIB_HOME = $CCFLIB_HOME" |
101 |
echo "CCFDEV = $CCFDEV" |
102 |
echo "CCF repository = $CVSROOT" |
103 |
echo |
104 |
echo "*** Ready !" |
105 |
echo |