-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·59 lines (48 loc) · 1.33 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·59 lines (48 loc) · 1.33 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /usr/bin/bash
# exit when any command fails
set -e
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
if ! test -d include ; then
echo "Failed to find the \'include\' directory (under pwd)"
exit 1
fi
if ! test -d lib ; then
echo "Failed to find the \'lib\' directory (under pwd)"
exit 1
fi
if ! test -d src ; then
echo "Failed to find the \'src\' directory (under pwd)"
exit 1
fi
## Change compiler recursively from 'gcc' to 'g++'
for dir in cspice csupport brief_c chrnos_c ckbref_c commnt_c cook_c dskbrief_c dskexp_c frmdif_c inspkt_c mkdsk_c mkspk_c msopck_c spacit_c spkdif_c spkmrg_c tobin_c toxfr_c versn_c
do
sed -i 's/gcc/g++/g' src/${dir}/mkprodct.csh
cd src/${dir}
chmod u+x mkprodct.csh
./mkprodct.csh
cd ../../
done
pwdd=$(pwd)
INC=${pwdd}/include
LIB=${pwdd}/lib
INC_DIR=/usr/local/include/cppspice
if ! test -d ${INC_DIR} ; then mkdir ${INC_DIR} ; fi
cd include
echo "Linking/Installing header files to ${INC_DIR}"
for hf in *.h ; do
if test -f ${INC_DIR}/${hf} ; then rm ${INC_DIR}/${hf} ; fi
ln -s ${INC}/${hf} ${INC_DIR}/${hf}
done
cd ../
LIB_DIR=/usr/local/lib
cd lib
echo "Linking/Installing library files to ${LIB_DIR}"
for lf in *.a ; do
if test -f ${LIB_DIR}/${lf} ; then rm ${LIB_DIR}/${lf} ; fi
ln -s ${LIB}/${lf} ${LIB_DIR}/lib${lf}
done
cd ../