2016-04-27 20:06:46 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-09-21 22:33:50 +00:00
|
|
|
export PATH="$PATH:$HOME/osmo-ci/scripts"
|
2016-04-27 20:06:46 +00:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands. There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.
Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.
Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".
Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.
Build aper-prefix branch of asn1c, as needed by 'regen'.
'make regen' first, to generate the .c from asn1, needed by the build.
Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-11 15:10:49 +00:00
|
|
|
base="$PWD"
|
|
|
|
deps="$base/deps"
|
|
|
|
inst="$deps/install"
|
|
|
|
|
|
|
|
mkdir "$deps" || true
|
|
|
|
rm -rf "$inst"
|
|
|
|
|
2016-08-27 11:59:54 +00:00
|
|
|
marker() {
|
2016-07-11 17:27:22 +00:00
|
|
|
set +x
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
2016-08-27 11:59:54 +00:00
|
|
|
echo " =============================== $@ ==============================="
|
2016-07-11 17:27:22 +00:00
|
|
|
echo
|
|
|
|
set -x
|
2016-08-27 11:59:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_dep() {
|
|
|
|
project="$1"
|
|
|
|
branch="$2"
|
|
|
|
marker $project
|
jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands. There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.
Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.
Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".
Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.
Build aper-prefix branch of asn1c, as needed by 'regen'.
'make regen' first, to generate the .c from asn1, needed by the build.
Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-11 15:10:49 +00:00
|
|
|
if [ -z "$project" ]; then
|
|
|
|
echo "internal failure"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
cd "$deps"
|
|
|
|
rm -rf "$project"
|
|
|
|
osmo-deps.sh "$project"
|
|
|
|
cd "$project"
|
|
|
|
if [ -n "$branch" ]; then
|
|
|
|
git checkout "$branch"
|
|
|
|
fi
|
2016-07-11 17:27:22 +00:00
|
|
|
git rev-parse HEAD
|
jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands. There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.
Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.
Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".
Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.
Build aper-prefix branch of asn1c, as needed by 'regen'.
'make regen' first, to generate the .c from asn1, needed by the build.
Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-11 15:10:49 +00:00
|
|
|
autoreconf --install --force
|
|
|
|
./configure --prefix="$inst"
|
|
|
|
$MAKE $PARALLEL_MAKE install
|
|
|
|
}
|
|
|
|
|
|
|
|
build_dep libosmocore
|
|
|
|
|
|
|
|
# All below builds want this PKG_CONFIG_PATH
|
|
|
|
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
|
|
|
|
|
|
build_dep libosmo-abis
|
|
|
|
build_dep libosmo-netif sysmocom/sctp
|
|
|
|
build_dep libosmo-sccp sysmocom/iu
|
|
|
|
build_dep libasn1c
|
|
|
|
|
|
|
|
# the asn1c binary is used by the 'regen' target below
|
|
|
|
build_dep asn1c aper-prefix
|
|
|
|
|
2016-08-27 11:59:54 +00:00
|
|
|
marker osmo-iuh
|
jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands. There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.
Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.
Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".
Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.
Build aper-prefix branch of asn1c, as needed by 'regen'.
'make regen' first, to generate the .c from asn1, needed by the build.
Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-11 15:10:49 +00:00
|
|
|
cd "$base"
|
2016-07-11 19:56:15 +00:00
|
|
|
|
2016-04-27 20:06:46 +00:00
|
|
|
autoreconf --install --force
|
jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands. There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.
Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.
Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".
Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.
Build aper-prefix branch of asn1c, as needed by 'regen'.
'make regen' first, to generate the .c from asn1, needed by the build.
Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-11 15:10:49 +00:00
|
|
|
./configure
|
2016-08-29 13:50:14 +00:00
|
|
|
|
|
|
|
# Verify that checked-in asn1 code is identical to regenerated asn1 code
|
jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands. There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.
Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.
Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".
Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.
Build aper-prefix branch of asn1c, as needed by 'regen'.
'make regen' first, to generate the .c from asn1, needed by the build.
Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-11 15:10:49 +00:00
|
|
|
PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen
|
2016-08-29 13:50:14 +00:00
|
|
|
|
|
|
|
# attempt to settle the file system
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
git status
|
|
|
|
git diff | cat
|
|
|
|
|
|
|
|
if ! git diff-files --quiet ; then
|
|
|
|
echo "ERROR: 'make -C src regen' does not match committed asn1 code"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands. There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.
Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.
Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".
Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.
Build aper-prefix branch of asn1c, as needed by 'regen'.
'make regen' first, to generate the .c from asn1, needed by the build.
Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-11 15:10:49 +00:00
|
|
|
$MAKE $PARALLEL_MAKE
|
2016-09-21 22:33:50 +00:00
|
|
|
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|
|
|
|
|| cat-testlogs.sh
|
|
|
|
LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \
|
|
|
|
|| cat-testlogs.sh
|