summaryrefslogtreecommitdiff
path: root/data/screen/autoconf.diff
blob: b6b45401865a15d730711633146c27a624710826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
diff -r -u screen-4.0.2/configure.in screen-4.0.2+iPhone/configure.in
--- screen-4.0.2/configure.in	2003-06-03 11:58:24.000000000 +0000
+++ screen-4.0.2+iPhone/configure.in	2008-02-12 10:55:24.000000000 +0000
@@ -46,31 +46,6 @@
 AC_PROG_GCC_TRADITIONAL
 AC_ISC_POSIX
 
-AC_TRY_RUN(main(){exit(0);},,[
-if test $CC != cc ; then
-AC_NOTE(Your $CC failed - restarting with CC=cc)
-AC_NOTE()
-CC=cc
-export CC
-exec $0 $configure_args
-fi
-])
-
-AC_TRY_RUN(main(){exit(0);},,
-exec 5>&2
-eval $ac_link
-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
-AC_NOTE($ac_compile)
-AC_MSG_ERROR(Can't run the compiler - sorry))
-
-AC_TRY_RUN([
-main()
-{
-  int __something_strange_();
-  __something_strange_(0);
-}
-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
-
 AC_PROG_AWK
 
 AC_PROG_INSTALL
@@ -293,73 +268,7 @@
 dnl
 
 AC_CHECKING(fifos)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#ifndef O_NONBLOCK
-#define O_NONBLOCK O_NDELAY
-#endif
-#ifndef S_IFIFO
-#define S_IFIFO 0010000
-#endif
-
-char *fin = "/tmp/conftest$$";
-
-main()
-{
-  struct stat stb;
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-  (void)alarm(5);
-#ifdef POSIX
-  if (mkfifo(fin, 0777))
-#else
-  if (mknod(fin, S_IFIFO|0777, 0))
-#endif
-    exit(1);
-  if (stat(fin, &stb) || (stb.st_mode & S_IFIFO) != S_IFIFO)
-    exit(1);
-  close(0);
-#ifdef __386BSD__
-  /*
-   * The next test fails under 386BSD, but screen works using fifos.
-   * Fifos in O_RDWR mode are only used for the BROKEN_PIPE case and for
-   * the select() configuration test.
-   */
-  exit(0);
-#endif
-  if (open(fin, O_RDONLY | O_NONBLOCK))
-    exit(1);
-  if (fork() == 0)
-    {
-      close(0);
-      if (open(fin, O_WRONLY | O_NONBLOCK))
-	exit(1);
-      close(0);
-      if (open(fin, O_WRONLY | O_NONBLOCK))
-	exit(1);
-      if (write(0, "TEST", 4) == -1)
-	exit(1);
-      exit(0);
-    }
-#ifdef FD_SET
-  FD_SET(0, &f);
-#else
-  f = 1;
-#endif
-  if (select(1, &f, 0, 0, 0) == -1)
-    exit(1);
-  exit(0);
-}
-], AC_NOTE(- your fifos are usable) fifo=1,
-AC_NOTE(- your fifos are not usable))
-rm -f /tmp/conftest*
+AC_NOTE(- your fifos are not usable)
 
 if test -n "$fifo"; then
 AC_CHECKING(for broken fifo implementation)
@@ -419,92 +328,10 @@
 dnl
 
 AC_CHECKING(sockets)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <fcntl.h>
-
-char *son = "/tmp/conftest$$";
-
-main()
-{
-  int s1, s2, l;
-  struct sockaddr_un a;
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-  (void)alarm(5);
-  if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-    exit(1);
-  a.sun_family = AF_UNIX;
-  strcpy(a.sun_path, son);
-  (void) unlink(son);
-  if (bind(s1, (struct sockaddr *) &a, strlen(son)+2) == -1)
-    exit(1);
-  if (listen(s1, 2))
-    exit(1);
-  if (fork() == 0)
-    {
-      if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-	kill(getppid(), 3);
-      (void)connect(s2, (struct sockaddr *)&a, strlen(son) + 2);
-      if (write(s2, "HELLO", 5) == -1)
-	kill(getppid(), 3);
-      exit(0);
-    }
-  l = sizeof(a);
-  close(0);
-  if (accept(s1, &a, &l))
-    exit(1);
-#ifdef FD_SET
-  FD_SET(0, &f);
-#else
-  f = 1;
-#endif
-  if (select(1, &f, 0, 0, 0) == -1)
-    exit(1);
-  exit(0);
-}
-], AC_NOTE(- your sockets are usable) sock=1,
-AC_NOTE(- your sockets are not usable))
-rm -f /tmp/conftest*
+AC_NOTE(- your sockets are usable) sock=1
 
-if test -n "$sock"; then
 AC_CHECKING(socket implementation)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-char *son = "/tmp/conftest$$";
-
-main()
-{
-  int s;
-  struct stat stb;
-  struct sockaddr_un a;
-  if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-    exit(0);
-  a.sun_family = AF_UNIX;
-  strcpy(a.sun_path, son);
-  (void) unlink(son);
-  if (bind(s, (struct sockaddr *) &a, strlen(son)+2) == -1)
-    exit(0);
-  if (stat(son, &stb))
-    exit(1);
-  close(s);
-  exit(0);
-}
-],AC_NOTE(- you are normal),
-AC_NOTE(- unix domain sockets are not kept in the filesystem)
-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
-rm -f /tmp/conftest*
-fi
+AC_NOTE(- you are normal)
 
 
 dnl
@@ -536,106 +363,7 @@
 dnl
 
 AC_CHECKING(select return value)
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-char *nam = "/tmp/conftest$$";
-
-#ifdef NAMEDPIPE
-
-#ifndef O_NONBLOCK
-#define O_NONBLOCK O_NDELAY
-#endif
-#ifndef S_IFIFO
-#define S_IFIFO 0010000
-#endif
-
-
-main()
-{
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-#ifdef __FreeBSD__
-/* From Andrew A. Chernov (ache@astral.msk.su):
- * opening RDWR fifo fails in BSD 4.4, but select return values are
- * right.
- */
-  exit(0);
-#endif
-  (void)alarm(5);
-#ifdef POSIX
-  if (mkfifo(nam, 0777))
-#else
-  if (mknod(nam, S_IFIFO|0777, 0))
-#endif
-    exit(1);
-  close(0);
-  if (open(nam, O_RDWR | O_NONBLOCK))
-    exit(1);
-  if (write(0, "TEST", 4) == -1)
-    exit(1);
-
-#else
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-main()
-{
-  int s1, s2, l;
-  struct sockaddr_un a;
-#ifdef FD_SET
-  fd_set f;
-#else
-  int f;
-#endif
-
-  (void)alarm(5);
-  if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-    exit(1);
-  a.sun_family = AF_UNIX;
-  strcpy(a.sun_path, nam);
-  (void) unlink(nam);
-  if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1)
-    exit(1);
-  if (listen(s1, 2))
-    exit(1);
-  if (fork() == 0)
-    {
-      if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
-	kill(getppid(), 3);
-      (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2);
-      if (write(s2, "HELLO", 5) == -1)
-	kill(getppid(), 3);
-      exit(0);
-    }
-  l = sizeof(a);
-  close(0);
-  if (accept(s1, (struct sockaddr *)&a, &l))
-    exit(1);
-#endif
-
-
-#ifdef FD_SET
-  FD_SET(0, &f);
-#else
-  f = 1;
-#endif
-  if (select(1, &f, 0, 0, 0) == -1)
-    exit(1);
-  if (select(1, &f, &f, 0, 0) != 2)
-    exit(1);
-  exit(0);
-}
-],AC_NOTE(- select is ok),
-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
+AC_NOTE(- select is ok)
 
 dnl
 dnl    ****  termcap or terminfo  ****
@@ -663,12 +391,7 @@
 AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
 AC_MSG_ERROR(!!! no tgetent - no screen))))))
 
-AC_TRY_RUN([
-main()
-{
- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
-}], AC_NOTE(- you use the termcap database),
-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
+AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)
 AC_CHECKING(ospeed)
 AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
 
@@ -731,81 +454,10 @@
 else
 
 AC_CHECKING(default tty permissions/group)
-rm -f conftest_grp
-AC_TRY_RUN([
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-main()
-{
-  struct stat sb;
-  char *x,*ttyname();
-  int om, m;
-  FILE *fp;
-
-  if (!(x = ttyname(0))) exit(1);
-  if (stat(x, &sb)) exit(1);
-  om = sb.st_mode;
-  if (om & 002) exit(0);
-  m = system("mesg y");
-  if (m == -1 || m == 127) exit(1);
-  if (stat(x, &sb)) exit(1);
-  m = sb.st_mode;
-  if (chmod(x, om)) exit(1);
-  if (m & 002) exit(0);
-  if (sb.st_gid == getgid()) exit(1);
-  if (!(fp=fopen("conftest_grp", "w")))
-    exit(1);
-  fprintf(fp, "%d\n", sb.st_gid);
-  fclose(fp);
-  exit(0);
-}
-],[
-    if test -f conftest_grp; then
-	ptygrp=`cat conftest_grp`
+	ptygrp=4
 	AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
 	AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
 	AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
-    else
-	AC_NOTE(- ptys are world accessable)
-    fi
-],[
-    WRITEPATH=''
-    XTERMPATH=''
-    AC_PATH_PROG(WRITEPATH, write)
-    AC_PATH_PROG(XTERMPATH, xterm)
-    found=
-    if test -n "$WRITEPATH$XTERMPATH"; then
-      findfollow=
-      lsfollow=
-      found=`find $WRITEPATH $XTERMPATH -follow -print 2>/dev/null`
-      if test -n "$found"; then
-	findfollow=-follow
-	lsfollow=L
-      fi
-      if test -n "$XTERMPATH"; then
-	ptygrpn=`ls -l$lsfollow $XTERMPATH | sed -n -e 1p | $AWK '{print $4}'`
-	if test tty != "$ptygrpn"; then
-	  XTERMPATH=
-	fi
-      fi
-    fi
-    if test -n "$WRITEPATH$XTERMPATH"; then
-      found=`find $WRITEPATH $XTERMPATH $findfollow -perm -2000 -print` 
-      if test -n "$found"; then
-	ptygrp=`ls -ln$lsfollow $found | sed -n -e 1p | $AWK '{print $4}'`
-	AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
-	AC_DEFINE_UNQUOTED(PTYMODE, $ptymode)
-	AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
-      else
-	AC_NOTE(- ptys are world accessable)
-      fi
-    else
-      AC_NOTE(- can't determine - assume ptys are world accessable)
-    fi
-  ]
-)
-rm -f conftest_grp
 fi
 
 dnl
@@ -1148,50 +800,9 @@
 AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
 
 AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
-AC_TRY_RUN([
-main() {
-  char buf[10];
-  strcpy(buf, "abcdefghi");
-  bcopy(buf, buf + 2, 3);
-  if (strncmp(buf, "ababcf", 6))
-    exit(1);
-  strcpy(buf, "abcdefghi");
-  bcopy(buf + 2, buf, 3);
-  if (strncmp(buf, "cdedef", 6))
-    exit(1);
-  exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEBCOPY))
-
-AC_TRY_RUN([
-#define bcopy(s,d,l) memmove(d,s,l)
-main() {
-  char buf[10];
-  strcpy(buf, "abcdefghi");
-  bcopy(buf, buf + 2, 3);
-  if (strncmp(buf, "ababcf", 6))
-    exit(1);
-  strcpy(buf, "abcdefghi");
-  bcopy(buf + 2, buf, 3);
-  if (strncmp(buf, "cdedef", 6))
-    exit(1);
-  exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEMEMMOVE))
-
-
-AC_TRY_RUN([
-#define bcopy(s,d,l) memcpy(d,s,l)
-main() {
-  char buf[10];
-  strcpy(buf, "abcdefghi");
-  bcopy(buf, buf + 2, 3);
-  if (strncmp(buf, "ababcf", 6))
-    exit(1);
-  strcpy(buf, "abcdefghi");
-  bcopy(buf + 2, buf, 3);
-  if (strncmp(buf, "cdedef", 6))
-    exit(1);
-  exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEMEMCPY))
+AC_DEFINE(USEBCOPY)
+AC_DEFINE(USEMEMMOVE)
+AC_DEFINE(USEMEMCPY)
 
 AC_MSG_CHECKING(long file names)
 (echo 1 > /tmp/conftest9012345) 2>/dev/null
@@ -1266,8 +877,6 @@
 dnl Ptx bug workaround -- insert -lc after -ltermcap
 test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
 
-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
-
 ETCSCREENRC="\"/usr/local/etc/screenrc\""
 if test -n "$prefix"; then
 ETCSCREENRC="\"$prefix/etc/screenrc\""