Writing metadata xattr on directories with sticky bit set, FR#94
[netatalk.git] / configure.ac
1 dnl configure.ac for netatalk
2
3 AC_INIT(etc/afpd/main.c)
4
5 NETATALK_VERSION=`cat $srcdir/VERSION`
6 AC_SUBST(NETATALK_VERSION)
7
8 AC_CANONICAL_SYSTEM
9 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
10 AM_CONFIG_HEADER(config.h)
11 AM_MAINTAINER_MODE([enable])
12
13 dnl Checks for programs.
14 AC_PROG_AWK
15 AC_PROG_CC
16 AC_PROG_CC_C99
17 AC_PROG_INSTALL
18 AC_PROG_LN_S
19 AC_PROG_MAKE_SET
20 AC_LIBTOOL_DLOPEN
21 AC_PROG_LIBTOOL
22 AC_PROG_PERL
23 AC_PROG_GREP
24 AC_PROG_PS
25 AM_PROG_CC_C_O
26 AC_C_BIGENDIAN
27 AC_C_INLINE
28 AC_PROG_LEX
29 AC_PROG_YACC
30
31 dnl Check if we can use attribute unused (gcc only) from ethereal
32 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
33 if test x$GCC != x ; then
34   CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
35   AC_MSG_RESULT(yes)
36 else
37   CFLAGS="-D_U_=\"\" $CFLAGS"
38   AC_MSG_RESULT(no)
39 fi
40
41 dnl Checks for header files, some checks are obsolete, unfortunately the code
42 dnl uses the resulting macros, so the code has to cleaned up too before
43 dnl we can remove the checks here.
44 AC_CHECK_HEADERS(mntent.h unistd.h termios.h ufs/quota.h)
45 AC_CHECK_HEADERS(netdb.h sgtty.h statfs.h dlfcn.h langinfo.h locale.h)
46 AC_CHECK_HEADERS(sys/param.h sys/fcntl.h sys/termios.h)
47 AC_CHECK_HEADERS(sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h)
48 dnl Checks for header files, confirmed to be required as of 2011
49 AC_CHECK_HEADERS([sys/mount.h], , , 
50 [#ifdef HAVE_SYS_PARAM_H
51 #include <sys/param.h>
52 #endif
53 ])
54 AC_CHECK_TYPES([fshare_t], [], [], [[#include <fcntl.h>]])
55
56 AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
57
58 dnl --------------------------------------------------------------------------
59 dnl check if dlsym needs to add an underscore, uses libtool macros 
60 dnl --------------------------------------------------------------------------
61 AC_LTDL_DLLIB
62 AC_CHECK_FUNCS(dlopen dlsym dlclose)
63 AC_LTDL_DLSYM_USCORE
64 if test x"$libltdl_cv_need_uscore" = xyes; then
65     AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
66 fi
67
68 dnl Special hecks
69 ac_neta_haveatfuncs=yes
70 AC_CHECK_FUNCS(openat renameat fstatat unlinkat, , ac_neta_haveatfuncs=no)
71 if test x"$ac_neta_haveatfuncs" = x"yes" ; then
72    AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)
73    AC_DEFINE([HAVE_ATFUNCS], 1, whether at funcs are available)
74 fi
75 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
76
77 dnl these tests have been comfirmed to be needed in 2011
78 AC_CHECK_FUNCS(backtrace_symbols dirfd getusershell pread pwrite pselect)
79 AC_CHECK_FUNCS(setlinebuf strlcat strlcpy strnlen mempcpy vasprintf asprintf)
80 AC_CHECK_FUNCS(mmap utime getpagesize) dnl needed by tbd
81
82 dnl search for necessary libraries
83 AC_SEARCH_LIBS(gethostbyname, nsl)
84 AC_SEARCH_LIBS(connect, socket)
85 AC_CHECK_FUNCS(getifaddrs) dnl comes after gethostbyname and connect so it picks up the libs
86
87 AX_PTHREAD(, [AC_MSG_ERROR([missing pthread_sigmask])])
88
89 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
90
91 dnl 64bit platform check
92 AC_NETATALK_64BIT_LIBS
93
94 dnl OS specific checks
95 AC_NETATALK_OS_SPECIFIC
96
97 dnl Check for optional admin group support
98 AC_NETATALK_ADMIN_GROUP
99
100 dnl Check for optional AFS support
101 AC_NETATALK_AFS_CHECK
102
103 dnl --with-pkgconfdir check to change configuration directory location
104 AC_NETATALK_CONFIG_DIRS
105
106 dnl Check for optional cracklib support
107 AC_NETATALK_CRACKLIB
108
109 dnl Check whether to enable debug code
110 AC_NETATALK_DEBUG
111
112 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
113 AC_NETATALK_DEBUGGING
114
115 dnl     Check for libiconv support
116 AC_NETATALK_CHECK_ICONV
117
118 dnl Check for CNID database backends
119 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
120
121 dnl Check for quota support
122 AC_NETATALK_CHECK_QUOTA
123
124 dnl Check for optional Zeroconf support
125 AC_NETATALK_ZEROCONF
126
127 dnl Check for optional TCP-wrappers support
128 AC_NETATALK_TCP_WRAPPERS
129
130 dnl Check for PAM libs
131 AC_NETATALK_PATH_PAM
132
133 dnl Check for optional shadow password support
134 AC_NETATALK_SHADOW
135         
136 dnl Check for optional valid-shell-check support
137 AC_NETATALK_SHELL_CHECK
138
139 dnl Check for optional sysv initscript install
140 AC_NETATALK_INIT_STYLE
141
142 dnl Path where UAM modules shall be installed
143 AC_ARG_WITH(uams-path, [  --with-uams-path=PATH   path to UAMs [[$libdir/netatalk/]]], [uams_path="$withval/"], [uams_path="$libdir/netatalk/"])
144
145 dnl Check for libgcrypt, if found enables DHX2 UAM
146 AC_NETATALK_PATH_LIBGCRYPT([1:1.2.3])
147
148 dnl Check for openssl, if found enables DHX UAM and Randnum UAM
149 AC_NETATALK_PATH_SSL
150
151 dnl Check for Berkeley DB library
152 AC_NETATALK_PATH_BDB
153
154 dnl Check for crypt
155 AC_NETATALK_CRYPT
156
157 dnl Check for building PGP UAM module
158 AC_NETATALK_PGP_UAM
159
160 dnl Check for building Kerberos V UAM module
161 AC_NETATALK_KRB5_UAM
162
163 dnl Check for Kerberos 5 support
164 AC_NETATALK_KERBEROS
165
166 dnl Check for overwrite the config files or not
167 AC_NETATALK_OVERWRITE_CONFIG
168
169 dnl Check for LDAP support, for client-side ACL visibility
170 AC_NETATALK_LDAP
171
172 dnl Check for ACL support
173 AC_NETATALK_ACL
174
175 dnl Check for Extended Attributes support
176 AC_NETATALK_EXTENDED_ATTRIBUTES
177
178 dnl Check if realpath() takes NULL
179 AC_NETATALK_REALPATH
180
181 dnl Check for sendfile()
182 AC_NETATALK_SENDFILE
183 AC_NETATALK_RECVFILE
184
185 dnl Check whether bundled libevent shall not be used
186 AC_NETATALK_LIBEVENT
187
188 dnl Check whether bundled tdb shall be used
189 AC_NETATALK_TDB
190
191 dnl Check for Tracker
192 AC_NETATALK_SPOTLIGHT
193
194 dnl libatalk API checks
195 AC_DEVELOPER
196
197 dnl Check for dtrace
198 AC_NETATALK_DTRACE
199
200 dnl Check for dbus-glib, for AFP stats on dbus
201 AC_NETATALK_DBUS_GLIB
202
203 dnl FHS stuff has to be done last because it overrides other defaults
204 AC_NETATALK_FHS
205
206 dnl netatalk lockfile path, must come after AC_NETATALK_FHS
207 AC_NETATALK_LOCKFILE
208
209 dnl Check for Docbook and build documentation if found
210 AX_CHECK_DOCBOOK
211
212 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include $CPPFLAGS"
213 UAMS_PATH="${uams_path}"
214
215 AC_SUBST(LIBS)
216 AC_SUBST(CFLAGS)
217 AC_SUBST(UAMS_PATH)
218
219 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
220 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
221 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
222 AM_CONDITIONAL(HAVE_ACLS, test x"$ac_cv_have_acls" = x"yes")
223 AM_CONDITIONAL(HAVE_LDAP, test x"$netatalk_cv_ldap" = x"yes")
224 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
225 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
226 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
227 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
228 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
229 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
230 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
231 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
232 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
233 AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
234 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
235
236 dnl Enable silent Automake rules if present                                                                           
237 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
238
239 dnl --------------------- generate files
240 AC_OUTPUT([Makefile
241         bin/Makefile
242         bin/ad/Makefile
243         bin/afppasswd/Makefile
244         bin/cnid/Makefile
245         bin/cnid/cnid2_create
246         bin/megatron/Makefile
247         bin/misc/Makefile
248         config/Makefile
249         config/pam/Makefile
250         contrib/Makefile
251         contrib/macusers/Makefile
252         contrib/macusers/macusers
253         contrib/shell_utils/Makefile
254         contrib/shell_utils/apple_dump
255         contrib/shell_utils/asip-status.pl
256         distrib/Makefile
257         distrib/config/Makefile
258         distrib/config/netatalk-config
259         distrib/initscripts/Makefile
260         distrib/m4/Makefile
261         doc/Makefile
262     doc/html.xsl
263     doc/man.xsl
264     doc/manual/Makefile
265     doc/manual/manual.xml
266     doc/manpages/Makefile
267     doc/manpages/man1/Makefile
268     doc/manpages/man5/Makefile
269     doc/manpages/man8/Makefile
270         etc/Makefile
271         etc/afpd/Makefile
272         etc/cnid_dbd/Makefile
273         etc/netatalk/Makefile
274         etc/spotlight/Makefile
275         etc/uams/Makefile
276         include/Makefile
277         include/atalk/Makefile
278         libatalk/Makefile
279         libatalk/acl/Makefile
280         libatalk/adouble/Makefile
281         libatalk/bstring/Makefile
282         libatalk/cnid/Makefile
283         libatalk/cnid/cdb/Makefile
284         libatalk/cnid/last/Makefile
285         libatalk/cnid/dbd/Makefile
286         libatalk/cnid/tdb/Makefile
287         libatalk/cnid/mysql/Makefile
288         libatalk/compat/Makefile
289         libatalk/dsi/Makefile
290         libatalk/iniparser/Makefile
291         libatalk/talloc/Makefile
292         libatalk/tdb/Makefile
293         libatalk/unicode/Makefile
294         libatalk/unicode/charsets/Makefile
295         libatalk/util/Makefile
296         libatalk/vfs/Makefile
297         macros/Makefile
298         man/Makefile
299         man/man1/Makefile
300     man/man1/ad.1
301     man/man1/afpldaptest.1
302     man/man1/afppasswd.1
303     man/man1/afpstats.1
304     man/man1/apple_dump.1
305     man/man1/asip-status.pl.1
306     man/man1/dbd.1
307     man/man1/macusers.1
308     man/man1/netatalk-config.1
309     man/man1/uniconv.1
310         man/man5/Makefile
311     man/man5/afp.conf.5
312     man/man5/afp_signature.conf.5
313     man/man5/afp_voluuid.conf.5
314     man/man5/extmap.conf.5
315         man/man8/Makefile
316     man/man8/afpd.8
317     man/man8/cnid_dbd.8
318     man/man8/cnid_metad.8
319     man/man8/netatalk.8
320         test/Makefile
321         test/afpd/Makefile
322         ],
323         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
324 )
325
326 AC_NETATALK_LIBS_SUMMARY
327 AC_NETATALK_CONFIG_SUMMARY