]> arthur.barton.de Git - netatalk.git/blob - configure.ac
systemd service file use PIDFile and ExecReload
[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 AX_PTHREAD(, [AC_MSG_ERROR([missing pthread_sigmask])])
84
85 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
86
87 dnl 64bit platform check
88 AC_NETATALK_64BIT_LIBS
89
90 dnl OS specific checks
91 AC_NETATALK_OS_SPECIFIC
92
93 dnl Check for optional admin group support
94 AC_NETATALK_ADMIN_GROUP
95
96 dnl Check for optional AFS support
97 AC_NETATALK_AFS_CHECK
98
99 dnl --with-pkgconfdir check to change configuration directory location
100 AC_NETATALK_CONFIG_DIRS
101
102 dnl Check for optional cracklib support
103 AC_NETATALK_CRACKLIB
104
105 dnl Check whether to enable debug code
106 AC_NETATALK_DEBUG
107
108 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
109 AC_NETATALK_DEBUGGING
110
111 dnl     Check for libiconv support
112 AC_NETATALK_CHECK_ICONV
113
114 dnl Check for CNID database backends
115 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
116
117 dnl Check for quota support
118 AC_NETATALK_CHECK_QUOTA
119
120 dnl Check for optional Zeroconf support
121 AC_NETATALK_ZEROCONF
122
123 dnl Check for optional TCP-wrappers support
124 AC_NETATALK_TCP_WRAPPERS
125
126 dnl Check for PAM libs
127 AC_NETATALK_PATH_PAM
128
129 dnl Check for optional shadow password support
130 AC_NETATALK_SHADOW
131         
132 dnl Check for optional valid-shell-check support
133 AC_NETATALK_SHELL_CHECK
134
135 dnl Check for optional sysv initscript install
136 AC_NETATALK_INIT_STYLE
137
138 dnl Path where UAM modules shall be installed
139 AC_ARG_WITH(uams-path, [  --with-uams-path=PATH   path to UAMs [[$libdir/netatalk/]]], [uams_path="$withval/"], [uams_path="$libdir/netatalk/"])
140
141 dnl Check for libgcrypt, if found enables DHX2 UAM
142 AC_NETATALK_PATH_LIBGCRYPT([1:1.2.3])
143
144 dnl Check for openssl, if found enables DHX UAM and Randnum UAM
145 AC_NETATALK_PATH_SSL
146
147 dnl Check for Berkeley DB library
148 AC_NETATALK_PATH_BDB
149
150 dnl Check for crypt
151 AC_NETATALK_CRYPT
152
153 dnl Check for building PGP UAM module
154 AC_NETATALK_PGP_UAM
155
156 dnl Check for building Kerberos V UAM module
157 AC_NETATALK_KRB5_UAM
158
159 dnl Check for Kerberos 5 support
160 AC_NETATALK_KERBEROS
161
162 dnl Check for overwrite the config files or not
163 AC_NETATALK_OVERWRITE_CONFIG
164
165 dnl Check for LDAP support, for client-side ACL visibility
166 AC_NETATALK_LDAP
167
168 dnl Check for ACL support
169 AC_NETATALK_ACL
170
171 dnl Check for Extended Attributes support
172 AC_NETATALK_EXTENDED_ATTRIBUTES
173
174 dnl Check if realpath() takes NULL
175 AC_NETATALK_REALPATH
176
177 dnl Check for sendfile()
178 AC_NETATALK_SENDFILE
179
180 dnl Check whether bundled libevent shall not be used
181 AC_NETATALK_LIBEVENT
182
183 dnl libatalk API checks
184 AC_DEVELOPER
185
186 dnl FHS stuff has to be done last because it overrides other defaults
187 AC_NETATALK_FHS
188
189 dnl netatalk lockfile path, must come after AC_NETATALK_FHS
190 AC_NETATALK_LOCKFILE
191
192 CFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/sys $CFLAGS"
193 UAMS_PATH="${uams_path}"
194
195 AC_SUBST(LIBS)
196 AC_SUBST(CFLAGS)
197 AC_SUBST(UAMS_PATH)
198
199 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
200 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
201 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
202 AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
203 AM_CONDITIONAL(HAVE_LDAP, test x"$netatalk_cv_ldap" = x"yes")
204 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
205 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
206 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
207 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
208 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
209 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
210 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
211 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
212 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
213 AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
214 AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes)
215
216 dnl Enable silent Automake rules if present                                                                           
217 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
218
219 dnl --------------------- generate files
220 AC_OUTPUT([Makefile
221         bin/Makefile
222         bin/ad/Makefile
223         bin/afppasswd/Makefile
224         bin/cnid/Makefile
225         bin/cnid/cnid2_create
226         bin/megatron/Makefile
227         bin/misc/Makefile
228         bin/uniconv/Makefile
229         config/Makefile
230         config/pam/Makefile
231         contrib/Makefile
232         contrib/macusers/Makefile
233         contrib/macusers/macusers
234         contrib/shell_utils/Makefile
235         contrib/shell_utils/apple_dump
236         contrib/shell_utils/asip-status.pl
237         distrib/Makefile
238         distrib/config/Makefile
239         distrib/config/netatalk-config
240         distrib/initscripts/Makefile
241         distrib/m4/Makefile
242         doc/Makefile
243         etc/Makefile
244         etc/afpd/Makefile
245         etc/cnid_dbd/Makefile
246         etc/netatalk/Makefile
247         etc/uams/Makefile
248         include/Makefile
249         include/atalk/Makefile
250         libatalk/Makefile
251         libatalk/acl/Makefile
252         libatalk/adouble/Makefile
253         libatalk/bstring/Makefile
254         libatalk/cnid/Makefile
255         libatalk/cnid/cdb/Makefile
256         libatalk/cnid/last/Makefile
257         libatalk/cnid/dbd/Makefile
258         libatalk/cnid/tdb/Makefile
259         libatalk/compat/Makefile
260         libatalk/dsi/Makefile
261         libatalk/iniparser/Makefile
262         libatalk/tdb/Makefile
263         libatalk/unicode/Makefile
264         libatalk/unicode/charsets/Makefile
265         libatalk/util/Makefile
266         libatalk/vfs/Makefile
267         macros/Makefile
268         man/Makefile
269         man/man1/Makefile
270         man/man5/Makefile
271         man/man8/Makefile
272         test/Makefile
273         test/afpd/Makefile
274         ],
275         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
276 )
277
278 AC_NETATALK_LIBS_SUMMARY
279 AC_NETATALK_CONFIG_SUMMARY