1 AC_DEFUN([AC_NETATALK_CNID], [
2 dnl Don't use BDB unless it's needed
6 dnl Determine whether or not to use Database Daemon CNID backend
7 AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend])
8 AC_ARG_WITH(cnid-dbd-backend,
9 [ --with-cnid-dbd-backend build CNID with Database Daemon Data Store],
10 [ if test x"$withval" = x"no"; then
22 if test $use_dbd_backend = yes; then
23 compiled_backends="$compiled_backends dbd"
24 AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.])
25 if test x"$DEFAULT_CNID_SCHEME" = x; then
26 DEFAULT_CNID_SCHEME=dbd
30 AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes")
32 dnl Determine whether or not to use BDB Concurrent Data Store
33 AC_MSG_CHECKING([whether or not to use BDB Concurrent Data Store])
34 AC_ARG_WITH(cnid-cdb-backend,
35 [ --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store],[
36 if test x"$withval" = x"no"; then
41 ],[use_cdb_backend=no]
44 if test $use_cdb_backend = yes; then
46 AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.])
47 if test x"$DEFAULT_CNID_SCHEME" = x; then
48 DEFAULT_CNID_SCHEME=cdb
51 compiled_backends="$compiled_backends cdb"
55 AM_CONDITIONAL(USE_CDB_BACKEND, test x"$use_cdb_backend" = x"yes")
57 dnl Determine whether or not to use LAST DID scheme
58 AC_MSG_CHECKING([whether or not to use LAST DID scheme])
59 AC_ARG_WITH(cnid-last-backend,
60 [ --with-cnid-last-backend build LAST CNID scheme],
62 if test x"$withval" = x"no"; then
71 if test $use_last_backend = yes; then
73 AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
74 if test x"$DEFAULT_CNID_SCHEME" = x; then
75 DEFAULT_CNID_SCHEME=last
77 compiled_backends="$compiled_backends last"
81 AM_CONDITIONAL(USE_LAST_BACKEND, test x"$use_last_backend" = x"yes")
83 dnl Determine whether or not to use TDB DID scheme
84 AC_MSG_CHECKING([whether or not to use TDB DID scheme])
85 AC_ARG_WITH(cnid-tdb-backend,
86 [ --with-cnid-tdb-backend build DID CNID scheme],
88 if test x"$withval" = x"no"; then
97 if test $use_tdb_backend = yes; then
99 AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
100 if test x"$DEFAULT_TDB_SCHEME" = x; then
101 DEFAULT_CNID_SCHEME=tdb
103 compiled_backends="$compiled_backends tdb"
107 AM_CONDITIONAL(USE_TDB_BACKEND, test x"$use_tdb_backend" = x"yes")
109 dnl Set default DID scheme
110 AC_MSG_CHECKING([default DID scheme])
111 AC_ARG_WITH(cnid-default-backend,
112 [ --with-cnid-default-backend=val set default DID scheme],
114 if test x"$withval" = x; then
115 AC_MSG_RESULT([ignored])
117 DEFAULT_CNID_SCHEME=$withval
118 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
121 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
124 if test x"$DEFAULT_CNID_SCHEME" = x; then
125 AC_MSG_ERROR([No DID schemes compiled in ])
128 AC_MSG_CHECKING([whether default CNID scheme has been activated])
130 for scheme in $compiled_backends ; do
131 if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then
135 if test x"$found_scheme" = x"no"; then
137 AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
142 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
143 AC_SUBST(DEFAULT_CNID_SCHEME)
144 AC_SUBST(compiled_backends)
146 if test "x$bdb_required" = "xyes"; then
147 ifelse([$1], , :, [$1])
149 ifelse([$2], , :, [$2])