osmo-build-dep.sh: cd into subdir before building

Support building the legacy openbsc source with osmo-build.dep.sh. This
will be used by the upcoming osmocom-build-old-tags-against-master.sh
script.

Related: OS#3765
Change-Id: I852e103e80bf295f692cf13c4cb38e80fbc19eca
This commit is contained in:
Oliver Smith 2019-03-25 16:57:00 +01:00
parent 3b3a250f6b
commit f8653decf5
2 changed files with 16 additions and 0 deletions

View File

@ -59,3 +59,13 @@ osmo_git_last_tags() {
ret="$(osmo_git_last_commits_tags "$1" "$2" "$3")"
echo "$ret" | cut -d/ -f 3
}
# Print the subdirectory of the repository where the source lies (configure.ac etc.).
# Print nothing when the source is in the topdir of the repository.
osmo_source_subdir() {
case "$1" in
openbsc)
echo "openbsc"
;;
esac
}

View File

@ -1,4 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/common.sh"
project="$1"
branch="$2"
@ -48,6 +49,11 @@ cd "$project"
# 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
$MAKE $PARALLEL_MAKE install