xref: /netbsd/external/gpl2/xcvs/dist/m4/getlogin_r.m4 (revision 6550d01e)
1#serial 1
2
3# Copyright (C) 2005 Free Software Foundation, Inc.
4#
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9dnl From Derek Price
10dnl
11dnl Provide getlogin_r when the system lacks it.
12dnl
13
14AC_DEFUN([gl_GETLOGIN_R_SUBSTITUTE],
15[
16  gl_PREREQ_GETLOGIN_R
17  AC_LIBSOURCE([getlogin_r.h])
18  AC_LIBOBJ([getlogin_r])
19])
20
21AC_DEFUN([gl_GETLOGIN_R],
22[
23  AC_REPLACE_FUNCS([getlogin_r])
24  if test $ac_cv_func_getlogin_r = no; then
25    gl_GETLOGIN_R_SUBSTITUTE
26  fi
27])
28
29AC_DEFUN([gl_PREREQ_GETLOGIN_R],
30[
31  AC_CHECK_HEADERS_ONCE([unistd.h])
32  AC_CHECK_DECLS_ONCE([getlogin getlogin_r])
33])
34