1 AC_DEFUN([AC_NETATALK_CNID], [
3 dnl Don't use BDB unless it's needed
7 dnl Determine whether or not to use Database Daemon CNID backend
8 AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend])
9 AC_ARG_WITH(cnid-dbd-backend,
10 [ --with-cnid-dbd-backend build CNID with Database Daemon Data Store],
11 [ if test x"$withval" = x"no"; then
23 if test $use_dbd_backend = yes; then
24 compiled_backends="$compiled_backends dbd"
25 AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.])
26 if test x"$DEFAULT_CNID_SCHEME" = x; then
27 DEFAULT_CNID_SCHEME=dbd
31 AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes")
33 dnl Determine whether or not to use BDB Concurrent Data Store
34 AC_MSG_CHECKING([whether or not to use BDB Concurrent Data Store])
35 AC_ARG_WITH(cnid-cdb-backend,
36 [ --with-cnid-cdb-backend build CNID with Concurrent BDB Data Store],[
37 if test x"$withval" = x"no"; then
42 ],[use_cdb_backend=no]
45 if test $use_cdb_backend = yes; then
47 AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.])
48 if test x"$DEFAULT_CNID_SCHEME" = x; then
49 DEFAULT_CNID_SCHEME=cdb
52 compiled_backends="$compiled_backends cdb"
56 AM_CONDITIONAL(USE_CDB_BACKEND, test x"$use_cdb_backend" = x"yes")
58 dnl Determine whether or not to use LAST DID scheme
59 AC_MSG_CHECKING([whether or not to use LAST DID scheme])
60 AC_ARG_WITH(cnid-last-backend,
61 [ --with-cnid-last-backend build LAST CNID scheme],
63 if test x"$withval" = x"no"; then
72 if test $use_last_backend = yes; then
74 AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
75 if test x"$DEFAULT_CNID_SCHEME" = x; then
76 DEFAULT_CNID_SCHEME=last
78 compiled_backends="$compiled_backends last"
82 AM_CONDITIONAL(USE_LAST_BACKEND, test x"$use_last_backend" = x"yes")
84 dnl Determine whether or not to use TDB DID scheme
85 AC_MSG_CHECKING([whether or not to use TDB DID scheme])
86 AC_ARG_WITH(cnid-tdb-backend,
87 [ --with-cnid-tdb-backend build DID CNID scheme],
89 if test x"$withval" = x"no"; then
98 if test $use_tdb_backend = yes; then
100 AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
101 if test x"$DEFAULT_TDB_SCHEME" = x; then
102 DEFAULT_CNID_SCHEME=tdb
104 compiled_backends="$compiled_backends tdb"
108 AM_CONDITIONAL(USE_TDB_BACKEND, test x"$use_tdb_backend" = x"yes")
110 dnl Determine whether or not to use MTAB DID scheme
111 AC_MSG_CHECKING([whether or not to use MTAB DID scheme])
112 AC_ARG_WITH(cnid-mtab-backend,
113 [ --with-cnid-mtab-backend build MTAB CNID scheme],
115 if test x"$withval" = x"no"; then
124 if test $use_mtab_backend = yes; then
126 AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.])
127 if test x"$DEFAULT_CNID_SCHEME" = x; then
128 DEFAULT_CNID_SCHEME=mtab
130 compiled_backends="$compiled_backends mtab"
134 AM_CONDITIONAL(USE_MTAB_BACKEND, test x"$use_mtab_backend" = x"yes")
136 dnl Set default DID scheme
137 AC_MSG_CHECKING([default DID scheme])
138 AC_ARG_WITH(cnid-default-backend,
139 [ --with-cnid-default-backend=val set default DID scheme],
141 if test x"$withval" = x; then
142 AC_MSG_RESULT([ignored])
144 DEFAULT_CNID_SCHEME=$withval
145 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
148 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
151 if test x"$DEFAULT_CNID_SCHEME" = x; then
152 AC_MSG_ERROR([No DID schemes compiled in ])
155 AC_MSG_CHECKING([whether default CNID scheme has been activated])
157 for scheme in $compiled_backends ; do
158 if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then
162 if test x"$found_scheme" = x"no"; then
164 AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
169 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
170 AC_SUBST(DEFAULT_CNID_SCHEME)
171 AC_SUBST(compiled_backends)
173 if test "x$bdb_required" = "xyes"; then
174 ifelse([$1], , :, [$1])
176 ifelse([$2], , :, [$2])