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=no]
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 if test $use_dbd_backend = yes; then
47 compiled_backends="$compiled_backends dbd"
48 AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.])
49 if test x"$DEFAULT_CNID_SCHEME" = x; then
50 DEFAULT_CNID_SCHEME=dbd
54 AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes")
56 dnl Determine whether or not to use BDB transactional data store
57 AC_MSG_CHECKING([whether or not to use BDB transactional DB store])
58 AC_ARG_WITH(cnid-db3-backend,
59 [ --with-cnid-db3-backend build CNID with transactional BDB Data Store],
61 if test x"$withval" = x"no"; then
70 if test x"$use_db3_backend" = x"yes"; then
72 AC_DEFINE(CNID_BACKEND_DB3, 1, [Define if CNID transactional BDB backend should be compiled.])
73 if test x"$DEFAULT_CNID_SCHEME" = x; then
74 DEFAULT_CNID_SCHEME=db3
76 compiled_backends="$compiled_backends db3"
81 AM_CONDITIONAL(USE_DB3_BACKEND, test x"$use_db3_backend" = x"yes")
83 dnl Determine whether or not to use LAST DID scheme
84 AC_MSG_CHECKING([whether or not to use LAST DID scheme])
85 AC_ARG_WITH(cnid-last-backend,
86 [ --with-cnid-last-backend build LAST CNID scheme],
88 if test x"$withval" = x"no"; then
97 if test $use_last_backend = yes; then
99 AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
100 if test x"$DEFAULT_CNID_SCHEME" = x; then
101 DEFAULT_CNID_SCHEME=last
103 compiled_backends="$compiled_backends last"
108 dnl Determine whether or not to use HASH DID scheme
109 AC_MSG_CHECKING([whether or not to use HASH DID scheme])
110 AC_ARG_WITH(cnid-hash-backend,
111 [ --with-cnid-hash-backend build HASH CNID scheme],
113 if test x"$withval" = x"no"; then
122 if test $use_hash_backend = yes; then
124 AC_DEFINE(CNID_BACKEND_HASH, 1, [Define if CNID HASH scheme backend should be compiled.])
125 if test x"$DEFAULT_CNID_SCHEME" = x; then
126 DEFAULT_CNID_SCHEME=hash
128 compiled_backends="$compiled_backends hash"
133 dnl Determine whether or not to use TDB DID scheme
134 AC_MSG_CHECKING([whether or not to use TDB DID scheme])
135 AC_ARG_WITH(cnid-tdb-backend,
136 [ --with-cnid-tdb-backend build DID CNID scheme],
138 if test x"$withval" = x"no"; then
147 if test $use_tdb_backend = yes; then
149 AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
150 if test x"$DEFAULT_TDB_SCHEME" = x; then
151 DEFAULT_CNID_SCHEME=tdb
153 compiled_backends="$compiled_backends tdb"
158 dnl Determine whether or not to use MTAB DID scheme
159 AC_MSG_CHECKING([whether or not to use MTAB DID scheme])
160 AC_ARG_WITH(cnid-mtab-backend,
161 [ --with-cnid-mtab-backend build MTAB CNID scheme],
163 if test x"$withval" = x"no"; then
172 if test $use_mtab_backend = yes; then
174 AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.])
175 if test x"$DEFAULT_CNID_SCHEME" = x; then
176 DEFAULT_CNID_SCHEME=mtab
178 compiled_backends="$compiled_backends mtab"
183 dnl Set default DID scheme
184 AC_MSG_CHECKING([default DID scheme])
185 AC_ARG_WITH(cnid-default-backend,
186 [ --with-cnid-default-backend=val set default DID scheme],
188 if test x"$withval" = x; then
189 AC_MSG_RESULT([ignored])
191 DEFAULT_CNID_SCHEME=$withval
192 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
195 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
198 if test x"$DEFAULT_CNID_SCHEME" = x; then
199 AC_MSG_ERROR([No DID schemes compiled in ])
202 AC_MSG_CHECKING([whether default CNID scheme has been activated])
204 for scheme in $compiled_backends ; do
205 if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then
209 if test x"$found_scheme" = x"no"; then
211 AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
216 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
217 AC_SUBST(DEFAULT_CNID_SCHEME)
218 AC_SUBST(compiled_backends)
220 if test "x$bdb_required" = "xyes"; then
221 ifelse([$1], , :, [$1])
223 ifelse([$2], , :, [$2])