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