summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/screen/screen-4.0.3/configure.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/screen/screen-4.0.3/configure.patch')
-rw-r--r--meta/recipes-extended/screen/screen-4.0.3/configure.patch979
1 files changed, 0 insertions, 979 deletions
diff --git a/meta/recipes-extended/screen/screen-4.0.3/configure.patch b/meta/recipes-extended/screen/screen-4.0.3/configure.patch
deleted file mode 100644
index e29bcc6639..0000000000
--- a/meta/recipes-extended/screen/screen-4.0.3/configure.patch
+++ /dev/null
@@ -1,979 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# The patch is borrowed from OE:
4# http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=4ee790cc6974bdfe1c9b06c0567b1c56f56d6615
5# and was rebased to screen-4.0.3's configure.in
6# by Dexuan Cui (dexuan.cui@intel.com).
7#
8# The description of the original patch is:
9#
10# Patch by Hannes Reich (hannes@skynet.ie) 22-Jul-2005
11# Resolves _some_ of the cross-compilation issues in screen's configure.in
12#
13diff --git a/configure.in b/configure.in
14index 34c9372..d5ed48a 100644
15--- a/configure.in
16+++ b/configure.in
17@@ -37,6 +37,325 @@ pat=`sed < ${srcdir}/patchlevel.h -n -e '/#define PATCHLEVEL/s/#define PATCHLEVE
18 VERSION="$rev.$vers.$pat"
19 AC_NOTE(this is screen version $VERSION)
20 AC_SUBST(VERSION)
21+
22+AH_TOP([
23+/* Copyright (c) 1993-2000
24+ * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
25+ * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
26+ * Copyright (c) 1987 Oliver Laumann
27+ *
28+ * This program is free software; you can redistribute it and/or modify
29+ * it under the terms of the GNU General Public License as published by
30+ * the Free Software Foundation; either version 2, or (at your option)
31+ * any later version.
32+ *
33+ * This program is distributed in the hope that it will be useful,
34+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
35+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36+ * GNU General Public License for more details.
37+ *
38+ * You should have received a copy of the GNU General Public License
39+ * along with this program (see the file COPYING); if not, write to the
40+ * Free Software Foundation, Inc.,
41+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
42+ *
43+ */
44+
45+
46+/**********************************************************************
47+ *
48+ * User Configuration Section
49+ */
50+
51+/*
52+ * Maximum of simultaneously allowed windows per screen session.
53+ */
54+#ifndef MAXWIN
55+# define MAXWIN 40
56+#endif
57+
58+/*
59+ * Define SOCKDIR to be the directory to contain the named sockets
60+ * screen creates. This should be in a common subdirectory, such as
61+ * /usr/local or /tmp. It makes things a little more secure if you
62+ * choose a directory which is not writable by everyone or where the
63+ * "sticky" bit is on, but this isn't required.
64+ * If SOCKDIR is not defined screen will put the named sockets in
65+ * the user's home directory. Notice that this can cause you problems
66+ * if some user's HOME directories are AFS- or NFS-mounted. Especially
67+ * AFS is unlikely to support named sockets.
68+ *
69+ * Screen will name the subdirectories "S-$USER" (e.g /tmp/S-davison).
70+ */
71+#undef SOCKDIR
72+
73+/*
74+ * Define this if the SOCKDIR is not shared between hosts.
75+ */
76+#define SOCKDIR_IS_LOCAL_TO_HOST
77+
78+/*
79+ * Screen sources two startup files. First a global file with a path
80+ * specified here, second your local $HOME/.screenrc
81+ * Don't define this, if you don't want it.
82+ */
83+#ifndef ETCSCREENRC
84+# define ETCSCREENRC "/usr/local/etc/screenrc"
85+#endif
86+
87+/*
88+ * Screen can look for the environment variable $SYSSCREENRC and -if it
89+ * exists- load the file specified in that variable as global screenrc.
90+ * If you want to enable this feature, define ALLOW_SYSSCREENRC to one (1).
91+ * Otherwise ETCSCREENRC is always loaded.
92+ */
93+#define ALLOW_SYSSCREENRC 1
94+
95+/*
96+ * Screen needs encoding files for the translation of utf8
97+ * into some encodings, e.g. JIS, BIG5.
98+ * Only needed if FONT, ENCODINGS and UTF8 are defined.
99+ */
100+#ifndef SCREENENCODINGS
101+# define SCREENENCODINGS "/usr/local/lib/screen/encodings"
102+#endif
103+/*
104+ * Define CHECKLOGIN to force Screen users to enter their Unix password
105+ * in addition to the screen password.
106+ *
107+ * Define NOSYSLOG if yo do not have logging facilities. Currently
108+ * syslog() will be used to trace ``su'' commands only.
109+ */
110+#define CHECKLOGIN 1
111+#undef NOSYSLOG
112+
113+
114+/*
115+ * define PTYMODE if you do not like the default of 0622, which allows
116+ * public write to your pty.
117+ * define PTYGROUP to some numerical group-id if you do not want the
118+ * tty to be in "your" group.
119+ * Note, screen is unable to change mode or group of the pty if it
120+ * is not installed with sufficient privilege. (e.g. set-uid-root)
121+ * define PTYROFS if the /dev/pty devices are mounted on a read-only
122+ * filesystem so screen should not even attempt to set mode or group
123+ * even if running as root (e.g. on TiVo).
124+ */
125+#undef PTYMODE
126+#undef PTYGROUP
127+#undef PTYROFS
128+
129+/*
130+ * If screen is NOT installed set-uid root, screen can provide tty
131+ * security by exclusively locking the ptys. While this keeps other
132+ * users from opening your ptys, it also keeps your own subprocesses
133+ * from being able to open /dev/tty. Define LOCKPTY to add this
134+ * exclusive locking.
135+ */
136+#undef LOCKPTY
137+
138+/*
139+ * If you'd rather see the status line on the first line of your
140+ * terminal rather than the last, define TOPSTAT.
141+ */
142+#undef TOPSTAT
143+
144+/*
145+ * define DETACH can detach a session. An absolute 'must'.
146+ */
147+#define DETACH
148+
149+/*
150+ * here come the erlangen extensions to screen:
151+ * define LOCK if you want to use a lock program for a screenlock.
152+ * define PASSWORD for secure reattach of your screen.
153+ * define COPY_PASTE to use the famous hacker's treasure zoo.
154+ * define POW_DETACH to have a detach_and_logout key (requires DETACH).
155+ * define REMOTE_DETACH (-d option) to move screen between terminals.
156+ * define AUTO_NUKE to enable Tim MacKenzies clear screen nuking
157+ * define PSEUDOS to allow window input/output filtering
158+ * define MULTI to allow multiple attaches.
159+ * define MULTIUSER to allow other users attach to your session
160+ * (if they are in the acl, of course)
161+ * define MAPKEYS to include input keyboard translation.
162+ * define FONT to support ISO2022/alternet charset support
163+ * define COLOR to include ansi color support. This may expose
164+ * a bug in x11r6-color-xterm.
165+ * define DW_CHARS to include support for double-width character
166+ * sets.
167+ * define ENCODINGS to include support for encodings like euc or big5.
168+ * Needs FONT to work.
169+ * define UTF8 if you want support for UTF-8 encoding.
170+ * Needs FONT and ENCODINGS to work.
171+ * define COLORS16 if you want 16 colors.
172+ * Needs COLOR to work.
173+ * define BUILTIN_TELNET to add telnet support to screen.
174+ * Syntax: screen //telnet host [port]
175+ * define RXVT_OSC if you want support for rxvts special
176+ * change fgcolor/bgcolor/bgpicture sequences
177+ */
178+#undef SIMPLESCREEN
179+#ifndef SIMPLESCREEN
180+# define LOCK
181+# define PASSWORD
182+# define COPY_PASTE
183+# define REMOTE_DETACH
184+# define POW_DETACH
185+# define AUTO_NUKE
186+# define PSEUDOS
187+# define MULTI
188+# define MULTIUSER
189+# define MAPKEYS
190+# define COLOR
191+# define FONT
192+# define DW_CHARS
193+# define ENCODINGS
194+# define UTF8
195+# define COLORS16
196+# define ZMODEM
197+# define BLANKER_PRG
198+#endif /* SIMPLESCREEN */
199+
200+#undef BUILTIN_TELNET
201+#undef RXVT_OSC
202+#undef COLORS256
203+
204+
205+/*
206+ * If you have a braille display you should define HAVE_BRAILLE.
207+ * The code inside #ifdef HAVE_BRAILLE was contributed by Hadi Bargi
208+ * Rangin (bargi@dots.physics.orst.edu).
209+ * WARNING: this is more or less unsupported code, it may be full of
210+ * bugs leading to security holes, enable at your own risk!
211+ */
212+#undef HAVE_BRAILLE
213+
214+
215+/*
216+ * As error messages are mostly meaningless to the user, we
217+ * try to throw out phrases that are somewhat more familiar
218+ * to ...well, at least familiar to us NetHack players.
219+ */
220+#ifndef NONETHACK
221+# define NETHACK
222+#endif /* NONETHACK */
223+
224+/*
225+ * If screen is installed with permissions to update /etc/utmp (such
226+ * as if it is installed set-uid root), define UTMPOK.
227+ */
228+#define UTMPOK
229+
230+/* Set LOGINDEFAULT to one (1)
231+ * if you want entries added to /etc/utmp by default, else set it to
232+ * zero (0).
233+ * LOGINDEFAULT will be one (1) whenever LOGOUTOK is undefined!
234+ */
235+#define LOGINDEFAULT 1
236+
237+/* Set LOGOUTOK to one (1)
238+ * if you want the user to be able to log her/his windows out.
239+ * (Meaning: They are there, but not visible in /etc/utmp).
240+ * Disabling this feature only makes sense if you have a secure /etc/utmp
241+ * database.
242+ * Negative examples: suns usually have a world writable utmp file,
243+ * xterm will run perfectly without s-bit.
244+ *
245+ * If LOGOUTOK is undefined and UTMPOK is defined, all windows are
246+ * initially and permanently logged in.
247+ *
248+ * Set CAREFULUTMP to one (1) if you want that users have at least one
249+ * window per screen session logged in.
250+ */
251+#define LOGOUTOK 1
252+#undef CAREFULUTMP
253+
254+
255+/*
256+ * If UTMPOK is defined and your system (incorrectly) counts logins by
257+ * counting non-null entries in /etc/utmp (instead of counting non-null
258+ * entries with no hostname that are not on a pseudo tty), define USRLIMIT
259+ * to have screen put an upper-limit on the number of entries to write
260+ * into /etc/utmp. This helps to keep you from exceeding a limited-user
261+ * license.
262+ */
263+#undef USRLIMIT
264+
265+/*
266+ * both must be defined if you want to favor tcsendbreak over
267+ * other calls to generate a break condition on serial lines.
268+ * (Do not bother, if you are not using plain tty windows.)
269+ */
270+#define POSIX_HAS_A_GOOD_TCSENDBREAK
271+#define SUNOS4_AND_WE_TRUST_TCSENDBREAK
272+
273+/*
274+ * to lower the interrupt load on the host machine, you may want to
275+ * adjust the VMIN and VTIME settings used for plain tty windows.
276+ * See the termio(4) manual page (Non-Canonical Mode Input Processing)
277+ * for details.
278+ * if undefined, VMIN=1, VTIME=0 is used as a default - this gives you
279+ * best user responsiveness, but highest interrupt frequency.
280+ * (Do not bother, if you are not using plain tty windows.)
281+ */
282+#define TTYVMIN 100
283+#define TTYVTIME 2
284+
285+/*
286+ * looks like the above values are ignored by setting FNDELAY.
287+ * This is default for all pty/ttys, you may disable it for
288+ * ttys here. After playing with it for a while, one may find out
289+ * that this feature may cause screen to lock up.
290+ */
291+#ifdef bsdi
292+# define TTY_DISABLE_FNBLOCK /* select barfs without it ... */
293+#endif
294+
295+
296+/*
297+ * Some terminals, e.g. Wyse 120, use a bitfield to select attributes.
298+ * This doesn't work with the standard so/ul/m? terminal entries,
299+ * because they will cancel each other out.
300+ * On TERMINFO machines, "sa" (sgr) may work. If you want screen
301+ * to switch attributes only with sgr, define USE_SGR.
302+ * This is *not* recomended, do this only if you must.
303+ */
304+#undef USE_SGR
305+
306+
307+/*
308+ * Define USE_LOCALE if you want screen to use the locale names
309+ * for the name of the month and day of the week.
310+ */
311+#define USE_LOCALE
312+
313+/*
314+ * Define USE_PAM if your system supports PAM (Pluggable Authentication
315+ * Modules) and you want screen to use it instead of calling crypt().
316+ * (You may also need to add -lpam to LIBS in the Makefile.)
317+ */
318+#undef USE_PAM
319+
320+/*
321+ * Define CHECK_SCREEN_W if you want screen to set TERM to screen-w
322+ * if the terminal width is greater than 131 columns. No longer needed
323+ * on modern systems which use $COLUMNS or the tty settings instead.
324+ */
325+#undef CHECK_SCREEN_W
326+
327+/**********************************************************************
328+ *
329+ * End of User Configuration Section
330+ *
331+ * Rest of this file is modified by 'configure'
332+ * Change at your own risk!
333+ *
334+ */
335+])
336+# end of AH_TOP
337+
338+AC_PREFIX_PROGRAM(screen)
339+AC_PREFIX_PROGRAM(gzip)
340 AC_PREFIX_PROGRAM(screen)
341 AC_PREFIX_PROGRAM(gzip)
342
343@@ -46,6 +365,7 @@ AC_PROG_CPP
344 AC_PROG_GCC_TRADITIONAL
345 AC_ISC_POSIX
346
347+AC_MSG_CHECKING([for compiler sanity])
348 AC_TRY_RUN(main(){exit(0);},,[
349 if test $CC != cc ; then
350 AC_NOTE(Your $CC failed - restarting with CC=cc)
351@@ -54,14 +374,9 @@ CC=cc
352 export CC
353 exec $0 $configure_args
354 fi
355-])
356+],AC_MSG_WARN([skipping test due to crosscompilation]))
357
358-AC_TRY_RUN(main(){exit(0);},,
359-exec 5>&2
360-eval $ac_link
361-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
362-AC_NOTE($ac_compile)
363-AC_MSG_ERROR(Can't run the compiler - sorry))
364+AC_MSG_CHECKING([if compiler sets exit status])
365
366 AC_TRY_RUN([
367 main()
368@@ -69,7 +384,8 @@ main()
369 int __something_strange_();
370 __something_strange_(0);
371 }
372-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
373+],AC_MSG_ERROR(Your compiler does not set the exit status - sorry),,
374+AC_MSG_WARN(skipping test due to crosscompilation))
375
376 AC_PROG_AWK
377
378@@ -103,6 +419,7 @@ AC_ARG_ENABLE(socket-dir,
379 dnl
380 dnl **** special unix variants ****
381 dnl
382+AH_TEMPLATE(ISC,[])
383 if test -n "$ISC"; then
384 AC_DEFINE(ISC) LIBS="$LIBS -linet"
385 fi
386@@ -114,11 +431,13 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
387 dnl fi
388 dnl fi
389
390+AH_TEMPLATE([sysV68],[])
391 if test -f /sysV68 ; then
392 AC_DEFINE(sysV68)
393 fi
394
395 AC_CHECKING(for MIPS)
396+AH_TEMPLATE([MIPS],[])
397 if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
398 oldlibs="$LIBS"
399 test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha.
400@@ -132,6 +451,8 @@ AC_DEFINE(MIPS)
401 AC_CHECKING(wait3)
402 AC_TRY_LINK(,[wait3();], ,
403 AC_CHECKING(wait2)
404+AH_TEMPLATE([USE_WAIT2],[On RISCOS we prefer wait2() over wait3(). rouilj@sni-usa.com])
405+dnl TODO(Hannes) shipped config.h.in wraps the define in #ifdef BSDWAIT
406 AC_TRY_LINK(,[wait2();],
407 dnl John Rouillard (rouilj@sni-usa.com):
408 dnl need -I/usr/include/bsd in RISCOS otherwise sockets are broken, no
409@@ -154,9 +475,11 @@ if test -f /usr/lib/libpyr.a ; then
410 oldlibs="$LIBS"
411 LIBS="$LIBS -lpyr"
412 AC_CHECKING(Pyramid OSX)
413+AH_TEMPLATE([OSX], [Pyramid OSX])
414 AC_TRY_LINK(,[open_controlling_pty("")], AC_DEFINE(OSX), LIBS="$oldlibs")
415 fi
416
417+AH_TEMPLATE([POSIX],[Define POSIX if your system supports IEEE Std 1003.1-1988 (POSIX).])
418 dnl ghazi@caip.rutgers.edu (Kaveh R. Ghazi):
419 dnl BBN butterfly is not POSIX, but a MACH BSD system.
420 dnl Do not define POSIX and TERMIO.
421@@ -183,6 +506,7 @@ main () {
422 fi
423
424 AC_CHECKING(for System V)
425+AH_TEMPLATE([SYSV], [Define SYSV if your machine is SYSV complient (Sys V, HPUX, A/UX)])
426 AC_TRY_COMPILE(
427 [#include <sys/types.h>
428 #include <signal.h>
429@@ -198,6 +522,11 @@ AC_EGREP_CPP(yes,
430 oldlibs="$LIBS"
431 LIBS="$LIBS -lelf"
432 AC_CHECKING(SVR4)
433+AH_TEMPLATE([SVR4],[])
434+AH_TEMPLATE([BUGGYGETLOGIN],
435+[If ttyslot() breaks getlogin() by returning indexes to utmp entries
436+ of type DEAD_PROCESS, then our getlogin() replacement should be
437+ selected by defining BUGGYGETLOGIN.])
438 AC_TRY_LINK([#include <utmpx.h>
439 ],,
440 [AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
441@@ -235,6 +564,9 @@ dnl **** Job control ****
442 dnl
443
444 AC_CHECKING(BSD job jontrol)
445+AH_TEMPLATE([BSDJOBS],
446+[Define BSDJOBS if you have BSD-style job control (both process
447+ groups and a tty that deals correctly with them)])
448 AC_TRY_LINK(
449 [#include <sys/types.h>
450 #include <sys/ioctl.h>
451@@ -255,6 +587,10 @@ dnl
452 dnl **** setreuid(), seteuid() ****
453 dnl
454 AC_CHECKING(setreuid)
455+AH_TEMPLATE([HAVE_SETREUID],
456+[If your system has the calls setreuid() and setregid(),
457+ define HAVE_SETREUID. Otherwise screen will use a forked process to
458+ safely create output files without retaining any special privileges.])
459 AC_TRY_LINK(,[
460 #ifdef __hpux
461 setresuid(0, 0, 0);
462@@ -269,6 +605,9 @@ dnl NeXT, AUX, ISC, and ultrix are still broken (no saved uid support)
463 dnl Solaris seteuid doesn't change the saved uid, bad for
464 dnl multiuser screen sessions
465 AC_CHECKING(seteuid)
466+AH_TEMPLATE([HAVE_SETEUID],
467+[If your system supports BSD4.4's seteuid() and setegid(), define
468+ HAVE_SETEUID.])
469 AC_TRY_LINK(,[
470 #if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
471 seteuid_is_broken(0);
472@@ -292,7 +631,8 @@ dnl
473 dnl **** FIFO tests ****
474 dnl
475
476-AC_CHECKING(fifos)
477+AC_CACHE_CHECK([usable fifos],
478+ [screen_cv_sys_fifo_usable],
479 AC_TRY_RUN([
480 #include <sys/types.h>
481 #include <sys/stat.h>
482@@ -357,12 +697,14 @@ main()
483 exit(1);
484 exit(0);
485 }
486-], AC_NOTE(- your fifos are usable) fifo=1,
487-AC_NOTE(- your fifos are not usable))
488-rm -f /tmp/conftest*
489-
490-if test -n "$fifo"; then
491-AC_CHECKING(for broken fifo implementation)
492+], screen_cv_sys_fifo_usable=yes, screen_cv_sys_fifo_usable=no))
493+
494+if test X"$screen_cv_sys_fifo_usable" = Xyes; then
495+AH_TEMPLATE([BROKEN_PIPE],
496+[Define this if your system exits select() immediatly if a pipe is
497+ opened read-only and no writer has opened it.])
498+AC_CACHE_CHECK([broken fifo implementation],
499+ [screen_cv_sys_fifo_broken_impl],
500 AC_TRY_RUN([
501 #include <sys/types.h>
502 #include <fcntl.h>
503@@ -407,9 +749,11 @@ main()
504 exit(1);
505 exit(0);
506 }
507-], AC_NOTE(- your implementation is ok),
508-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
509-rm -f /tmp/conftest*
510+], screen_cv_sys_fifo_broken_impl=no,
511+screen_cv_sys_fifo_broken_impl=yes))
512+if test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then
513+ AC_DEFINE(BROKEN_PIPE)
514+fi
515 fi
516
517 dnl
518@@ -418,7 +762,8 @@ dnl
519 dnl may need LIBS="$LIBS -lsocket" here
520 dnl
521
522-AC_CHECKING(sockets)
523+AC_CACHE_CHECK([sockets are usable],
524+ [screen_cv_sys_sockets_usable],
525 AC_TRY_RUN([
526 #include <sys/types.h>
527 #include <sys/socket.h>
528@@ -469,12 +814,16 @@ main()
529 exit(1);
530 exit(0);
531 }
532-], AC_NOTE(- your sockets are usable) sock=1,
533-AC_NOTE(- your sockets are not usable))
534-rm -f /tmp/conftest*
535+], screen_cv_sys_sockets_usable=yes,
536+screen_cv_sys_sockets_usable=no))
537
538-if test -n "$sock"; then
539+if test X"$screen_cv_sys_sockets_usable" = Xyes; then
540 AC_CHECKING(socket implementation)
541+AH_TEMPLATE([SOCK_NOT_IN_FS],
542+[Define this if the unix-domain socket implementation doesn't
543+ create a socket in the filesystem.])
544+AC_CACHE_CHECK([if sockets are not stored in the filesystem],
545+ [screen_cv_sys_sockets_nofs],
546 AC_TRY_RUN([
547 #include <sys/types.h>
548 #include <sys/stat.h>
549@@ -500,22 +849,25 @@ main()
550 close(s);
551 exit(0);
552 }
553-],AC_NOTE(- you are normal),
554-AC_NOTE(- unix domain sockets are not kept in the filesystem)
555-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
556-rm -f /tmp/conftest*
557+], screen_cv_sys_sockets_nofs=no,
558+screen_cv_sys_sockets_nofs=yes))
559+
560+if test X"$screen_cv_sys_sockets_nofs" = Xyes; then
561+ AC_DEFINE(SOCK_NOT_IN_FS)
562+fi
563 fi
564
565
566 dnl
567 dnl **** choose sockets or fifos ****
568 dnl
569-if test -n "$fifo"; then
570- if test -n "$sock"; then
571- if test -n "$nore"; then
572+AH_TEMPLATE([NAMEDPIPE], [Define this if your system supports named pipes.])
573+if test X"$screen_cv_sys_fifo_usable" = Xyes; then
574+ if test X"$screen_cv_sys_sockets_usable" = Xyes; then
575+ if test X"$screen_cv_sys_sockets_nofs" = Xyes; then
576 AC_NOTE(- hmmm... better take the fifos)
577 AC_DEFINE(NAMEDPIPE)
578- elif test -n "$fifobr"; then
579+ elif test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then
580 AC_NOTE(- as your fifos are broken lets use the sockets.)
581 else
582 AC_NOTE(- both sockets and fifos usable. let's take fifos.)
583@@ -525,7 +877,7 @@ if test -n "$fifo"; then
584 AC_NOTE(- using named pipes, of course)
585 AC_DEFINE(NAMEDPIPE)
586 fi
587-elif test -n "$sock"; then
588+elif test X"$screen_cv_sys_sockets_usable" = Xyes; then
589 AC_NOTE(- using unix-domain sockets, of course)
590 else
591 AC_MSG_ERROR(you have neither usable sockets nor usable pipes -> no screen)
592@@ -535,7 +887,11 @@ dnl
593 dnl **** check the select implementation ****
594 dnl
595
596-AC_CHECKING(select return value)
597+AH_TEMPLATE([SELECT_BROKEN],
598+[If the select return value doesn't treat a descriptor that is
599+ usable for reading and writing as two hits, define SELECT_BROKEN.])
600+AC_CACHE_CHECK([for broken select return value],
601+ [screen_cv_sys_select_broken_retval],
602 AC_TRY_RUN([
603 #include <sys/types.h>
604 #include <sys/stat.h>
605@@ -634,17 +990,26 @@ main()
606 exit(1);
607 exit(0);
608 }
609-],AC_NOTE(- select is ok),
610-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
611+], screen_cv_sys_select_broken_retval=no,
612+screen_cv_sys_select_broken_retval=yes))
613+if test X"$screen_cv_sys_select_broken_retval" = Xyes; then
614+ AC_DEFINE(SELECT_BROKEN)
615+fi
616
617 dnl
618 dnl **** termcap or terminfo ****
619 dnl
620+AH_TEMPLATE([TERMINFO],
621+[Define TERMINFO if your machine emulates the termcap routines
622+ with the terminfo database.
623+ Thus the .screenrc file is parsed for
624+ the command 'terminfo' and not 'termcap'])
625 AC_CHECKING(for tgetent)
626 AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
627 olibs="$LIBS"
628 LIBS="-lcurses $olibs"
629 AC_CHECKING(libcurses)
630+AC_CHECK_LIB(ncursesw,tgetent)
631 AC_TRY_LINK(,[
632 #ifdef __hpux
633 __sorry_hpux_libcurses_is_totally_broken_in_10_10();
634@@ -662,25 +1027,39 @@ LIBS="-lncurses $olibs"
635 AC_CHECKING(libncurses)
636 AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
637 AC_MSG_ERROR(!!! no tgetent - no screen))))))
638-
639-AC_TRY_RUN([
640+AC_CACHE_CHECK([using terminfo database],[screen_cv_sys_terminfo_used],
641+ AC_TRY_RUN([
642 main()
643 {
644 exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
645-}], AC_NOTE(- you use the termcap database),
646-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
647+}
648+ ], screen_cv_sys_terminfo_used=no,
649+ screen_cv_sys_terminfo_used=yes)
650+)
651+
652+if test X"$screen_cv_sys_terminfo_used" = Xyes; then
653+ AC_DEFINE(TERMINFO)
654+fi
655+
656 AC_CHECKING(ospeed)
657+AH_TEMPLATE([NEED_OSPEED],[If your library does not define ospeed, define this.])
658 AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
659
660 dnl
661 dnl **** PTY specific things ****
662 dnl
663+AH_TEMPLATE([HAVE_DEV_PTC],
664+[define HAVE_DEV_PTC if you have a /dev/ptc character special
665+ device.])
666 AC_CHECKING(for /dev/ptc)
667 if test -r /dev/ptc; then
668 AC_DEFINE(HAVE_DEV_PTC)
669 fi
670
671 AC_CHECKING(for SVR4 ptys)
672+AH_TEMPLATE([HAVE_SVR4_PTYS],
673+[define HAVE_SVR4_PTYS if you have a /dev/ptmx character special
674+ device and support the ptsname(), grantpt(), unlockpt() functions.])
675 sysvr4ptys=
676 if test -c /dev/ptmx ; then
677 AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
678@@ -696,6 +1075,13 @@ AC_CHECK_FUNCS(openpty,,
679 fi
680
681 AC_CHECKING(for ptyranges)
682+AH_TEMPLATE([PTYRANGE0],
683+[define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen
684+ to unusual environments. E.g. For SunOs the defaults are "qpr" and
685+ "0123456789abcdef". For SunOs 4.1.2
686+ #define PTYRANGE0 "pqrstuvwxyzPQRST"
687+ is recommended by Dan Jacobson.])
688+AH_TEMPLATE([PTYRANGE1],[])
689 if test -d /dev/ptym ; then
690 pdir='/dev/ptym'
691 else
692@@ -812,6 +1198,9 @@ dnl
693 dnl **** utmp handling ****
694 dnl
695 AC_CHECKING(getutent)
696+AH_TEMPLATE([GETUTENT],
697+[If your system has getutent(), pututline(), etc. to write to the
698+ utmp file, define GETUTENT.])
699 AC_TRY_LINK([
700 #include <time.h> /* to get time_t on SCO */
701 #include <sys/types.h>
702@@ -845,6 +1234,7 @@ AC_TRY_LINK([
703 [int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs")
704 )
705 AC_CHECKING(ut_host)
706+AH_TEMPLATE([UTHOST],[Define UTHOST if the utmp file has a host field.])
707 AC_TRY_COMPILE([
708 #include <time.h>
709 #include <sys/types.h>
710@@ -855,8 +1245,9 @@ AC_TRY_COMPILE([
711 #include <utmp.h>
712 #endif
713 ],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE(UTHOST))
714+AH_TEMPLATE([HAVE_UTEMPTER],[Define if you have the utempter utmp helper program])
715 AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
716-if test "$have_utempter" = yes; then
717+if test X"$have_utempter" = Xyes; then
718 AC_DEFINE(HAVE_UTEMPTER)
719 LIBS="$LIBS -lutempter"
720 fi
721@@ -864,20 +1255,39 @@ fi
722 dnl
723 dnl **** loadav ****
724 dnl
725+
726+AH_TEMPLATE([LOADAV],
727+[If you want the "time" command to display the current load average
728+ define LOADAV. Maybe you must install screen with the needed
729+ privileges to read /dev/kmem.
730+ Note that NLIST_ stuff is only checked, when getloadavg() is not available.
731+])
732+AH_TEMPLATE([LOADAV_NUM])
733+AH_TEMPLATE([LOADAV_TYPE])
734+AH_TEMPLATE([LOADAV_SCALE])
735+AH_TEMPLATE([LOADAV_GETLOADAVG])
736+AH_TEMPLATE([LOADAV_UNIX])
737+AH_TEMPLATE([LOADAV_AVENRUN])
738+AH_TEMPLATE([LOADAV_USE_NLIST64])
739+
740+AH_TEMPLATE([NLIST_DECLARED])
741+AH_TEMPLATE([NLIST_STRUCT])
742+AH_TEMPLATE([NLIST_NAME_UNION])
743+
744 AC_CHECKING(for libutil(s))
745-test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
746-test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
747+dnl I have no idea whether "login" is an appropriate symbol to check for here - Hannes
748+AC_CHECK_LIB(utils,login)
749+AC_CHECK_LIB(util,login)
750
751 AC_CHECKING(getloadavg)
752 AC_TRY_LINK(,[getloadavg((double *)0, 0);],
753 AC_DEFINE(LOADAV_GETLOADAVG) load=1,
754-if test -f /usr/lib/libkvm.a ; then
755 olibs="$LIBS"
756-LIBS="$LIBS -lkvm"
757+AC_CHECK_LIB(kvm,kvm_open,
758 AC_CHECKING(getloadavg with -lkvm)
759 AC_TRY_LINK(,[getloadavg((double *)0, 0);],
760 AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
761-fi
762+)
763 )
764
765 if test -z "$load" ; then
766@@ -1019,6 +1429,12 @@ if test -n "$loadscale" ; then AC_DEFINE_UNQUOTED(LOADAV_SCALE,$loadscale) fi
767 dnl
768 dnl **** signal handling ****
769 dnl
770+
771+AH_TEMPLATE([SIGVOID],
772+[Define SIGVOID if your signal handlers return void. On older
773+ systems, signal returns int, but on newer ones, it returns void.])
774+
775+
776 if test -n "$posix" ; then
777
778 dnl POSIX has reliable signals with void return type.
779@@ -1036,6 +1452,7 @@ AC_TRY_COMPILE(
780 #endif
781 extern void (*signal ()) ();], [int i;], AC_DEFINE(SIGVOID))
782 AC_CHECKING(sigset)
783+AH_TEMPLATE([USESIGSET], [Define USESIGSET if you have sigset for BSD 4.1 reliable signals.])
784 AC_TRY_LINK([
785 #include <sys/types.h>
786 #include <signal.h>
787@@ -1047,6 +1464,9 @@ sigset(0, (int (*)())0);
788 #endif
789 ], AC_DEFINE(USESIGSET))
790 AC_CHECKING(signal implementation)
791+AH_TEMPLATE([SYSVSIGS],
792+[Define SYSVSIGS if signal handlers must be reinstalled after
793+ they have been called.])
794 AC_TRY_RUN([
795 #include <sys/types.h>
796 #include <signal.h>
797@@ -1089,13 +1509,14 @@ dnl **** libraries ****
798 dnl
799
800 AC_CHECKING(for crypt and sec libraries)
801-test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
802+dnl I have no idea whether "crypt" is an appropriate symbol to check for here - Hannes
803+AC_CHECK_LIB(crypt_d,crypt)
804 oldlibs="$LIBS"
805-LIBS="$LIBS -lcrypt"
806 AC_CHECKING(crypt)
807 AC_TRY_LINK(,,,LIBS="$oldlibs")
808-test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
809-test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
810+AC_CHECK_LIB(crypt,crypt)
811+AC_CHECK_LIB(sec,crypt)
812+AC_CHECK_LIB(shadow,getspnam)
813 oldlibs="$LIBS"
814 LIBS="$LIBS -lsun"
815 AC_CHECKING(IRIX sun library)
816@@ -1118,6 +1539,13 @@ dnl
817 dnl **** misc things ****
818 dnl
819 AC_CHECKING(wait union)
820+AH_TEMPLATE([BSDWAIT],
821+[Define BSDWAIT if your system defines a 'union wait' in <sys/wait.h>
822+
823+ Only allow BSDWAIT i.e. wait3 on nonposix systems, since
824+ posix implies wait(3) and waitpid(3). vdlinden@fwi.uva.nl
825+ TODO(Hannes) shipped config.h.in does that with a #ifdef
826+])
827 AC_TRY_COMPILE([#include <sys/types.h>
828 #include <sys/wait.h>
829 ],[
830@@ -1128,6 +1556,12 @@ AC_TRY_COMPILE([#include <sys/types.h>
831 #endif
832 ],AC_DEFINE(BSDWAIT))
833
834+AH_TEMPLATE([TERMIO],
835+[Define TERMIO if you have struct termio instead of struct sgttyb.
836+ This is usually the case for SVID systems, where BSD uses sgttyb.
837+ POSIX systems should define this anyway, even though they use
838+ struct termios.])
839+
840 if test -z "$butterfly"; then
841 AC_CHECKING(for termio or termios)
842 AC_TRY_CPP([#include <termio.h>], AC_DEFINE(TERMIO),
843@@ -1137,17 +1571,34 @@ fi
844 )
845 fi
846
847+AH_TEMPLATE([CYTERMIO], [Define CYTERMIO if you have cyrillic termio modes.])
848 dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
849 AC_CHECKING(getspnam)
850+AH_TEMPLATE([SHADOWPW],
851+[If the passwords are stored in a shadow file and you want the
852+ builtin lock to work properly, define SHADOWPW.])
853 AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
854
855 AC_CHECKING(getttyent)
856+AH_TEMPLATE([GETTTYENT],
857+[If your system has the new format /etc/ttys (like 4.3 BSD) and the
858+ getttyent(3) library functions, define GETTTYENT.])
859 AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
860
861 AC_CHECKING(fdwalk)
862+AH_TEMPLATE([HAVE_FDWALK],
863+[Newer versions of Solaris include fdwalk, which can greatly improve
864+ the startup time of screen; otherwise screen spends a lot of time
865+ closing file descriptors.])
866 AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
867
868-AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
869+AH_TEMPLATE([USEBCOPY],
870+[Define USEBCOPY if the bcopy/memcpy from your system's C library
871+ supports the overlapping of source and destination blocks. When
872+ undefined, screen uses its own (probably slower) version of bcopy().])
873+
874+AC_CACHE_CHECK([if bcopy handles overlap],
875+ [screen_cv_sys_bcopy_overlap],
876 AC_TRY_RUN([
877 main() {
878 char buf[10];
879@@ -1160,8 +1611,21 @@ main() {
880 if (strncmp(buf, "cdedef", 6))
881 exit(1);
882 exit(0); /* libc version works properly. */
883-}], AC_DEFINE(USEBCOPY))
884+}], screen_cv_sys_bcopy_overlap=yes,
885+screen_cv_sys_bcopy_overlap=no))
886+if test X"$screen_cv_sys_bcopy_overlap" = Xyes; then
887+ AC_DEFINE(USEBCOPY)
888+fi
889
890+AH_TEMPLATE([USEMEMMOVE],
891+[SYSV machines may have a working memcpy() -- Oh, this is
892+ quite unlikely. Tell me if you see one.
893+ "But then, memmove() should work, if at all available" he thought...
894+ Boing, never say "works everywhere" unless you checked SCO UNIX.
895+ Their memove fails the test in the configure script. Sigh. (Juergen)
896+])
897+AC_CACHE_CHECK([if memmove handles overlap],
898+ [screen_cv_sys_memmove_overlap],
899 AC_TRY_RUN([
900 #define bcopy(s,d,l) memmove(d,s,l)
901 main() {
902@@ -1175,9 +1639,15 @@ main() {
903 if (strncmp(buf, "cdedef", 6))
904 exit(1);
905 exit(0); /* libc version works properly. */
906-}], AC_DEFINE(USEMEMMOVE))
907-
908+}], screen_cv_sys_memmove_overlap=yes,
909+screen_cv_sys_memmove_overlap=no))
910+if test X"$screen_cv_sys_memmove_overlap" = Xyes; then
911+ AC_DEFINE(USEMEMMOVE)
912+fi
913
914+AH_TEMPLATE([USEMEMCPY],[])
915+AC_CACHE_CHECK([if memcpy handles overlap],
916+ [screen_cv_sys_memcpy_overlap],
917 AC_TRY_RUN([
918 #define bcopy(s,d,l) memcpy(d,s,l)
919 main() {
920@@ -1191,9 +1661,19 @@ main() {
921 if (strncmp(buf, "cdedef", 6))
922 exit(1);
923 exit(0); /* libc version works properly. */
924-}], AC_DEFINE(USEMEMCPY))
925+}], screen_cv_sys_memcpy_overlap=yes,
926+screen_cv_sys_memcpy_overlap=no))
927+if test X"$screen_cv_sys_memcpy_overlap" = Xyes; then
928+ AC_DEFINE(USEMEMCPY)
929+fi
930
931 AC_MSG_CHECKING(long file names)
932+AH_TEMPLATE([NAME_MAX],
933+[If you are on a SYS V machine that restricts filename length to 14
934+ characters, you may need to enforce that by setting NAME_MAX to 14])
935+dnl TODO(Hannes) shipped config.h.in has
936+dnl #undef NAME_MAX /* KEEP_UNDEF_HERE override system value */
937+dnl ahead of this
938 (echo 1 > /tmp/conftest9012345) 2>/dev/null
939 (echo 2 > /tmp/conftest9012346) 2>/dev/null
940 val=`cat /tmp/conftest9012345 2>/dev/null`
941@@ -1206,17 +1686,28 @@ fi
942 rm -f /tmp/conftest*
943
944 AC_MSG_CHECKING(for vsprintf)
945+AH_TEMPLATE([USEVARARGS],
946+[If your system has vsprintf() and requires the use of the macros in
947+ "varargs.h" to use functions with variable arguments,
948+ define USEVARARGS.])
949 AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
950
951 AC_HEADER_DIRENT
952
953 AC_MSG_CHECKING(for setenv)
954+AH_TEMPLATE([USESETENV], [If your system has setenv() and unsetenv() define USESETENV])
955 AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV),
956 AC_MSG_RESULT(no)
957 AC_MSG_CHECKING(for putenv)
958+AH_TEMPLATE([NEEDPUTENV],
959+[If your system does not come with a setenv()/putenv()/getenv()
960+ functions, you may bring in our own code by defining NEEDPUTENV.])
961 AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV)
962 ))
963 AC_MSG_CHECKING([for nl_langinfo(CODESET)])
964+AH_TEMPLATE([HAVE_NL_LANGINFO],
965+[define HAVE_NL_LANGINFO if your system has the nl_langinfo() call
966+ and <langinfo.h> defines CODESET.])
967 AC_TRY_LINK([
968 #include <langinfo.h>
969 ],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NL_LANGINFO), AC_MSG_RESULT(no))
970@@ -1266,7 +1757,8 @@ fi
971 dnl Ptx bug workaround -- insert -lc after -ltermcap
972 test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
973
974-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
975+AC_MSG_CHECKING(compiler sanity)
976+AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.), AC_MSG_WARN(Skipping test due to crosscompilation))
977
978 ETCSCREENRC="\"/usr/local/etc/screenrc\""
979 if test -n "$prefix"; then