-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·126 lines (110 loc) · 4.11 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·126 lines (110 loc) · 4.11 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
DEF_install="$(pwd)/install"
DEF_build="$(pwd)/BuildArea"
DEF_variant="release"
components=" boost physical xylose chimp "
component_args_boost=" --with-regex link=static "
function usage() {
echo "$0 [component list] [--] [options] [--help]"
echo " [component list]: The components to build and install"
echo " If you don't specify a component to build and install, all"
echo " components will be built and installed."
echo " NOTE: for simplicity of this script, the component list MUST"
echo " be first in the list of command line arguments to this script"
echo ""
echo " Currently, the following pieces will be compiled and installed:"
printf " component\t\tcomponent specific arguments\n"
printf " *********\t\t******************\n"
for i in $components; do
eval " args=\${component_args_${i//-/_}}"
printf " %s\t\t%s\n" "$i" "$args"
done
echo ""
echo " The optional '--' separation characters may be necessary if a"
echo " component happens to have the same name as a bjam option."
echo ""
echo " The options can be any bjam option including:"
echo " --prefix=/path/to/install/into Default: ${DEF_install}"
echo " Be warned that this must be an ABSOLUTE path"
echo " --libdir=/path/to/install/lib Default: ${DEF_install}/lib"
echo " Be warned that this must be an ABSOLUTE path"
echo " --includedir=/path/to/install/inc Default: ${DEF_install}/include"
echo " Be warned that this must be an ABSOLUTE path"
echo " --build-dir=/path/for/building Default: ${DEF_build}"
echo " Be warned that this must be an ABSOLUTE path"
echo " variant=[debug,release,profile] Default: ${DEF_variant}"
echo ""
echo " you can also just specify [debug|release|profile] instead of"
echo " using the 'variant=' prefix. "
echo ""
echo " --help show this message"
}
# create list of componets requested to build
requested_components=""
for i in "$@" ; do
if [ "${components// $i /}" != "${components}" ]; then
shift 1
requested_components=" $requested_components $i "
else
break
fi
done
if [ "$requested_components" != "" ]; then
components="$requested_components"
fi
#get rid of the possible -- separation character
if [ "$1" = "--" ]; then
shift 1
fi
all_args="$*"
function arg_set() {
grep_result=$(echo " ${all_args} " | grep "$1")
if [ "$grep_result" != "" ]; then
echo 1
return 1
fi
}
if [ "$(arg_set '\(--\)help')" ]; then
usage
exit;
fi
if [ ! "$(arg_set '\(--\)prefix')" ]; then
prefix="--prefix=${DEF_install}"
install_dir="${DEF_install}"
else
install_dir=$(echo "${all_args}" | \
sed -e "s/.*--prefix=\([^[:space:]]*\)\s*.*/\1/")
fi
if [ ! "$(arg_set '\(--\)build-dir')" ]; then
build_dir="--build-dir=${DEF_build}"
fi
if [ ! "$(arg_set '[[:space:]]\<variant=')" -a \
! "$(arg_set '[[:space:]]\<release[[:space:]]\>')" -a \
! "$(arg_set '[[:space:]]\<debug\>[[:space:]]')" -a \
! "$(arg_set '[[:space:]]\<profile\>[[:space:]]')" ]; then
variant="variant=${DEF_variant}"
fi
# lets first make sure that the Boost.Build system is up and running...
. project-shell --do-not-start-shell
for i in $components; do
pushd $i > /dev/null
if [ -d docs/api -a -f docs/api/Jamfile -a -f docs/api/Doxyfile ]; then
echo "building sub-component $i documentation..."
sleep .8
pushd docs/api > /dev/null
bjam
popd > /dev/null
fi
echo "building sub-component $i..."
sleep .8
eval "args=\${component_args_${i//-/_}}"
bjam ${args} ${build_dir} ${variant} install ${prefix} "$@"
popd > /dev/null
done
# copy over the build config for Make and CMake
for i in Makefile.chimp-project ; do
echo "installing $i to ${install_dir}"
mkdir -p ${install_dir}/share/chimp
cat "$i" | sed -e "s/@CHIMP_INSTALL_DIR@/${install_dir//\//\\/}/" > \
${install_dir}/share/chimp/$i
done