* m4/getlogin.m4 (gl_LIB_GETLOGIN): New macro.
* modules/getlogin (configure.ac): Require gl_LIB_GETLOGIN.
(Link): New section.
* modules/getlogin_r (Files): Add m4/getlogin.m4.
(configure.ac): Require gl_LIB_GETLOGIN.
(Link): New section.
* NEWS: Mention the new link requirements.
* modules/getlogin-tests (test_getlogin_LDADD): New variable.
* modules/getlogin_r-tests (test_getlogin_r_LDADD): New variable.
+2016-12-17 Bruno Haible <bruno@clisp.org>
+
+ getlogin, getlogin_r: Fix link errors on MSVC.
+ * m4/getlogin.m4 (gl_LIB_GETLOGIN): New macro.
+ * modules/getlogin (configure.ac): Require gl_LIB_GETLOGIN.
+ (Link): New section.
+ * modules/getlogin_r (Files): Add m4/getlogin.m4.
+ (configure.ac): Require gl_LIB_GETLOGIN.
+ (Link): New section.
+ * NEWS: Mention the new link requirements.
+ * modules/getlogin-tests (test_getlogin_LDADD): New variable.
+ * modules/getlogin_r-tests (test_getlogin_r_LDADD): New variable.
+
2016-12-17 Bruno Haible <bruno@clisp.org>
Un-deprecate the 'progname' module.
Date Modules Changes
+2016-12-17 getlogin The link requirements of these modules are changed
+ getlogin_r from empty to $(LIB_GETLOGIN).
+
2016-12-13 dfa Remove DFA_CASE_FOLD flag. Now based on RE_ICASE.
2016-11-17 unistr/u32-strmblen The function u32_strmblen can now return -1.
-# getlogin.m4 serial 4
+# getlogin.m4 serial 5
dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
HAVE_GETLOGIN=0
fi
])
+
+dnl Determines the library needed by the implementation of the
+dnl getlogin and getlogin_r functions.
+AC_DEFUN([gl_LIB_GETLOGIN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case $host_os in
+ mingw*)
+ LIB_GETLOGIN='-ladvapi32' ;;
+ *)
+ LIB_GETLOGIN= ;;
+ esac
+ AC_SUBST([LIB_GETLOGIN])
+])
AC_LIBOBJ([getlogin])
fi
gl_UNISTD_MODULE_INDICATOR([getlogin])
+AC_REQUIRE([gl_LIB_GETLOGIN])
Makefile.am:
Include:
<unistd.h>
+Link:
+$(LIB_GETLOGIN)
+
License:
LGPLv2+
Makefile.am:
TESTS += test-getlogin
check_PROGRAMS += test-getlogin
+test_getlogin_LDADD = $(LDADD) $(LIB_GETLOGIN)
Files:
lib/getlogin_r.c
m4/getlogin_r.m4
+m4/getlogin.m4
Depends-on:
unistd
gl_PREREQ_GETLOGIN_R
fi
gl_UNISTD_MODULE_INDICATOR([getlogin_r])
+AC_REQUIRE([gl_LIB_GETLOGIN])
Makefile.am:
Include:
<unistd.h>
+Link:
+$(LIB_GETLOGIN)
+
License:
LGPLv2+
Makefile.am:
TESTS += test-getlogin_r
check_PROGRAMS += test-getlogin_r
+test_getlogin_r_LDADD = $(LDADD) $(LIB_GETLOGIN)