forked from facebookincubator/hsthrift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
new_install_deps.sh
executable file
·42 lines (34 loc) · 1.12 KB
/
new_install_deps.sh
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
#!/usr/bin/env bash
# Copyright (c) Facebook, Inc. and its affiliates.
set -e
BUILDER=./build.sh
THREADS=4
#
# These are required source deps not satisifiable with common package systems
# in topological order. You can pass additional deps on the command line.
#
DEPS="fmt folly fizz wangle fbthrift"
while [ "$#" -gt 0 ]; do
case "$1" in
--threads) THREADS="$2"; shift; shift;;
*) DEPS+=" $1"; shift;;
esac
done
# default library and bin install path
if [ -z "${INSTALL_PREFIX}" ]; then
INSTALL_PREFIX="${HOME}/.hsthrift"
fi
# build in order
for dep in $DEPS; do
${BUILDER} build --no-deps --install-dir "${INSTALL_PREFIX}" \
--num-jobs "${THREADS}" "$dep"
done
# add these to your environment
if [ -d "${INSTALL_PREFIX}/lib64" ]; then
echo "export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${INSTALL_PREFIX}/lib64"
echo "export PKG_CONFIG_PATH=${INSTALL_PREFIX}/lib/pkgconfig:${INSTALL_PREFIX}/lib64/pkgconfig"
else
echo "export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib"
echo "export PKG_CONFIG_PATH=${INSTALL_PREFIX}/lib/pkgconfig"
fi
echo "export PATH=\$PATH:${INSTALL_PREFIX}/bin"