aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2018-09-15 10:21:40 +0100
committerHolger Freyther <holger@freyther.de>2018-09-18 06:29:17 +0000
commitcb132bd79f2176a535d049d7d3b32443b94df6e8 (patch)
tree40219f7ddcd78e2b6093cf646a535bf3f9381bc3
parent43857809c1778792cc447fac89c4a0587098234d (diff)
build: Add overload to clone repo and build in subdirectory
To build osmo-nitb we need to clone "openbsc" and then enter the "openbsc" sub-directory. For building "mobile" and "virt_phy" of OsmocomBB we will need to do something similar. Instead of added more hardcoded paths, add a variant that allows to specify the source directory. Change-Id: I67fbd54296f2c68316bf8e89cfeb37d147193d53
-rw-r--r--contrib/jenkins-build-common.sh21
-rwxr-xr-xcontrib/jenkins-build-osmo-nitb.sh2
2 files changed, 14 insertions, 9 deletions
diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh
index 731bf58..c2ffbb4 100644
--- a/contrib/jenkins-build-common.sh
+++ b/contrib/jenkins-build-common.sh
@@ -12,6 +12,7 @@
# build_repo libosmocore --configure --opts
# build_repo libosmo-foo special_branch --configure --opts
# build_repo osmo-bar
+# build_repo_dir openbsc ./openbsc
#
# create_bin_tgz
#--------------
@@ -98,11 +99,19 @@ have_repo() {
build_repo() {
# usage: build_repo <name> [<branch>] [--configure-opts [...]]
+ dir="$1"
+ shift
+ build_repo_dir "${dir}" "./" $@
+}
+
+build_repo_dir() {
+ # usage: build_repo_dir <name> <dir> [<branch>] [--configure-opts [...]]
dep="$1"
+ dir="$2"
branch="master"
- if [ -z "$(echo "$2" | grep '^-')" ]; then
+ if [ -z "$(echo "$3" | grep '^-')" ]; then
# second arg does not start with a dash, it's empty or a branch
- branch="$2"
+ branch="$3"
if [ -n "$branch" ]; then
# we had a branch arg, need to shift once more to get config options
shift
@@ -111,6 +120,7 @@ build_repo() {
fi
fi
shift
+ shift
configure_opts="$@"
set +x; echo "
@@ -122,12 +132,7 @@ build_repo() {
have_repo "$dep" "$branch"
- cd "$dep"
-
- # special shim: we know the openbsc.git needs to be built in the openbsc/ subdir.
- if [ "$dep" = "openbsc" ]; then
- cd openbsc
- fi
+ cd "$dep/${dir}"
set +x; echo; echo; set -x
autoreconf -fi
diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh
index 1e3ecc6..4f81fa8 100755
--- a/contrib/jenkins-build-osmo-nitb.sh
+++ b/contrib/jenkins-build-osmo-nitb.sh
@@ -10,6 +10,6 @@ build_repo libosmo-netif --disable-doxygen
build_repo openggsn
build_repo libsmpp34
build_repo libosmo-sccp
-build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat
+build_repo_dir openbsc openbsc --enable-smpp --enable-osmo-bsc --enable-nat
create_bin_tgz "osmo-nitb osmo-bsc_mgcp"