Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/screen/files/, app-misc/screen/
Date: Sat, 10 Sep 2022 01:58:03
Message-Id: 1662775036.34e05020127fbb74568a573fdec83a60fba0d7c5.sam@gentoo
1 commit: 34e05020127fbb74568a573fdec83a60fba0d7c5
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 10 01:50:59 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 10 01:57:16 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34e05020
7
8 app-misc/screen: fix build w/ Clang 15 (fix configure tests)
9
10 Closes: https://bugs.gentoo.org/869371
11 Thanks-to: Nicholas Vinson <nvinson234 <AT> gmail.com>
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 ...n-4.9.0-configure-implicit-function-decls.patch | 745 +++++++++++++++++++++
15 app-misc/screen/screen-4.9.0-r1.ebuild | 146 ++++
16 2 files changed, 891 insertions(+)
17
18 diff --git a/app-misc/screen/files/screen-4.9.0-configure-implicit-function-decls.patch b/app-misc/screen/files/screen-4.9.0-configure-implicit-function-decls.patch
19 new file mode 100644
20 index 000000000000..e9db7ba786aa
21 --- /dev/null
22 +++ b/app-misc/screen/files/screen-4.9.0-configure-implicit-function-decls.patch
23 @@ -0,0 +1,745 @@
24 +https://bugs.gentoo.org/869371
25 +--- a/configure.ac
26 ++++ b/configure.ac
27 +@@ -157,10 +157,11 @@ if test -n "$ULTRIX"; then
28 + fi
29 + AC_CHECKING(for POSIX.1)
30 + AC_EGREP_CPP(YES_IS_DEFINED,
31 + [#include <sys/types.h>
32 + #include <unistd.h>
33 ++int
34 + main () {
35 + #ifdef _POSIX_VERSION
36 + YES_IS_DEFINED;
37 + #endif
38 + ], AC_NOTE(- you have a POSIX system) AC_DEFINE(POSIX) posix=1)
39 +@@ -231,10 +232,11 @@ dnl
40 +
41 + AC_CHECKING(BSD job jontrol)
42 + AC_TRY_LINK(
43 + [#include <sys/types.h>
44 + #include <sys/ioctl.h>
45 ++#include <unistd.h>
46 + ], [
47 + #ifdef POSIX
48 + tcsetpgrp(0, 0);
49 + #else
50 + int x = TIOCSPGRP;
51 +@@ -248,48 +250,64 @@ int y = TIOCNOTTY;
52 +
53 + dnl
54 + dnl **** setresuid(), setreuid(), seteuid() ****
55 + dnl
56 + AC_CHECKING(setresuid)
57 +-AC_TRY_LINK(,[
58 ++AC_TRY_LINK(
59 ++[#include <unistd.h>
60 ++], [
61 + setresuid(0, 0, 0);
62 + ], AC_DEFINE(HAVE_SETRESUID))
63 + AC_CHECKING(setreuid)
64 +-AC_TRY_LINK(,[
65 ++AC_TRY_LINK(
66 ++[#include <unistd.h>
67 ++], [
68 + setreuid(0, 0);
69 + ], AC_DEFINE(HAVE_SETREUID))
70 + dnl
71 + dnl seteuid() check:
72 + dnl linux seteuid was broken before V1.1.11
73 + dnl NeXT, AUX, ISC, and ultrix are still broken (no saved uid support)
74 + dnl Solaris seteuid doesn't change the saved uid, bad for
75 + dnl multiuser screen sessions
76 + AC_CHECKING(seteuid)
77 +-AC_TRY_LINK(,[
78 ++AC_TRY_LINK(
79 ++[#include <unistd.h>
80 ++],[
81 + #if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
82 +-seteuid_is_broken(0);
83 ++int seteuid_is_broken(int); seteuid_is_broken(0);
84 + #else
85 + seteuid(0);
86 + #endif
87 + ], AC_DEFINE(HAVE_SETEUID))
88 +
89 + dnl execvpe
90 + AC_CHECKING(execvpe)
91 +-AC_TRY_LINK(,[
92 ++AC_TRY_LINK(
93 ++[#include <unistd.h>
94 ++],[
95 + execvpe(0, 0, 0);
96 + ], AC_DEFINE(HAVE_EXECVPE)
97 + CFLAGS="$CFLAGS -D_GNU_SOURCE")
98 +
99 + dnl
100 + dnl **** select() ****
101 + dnl
102 +
103 + AC_CHECKING(select)
104 +-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
105 ++AC_TRY_LINK(
106 ++[#include <sys/select.h>
107 ++],[
108 ++ select(0, 0, 0, 0, 0);
109 ++],,
110 + LIBS="$LIBS -lnet -lnsl"
111 + AC_CHECKING(select with $LIBS)
112 +-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
113 ++AC_TRY_LINK(
114 ++[#include <sys/select.h>
115 ++],[
116 ++ select(0, 0, 0, 0, 0);
117 ++],,
118 + AC_MSG_ERROR(!!! no select - no screen))
119 + )
120 + dnl
121 + dnl **** FIFO tests ****
122 + dnl
123 +@@ -314,11 +332,11 @@ AC_TRY_RUN([
124 + #define S_IFIFO 0010000
125 + #endif
126 +
127 + char *fin = "/tmp/conftest$$";
128 +
129 +-main()
130 ++int main()
131 + {
132 + struct stat stb;
133 + fd_set f;
134 +
135 + (void)alarm(5);
136 +@@ -326,40 +344,40 @@ main()
137 + #ifdef POSIX
138 + if (mkfifo(fin, 0777))
139 + #else
140 + if (mknod(fin, S_IFIFO|0777, 0))
141 + #endif
142 +- exit(1);
143 ++ return 1;
144 + if (stat(fin, &stb) || (stb.st_mode & S_IFIFO) != S_IFIFO)
145 +- exit(1);
146 ++ return 1;
147 + close(0);
148 + #ifdef __386BSD__
149 + /*
150 + * The next test fails under 386BSD, but screen works using fifos.
151 + * Fifos in O_RDWR mode are only used for the BROKEN_PIPE case and for
152 + * the select() configuration test.
153 + */
154 +- exit(0);
155 ++ return 0;
156 + #endif
157 + if (open(fin, O_RDONLY | O_NONBLOCK))
158 +- exit(1);
159 ++ return 1;
160 + if (fork() == 0)
161 + {
162 + close(0);
163 + if (open(fin, O_WRONLY | O_NONBLOCK))
164 +- exit(1);
165 ++ return 1;
166 + close(0);
167 + if (open(fin, O_WRONLY | O_NONBLOCK))
168 +- exit(1);
169 ++ return 1;
170 + if (write(0, "TEST", 4) == -1)
171 +- exit(1);
172 +- exit(0);
173 ++ return 1;
174 ++ return 0;
175 + }
176 + FD_SET(0, &f);
177 + if (select(1, &f, 0, 0, 0) == -1)
178 +- exit(1);
179 +- exit(0);
180 ++ return 1;
181 ++ return 0;
182 + }
183 + ], AC_NOTE(- your fifos are usable) fifo=1,
184 + AC_NOTE(- your fifos are not usable),
185 + AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1)
186 + rm -f /tmp/conftest*
187 +@@ -385,30 +403,31 @@ AC_TRY_RUN([
188 + #define S_IFIFO 0010000
189 + #endif
190 +
191 + char *fin = "/tmp/conftest$$";
192 +
193 ++int
194 + main()
195 + {
196 + struct timeval tv;
197 + fd_set f;
198 +
199 + #ifdef POSIX
200 + if (mkfifo(fin, 0600))
201 + #else
202 + if (mknod(fin, S_IFIFO|0600, 0))
203 + #endif
204 +- exit(1);
205 ++ return 1;
206 + close(0);
207 + if (open(fin, O_RDONLY|O_NONBLOCK))
208 +- exit(1);
209 ++ return 1;
210 + FD_SET(0, &f);
211 + tv.tv_sec = 1;
212 + tv.tv_usec = 0;
213 + if (select(1, &f, 0, 0, &tv))
214 +- exit(1);
215 +- exit(0);
216 ++ return 1;
217 ++ return 0;
218 + }
219 + ], AC_NOTE(- your implementation is ok),
220 + AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,
221 + AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok))
222 + rm -f /tmp/conftest*
223 +@@ -432,46 +455,48 @@ AC_TRY_RUN([
224 +
225 + #include <sys/stat.h>
226 + #include <fcntl.h>
227 + #include <sys/socket.h>
228 + #include <sys/un.h>
229 ++#include <signal.h>
230 +
231 + char *son = "/tmp/conftest$$";
232 +
233 ++int
234 + main()
235 + {
236 + int s1, s2, l;
237 + struct sockaddr_un a;
238 + fd_set f;
239 +
240 + (void)alarm(5);
241 + if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
242 +- exit(1);
243 ++ return 1;
244 + a.sun_family = AF_UNIX;
245 + strcpy(a.sun_path, son);
246 + (void) unlink(son);
247 + if (bind(s1, (struct sockaddr *) &a, strlen(son)+2) == -1)
248 +- exit(1);
249 ++ return 1;
250 + if (listen(s1, 2))
251 +- exit(1);
252 ++ return 1;
253 + if (fork() == 0)
254 + {
255 + if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
256 + kill(getppid(), 3);
257 + (void)connect(s2, (struct sockaddr *)&a, strlen(son) + 2);
258 + if (write(s2, "HELLO", 5) == -1)
259 + kill(getppid(), 3);
260 +- exit(0);
261 ++ return 0;
262 + }
263 + l = sizeof(a);
264 + close(0);
265 + if (accept(s1, &a, &l))
266 +- exit(1);
267 ++ return 1;
268 + FD_SET(0, &f);
269 + if (select(1, &f, 0, 0, 0) == -1)
270 +- exit(1);
271 +- exit(0);
272 ++ return 1;
273 ++ return 0;
274 + }
275 + ], AC_NOTE(- your sockets are usable) sock=1,
276 + AC_NOTE(- your sockets are not usable),
277 + AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1)
278 + rm -f /tmp/conftest*
279 +@@ -491,26 +516,27 @@ AC_TRY_RUN([
280 + #include <sys/socket.h>
281 + #include <sys/un.h>
282 +
283 + char *son = "/tmp/conftest$$";
284 +
285 ++int
286 + main()
287 + {
288 + int s;
289 + struct stat stb;
290 + struct sockaddr_un a;
291 + if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
292 +- exit(0);
293 ++ return 0;
294 + a.sun_family = AF_UNIX;
295 + strcpy(a.sun_path, son);
296 + (void) unlink(son);
297 + if (bind(s, (struct sockaddr *) &a, strlen(son)+2) == -1)
298 +- exit(0);
299 ++ return 0;
300 + if (stat(son, &stb))
301 +- exit(1);
302 ++ return 1;
303 + close(s);
304 +- exit(0);
305 ++ return 0;
306 + }
307 + ],AC_NOTE(- you are normal),
308 + AC_NOTE(- unix domain sockets are not kept in the filesystem)
309 + AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,
310 + AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal))
311 +@@ -545,122 +571,167 @@ char *nam = "/tmp/conftest$$";
312 + #endif
313 + #ifndef S_IFIFO
314 + #define S_IFIFO 0010000
315 + #endif
316 +
317 ++int
318 + main()
319 + {
320 + fd_set f;
321 +
322 + #ifdef __FreeBSD__
323 + /* From Andrew A. Chernov (ache@××××××××××.su):
324 + * opening RDWR fifo fails in BSD 4.4, but select return values are
325 + * right.
326 + */
327 +- exit(0);
328 ++ return 0;
329 + #endif
330 + (void)alarm(5);
331 + #ifdef POSIX
332 + if (mkfifo(nam, 0777))
333 + #else
334 + if (mknod(nam, S_IFIFO|0777, 0))
335 + #endif
336 +- exit(1);
337 ++ return 1;
338 + close(0);
339 + if (open(nam, O_RDWR | O_NONBLOCK))
340 +- exit(1);
341 ++ return 1;
342 + if (write(0, "TEST", 4) == -1)
343 +- exit(1);
344 ++ return 1;
345 +
346 + #else
347 +
348 + #include <sys/types.h>
349 + #include <sys/socket.h>
350 + #include <sys/un.h>
351 ++#include <signal.h>
352 +
353 ++int
354 + main()
355 + {
356 + int s1, s2, l;
357 + struct sockaddr_un a;
358 + fd_set f;
359 +
360 + (void)alarm(5);
361 + if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
362 +- exit(1);
363 ++ return 1;
364 + a.sun_family = AF_UNIX;
365 + strcpy(a.sun_path, nam);
366 + (void) unlink(nam);
367 + if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1)
368 +- exit(1);
369 ++ return 1;
370 + if (listen(s1, 2))
371 +- exit(1);
372 ++ return 1;
373 + if (fork() == 0)
374 + {
375 + if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
376 + kill(getppid(), 3);
377 + (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2);
378 + if (write(s2, "HELLO", 5) == -1)
379 + kill(getppid(), 3);
380 +- exit(0);
381 ++ return 0;
382 + }
383 + l = sizeof(a);
384 + close(0);
385 + if (accept(s1, (struct sockaddr *)&a, &l))
386 +- exit(1);
387 ++ return 1;
388 + #endif
389 +
390 +
391 + FD_SET(0, &f);
392 + if (select(1, &f, 0, 0, 0) == -1)
393 +- exit(1);
394 ++ return 1;
395 + if (select(1, &f, &f, 0, 0) != 2)
396 +- exit(1);
397 +- exit(0);
398 ++ return 1;
399 ++ return 0;
400 + }
401 + ],AC_NOTE(- select is ok),
402 + AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),
403 + AC_NOTE(- skipping check because we are cross compiling; assuming select is ok))
404 +
405 + dnl
406 + dnl **** termcap or terminfo ****
407 + dnl
408 + AC_CHECKING(for tgetent)
409 +-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
410 ++AC_TRY_LINK([
411 ++ #include <curses.h>
412 ++ #include <term.h>
413 ++], [
414 ++ tgetent((char *)0, (char *)0);
415 ++],,
416 + olibs="$LIBS"
417 + LIBS="-lcurses $olibs"
418 + AC_CHECKING(libcurses)
419 +-AC_TRY_LINK(,[
420 ++AC_TRY_LINK([#include <curses.h>
421 ++ #include <term.h>
422 ++],[
423 + #ifdef __hpux
424 + __sorry_hpux_libcurses_is_totally_broken_in_10_10();
425 + #else
426 + tgetent((char *)0, (char *)0);
427 + #endif
428 + ],,
429 + LIBS="-ltermcap $olibs"
430 + AC_CHECKING(libtermcap)
431 +-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
432 ++AC_TRY_LINK(
433 ++[#include <curses.h>
434 ++ #include <term.h>
435 ++],[
436 ++ tgetent((char *)0, (char *)0);
437 ++],,
438 + LIBS="-ltermlib $olibs"
439 + AC_CHECKING(libtermlib)
440 +-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
441 ++AC_TRY_LINK(
442 ++[#include <curses.h>
443 ++ #include <term.h>
444 ++],[
445 ++ tgetent((char *)0, (char *)0);
446 ++],,
447 + LIBS="-lncursesw $olibs"
448 + AC_CHECKING(libncursesw)
449 +-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
450 ++AC_TRY_LINK(
451 ++[#include <curses.h>
452 ++ #include <term.h>
453 ++],[
454 ++ tgetent((char *)0, (char *)0);
455 ++],,
456 + LIBS="-ltinfow $olibs"
457 + AC_CHECKING(libtinfow)
458 +-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
459 ++AC_TRY_LINK(
460 ++[#include <curses.h>
461 ++ #include <term.h>
462 ++],[
463 ++ tgetent((char *)0, (char *)0);
464 ++],,
465 + LIBS="-lncurses $olibs"
466 + AC_CHECKING(libncurses)
467 +-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
468 ++AC_TRY_LINK(
469 ++[#include <curses.h>
470 ++ #include <term.h>
471 ++],[
472 ++ tgetent((char *)0, (char *)0);
473 ++],,
474 + LIBS="-ltinfo $olibs"
475 + AC_CHECKING(libtinfo)
476 +-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
477 ++AC_TRY_LINK(
478 ++[#include <curses.h>
479 ++ #include <term.h>
480 ++],[
481 ++ tgetent((char *)0, (char *)0);
482 ++],,
483 + AC_MSG_ERROR(!!! no tgetent - no screen)))))))))
484 +
485 + AC_TRY_RUN([
486 ++#include <curses.h>
487 ++#include <string.h>
488 ++#include <term.h>
489 ++
490 ++int
491 + main()
492 + {
493 +- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
494 ++ return(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
495 + }], AC_NOTE(- you use the termcap database),
496 + AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),
497 + AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO))
498 + AC_CHECKING(ospeed)
499 + AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
500 +@@ -677,11 +748,15 @@ fi
501 +
502 + if test "$cross_compiling" = no ; then
503 + AC_CHECKING(for SVR4 ptys)
504 + sysvr4ptys=
505 + if test -c /dev/ptmx ; then
506 +-AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
507 ++AC_TRY_LINK([
508 ++ #include <stdlib.h>
509 ++], [
510 ++ ptsname(0);grantpt(0);unlockpt(0);
511 ++],[AC_DEFINE(HAVE_SVR4_PTYS)
512 + sysvr4ptys=1])
513 + fi
514 + fi
515 +
516 + AC_CHECK_FUNCS(getpt)
517 +@@ -733,33 +808,36 @@ AC_CHECKING(default tty permissions/group)
518 + rm -f conftest_grp
519 + AC_TRY_RUN([
520 + #include <sys/types.h>
521 + #include <sys/stat.h>
522 + #include <stdio.h>
523 ++#include <stdlib.h>
524 ++#include <unistd.h>
525 ++int
526 + main()
527 + {
528 + struct stat sb;
529 + char *x,*ttyname();
530 + int om, m;
531 + FILE *fp;
532 +
533 +- if (!(x = ttyname(0))) exit(1);
534 +- if (stat(x, &sb)) exit(1);
535 ++ if (!(x = ttyname(0))) return 1;
536 ++ if (stat(x, &sb)) return 1;
537 + om = sb.st_mode;
538 +- if (om & 002) exit(0);
539 ++ if (om & 002) return 0;
540 + m = system("mesg y");
541 +- if (m == -1 || m == 127) exit(1);
542 +- if (stat(x, &sb)) exit(1);
543 ++ if (m == -1 || m == 127) return 1;
544 ++ if (stat(x, &sb)) return 1;
545 + m = sb.st_mode;
546 +- if (chmod(x, om)) exit(1);
547 +- if (m & 002) exit(0);
548 +- if (sb.st_gid == getgid()) exit(1);
549 ++ if (chmod(x, om)) return 1;
550 ++ if (m & 002) return 0;
551 ++ if (sb.st_gid == getgid()) return 1;
552 + if (!(fp=fopen("conftest_grp", "w")))
553 +- exit(1);
554 ++ return 1;
555 + fprintf(fp, "%d\n", sb.st_gid);
556 + fclose(fp);
557 +- exit(0);
558 ++ return 0;
559 + }
560 + ],[
561 + if test -f conftest_grp; then
562 + ptygrp=`cat conftest_grp`
563 + AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
564 +@@ -869,17 +942,25 @@ AC_CHECKING(for libutil(s))
565 + test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
566 + test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
567 + fi
568 +
569 + AC_CHECKING(getloadavg)
570 +-AC_TRY_LINK(,[getloadavg((double *)0, 0);],
571 ++AC_TRY_LINK(
572 ++[
573 ++ #include <stdlib.h>
574 ++],[
575 ++ getloadavg((double *)0, 0);],
576 + AC_DEFINE(LOADAV_GETLOADAVG) load=1,
577 + if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
578 + olibs="$LIBS"
579 + LIBS="$LIBS -lkvm"
580 + AC_CHECKING(getloadavg with -lkvm)
581 +-AC_TRY_LINK(,[getloadavg((double *)0, 0);],
582 ++AC_TRY_LINK(
583 ++[
584 ++ #include <stdlib.h>
585 ++],[
586 ++ getloadavg((double *)0, 0);],
587 + AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
588 + fi
589 + )
590 +
591 + if test -z "$load" ; then
592 +@@ -931,10 +1012,11 @@ else
593 +
594 + $nlist64
595 +
596 + struct nlist nl[2];
597 +
598 ++int
599 + main()
600 + {
601 + #if !defined(_AUX_SOURCE) && !defined(AUX)
602 + # ifdef NLIST_NAME_UNION
603 + nl[0].n_un.n_name = "$av";
604 +@@ -944,12 +1026,12 @@ main()
605 + #else
606 + strncpy(nl[0].n_name, "$av", sizeof(nl[0].n_name));
607 + #endif
608 + nlist(LOADAV_UNIX, nl);
609 + if (nl[0].n_value == 0)
610 +- exit(1);
611 +- exit(0);
612 ++ return 1;
613 ++ return 0;
614 + }
615 + ],avensym=$av;break)
616 + if test "$av" = _Loadavg; then
617 + nlist64='#define nlist nlist64'
618 + fi
619 +@@ -1068,21 +1150,22 @@ void
620 + hand()
621 + {
622 + got++;
623 + }
624 +
625 ++int
626 + main()
627 + {
628 + /* on hpux we use sigvec to get bsd signals */
629 + #ifdef __hpux
630 + (void)signal(SIGCLD, hand);
631 + kill(getpid(), SIGCLD);
632 + kill(getpid(), SIGCLD);
633 + if (got < 2)
634 +- exit(1);
635 ++ return 1;
636 + #endif
637 +- exit(0);
638 ++ return 0;
639 + }
640 + ],,AC_DEFINE(SYSVSIGS),:)
641 +
642 + fi
643 +
644 +@@ -1107,14 +1190,22 @@ oldlibs="$LIBS"
645 + LIBS="$LIBS -lsun"
646 + AC_CHECKING(IRIX sun library)
647 + AC_TRY_LINK(,,,LIBS="$oldlibs")
648 +
649 + AC_CHECKING(syslog)
650 +-AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS"
651 ++AC_TRY_LINK(
652 ++[#include <syslog.h>
653 ++], [
654 ++ closelog();
655 ++], , [oldlibs="$LIBS"
656 + LIBS="$LIBS -lbsd"
657 + AC_CHECKING(syslog in libbsd.a)
658 +-AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
659 ++AC_TRY_LINK(
660 ++[#include <syslog.h>
661 ++], [
662 ++ closelog();
663 ++], AC_NOTE(- found.), [LIBS="$oldlibs"
664 + AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])])
665 +
666 + AC_EGREP_CPP(YES_IS_DEFINED,
667 + [#ifdef M_UNIX
668 + YES_IS_DEFINED;
669 +@@ -1147,66 +1238,87 @@ fi
670 + dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
671 + AC_CHECKING(getspnam)
672 + AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
673 +
674 + AC_CHECKING(getttyent)
675 +-AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
676 ++AC_TRY_LINK(
677 ++[
678 ++ #include <ttyent.h>
679 ++],[
680 ++ getttyent();
681 ++], AC_DEFINE(GETTTYENT))
682 +
683 + AC_CHECKING(fdwalk)
684 + AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
685 +
686 + AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
687 + AC_TRY_RUN([
688 ++#include <string.h>
689 ++
690 ++int
691 + main() {
692 + char buf[10];
693 + strcpy(buf, "abcdefghi");
694 + bcopy(buf, buf + 2, 3);
695 + if (strncmp(buf, "ababcf", 6))
696 +- exit(1);
697 ++ return 1;
698 + strcpy(buf, "abcdefghi");
699 + bcopy(buf + 2, buf, 3);
700 + if (strncmp(buf, "cdedef", 6))
701 +- exit(1);
702 +- exit(0); /* libc version works properly. */
703 ++ return 1;
704 ++ return 0; /* libc version works properly. */
705 + }], AC_DEFINE(USEBCOPY),,:)
706 +
707 + AC_TRY_RUN([
708 ++#include <string.h>
709 ++
710 + #define bcopy(s,d,l) memmove(d,s,l)
711 ++int
712 + main() {
713 + char buf[10];
714 + strcpy(buf, "abcdefghi");
715 + bcopy(buf, buf + 2, 3);
716 + if (strncmp(buf, "ababcf", 6))
717 +- exit(1);
718 ++ return 1;
719 + strcpy(buf, "abcdefghi");
720 + bcopy(buf + 2, buf, 3);
721 + if (strncmp(buf, "cdedef", 6))
722 +- exit(1);
723 +- exit(0); /* libc version works properly. */
724 ++ return 1;
725 ++ return 0; /* libc version works properly. */
726 + }], AC_DEFINE(USEMEMMOVE),,
727 + AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE))
728 +
729 +
730 + AC_TRY_RUN([
731 ++#include <string.h>
732 ++
733 + #define bcopy(s,d,l) memcpy(d,s,l)
734 ++int
735 + main() {
736 + char buf[10];
737 + strcpy(buf, "abcdefghi");
738 + bcopy(buf, buf + 2, 3);
739 + if (strncmp(buf, "ababcf", 6))
740 +- exit(1);
741 ++ return 1;
742 + strcpy(buf, "abcdefghi");
743 + bcopy(buf + 2, buf, 3);
744 + if (strncmp(buf, "cdedef", 6))
745 +- exit(1);
746 +- exit(0); /* libc version works properly. */
747 ++ return 1;
748 ++ return 0; /* libc version works properly. */
749 + }], AC_DEFINE(USEMEMCPY),,:)
750 +
751 + AC_SYS_LONG_FILE_NAMES
752 +
753 + AC_MSG_CHECKING(for vsprintf)
754 +-AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
755 ++AC_TRY_LINK(
756 ++[
757 ++ #include <stdarg.h>
758 ++ #include <stdio.h>
759 ++],
760 ++[
761 ++ va_list valist; vsprintf(0,0,valist);
762 ++], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
763 +
764 + AC_HEADER_DIRENT
765 +
766 + AC_MSG_CHECKING(for setenv)
767 + if test -z "$ac_setenv_args"; then
768 +
769
770 diff --git a/app-misc/screen/screen-4.9.0-r1.ebuild b/app-misc/screen/screen-4.9.0-r1.ebuild
771 new file mode 100644
772 index 000000000000..44eb81d05d0d
773 --- /dev/null
774 +++ b/app-misc/screen/screen-4.9.0-r1.ebuild
775 @@ -0,0 +1,146 @@
776 +# Copyright 1999-2022 Gentoo Authors
777 +# Distributed under the terms of the GNU General Public License v2
778 +
779 +EAPI=7
780 +
781 +inherit autotools flag-o-matic pam tmpfiles
782 +
783 +DESCRIPTION="screen manager with VT100/ANSI terminal emulation"
784 +HOMEPAGE="https://www.gnu.org/software/screen/"
785 +
786 +if [[ ${PV} != 9999 ]] ; then
787 + SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
788 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
789 +else
790 + inherit git-r3
791 + EGIT_REPO_URI="https://git.savannah.gnu.org/git/screen.git"
792 + EGIT_CHECKOUT_DIR="${WORKDIR}/${P}" # needed for setting S later on
793 + S="${WORKDIR}"/${P}/src
794 +fi
795 +
796 +LICENSE="GPL-2"
797 +SLOT="0"
798 +IUSE="debug nethack pam selinux multiuser"
799 +
800 +DEPEND=">=sys-libs/ncurses-5.2:=
801 + virtual/libcrypt:=
802 + pam? ( sys-libs/pam )"
803 +RDEPEND="${DEPEND}
804 + acct-group/utmp
805 + selinux? ( sec-policy/selinux-screen )"
806 +BDEPEND="sys-apps/texinfo"
807 +
808 +PATCHES=(
809 + # Don't use utempter even if it is found on the system.
810 + "${FILESDIR}"/${PN}-4.3.0-no-utempter.patch
811 + "${FILESDIR}"/${PN}-4.6.2-utmp-exit.patch
812 + "${FILESDIR}"/${PN}-4.9.0-configure-implicit-function-decls.patch
813 +)
814 +
815 +src_prepare() {
816 + default
817 +
818 + # sched.h is a system header and causes problems with some C libraries
819 + mv sched.h _sched.h || die
820 + sed -i '/include/ s:sched.h:_sched.h:' screen.h || die
821 +
822 + # Fix manpage
823 + sed -i \
824 + -e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
825 + -e "s:/usr/local/screens:${EPREFIX}/tmp/screen:g" \
826 + -e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
827 + -e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
828 + -e "s:/local/screens/S\\\-:${EPREFIX}/tmp/screen/S\\\-:g" \
829 + doc/screen.1 || die
830 +
831 + if [[ ${CHOST} == *-darwin* ]] || use elibc_musl; then
832 + sed -i -e '/^#define UTMPOK/s/define/undef/' acconfig.h || die
833 + fi
834 +
835 + # disable musl dummy headers for utmp[x]
836 + use elibc_musl && append-cppflags "-D_UTMP_H -D_UTMPX_H"
837 +
838 + # reconfigure
839 + eautoreconf
840 +}
841 +
842 +src_configure() {
843 + append-cppflags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"
844 +
845 + if [[ ${CHOST} == *-solaris* ]]; then
846 + # enable msg_header by upping the feature standard compatible
847 + # with c99 mode
848 + append-cppflags -D_XOPEN_SOURCE=600
849 + fi
850 +
851 + use nethack || append-cppflags "-DNONETHACK"
852 + use debug && append-cppflags "-DDEBUG"
853 +
854 + local myeconfargs=(
855 + --with-socket-dir="${EPREFIX}/tmp/${PN}"
856 + --with-sys-screenrc="${EPREFIX}/etc/screenrc"
857 + --with-pty-mode=0620
858 + --with-pty-group=5
859 + --enable-rxvt_osc
860 + --enable-telnet
861 + --enable-colors256
862 + $(use_enable pam)
863 + )
864 + econf "${myeconfargs[@]}"
865 +}
866 +
867 +src_compile() {
868 + LC_ALL=POSIX emake comm.h term.h
869 + emake osdef.h
870 +
871 + emake -C doc screen.info
872 + default
873 +}
874 +
875 +src_install() {
876 + local DOCS=(
877 + README ChangeLog INSTALL TODO NEWS* patchlevel.h
878 + doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps}
879 + )
880 +
881 + emake DESTDIR="${D}" SCREEN="${P}" install
882 +
883 + local tmpfiles_perms tmpfiles_group
884 +
885 + if use multiuser || use prefix ; then
886 + fperms 4755 /usr/bin/${P}
887 + tmpfiles_perms="0755"
888 + tmpfiles_group="root"
889 + else
890 + fowners root:utmp /usr/bin/${P}
891 + fperms 2755 /usr/bin/${P}
892 + tmpfiles_perms="0775"
893 + tmpfiles_group="utmp"
894 + fi
895 +
896 + newtmpfiles - screen.conf <<<"d /tmp/screen ${tmpfiles_perms} root ${tmpfiles_group}"
897 +
898 + insinto /usr/share/${PN}
899 + doins terminfo/{screencap,screeninfo.src}
900 +
901 + insinto /etc
902 + doins "${FILESDIR}"/screenrc
903 +
904 + if use pam; then
905 + pamd_mimic_system screen auth
906 + fi
907 +
908 + dodoc "${DOCS[@]}"
909 +}
910 +
911 +pkg_postinst() {
912 + if [[ -z ${REPLACING_VERSIONS} ]]; then
913 + elog "Some dangerous key bindings have been removed or changed to more safe values."
914 + elog "We enable some xterm hacks in our default screenrc, which might break some"
915 + elog "applications. Please check /etc/screenrc for information on these changes."
916 + fi
917 +
918 + tmpfiles_process screen.conf
919 +
920 + ewarn "This revision changes the screen socket location to ${EROOT}/tmp/${PN}"
921 +}