login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
authorBruno Haible <bruno@clisp.org>
Fri, 17 Sep 2010 02:09:33 +0000 (04:09 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 17 Sep 2010 02:09:33 +0000 (04:09 +0200)
* m4/pty.m4 (gl_FUNC_LOGIN_TTY): Augment LIBS while checking whether
login_tty exists.
Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.

ChangeLog
m4/pty.m4

index e9a60cd..63524d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-09-16  Bruno Haible  <bruno@clisp.org>
 
+       login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
+       * m4/pty.m4 (gl_FUNC_LOGIN_TTY): Augment LIBS while checking whether
+       login_tty exists.
+       Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.
+
+2010-09-16  Bruno Haible  <bruno@clisp.org>
+
        login_tty: Make the replacement code work on BSD systems.
        * lib/login_tty.c: Include <sys/ioctl.h>.
        (login_tty): Use ioctl TIOCSCTTY when available.
index 7fc91ca..d2966bc 100644 (file)
--- a/m4/pty.m4
+++ b/m4/pty.m4
@@ -1,4 +1,4 @@
-# pty.m4 serial 8
+# pty.m4 serial 9
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -142,7 +142,10 @@ AC_DEFUN([gl_FUNC_LOGIN_TTY],
 [
   AC_REQUIRE([gl_PTY_LIB])
 
-  AC_CHECK_FUNCS_ONCE([login_tty])
+  gl_saved_libs="$LIBS"
+  LIBS="$LIBS $PTY_LIB"
+  AC_CHECK_FUNCS([login_tty])
+  LIBS="$gl_saved_LIBS"
   if test $ac_cv_func_login_tty = no; then
     AC_LIBOBJ([login_tty])
   fi