summaryrefslogtreecommitdiff
blob: 02d1f0ff8b1fbf94869142a1a3f85476347217bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 873d4759aa7b0581bf34e8a7ebfcbeca789ed6e1 Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flo@geekplace.eu>
Date: Tue, 16 May 2023 09:56:48 +0200
Subject: [PATCH] m4/ptyfuncs.m4 tools/configure: add linux headers for pty
 functions

To avoid implicit function declarations, which will cause an error on
modern compilers. See https://wiki.gentoo.org/wiki/Modern_C_porting

Downstream Gentoo bug: https://bugs.gentoo.org/904449

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
--- a/m4/ptyfuncs.m4
+++ b/m4/ptyfuncs.m4
@@ -19,6 +19,9 @@ AC_DEFUN([AX_CHECK_PTYFUNCS], [
             AC_LINK_IFELSE([AC_LANG_SOURCE([
 #ifdef INCLUDE_LIBUTIL_H
 #include INCLUDE_LIBUTIL_H
+#else
+#include <pty.h>
+#include <utmp.h>
 #endif
 int main(void) {
   openpty(0,0,0,0,0);
--- a/tools/configure
+++ b/tools/configure
@@ -9002,6 +9002,9 @@ See \`config.log' for more details" "$LINENO" 5; }
 
 #ifdef INCLUDE_LIBUTIL_H
 #include INCLUDE_LIBUTIL_H
+#else
+#include <pty.h>
+#include <utmp.h>
 #endif
 int main(void) {
   openpty(0,0,0,0,0);
-- 
2.39.3