aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/osmo-build-dep.sh
blob: 701341417261e6aa0af169c1c63bb01c42b1e402 (plain)
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
#!/bin/sh
. "$(dirname "$0")/common.sh"

project="$1"
branch="$2"
cfg="$3"

set -e

set +x
example="
Example:
  export deps=\$PWD/deps inst=\$PWD/inst
  mkdir -p \$deps
  mkdir -p \$inst
  MAKE=make PARALLEL_MAKE=-j8 osmo-build-dep.sh libosmocore
"

echo
echo
echo
echo " =============================== $project ==============================="
echo
if [ -z "$project" ]; then
	echo "internal failure: \$project is empty$example"
	exit 1
fi
if [ -z "$deps" ]; then
	echo "internal failure: \$deps is empty$example"
	exit 1
fi
if [ -z "$inst" ]; then
	echo "internal failure: \$inst is empty$example"
	exit 1
fi
if [ -z "$MAKE" ]; then
	echo "internal failure: \$MAKE is empty$example"
	exit 1
fi
set -x

mkdir -p "$deps"
cd "$deps"
osmo-deps.sh "$project" "$branch"
cd "$project"

# Keep the installation targets of the dependencies in a seperate directory
# hierarchy before stowing them to avoid wrongly suggesting that they are part
# of the -I and -L search paths
mkdir -p "$inst/stow"

subdir="$(osmo_source_subdir "$project")"
if [ -n "$subdir" ]; then
	cd "$subdir"
fi

autoreconf --install --force
./configure --prefix="$inst/stow/$project" --with-systemdsystemunitdir="$inst/stow/$project/lib/systemd/system" $cfg

if [ -n "$CHECK" ]; then
	$MAKE $PARALLEL_MAKE check
fi

$MAKE $PARALLEL_MAKE install

# Make the dependencies available through symlinks in $deps ($PWD/..).
STOW_DIR="$inst/stow" stow --restow $project