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 Determine whether or not to use MTAB DID scheme
110 AC_MSG_CHECKING([whether or not to use MTAB DID scheme])
111 AC_ARG_WITH(cnid-mtab-backend,
112 [ --with-cnid-mtab-backend build MTAB CNID scheme],
114 if test x"$withval" = x"no"; then
123 if test $use_mtab_backend = yes; then
125 AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.])
126 if test x"$DEFAULT_CNID_SCHEME" = x; then
127 DEFAULT_CNID_SCHEME=mtab
129 compiled_backends="$compiled_backends mtab"
133 AM_CONDITIONAL(USE_MTAB_BACKEND, test x"$use_mtab_backend" = x"yes")
135 dnl Set default DID scheme
136 AC_MSG_CHECKING([default DID scheme])
137 AC_ARG_WITH(cnid-default-backend,
138 [ --with-cnid-default-backend=val set default DID scheme],
140 if test x"$withval" = x; then
141 AC_MSG_RESULT([ignored])
143 DEFAULT_CNID_SCHEME=$withval
144 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
147 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
150 if test x"$DEFAULT_CNID_SCHEME" = x; then
151 AC_MSG_ERROR([No DID schemes compiled in ])
154 AC_MSG_CHECKING([whether default CNID scheme has been activated])
156 for scheme in $compiled_backends ; do
157 if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then
161 if test x"$found_scheme" = x"no"; then
163 AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
168 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
169 AC_SUBST(DEFAULT_CNID_SCHEME)
170 AC_SUBST(compiled_backends)
172 if test "x$bdb_required" = "xyes"; then
173 ifelse([$1], , :, [$1])
175 ifelse([$2], , :, [$2])