]> arthur.barton.de Git - netatalk.git/blob - configure.ac
Cleanup
[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
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)
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_SEARCH_LIBS(pthread_sigmask, pthread,,[AC_MSG_ERROR([missing pthread_sigmask])])
84 if test x"$ac_cv_search_pthread_sigmask" != x"none required" ; then
85    PTHREAD_LIBS=$ac_cv_search_pthread_sigmask
86 fi
87 AC_SUBST(PTHREAD_LIBS)
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_SYSV_STYLE
141
142 dnl Path where UAM modules shall be installed
143 AC_ARG_WITH(uams-path, [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]], [uams_path="$withval"], [uams_path="${PKGCONFDIR}/uams"])
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 overwrite the config files or not
164 AC_NETATALK_OVERWRITE_CONFIG
165
166 dnl Check for LDAP support, for client-side ACL visibility
167 AC_NETATALK_LDAP
168
169 dnl Check for ACL support
170 AC_NETATALK_ACL
171
172 dnl Check for Extended Attributes support
173 AC_NETATALK_EXTENDED_ATTRIBUTES
174
175 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
176 AC_NETATALK_SMB_SHAREMODES
177
178 dnl Check if realpath() takes NULL
179 AC_NETATALK_REALPATH
180
181 dnl Check for sendfile()
182 AC_NETATALK_SENDFILE
183
184 dnl FHS stuff has to be done last because it overrides other defaults
185 AC_NETATALK_FHS
186
187 LIBS="$LIBS -L\$(top_srcdir)/libatalk"
188 CFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/sys $CFLAGS"
189 UAMS_PATH="${uams_path}"
190
191 AC_SUBST(LIBS)
192 AC_SUBST(CFLAGS)
193 AC_SUBST(UAMS_PATH)
194
195 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
196 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
197 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
198 AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
199 AM_CONDITIONAL(HAVE_LDAP, test x"$with_ldap" = x"yes")
200 AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
201 AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
202 AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
203 AM_CONDITIONAL(USE_PAM_SO, test x$use_pam_so = xyes)
204 AM_CONDITIONAL(USE_PAM, test x$netatalk_cv_install_pam = xyes)
205 AM_CONDITIONAL(BUILD_PAM, test x$compile_pam = xyes)
206 AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes)
207 AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes)
208 AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
209 AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
210
211 dnl --------------------- generate files
212
213 AC_OUTPUT([Makefile
214         bin/Makefile
215         bin/ad/Makefile
216         bin/afppasswd/Makefile
217         bin/cnid/Makefile
218         bin/cnid/cnid2_create
219         bin/megatron/Makefile
220         bin/misc/Makefile
221         bin/uniconv/Makefile
222         config/Makefile
223         config/pam/Makefile
224         contrib/Makefile
225         contrib/macusers/Makefile
226         contrib/macusers/macusers
227         contrib/shell_utils/Makefile
228         contrib/shell_utils/apple_dump
229         contrib/shell_utils/asip-status.pl
230         distrib/Makefile
231         distrib/config/Makefile
232         distrib/config/netatalk-config
233         distrib/initscripts/Makefile
234         distrib/m4/Makefile
235         doc/Makefile
236         etc/Makefile
237         etc/afpd/Makefile
238         etc/cnid_dbd/Makefile
239         etc/uams/Makefile
240         include/Makefile
241         include/atalk/Makefile
242         libatalk/Makefile
243         libatalk/acl/Makefile
244         libatalk/adouble/Makefile
245         libatalk/bstring/Makefile
246         libatalk/cnid/Makefile
247         libatalk/cnid/cdb/Makefile
248         libatalk/cnid/last/Makefile
249         libatalk/cnid/dbd/Makefile
250         libatalk/cnid/tdb/Makefile
251         libatalk/compat/Makefile
252         libatalk/dsi/Makefile
253         libatalk/iniparser/Makefile
254         libatalk/tdb/Makefile
255         libatalk/unicode/Makefile
256         libatalk/unicode/charsets/Makefile
257         libatalk/util/Makefile
258         libatalk/vfs/Makefile
259         macros/Makefile
260         man/Makefile
261         man/man1/Makefile
262         man/man5/Makefile
263         man/man8/Makefile
264         test/Makefile
265         test/afpd/Makefile
266         ],
267         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
268 )
269
270 AC_NETATALK_LIBS_SUMMARY
271 AC_NETATALK_CONFIG_SUMMARY