diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-10-16 19:06:32 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-16 20:23:37 -0700 |
commit | 86396e9904f18e2379689ce4d7f83a88dc3016d1 (patch) | |
tree | cbd2eba0b32929f757af4d8b710e1f08401ce455 | |
parent | 1d6c1db4a5808da55b0b49f3d6460f3f10f5e917 (diff) | |
download | subsurface-86396e9904f18e2379689ce4d7f83a88dc3016d1.tar.gz |
build-system: fix libgit2 detection
Usually ldconfig isn't in the user's path.
Suggested-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rwxr-xr-x | scripts/build.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index 9d115310e..cc83eeccb 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -265,9 +265,12 @@ else # maybe there's a system version that's new enough? # Ugh that's uggly - read the ultimate filename, split at the last 'o' which gets us ".0.26.3" or ".1.0.0" # since that starts with a dot, the field numbers in the cut need to be one higher - LIBGIT=$(realpath $(ldconfig -p | grep libgit2\\.so\\. | cut -d\ -f4) | awk -Fo '{ print $NF }') - LIBGITMAJ=$(echo $LIBGIT | cut -d. -f2) - LIBGIT=$(echo $LIBGIT | cut -d. -f3) + LDCONFIG=$(PATH=/sbin:/usr/sbin:$PATH which ldconfig) + if [ ! -z "$LDCONFIG" ] ; then + LIBGIT=$(realpath $("$LDCONFIG" -p | grep libgit2\\.so\\. | cut -d\ -f4) | awk -Fo '{ print $NF }') + LIBGITMAJ=$(echo $LIBGIT | cut -d. -f2) + LIBGIT=$(echo $LIBGIT | cut -d. -f3) + fi fi fi |