summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-04-05 21:37:39 +0200
committerBruno Haible <bruno@clisp.org>2023-04-08 13:03:52 +0200
commitfd359b259bd3bc9d04dd8b993e24de024311a5c4 (patch)
tree0e8d0e506655409811b80dff410e5d3c5edd3dd9
parentbb21bd7c3fca3de45442cdaec9ae98bc49dc593b (diff)
downloadgnulib-fd359b259bd3bc9d04dd8b993e24de024311a5c4.tar.gz
forkpty, openpty, login_tty: Fix link errors of the tests.
* m4/pty.m4 (gl_PTY_LIB): On Haiku, set PTY_LIB to '-lbsd'.
-rw-r--r--ChangeLog5
-rw-r--r--m4/pty.m431
2 files changed, 24 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 79ef565d19..dc116bb2a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2023-04-05 Bruno Haible <bruno@clisp.org>
+ forkpty, openpty, login_tty: Fix link errors of the tests.
+ * m4/pty.m4 (gl_PTY_LIB): On Haiku, set PTY_LIB to '-lbsd'.
+
+2023-04-05 Bruno Haible <bruno@clisp.org>
+
strerrorname_np: Fix compilation error on Haiku.
* lib/strerrorname_np.c (strerrorname_np): Avoid conflict between
EDOOFUS and EINVAL.
diff --git a/m4/pty.m4 b/m4/pty.m4
index 885b76b453..0aed35c377 100644
--- a/m4/pty.m4
+++ b/m4/pty.m4
@@ -1,5 +1,5 @@
-# pty.m4 serial 14
-dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+# pty.m4 serial 14.1
+dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,14 +9,21 @@ dnl with or without modifications, as long as this notice is preserved.
# Define automake variable PTY_LIB to the library needed (if any).
AC_DEFUN([gl_PTY_LIB],
[
+ AC_REQUIRE([AC_CANONICAL_HOST])
# Check for the library required for forkpty.
PTY_LIB=
- save_LIBS="$LIBS"
- AC_SEARCH_LIBS([forkpty], [util],
- [if test "$ac_cv_search_forkpty" != "none required"; then
- PTY_LIB="$ac_cv_search_forkpty"
- fi])
- LIBS="$save_LIBS"
+ case "$host_os" in
+ haiku*) PTY_LIB='-lbsd' ;;
+ *)
+ save_LIBS="$LIBS"
+ AC_SEARCH_LIBS([forkpty], [util],
+ [if test "$ac_cv_search_forkpty" != "none required"; then
+ PTY_LIB="$ac_cv_search_forkpty"
+ fi
+ ])
+ LIBS="$save_LIBS"
+ ;;
+ esac
AC_SUBST([PTY_LIB])
])
@@ -25,8 +32,8 @@ AC_DEFUN([gl_FUNC_FORKPTY],
AC_REQUIRE([gl_PTY_LIB])
AC_REQUIRE([gl_PTY_H])
- dnl We assume that forkpty exists (possibly in libc, possibly in libutil)
- dnl if and only if it is declared.
+ dnl We assume that forkpty exists (possibly in libc, possibly in libutil or
+ dnl libbsd) if and only if it is declared.
AC_CHECK_DECLS([forkpty],,, [[
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
#include <sys/types.h>
@@ -90,8 +97,8 @@ AC_DEFUN([gl_FUNC_OPENPTY],
dnl Persuade Solaris <stdlib.h> to declare posix_openpt().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- dnl We assume that openpty exists (possibly in libc, possibly in libutil)
- dnl if and only if it is declared.
+ dnl We assume that openpty exists (possibly in libc, possibly in libutil or
+ dnl libbsd) if and only if it is declared.
AC_CHECK_DECLS([openpty],,, [[
/* <sys/types.h> is a prerequisite of <libutil.h> on FreeBSD 8.0. */
#include <sys/types.h>