Skip to content

Commit f25020f

Browse files
committed
PHPC-873: Do not allow mixing bundled and system libraries
1 parent 47b9be9 commit f25020f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

config.m4

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,16 @@ if test "$MONGODB" != "no"; then
342342
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_EXCEPTIONS, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
343343
fi
344344

345-
PHP_ARG_WITH(libbson, whether to use system libbson,
346-
[ --with-libbson Use system libbson], no, no)
345+
PHP_ARG_WITH(libbson, whether to use system libbson,
346+
[ --with-libbson Use system libbson], no, no)
347+
PHP_ARG_WITH(libmongoc, whether to use system libmongoc,
348+
[ --with-libmongoc Use system libmongoc], no, no)
347349

348350
if test "$PHP_LIBBSON" != "no"; then
351+
if test "$PHP_LIBMONGOC" == "no"; then
352+
AC_MSG_ERROR(Cannot use system libbson and bundled libmongoc)
353+
fi
354+
349355
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
350356
AC_MSG_CHECKING(for libbson)
351357
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libbson-1.0; then
@@ -374,12 +380,13 @@ dnl libmongoc stuff {{{
374380
AC_MSG_CHECKING(configuring libmongoc)
375381
AC_MSG_RESULT(...)
376382

377-
PHP_ARG_WITH(libmongoc, whether to use system libmongoc,
378-
[ --with-libmongoc Use system libmongoc], no, no)
379-
380383
AC_DEFINE(HAVE_MONGOC, 1, [Kinda useless extension without it..])
381384

382385
if test "$PHP_LIBMONGOC" != "no"; then
386+
if test "$PHP_LIBBSON" == "no"; then
387+
AC_MSG_ERROR(Cannot use system libmongoc and bundled libbson)
388+
fi
389+
383390
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
384391
AC_MSG_CHECKING(for libmongoc)
385392
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmongoc-1.0; then

0 commit comments

Comments
 (0)