2 # See if we need to use our replacement for Solaris' openat et al functions.
4 dnl Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
5 dnl This file is free software; the Free Software Foundation
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
9 # Written by Jim Meyering.
11 AC_DEFUN([gl_FUNC_OPENAT],
13 AC_LIBSOURCES([openat.c, openat.h, openat-priv.h, openat-die.c, at-func.c])
14 AC_LIBSOURCES([intprops.h])
15 AC_LIBSOURCES([mkdirat.c])
16 AC_LIBSOURCES([fchmodat.c])
18 # No system provides these functions; compile them unconditionally.
22 AC_LIBOBJ([openat-die])
23 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
24 AC_CHECK_FUNCS_ONCE([lchmod])
25 AC_CHECK_FUNCS_ONCE([fdopendir])
26 AC_REPLACE_FUNCS(openat)
27 case $ac_cv_func_openat in
30 AC_DEFINE([__OPENAT_PREFIX], [[rpl_]],
31 [Define to rpl_ if the openat replacement function should be used.])
36 AC_DEFUN([gl_PREREQ_OPENAT],
38 AC_REQUIRE([gl_SAVE_CWD])