AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy)
AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo strlcpy strlcat setlinebuf dirfd pselect access pread pwrite)
AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
-#ac_neta_haveatfuncs=yes
-#AC_CHECK_FUNCS(openat renameat fstatat unlinkat, ,ac_neta_haveatfuncs=no)
-#if test x"$ac_neta_haveatfuncs" = x"yes" ; then
-# AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)
-#fi
-AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)
-AC_CHECK_FUNCS(openat renameat fstatat unlinkat, ,AC_DEFINE([_ATFILE_SOURCE], 0, AT file source))
+ac_neta_haveatfuncs=yes
+AC_CHECK_FUNCS(openat renameat fstatat unlinkat, , ac_neta_haveatfuncs=no)
+if test x"$ac_neta_haveatfuncs" = x"yes" ; then
+ AC_DEFINE([_ATFILE_SOURCE], 1, AT file source)
+ AC_DEFINE([HAVE_ATFUNCS], 1, whether at funcs are available)
+fi
AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x)
AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
AM_CONDITIONAL(USE_APPLETALK, test x$netatalk_cv_ddp_enabled = xyes)
+AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
dnl --------------------- generate files