Blame m4/getlogin.m4

Packit 8f70b4
# getlogin.m4 serial 5
Packit 8f70b4
dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
Packit 8f70b4
dnl This file is free software; the Free Software Foundation
Packit 8f70b4
dnl gives unlimited permission to copy and/or distribute it,
Packit 8f70b4
dnl with or without modifications, as long as this notice is preserved.
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_FUNC_GETLOGIN],
Packit 8f70b4
[
Packit 8f70b4
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
Packit 8f70b4
  AC_CHECK_DECLS_ONCE([getlogin])
Packit 8f70b4
  if test $ac_cv_have_decl_getlogin = no; then
Packit 8f70b4
    HAVE_DECL_GETLOGIN=0
Packit 8f70b4
  fi
Packit 8f70b4
  AC_CHECK_FUNCS_ONCE([getlogin])
Packit 8f70b4
  if test $ac_cv_func_getlogin = no; then
Packit 8f70b4
    HAVE_GETLOGIN=0
Packit 8f70b4
  fi
Packit 8f70b4
])
Packit 8f70b4
Packit 8f70b4
dnl Determines the library needed by the implementation of the
Packit 8f70b4
dnl getlogin and getlogin_r functions.
Packit 8f70b4
AC_DEFUN([gl_LIB_GETLOGIN],
Packit 8f70b4
[
Packit 8f70b4
  AC_REQUIRE([AC_CANONICAL_HOST])
Packit 8f70b4
  case $host_os in
Packit 8f70b4
    mingw*)
Packit 8f70b4
      LIB_GETLOGIN='-ladvapi32' ;;
Packit 8f70b4
    *)
Packit 8f70b4
      LIB_GETLOGIN= ;;
Packit 8f70b4
  esac
Packit 8f70b4
  AC_SUBST([LIB_GETLOGIN])
Packit 8f70b4
])