Skip to content

PHPC-534: Enable configure without SASL #193

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

Closed
wants to merge 3 commits into from
Closed
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
52 changes: 28 additions & 24 deletions config.m4
Original file line number Diff line number Diff line change
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, 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you are changing the default from "yes" to "no" here?


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