* m4/openat.m4 (gl_FUNC_OPENAT): Don't compile mkdirat
[gnulib.git] / m4 / openat.m4
1 #serial 12
2 # See if we need to use our replacement for Solaris' openat et al functions.
3
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.
8
9 # Written by Jim Meyering.
10
11 AC_DEFUN([gl_FUNC_OPENAT],
12 [
13   AC_LIBOBJ([openat-die])
14   AC_LIBOBJ([openat-proc])
15   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
16   AC_CHECK_FUNCS_ONCE([lchmod])
17   AC_CHECK_FUNCS_ONCE([fdopendir])
18   AC_REPLACE_FUNCS([fchmodat mkdirat openat])
19   case $ac_cv_func_openat+$ac_cv_func_lstat_dereferences_slashed_symlink in
20   yes+yes) ;;
21   yes+*) AC_LIBOBJ([fstatat]);;
22   *)
23     AC_DEFINE([__OPENAT_PREFIX], [[rpl_]],
24       [Define to rpl_ if the openat replacement function should be used.])
25     gl_PREREQ_OPENAT;;
26   esac
27 ])
28
29 AC_DEFUN([gl_PREREQ_OPENAT],
30 [
31   AC_REQUIRE([gl_SAVE_CWD])
32 ])