From f8653decf5301289586d99bf99f5f2af36c67f3e Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 25 Mar 2019 16:57:00 +0100 Subject: [PATCH] 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 --- scripts/common.sh | 10 ++++++++++ scripts/osmo-build-dep.sh | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/scripts/common.sh b/scripts/common.sh index 9f274d77..0a32c31e 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -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 +} diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index dfec9be7..2e4fb314 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -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