summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-08-15 20:30:01 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-17 19:57:32 +0100
commit84d16bfae3f3cb9e5d07b011598d74e72ab2e8e6 (patch)
tree6c0f1929c64a99e6deb2db1bbd25bfa307df7643
parent500c7d3071177daa35ccd3bbe05b4768b2730179 (diff)
downloadpoky-84d16bfae3f3cb9e5d07b011598d74e72ab2e8e6.tar.gz
screen: Add missing include files in configure checks
Fixes builds with -Werror (From OE-Core rev: 1f3e413e5520f18b8b2e25533e7d17790d31aaf4) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/screen/screen/0001-configure-Add-needed-system-headers-in-checks.patch151
-rw-r--r--meta/recipes-extended/screen/screen_4.9.0.bb3
2 files changed, 153 insertions, 1 deletions
diff --git a/meta/recipes-extended/screen/screen/0001-configure-Add-needed-system-headers-in-checks.patch b/meta/recipes-extended/screen/screen/0001-configure-Add-needed-system-headers-in-checks.patch
new file mode 100644
index 0000000000..80659942c7
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/0001-configure-Add-needed-system-headers-in-checks.patch
@@ -0,0 +1,151 @@
1From 4e102de2e6204c1d8e8be00bb5ffd4587e70350c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 15 Aug 2022 10:35:53 -0700
4Subject: [PATCH] configure: Add needed system headers in checks
5
6Newer compilers throw warnings when a funciton is used with implicit
7declaration and enabling -Werror can silently fail these tests and
8result in wrong configure results. Therefore add the needed headers in
9the AC_TRY_LINK macros
10
11 * configure.ac: Add missing system headers in AC_TRY_LINK.
12
13Upstream-Status: Submitted [https://lists.gnu.org/archive/html/screen-devel/2022-08/msg00000.html]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 configure.ac | 57 +++++++++++++++++++++++++++++++++++++++-------------
17 1 file changed, 43 insertions(+), 14 deletions(-)
18
19diff --git a/configure.ac b/configure.ac
20index c0f02df..d308079 100644
21--- a/configure.ac
22+++ b/configure.ac
23@@ -233,6 +233,7 @@ AC_CHECKING(BSD job jontrol)
24 AC_TRY_LINK(
25 [#include <sys/types.h>
26 #include <sys/ioctl.h>
27+#include <unistd.h>
28 ], [
29 #ifdef POSIX
30 tcsetpgrp(0, 0);
31@@ -250,12 +251,16 @@ dnl
32 dnl **** setresuid(), setreuid(), seteuid() ****
33 dnl
34 AC_CHECKING(setresuid)
35-AC_TRY_LINK(,[
36-setresuid(0, 0, 0);
37+AC_TRY_LINK([
38+#include <unistd.h>
39+],[
40+return setresuid(0, 0, 0);
41 ], AC_DEFINE(HAVE_SETRESUID))
42 AC_CHECKING(setreuid)
43-AC_TRY_LINK(,[
44-setreuid(0, 0);
45+AC_TRY_LINK([
46+#include <unistd.h>
47+],[
48+return setreuid(0, 0);
49 ], AC_DEFINE(HAVE_SETREUID))
50 dnl
51 dnl seteuid() check:
52@@ -274,7 +279,9 @@ seteuid(0);
53
54 dnl execvpe
55 AC_CHECKING(execvpe)
56-AC_TRY_LINK(,[
57+AC_TRY_LINK([
58+ #include <unistd.h>
59+],[
60 execvpe(0, 0, 0);
61 ], AC_DEFINE(HAVE_EXECVPE)
62 CFLAGS="$CFLAGS -D_GNU_SOURCE")
63@@ -284,10 +291,18 @@ dnl **** select() ****
64 dnl
65
66 AC_CHECKING(select)
67-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
68+AC_TRY_LINK([
69+ #include <sys/select.h>
70+],[
71+ select(0, 0, 0, 0, 0);
72+],,
73 LIBS="$LIBS -lnet -lnsl"
74 AC_CHECKING(select with $LIBS)
75-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
76+AC_TRY_LINK([
77+ #include <sys/select.h>
78+],[
79+ select(0, 0, 0, 0, 0);
80+],,
81 AC_MSG_ERROR(!!! no select - no screen))
82 )
83 dnl
84@@ -624,11 +639,19 @@ dnl
85 dnl **** termcap or terminfo ****
86 dnl
87 AC_CHECKING(for tgetent)
88-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
89+AC_TRY_LINK([
90+ #include <curses.h>
91+ #include <term.h>
92+],[
93+ tgetent((char *)0, (char *)0);
94+],,
95 olibs="$LIBS"
96 LIBS="-lcurses $olibs"
97 AC_CHECKING(libcurses)
98-AC_TRY_LINK(,[
99+AC_TRY_LINK([
100+ #include <curses.h>
101+ #include <term.h>
102+],[
103 #ifdef __hpux
104 __sorry_hpux_libcurses_is_totally_broken_in_10_10();
105 #else
106@@ -871,7 +894,7 @@ test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
107 fi
108
109 AC_CHECKING(getloadavg)
110-AC_TRY_LINK(,[getloadavg((double *)0, 0);],
111+AC_TRY_LINK([#include <stdlib.h>],[getloadavg((double *)0, 0);],
112 AC_DEFINE(LOADAV_GETLOADAVG) load=1,
113 if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
114 olibs="$LIBS"
115@@ -1109,10 +1132,10 @@ AC_CHECKING(IRIX sun library)
116 AC_TRY_LINK(,,,LIBS="$oldlibs")
117
118 AC_CHECKING(syslog)
119-AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS"
120+AC_TRY_LINK([#include <syslog.h>],[closelog();], , [oldlibs="$LIBS"
121 LIBS="$LIBS -lbsd"
122 AC_CHECKING(syslog in libbsd.a)
123-AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
124+AC_TRY_LINK([#include <syslog.h>], [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
125 AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])])
126
127 AC_EGREP_CPP(YES_IS_DEFINED,
128@@ -1149,7 +1172,7 @@ AC_CHECKING(getspnam)
129 AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
130
131 AC_CHECKING(getttyent)
132-AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
133+AC_TRY_LINK([#include <ttyent.h>],[getttyent();], AC_DEFINE(GETTTYENT))
134
135 AC_CHECKING(fdwalk)
136 AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
137@@ -1204,7 +1227,13 @@ main() {
138 AC_SYS_LONG_FILE_NAMES
139
140 AC_MSG_CHECKING(for vsprintf)
141-AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
142+AC_TRY_LINK([
143+ #include <stdarg.h>
144+ #include <stdio.h>
145+],[
146+ va_list valist;
147+ vsprintf(0,0,valist);
148+], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
149
150 AC_HEADER_DIRENT
151
diff --git a/meta/recipes-extended/screen/screen_4.9.0.bb b/meta/recipes-extended/screen/screen_4.9.0.bb
index b36173b8de..77e8000bf3 100644
--- a/meta/recipes-extended/screen/screen_4.9.0.bb
+++ b/meta/recipes-extended/screen/screen_4.9.0.bb
@@ -21,7 +21,8 @@ SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
21 file://0002-comm.h-now-depends-on-term.h.patch \ 21 file://0002-comm.h-now-depends-on-term.h.patch \
22 file://0001-fix-for-multijob-build.patch \ 22 file://0001-fix-for-multijob-build.patch \
23 file://0001-Remove-more-compatibility-stuff.patch \ 23 file://0001-Remove-more-compatibility-stuff.patch \
24 " 24 file://0001-configure-Add-needed-system-headers-in-checks.patch \
25 "
25 26
26SRC_URI[sha256sum] = "f9335281bb4d1538ed078df78a20c2f39d3af9a4e91c57d084271e0289c730f4" 27SRC_URI[sha256sum] = "f9335281bb4d1538ed078df78a20c2f39d3af9a4e91c57d084271e0289c730f4"
27 28