1 dnl Kitchen sink for configuration macros
4 AC_DEFUN(AX_CHECK_DOCBOOK, [
5 # It's just rude to go over the net to build
13 [Path to Docbook XSL directory]
15 [DOCBOOK_ROOT=$withval]
18 if test -n "$DOCBOOK_ROOT" ; then
19 AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
20 if test -n "$XSLTPROC"; then
21 AC_MSG_CHECKING([whether xsltproc works])
22 DB_FILE="$DOCBOOK_ROOT/html/docbook.xsl"
23 $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
24 <?xml version="1.0" encoding='ISO-8859-1'?>
25 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
29 if test "$?" = 0; then
32 AC_MSG_RESULT($XSLTPROC_WORKS)
36 AC_MSG_CHECKING([whether to build Docbook documentation])
37 AC_MSG_RESULT($XSLTPROC_WORKS)
39 AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC_WORKS" = x"yes")
40 AC_SUBST(XSLTPROC_FLAGS)
41 AC_SUBST(DOCBOOK_ROOT)
46 AC_DEFUN([AC_NETATALK_DTRACE], [
50 [Enable dtrace probes (default: enabled if dtrace found)]
55 if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
56 AC_CHECK_PROG([atalk_cv_have_dtrace], [dtrace], [yes], [no])
57 if test "x$atalk_cv_have_dtrace" = "xno" ; then
58 if test "x$WDTRACE" = "xyes" ; then
59 AC_MSG_FAILURE([dtrace requested but not found])
67 if test x"$WDTRACE" = x"yes" ; then
68 AC_DEFINE([WITH_DTRACE], [1], [dtrace probes])
70 if test x"$this_os" = x"freebsd" ; then
75 AM_CONDITIONAL(WITH_DTRACE, test "x$WDTRACE" = "xyes")
78 dnl Check for dbus-glib, for AFP stats
79 AC_DEFUN([AC_NETATALK_DBUS_GLIB], [
85 [Enable AFP statistics via dbus (default: enabled if dbus found)]
89 if test x"$withval" != x"no" ; then
90 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1, have_dbus=yes, have_dbus=no)
91 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1, have_dbus_glib=yes, have_dbus_glib=no)
92 PKG_CHECK_MODULES(DBUS_GTHREAD, gthread-2.0, have_dbus_gthread=yes, have_dbus_gthread=no)
93 if test x$have_dbus_glib = xyes -a x$have_dbus = xyes -a x$have_dbus_gthread = xyes ; then
96 CFLAGS="$CFLAGS $DBUS_GLIB_CFLAGS"
97 LIBS="$LIBS $DBUS_GLIB_LIBS"
98 AC_CHECK_FUNC([dbus_g_bus_get_private], [atalk_cv_with_dbus=yes], [atalk_cv_with_dbus=no])
99 CFLAGS="$saved_CFLAGS"
104 if test x"$withval" = x"yes" -a x"$atalk_cv_with_dbus" = x"no"; then
105 AC_MSG_ERROR([afpstats requested but dbus-glib not found])
110 [AS_HELP_STRING([--with-dbus-sysconf-dir=PATH],[Path to dbus system bus security configuration directory (default: ${sysconfdir}/dbus-1/system.d/)])],
111 ac_cv_dbus_sysdir=$withval,
112 ac_cv_dbus_sysdir='${sysconfdir}/dbus-1/system.d'
115 if test x$atalk_cv_with_dbus = xyes ; then
116 AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if support for dbus-glib was found])
117 DBUS_SYS_DIR="$ac_cv_dbus_sysdir"
120 AC_SUBST(DBUS_SYS_DIR)
121 AC_SUBST(DBUS_CFLAGS)
123 AC_SUBST(DBUS_GLIB_CFLAGS)
124 AC_SUBST(DBUS_GLIB_LIBS)
125 AC_SUBST(DBUS_GTHREAD_CFLAGS)
126 AC_SUBST(DBUS_GTHREAD_LIBS)
127 AM_CONDITIONAL(HAVE_DBUS_GLIB, test x$atalk_cv_with_dbus = xyes)
130 dnl Whether to enable developer build
131 AC_DEFUN([AC_DEVELOPER], [
132 AC_MSG_CHECKING([whether to enable developer build])
135 AS_HELP_STRING([--enable-developer], [whether to enable developer build (ABI checking)]),
136 enable_dev=$enableval,
139 AC_MSG_RESULT([$enable_dev])
140 AM_CONDITIONAL(DEVELOPER, test x"$enable_dev" = x"yes")
143 dnl Tracker, for Spotlight
144 AC_DEFUN([AC_NETATALK_SPOTLIGHT], [
145 ac_cv_have_tracker=no
146 ac_cv_tracker_pkg_version_default=0.12
147 ac_cv_tracker_pkg_version_min=0.12
150 AC_ARG_WITH([tracker-pkgconfig-version],
151 [AS_HELP_STRING([--with-tracker-pkgconfig-version=VERSION],[Version suffix of the Tracker SPARQL and tracker-miner pkg in pkg-config (default: 0.12)])],
152 [ac_cv_tracker_pkg_version=$withval],
153 [ac_cv_tracker_pkg_version=$ac_cv_tracker_pkg_default]
156 AC_ARG_WITH([tracker-prefix],
157 [AS_HELP_STRING([--with-tracker-prefix=PATH],[Prefix of Tracker installation (default: none)])],
158 [ac_cv_tracker_prefix=$withval],
159 [ac_cv_tracker_prefix="`pkg-config --variable=prefix tracker-sparql-$ac_cv_tracker_pkg_version`"]
162 AC_ARG_VAR([PKG_CONFIG_PATH], [Path to additional pkg-config packages])
163 PKG_CHECK_MODULES([TRACKER], [tracker-sparql-$ac_cv_tracker_pkg_version >= $ac_cv_tracker_pkg_version_min], [ac_cv_have_tracker_sparql=yes], [ac_cv_have_tracker_sparql=no])
164 PKG_CHECK_MODULES([TRACKER_MINER], [tracker-miner-$ac_cv_tracker_pkg_version >= $ac_cv_tracker_pkg_version_min], [ac_cv_have_tracker_miner=yes], [ac_cv_have_tracker_miner=no])
166 if test x"$ac_cv_have_tracker_sparql" = x"no" -o x"$ac_cv_have_tracker_miner" = x"no" ; then
167 if test x"$need_tracker_sparql" = x"yes" ; then
168 AC_MSG_ERROR([$ac_cv_tracker_pkg not found])
171 AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker is available])
172 AC_DEFINE(HAVE_TRACKER_SPARQL, 1, [Define if Tracker SPARQL is available])
173 AC_DEFINE(HAVE_TRACKER_MINER, 1, [Define if Tracker miner library is available])
174 AC_DEFINE_UNQUOTED(TRACKER_PREFIX, ["$ac_cv_tracker_prefix"], [Path to Tracker])
175 AC_DEFINE([DBUS_DAEMON_PATH], ["/bin/dbus-daemon"], [Path to dbus-daemon])
176 ac_cv_tracker_type="(SPARQL)"
179 dnl Test for Tracker 0.6 on Solaris and derived platforms, and FreeBSD
180 if test x"$ac_cv_have_tracker_sparql" != x"yes" ; then
181 if test x"$this_os" = x"solaris" -o x"$this_os" = x"freebsd" ; then
182 PKG_CHECK_MODULES([TRACKER], [tracker >= 0.6], [ac_cv_have_tracker_rdf=yes], [ac_cv_have_tracker_rdf=no])
183 if test x"$ac_cv_have_tracker_rdf" = x"yes" ; then
184 AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker is available])
185 AC_DEFINE(HAVE_TRACKER_RDF, 1, [Define if Tracker 0.6 with support for RDF queries is available])
186 ac_cv_tracker_type="(RDF)"
189 AC_DEFINE([DBUS_DAEMON_PATH], ["/usr/lib/dbus-daemon"], [Path to dbus-daemon])
190 AC_DEFINE([TRACKERD_PATH], ["/bin/trackerd"], [Path to trackerd])
193 AC_DEFINE([DBUS_DAEMON_PATH], ["/usr/local/bin/dbus-daemon"], [Path to dbus-daemon])
194 AC_DEFINE([TRACKERD_PATH], ["/usr/local/libexec/trackerd"], [Path to trackerd])
201 if test x"$ac_cv_have_tracker_sparql" = x"yes" -o x"$ac_cv_have_tracker_rdf" = x"yes" ; then
202 ac_cv_have_tracker=yes
204 AC_SUBST(TRACKER_CFLAGS)
205 AC_SUBST(TRACKER_LIBS)
206 AC_SUBST(TRACKER_MINER_CFLAGS)
207 AC_SUBST(TRACKER_MINER_LIBS)
208 AM_CONDITIONAL(HAVE_TRACKER_SPARQL, [test x"$ac_cv_have_tracker_sparql" = x"yes"])
209 AM_CONDITIONAL(HAVE_TRACKER_RDF, [test x"$ac_cv_have_tracker_rdf" = x"yes"])
212 dnl Whether to disable bundled libevent
213 AC_DEFUN([AC_NETATALK_LIBEVENT], [
214 AC_MSG_CHECKING([whether to use bundled libevent])
217 [AS_HELP_STRING([--with-libevent],[whether to use the bundled libevent (default: yes)])],
218 use_bundled_libevent=$withval,
219 use_bundled_libevent=yes
223 [AS_HELP_STRING([--with-libevent-header],[path to libevent header files])],
224 [use_bundled_libevent=no; LIBEVENT_CFLAGS=-I$withval]
228 [AS_HELP_STRING([--with-libevent-lib],[path to libevent library])],
229 [use_bundled_libevent=no; LIBEVENT_LDFLAGS=-L$withval]
231 if test x"$LIBEVENT_CFLAGS" = x"-Iyes" -o x"$LIBEVENT_LDFLAGS" = x"-Lyes" ; then
232 AC_MSG_ERROR([--with-libevent requires a path])
234 AC_MSG_RESULT([$use_bundled_libevent])
235 if test x"$use_bundled_libevent" = x"yes" ; then
236 AC_CONFIG_SUBDIRS([libevent])
238 AC_SUBST(LIBEVENT_CFLAGS)
239 AC_SUBST(LIBEVENT_LDFLAGS)
240 AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
243 dnl Filesystem Hierarchy Standard (FHS) compatibility
244 AC_DEFUN([AC_NETATALK_FHS], [
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
254 mandir="/usr/share/man"
255 uams_path="${libdir}/netatalk"
256 PKGCONFDIR="${sysconfdir}"
257 SERVERTEXT="${localstatedir}/netatalk/msg"
259 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
261 atalk_cv_fhs_compat=yes
264 atalk_cv_fhs_compat=no
268 atalk_cv_fhs_compat=no
271 dnl netatalk lockfile path
272 AC_DEFUN([AC_NETATALK_LOCKFILE], [
273 AC_MSG_CHECKING([netatalk lockfile path])
276 [AS_HELP_STRING([--with-lockfile=PATH],[Path of netatalk lockfile])],
277 ac_cv_netatalk_lock=$withval,
278 ac_cv_netatalk_lock=""
280 if test -z "$ac_cv_netatalk_lock" ; then
281 ac_cv_netatalk_lock=/var/spool/locks/netatalk
282 if test x"$atalk_cv_fhs_compat" = x"yes" ; then
283 ac_cv_netatalk_lock=/var/run/netatalk.pid
287 ac_cv_netatalk_lock=/var/spool/lock/netatalk
290 ac_cv_netatalk_lock=/var/run/netatalk.pid
293 ac_cv_netatalk_lock=/var/lock/netatalk
298 AC_DEFINE_UNQUOTED(PATH_NETATALK_LOCK, ["$ac_cv_netatalk_lock"], [netatalk lockfile path])
299 AC_SUBST(PATH_NETATALK_LOCK, ["$ac_cv_netatalk_lock"])
300 AC_MSG_RESULT([$ac_cv_netatalk_lock])
303 dnl 64bit platform check
304 AC_DEFUN([AC_NETATALK_64BIT_LIBS], [
305 AC_MSG_CHECKING([whether to check for 64bit libraries])
306 # Test if the compiler is in 64bit mode
307 echo 'int i;' > conftest.$ac_ext
308 atalk_cv_cc_64bit_output=no
309 if AC_TRY_EVAL(ac_compile); then
310 case `/usr/bin/file conftest.$ac_objext` in
312 atalk_cv_cc_64bit_output=yes
318 case $host_cpu:$atalk_cv_cc_64bit_output in
319 powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
323 atalk_libname="lib/64"
331 atalk_libname="lib64"
342 dnl Check for optional admin group support
343 AC_DEFUN([AC_NETATALK_ADMIN_GROUP], [
344 netatalk_cv_admin_group=yes
345 AC_MSG_CHECKING([for administrative group support])
346 AC_ARG_ENABLE(admin-group,
347 [ --disable-admin-group disable admin group],[
348 if test x"$enableval" = x"no"; then
349 AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
350 netatalk_cv_admin_group=no
353 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
356 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
361 dnl Check for optional cracklib support
362 AC_DEFUN([AC_NETATALK_CRACKLIB], [
363 netatalk_cv_with_cracklib=no
364 AC_ARG_WITH(cracklib,
365 [ --with-cracklib[[=DICT]] enable/set location of cracklib dictionary [[no]]],[
366 if test "x$withval" != "xno" ; then
368 AC_CHECK_LIB(crack, main, [
369 AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
371 if test "$cracklib" = "yes"; then
372 cracklib="/usr/$atalk_libname/cracklib_dict"
374 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
375 [path to cracklib dictionary])
376 AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
377 netatalk_cv_with_cracklib=yes
379 AC_MSG_ERROR([cracklib not found!])
385 AC_MSG_CHECKING([for cracklib support])
386 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
389 dnl Check whether to enable debug code
390 AC_DEFUN([AC_NETATALK_DEBUG], [
391 AC_MSG_CHECKING([whether to enable verbose debug code])
393 [ --enable-debug enable verbose debug code],[
394 if test "$enableval" != "no"; then
395 if test "$enableval" = "yes"; then
396 AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
398 AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
403 AC_DEFINE(NDEBUG, 1, [Disable assertions])
407 AC_DEFINE(NDEBUG, 1, [Disable assertions])
412 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
413 AC_DEFUN([AC_NETATALK_DEBUGGING], [
414 AC_MSG_CHECKING([whether to enable debugging with debuggers])
415 AC_ARG_ENABLE(debugging,
416 [ --enable-debugging disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
417 if test "$enableval" != "no"; then
418 if test "$enableval" = "yes"; then
419 AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
421 AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
434 dnl Check for optional shadow password support
435 AC_DEFUN([AC_NETATALK_SHADOW], [
436 netatalk_cv_use_shadowpw=no
438 [ --with-shadow enable shadow password support [[auto]]],
439 [netatalk_cv_use_shadowpw="$withval"],
440 [netatalk_cv_use_shadowpw=auto]
443 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
444 AC_CHECK_HEADER([shadow.h])
445 if test x"$ac_cv_header_shadow_h" = x"yes"; then
446 netatalk_cv_use_shadowpw=yes
447 AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
449 if test "x$shadowpw" = "xyes"; then
450 AC_MSG_ERROR([shadow support not available])
452 netatalk_cv_use_shadowpw=no
457 AC_MSG_CHECKING([whether shadow support should be enabled])
458 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
465 dnl Check for optional valid-shell-check support
466 AC_DEFUN([AC_NETATALK_SHELL_CHECK], [
467 netatalk_cv_use_shellcheck=yes
468 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
469 AC_ARG_ENABLE(shell-check,
470 [ --disable-shell-check disable checking for a valid shell],[
471 if test "$enableval" = "no"; then
472 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
474 netatalk_cv_use_shellcheck=no
484 dnl Check for optional initscript install
485 AC_DEFUN([AC_NETATALK_INIT_STYLE], [
486 AC_ARG_WITH(init-style,
487 [ --with-init-style use OS specific init config [[redhat-sysv|redhat-systemd|suse-sysv|suse-systemd|gentoo|netbsd|debian|solaris|systemd]]],
488 init_style="$withval", init_style=none
490 case "$init_style" in
492 AC_MSG_ERROR([--with-init-style=redhat is obsoleted. Use redhat-sysv or redhat-systemd.])
495 AC_MSG_RESULT([enabling redhat-style sysv initscript support])
496 ac_cv_init_dir="/etc/rc.d/init.d"
499 AC_MSG_RESULT([enabling redhat-style systemd support])
500 ac_cv_init_dir="/lib/systemd/system"
503 AC_MSG_ERROR([--with-init-style=suse is obsoleted. Use suse-sysv or suse-systemd.])
506 AC_MSG_RESULT([enabling suse-style sysv initscript support])
507 ac_cv_init_dir="/etc/init.d"
510 AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
511 ac_cv_init_dir="/lib/systemd/system"
514 AC_MSG_RESULT([enabling gentoo-style initscript support])
515 ac_cv_init_dir="/etc/init.d"
518 AC_MSG_RESULT([enabling netbsd-style initscript support])
519 ac_cv_init_dir="/etc/rc.d"
522 AC_MSG_RESULT([enabling debian-style initscript support])
523 ac_cv_init_dir="/etc/init.d"
526 AC_MSG_RESULT([enabling solaris-style SMF support])
527 ac_cv_init_dir="/lib/svc/manifest/network/"
530 AC_MSG_RESULT([enabling general systemd support])
531 ac_cv_init_dir="/lib/systemd/system"
534 AC_MSG_RESULT([disabling init-style support])
535 ac_cv_init_dir="none"
538 AC_MSG_ERROR([illegal init-style])
541 AM_CONDITIONAL(USE_NETBSD, test x$init_style = xnetbsd)
542 AM_CONDITIONAL(USE_REDHAT_SYSV, test x$init_style = xredhat-sysv)
543 AM_CONDITIONAL(USE_SUSE_SYSV, test x$init_style = xsuse-sysv)
544 AM_CONDITIONAL(USE_SOLARIS, test x$init_style = xsolaris)
545 AM_CONDITIONAL(USE_GENTOO, test x$init_style = xgentoo)
546 AM_CONDITIONAL(USE_DEBIAN, test x$init_style = xdebian)
547 AM_CONDITIONAL(USE_SYSTEMD, test x$init_style = xsystemd || test x$init_style = xredhat-systemd || test x$init_style = xsuse-systemd)
548 AM_CONDITIONAL(USE_UNDEF, test x$init_style = xnone)
550 AC_ARG_WITH(init-dir,
551 [ --with-init-dir=PATH path to OS specific init directory],
552 ac_cv_init_dir="$withval", ac_cv_init_dir="$ac_cv_init_dir"
554 INIT_DIR="$ac_cv_init_dir"
555 AC_SUBST(INIT_DIR, ["$ac_cv_init_dir"])
558 dnl OS specific configuration
559 AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
561 *aix*) this_os=aix ;;
562 *freebsd*) this_os=freebsd ;;
563 *hpux11*) this_os=hpux11 ;;
564 *irix*) this_os=irix ;;
565 *linux*) this_os=linux ;;
566 *osx*) this_os=macosx ;;
567 *darwin*) this_os=macosx ;;
568 *netbsd*) this_os=netbsd ;;
569 *openbsd*) this_os=openbsd ;;
570 *osf*) this_os=tru64 ;;
571 *solaris*) this_os=solaris ;;
575 i386|i486|i586|i686|k7) this_cpu=x86 ;;
576 alpha) this_cpu=alpha ;;
577 mips) this_cpu=mips ;;
578 powerpc|ppc) this_cpu=ppc ;;
581 dnl --------------------- GNU source
583 linux) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
585 kfreebsd-gnu) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
589 dnl --------------------- operating system specific flags (port from sys/*)
591 dnl ----- FreeBSD specific -----
592 if test x"$this_os" = "xfreebsd"; then
593 AC_MSG_RESULT([ * FreeBSD specific configuration])
594 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
595 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
596 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
599 dnl ----- GNU/kFreeBSD specific -----
600 if test x"$this_os" = "xkfreebsd-gnu"; then
601 AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration])
602 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
603 AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
604 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
607 dnl ----- Linux specific -----
608 if test x"$this_os" = "xlinux"; then
609 AC_MSG_RESULT([ * Linux specific configuration])
610 AC_DEFINE(LINUX, 1, [OS is Linux])
611 dnl ----- check if we need the quotactl wrapper
612 AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
613 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
614 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
618 dnl ----- as far as I can tell, dbtob always does the wrong thing
619 dnl ----- on every single version of linux I've ever played with.
620 dnl ----- see etc/afpd/quota.c
621 AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
626 dnl ----- NetBSD specific -----
627 if test x"$this_os" = "xnetbsd"; then
628 AC_MSG_RESULT([ * NetBSD specific configuration])
629 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
630 AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
631 AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
633 CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
636 dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
637 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
640 dnl ----- OpenBSD specific -----
641 if test x"$this_os" = "xopenbsd"; then
642 AC_MSG_RESULT([ * OpenBSD specific configuration])
643 AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
644 dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
645 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
648 dnl ----- Solaris specific -----
649 if test x"$this_os" = "xsolaris"; then
650 AC_MSG_RESULT([ * Solaris specific configuration])
651 AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
652 AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
653 AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
654 AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
655 AC_DEFINE(_XOPEN_SOURCE, 600, [Solaris compilation environment])
656 AC_DEFINE(__EXTENSIONS__, 1, [Solaris compilation environment])
657 CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
662 AC_MSG_CHECKING([if we can build Solaris kernel module])
663 if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
666 AC_MSG_RESULT([$solaris_module])
668 COMPILE_64BIT_KMODULE=no
671 COMPILE_KERNEL_GCC=no
673 if test "$solaris_module" = "yes"; then
674 dnl Solaris kernel module stuff
675 AC_MSG_CHECKING([if we have to build a 64bit kernel module])
677 # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)
678 if test -x /usr/bin/isainfo; then
679 # check for 64 bit platform
680 if isainfo -kv | grep '^64-bit'; then
681 COMPILE_64BIT_KMODULE=yes
685 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
687 if test "${GCC}" = yes; then
688 COMPILE_KERNEL_GCC=yes
689 if test "$COMPILE_64BIT_KMODULE" = yes; then
691 AC_MSG_CHECKING([if we can build a 64bit kernel module])
693 case `$CC --version 2>/dev/null` in
695 COMPILE_64BIT_KMODULE=no
696 COMPILE_KERNEL_GCC=no
701 #KLDFLAGS="-melf64_sparc"
705 AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
711 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
713 if test "$COMPILE_64BIT_KMODULE" = yes; then
714 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
715 KCFLAGS="-xarch=v9 -xregs=no%appl"
721 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
724 AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
725 AC_LINK_IFELSE([AC_LANG_PROGRAM([[\
726 #include <sys/stream.h>
727 #include <sys/ddi.h>]], [[\
729 ]])],[netatalk_cv_HAVE_TIMEOUT_ID_T=yes],[netatalk_cv_HAVE_TIMEOUT_ID_T=no])])
731 AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
734 AC_SUBST(COMPILE_KERNEL_GCC)
735 AC_SUBST(COMPILE_64BIT_KMODULE)
740 dnl Whether to run ldconfig after installing libraries
741 AC_PATH_PROG(NETA_LDCONFIG, ldconfig, , [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/bin])
742 echo NETA_LDCONFIG = $NETA_LDCONFIG
743 AM_CONDITIONAL(RUN_LDCONFIG, test x"$this_os" = x"linux" -a x"$NETA_LDCONFIG" != x"")
746 dnl Check for building PGP UAM module
747 AC_DEFUN([AC_NETATALK_PGP_UAM], [
748 AC_MSG_CHECKING([whether the PGP UAM should be build])
749 AC_ARG_ENABLE(pgp-uam,
750 [ --enable-pgp-uam enable build of PGP UAM module],[
751 if test "$enableval" = "yes"; then
752 if test "x$neta_cv_have_openssl" = "xyes"; then
753 AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
766 dnl Check for building Kerberos V UAM module
767 AC_DEFUN([AC_NETATALK_KRB5_UAM], [
768 netatalk_cv_build_krb5_uam=no
769 AC_ARG_ENABLE(krbV-uam,
770 [ --enable-krbV-uam enable build of Kerberos V UAM module],
772 if test x"$enableval" = x"yes"; then
773 NETATALK_GSSAPI_CHECK([
774 netatalk_cv_build_krb5_uam=yes
776 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
783 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
784 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
789 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
792 dnl Check if we can directly use Kerberos 5 API, used for reading keytabs
793 dnl and automatically construction DirectoryService names from that, instead
794 dnl of requiring special configuration in afp.conf
795 AC_DEFUN([AC_NETATALK_KERBEROS], [
796 AC_MSG_CHECKING([for Kerberos 5 (necessary for GetSrvrInfo:DirectoryNames support)])
797 AC_ARG_WITH([kerberos],
798 [AS_HELP_STRING([--with-kerberos], [Kerberos 5 support (default=auto)])],
800 [with_kerberos=auto])
801 AC_MSG_RESULT($with_kerberos)
803 if test x"$with_kerberos" != x"no"; then
804 have_krb5_header="no"
805 AC_CHECK_HEADERS([krb5/krb5.h krb5.h], [have_krb5_header="yes"; break])
806 if test x"$have_krb5_header" = x"no" && test x"$with_kerberos" != x"auto"; then
807 AC_MSG_FAILURE([--with-kerberos was given, but no headers found])
810 AC_PATH_PROG([KRB5_CONFIG], [krb5-config])
811 AC_MSG_CHECKING([for krb5-config])
812 if test -x "$KRB5_CONFIG"; then
813 AC_MSG_RESULT([$KRB5_CONFIG])
814 KRB5_CFLAGS="`$KRB5_CONFIG --cflags krb5`"
815 KRB5_LIBS="`$KRB5_CONFIG --libs krb5`"
816 AC_SUBST(KRB5_CFLAGS)
820 AC_MSG_RESULT([not found])
821 if test x"$with_kerberos" != x"auto"; then
822 AC_MSG_FAILURE([--with-kerberos was given, but krb5-config could not be found])
827 if test x"$with_kerberos" = x"yes"; then
828 AC_DEFINE([HAVE_KERBEROS], [1], [Define if Kerberos 5 is available])
831 dnl Check for krb5_free_unparsed_name and krb5_free_error_message
832 save_CFLAGS="$CFLAGS"
834 CFLAGS="$KRB5_CFLAGS"
836 AC_CHECK_FUNCS([krb5_free_unparsed_name krb5_free_error_message krb5_free_keytab_entry_contents krb5_kt_free_entry])
837 CFLAGS="$save_CFLAGS"
841 dnl Check for overwrite the config files or not
842 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
843 AC_MSG_CHECKING([whether configuration files should be overwritten])
844 AC_ARG_ENABLE(overwrite,
845 [ --enable-overwrite overwrite configuration files during installation],
846 [OVERWRITE_CONFIG="${enable_overwrite}"],
847 [OVERWRITE_CONFIG="no"]
849 AC_MSG_RESULT([$OVERWRITE_CONFIG])
850 AC_SUBST(OVERWRITE_CONFIG)
853 dnl Check for LDAP support, for client-side ACL visibility
854 AC_DEFUN([AC_NETATALK_LDAP], [
855 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
857 [AS_HELP_STRING([--with-ldap],
858 [LDAP support (default=auto)])],
859 netatalk_cv_ldap=$withval,
860 netatalk_cv_ldap=auto
862 AC_MSG_RESULT($netatalk_cv_ldap)
864 save_CFLAGS="$CFLAGS"
865 save_LDFLAGS="$LDFLAGS"
874 if test x"$netatalk_cv_ldap" != x"no" ; then
875 if test x"$netatalk_cv_ldap" != x"yes" -a x"$netatalk_cv_ldap" != x"auto"; then
876 CFLAGS="-I$netatalk_cv_ldap/include"
877 LDFLAGS="-L$netatalk_cv_ldap/lib"
879 AC_CHECK_HEADER([ldap.h], netatalk_cv_ldap=yes,
880 [ if test x"$netatalk_cv_ldap" = x"yes" ; then
881 AC_MSG_ERROR([Missing LDAP headers])
885 AC_CHECK_LIB(ldap, ldap_init, netatalk_cv_ldap=yes,
886 [ if test x"$netatalk_cv_ldap" = x"yes" ; then
887 AC_MSG_ERROR([Missing LDAP library])
893 if test x"$netatalk_cv_ldap" = x"yes"; then
894 LDAP_CFLAGS="$CFLAGS"
895 LDAP_LDFLAGS="$LDFLAGS"
897 AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
900 AC_SUBST(LDAP_CFLAGS)
901 AC_SUBST(LDAP_LDFLAGS)
903 CFLAGS="$save_CFLAGS"
904 LDFLAGS="$save_LDFLAGS"
908 dnl Check for ACL support
909 AC_DEFUN([AC_NETATALK_ACL], [
910 AC_MSG_CHECKING(whether to support ACLs)
912 [AS_HELP_STRING([--with-acls],
913 [Include ACL support (default=auto)])],
916 with_acl_support="$withval"
919 with_acl_support=auto
922 [with_acl_support=auto])
923 AC_MSG_RESULT($with_acl_support)
925 if test x"$with_acl_support" = x"no"; then
926 AC_MSG_RESULT(Disabling ACL support)
927 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
932 if test x"$with_acl_support" = x"yes" ; then
933 AC_MSG_NOTICE(checking whether ACL support is available:)
936 AC_MSG_NOTICE(Using UnixWare ACLs)
937 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
940 AC_MSG_NOTICE(Using solaris ACLs)
941 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
942 ACL_LIBS="$ACL_LIBS -lsec"
945 AC_MSG_NOTICE(Using HPUX ACLs)
946 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
949 AC_MSG_NOTICE(Using IRIX ACLs)
950 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
953 AC_MSG_NOTICE(Using AIX ACLs)
954 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
957 AC_MSG_NOTICE(Using Tru64 ACLs)
958 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
959 ACL_LIBS="$ACL_LIBS -lpacl"
962 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
963 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
966 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
969 AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
972 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
974 LIBS="$LIBS $ACL_LIBS"
975 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
976 #include <sys/types.h>
981 acl_entry_t *entry_p;
982 return acl_get_entry(acl, entry_id, entry_p);
983 ]])],[netatalk_cv_HAVE_POSIX_ACLS=yes],[netatalk_cv_HAVE_POSIX_ACLS=no
984 with_acl_support=no])
987 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
988 AC_MSG_NOTICE(Using POSIX ACLs)
989 AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
990 AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
992 LIBS="$LIBS $ACL_LIBS"
993 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
994 #include <sys/types.h>
997 acl_permset_t permset_d;
999 return acl_get_perm_np(permset_d, perm);
1000 ]])],[netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],[netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
1003 if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
1004 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
1008 AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
1010 LIBS="$LIBS $ACL_LIBS"
1011 AC_CHECK_FUNCS(acl_from_mode,
1012 [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
1013 [netatalk_cv_HAVE_ACL_FROM_MODE=no])
1016 if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
1017 AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
1021 AC_MSG_NOTICE(ACL support is not avaliable)
1022 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
1028 if test x"$with_acl_support" = x"yes" ; then
1029 AC_CHECK_HEADERS([acl/libacl.h])
1030 AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
1035 dnl Check for Extended Attributes support
1036 AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
1038 neta_cv_eas_sys_found=no
1039 neta_cv_eas_sys_not_found=no
1041 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
1046 AC_SEARCH_LIBS(getproplist, [proplist])
1047 AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
1048 [neta_cv_eas_sys_found=yes],
1049 [neta_cv_eas_sys_not_found=yes])
1050 AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
1051 [neta_cv_eas_sys_not_found=yes])
1052 AC_CHECK_FUNCS([sizeof_proplist_entry],,
1053 [neta_cv_eas_sys_not_found=yes])
1057 AC_CHECK_FUNCS([attropen],
1058 [neta_cv_eas_sys_found=yes; AC_DEFINE(HAVE_EAFD, 1, [extattr API has full fledged fds for EAs])],
1059 [neta_cv_eas_sys_not_found=yes])
1063 AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
1064 [neta_cv_eas_sys_found=yes],
1065 [neta_cv_eas_sys_not_found=yes])
1066 AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
1067 [neta_cv_eas_sys_not_found=yes])
1068 AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
1069 [neta_cv_eas_sys_not_found=yes])
1070 AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
1071 [neta_cv_eas_sys_not_found=yes])
1074 *freebsd4* | *dragonfly* )
1075 AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
1079 AC_SEARCH_LIBS(getxattr, [attr])
1081 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1082 AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
1083 [neta_cv_eas_sys_found=yes],
1084 [neta_cv_eas_sys_not_found=yes])
1085 AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
1086 [neta_cv_eas_sys_not_found=yes])
1087 AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
1088 [neta_cv_eas_sys_not_found=yes])
1091 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1092 AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
1093 [neta_cv_eas_sys_found=yes],
1094 [neta_cv_eas_sys_not_found=yes])
1095 AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
1096 [neta_cv_eas_sys_not_found=yes])
1099 if test "x$neta_cv_eas_sys_found" != "xyes" ; then
1100 AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
1101 [neta_cv_eas_sys_not_found=yes])
1102 AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
1103 [neta_cv_eas_sys_not_found=yes])
1108 # Do xattr functions take additional options like on Darwin?
1109 if test x"$ac_cv_func_getxattr" = x"yes" ; then
1110 AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
1112 LIBS="$LIBS $ACL_LIBS"
1113 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1114 #include <sys/types.h>
1115 #if HAVE_ATTR_XATTR_H
1116 #include <attr/xattr.h>
1117 #elif HAVE_SYS_XATTR_H
1118 #include <sys/xattr.h>
1121 getxattr(0, 0, 0, 0, 0, 0);
1122 ]])],[smb_attr_cv_xattr_add_opt=yes],[smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
1124 if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
1125 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
1129 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
1130 if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
1131 neta_cv_eas="$neta_cv_eas | sys"
1134 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
1137 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
1138 dnl Defines "neta_cv_have_smbshmd" to "yes" or "no"
1139 dnl AC_SUBST's "SMB_SHAREMODES_CFLAGS" and "SMB_SHAREMODES_LDFLAGS"
1140 dnl AM_CONDITIONAL's "USE_SMB_SHAREMODES"
1141 AC_DEFUN([AC_NETATALK_SMB_SHAREMODES], [
1142 neta_cv_have_smbshmd=no
1143 AC_ARG_WITH(smbsharemodes-lib,
1144 [ --with-smbsharemodes-lib=PATH PATH to libsmbsharemodes lib from Samba],
1145 [SMB_SHAREMODES_LDFLAGS="-L$withval -lsmbsharemodes"]
1147 AC_ARG_WITH(smbsharemodes-include,
1148 [ --with-smbsharemodes-include=PATH PATH to libsmbsharemodes header from Samba],
1149 [SMB_SHAREMODES_CFLAGS="-I$withval"]
1151 AC_ARG_WITH(smbsharemodes,
1152 [AS_HELP_STRING([--with-smbsharemodes],[Samba interop (default is yes)])],
1153 [use_smbsharemodes=$withval],
1154 [use_smbsharemodes=yes]
1157 if test x"$use_smbsharemodes" = x"yes" ; then
1158 AC_MSG_CHECKING([whether to enable Samba/Netatalk access/deny/share-modes interop])
1160 saved_CFLAGS="$CFLAGS"
1161 saved_LDFLAGS="$LDFLAGS"
1162 CFLAGS="$SMB_SHAREMODES_CFLAGS $CFLAGS"
1163 LDFLAGS="$SMB_SHAREMODES_LDFLAGS $LDFLAGS"
1166 [#include <unistd.h>
1168 #include <sys/time.h>
1171 /* From messages.h */
1175 #include "smb_share_modes.h"
1176 int main(void) { (void)smb_share_mode_db_open(""); return 0;}],
1177 [neta_cv_have_smbshmd=yes]
1180 AC_MSG_RESULT($neta_cv_have_smbshmd)
1181 AC_SUBST(SMB_SHAREMODES_CFLAGS, [$SMB_SHAREMODES_CFLAGS])
1182 AC_SUBST(SMB_SHAREMODES_LDFLAGS, [$SMB_SHAREMODES_LDFLAGS])
1183 CFLAGS="$saved_CFLAGS"
1184 LDFLAGS="$saved_LDFLAGS"
1187 AM_CONDITIONAL(USE_SMB_SHAREMODES, test x"$neta_cv_have_smbshmd" = x"yes")
1190 dnl ------ Check for sendfile() --------
1191 AC_DEFUN([AC_NETATALK_SENDFILE], [
1192 netatalk_cv_search_sendfile=yes
1193 AC_ARG_ENABLE(sendfile,
1194 [ --disable-sendfile disable sendfile syscall],
1195 [if test x"$enableval" = x"no"; then
1196 netatalk_cv_search_sendfile=no
1200 if test x"$netatalk_cv_search_sendfile" = x"yes"; then
1203 AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
1204 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
1208 AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()])
1209 AC_SEARCH_LIBS(sendfile, sendfile)
1210 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
1211 AC_CHECK_FUNCS([sendfilev])
1215 AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
1216 AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
1224 if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
1225 AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
1230 dnl --------------------- Check if realpath() takes NULL
1231 AC_DEFUN([AC_NETATALK_REALPATH], [
1232 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
1233 neta_cv_REALPATH_TAKES_NULL, [
1234 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1239 void exit_on_core(int ignored) {
1245 signal(SIGSEGV, exit_on_core);
1246 newpath = realpath("/tmp", NULL);
1247 exit((newpath != NULL) ? 0 : 1);
1248 }]])],[neta_cv_REALPATH_TAKES_NULL=yes],[neta_cv_REALPATH_TAKES_NULL=no],[neta_cv_REALPATH_TAKES_NULL=cross
1253 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
1254 AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])