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