3 dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl This file is offered as-is, without any warranty.
9 AC_DEFUN([gl_FUNC_GETLOGIN],
11 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
12 AC_CHECK_DECLS_ONCE([getlogin])
13 if test $ac_cv_have_decl_getlogin = no; then
16 AC_CHECK_FUNCS_ONCE([getlogin])
17 if test $ac_cv_func_getlogin = no; then
22 dnl Determines the library needed by the implementation of the
23 dnl getlogin and getlogin_r functions.
24 AC_DEFUN([gl_LIB_GETLOGIN],
26 AC_REQUIRE([AC_CANONICAL_HOST])
29 GETLOGIN_LIB='-ladvapi32' ;;
33 AC_SUBST([GETLOGIN_LIB])
34 dnl For backward compatibility.
35 LIB_GETLOGIN="$GETLOGIN_LIB"
36 AC_SUBST([LIB_GETLOGIN])