ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/ptytty.m4
(Generate patch)

Comparing rxvt-unicode/ptytty.m4 (file contents):
Revision 1.13 by sf-exg, Wed Feb 17 10:24:06 2010 UTC vs.
Revision 1.14 by sf-exg, Wed Jul 21 08:46:13 2010 UTC

24 setresuid \ 24 setresuid \
25) 25)
26 26
27have_clone=no 27have_clone=no
28 28
29AC_MSG_CHECKING(for /dev/ptym/clone)
30if test -e /dev/ptym/clone; then
31 AC_MSG_RESULT(yes)
32 AC_DEFINE(HAVE_DEV_CLONE, 1, [Define to 1 if you have /dev/ptym/clone])
33 AC_DEFINE(CLONE_DEVICE, "/dev/ptym/clone", [clone device filename])
34 have_clone=yes
35else
36 AC_MSG_RESULT(no)
37fi
38
39AC_MSG_CHECKING(for /dev/ptc) 29AC_MSG_CHECKING(for /dev/ptc)
40if test -e /dev/ptc; then 30if test -e /dev/ptc; then
41 AC_MSG_RESULT(yes) 31 AC_MSG_RESULT(yes)
42 AC_DEFINE(HAVE_DEV_PTC, 1, [Define to 1 if you have /dev/ptc])
43 AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename]) 32 AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename])
44 have_clone=yes 33 have_clone=yes
45else 34else
46 AC_MSG_RESULT(no) 35 AC_MSG_RESULT(no)
47fi 36fi
73 AC_MSG_RESULT(yes)], 62 AC_MSG_RESULT(yes)],
74 [AC_MSG_RESULT(no)]) 63 [AC_MSG_RESULT(no)])
75fi 64fi
76 65
77if test -z "$unix98_pty"; then 66if test -z "$unix98_pty"; then
78 AC_CHECK_FUNCS(openpty, [], [AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"])]) 67 AC_SEARCH_LIBS(openpty, util, AC_DEFINE(HAVE_OPENPTY, 1, ""))
79fi 68fi
80]) 69])
81 70
82AC_DEFUN([UTMP_CHECK], 71AC_DEFUN([UTMP_CHECK],
83[ 72[
236 exit(0); 225 exit(0);
237}]])],[pt_cv_path_utmp=`cat conftestval`],[pt_cv_path_utmp=],[dnl 226}]])],[pt_cv_path_utmp=`cat conftestval`],[pt_cv_path_utmp=],[dnl
238 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])]) 227 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])])
239if test x$pt_cv_path_utmp != x; then 228if test x$pt_cv_path_utmp != x; then
240 AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp) 229 AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp)
241fi
242
243dnl# --------------------------------------------------------------------------
244
245dnl# find utmpx - if a utmp file exists at the same location and is more than
246dnl# a day newer, then dump the utmpx. People leave lots of junk around.
247AC_CACHE_CHECK(where utmpx is located, pt_cv_path_utmpx,
248[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
249#include <stdlib.h>
250#include <sys/types.h>
251#include <utmpx.h>
252#include <errno.h>
253#include <sys/stat.h>
254#ifdef HAVE_STRING_H
255#include <string.h>
256#endif
257main()
258{
259 char **u, *p, *utmplist[] = {
260#ifdef UTMPX_FILE
261 UTMPX_FILE,
262#endif
263#ifdef _PATH_UTMPX
264 _PATH_UTMPX,
265#endif
266 "/var/adm/utmpx", "/etc/utmpx", NULL };
267 FILE *a, *f=fopen("conftestval", "w");
268 struct stat statu, statux;
269 if (!f) exit(1);
270 for (u = utmplist; *u; u++) {
271 if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
272 if (stat(*u, &statux) < 0)
273 continue;
274 p = strdup(*u);
275 p[strlen(p) - 1] = '\0';
276 if (stat(p, &statu) >= 0
277 && (statu.st_mtime - statux.st_mtime > 86400))
278 continue;
279 fprintf(f, "%s\n", *u);
280 exit(0);
281 }
282 }
283 exit(0);
284}]])],[pt_cv_path_utmpx=`cat conftestval`],[pt_cv_path_utmpx=],[dnl
285 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])])
286if test x$pt_cv_path_utmpx != x; then
287 AC_DEFINE_UNQUOTED(UTMPX_FILE, "$pt_cv_path_utmpx", Define location of utmpx)
288fi 230fi
289 231
290dnl# -------------------------------------------------------------------------- 232dnl# --------------------------------------------------------------------------
291 233
292dnl# find wtmp 234dnl# find wtmp

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines