build.sh: add flags to only build / not build dependencies

This is mainly intended for use when creating Coverity builds. This
commit is easier to understand with git show -w as almost all changes
are whitespace.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-12-27 08:35:13 -08:00
parent 55a3cd13cd
commit 40c6d9521e

View file

@ -59,6 +59,16 @@ while [[ $# -gt 0 ]] ; do
# hack for Travix Mac build # hack for Travix Mac build
SKIP_GOOGLEMAPS="1" SKIP_GOOGLEMAPS="1"
;; ;;
-only-deps)
# for Coverity build we want a mode to just build Subsurface and libdivecomputer (those will be analyzed),
# and build the rest, first.
ONLY_DEPS="1"
;;
-no-deps)
# for Coverity build we want a mode to just build Subsurface and libdivecomputer (those will be analyzed),
# and build the rest, first.
NO_DEPS="1"
;;
*) *)
echo "Unknown command line argument $arg" echo "Unknown command line argument $arg"
;; ;;
@ -304,6 +314,7 @@ if [[ $PLATFORM = Darwin || "$LIBGIT" < "24" ]] ; then
cd $SRC cd $SRC
if [ -z "$NO_DEPS" ] ; then
if [ ! -d libgit2 ] ; then if [ ! -d libgit2 ] ; then
if [[ $1 = local ]] ; then if [[ $1 = local ]] ; then
git clone $SRC/../libgit2 libgit2 git clone $SRC/../libgit2 libgit2
@ -323,6 +334,7 @@ if [[ $PLATFORM = Darwin || "$LIBGIT" < "24" ]] ; then
cmake $OLDER_MAC_CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=Release -DBUILD_CLAR=OFF .. cmake $OLDER_MAC_CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=Release -DBUILD_CLAR=OFF ..
make -j4 make -j4
make install make install
fi
if [ $PLATFORM = Darwin ] ; then if [ $PLATFORM = Darwin ] ; then
# in order for macdeployqt to do its job correctly, we need the full path in the dylib ID # in order for macdeployqt to do its job correctly, we need the full path in the dylib ID
@ -339,6 +351,7 @@ cd $SRC
# build libdivecomputer # build libdivecomputer
if [ -z "$ONLY_DEPS" ] ; then
cd subsurface cd subsurface
if [ ! -d libdivecomputer/src ] ; then if [ ! -d libdivecomputer/src ] ; then
@ -361,6 +374,7 @@ fi
CFLAGS="$OLDER_MAC -I$INSTALL_ROOT/include $LIBDC_CFLAGS" ../configure --prefix=$INSTALL_ROOT --disable-examples CFLAGS="$OLDER_MAC -I$INSTALL_ROOT/include $LIBDC_CFLAGS" ../configure --prefix=$INSTALL_ROOT --disable-examples
make -j4 make -j4
make install make install
fi
if [ $PLATFORM = Darwin ] ; then if [ $PLATFORM = Darwin ] ; then
if [ -z "$CMAKE_PREFIX_PATH" ] ; then if [ -z "$CMAKE_PREFIX_PATH" ] ; then
@ -401,6 +415,7 @@ if [ "$BUILDGRANTLEE" = "1" ] ; then
# build grantlee # build grantlee
PRINTING="-DNO_PRINTING=OFF" PRINTING="-DNO_PRINTING=OFF"
if [ -z "$NO_DEPS" ] ; then
cd $SRC cd $SRC
if [ ! -d grantlee ] ; then if [ ! -d grantlee ] ; then
@ -423,6 +438,7 @@ if [ "$BUILDGRANTLEE" = "1" ] ; then
$SRC/grantlee $SRC/grantlee
make -j4 make -j4
make install make install
fi
else else
PRINTING="-DNO_PRINTING=ON" PRINTING="-DNO_PRINTING=ON"
fi fi
@ -430,6 +446,7 @@ fi
if [ "$SKIP_GOOGLEMAPS" != "1" ] ; then if [ "$SKIP_GOOGLEMAPS" != "1" ] ; then
# build the googlemaps map plugin # build the googlemaps map plugin
if [ -z "$NO_DEPS" ] ; then
cd $SRC cd $SRC
if [ ! -d googlemaps ] ; then if [ ! -d googlemaps ] ; then
if [[ $1 = local ]] ; then if [[ $1 = local ]] ; then
@ -454,11 +471,13 @@ if [ "$SKIP_GOOGLEMAPS" != "1" ] ; then
make -j4 make -j4
make install make install
fi fi
fi
# finally, build Subsurface # finally, build Subsurface
set -x set -x
if [ -z "$ONLY_DEPS" ] ; then
cd $SRC/subsurface cd $SRC/subsurface
for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
SUBSURFACE_EXECUTABLE=${BUILDS[$i]} SUBSURFACE_EXECUTABLE=${BUILDS[$i]}
@ -505,3 +524,6 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do
cp subsurface/icons/subsurface-icon.png appdir/usr/share/icons/hicolor/256x256/apps/ cp subsurface/icons/subsurface-icon.png appdir/usr/share/icons/hicolor/256x256/apps/
fi fi
done done
else
echo "Done building the dependencies, did not build libdivecomputer and Subsurface"
fi