1 dnl Kitchen sink for configuration macros
4 AC_DEFUN([AC_NETATALK_DTRACE], [
8 [Enable dtrace probes (default: enabled if dtrace found)]
13 if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
14 AC_CHECK_PROG([atalk_cv_have_dtrace], [dtrace], [yes], [no])
15 if test "x$atalk_cv_have_dtrace" = "xno" ; then
16 if test "x$WDTRACE" = "xyes" ; then
17 AC_MSG_FAILURE([dtrace requested but not found])
25 if test x"$WDTRACE" = x"yes" ; then
26 AC_DEFINE([WITH_DTRACE], [1], [dtrace probes])
28 if test x"$this_os" = x"freebsd" ; then
33 AM_CONDITIONAL(WITH_DTRACE, test "x$WDTRACE" = "xyes")
36 dnl Check for dbus-glib, for AFP stats
37 AC_DEFUN([AC_NETATALK_DBUS_GLIB], [
39 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1, have_dbus=yes, have_dbus=no)
40 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1, have_dbus_glib=yes, have_dbus_glib=no)
41 PKG_CHECK_MODULES(DBUS_GTHREAD, gthread-2.0, have_dbus_gthread=yes, have_dbus_gthread=no)
44 AC_SUBST(DBUS_GLIB_CFLAGS)
45 AC_SUBST(DBUS_GLIB_LIBS)
46 AC_SUBST(DBUS_GTHREAD_CFLAGS)
47 AC_SUBST(DBUS_GTHREAD_LIBS)
48 if test x$have_dbus_glib = xyes -a x$have_dbus = xyes -a x$have_dbus_gthread = xyes ; then
51 CFLAGS="$CFLAGS $DBUS_GLIB_CFLAGS"
52 LIBS="$LIBS $DBUS_GLIB_LIBS"
53 AC_CHECK_FUNC([dbus_g_bus_get_private], [atalk_cv_with_dbus=yes], [atalk_cv_with_dbus=no])
54 CFLAGS="$saved_CFLAGS"
57 AM_CONDITIONAL(HAVE_DBUS_GLIB, test x$atalk_cv_with_dbus = xyes)
61 [AS_HELP_STRING([--with-dbus-sysconf-dir=PATH],[Path to dbus system bus security configuration directory (default: ${sysconfdir}/dbus-1/system.d/)])],
62 ac_cv_dbus_sysdir=$withval,
63 ac_cv_dbus_sysdir='${sysconfdir}/dbus-1/system.d'
66 if test x$atalk_cv_with_dbus = xyes ; then
67 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if support for dbus-glib was found])
68 DBUS_SYS_DIR="$ac_cv_dbus_sysdir"
69 AC_SUBST(DBUS_SYS_DIR)
73 dnl Whether to enable developer build
74 AC_DEFUN([AC_DEVELOPER], [
75 AC_MSG_CHECKING([whether to enable developer build])
78 AS_HELP_STRING([--enable-developer], [whether to enable developer build (ABI checking)]),
79 enable_dev=$enableval,
82 AC_MSG_RESULT([$enable_dev])
83 AM_CONDITIONAL(DEVELOPER, test x"$enable_dev" = x"yes")
86 dnl Tracker, for Spotlight
87 AC_DEFUN([AC_NETATALK_SPOTLIGHT], [
90 ac_cv_tracker_pkg_default=tracker-sparql-0.12
91 AC_ARG_WITH([tracker-pkg-config],
92 [AS_HELP_STRING([--with-tracker-pkg-config],[name of the Tracker SPARQL pkg in pkg-config])],
93 [ac_cv_tracker_pkg=$withval],
94 [ac_cv_tracker_pkg=$ac_cv_tracker_pkg_default])
96 PKG_CHECK_MODULES([TRACKER], [$ac_cv_tracker_pkg >= 0.12], [ac_cv_have_tracker_sparql=yes], [ac_cv_have_tracker_sparql=no])
98 if test x"$ac_cv_have_tracker_sparql" = x"no" ; then
99 if test x"$need_tracker" = x"yes" ; then
100 AC_MSG_ERROR([$ac_cv_tracker_pkg not found])
103 AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker is available])
104 AC_DEFINE(HAVE_TRACKER_SPARQL, 1, [Define if Tracker SPARQL is available])
105 ac_cv_tracker_prefix=`pkg-config --variable=prefix $ac_cv_tracker_pkg`
106 AC_DEFINE_UNQUOTED(TRACKER_PREFIX, ["$ac_cv_tracker_prefix"], [Path to Tracker])
109 ac_cv_tracker_miner_pkg_default=tracker-miner-0.12
110 AC_ARG_WITH([tracker-miner-pkg-config],
111 [AS_HELP_STRING([--with-tracker-miner-pkg-config],[name of the Tracker miner pkg in pkg-config])],
112 [ac_cv_tracker_miner_pkg=$withval],
113 [ac_cv_tracker_miner_pkg=$ac_cv_tracker_miner_pkg_default])
115 PKG_CHECK_MODULES([TRACKER_MINER], [$ac_cv_tracker_miner_pkg >= 0.12], [ac_cv_have_tracker_miner=yes], [ac_cv_have_tracker_miner=no])
117 if test x"$ac_cv_have_tracker_miner" = x"yes" ; then
118 AC_DEFINE(HAVE_TRACKER_MINER, 1, [Define if Tracker miner library is available])
119 AC_SUBST(TRACKER_MINER_CFLAGS)
120 AC_SUBST(TRACKER_MINER_LIBS)
123 dnl Test for Tracker 0.6 on Solaris and derived platforms
124 if test x"$this_os" = x"solaris" ; then
125 PKG_CHECK_MODULES([TRACKER], [tracker >= 0.6], [ac_cv_have_tracker_rdf=yes], [ac_cv_have_tracker_rdf=no])
126 if test x"$ac_cv_have_tracker_rdf" = x"yes" ; then
127 AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker is available])
128 AC_DEFINE(HAVE_TRACKER_RDF, 1, [Define if Tracker 0.6 with support for RDF queries is available])
129 ac_cv_tracker_prefix=`pkg-config --variable=prefix tracker`
130 AC_DEFINE_UNQUOTED(TRACKER_RDF_PREFIX, ["$ac_cv_tracker_prefix"], [Path to Tracker])
134 if test x"$ac_cv_have_tracker_sparql" = x"yes" -o x"$ac_cv_have_tracker_rdf" = x"yes" ; then
135 ac_cv_have_tracker=yes
137 AC_SUBST(TRACKER_CFLAGS)
138 AC_SUBST(TRACKER_LIBS)
139 AM_CONDITIONAL(HAVE_TRACKER_SPARQL, [test x"$ac_cv_have_tracker_sparql" = x"yes"])
140 AM_CONDITIONAL(HAVE_TRACKER_RDF, [test x"$ac_cv_have_tracker_rdf" = x"yes"])
143 dnl Whether to disable bundled libevent
144 AC_DEFUN([AC_NETATALK_LIBEVENT], [
145 AC_MSG_CHECKING([whether to use bundled libevent])
148 [AS_HELP_STRING([--with-libevent],[whether to use the bundled libevent (default: yes)])],
149 use_bundled_libevent=$withval,
150 use_bundled_libevent=yes
154 [AS_HELP_STRING([--with-libevent-header],[path to libevent header files])],
155 [use_bundled_libevent=no; LIBEVENT_CFLAGS=-I$withval]
159 [AS_HELP_STRING([--with-libevent-lib],[path to libevent library])],
160 [use_bundled_libevent=no; LIBEVENT_LDFLAGS=-L$withval]
162 if test x"$LIBEVENT_CFLAGS" = x"-Iyes" -o x"$LIBEVENT_LDFLAGS" = x"-Lyes" ; then
163 AC_MSG_ERROR([--with-libevent requires a path])
165 AC_MSG_RESULT([$use_bundled_libevent])
166 if test x"$use_bundled_libevent" = x"yes" ; then
167 AC_CONFIG_SUBDIRS([libevent])
169 AC_SUBST(LIBEVENT_CFLAGS)
170 AC_SUBST(LIBEVENT_LDFLAGS)
171 AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
174 dnl Filesystem Hierarchy Standard (FHS) compatibility
175 AC_DEFUN([AC_NETATALK_FHS], [
176 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
178 [ --enable-fhs use Filesystem Hierarchy Standard (FHS) compatibility],[
179 if test "$enableval" = "yes"; then
185 mandir="/usr/share/man"
186 uams_path="${libdir}/netatalk"
187 PKGCONFDIR="${sysconfdir}"
188 SERVERTEXT="${localstatedir}/netatalk/msg"
190 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
192 atalk_cv_fhs_compat=yes
195 atalk_cv_fhs_compat=no
199 atalk_cv_fhs_compat=no
202 dnl netatalk lockfile path
203 AC_DEFUN([AC_NETATALK_LOCKFILE], [
204 AC_MSG_CHECKING([netatalk lockfile path])
207 [AS_HELP_STRING([--with-lockfile=PATH],[Path of netatalk lockfile])],
208 ac_cv_netatalk_lock=$withval,
209 ac_cv_netatalk_lock=""
211 if test -z "$ac_cv_netatalk_lock" ; then
212 ac_cv_netatalk_lock=/var/spool/locks/netatalk
213 if test x"$atalk_cv_fhs_compat" = x"yes" ; then
214 ac_cv_netatalk_lock=/var/run/netatalk.pid
218 ac_cv_netatalk_lock=/var/spool/lock/netatalk
221 ac_cv_netatalk_lock=/var/run/netatalk.pid
224 ac_cv_netatalk_lock=/var/lock/netatalk
229 AC_DEFINE_UNQUOTED(PATH_NETATALK_LOCK, ["$ac_cv_netatalk_lock"], [netatalk lockfile path])
230 AC_SUBST(PATH_NETATALK_LOCK, ["$ac_cv_netatalk_lock"])
231 AC_MSG_RESULT([$ac_cv_netatalk_lock])
234 dnl 64bit platform check
235 AC_DEFUN([AC_NETATALK_64BIT_LIBS], [
236 AC_MSG_CHECKING([whether to check for 64bit libraries])
237 # Test if the compiler is in 64bit mode
238 echo 'int i;' > conftest.$ac_ext
239 atalk_cv_cc_64bit_output=no
240 if AC_TRY_EVAL(ac_compile); then
241 case `/usr/bin/file conftest.$ac_objext` in
243 atalk_cv_cc_64bit_output=yes
249 case $host_cpu:$atalk_cv_cc_64bit_output in
250 powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
254 atalk_libname="lib/64"
262 atalk_libname="lib64"
273 dnl Check for optional admin group support
274 AC_DEFUN([AC_NETATALK_ADMIN_GROUP], [
275 netatalk_cv_admin_group=yes
276 AC_MSG_CHECKING([for administrative group support])
277 AC_ARG_ENABLE(admin-group,
278 [ --disable-admin-group disable admin group],[
279 if test x"$enableval" = x"no"; then
280 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
281 netatalk_cv_admin_group=no
284 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
287 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
292 dnl Check for optional cracklib support
293 AC_DEFUN([AC_NETATALK_CRACKLIB], [
294 netatalk_cv_with_cracklib=no
295 AC_ARG_WITH(cracklib,
296 [ --with-cracklib[[=DICT]] enable/set location of cracklib dictionary [[no]]],[
297 if test "x$withval" != "xno" ; then
299 AC_CHECK_LIB(crack, main, [
300 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
302 if test "$cracklib" = "yes"; then
303 cracklib="/usr/$atalk_libname/cracklib_dict"
305 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
306 [path to cracklib dictionary])
307 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
308 netatalk_cv_with_cracklib=yes
310 AC_MSG_ERROR([cracklib not found!])
316 AC_MSG_CHECKING([for cracklib support])
317 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
320 dnl Check whether to enable debug code
321 AC_DEFUN([AC_NETATALK_DEBUG], [
322 AC_MSG_CHECKING([whether to enable verbose debug code])
324 [ --enable-debug enable verbose debug code],[
325 if test "$enableval" != "no"; then
326 if test "$enableval" = "yes"; then
327 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
329 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
334 AC_DEFINE(NDEBUG, 1, [Disable assertions])
338 AC_DEFINE(NDEBUG, 1, [Disable assertions])
343 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
344 AC_DEFUN([AC_NETATALK_DEBUGGING], [
345 AC_MSG_CHECKING([whether to enable debugging with debuggers])
346 AC_ARG_ENABLE(debugging,
347 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
348 if test "$enableval" != "no"; then
349 if test "$enableval" = "yes"; then
350 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
352 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
365 dnl Check for optional shadow password support
366 AC_DEFUN([AC_NETATALK_SHADOW], [
367 netatalk_cv_use_shadowpw=no
369 [ --with-shadow enable shadow password support [[auto]]],
370 [netatalk_cv_use_shadowpw="$withval"],
371 [netatalk_cv_use_shadowpw=auto]
374 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
375 AC_CHECK_HEADER([shadow.h])
376 if test x"$ac_cv_header_shadow_h" = x"yes"; then
377 netatalk_cv_use_shadowpw=yes
378 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
380 if test "x$shadowpw" = "xyes"; then
381 AC_MSG_ERROR([shadow support not available])
383 netatalk_cv_use_shadowpw=no
388 AC_MSG_CHECKING([whether shadow support should be enabled])
389 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
396 dnl Check for optional valid-shell-check support
397 AC_DEFUN([AC_NETATALK_SHELL_CHECK], [
398 netatalk_cv_use_shellcheck=yes
399 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
400 AC_ARG_ENABLE(shell-check,
401 [ --disable-shell-check disable checking for a valid shell],[
402 if test "$enableval" = "no"; then
403 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
405 netatalk_cv_use_shellcheck=no
415 dnl Check for optional initscript install
416 AC_DEFUN([AC_NETATALK_INIT_STYLE], [
417 AC_ARG_WITH(init-style,
418 [ --with-init-style use OS specific init config [[redhat-sysv|redhat-systemd|suse-sysv|suse-systemd|gentoo|netbsd|debian|solaris|systemd]]],
419 init_style="$withval", init_style=none
421 case "$init_style" in
423 AC_MSG_ERROR([--with-init-style=redhat is obsoleted. Use redhat-sysv or redhat-systemd.])
426 AC_MSG_RESULT([enabling redhat-style sysv initscript support])
427 ac_cv_init_dir="/etc/rc.d/init.d"
430 AC_MSG_RESULT([enabling redhat-style systemd support])
431 ac_cv_init_dir="/lib/systemd/system"
434 AC_MSG_ERROR([--with-init-style=suse is obsoleted. Use suse-sysv or suse-systemd.])
437 AC_MSG_RESULT([enabling suse-style sysv initscript support])
438 ac_cv_init_dir="/etc/init.d"
441 AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
442 ac_cv_init_dir="/lib/systemd/system"
445 AC_MSG_RESULT([enabling gentoo-style initscript support])
446 ac_cv_init_dir="/etc/init.d"
449 AC_MSG_RESULT([enabling netbsd-style initscript support])
450 ac_cv_init_dir="/etc/rc.d"
453 AC_MSG_RESULT([enabling debian-style initscript support])
454 ac_cv_init_dir="/etc/init.d"
457 AC_MSG_RESULT([enabling solaris-style SMF support])
458 ac_cv_init_dir="/lib/svc/manifest/network/"
461 AC_MSG_RESULT([enabling general systemd support])
462 ac_cv_init_dir="/lib/systemd/system"
465 AC_MSG_RESULT([disabling init-style support])
466 ac_cv_init_dir="none"
469 AC_MSG_ERROR([illegal init-style])
472 AM_CONDITIONAL(USE_NETBSD, test x$init_style = xnetbsd)
473 AM_CONDITIONAL(USE_REDHAT_SYSV, test x$init_style = xredhat-sysv)
474 AM_CONDITIONAL(USE_SUSE_SYSV, test x$init_style = xsuse-sysv)
475 AM_CONDITIONAL(USE_SOLARIS, test x$init_style = xsolaris)
476 AM_CONDITIONAL(USE_GENTOO, test x$init_style = xgentoo)
477 AM_CONDITIONAL(USE_DEBIAN, test x$init_style = xdebian)
478 AM_CONDITIONAL(USE_SYSTEMD, test x$init_style = xsystemd || test x$init_style = xredhat-systemd || test x$init_style = xsuse-systemd)
479 AM_CONDITIONAL(USE_UNDEF, test x$init_style = xnone)
481 AC_ARG_WITH(init-dir,
482 [ --with-init-dir=PATH path to OS specific init directory],
483 ac_cv_init_dir="$withval", ac_cv_init_dir="$ac_cv_init_dir"
485 INIT_DIR="$ac_cv_init_dir"
486 AC_SUBST(INIT_DIR, ["$ac_cv_init_dir"])
489 dnl OS specific configuration
490 AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
492 *aix*) this_os=aix ;;
493 *freebsd*) this_os=freebsd ;;
494 *hpux11*) this_os=hpux11 ;;
495 *irix*) this_os=irix ;;
496 *linux*) this_os=linux ;;
497 *osx*) this_os=macosx ;;
498 *darwin*) this_os=macosx ;;
499 *netbsd*) this_os=netbsd ;;
500 *openbsd*) this_os=openbsd ;;
501 *osf*) this_os=tru64 ;;
502 *solaris*) this_os=solaris ;;
506 i386|i486|i586|i686|k7) this_cpu=x86 ;;
507 alpha) this_cpu=alpha ;;
508 mips) this_cpu=mips ;;
509 powerpc|ppc) this_cpu=ppc ;;
512 dnl --------------------- GNU source
514 linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
516 kfreebsd-gnu) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
520 dnl --------------------- operating system specific flags (port from sys/*)
522 dnl ----- FreeBSD specific -----
523 if test x"$this_os" = "xfreebsd"; then
524 AC_MSG_RESULT([ * FreeBSD specific configuration])
525 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
526 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
527 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
530 dnl ----- GNU/kFreeBSD specific -----
531 if test x"$this_os" = "xkfreebsd-gnu"; then
532 AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration])
533 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
534 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
535 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
538 dnl ----- Linux specific -----
539 if test x"$this_os" = "xlinux"; then
540 AC_MSG_RESULT([ * Linux specific configuration])
541 AC_DEFINE(LINUX, 1, [OS is Linux])
542 dnl ----- check if we need the quotactl wrapper
543 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
544 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
545 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
549 dnl ----- as far as I can tell, dbtob always does the wrong thing
550 dnl ----- on every single version of linux I've ever played with.
551 dnl ----- see etc/afpd/quota.c
552 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
557 dnl ----- NetBSD specific -----
558 if test x"$this_os" = "xnetbsd"; then
559 AC_MSG_RESULT([ * NetBSD specific configuration])
560 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
561 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
562 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
564 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
567 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
568 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
571 dnl ----- OpenBSD specific -----
572 if test x"$this_os" = "xopenbsd"; then
573 AC_MSG_RESULT([ * OpenBSD specific configuration])
574 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
575 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
576 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
579 dnl ----- Solaris specific -----
580 if test x"$this_os" = "xsolaris"; then
581 AC_MSG_RESULT([ * Solaris specific configuration])
582 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
583 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
584 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
585 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
586 AC_DEFINE(_XOPEN_SOURCE, 600, [Solaris compilation environment])
587 AC_DEFINE(__EXTENSIONS__, 1, [Solaris compilation environment])
588 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
593 AC_MSG_CHECKING([if we can build Solaris kernel module])
594 if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
597 AC_MSG_RESULT([$solaris_module])
599 COMPILE_64BIT_KMODULE=no
602 COMPILE_KERNEL_GCC=no
604 if test "$solaris_module" = "yes"; then
605 dnl Solaris kernel module stuff
606 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
608 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
609 if test -x /usr/bin/isainfo; then
610 # check for 64 bit platform
611 if isainfo -kv | grep '^64-bit'; then
612 COMPILE_64BIT_KMODULE=yes
616 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
618 if test "${GCC}" = yes; then
619 COMPILE_KERNEL_GCC=yes
620 if test "$COMPILE_64BIT_KMODULE" = yes; then
622 AC_MSG_CHECKING([if we can build a 64bit kernel module])
624 case `$CC --version 2>/dev/null` in
626 COMPILE_64BIT_KMODULE=no
627 COMPILE_KERNEL_GCC=no
632 #KLDFLAGS="-melf64_sparc"
636 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
642 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
644 if test "$COMPILE_64BIT_KMODULE" = yes; then
645 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
646 KCFLAGS="-xarch=v9 -xregs=no%appl"
652 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
655 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
656 AC_LINK_IFELSE([AC_LANG_PROGRAM([[\
657 #include <sys/stream.h>
658 #include <sys/ddi.h>]], [[\
660 ]])],[netatalk_cv_HAVE_TIMEOUT_ID_T=yes],[netatalk_cv_HAVE_TIMEOUT_ID_T=no])])
662 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
665 AC_SUBST(COMPILE_KERNEL_GCC)
666 AC_SUBST(COMPILE_64BIT_KMODULE)
671 dnl Whether to run ldconfig after installing libraries
672 AC_PATH_PROG(NETA_LDCONFIG, ldconfig, , [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/bin])
673 echo NETA_LDCONFIG = $NETA_LDCONFIG
674 AM_CONDITIONAL(RUN_LDCONFIG, test x"$this_os" = x"linux" -a x"$NETA_LDCONFIG" != x"")
677 dnl Check for building PGP UAM module
678 AC_DEFUN([AC_NETATALK_PGP_UAM], [
679 AC_MSG_CHECKING([whether the PGP UAM should be build])
680 AC_ARG_ENABLE(pgp-uam,
681 [ --enable-pgp-uam enable build of PGP UAM module],[
682 if test "$enableval" = "yes"; then
683 if test "x$neta_cv_have_openssl" = "xyes"; then
684 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
697 dnl Check for building Kerberos V UAM module
698 AC_DEFUN([AC_NETATALK_KRB5_UAM], [
699 netatalk_cv_build_krb5_uam=no
700 AC_ARG_ENABLE(krbV-uam,
701 [ --enable-krbV-uam enable build of Kerberos V UAM module],
703 if test x"$enableval" = x"yes"; then
704 NETATALK_GSSAPI_CHECK([
705 netatalk_cv_build_krb5_uam=yes
707 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
714 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
715 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
720 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
723 dnl Check if we can directly use Kerberos 5 API, used for reading keytabs
724 dnl and automatically construction DirectoryService names from that, instead
725 dnl of requiring special configuration in afp.conf
726 AC_DEFUN([AC_NETATALK_KERBEROS], [
727 AC_MSG_CHECKING([for Kerberos 5 (necessary for GetSrvrInfo:DirectoryNames support)])
728 AC_ARG_WITH([kerberos],
729 [AS_HELP_STRING([--with-kerberos], [Kerberos 5 support (default=auto)])],
731 [with_kerberos=auto])
732 AC_MSG_RESULT($with_kerberos)
734 if test x"$with_kerberos" != x"no"; then
735 have_krb5_header="no"
736 AC_CHECK_HEADERS([krb5/krb5.h krb5.h], [have_krb5_header="yes"; break])
737 if test x"$have_krb5_header" = x"no" && test x"$with_kerberos" != x"auto"; then
738 AC_MSG_FAILURE([--with-kerberos was given, but no headers found])
741 AC_PATH_PROG([KRB5_CONFIG], [krb5-config])
742 AC_MSG_CHECKING([for krb5-config])
743 if test -x "$KRB5_CONFIG"; then
744 AC_MSG_RESULT([$KRB5_CONFIG])
745 KRB5_CFLAGS="`$KRB5_CONFIG --cflags krb5`"
746 KRB5_LIBS="`$KRB5_CONFIG --libs krb5`"
747 AC_SUBST(KRB5_CFLAGS)
751 AC_MSG_RESULT([not found])
752 if test x"$with_kerberos" != x"auto"; then
753 AC_MSG_FAILURE([--with-kerberos was given, but krb5-config could not be found])
758 if test x"$with_kerberos" = x"yes"; then
759 AC_DEFINE([HAVE_KERBEROS], [1], [Define if Kerberos 5 is available])
762 dnl Check for krb5_free_unparsed_name and krb5_free_error_message
763 save_CFLAGS="$CFLAGS"
765 CFLAGS="$KRB5_CFLAGS"
767 AC_CHECK_FUNCS([krb5_free_unparsed_name krb5_free_error_message krb5_free_keytab_entry_contents krb5_kt_free_entry])
768 CFLAGS="$save_CFLAGS"
772 dnl Check for overwrite the config files or not
773 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
774 AC_MSG_CHECKING([whether configuration files should be overwritten])
775 AC_ARG_ENABLE(overwrite,
776 [ --enable-overwrite overwrite configuration files during installation],
777 [OVERWRITE_CONFIG="${enable_overwrite}"],
778 [OVERWRITE_CONFIG="no"]
780 AC_MSG_RESULT([$OVERWRITE_CONFIG])
781 AC_SUBST(OVERWRITE_CONFIG)
784 dnl Check for LDAP support, for client-side ACL visibility
785 AC_DEFUN([AC_NETATALK_LDAP], [
786 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
788 [AS_HELP_STRING([--with-ldap],
789 [LDAP support (default=auto)])],
790 netatalk_cv_ldap=$withval,
791 netatalk_cv_ldap=auto
793 AC_MSG_RESULT($netatalk_cv_ldap)
795 save_CFLAGS="$CFLAGS"
796 save_LDFLAGS="$LDFLAGS"
805 if test x"$netatalk_cv_ldap" != x"no" ; then
806 if test x"$netatalk_cv_ldap" != x"yes" -a x"$netatalk_cv_ldap" != x"auto"; then
807 CFLAGS="-I$netatalk_cv_ldap/include"
808 LDFLAGS="-L$netatalk_cv_ldap/lib"
810 AC_CHECK_HEADER([ldap.h], netatalk_cv_ldap=yes,
811 [ if test x"$netatalk_cv_ldap" = x"yes" ; then
812 AC_MSG_ERROR([Missing LDAP headers])
816 AC_CHECK_LIB(ldap, ldap_init, netatalk_cv_ldap=yes,
817 [ if test x"$netatalk_cv_ldap" = x"yes" ; then
818 AC_MSG_ERROR([Missing LDAP library])
824 if test x"$netatalk_cv_ldap" = x"yes"; then
825 LDAP_CFLAGS="$CFLAGS"
826 LDAP_LDFLAGS="$LDFLAGS"
828 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
831 AC_SUBST(LDAP_CFLAGS)
832 AC_SUBST(LDAP_LDFLAGS)
834 CFLAGS="$save_CFLAGS"
835 LDLFLAGS="$save_LDLFLAGS"
839 dnl Check for ACL support
840 AC_DEFUN([AC_NETATALK_ACL], [
841 AC_MSG_CHECKING(whether to support ACLs)
843 [AS_HELP_STRING([--with-acls],
844 [Include ACL support (default=auto)])],
847 with_acl_support="$withval"
850 with_acl_support=auto
853 [with_acl_support=auto])
854 AC_MSG_RESULT($with_acl_support)
856 if test x"$with_acl_support" = x"no"; then
857 AC_MSG_RESULT(Disabling ACL support)
858 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
863 if test x"$with_acl_support" = x"yes" ; then
864 AC_MSG_NOTICE(checking whether ACL support is available:)
867 AC_MSG_NOTICE(Using UnixWare ACLs)
868 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
871 AC_MSG_NOTICE(Using solaris ACLs)
872 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
873 ACL_LIBS="$ACL_LIBS -lsec"
876 AC_MSG_NOTICE(Using HPUX ACLs)
877 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
880 AC_MSG_NOTICE(Using IRIX ACLs)
881 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
884 AC_MSG_NOTICE(Using AIX ACLs)
885 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
888 AC_MSG_NOTICE(Using Tru64 ACLs)
889 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
890 ACL_LIBS="$ACL_LIBS -lpacl"
893 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
894 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
897 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
900 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
903 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
905 LIBS="$LIBS $ACL_LIBS"
906 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
907 #include <sys/types.h>
912 acl_entry_t *entry_p;
913 return acl_get_entry(acl, entry_id, entry_p);
914 ]])],[netatalk_cv_HAVE_POSIX_ACLS=yes],[netatalk_cv_HAVE_POSIX_ACLS=no
915 with_acl_support=no])
918 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
919 AC_MSG_NOTICE(Using POSIX ACLs)
920 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
921 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
923 LIBS="$LIBS $ACL_LIBS"
924 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
925 #include <sys/types.h>
928 acl_permset_t permset_d;
930 return acl_get_perm_np(permset_d, perm);
931 ]])],[netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],[netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
934 if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
935 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
939 AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
941 LIBS="$LIBS $ACL_LIBS"
942 AC_CHECK_FUNCS(acl_from_mode,
943 [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
944 [netatalk_cv_HAVE_ACL_FROM_MODE=no])
947 if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
948 AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
952 AC_MSG_NOTICE(ACL support is not avaliable)
953 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
959 if test x"$with_acl_support" = x"yes" ; then
960 AC_CHECK_HEADERS([acl/libacl.h])
961 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
966 dnl Check for Extended Attributes support
967 AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
969 neta_cv_eas_sys_found=no
970 neta_cv_eas_sys_not_found=no
972 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
977 AC_SEARCH_LIBS(getproplist, [proplist])
978 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
979 [neta_cv_eas_sys_found=yes],
980 [neta_cv_eas_sys_not_found=yes])
981 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
982 [neta_cv_eas_sys_not_found=yes])
983 AC_CHECK_FUNCS([sizeof_proplist_entry],,
984 [neta_cv_eas_sys_not_found=yes])
988 AC_CHECK_FUNCS([attropen],
989 [neta_cv_eas_sys_found=yes; AC_DEFINE(HAVE_EAFD, 1, [extattr API has full fledged fds for EAs])],
990 [neta_cv_eas_sys_not_found=yes])
994 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
995 [neta_cv_eas_sys_found=yes],
996 [neta_cv_eas_sys_not_found=yes])
997 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
998 [neta_cv_eas_sys_not_found=yes])
999 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
1000 [neta_cv_eas_sys_not_found=yes])
1001 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
1002 [neta_cv_eas_sys_not_found=yes])
1005 *freebsd4* | *dragonfly* )
1006 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
1010 AC_SEARCH_LIBS(getxattr, [attr])
1012 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1013 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
1014 [neta_cv_eas_sys_found=yes],
1015 [neta_cv_eas_sys_not_found=yes])
1016 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
1017 [neta_cv_eas_sys_not_found=yes])
1018 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
1019 [neta_cv_eas_sys_not_found=yes])
1022 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1023 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
1024 [neta_cv_eas_sys_found=yes],
1025 [neta_cv_eas_sys_not_found=yes])
1026 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
1027 [neta_cv_eas_sys_not_found=yes])
1030 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1031 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
1032 [neta_cv_eas_sys_not_found=yes])
1033 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
1034 [neta_cv_eas_sys_not_found=yes])
1039 # Do xattr functions take additional options like on Darwin?
1040 if test x"$ac_cv_func_getxattr" = x"yes" ; then
1041 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
1043 LIBS="$LIBS $ACL_LIBS"
1044 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1045 #include <sys/types.h>
1046 #if HAVE_ATTR_XATTR_H
1047 #include <attr/xattr.h>
1048 #elif HAVE_SYS_XATTR_H
1049 #include <sys/xattr.h>
1052 getxattr(0, 0, 0, 0, 0, 0);
1053 ]])],[smb_attr_cv_xattr_add_opt=yes],[smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
1055 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
1056 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
1060 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
1061 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
1062 neta_cv_eas="$neta_cv_eas | sys"
1065 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
1068 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
1069 dnl Defines "neta_cv_have_smbshmd" to "yes" or "no"
1070 dnl AC_SUBST's "SMB_SHAREMODES_CFLAGS" and "SMB_SHAREMODES_LDFLAGS"
1071 dnl AM_CONDITIONAL's "USE_SMB_SHAREMODES"
1072 AC_DEFUN([AC_NETATALK_SMB_SHAREMODES], [
1073 neta_cv_have_smbshmd=no
1074 AC_ARG_WITH(smbsharemodes-lib,
1075 [ --with-smbsharemodes-lib=PATH PATH to libsmbsharemodes lib from Samba],
1076 [SMB_SHAREMODES_LDFLAGS="-L$withval -lsmbsharemodes"]
1078 AC_ARG_WITH(smbsharemodes-include,
1079 [ --with-smbsharemodes-include=PATH PATH to libsmbsharemodes header from Samba],
1080 [SMB_SHAREMODES_CFLAGS="-I$withval"]
1082 AC_ARG_WITH(smbsharemodes,
1083 [AS_HELP_STRING([--with-smbsharemodes],[Samba interop (default is yes)])],
1084 [use_smbsharemodes=$withval],
1085 [use_smbsharemodes=yes]
1088 if test x"$use_smbsharemodes" = x"yes" ; then
1089 AC_MSG_CHECKING([whether to enable Samba/Netatalk access/deny/share-modes interop])
1091 saved_CFLAGS="$CFLAGS"
1092 saved_LDFLAGS="$LDFLAGS"
1093 CFLAGS="$SMB_SHAREMODES_CFLAGS $CFLAGS"
1094 LDFLAGS="$SMB_SHAREMODES_LDFLAGS $LDFLAGS"
1097 [#include <unistd.h>
1099 #include <sys/time.h>
1102 /* From messages.h */
1106 #include "smb_share_modes.h"
1107 int main(void) { (void)smb_share_mode_db_open(""); return 0;}],
1108 [neta_cv_have_smbshmd=yes]
1111 AC_MSG_RESULT($neta_cv_have_smbshmd)
1112 AC_SUBST(SMB_SHAREMODES_CFLAGS, [$SMB_SHAREMODES_CFLAGS])
1113 AC_SUBST(SMB_SHAREMODES_LDFLAGS, [$SMB_SHAREMODES_LDFLAGS])
1114 CFLAGS="$saved_CFLAGS"
1115 LDFLAGS="$saved_LDFLAGS"
1118 AM_CONDITIONAL(USE_SMB_SHAREMODES, test x"$neta_cv_have_smbshmd" = x"yes")
1121 dnl ------ Check for sendfile() --------
1122 AC_DEFUN([AC_NETATALK_SENDFILE], [
1123 netatalk_cv_search_sendfile=yes
1124 AC_ARG_ENABLE(sendfile,
1125 [ --disable-sendfile disable sendfile syscall],
1126 [if test x"$enableval" = x"no"; then
1127 netatalk_cv_search_sendfile=no
1131 if test x"$netatalk_cv_search_sendfile" = x"yes"; then
1134 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
1135 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
1139 AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()])
1140 AC_SEARCH_LIBS(sendfile, sendfile)
1141 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
1142 AC_CHECK_FUNCS([sendfilev])
1146 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
1147 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
1155 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
1156 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
1161 dnl --------------------- Check if realpath() takes NULL
1162 AC_DEFUN([AC_NETATALK_REALPATH], [
1163 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
1164 neta_cv_REALPATH_TAKES_NULL, [
1165 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1170 void exit_on_core(int ignored) {
1176 signal(SIGSEGV, exit_on_core);
1177 newpath = realpath("/tmp", NULL);
1178 exit((newpath != NULL) ? 0 : 1);
1179 }]])],[neta_cv_REALPATH_TAKES_NULL=yes],[neta_cv_REALPATH_TAKES_NULL=no],[neta_cv_REALPATH_TAKES_NULL=cross
1184 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
1185 AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])