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"
28 AM_CONDITIONAL(USE_CDB_BACKEND, test x"$use_cdb_backend" = x"yes")
30 dnl Determine whether or not to use Database Daemon CNID backend
31 AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend])
32 AC_ARG_WITH(cnid-dbd-backend,
33 [ --with-cnid-dbd-backend build CNID with Database Daemon Data Store],
34 [ if test x"$withval" = x"no"; then
46 dnl Determine whether or not to use with transaction support in Database Daemon
47 AC_MSG_CHECKING([whether or not to use Database Daemon with transaction support])
48 AC_ARG_WITH(cnid-dbd-txn,
49 [ --with-cnid-dbd-txn build transaction support for dbd backend],
50 [ if test x"$withval" = x"no"; then
62 if test $use_dbd_txn = yes; then
64 AC_DEFINE(CNID_BACKEND_DBD_TXN, 1, [Define if CNID Database Daemon backend has transaction support])
66 if test x"$use_dbd_backend" = x; then
71 if test $use_dbd_backend = yes; then
72 compiled_backends="$compiled_backends dbd"
73 AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.])
74 if test x"$DEFAULT_CNID_SCHEME" = x; then
75 DEFAULT_CNID_SCHEME=dbd
79 AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes")
81 dnl Determine whether or not to use BDB transactional data store
82 AC_MSG_CHECKING([whether or not to use BDB transactional DB store])
83 AC_ARG_WITH(cnid-db3-backend,
84 [ --with-cnid-db3-backend build CNID with transactional BDB Data Store],
86 if test x"$withval" = x"no"; then
95 if test x"$use_db3_backend" = x"yes"; then
97 AC_DEFINE(CNID_BACKEND_DB3, 1, [Define if CNID transactional BDB backend should be compiled.])
98 if test x"$DEFAULT_CNID_SCHEME" = x; then
99 DEFAULT_CNID_SCHEME=db3
101 compiled_backends="$compiled_backends db3"
106 AM_CONDITIONAL(USE_DB3_BACKEND, test x"$use_db3_backend" = x"yes")
108 dnl Determine whether or not to use LAST DID scheme
109 AC_MSG_CHECKING([whether or not to use LAST DID scheme])
110 AC_ARG_WITH(cnid-last-backend,
111 [ --with-cnid-last-backend build LAST CNID scheme],
113 if test x"$withval" = x"no"; then
122 if test $use_last_backend = yes; then
124 AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
125 if test x"$DEFAULT_CNID_SCHEME" = x; then
126 DEFAULT_CNID_SCHEME=last
128 compiled_backends="$compiled_backends last"
133 dnl Determine whether or not to use HASH DID scheme
134 AC_MSG_CHECKING([whether or not to use HASH DID scheme])
135 AC_ARG_WITH(cnid-hash-backend,
136 [ --with-cnid-hash-backend build HASH CNID scheme],
138 if test x"$withval" = x"no"; then
147 if test $use_hash_backend = yes; then
149 AC_DEFINE(CNID_BACKEND_HASH, 1, [Define if CNID HASH scheme backend should be compiled.])
150 if test x"$DEFAULT_CNID_SCHEME" = x; then
151 DEFAULT_CNID_SCHEME=hash
153 compiled_backends="$compiled_backends hash"
158 dnl Determine whether or not to use TDB DID scheme
159 AC_MSG_CHECKING([whether or not to use TDB DID scheme])
160 AC_ARG_WITH(cnid-tdb-backend,
161 [ --with-cnid-tdb-backend build DID CNID scheme],
163 if test x"$withval" = x"no"; then
172 if test $use_tdb_backend = yes; then
174 AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
175 if test x"$DEFAULT_TDB_SCHEME" = x; then
176 DEFAULT_CNID_SCHEME=tdb
178 compiled_backends="$compiled_backends tdb"
183 dnl Determine whether or not to use MTAB DID scheme
184 AC_MSG_CHECKING([whether or not to use MTAB DID scheme])
185 AC_ARG_WITH(cnid-mtab-backend,
186 [ --with-cnid-mtab-backend build MTAB CNID scheme],
188 if test x"$withval" = x"no"; then
197 if test $use_mtab_backend = yes; then
199 AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.])
200 if test x"$DEFAULT_CNID_SCHEME" = x; then
201 DEFAULT_CNID_SCHEME=mtab
203 compiled_backends="$compiled_backends mtab"
208 dnl Set default DID scheme
209 AC_MSG_CHECKING([default DID scheme])
210 AC_ARG_WITH(cnid-default-backend,
211 [ --with-cnid-default-backend=val set default DID scheme],
213 if test x"$withval" = x; then
214 AC_MSG_RESULT([ignored])
216 DEFAULT_CNID_SCHEME=$withval
217 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
220 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
223 if test x"$DEFAULT_CNID_SCHEME" = x; then
224 AC_MSG_ERROR([No DID schemes compiled in ])
227 AC_MSG_CHECKING([whether default CNID scheme has been activated])
229 for scheme in $compiled_backends ; do
230 if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then
234 if test x"$found_scheme" = x"no"; then
236 AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
241 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
242 AC_SUBST(DEFAULT_CNID_SCHEME)
243 AC_SUBST(compiled_backends)
245 if test "x$bdb_required" = "xyes"; then
246 ifelse([$1], , :, [$1])
248 ifelse([$2], , :, [$2])