summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/screen/screen/0001-configure-Add-needed-system-headers-in-checks.patch
blob: 80659942c73916f4bb5ae4f343511bbc2d18f6b1 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
From 4e102de2e6204c1d8e8be00bb5ffd4587e70350c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 15 Aug 2022 10:35:53 -0700
Subject: [PATCH] configure: Add needed system headers in checks

Newer compilers throw warnings when a funciton is used with implicit
declaration and enabling -Werror can silently fail these tests and
result in wrong configure results. Therefore add the needed headers in
the AC_TRY_LINK macros

	* configure.ac: Add missing system headers in AC_TRY_LINK.

Upstream-Status: Submitted [https://lists.gnu.org/archive/html/screen-devel/2022-08/msg00000.html]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 configure.ac | 57 +++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 43 insertions(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index c0f02df..d308079 100644
--- a/configure.ac
+++ b/configure.ac
@@ -233,6 +233,7 @@ AC_CHECKING(BSD job jontrol)
 AC_TRY_LINK(
 [#include <sys/types.h>
 #include <sys/ioctl.h>
+#include <unistd.h>
 ], [
 #ifdef POSIX
 tcsetpgrp(0, 0);
@@ -250,12 +251,16 @@ dnl
 dnl    ****  setresuid(), setreuid(), seteuid()  ****
 dnl
 AC_CHECKING(setresuid)
-AC_TRY_LINK(,[
-setresuid(0, 0, 0);
+AC_TRY_LINK([
+#include <unistd.h>
+],[
+return setresuid(0, 0, 0);
 ], AC_DEFINE(HAVE_SETRESUID))
 AC_CHECKING(setreuid)
-AC_TRY_LINK(,[
-setreuid(0, 0);
+AC_TRY_LINK([
+#include <unistd.h>
+],[
+return setreuid(0, 0);
 ], AC_DEFINE(HAVE_SETREUID))
 dnl
 dnl seteuid() check:
@@ -274,7 +279,9 @@ seteuid(0);
 
 dnl execvpe
 AC_CHECKING(execvpe)
-AC_TRY_LINK(,[
+AC_TRY_LINK([
+    #include <unistd.h>
+],[
     execvpe(0, 0, 0);
 ], AC_DEFINE(HAVE_EXECVPE)
 CFLAGS="$CFLAGS -D_GNU_SOURCE")
@@ -284,10 +291,18 @@ dnl    ****  select()  ****
 dnl
 
 AC_CHECKING(select)
-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, 
+AC_TRY_LINK([
+    #include <sys/select.h>
+],[
+    select(0, 0, 0, 0, 0);
+],, 
 LIBS="$LIBS -lnet -lnsl"
 AC_CHECKING(select with $LIBS)
-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, 
+AC_TRY_LINK([
+    #include <sys/select.h>
+],[
+    select(0, 0, 0, 0, 0);
+],, 
 AC_MSG_ERROR(!!! no select - no screen))
 )
 dnl
@@ -624,11 +639,19 @@ dnl
 dnl    ****  termcap or terminfo  ****
 dnl
 AC_CHECKING(for tgetent)
-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
+AC_TRY_LINK([
+    #include <curses.h>
+    #include <term.h>
+],[
+    tgetent((char *)0, (char *)0);
+],,
 olibs="$LIBS"
 LIBS="-lcurses $olibs"
 AC_CHECKING(libcurses)
-AC_TRY_LINK(,[
+AC_TRY_LINK([
+    #include <curses.h>
+    #include <term.h>
+],[
 #ifdef __hpux
 __sorry_hpux_libcurses_is_totally_broken_in_10_10();
 #else
@@ -871,7 +894,7 @@ test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
 fi
 
 AC_CHECKING(getloadavg)
-AC_TRY_LINK(,[getloadavg((double *)0, 0);],
+AC_TRY_LINK([#include <stdlib.h>],[getloadavg((double *)0, 0);],
 AC_DEFINE(LOADAV_GETLOADAVG) load=1,
 if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
 olibs="$LIBS"
@@ -1109,10 +1132,10 @@ AC_CHECKING(IRIX sun library)
 AC_TRY_LINK(,,,LIBS="$oldlibs")
 
 AC_CHECKING(syslog)
-AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS"
+AC_TRY_LINK([#include <syslog.h>],[closelog();], , [oldlibs="$LIBS"
 LIBS="$LIBS -lbsd"
 AC_CHECKING(syslog in libbsd.a)
-AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
+AC_TRY_LINK([#include <syslog.h>], [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
 AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])])
 
 AC_EGREP_CPP(YES_IS_DEFINED,
@@ -1149,7 +1172,7 @@ AC_CHECKING(getspnam)
 AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
 
 AC_CHECKING(getttyent)
-AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
+AC_TRY_LINK([#include <ttyent.h>],[getttyent();], AC_DEFINE(GETTTYENT))
 
 AC_CHECKING(fdwalk)
 AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
@@ -1204,7 +1227,13 @@ main() {
 AC_SYS_LONG_FILE_NAMES
 
 AC_MSG_CHECKING(for vsprintf)
-AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
+AC_TRY_LINK([
+    #include <stdarg.h>
+    #include <stdio.h>
+],[
+   va_list valist;
+   vsprintf(0,0,valist);
+], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
 
 AC_HEADER_DIRENT