X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=macros%2Fcnid-backend.m4;h=c87e457c598c0832985228832bfeb867e7f57360;hb=f254fd618b53e97cc5382b23709d4f3de1e70b41;hp=a304b24ce4bbdcf5ee6e7b500f08bbc8d57a6df0;hpb=ecfc96169ab669b578e53fa8e13592934fe37788;p=netatalk.git diff --git a/macros/cnid-backend.m4 b/macros/cnid-backend.m4 index a304b24c..c87e457c 100644 --- a/macros/cnid-backend.m4 +++ b/macros/cnid-backend.m4 @@ -1,39 +1,15 @@ AC_DEFUN([AC_NETATALK_CNID], [ - dnl Don't use BDB unless it's needed bdb_required=no compiled_backends="" - dnl Determine whether or not to use BDB Concurrent Data Store - AC_MSG_CHECKING([whether or not to use BDB Concurrent Data Store]) - AC_ARG_WITH(cnid-cdb-backend, - [ --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store],[ - if test x"$withval" = x"no"; then - use_cdb_backend=no - else - use_cdb_backend=yes - fi - ],[use_cdb_backend=yes] - ) - - if test $use_cdb_backend = yes; then - AC_MSG_RESULT([yes]) - AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.]) - DEFAULT_CNID_SCHEME=cdb - bdb_required=yes - compiled_backends="$compiled_backends cdb" - else - AC_MSG_RESULT([no]) - fi - AM_CONDITIONAL(USE_CDB_BACKEND, test x"$use_cdb_backend" = x"yes") - dnl Determine whether or not to use Database Daemon CNID backend AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend]) AC_ARG_WITH(cnid-dbd-backend, - [ --with-cnid-dbd-backend build CNID with Database Daemon Data Store], + [ --with-cnid-dbd-backend build CNID with Database Daemon Data Store [[yes]]], [ if test x"$withval" = x"no"; then - AC_MSG_RESULT([no]) use_dbd_backend=no + AC_MSG_RESULT([no]) else use_dbd_backend=yes AC_MSG_RESULT([yes]) @@ -43,31 +19,6 @@ AC_DEFUN([AC_NETATALK_CNID], [ AC_MSG_RESULT([yes]) ]) - dnl Determine whether or not to use with transaction support in Database Daemon - AC_MSG_CHECKING([whether or not to use Database Daemon with transaction support]) - AC_ARG_WITH(cnid-dbd-txn, - [ --with-cnid-dbd-txn build transaction support for dbd backend], - [ if test x"$withval" = x"no"; then - AC_MSG_RESULT([no]) - use_dbd_txn=no - else - use_dbd_txn=yes - AC_MSG_RESULT([yes]) - fi - ],[ - use_dbd_txn=no - AC_MSG_RESULT([no]) - ]) - - if test $use_dbd_txn = yes; then - use_dbd_backend=yes - AC_DEFINE(CNID_BACKEND_DBD_TXN, 1, [Define if CNID Database Daemon backend has transaction support]) - else - if test x"$use_dbd_backend" = x; then - use_dbd_backend=no - fi - fi - if test $use_dbd_backend = yes; then compiled_backends="$compiled_backends dbd" AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.]) @@ -78,37 +29,37 @@ AC_DEFUN([AC_NETATALK_CNID], [ fi AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes") - dnl Determine whether or not to use BDB transactional data store - AC_MSG_CHECKING([whether or not to use BDB transactional DB store]) - AC_ARG_WITH(cnid-db3-backend, - [ --with-cnid-db3-backend build CNID with transactional BDB Data Store], - [ + dnl Determine whether or not to use BDB Concurrent Data Store + AC_MSG_CHECKING([whether or not to use BDB Concurrent Data Store]) + AC_ARG_WITH(cnid-cdb-backend, + [ --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store [[no]]],[ if test x"$withval" = x"no"; then - use_db3_backend=no + use_cdb_backend=no else - use_db3_backend=yes + use_cdb_backend=yes fi ],[ - use_db3_backend=no + use_cdb_backend=no ]) - if test x"$use_db3_backend" = x"yes"; then + + if test $use_cdb_backend = yes; then AC_MSG_RESULT([yes]) - AC_DEFINE(CNID_BACKEND_DB3, 1, [Define if CNID transactional BDB backend should be compiled.]) + AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.]) if test x"$DEFAULT_CNID_SCHEME" = x; then - DEFAULT_CNID_SCHEME=db3 + DEFAULT_CNID_SCHEME=cdb fi - compiled_backends="$compiled_backends db3" bdb_required=yes + compiled_backends="$compiled_backends cdb" else AC_MSG_RESULT([no]) fi - AM_CONDITIONAL(USE_DB3_BACKEND, test x"$use_db3_backend" = x"yes") + AM_CONDITIONAL(USE_CDB_BACKEND, test x"$use_cdb_backend" = x"yes") dnl Determine whether or not to use LAST DID scheme AC_MSG_CHECKING([whether or not to use LAST DID scheme]) AC_ARG_WITH(cnid-last-backend, - [ --with-cnid-last-backend build LAST CNID scheme], + [ --with-cnid-last-backend build LAST CNID scheme [[yes]]], [ if test x"$withval" = x"no"; then use_last_backend=no @@ -129,36 +80,12 @@ AC_DEFUN([AC_NETATALK_CNID], [ else AC_MSG_RESULT([no]) fi - - dnl Determine whether or not to use HASH DID scheme - AC_MSG_CHECKING([whether or not to use HASH DID scheme]) - AC_ARG_WITH(cnid-hash-backend, - [ --with-cnid-hash-backend build HASH CNID scheme], - [ - if test x"$withval" = x"no"; then - use_hash_backend=no - else - use_hash_backend=yes - fi - ],[ - use_hash_backend=no - ]) - - if test $use_hash_backend = yes; then - AC_MSG_RESULT([yes]) - AC_DEFINE(CNID_BACKEND_HASH, 1, [Define if CNID HASH scheme backend should be compiled.]) - if test x"$DEFAULT_CNID_SCHEME" = x; then - DEFAULT_CNID_SCHEME=hash - fi - compiled_backends="$compiled_backends hash" - else - AC_MSG_RESULT([no]) - fi + AM_CONDITIONAL(USE_LAST_BACKEND, test x"$use_last_backend" = x"yes") dnl Determine whether or not to use TDB DID scheme AC_MSG_CHECKING([whether or not to use TDB DID scheme]) AC_ARG_WITH(cnid-tdb-backend, - [ --with-cnid-tdb-backend build DID CNID scheme], + [ --with-cnid-tdb-backend build TDB CNID scheme [[yes]]], [ if test x"$withval" = x"no"; then use_tdb_backend=no @@ -166,49 +93,58 @@ AC_DEFUN([AC_NETATALK_CNID], [ use_tdb_backend=yes fi ],[ - use_tdb_backend=no + use_tdb_backend=yes ]) if test $use_tdb_backend = yes; then AC_MSG_RESULT([yes]) AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.]) - if test x"$DEFAULT_TDB_SCHEME" = x; then + if test x"$DEFAULT_CNID_SCHEME" = x; then DEFAULT_CNID_SCHEME=tdb fi compiled_backends="$compiled_backends tdb" else AC_MSG_RESULT([no]) fi + AM_CONDITIONAL(USE_TDB_BACKEND, test x"$use_tdb_backend" = x"yes") - dnl Determine whether or not to use MTAB DID scheme - AC_MSG_CHECKING([whether or not to use MTAB DID scheme]) - AC_ARG_WITH(cnid-mtab-backend, - [ --with-cnid-mtab-backend build MTAB CNID scheme], - [ - if test x"$withval" = x"no"; then - use_mtab_backend=no - else - use_mtab_backend=yes - fi - ],[ - use_mtab_backend=no - ]) + dnl Check for mysql CNID backend + AC_ARG_VAR(MYSQL_CFLAGS, [C compiler flags for MySQL, overriding checks]) + AC_ARG_VAR(MYSQL_LIBS, [linker flags for MySQL, overriding checks]) - if test $use_mtab_backend = yes; then - AC_MSG_RESULT([yes]) - AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.]) - if test x"$DEFAULT_CNID_SCHEME" = x; then - DEFAULT_CNID_SCHEME=mtab - fi - compiled_backends="$compiled_backends mtab" - else - AC_MSG_RESULT([no]) + AC_MSG_CHECKING([MySQL library and headers]) + AC_ARG_WITH( + mysql-config, + [AS_HELP_STRING([--with-mysql-config=PATH],[Path to mysql-config binary (default: mysql_config)])], + MYSQL_CONFIG=$withval + ) + + if test -z "$MYSQL_CONFIG" -a -z "$MYSQL_CFLAGS" -a -z "$MYSQL_LIBS" ; then + AC_PATH_PROG(MYSQL_CONFIG, mysql_config) fi + if test -x "$MYSQL_CONFIG" ; then + AC_MSG_RESULT([$MYSQL_CONFIG]) + MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`" + MYSQL_LIBS="`$MYSQL_CONFIG --libs`" + ac_cv_with_cnid_mysql="yes" + elif test -n "$MYSQL_CFLAGS" -a -n "$MYSQL_LIBS" ; then + ac_cv_with_cnid_mysql="yes" + fi + + if test x"$ac_cv_with_cnid_mysql" = x"yes" ; then + compiled_backends="$compiled_backends mysql" + AC_DEFINE(CNID_BACKEND_MYSQL, 1, [whether the MySQL CNID module is available]) + fi + + AC_SUBST(MYSQL_CFLAGS) + AC_SUBST(MYSQL_LIBS) + AM_CONDITIONAL(USE_MYSQL_BACKEND, test x"$ac_cv_with_cnid_mysql" = x"yes") + dnl Set default DID scheme AC_MSG_CHECKING([default DID scheme]) AC_ARG_WITH(cnid-default-backend, - [ --with-cnid-default-backend=val set default DID scheme], + [ --with-cnid-default-backend=val set default DID scheme [[dbd]]], [ if test x"$withval" = x; then AC_MSG_RESULT([ignored])