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