Skip to content
Snippets Groups Projects
Commit f005565b authored by Steve Lhomme's avatar Steve Lhomme
Browse files

configure: test protobuf-lite < 22 with minimum/maximum values

When the protoc version is in the a.b.c format the protobuf version
is in the a.b.c.d format. Some version of pkg-config allow the equality
of the two, but not all.

We can just make sure protobuf is between a.b.c and a.b.(c+1).

Fixes #29066
parent 35e67cfa
No related branches found
No related tags found
1 merge request!6936configure: test protobuf-lite < 22 with minimum/maximum values
Pipeline #570882 passed with stage
in 36 minutes and 55 seconds
......@@ -3957,8 +3957,10 @@ AS_IF([test -n "$PKG_CONFIG"],[
PROTOC_MAJ_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -1)"
AS_IF([test "${PROTOC_MAJ_VERSION}" -lt "22" ], [
dnl protoc x.y.z is compatible with protobuf x.y.z
PROTOBUF_VERSION="$(echo ${PROTOC_FULL_VERSION})"
PROTOBUF_TEST="protobuf-lite == ${PROTOBUF_VERSION}"
PROTOBUF_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -3)"
dnl the protoc version is in the x.y.z format but protobuf version is in the x.y.z.r format
PROTOBUF_MAX_VERSION="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
PROTOBUF_TEST="protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${PROTOBUF_MAX_VERSION}"
],[
dnl protoc x.y is compatible with protobuf x.y.*
PROTOBUF_VERSION="$(echo ${PROTOC_FULL_VERSION} | cut -d '.' -f -2)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment