1 AC_DEFUN([AC_NETATALK_CNID], [
3 dnl Don't use BDB unless it's needed
7 dnl Determine whether or not to use BDB Concurrent Data Store
8 AC_MSG_CHECKING([whether or not to use BDB Concurrent Data Store])
9 AC_ARG_WITH(cnid-cdb-backend,
10 [ --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store],[
11 if test x"$withval" = x"no"; then
16 ],[use_cdb_backend=yes]
19 if test $use_cdb_backend = yes; then
21 AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.])
22 DEFAULT_CNID_SCHEME=cdb
24 compiled_backends="$compiled_backends cdb"
29 dnl Determine whether or not to use Database Daemon CNID backend
30 AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend])
31 AC_ARG_WITH(cnid-dbd-backend,
32 [ --with-cnid-dbd-backend build CNID with Database Daemon Data Store],
33 [ if test x"$withval" = x"no"; then
45 dnl Determine whether or not to use with transaction support in Database Daemon
46 AC_MSG_CHECKING([whether or not to use Database Daemon with transaction support])
47 AC_ARG_WITH(cnid-dbd-txn,
48 [ --with-cnid-dbd-txn build transaction support for dbd backend],
49 [ if test x"$withval" = x"no"; then
61 if test $use_dbd_txn = yes; then
63 AC_DEFINE(CNID_BACKEND_DBD_TXN, 1, [Define if CNID Database Daemon backend has transaction support])
65 if test x"$use_dbd_backend" = x; then
70 if test $use_dbd_backend = yes; then
71 compiled_backends="$compiled_backends dbd"
72 AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.])
73 if test x"$DEFAULT_CNID_SCHEME" = x; then
74 DEFAULT_CNID_SCHEME=dbd
78 AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes")
80 dnl Determine whether or not to use BDB transactional data store
81 AC_MSG_CHECKING([whether or not to use BDB transactional DB store])
82 AC_ARG_WITH(cnid-db3-backend,
83 [ --with-cnid-db3-backend build CNID with transactional BDB Data Store],
85 if test x"$withval" = x"no"; then
94 if test x"$use_db3_backend" = x"yes"; then
96 AC_DEFINE(CNID_BACKEND_DB3, 1, [Define if CNID transactional BDB backend should be compiled.])
97 if test x"$DEFAULT_CNID_SCHEME" = x; then
98 DEFAULT_CNID_SCHEME=db3
100 compiled_backends="$compiled_backends db3"
106 dnl Determine whether or not to use LAST DID scheme
107 AC_MSG_CHECKING([whether or not to use LAST DID scheme])
108 AC_ARG_WITH(cnid-last-backend,
109 [ --with-cnid-last-backend build LAST CNID scheme],
111 if test x"$withval" = x"no"; then
120 if test $use_last_backend = yes; then
122 AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
123 if test x"$DEFAULT_CNID_SCHEME" = x; then
124 DEFAULT_CNID_SCHEME=last
126 compiled_backends="$compiled_backends last"
131 dnl Determine whether or not to use HASH DID scheme
132 AC_MSG_CHECKING([whether or not to use HASH DID scheme])
133 AC_ARG_WITH(cnid-hash-backend,
134 [ --with-cnid-hash-backend build HASH CNID scheme],
136 if test x"$withval" = x"no"; then
145 if test $use_hash_backend = yes; then
147 AC_DEFINE(CNID_BACKEND_HASH, 1, [Define if CNID HASH scheme backend should be compiled.])
148 if test x"$DEFAULT_CNID_SCHEME" = x; then
149 DEFAULT_CNID_SCHEME=hash
151 compiled_backends="$compiled_backends hash"
156 dnl Determine whether or not to use TDB DID scheme
157 AC_MSG_CHECKING([whether or not to use TDB DID scheme])
158 AC_ARG_WITH(cnid-tdb-backend,
159 [ --with-cnid-tdb-backend build DID CNID scheme],
161 if test x"$withval" = x"no"; then
170 if test $use_tdb_backend = yes; then
172 AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
173 if test x"$DEFAULT_TDB_SCHEME" = x; then
174 DEFAULT_CNID_SCHEME=tdb
176 compiled_backends="$compiled_backends tdb"
181 dnl Determine whether or not to use MTAB DID scheme
182 AC_MSG_CHECKING([whether or not to use MTAB DID scheme])
183 AC_ARG_WITH(cnid-mtab-backend,
184 [ --with-cnid-mtab-backend build MTAB CNID scheme],
186 if test x"$withval" = x"no"; then
195 if test $use_mtab_backend = yes; then
197 AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.])
198 if test x"$DEFAULT_CNID_SCHEME" = x; then
199 DEFAULT_CNID_SCHEME=mtab
201 compiled_backends="$compiled_backends mtab"
206 dnl Set default DID scheme
207 AC_MSG_CHECKING([default DID scheme])
208 AC_ARG_WITH(cnid-default-backend,
209 [ --with-cnid-default-backend=val set default DID scheme],
211 if test x"$withval" = x; then
212 AC_MSG_RESULT([ignored])
214 DEFAULT_CNID_SCHEME=$withval
215 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
218 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
221 if test x"$DEFAULT_CNID_SCHEME" = x; then
222 AC_MSG_ERROR([No DID schemes compiled in ])
225 AC_MSG_CHECKING([whether default CNID scheme has been activated])
227 for scheme in $compiled_backends ; do
228 if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then
232 if test x"$found_scheme" = x"no"; then
234 AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
239 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
240 AC_SUBST(DEFAULT_CNID_SCHEME)
241 AC_SUBST(compiled_backends)
243 if test "x$bdb_required" = "xyes"; then
244 ifelse([$1], , :, [$1])
246 ifelse([$2], , :, [$2])