1 |
solar 09/04/19 19:58:04 |
2 |
|
3 |
Added: screen-4.0.3-crosscompile.patch |
4 |
Log: |
5 |
- update for cross compile. Fixes bug 193902 |
6 |
(Portage version: 2.1.6.7/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 app-misc/screen/files/screen-4.0.3-crosscompile.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/screen/files/screen-4.0.3-crosscompile.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/screen/files/screen-4.0.3-crosscompile.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: screen-4.0.3-crosscompile.patch |
15 |
=================================================================== |
16 |
--- configure.in~ 2008-11-23 17:43:48.000000000 +0000 |
17 |
+++ configure.in 2008-11-23 17:43:48.000000000 +0000 |
18 |
@@ -46,6 +46,7 @@ |
19 |
AC_PROG_GCC_TRADITIONAL |
20 |
AC_ISC_POSIX |
21 |
|
22 |
+AC_MSG_CHECKING([for compiler sanity]) |
23 |
AC_TRY_RUN(main(){exit(0);},,[ |
24 |
if test $CC != cc ; then |
25 |
AC_NOTE(Your $CC failed - restarting with CC=cc) |
26 |
@@ -54,22 +55,17 @@ |
27 |
export CC |
28 |
exec $0 $configure_args |
29 |
fi |
30 |
-]) |
31 |
- |
32 |
-AC_TRY_RUN(main(){exit(0);},, |
33 |
-exec 5>&2 |
34 |
-eval $ac_link |
35 |
-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;) |
36 |
-AC_NOTE($ac_compile) |
37 |
-AC_MSG_ERROR(Can't run the compiler - sorry)) |
38 |
+],AC_MSG_WARN([skipping test due to crosscompilation])) |
39 |
|
40 |
+AC_MSG_CHECKING([if compiler sets exit status]) |
41 |
AC_TRY_RUN([ |
42 |
main() |
43 |
{ |
44 |
int __something_strange_(); |
45 |
__something_strange_(0); |
46 |
} |
47 |
-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry)) |
48 |
+],AC_MSG_ERROR(Your compiler does not set the exit status - sorry),, |
49 |
+AC_MSG_WARN(skipping test due to crosscompilation)) |
50 |
|
51 |
AC_PROG_AWK |
52 |
|
53 |
@@ -103,6 +99,7 @@ |
54 |
dnl |
55 |
dnl **** special unix variants **** |
56 |
dnl |
57 |
+AH_TEMPLATE(ISC,[]) |
58 |
if test -n "$ISC"; then |
59 |
AC_DEFINE(ISC) LIBS="$LIBS -linet" |
60 |
fi |
61 |
@@ -114,11 +111,13 @@ |
62 |
dnl fi |
63 |
dnl fi |
64 |
|
65 |
+AH_TEMPLATE([sysV68],[]) |
66 |
if test -f /sysV68 ; then |
67 |
AC_DEFINE(sysV68) |
68 |
fi |
69 |
|
70 |
AC_CHECKING(for MIPS) |
71 |
+AH_TEMPLATE([MIPS],[]) |
72 |
if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then |
73 |
oldlibs="$LIBS" |
74 |
test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha. |
75 |
@@ -132,6 +131,8 @@ |
76 |
AC_CHECKING(wait3) |
77 |
AC_TRY_LINK(,[wait3();], , |
78 |
AC_CHECKING(wait2) |
79 |
+AH_TEMPLATE([USE_WAIT2],[On RISCOS we prefer wait2() over wait3(). rouilj@×××××××.com]) |
80 |
+dnl TODO(Hannes) shipped config.h.in wraps the define in #ifdef BSDWAIT |
81 |
AC_TRY_LINK(,[wait2();], |
82 |
dnl John Rouillard (rouilj@×××××××.com): |
83 |
dnl need -I/usr/include/bsd in RISCOS otherwise sockets are broken, no |
84 |
@@ -154,9 +155,11 @@ |
85 |
oldlibs="$LIBS" |
86 |
LIBS="$LIBS -lpyr" |
87 |
AC_CHECKING(Pyramid OSX) |
88 |
+AH_TEMPLATE([OSX], [Pyramid OSX]) |
89 |
AC_TRY_LINK(,[open_controlling_pty("")], AC_DEFINE(OSX), LIBS="$oldlibs") |
90 |
fi |
91 |
|
92 |
+AH_TEMPLATE([POSIX],[Define POSIX if your system supports IEEE Std 1003.1-1988 (POSIX).]) |
93 |
dnl ghazi@××××××××××××.edu (Kaveh R. Ghazi): |
94 |
dnl BBN butterfly is not POSIX, but a MACH BSD system. |
95 |
dnl Do not define POSIX and TERMIO. |
96 |
@@ -183,6 +186,7 @@ |
97 |
fi |
98 |
|
99 |
AC_CHECKING(for System V) |
100 |
+AH_TEMPLATE([SYSV], [Define SYSV if your machine is SYSV complient (Sys V, HPUX, A/UX)]) |
101 |
AC_TRY_COMPILE( |
102 |
[#include <sys/types.h> |
103 |
#include <signal.h> |
104 |
@@ -226,6 +230,9 @@ |
105 |
dnl |
106 |
|
107 |
AC_CHECKING(BSD job jontrol) |
108 |
+AH_TEMPLATE([BSDJOBS], |
109 |
+[Define BSDJOBS if you have BSD-style job control (both process |
110 |
+ groups and a tty that deals correctly with them)]) |
111 |
AC_TRY_LINK( |
112 |
[#include <sys/types.h> |
113 |
#include <sys/ioctl.h> |
114 |
@@ -246,6 +253,10 @@ |
115 |
dnl **** setreuid(), seteuid() **** |
116 |
dnl |
117 |
AC_CHECKING(setreuid) |
118 |
+AH_TEMPLATE([HAVE_SETREUID], |
119 |
+[If your system has the calls setreuid() and setregid(), |
120 |
+ define HAVE_SETREUID. Otherwise screen will use a forked process to |
121 |
+ safely create output files without retaining any special privileges.]) |
122 |
AC_TRY_LINK(,[ |
123 |
#ifdef __hpux |
124 |
setresuid(0, 0, 0); |
125 |
@@ -260,6 +271,9 @@ |
126 |
dnl Solaris seteuid doesn't change the saved uid, bad for |
127 |
dnl multiuser screen sessions |
128 |
AC_CHECKING(seteuid) |
129 |
+AH_TEMPLATE([HAVE_SETEUID], |
130 |
+[If your system supports BSD4.4's seteuid() and setegid(), define |
131 |
+ HAVE_SETEUID.]) |
132 |
AC_TRY_LINK(,[ |
133 |
#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news) |
134 |
seteuid_is_broken(0); |
135 |
@@ -284,6 +298,8 @@ |
136 |
dnl |
137 |
|
138 |
AC_CHECKING(fifos) |
139 |
+AC_CACHE_CHECK([usable fifos], |
140 |
+ [screen_cv_sys_fifo_usable], |
141 |
AC_TRY_RUN([ |
142 |
#include <sys/types.h> |
143 |
#include <sys/stat.h> |
144 |
@@ -348,12 +364,14 @@ |
145 |
exit(1); |
146 |
exit(0); |
147 |
} |
148 |
-], AC_NOTE(- your fifos are usable) fifo=1, |
149 |
-AC_NOTE(- your fifos are not usable)) |
150 |
-rm -f /tmp/conftest* |
151 |
+], screen_cv_sys_fifo_usable=yes, screen_cv_sys_fifo_usable=no)) |
152 |
|
153 |
-if test -n "$fifo"; then |
154 |
-AC_CHECKING(for broken fifo implementation) |
155 |
+if test X"$screen_cv_sys_fifo_usable" = Xyes; then |
156 |
+AH_TEMPLATE([BROKEN_PIPE], |
157 |
+[Define this if your system exits select() immediatly if a pipe is |
158 |
+ opened read-only and no writer has opened it.]) |
159 |
+AC_CACHE_CHECK([broken fifo implementation], |
160 |
+ [screen_cv_sys_fifo_broken_impl], |
161 |
AC_TRY_RUN([ |
162 |
#include <sys/types.h> |
163 |
#include <fcntl.h> |
164 |
@@ -398,9 +416,11 @@ |
165 |
exit(1); |
166 |
exit(0); |
167 |
} |
168 |
-], AC_NOTE(- your implementation is ok), |
169 |
-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1) |
170 |
-rm -f /tmp/conftest* |
171 |
+], screen_cv_sys_fifo_broken_impl=no, |
172 |
+screen_cv_sys_fifo_broken_impl=yes)) |
173 |
+if test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then |
174 |
+ AC_DEFINE(BROKEN_PIPE) |
175 |
+fi |
176 |
fi |
177 |
|
178 |
dnl |
179 |
@@ -410,6 +430,8 @@ |
180 |
dnl |
181 |
|
182 |
AC_CHECKING(sockets) |
183 |
+AC_CACHE_CHECK([sockets are usable], |
184 |
+ [screen_cv_sys_sockets_usable], |
185 |
AC_TRY_RUN([ |
186 |
#include <sys/types.h> |
187 |
#include <sys/socket.h> |
188 |
@@ -460,12 +482,16 @@ |
189 |
exit(1); |
190 |
exit(0); |
191 |
} |
192 |
-], AC_NOTE(- your sockets are usable) sock=1, |
193 |
-AC_NOTE(- your sockets are not usable)) |
194 |
-rm -f /tmp/conftest* |
195 |
+], screen_cv_sys_sockets_usable=yes, |
196 |
+screen_cv_sys_sockets_usable=no)) |
197 |
|
198 |
-if test -n "$sock"; then |
199 |
+if test X"$screen_cv_sys_sockets_usable" = Xyes; then |
200 |
AC_CHECKING(socket implementation) |
201 |
+AH_TEMPLATE([SOCK_NOT_IN_FS], |
202 |
+[Define this if the unix-domain socket implementation doesn't |
203 |
+ create a socket in the filesystem.]) |
204 |
+AC_CACHE_CHECK([if sockets are not stored in the filesystem], |
205 |
+ [screen_cv_sys_sockets_nofs], |
206 |
AC_TRY_RUN([ |
207 |
#include <sys/types.h> |
208 |
#include <sys/stat.h> |
209 |
@@ -491,22 +517,25 @@ |
210 |
close(s); |
211 |
exit(0); |
212 |
} |
213 |
-],AC_NOTE(- you are normal), |
214 |
-AC_NOTE(- unix domain sockets are not kept in the filesystem) |
215 |
-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1) |
216 |
-rm -f /tmp/conftest* |
217 |
+], screen_cv_sys_sockets_nofs=no, |
218 |
+screen_cv_sys_sockets_nofs=yes)) |
219 |
+ |
220 |
+if test X"$screen_cv_sys_sockets_nofs" = Xyes; then |
221 |
+ AC_DEFINE(SOCK_NOT_IN_FS) |
222 |
+fi |
223 |
fi |
224 |
|
225 |
|
226 |
dnl |
227 |
dnl **** choose sockets or fifos **** |
228 |
dnl |
229 |
-if test -n "$fifo"; then |
230 |
- if test -n "$sock"; then |
231 |
- if test -n "$nore"; then |
232 |
+AH_TEMPLATE([NAMEDPIPE], [Define this if your system supports named pipes.]) |
233 |
+if test X"$screen_cv_sys_fifo_usable" = Xyes; then |
234 |
+ if test X"$screen_cv_sys_sockets_usable" = Xyes; then |
235 |
+ if test X"$screen_cv_sys_sockets_nofs" = Xyes; then |
236 |
AC_NOTE(- hmmm... better take the fifos) |
237 |
AC_DEFINE(NAMEDPIPE) |
238 |
- elif test -n "$fifobr"; then |
239 |
+ elif test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then |
240 |
AC_NOTE(- as your fifos are broken lets use the sockets.) |
241 |
else |
242 |
AC_NOTE(- both sockets and fifos usable. let's take fifos.) |
243 |
@@ -516,7 +545,7 @@ |
244 |
AC_NOTE(- using named pipes, of course) |
245 |
AC_DEFINE(NAMEDPIPE) |
246 |
fi |
247 |
-elif test -n "$sock"; then |
248 |
+elif test X"$screen_cv_sys_sockets_usable" = Xyes; then |
249 |
AC_NOTE(- using unix-domain sockets, of course) |
250 |
else |
251 |
AC_MSG_ERROR(you have neither usable sockets nor usable pipes -> no screen) |
252 |
@@ -526,7 +555,11 @@ |
253 |
dnl **** check the select implementation **** |
254 |
dnl |
255 |
|
256 |
-AC_CHECKING(select return value) |
257 |
+AH_TEMPLATE([SELECT_BROKEN], |
258 |
+[If the select return value doesn't treat a descriptor that is |
259 |
+ usable for reading and writing as two hits, define SELECT_BROKEN.]) |
260 |
+AC_CACHE_CHECK([for broken select return value], |
261 |
+ [screen_cv_sys_select_broken_retval], |
262 |
AC_TRY_RUN([ |
263 |
#include <sys/types.h> |
264 |
#include <sys/stat.h> |
265 |
@@ -625,17 +658,26 @@ |
266 |
exit(1); |
267 |
exit(0); |
268 |
} |
269 |
-],AC_NOTE(- select is ok), |
270 |
-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN)) |
271 |
+], screen_cv_sys_select_broken_retval=no, |
272 |
+screen_cv_sys_select_broken_retval=yes)) |
273 |
+if test X"$screen_cv_sys_select_broken_retval" = Xyes; then |
274 |
+ AC_DEFINE(SELECT_BROKEN) |
275 |
+fi |
276 |
|
277 |
dnl |
278 |
dnl **** termcap or terminfo **** |
279 |
dnl |
280 |
+AH_TEMPLATE([TERMINFO], |
281 |
+[Define TERMINFO if your machine emulates the termcap routines |
282 |
+ with the terminfo database. |
283 |
+ Thus the .screenrc file is parsed for |
284 |
+ the command 'terminfo' and not 'termcap']) |
285 |
+ |
286 |
AC_CHECKING(for tgetent) |
287 |
AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
288 |
olibs="$LIBS" |
289 |
-LIBS="-lcurses $olibs" |
290 |
AC_CHECKING(libcurses) |
291 |
+AC_CHECK_LIB(ncursesw,tgetent) |
292 |
AC_TRY_LINK(,[ |
293 |
#ifdef __hpux |
294 |
__sorry_hpux_libcurses_is_totally_broken_in_10_10(); |
295 |
@@ -654,24 +696,39 @@ |
296 |
AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
297 |
AC_MSG_ERROR(!!! no tgetent - no screen)))))) |
298 |
|
299 |
-AC_TRY_RUN([ |
300 |
+AC_CACHE_CHECK([using terminfo database],[screen_cv_sys_terminfo_used], |
301 |
+ AC_TRY_RUN([ |
302 |
main() |
303 |
{ |
304 |
exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); |
305 |
-}], AC_NOTE(- you use the termcap database), |
306 |
-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)) |
307 |
+} |
308 |
+ ], screen_cv_sys_terminfo_used=no, |
309 |
+ screen_cv_sys_terminfo_used=yes) |
310 |
+) |
311 |
+ |
312 |
+if test X"$screen_cv_sys_terminfo_used" = Xyes; then |
313 |
+ AC_DEFINE(TERMINFO) |
314 |
+fi |
315 |
+ |
316 |
AC_CHECKING(ospeed) |
317 |
+AH_TEMPLATE([NEED_OSPEED],[If your library does not define ospeed, define this.]) |
318 |
AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED)) |
319 |
|
320 |
dnl |
321 |
dnl **** PTY specific things **** |
322 |
dnl |
323 |
+AH_TEMPLATE([HAVE_DEV_PTC], |
324 |
+[define HAVE_DEV_PTC if you have a /dev/ptc character special |
325 |
+ device.]) |
326 |
AC_CHECKING(for /dev/ptc) |
327 |
if test -r /dev/ptc; then |
328 |
AC_DEFINE(HAVE_DEV_PTC) |
329 |
fi |
330 |
|
331 |
AC_CHECKING(for SVR4 ptys) |
332 |
+AH_TEMPLATE([HAVE_SVR4_PTYS], |
333 |
+[define HAVE_SVR4_PTYS if you have a /dev/ptmx character special |
334 |
+ device and support the ptsname(), grantpt(), unlockpt() functions.]) |
335 |
sysvr4ptys= |
336 |
if test -c /dev/ptmx ; then |
337 |
AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS) |
338 |
@@ -687,6 +744,13 @@ |
339 |
fi |
340 |
|
341 |
AC_CHECKING(for ptyranges) |
342 |
+AH_TEMPLATE([PTYRANGE0], |
343 |
+[define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen |
344 |
+ to unusual environments. E.g. For SunOs the defaults are "qpr" and |
345 |
+ "0123456789abcdef". For SunOs 4.1.2 |
346 |
+ #define PTYRANGE0 "pqrstuvwxyzPQRST" |
347 |
+ is recommended by Dan Jacobson.]) |
348 |
+AH_TEMPLATE([PTYRANGE1],[]) |
349 |
if test -d /dev/ptym ; then |
350 |
pdir='/dev/ptym' |
351 |
else |
352 |
@@ -850,20 +914,39 @@ |
353 |
dnl |
354 |
dnl **** loadav **** |
355 |
dnl |
356 |
+ |
357 |
+AH_TEMPLATE([LOADAV], |
358 |
+[If you want the "time" command to display the current load average |
359 |
+ define LOADAV. Maybe you must install screen with the needed |
360 |
+ privileges to read /dev/kmem. |
361 |
+ Note that NLIST_ stuff is only checked, when getloadavg() is not available. |
362 |
+]) |
363 |
+AH_TEMPLATE([LOADAV_NUM]) |
364 |
+AH_TEMPLATE([LOADAV_TYPE]) |
365 |
+AH_TEMPLATE([LOADAV_SCALE]) |
366 |
+AH_TEMPLATE([LOADAV_GETLOADAVG]) |
367 |
+AH_TEMPLATE([LOADAV_UNIX]) |
368 |
+AH_TEMPLATE([LOADAV_AVENRUN]) |
369 |
+AH_TEMPLATE([LOADAV_USE_NLIST64]) |
370 |
+ |
371 |
+AH_TEMPLATE([NLIST_DECLARED]) |
372 |
+AH_TEMPLATE([NLIST_STRUCT]) |
373 |
+AH_TEMPLATE([NLIST_NAME_UNION]) |
374 |
+ |
375 |
AC_CHECKING(for libutil(s)) |
376 |
-test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils" |
377 |
-test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil" |
378 |
+dnl I have no idea whether "login" is an appropriate symbol to check for here - Hannes |
379 |
+AC_CHECK_LIB(utils,login) |
380 |
+AC_CHECK_LIB(util,login) |
381 |
|
382 |
AC_CHECKING(getloadavg) |
383 |
AC_TRY_LINK(,[getloadavg((double *)0, 0);], |
384 |
AC_DEFINE(LOADAV_GETLOADAVG) load=1, |
385 |
-if test -f /usr/lib/libkvm.a ; then |
386 |
olibs="$LIBS" |
387 |
-LIBS="$LIBS -lkvm" |
388 |
+AC_CHECK_LIB(kvm,kvm_open, |
389 |
AC_CHECKING(getloadavg with -lkvm) |
390 |
AC_TRY_LINK(,[getloadavg((double *)0, 0);], |
391 |
AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs") |
392 |
-fi |
393 |
+) |
394 |
) |
395 |
|
396 |
if test -z "$load" ; then |
397 |
@@ -1005,6 +1088,11 @@ |
398 |
dnl |
399 |
dnl **** signal handling **** |
400 |
dnl |
401 |
+ |
402 |
+AH_TEMPLATE([SIGVOID], |
403 |
+[Define SIGVOID if your signal handlers return void. On older |
404 |
+ systems, signal returns int, but on newer ones, it returns void.]) |
405 |
+ |
406 |
if test -n "$posix" ; then |
407 |
|
408 |
dnl POSIX has reliable signals with void return type. |
409 |
@@ -1014,6 +1102,7 @@ |
410 |
else |
411 |
|
412 |
AC_CHECKING(return type of signal handlers) |
413 |
+AH_TEMPLATE([USESIGSET], [Define USESIGSET if you have sigset for BSD 4.1 reliable signals.]) |
414 |
AC_TRY_COMPILE( |
415 |
[#include <sys/types.h> |
416 |
#include <signal.h> |
417 |
@@ -1033,6 +1122,9 @@ |
418 |
#endif |
419 |
], AC_DEFINE(USESIGSET)) |
420 |
AC_CHECKING(signal implementation) |
421 |
+AH_TEMPLATE([SYSVSIGS], |
422 |
+[Define SYSVSIGS if signal handlers must be reinstalled after |
423 |
+ they have been called.]) |
424 |
AC_TRY_RUN([ |
425 |
#include <sys/types.h> |
426 |
#include <signal.h> |
427 |
@@ -1075,13 +1167,14 @@ |
428 |
dnl |
429 |
|
430 |
AC_CHECKING(for crypt and sec libraries) |
431 |
-test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d" |
432 |
+dnl I have no idea whether "crypt" is an appropriate symbol to check for here - Hannes |
433 |
+AC_CHECK_LIB(crypt_d,crypt) |
434 |
oldlibs="$LIBS" |
435 |
-LIBS="$LIBS -lcrypt" |
436 |
AC_CHECKING(crypt) |
437 |
AC_TRY_LINK(,,,LIBS="$oldlibs") |
438 |
-test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec" |
439 |
-test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow" |
440 |
+AC_CHECK_LIB(crypt,crypt) |
441 |
+AC_CHECK_LIB(sec,crypt) |
442 |
+AC_CHECK_LIB(shadow,getspnam) |
443 |
oldlibs="$LIBS" |
444 |
LIBS="$LIBS -lsun" |
445 |
AC_CHECKING(IRIX sun library) |
446 |
@@ -1104,6 +1197,13 @@ |
447 |
dnl **** misc things **** |
448 |
dnl |
449 |
AC_CHECKING(wait union) |
450 |
+AH_TEMPLATE([BSDWAIT], |
451 |
+[Define BSDWAIT if your system defines a 'union wait' in <sys/wait.h> |
452 |
+ |
453 |
+ Only allow BSDWAIT i.e. wait3 on nonposix systems, since |
454 |
+ posix implies wait(3) and waitpid(3). vdlinden@×××××××.nl |
455 |
+ TODO(Hannes) shipped config.h.in does that with a #ifdef |
456 |
+]) |
457 |
AC_TRY_COMPILE([#include <sys/types.h> |
458 |
#include <sys/wait.h> |
459 |
],[ |
460 |
@@ -1114,6 +1214,13 @@ |
461 |
#endif |
462 |
],AC_DEFINE(BSDWAIT)) |
463 |
|
464 |
+AH_TEMPLATE([TERMIO], |
465 |
+[Define TERMIO if you have struct termio instead of struct sgttyb. |
466 |
+ This is usually the case for SVID systems, where BSD uses sgttyb. |
467 |
+ POSIX systems should define this anyway, even though they use |
468 |
+ struct termios.]) |
469 |
+ |
470 |
+ |
471 |
if test -z "$butterfly"; then |
472 |
AC_CHECKING(for termio or termios) |
473 |
AC_TRY_CPP([#include <termio.h>], AC_DEFINE(TERMIO), |
474 |
@@ -1123,17 +1230,35 @@ |
475 |
) |
476 |
fi |
477 |
|
478 |
+AH_TEMPLATE([CYTERMIO], [Define CYTERMIO if you have cyrillic termio modes.]) |
479 |
+ |
480 |
dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW)) |
481 |
AC_CHECKING(getspnam) |
482 |
+AH_TEMPLATE([SHADOWPW], |
483 |
+[If the passwords are stored in a shadow file and you want the |
484 |
+ builtin lock to work properly, define SHADOWPW.]) |
485 |
AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW)) |
486 |
|
487 |
AC_CHECKING(getttyent) |
488 |
+AH_TEMPLATE([GETTTYENT], |
489 |
+[If your system has the new format /etc/ttys (like 4.3 BSD) and the |
490 |
+ getttyent(3) library functions, define GETTTYENT.]) |
491 |
AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT)) |
492 |
|
493 |
AC_CHECKING(fdwalk) |
494 |
+AH_TEMPLATE([HAVE_FDWALK], |
495 |
+[Newer versions of Solaris include fdwalk, which can greatly improve |
496 |
+ the startup time of screen; otherwise screen spends a lot of time |
497 |
+ closing file descriptors.]) |
498 |
AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK)) |
499 |
|
500 |
-AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments) |
501 |
+AH_TEMPLATE([USEBCOPY], |
502 |
+[Define USEBCOPY if the bcopy/memcpy from your system's C library |
503 |
+ supports the overlapping of source and destination blocks. When |
504 |
+ undefined, screen uses its own (probably slower) version of bcopy().]) |
505 |
+ |
506 |
+AC_CACHE_CHECK([if bcopy handles overlap], |
507 |
+ [screen_cv_sys_bcopy_overlap], |
508 |
AC_TRY_RUN([ |
509 |
main() { |
510 |
char buf[10]; |
511 |
@@ -1146,7 +1271,21 @@ |
512 |
if (strncmp(buf, "cdedef", 6)) |
513 |
exit(1); |
514 |
exit(0); /* libc version works properly. */ |
515 |
-}], AC_DEFINE(USEBCOPY)) |
516 |
+}], screen_cv_sys_bcopy_overlap=yes, |
517 |
+screen_cv_sys_bcopy_overlap=no)) |
518 |
+if test X"$screen_cv_sys_bcopy_overlap" = Xyes; then |
519 |
+ AC_DEFINE(USEBCOPY) |
520 |
+fi |
521 |
+ |
522 |
+AH_TEMPLATE([USEMEMMOVE], |
523 |
+[SYSV machines may have a working memcpy() -- Oh, this is |
524 |
+ quite unlikely. Tell me if you see one. |
525 |
+ "But then, memmove() should work, if at all available" he thought... |
526 |
+ Boing, never say "works everywhere" unless you checked SCO UNIX. |
527 |
+ Their memove fails the test in the configure script. Sigh. (Juergen) |
528 |
+]) |
529 |
+AC_CACHE_CHECK([if memmove handles overlap], |
530 |
+ [screen_cv_sys_memmove_overlap], |
531 |
|
532 |
AC_TRY_RUN([ |
533 |
#define bcopy(s,d,l) memmove(d,s,l) |
534 |
@@ -1161,9 +1300,15 @@ |
535 |
if (strncmp(buf, "cdedef", 6)) |
536 |
exit(1); |
537 |
exit(0); /* libc version works properly. */ |
538 |
-}], AC_DEFINE(USEMEMMOVE)) |
539 |
- |
540 |
+}], screen_cv_sys_memmove_overlap=yes, |
541 |
+screen_cv_sys_memmove_overlap=no)) |
542 |
+if test X"$screen_cv_sys_memmove_overlap" = Xyes; then |
543 |
+ AC_DEFINE(USEMEMMOVE) |
544 |
+fi |
545 |
|
546 |
+AH_TEMPLATE([USEMEMCPY],[]) |
547 |
+AC_CACHE_CHECK([if memcpy handles overlap], |
548 |
+ [screen_cv_sys_memcpy_overlap], |
549 |
AC_TRY_RUN([ |
550 |
#define bcopy(s,d,l) memcpy(d,s,l) |
551 |
main() { |
552 |
@@ -1177,9 +1322,19 @@ |
553 |
if (strncmp(buf, "cdedef", 6)) |
554 |
exit(1); |
555 |
exit(0); /* libc version works properly. */ |
556 |
-}], AC_DEFINE(USEMEMCPY)) |
557 |
+}], screen_cv_sys_memcpy_overlap=yes, |
558 |
+screen_cv_sys_memcpy_overlap=no)) |
559 |
+if test X"$screen_cv_sys_memcpy_overlap" = Xyes; then |
560 |
+ AC_DEFINE(USEMEMCPY) |
561 |
+fi |
562 |
|
563 |
AC_MSG_CHECKING(long file names) |
564 |
+AH_TEMPLATE([NAME_MAX], |
565 |
+[If you are on a SYS V machine that restricts filename length to 14 |
566 |
+ characters, you may need to enforce that by setting NAME_MAX to 14]) |
567 |
+dnl TODO(Hannes) shipped config.h.in has |
568 |
+dnl #undef NAME_MAX /* KEEP_UNDEF_HERE override system value */ |
569 |
+dnl ahead of this |
570 |
(echo 1 > /tmp/conftest9012345) 2>/dev/null |
571 |
(echo 2 > /tmp/conftest9012346) 2>/dev/null |
572 |
val=`cat /tmp/conftest9012345 2>/dev/null` |
573 |
@@ -1192,6 +1347,10 @@ |
574 |
rm -f /tmp/conftest* |
575 |
|
576 |
AC_MSG_CHECKING(for vsprintf) |
577 |
+AH_TEMPLATE([USEVARARGS], |
578 |
+[If your system has vsprintf() and requires the use of the macros in |
579 |
+ "varargs.h" to use functions with variable arguments, |
580 |
+ define USEVARARGS.]) |
581 |
AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], |
582 |
[AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS)], |
583 |
[AC_MSG_RESULT(no)]) |
584 |
@@ -1199,12 +1358,19 @@ |
585 |
AC_HEADER_DIRENT |
586 |
|
587 |
AC_MSG_CHECKING(for setenv) |
588 |
+AH_TEMPLATE([USESETENV], [If your system has setenv() and unsetenv() define USESETENV]) |
589 |
AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV), |
590 |
AC_MSG_RESULT(no) |
591 |
AC_MSG_CHECKING(for putenv) |
592 |
+AH_TEMPLATE([NEEDPUTENV], |
593 |
+[If your system does not come with a setenv()/putenv()/getenv() |
594 |
+ functions, you may bring in our own code by defining NEEDPUTENV.]) |
595 |
AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV) |
596 |
)) |
597 |
AC_MSG_CHECKING([for nl_langinfo(CODESET)]) |
598 |
+AH_TEMPLATE([HAVE_NL_LANGINFO], |
599 |
+[define HAVE_NL_LANGINFO if your system has the nl_langinfo() call |
600 |
+ and <langinfo.h> defines CODESET.]) |
601 |
AC_TRY_LINK([ |
602 |
#include <langinfo.h> |
603 |
],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NL_LANGINFO), AC_MSG_RESULT(no)) |
604 |
@@ -1254,7 +1420,8 @@ |
605 |
dnl Ptx bug workaround -- insert -lc after -ltermcap |
606 |
test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq" |
607 |
|
608 |
-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.)) |
609 |
+AC_MSG_CHECKING(compiler sanity) |
610 |
+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)) |
611 |
|
612 |
ETCSCREENRC="\"/usr/local/etc/screenrc\"" |
613 |
if test -n "$prefix"; then |