Skip to content

PHPC-479: Print library version for libmongoc, libbson, and libmongocrypt #1153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ if test "$PHP_MONGODB" != "no"; then
PHP_MONGODB_SYSTEM_LIBS="yes"
fi

PHP_MONGODB_BSON_VERSION_STRING="None"
PHP_MONGODB_MONGOC_VERSION_STRING="None"
PHP_MONGODB_MONGOCRYPT_VERSION_STRING="None"

if test "$PHP_MONGODB_SYSTEM_LIBS" != "no"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for libbson)
Expand All @@ -224,6 +228,7 @@ if test "$PHP_MONGODB" != "no"; then
PHP_MONGODB_BSON_CFLAGS=`$PKG_CONFIG libbson-1.0 --cflags`
PHP_MONGODB_BSON_LIBS=`$PKG_CONFIG libbson-1.0 --libs`
PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion`
PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)"
AC_MSG_RESULT(version $PHP_MONGODB_BSON_VERSION found)
else
AC_MSG_ERROR(system libbson must be upgraded to version >= 1.17.0)
Expand All @@ -241,6 +246,7 @@ if test "$PHP_MONGODB" != "no"; then
PHP_MONGODB_MONGOC_CFLAGS=`$PKG_CONFIG libmongoc-1.0 --cflags`
PHP_MONGODB_MONGOC_LIBS=`$PKG_CONFIG libmongoc-1.0 --libs`
PHP_MONGODB_MONGOC_VERSION=`$PKG_CONFIG libmongoc-1.0 --modversion`
PHP_MONGODB_MONGOC_VERSION_STRING="System ($PHP_MONGODB_MONGOC_VERSION)"
AC_MSG_RESULT(version $PHP_MONGODB_MONGOC_VERSION found)
else
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.17.0)
Expand All @@ -260,6 +266,7 @@ if test "$PHP_MONGODB" != "no"; then
PHP_MONGODB_MONGOCRYPT_CFLAGS=`$PKG_CONFIG libmongocrypt --cflags`
PHP_MONGODB_MONGOCRYPT_LIBS=`$PKG_CONFIG libmongocrypt --libs`
PHP_MONGODB_MONGOCRYPT_VERSION=`$PKG_CONFIG libmongocrypt --modversion`
PHP_MONGODB_MONGOCRYPT_VERSION_STRING="System ($PHP_MONGODB_MONGOCRYPT_VERSION)"
AC_MSG_RESULT(version $PHP_MONGODB_MONGOCRYPT_VERSION found)

PHP_MONGODB_CFLAGS="$PHP_MONGODB_CFLAGS $PHP_MONGODB_MONGOCRYPT_CFLAGS"
Expand Down Expand Up @@ -330,6 +337,10 @@ if test "$PHP_MONGODB" != "no"; then
_include([scripts/autotools/libmongocrypt/CheckSSL.m4])
_include([scripts/autotools/libmongocrypt/Version.m4])

PHP_MONGODB_BSON_VERSION_STRING="Bundled ($BSON_VERSION)"
PHP_MONGODB_MONGOC_VERSION_STRING="Bundled ($MONGOC_VERSION)"
PHP_MONGODB_MONGOCRYPT_VERSION_STRING="Bundled ($MONGOCRYPT_BUILD_VERSION)"

m4_popdef([_include])

AC_SUBST(BSON_EXTRA_ALIGN, 0)
Expand Down Expand Up @@ -500,9 +511,9 @@ Build configuration:
Extra CFLAGS : $STD_CFLAGS $EXTRA_CFLAGS
Developers flags (slow) : $MAINTAINER_CFLAGS
Code Coverage flags (extra slow) : $COVERAGE_CFLAGS
System libmongoc : $PHP_MONGODB_SYSTEM_LIBS
System libbson : $PHP_MONGODB_SYSTEM_LIBS
System libmongocrypt : $PHP_MONGODB_SYSTEM_LIBS
libmongoc : $PHP_MONGODB_BSON_VERSION_STRING
libbson : $PHP_MONGODB_MONGOC_VERSION_STRING
libmongocrypt : $PHP_MONGODB_MONGOCRYPT_VERSION_STRING
LDFLAGS : $LDFLAGS
EXTRA_LDFLAGS : $EXTRA_LDFLAGS
MONGODB_SHARED_LIBADD : $MONGODB_SHARED_LIBADD
Expand Down