1 dnl configure.in for netatalk
3 AC_INIT(etc/afpd/main.c)
5 NETATALK_VERSION=`cat $srcdir/VERSION`
6 AC_SUBST(NETATALK_VERSION)
9 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
10 AM_CONFIG_HEADER(config.h)
11 AM_MAINTAINER_MODE([enable])
13 dnl Checks for programs.
27 dnl Checks for typedefs, structures, and compiler characteristics.
30 dnl Request SUSv3 standard interfaces plus anything else the platform may have
31 CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -D_GNU_SOURCE"
33 dnl Check if we can use attribute unused (gcc only) from ethereal
34 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
35 if test x$GCC != x ; then
36 CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
39 CFLAGS="-D_U_=\"\" $CFLAGS"
43 dnl Checks for header files, some checks are obsolete, unfortunately the code
44 dnl uses the resulting macros, so the code has to cleaned up too before
45 dnl we can remove the checks here.
46 AC_CHECK_HEADERS(mntent.h unistd.h termios.h ufs/quota.h)
47 AC_CHECK_HEADERS(netdb.h sgtty.h statfs.h dlfcn.h langinfo.h locale.h)
48 AC_CHECK_HEADERS(sys/param.h sys/fcntl.h sys/termios.h)
49 AC_CHECK_HEADERS(sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h)
50 dnl Checks for header files, confirmed to be required as of 2011
51 AC_CHECK_HEADERS(sys/epoll.h)
52 AC_CHECK_HEADERS([sys/mount.h], , ,
53 [#ifdef HAVE_SYS_PARAM_H
54 #include <sys/param.h>
58 AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
60 dnl --------------------------------------------------------------------------
61 dnl check if dlsym needs to add an underscore, uses libtool macros
62 dnl --------------------------------------------------------------------------
64 AC_CHECK_FUNCS(dlopen dlsym dlclose)
66 if test x"$libltdl_cv_need_uscore" = xyes; then
67 AC_DEFINE(DLSYM_PREPEND_UNDERSCORE, 1, [BSD compatibility macro])
71 ac_neta_haveatfuncs=yes
72 AC_CHECK_FUNCS(openat renameat fstatat unlinkat, , ac_neta_haveatfuncs=no)
73 if test x"$ac_neta_haveatfuncs" = x"yes" ; then
74 AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)
75 AC_DEFINE([HAVE_ATFUNCS], 1, whether at funcs are available)
77 AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
79 dnl these tests have been comfirmed to be needed in 2011
80 AC_CHECK_FUNC(epoll_create, AC_DEFINE([HAVE_EPOLL], 1, Whether Linux epoll is available))
81 AC_CHECK_FUNCS(backtrace_symbols dirfd getusershell pread pwrite pselect)
82 AC_CHECK_FUNCS(setlinebuf strlcat strlcpy strnlen)
83 AC_CHECK_FUNCS(mmap utime getpagesize) dnl needed by tbd
85 dnl search for necessary libraries
86 AC_SEARCH_LIBS(gethostbyname, nsl)
87 AC_SEARCH_LIBS(connect, socket)
88 AC_SEARCH_LIBS(pthread_sigmask, pthread,,[AC_MSG_ERROR([missing pthread_sigmask])])
89 if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
90 PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
92 AC_SUBST(PTHREAD_LIBS)
94 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, ELOOP, errno returned by open with O_NOFOLLOW)
98 dnl --------------------------------------------------------------------------
99 dnl 64bit platform check
100 dnl --------------------------------------------------------------------------
102 AC_MSG_CHECKING([whether to check for 64bit libraries])
103 # Test if the compiler is in 64bit mode
104 echo 'int i;' > conftest.$ac_ext
105 atalk_cv_cc_64bit_output=no
106 if AC_TRY_EVAL(ac_compile); then
107 case `/usr/bin/file conftest.$ac_objext` in
109 atalk_cv_cc_64bit_output=yes
115 case $host_cpu:$atalk_cv_cc_64bit_output in
116 powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
120 atalk_libname="lib/64"
128 atalk_libname="lib64"
138 dnl --------------------------------------------------------------------------
139 dnl OS specific configuration comes in here:
140 dnl --------------------------------------------------------------------------
142 AC_NETATALK_OS_SPECIFIC
144 dnl --------------------------------------------------------------------------
145 dnl specific configuration comes in here:
146 dnl --------------------------------------------------------------------------
148 dnl Check for optional admin group support
149 AC_NETATALK_ADMIN_GROUP
151 dnl Check for optional AFS support
152 AC_NETATALK_AFS_CHECK
154 dnl --with-pkgconfdir check to change configuration directory location
155 AC_NETATALK_CONFIG_DIRS
157 dnl Check for optional cracklib support
160 dnl Check whether to enable debug code
163 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
164 AC_NETATALK_DEBUGGING
166 dnl Check for libiconv support
167 AC_NETATALK_CHECK_ICONV
169 dnl Check for CNID database backends
170 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
172 dnl Check for quota support
173 AC_NETATALK_CHECK_QUOTA
175 dnl Check for optional server location protocol support (used by MacOS X)
178 dnl Check for optional Zeroconf support
181 dnl Check for optional TCP-wrappers support
182 AC_NETATALK_TCP_WRAPPERS
184 dnl Check for PAM libs
187 dnl Check for optional shadow password support
190 dnl Check for optional valid-shell-check support
191 AC_NETATALK_SHELL_CHECK
193 dnl Check for optional Webmin
196 dnl Check for optional sysv initscript install
197 AC_NETATALK_SYSV_STYLE
199 dnl Path where UAM modules shall be installed
200 AC_ARG_WITH(uams-path, [ --with-uams-path=PATH path to UAMs [[PKGCONF/uams]]], [uams_path="$withval"], [uams_path="${PKGCONFDIR}/uams"])
202 dnl Check for libgcrypt, if found enables DHX2 UAM
203 AC_NETATALK_PATH_LIBGCRYPT([1:1.2.3])
205 dnl Check for openssl, if found enables DHX UAM and Randnum UAM
208 dnl Check for Berkeley DB library
214 dnl Check for building PGP UAM module
217 dnl Check for building Kerberos V UAM module
220 dnl Check for overwrite the config files or not
221 AC_NETATALK_OVERWRITE_CONFIG
223 dnl Check for LDAP support, for client-side ACL visibility
226 dnl Check for ACL support
229 dnl Check for Extended Attributes support
230 AC_NETATALK_EXTENDED_ATTRIBUTES
232 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
233 AC_NETATALK_SMB_SHAREMODES
235 dnl Check if realpath() takes NULL
238 dnl Check for sendfile()
241 dnl --------------------------------------------------------------------------
242 dnl FHS stuff has to be done last because it overrides other defaults
243 dnl --------------------------------------------------------------------------
245 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
247 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[
248 if test "$enableval" = "yes"; then
249 uams_path="${libdir}/netatalk"
251 PKGCONFDIR=${sysconfdir}/netatalk
252 SERVERTEXT="${PKGCONFDIR}/msg"
254 mandir="/usr/share/man"
255 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
265 dnl --------------------------------------------------------------------------
266 dnl post-FHS substitutions, etc
267 dnl --------------------------------------------------------------------------
269 UAMS_PATH="${uams_path}"
272 dnl --------------------------------------------------------------------------
273 dnl drop in includes for top level directory structures here...
274 dnl --------------------------------------------------------------------------
276 dnl Note: $(top_srcdir)/include should be added before all other includes
277 dnl so that includes from that directory a preferred to includes from
278 dnl /usr/include or similar places.
279 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
280 CFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/sys $CFLAGS"
283 dnl --------------------------------------------------------------------------
284 dnl Last minute substitutions
285 dnl --------------------------------------------------------------------------
287 dnl ac_cv_target_os is now host_os, ac_cv_target_cpu is now host_cpu
291 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
292 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
293 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
294 AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
295 AM_CONDITIONAL(HAVE_LDAP, test x"$with_ldap" = x"yes")
296 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
297 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
298 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
299 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
300 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
301 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
302 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
303 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
304 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
305 AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
307 dnl --------------------- generate files
312 bin/afppasswd/Makefile
314 bin/cnid/cnid2_create
315 bin/megatron/Makefile
321 contrib/macusers/Makefile
322 contrib/macusers/macusers
323 contrib/shell_utils/Makefile
324 contrib/shell_utils/apple_dump
325 contrib/shell_utils/asip-status.pl
327 distrib/config/Makefile
328 distrib/config/netatalk-config
329 distrib/initscripts/Makefile
331 distrib/systemd/Makefile
335 etc/cnid_dbd/Makefile
338 include/atalk/Makefile
340 libatalk/acl/Makefile
341 libatalk/adouble/Makefile
342 libatalk/bstring/Makefile
343 libatalk/cnid/Makefile
344 libatalk/cnid/cdb/Makefile
345 libatalk/cnid/last/Makefile
346 libatalk/cnid/dbd/Makefile
347 libatalk/cnid/tdb/Makefile
348 libatalk/compat/Makefile
349 libatalk/dsi/Makefile
350 libatalk/tdb/Makefile
351 libatalk/unicode/Makefile
352 libatalk/unicode/charsets/Makefile
353 libatalk/util/Makefile
354 libatalk/vfs/Makefile
363 [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
366 AC_NETATALK_LIBS_SUMMARY
367 AC_NETATALK_CONFIG_SUMMARY