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