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 [[yes]]],
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 [[no]]],[
36 if test x"$withval" = x"no"; then
46 if test $use_cdb_backend = yes; then
48 AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.])
49 if test x"$DEFAULT_CNID_SCHEME" = x; then
50 DEFAULT_CNID_SCHEME=cdb
53 compiled_backends="$compiled_backends cdb"
57 AM_CONDITIONAL(USE_CDB_BACKEND, test x"$use_cdb_backend" = x"yes")
59 dnl Determine whether or not to use LAST DID scheme
60 AC_MSG_CHECKING([whether or not to use LAST DID scheme])
61 AC_ARG_WITH(cnid-last-backend,
62 [ --with-cnid-last-backend build LAST CNID scheme [[yes]]],
64 if test x"$withval" = x"no"; then
73 if test $use_last_backend = yes; then
75 AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
76 if test x"$DEFAULT_CNID_SCHEME" = x; then
77 DEFAULT_CNID_SCHEME=last
79 compiled_backends="$compiled_backends last"
83 AM_CONDITIONAL(USE_LAST_BACKEND, test x"$use_last_backend" = x"yes")
85 dnl Determine whether or not to use TDB DID scheme
86 AC_MSG_CHECKING([whether or not to use TDB DID scheme])
87 AC_ARG_WITH(cnid-tdb-backend,
88 [ --with-cnid-tdb-backend build TDB CNID scheme [[yes]]],
90 if test x"$withval" = x"no"; then
99 if test $use_tdb_backend = yes; then
101 AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
102 if test x"$DEFAULT_CNID_SCHEME" = x; then
103 DEFAULT_CNID_SCHEME=tdb
105 compiled_backends="$compiled_backends tdb"
109 AM_CONDITIONAL(USE_TDB_BACKEND, test x"$use_tdb_backend" = x"yes")
111 dnl Set default DID scheme
112 AC_MSG_CHECKING([default DID scheme])
113 AC_ARG_WITH(cnid-default-backend,
114 [ --with-cnid-default-backend=val set default DID scheme [[dbd]]],
116 if test x"$withval" = x; then
117 AC_MSG_RESULT([ignored])
119 DEFAULT_CNID_SCHEME=$withval
120 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
123 AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
126 if test x"$DEFAULT_CNID_SCHEME" = x; then
127 AC_MSG_ERROR([No DID schemes compiled in ])
130 AC_MSG_CHECKING([whether default CNID scheme has been activated])
132 for scheme in $compiled_backends ; do
133 if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then
137 if test x"$found_scheme" = x"no"; then
139 AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
144 AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
145 AC_SUBST(DEFAULT_CNID_SCHEME)
146 AC_SUBST(compiled_backends)
148 if test "x$bdb_required" = "xyes"; then
149 ifelse([$1], , :, [$1])
151 ifelse([$2], , :, [$2])