diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2012-11-01 19:25:23 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin@redhat.com> | 2012-11-01 19:25:23 -0400 |
commit | f3107c65d71d2167e9b95ff79a0d75ed5385bb56 (patch) | |
tree | cdf9bb03a961074cc8cc386ffc47f2a85d7560bf /configure.ac | |
parent | 8c2ec5b5cad770c4e13dbfebf888a4ef08c0c4d2 (diff) | |
download | slapi-nis-f3107c65d71d2167e9b95ff79a0d75ed5385bb56.tar.gz slapi-nis-f3107c65d71d2167e9b95ff79a0d75ed5385bb56.tar.xz slapi-nis-f3107c65d71d2167e9b95ff79a0d75ed5385bb56.zip |
Overhaul betxn support
* Check for BETXN support at build-time, provide options for disabling
or requiring that it be available for build to succeed.
* Track whether or not BETXN support is enabled in the plugin-local
state.
* Skip processing in post/internalpost callbacks if BETXN support is enabled.
* Skip work in betxnpost callbacks if BETXN support is disabled.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 66c978e..90dba52 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,14 @@ dirsrv) SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN, SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN, SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN, + SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN, + SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN, + SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN, + SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN, + SLAPI_PLUGIN_BE_TXN_POST_ADD_FN, + SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN, + SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN, + SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN, NULL] ,,, [AC_INCLUDES_DEFAULT @@ -137,6 +145,83 @@ dirsrv) ;; esac +AC_ARG_ENABLE(be-txns, + AS_HELP_STRING([--disable-be-txns], + [build without support for backend transactions]), + if test x$enableval = xno ; then + transactions=false + elif test x$enableval = xyes; then + transactions=true + fi, + transactions=auto) +if test x$transactions = xauto ; then + AC_MSG_CHECKING([for transaction support]) + transactions=false + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN = xyes; then + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN = xyes; then + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN = xyes; then + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN = xyes; then + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_ADD_FN = xyes; then + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN = xyes; then + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN = xyes; then + if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN = xyes; then + transactions=true + fi + fi + fi + fi + fi + fi + fi + fi + if $transactions ; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +else + if $transactions ; then + AC_MSG_RESULT([enabling backend transaction support]) + else + AC_MSG_RESULT([disabling backend transaction support]) + fi +fi +if $transactions ; then + AC_DEFINE(SLAPI_NIS_SUPPORT_BE_TXNS,1, + [Define if support for backend transactions should be built.]) +fi + +AC_ARG_ENABLE(be-txns-by-default, + AS_HELP_STRING([--disable-be-txns-by-default], + [disable use of backend transactions by default]), + if test x$enableval = xno ; then + deftransactions=0 + elif test x$enableval = xyes ; then + if ! $transactions ; then + AC_MSG_ERROR([unable to enable transactions by default without support for them]) + fi + deftransactions=1 + else + deftransactions=auto + fi, + deftransactions=auto) +if test $deftransactions = auto ; then + AC_MSG_CHECKING([whether or not to enable transaction support by default]) + if $transactions ; then + AC_MSG_RESULT([yes]) + deftransactions=1 + else + AC_MSG_RESULT([no transaction support, so no]) + deftransactions=0 + fi +elif test x$deftransactions = x0 ; then + AC_MSG_RESULT([disabling backend transactions by default]) +elif test x$deftransactions = x1 ; then + AC_MSG_RESULT([enabling backend transactions by default]) +fi +AC_DEFINE_UNQUOTED(DEFAULT_PLUGIN_USE_BETXNS,$deftransactions, + [Define non-zero if support for backend transactions should be enabled by default.]) + if test $thread_api = NSPR ; then AC_DEFINE(USE_NSPR_THREADS,1,[Define to use NSPR threading functions.]) elif test $thread_api = POSIX ; then |