]> arthur.barton.de Git - netatalk.git/blob - macros/cnid-backend.m4
OSX uses FPzzz command even if connected with AFP2.2 (via classic)
[netatalk.git] / macros / cnid-backend.m4
1 AC_DEFUN([AC_NETATALK_CNID], [
2
3     dnl Don't use BDB unless it's needed
4     bdb_required=no
5     compiled_backends=""
6
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
12                 use_cdb_backend=no
13         else
14             use_cdb_backend=yes
15         fi
16     ],[use_cdb_backend=yes]
17     )
18
19     if test $use_cdb_backend = yes; then
20         AC_MSG_RESULT([yes])
21         AC_DEFINE(CNID_BACKEND_CDB, 1, [Define if CNID Concurrent BDB backend should be compiled.])         
22         DEFAULT_CNID_SCHEME=cdb
23         bdb_required=yes
24         compiled_backends="$compiled_backends cdb"
25     else
26         AC_MSG_RESULT([no])
27     fi
28
29     dnl Determine whether or not to use Database Daemon CNID backend
30     AC_MSG_CHECKING([whether or not to use Database Daemon CNID backend])
31     AC_ARG_WITH(cnid-dbd-backend,
32     [  --with-cnid-dbd-backend       build CNID with Database Daemon Data Store],
33     [   if test x"$withval" = x"no"; then
34             AC_MSG_RESULT([no])
35             use_dbd_backend=no
36         else
37             use_dbd_backend=yes
38             AC_MSG_RESULT([yes])
39         fi
40     ],[
41         use_dbd_backend=no
42         AC_MSG_RESULT([no])
43     ])
44
45     dnl Determine whether or not to use with transaction support in Database Daemon
46     AC_MSG_CHECKING([whether or not to use Database Daemon with transaction support])
47     AC_ARG_WITH(cnid-dbd-txn,
48     [  --with-cnid-dbd-txn           build transaction support for dbd backend],
49     [   if test x"$withval" = x"no"; then
50             AC_MSG_RESULT([no])
51             use_dbd_txn=no
52         else
53             use_dbd_txn=yes
54             AC_MSG_RESULT([yes])
55         fi
56         ],[
57         use_dbd_txn=no
58         AC_MSG_RESULT([no])
59     ])
60
61     if test $use_dbd_txn = yes; then
62         use_dbd_backend=yes
63         AC_DEFINE(CNID_BACKEND_DBD_TXN, 1, [Define if CNID Database Daemon backend has transaction support])
64     else
65         if test x"$use_dbd_backend" = x; then    
66             use_dbd_backend=no
67         fi
68     fi
69
70     if test $use_dbd_backend = yes; then
71         compiled_backends="$compiled_backends dbd"
72         AC_DEFINE(CNID_BACKEND_DBD, 1, [Define if CNID Database Daemon backend should be compiled.])
73         if test x"$DEFAULT_CNID_SCHEME" = x; then
74             DEFAULT_CNID_SCHEME=dbd
75         fi
76         bdb_required=yes
77     fi
78     AM_CONDITIONAL(BUILD_DBD_DAEMON, test x"$use_dbd_backend" = x"yes")
79
80     dnl Determine whether or not to use BDB transactional data store
81     AC_MSG_CHECKING([whether or not to use BDB transactional DB store])
82     AC_ARG_WITH(cnid-db3-backend,
83     [  --with-cnid-db3-backend  build CNID with transactional BDB Data Store],
84         [
85             if test x"$withval" = x"no"; then
86             use_db3_backend=no
87         else
88             use_db3_backend=yes
89             $compiled_backends="$compile_backends db3"
90         fi
91     ],[
92         use_db3_backend=no
93     ])
94
95     if test x"$use_db3_backend" = x"yes"; then
96         AC_MSG_RESULT([yes])
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
100         fi
101         bdb_required=yes
102     else
103         AC_MSG_RESULT([no])
104     fi
105
106     dnl Determine whether or not to use LAST DID scheme
107     AC_MSG_CHECKING([whether or not to use LAST DID scheme])
108     AC_ARG_WITH(cnid-last-backend,
109         [  --with-cnid-last-backend     build LAST CNID scheme],
110         [
111         if test x"$withval" = x"no"; then
112             use_last_backend=no
113         else
114             use_last_backend=yes
115             compiled_backends="$compiled_backends last"
116         fi
117     ],[
118         use_last_backend=no
119     ])
120
121     if test $use_last_backend = yes; then
122         AC_MSG_RESULT([yes])
123         AC_DEFINE(CNID_BACKEND_LAST, 1, [Define if CNID LAST scheme backend should be compiled.])
124         if test x"$DEFAULT_CNID_SCHEME" = x; then
125             DEFAULT_CNID_SCHEME=last
126         fi
127     else
128         AC_MSG_RESULT([no])
129     fi
130
131     dnl Determine whether or not to use HASH DID scheme
132     AC_MSG_CHECKING([whether or not to use HASH DID scheme])
133     AC_ARG_WITH(cnid-hash-backend,
134         [  --with-cnid-hash-backend     build HASH CNID scheme],
135         [
136         if test x"$withval" = x"no"; then
137             use_hash_backend=no
138         else
139             use_hash_backend=yes
140             compiled_backends="$compiled_backends hash"
141         fi
142     ],[
143         use_hash_backend=no
144     ])
145
146     if test $use_hash_backend = yes; then
147         AC_MSG_RESULT([yes])
148         AC_DEFINE(CNID_BACKEND_HASH, 1, [Define if CNID HASH scheme backend should be compiled.])
149         if test x"$DEFAULT_CNID_SCHEME" = x; then
150             DEFAULT_CNID_SCHEME=hash
151         fi
152     else
153         AC_MSG_RESULT([no])
154     fi
155
156     dnl Determine whether or not to use TDB DID scheme
157     AC_MSG_CHECKING([whether or not to use TDB DID scheme])
158     AC_ARG_WITH(cnid-tdb-backend,
159         [  --with-cnid-tdb-backend      build DID CNID scheme],
160     [
161         if test x"$withval" = x"no"; then
162             use_tdb_backend=no
163         else
164             use_tdb_backend=yes
165             compiled_backends="$compiled_backends tdb"
166         fi
167     ],[
168         use_tdb_backend=no
169     ])
170
171     if test $use_tdb_backend = yes; then
172         AC_MSG_RESULT([yes])
173         AC_DEFINE(CNID_BACKEND_TDB, 1, [Define if CNID TDB scheme backend should be compiled.])
174         if test x"$DEFAULT_TDB_SCHEME" = x; then
175             DEFAULT_CNID_SCHEME=tdb
176         fi
177     else
178         AC_MSG_RESULT([no])
179     fi
180
181     dnl Determine whether or not to use MTAB DID scheme
182     AC_MSG_CHECKING([whether or not to use MTAB DID scheme])
183     AC_ARG_WITH(cnid-mtab-backend,
184         [  --with-cnid-mtab-backend     build MTAB CNID scheme],
185     [
186         if test x"$withval" = x"no"; then
187             use_mtab_backend=no
188         else
189             use_mtab_backend=yes
190             compiled_backends="$compiled_backends mtab"
191         fi
192     ],[
193         use_mtab_backend=no
194     ])
195
196     if test $use_mtab_backend = yes; then
197         AC_MSG_RESULT([yes])
198         AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.])
199         if test x"$DEFAULT_CNID_SCHEME" = x; then
200             DEFAULT_CNID_SCHEME=mtab
201         fi
202     else                
203         AC_MSG_RESULT([no])
204     fi
205
206     dnl Set default DID scheme
207     AC_MSG_CHECKING([default DID scheme])
208     AC_ARG_WITH(cnid-default-backend,
209         [  --with-cnid-default-backend=val      set default DID scheme],
210     [
211         if test x"$withval" = x; then
212             AC_MSG_RESULT([ignored])
213         else
214             DEFAULT_CNID_SCHEME=$withval
215             AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
216         fi
217     ],[
218         AC_MSG_RESULT($DEFAULT_CNID_SCHEME)
219     ])
220
221     if test x"$DEFAULT_CNID_SCHEME" = x; then
222         AC_MSG_ERROR([No DID schemes compiled in ])
223     fi
224
225     AC_MSG_CHECKING([whether default CNID scheme has been activated])
226     found_scheme=no
227     for scheme in $compiled_backends ; do
228         if test x"$scheme" = x"$DEFAULT_CNID_SCHEME"; then      
229             found_scheme=yes
230         fi
231     done
232     if test x"$found_scheme" = x"no"; then
233         AC_MSG_RESULT([no])
234         AC_MSG_ERROR([Specified default CNID scheme $DEFAULT_CNID_SCHEME was not selected for compilation])
235     else
236         AC_MSG_RESULT([yes])
237     fi
238
239     AC_DEFINE_UNQUOTED(DEFAULT_CNID_SCHEME, "$DEFAULT_CNID_SCHEME", [Default CNID scheme to be used])
240     AC_SUBST(DEFAULT_CNID_SCHEME)
241     AC_SUBST(compiled_backends)
242
243     if test "x$bdb_required" = "xyes"; then
244         ifelse([$1], , :, [$1])
245     else
246         ifelse([$2], , :, [$2])     
247     fi
248 ])