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