* modules/openat (Files): Add lib/openat-die.c.
[gnulib.git] / m4 / openat.m4
1 #serial 4
2 # See if we need to use our replacement for Solaris' openat function.
3
4 dnl Copyright (C) 2004, 2005 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_LIBSOURCES([openat.c, openat.h, openat-die.c])
14   AC_LIBOBJ([openat-die])
15   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
16   AC_REPLACE_FUNCS(openat)
17   case $ac_cv_func_openat in
18   yes) ;;
19   *)
20     AC_DEFINE([__OPENAT_PREFIX], [[rpl_]],
21       [Define to rpl_ if the openat replacement function should be used.])
22     gl_PREREQ_OPENAT;;
23   esac
24 ])
25
26 AC_DEFUN([gl_PREREQ_OPENAT],
27 [
28   AC_REQUIRE([gl_SAVE_CWD])
29 ])