X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=macros%2Fcnid-backend.m4;h=c87e457c598c0832985228832bfeb867e7f57360;hp=caef203cd053a8f6c1f33629deed2c9dd9276b72;hb=3a84db87064922ad10ac10cc1d6833380e575995;hpb=95c599bf656ced1d9169c5595cc4f412d19c45a7 diff --git a/macros/cnid-backend.m4 b/macros/cnid-backend.m4 index caef203c..c87e457c 100644 --- a/macros/cnid-backend.m4 +++ b/macros/cnid-backend.m4 @@ -6,7 +6,7 @@ AC_DEFUN([AC_NETATALK_CNID], [ 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 use_dbd_backend=no AC_MSG_RESULT([no]) @@ -32,7 +32,7 @@ AC_DEFUN([AC_NETATALK_CNID], [ 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],[ + [ --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store [[no]]],[ if test x"$withval" = x"no"; then use_cdb_backend=no else @@ -59,7 +59,7 @@ AC_DEFUN([AC_NETATALK_CNID], [ 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 @@ -85,7 +85,7 @@ AC_DEFUN([AC_NETATALK_CNID], [ 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 @@ -108,10 +108,43 @@ AC_DEFUN([AC_NETATALK_CNID], [ fi AM_CONDITIONAL(USE_TDB_BACKEND, test x"$use_tdb_backend" = x"yes") + 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]) + + 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])