Skip to content

PHPC-534: Enable configure without SASL #197

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 4 commits into from
Jan 7, 2016
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
56 changes: 30 additions & 26 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ MONGOC_SOURCES_SASL=mongoc-sasl.c
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_CONTRIB, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
fi

PHP_ARG_WITH(libbson, Use system libbson,
PHP_ARG_WITH(libbson, whether to use system libbson,
[ --with-libbson Use system libbson], no, no)

if test "$PHP_LIBBSON" != "no"; then
Expand Down Expand Up @@ -331,7 +331,7 @@ dnl libmongoc stuff {{{
AC_MSG_CHECKING(configuring libmongoc)
AC_MSG_RESULT(...)

PHP_ARG_WITH(libmongoc, Use system libmongoc,
PHP_ARG_WITH(libmongoc, whether to use system libmongoc,
[ --with-libmongoc Use system libmongoc], no, no)

AC_DEFINE(HAVE_MONGOC, 1, [Kinda useless extension without it..])
Expand Down Expand Up @@ -370,7 +370,7 @@ PHP_ARG_WITH(libmongoc, Use system libmongoc,
fi


PHP_ARG_WITH(pcre-dir, pcre-dir install prefix
PHP_ARG_WITH(pcre-dir, for pcre-dir install prefix,
[ --with-pcre-dir[=DIR] mongodb: pcre install prefix], auto, yes)

if test "$PHP_PCRE_DIR" != "no"; then
Expand All @@ -390,8 +390,8 @@ if test "$PHP_PCRE_DIR" != "no"; then
fi
fi

PHP_ARG_WITH(mongodb-sasl, Build with Cyrus SASL support,
[ --with-mongodb-sasl[=DIR] mongodb: Include Cyrus SASL support], auto, yes)
PHP_ARG_WITH(mongodb-sasl, for Cyrus SASL support,
[ --with-mongodb-sasl[=DIR] mongodb: Include Cyrus SASL support], auto, no)

if test "$PHP_MONGODB_SASL" != "no"; then
AC_MSG_CHECKING(for SASL)
Expand All @@ -405,31 +405,35 @@ if test "$PHP_MONGODB_SASL" != "no"; then

if test -z "$MONGODB_SASL_DIR"; then
AC_MSG_RESULT(not found)
if test "$MONGODB_SASL" != "auto"; then
if test "$PHP_MONGODB_SASL" != "auto"; then
AC_MSG_ERROR([sasl.h not found!])
else
AC_SUBST(MONGOC_ENABLE_SASL, 0)
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
fi
fi
else

PHP_CHECK_LIBRARY(sasl2, sasl_version,
[
PHP_ADD_INCLUDE($MONGODB_SASL_DIR)
PHP_ADD_LIBRARY_WITH_PATH(sasl2, $MONGODB_SASL_DIR/$PHP_LIBDIR, MONGODB_SHARED_LIBADD)
MONGOC_ENABLE_SASL=1
AC_SUBST(MONGOC_ENABLE_SASL)
], [
if test "$MONGODB_SASL" != "auto"; then
AC_MSG_ERROR([MONGO SASL check failed. Please check config.log for more information.])
fi
], [
-L$MONGODB_SASL_DIR/$PHP_LIBDIR
])
PHP_CHECK_LIBRARY(sasl2, sasl_version,
[
PHP_ADD_INCLUDE($MONGODB_SASL_DIR)
PHP_ADD_LIBRARY_WITH_PATH(sasl2, $MONGODB_SASL_DIR/$PHP_LIBDIR, MONGODB_SHARED_LIBADD)
MONGOC_ENABLE_SASL=1
AC_SUBST(MONGOC_ENABLE_SASL)
], [
if test "$MONGODB_SASL" != "auto"; then
AC_MSG_ERROR([MONGO SASL check failed. Please check config.log for more information.])
fi
], [
-L$MONGODB_SASL_DIR/$PHP_LIBDIR
])

PHP_CHECK_LIBRARY(sasl2, sasl_client_done,
[
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 1)
], [
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
])
PHP_CHECK_LIBRARY(sasl2, sasl_client_done,
[
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 1)
], [
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
])
fi
else
AC_SUBST(MONGOC_ENABLE_SASL, 0)
AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
Expand Down