1 |
ccflib |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
|
|
# ccf-setup.sh |
4 |
|
|
# |
5 |
|
|
# Setup to build CCF from user's home |
6 |
|
|
# |
7 |
ccflib |
1.6 |
# $Id: ccf-setup.sh,v 1.5 2014/12/12 13:49:27 ccflib Exp $ |
8 |
ccflib |
1.1 |
|
9 |
|
|
|
10 |
ccflib |
1.3 |
host=`hostname | cut -d. -f1` |
11 |
|
|
|
12 |
ccflib |
1.4 |
# 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 |
ccflib |
1.6 |
sunu4u) kernelbits=32 ; refhost="xvsoc01" ;; |
22 |
ccflib |
1.4 |
esac |
23 |
|
|
|
24 |
|
|
# Define CCFLIB_HOME |
25 |
|
|
|
26 |
ccflib |
1.3 |
case "$host" in |
27 |
ccflib |
1.6 |
sasbld01) export CCFLIB_HOME=/home/ccflib ;; |
28 |
|
|
xvsoc01) export CCFLIB_HOME=/data/xmm/ccflib ;; |
29 |
|
|
*) export CCFLIB_HOME=/ccfbuild ;; |
30 |
ccflib |
1.1 |
esac |
31 |
|
|
|
32 |
ccflib |
1.4 |
# Define where is the CCF development software |
33 |
|
|
|
34 |
|
|
export CCFDEV=${CCFLIB_HOME}/ccfdev |
35 |
|
|
|
36 |
ccflib |
1.5 |
if [ ! -d "${CCFDEV}" ] ; then |
37 |
ccflib |
1.4 |
echo "ccf-setup.sh: ${CCFDEV} not found ! - Abort" |
38 |
|
|
return |
39 |
|
|
fi |
40 |
|
|
|
41 |
|
|
# Set the CVS access to CCF package repository |
42 |
|
|
|
43 |
|
|
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
44 |
|
|
|
45 |
|
|
# Heasoft |
46 |
|
|
|
47 |
ccflib |
1.6 |
case "$host" in |
48 |
|
|
xvsoc01) export LHEASOFT=1 ;; |
49 |
|
|
sasdmz01) export HEADAS=/sasbuild/local/sasdmz01/headas/architecture |
50 |
|
|
if [ ! -d "$HEADAS" ] ; then |
51 |
|
|
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
52 |
|
|
return |
53 |
|
|
fi |
54 |
|
|
. ${HEADAS}/headas-init.sh ;; |
55 |
|
|
sasdmz02) export HEADAS=/sasbuild/local/sasdmz02/headas/architecture |
56 |
|
|
if [ ! -d "$HEADAS" ] ; then |
57 |
|
|
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
58 |
|
|
return |
59 |
|
|
fi |
60 |
|
|
. ${HEADAS}/headas-init.sh ;; |
61 |
|
|
*) export HEADAS=/sasbuild/local/${refhost}/headas/architecture |
62 |
|
|
if [ ! -d "$HEADAS" ] ; then |
63 |
|
|
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
64 |
|
|
return |
65 |
|
|
fi |
66 |
|
|
. ${HEADAS}/headas-init.sh ;; |
67 |
|
|
esac |
68 |
ccflib |
1.4 |
|
69 |
|
|
# SAS |
70 |
|
|
|
71 |
ccflib |
1.6 |
case "$host" in |
72 |
|
|
xvsoc01) export SAS_DIR=${CCFLIB_HOME}/xmmsas_20020413_2031 |
73 |
|
|
export SAS_PATH=$SAS_DIR |
74 |
|
|
. $SAS_DIR/sas-setup.sh ;; |
75 |
|
|
*) [ ! -f "$HOME/setsas.sh" ] && /sas/bin/confsas |
76 |
|
|
. $HOME/setsas.sh 1> /dev/null ;; |
77 |
|
|
esac |
78 |
|
|
|
79 |
ccflib |
1.4 |
export SAS_MEMORY_MODEL=Low |
80 |
|
|
|
81 |
ccflib |
1.1 |
# Adds some useful perl modules. |
82 |
|
|
|
83 |
|
|
if [ ! -z $PERL5LIB ]; then |
84 |
|
|
export PERL5LIB=${CCFLIB_HOME}/perl\:$PERL5LIB |
85 |
|
|
else |
86 |
|
|
export PERL5LIB=${CCFLIB_HOME}/perl |
87 |
|
|
fi |
88 |
|
|
|
89 |
ccflib |
1.4 |
# From CCFDEV/setup.sh |
90 |
ccflib |
1.1 |
|
91 |
ccflib |
1.4 |
export PERL5LIB=${CCFDEV}/lib/perl5:$PERL5LIB |
92 |
ccflib |
1.1 |
|
93 |
|
|
|
94 |
ccflib |
1.4 |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
95 |
ccflib |
1.1 |
|
96 |
ccflib |
1.4 |
export PATH=${CCFLIB_HOME}/bin\:$PATH |
97 |
ccflib |
1.1 |
|
98 |
ccflib |
1.4 |
# Unset MAKE if set |
99 |
ccflib |
1.1 |
|
100 |
ccflib |
1.4 |
if [ ! -z "$MAKE" ] ; then |
101 |
|
|
echo "ccf-setup.sh, WARNING: Your environment sets MAKE=$MAKE. It will be unset." |
102 |
|
|
unset MAKE |
103 |
|
|
fi |
104 |
ccflib |
1.1 |
|
105 |
ccflib |
1.4 |
# Show it |
106 |
ccflib |
1.1 |
|
107 |
ccflib |
1.4 |
echo |
108 |
|
|
echo "SAS build reference information" |
109 |
|
|
echo "===============================" |
110 |
|
|
echo |
111 |
|
|
sasversion -V 2 |
112 |
|
|
|
113 |
|
|
echo |
114 |
|
|
echo "CCF building tools" |
115 |
|
|
echo "==================" |
116 |
|
|
echo |
117 |
|
|
deceit -v |
118 |
|
|
ccfextseq -v |
119 |
|
|
echo |
120 |
|
|
echo "CCF development environment" |
121 |
|
|
echo "===========================" |
122 |
|
|
echo |
123 |
|
|
echo "CCFLIB_HOME = $CCFLIB_HOME" |
124 |
|
|
echo "CCFDEV = $CCFDEV" |
125 |
|
|
echo "CCF repository = $CVSROOT" |
126 |
|
|
echo |
127 |
|
|
echo "*** Ready !" |
128 |
|
|
echo |