forked from habanero-rice/hclib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·75 lines (57 loc) · 1.47 KB
/
install.sh
File metadata and controls
executable file
·75 lines (57 loc) · 1.47 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
#!/bin/bash
set -e
# Bootstrap, Configure, Make and Install
#
# Defining some variables
#
PROJECT_NAME=hclib
PREFIX_FLAGS="--prefix=${INSTALL_PREFIX:=${PWD}/${PROJECT_NAME}-install}"
: ${NPROC:=1}
# Don't clobber our custom header template
export AUTOHEADER="echo autoheader disabled"
#
# Bootstrap
#
# if install root has been specified, add --prefix option to configure
echo "[${PROJECT_NAME}] Bootstrap..."
./bootstrap.sh
#
# Configure
#
echo "[${PROJECT_NAME}] Configure..."
COMPTREE=$PWD/compileTree
mkdir -p ${COMPTREE}
cd ${COMPTREE}
../configure ${PREFIX_FLAGS} ${HCLIB_FLAGS} $*
#
# Make
#
echo "[${PROJECT_NAME}] Make..."
make -j${NPROC}
#
# Make install
#
# if install root has been specified, perform make install
echo "[${PROJECT_NAME}] Make install... to ${INSTALL_PREFIX}"
make -j${NPROC} install
#
# Create environment setup script
#
# if install root has been specified, perform make install
HCLIB_ENV_SETUP_SCRIPT=${INSTALL_PREFIX}/bin/hclib_setup_env.sh
if [ -z `command -v xml2-config` ]; then
echo "ERROR: Command xml2-config not found."\
"Please ensure libxml2 (devel) is properly installed." >&2
exit 1
fi
mkdir -p `dirname ${HCLIB_ENV_SETUP_SCRIPT}`
cat > "${HCLIB_ENV_SETUP_SCRIPT}" <<EOI
# HClib environment setup
export HCLIB_ROOT='${INSTALL_PREFIX}'
EOI
cat <<EOI
[${PROJECT_NAME}] Installation complete.
${PROJECT_NAME} installed to: ${INSTALL_PREFIX}
Add the following to your .bashrc (or equivalent):
source ${HCLIB_ENV_SETUP_SCRIPT}
EOI