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.5 by ayin, Mon Jan 23 10:41:16 2006 UTC vs.
Revision 1.13 by sf-exg, Wed Feb 17 10:24:06 2010 UTC

7 pty.h \ 7 pty.h \
8 util.h \ 8 util.h \
9 libutil.h \ 9 libutil.h \
10 sys/ioctl.h \ 10 sys/ioctl.h \
11 sys/stropts.h \ 11 sys/stropts.h \
12 stropts.h \
12) 13)
13 14
14AC_CHECK_FUNCS( \ 15AC_CHECK_FUNCS( \
15 revoke \ 16 revoke \
16 _getpty \ 17 _getpty \
17 getpt \ 18 getpt \
18 posix_openpt \ 19 posix_openpt \
19 isastream \ 20 isastream \
21 setuid \
22 seteuid \
23 setreuid \
24 setresuid \
20) 25)
21 26
22have_clone=no 27have_clone=no
23 28
24AC_MSG_CHECKING(for /dev/ptym/clone) 29AC_MSG_CHECKING(for /dev/ptym/clone)
59 ;; 64 ;;
60esac 65esac
61 66
62if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then 67if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then
63 AC_MSG_CHECKING(for UNIX98 ptys) 68 AC_MSG_CHECKING(for UNIX98 ptys)
64 AC_TRY_LINK([#include <stdlib.h>], 69 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]],
65 [grantpt(0);unlockpt(0);ptsname(0);], 70 [[grantpt(0);unlockpt(0);ptsname(0);]])],
66 [unix98_pty=yes 71 [unix98_pty=yes
67 AC_DEFINE(UNIX98_PTY, 1, "") 72 AC_DEFINE(UNIX98_PTY, 1, "")
68 AC_MSG_RESULT(yes)], 73 AC_MSG_RESULT(yes)],
69 [AC_MSG_RESULT(no)]) 74 [AC_MSG_RESULT(no)])
70fi 75fi
79support_utmp=yes 84support_utmp=yes
80support_wtmp=yes 85support_wtmp=yes
81support_lastlog=yes 86support_lastlog=yes
82 87
83AC_ARG_ENABLE(utmp, 88AC_ARG_ENABLE(utmp,
84 [ --enable-utmp enable utmp (utmpx) support], 89 [AS_HELP_STRING([--enable-utmp],[enable utmp (utmpx) support])],
85 [if test x$enableval = xyes -o x$enableval = xno; then 90 [if test x$enableval = xyes -o x$enableval = xno; then
86 support_utmp=$enableval 91 support_utmp=$enableval
87 fi]) 92 fi])
88 93
89AC_ARG_ENABLE(wtmp, 94AC_ARG_ENABLE(wtmp,
90 [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)], 95 [AS_HELP_STRING([--enable-wtmp],[enable wtmp (wtmpx) support (requires --enable-utmp)])],
91 [if test x$enableval = xyes -o x$enableval = xno; then 96 [if test x$enableval = xyes -o x$enableval = xno; then
92 support_wtmp=$enableval 97 support_wtmp=$enableval
93 fi]) 98 fi])
94 99
95AC_ARG_ENABLE(lastlog, 100AC_ARG_ENABLE(lastlog,
96 [ --enable-lastlog enable lastlog support (requires --enable-utmp)], 101 [AS_HELP_STRING([--enable-lastlog],[enable lastlog support (requires --enable-utmp)])],
97 [if test x$enableval = xyes -o x$enableval = xno; then 102 [if test x$enableval = xyes -o x$enableval = xno; then
98 support_lastlog=$enableval 103 support_lastlog=$enableval
99 fi]) 104 fi])
100 105
101if test x$support_utmp = xyes; then 106if test x$support_utmp = xyes; then
107if test x$support_lastlog = xyes; then 112if test x$support_lastlog = xyes; then
108 AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled) 113 AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled)
109fi 114fi
110 115
111AC_CHECK_FUNCS( \ 116AC_CHECK_FUNCS( \
112 ttyslot \
113 updwtmp \ 117 updwtmp \
114 updwtmpx \ 118 updwtmpx \
119 updlastlogx \
115) 120)
116 121
117AC_CHECK_HEADERS( \ 122AC_CHECK_HEADERS(lastlog.h)
118 utmp.h \
119 utmpx.h \
120 lastlog.h \
121)
122 123
123dnl# -------------------------------------------------------------------------- 124dnl# --------------------------------------------------------------------------
124dnl# DO ALL UTMP AND WTMP CHECKING 125dnl# DO ALL UTMP AND WTMP CHECKING
125dnl# -------------------------------------------------------------------------- 126dnl# --------------------------------------------------------------------------
126dnl# check for host field in utmp structure 127dnl# check for host field in utmp structure
127 128
128dnl# -------------------------------------------- 129dnl# --------------------------------------------
129AC_CHECK_HEADER(utmp.h, 130AC_CHECK_HEADERS(utmp.h,
130[AC_CACHE_CHECK([for struct utmp], struct_utmp, 131[AC_CACHE_CHECK([for struct utmp], pt_cv_struct_utmp,
131[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 132[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
132#include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])]) 133#include <utmp.h>]], [[struct utmp ut;]])],[pt_cv_struct_utmp=yes],[pt_cv_struct_utmp=no])])
133if test x$struct_utmp = xyes; then 134if test x$pt_cv_struct_utmp = xyes; then
134 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) 135 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)
135fi 136fi
136] 137]
137 138
138AC_CACHE_CHECK(for ut_host in utmp struct, struct_utmp_host, 139AC_CACHE_CHECK(for ut_host in utmp struct, pt_cv_struct_utmp_host,
139[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 140[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
140#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[struct_utmp_host=yes],[struct_utmp_host=no])]) 141#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[pt_cv_struct_utmp_host=yes],[pt_cv_struct_utmp_host=no])])
141if test x$struct_utmp_host = xyes; then 142if test x$pt_cv_struct_utmp_host = xyes; then
142 AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) 143 AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)
143fi 144fi
144 145
145AC_CACHE_CHECK(for ut_pid in utmp struct, struct_utmp_pid, 146AC_CACHE_CHECK(for ut_pid in utmp struct, pt_cv_struct_utmp_pid,
146[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 147[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
147#include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[struct_utmp_pid=yes],[struct_utmp_pid=no])]) 148#include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[pt_cv_struct_utmp_pid=yes],[pt_cv_struct_utmp_pid=no])])
148if test x$struct_utmp_pid = xyes; then 149if test x$pt_cv_struct_utmp_pid = xyes; then
149 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) 150 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)
150fi 151fi
151) dnl# AC_CHECK_HEADER(utmp.h 152) dnl# AC_CHECK_HEADERS(utmp.h
152 153
153dnl# -------------------------------------------- 154dnl# --------------------------------------------
154 155
155AC_CHECK_HEADER(utmpx.h, 156AC_CHECK_HEADERS(utmpx.h,
156[AC_CACHE_CHECK([for struct utmpx], struct_utmpx, 157[AC_CACHE_CHECK([for struct utmpx], pt_cv_struct_utmpx,
157[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 158[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
158#include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])]) 159#include <utmpx.h>]], [[struct utmpx ut;]])],[pt_cv_struct_utmpx=yes],[pt_cv_struct_utmpx=no])])
159if test x$struct_utmpx = xyes; then 160if test x$pt_cv_struct_utmpx = xyes; then
160 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) 161 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)
161fi 162fi
162] 163]
163 164
164AC_CACHE_CHECK(for host in utmpx struct, struct_utmpx_host, 165AC_CACHE_CHECK(for host in utmpx struct, pt_cv_struct_utmpx_host,
165[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 166[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
166#include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[struct_utmpx_host=yes],[struct_utmpx_host=no])]) 167#include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[pt_cv_struct_utmpx_host=yes],[pt_cv_struct_utmpx_host=no])])
167if test x$struct_utmpx_host = xyes; then 168if test x$pt_cv_struct_utmpx_host = xyes; then
168 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) 169 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)
169fi 170fi
170 171
171AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session, 172AC_CACHE_CHECK(for session in utmpx struct, pt_cv_struct_utmpx_session,
172[AC_TRY_COMPILE([#include <sys/types.h> 173[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
173#include <utmpx.h>], 174#include <utmpx.h>]], [[struct utmpx utx; utx.ut_session;]])],[pt_cv_struct_utmpx_session=yes],[pt_cv_struct_utmpx_session=no])])
174[struct utmpx utx; utx.ut_session;],
175struct_utmpx_session=yes, struct_utmpx_session=no)])
176if test x$struct_utmpx_session = xyes; then 175if test x$pt_cv_struct_utmpx_session = xyes; then
177 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) 176 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)
178fi 177fi
179) dnl# AC_CHECK_HEADER(utmpx.h 178) dnl# AC_CHECK_HEADERS(utmpx.h
180 179
181dnl# -------------------------------------------------------------------------- 180dnl# --------------------------------------------------------------------------
182dnl# check for struct lastlog 181dnl# check for struct lastlog
183AC_CACHE_CHECK(for struct lastlog, struct_lastlog, 182AC_CACHE_CHECK(for struct lastlog, pt_cv_struct_lastlog,
184[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 183[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
185#include <utmp.h> 184#include <utmp.h>
186#ifdef HAVE_LASTLOG_H 185#ifdef HAVE_LASTLOG_H
187#include <lastlog.h> 186#include <lastlog.h>
188#endif 187#endif
189]], [[struct lastlog ll;]])],[struct_lastlog=yes],[struct_lastlog=no])]) 188]], [[struct lastlog ll;]])],[pt_cv_struct_lastlog=yes],[pt_cv_struct_lastlog=no])])
190if test x$struct_lastlog = xyes; then 189if test x$pt_cv_struct_lastlog = xyes; then
191 AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog) 190 AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)
192fi 191fi
193 192
194dnl# check for struct lastlogx 193dnl# check for struct lastlogx
195AC_CACHE_CHECK(for struct lastlogx, struct_lastlogx, 194AC_CACHE_CHECK(for struct lastlogx, pt_cv_struct_lastlogx,
196[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 195[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
197#include <utmpx.h> 196#include <utmpx.h>
198#ifdef HAVE_LASTLOG_H 197#ifdef HAVE_LASTLOG_H
199#include <lastlog.h> 198#include <lastlog.h>
200#endif 199#endif
201]], [[struct lastlogx ll;]])],[struct_lastlogx=yes],[struct_lastlogx=no])]) 200]], [[struct lastlogx ll;]])],[pt_cv_struct_lastlogx=yes],[pt_cv_struct_lastlogx=no])])
202if test x$struct_lastlogx = xyes; then 201if test x$pt_cv_struct_lastlogx = xyes; then
203 AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx) 202 AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)
204fi 203fi
205 204
206dnl# -------------------------------------------------------------------------- 205dnl# --------------------------------------------------------------------------
207dnl# FIND FILES 206dnl# FIND FILES
208dnl# -------------------------------------------------------------------------- 207dnl# --------------------------------------------------------------------------
209 208
210dnl# find utmp 209dnl# find utmp
211AC_CACHE_CHECK(where utmp is located, path_utmp, 210AC_CACHE_CHECK(where utmp is located, pt_cv_path_utmp,
212[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 211[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
212#include <stdlib.h>
213#include <sys/types.h> 213#include <sys/types.h>
214#include <utmp.h> 214#include <utmp.h>
215#include <errno.h> 215#include <errno.h>
216main() 216main()
217{ 217{
232 fprintf(f, "%s\n", *u); 232 fprintf(f, "%s\n", *u);
233 exit(0); 233 exit(0);
234 } 234 }
235 } 235 }
236 exit(0); 236 exit(0);
237}]])],[path_utmp=`cat conftestval`],[path_utmp=],[dnl 237}]])],[pt_cv_path_utmp=`cat conftestval`],[pt_cv_path_utmp=],[dnl
238 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])]) 238 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])])
239if test x$path_utmp != x; then 239if test x$pt_cv_path_utmp != x; then
240 AC_DEFINE_UNQUOTED(UTMP_FILE, "$path_utmp", Define location of utmp) 240 AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp)
241fi 241fi
242 242
243dnl# -------------------------------------------------------------------------- 243dnl# --------------------------------------------------------------------------
244 244
245dnl# find utmpx - if a utmp file exists at the same location and is more than 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. 246dnl# a day newer, then dump the utmpx. People leave lots of junk around.
247AC_CACHE_CHECK(where utmpx is located, path_utmpx, 247AC_CACHE_CHECK(where utmpx is located, pt_cv_path_utmpx,
248[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 248[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
249#include <stdlib.h>
249#include <sys/types.h> 250#include <sys/types.h>
250#include <utmpx.h> 251#include <utmpx.h>
251#include <errno.h> 252#include <errno.h>
252#include <sys/stat.h> 253#include <sys/stat.h>
253#ifdef HAVE_STRING_H 254#ifdef HAVE_STRING_H
278 fprintf(f, "%s\n", *u); 279 fprintf(f, "%s\n", *u);
279 exit(0); 280 exit(0);
280 } 281 }
281 } 282 }
282 exit(0); 283 exit(0);
283}]])],[path_utmpx=`cat conftestval`],[path_utmpx=],[dnl 284}]])],[pt_cv_path_utmpx=`cat conftestval`],[pt_cv_path_utmpx=],[dnl
284 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])]) 285 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])])
285if test x$path_utmpx != x; then 286if test x$pt_cv_path_utmpx != x; then
286 AC_DEFINE_UNQUOTED(UTMPX_FILE, "$path_utmpx", Define location of utmpx) 287 AC_DEFINE_UNQUOTED(UTMPX_FILE, "$pt_cv_path_utmpx", Define location of utmpx)
287fi 288fi
288 289
289dnl# -------------------------------------------------------------------------- 290dnl# --------------------------------------------------------------------------
290 291
291dnl# find wtmp 292dnl# find wtmp
292AC_CACHE_CHECK(where wtmp is located, path_wtmp, 293AC_CACHE_CHECK(where wtmp is located, pt_cv_path_wtmp,
293[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 294[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
295#include <stdlib.h>
294#include <sys/types.h> 296#include <sys/types.h>
295#ifdef HAVE_UTMP_H 297#ifdef HAVE_UTMP_H
296#include <utmp.h> 298#include <utmp.h>
297#endif 299#endif
298#include <errno.h> 300#include <errno.h>
299main() 301main()
300{ 302{
301 char **w, *wtmplist[] = { 303 char **w, *wtmplist[] = {
302 "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; 304 "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL };
303 FILE *a, *f=fopen("conftestval", "w"); 305 FILE *a, *f=fopen("conftestval", "w");
304 if (!f) exit(1); 306 if (!f) exit(1);
305#ifdef WTMP_FILE 307#ifdef WTMP_FILE
306 fprintf(f, "%s\n", WTMP_FILE); 308 fprintf(f, "%s\n", WTMP_FILE);
307 exit(0); 309 exit(0);
315 fprintf(f, "%s\n", *w); 317 fprintf(f, "%s\n", *w);
316 exit(0); 318 exit(0);
317 } 319 }
318 } 320 }
319 exit(0); 321 exit(0);
320}]])],[path_wtmp=`cat conftestval`],[path_wtmp=],[dnl 322}]])],[pt_cv_path_wtmp=`cat conftestval`],[pt_cv_path_wtmp=],[dnl
321 AC_MSG_WARN(Define WTMP_FILE in config.h manually)])]) 323 AC_MSG_WARN(Define WTMP_FILE in config.h manually)])])
322if test x$path_wtmp != x; then 324if test x$pt_cv_path_wtmp != x; then
323 AC_DEFINE_UNQUOTED(WTMP_FILE, "$path_wtmp", Define location of wtmp) 325 AC_DEFINE_UNQUOTED(WTMP_FILE, "$pt_cv_path_wtmp", Define location of wtmp)
324fi 326fi
325dnl# -------------------------------------------------------------------------- 327dnl# --------------------------------------------------------------------------
326 328
327dnl# find wtmpx 329dnl# find wtmpx
328AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, 330AC_CACHE_CHECK(where wtmpx is located, pt_cv_path_wtmpx,
329[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 331[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
332#include <stdlib.h>
330#ifdef HAVE_UTMPX_H 333#ifdef HAVE_UTMPX_H
331#include <utmpx.h> 334#include <utmpx.h>
332#endif 335#endif
333#include <errno.h> 336#include <errno.h>
334main() 337main()
335{ 338{
336 char **w, *wtmplist[] = { 339 char **w, *wtmplist[] = {
337 "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; 340 "/var/log/wtmpx", "/var/adm/wtmpx", NULL };
338 FILE *a, *f=fopen("conftestval", "w"); 341 FILE *a, *f=fopen("conftestval", "w");
339 if (!f) exit(1); 342 if (!f) exit(1);
340#ifdef WTMPX_FILE 343#ifdef WTMPX_FILE
341 fprintf(f, "%s\n", WTMPX_FILE); 344 fprintf(f, "%s\n", WTMPX_FILE);
342 exit(0); 345 exit(0);
350 fprintf(f, "%s\n", *w); 353 fprintf(f, "%s\n", *w);
351 exit(0); 354 exit(0);
352 } 355 }
353 } 356 }
354 exit(0); 357 exit(0);
355}]])],[path_wtmpx=`cat conftestval`],[path_wtmpx=],[dnl 358}]])],[pt_cv_path_wtmpx=`cat conftestval`],[pt_cv_path_wtmpx=],[dnl
356 AC_MSG_WARN(Define WTMPX_FILE in config.h manually)])]) 359 AC_MSG_WARN(Define WTMPX_FILE in config.h manually)])])
357if test x$path_wtmpx != x; then 360if test x$pt_cv_path_wtmpx != x; then
358 AC_DEFINE_UNQUOTED(WTMPX_FILE, "$path_wtmpx", Define location of wtmpx) 361 AC_DEFINE_UNQUOTED(WTMPX_FILE, "$pt_cv_path_wtmpx", Define location of wtmpx)
359fi 362fi
360dnl# -------------------------------------------------------------------------- 363dnl# --------------------------------------------------------------------------
361 364
362dnl# find lastlog 365dnl# find lastlog
363AC_CACHE_CHECK(where lastlog is located, path_lastlog, 366AC_CACHE_CHECK(where lastlog is located, pt_cv_path_lastlog,
364[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 367[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
368#include <stdlib.h>
365#include <sys/types.h> 369#include <sys/types.h>
366#ifdef HAVE_UTMPX_H 370#ifdef HAVE_UTMPX_H
367#include <utmpx.h> 371#include <utmpx.h>
368#elif defined(HAVE_UTMP_H) 372#elif defined(HAVE_UTMP_H)
369#include <utmp.h> 373#include <utmp.h>
390 fprintf(f, "%s\n", *w); 394 fprintf(f, "%s\n", *w);
391 exit(0); 395 exit(0);
392 } 396 }
393 } 397 }
394 exit(0); 398 exit(0);
395}]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl 399}]])],[pt_cv_path_lastlog=`cat conftestval`],[pt_cv_path_lastlog=],[dnl
396 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])]) 400 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])])
397if test x$path_lastlog != x; then 401if test x$pt_cv_path_lastlog != x; then
398 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog) 402 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$pt_cv_path_lastlog", Define location of lastlog)
399 if test -d "$path_lastlog"; then
400 AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory)
401 fi
402fi 403fi
403dnl# -------------------------------------------------------------------------- 404dnl# --------------------------------------------------------------------------
404 405
405dnl# find lastlogx 406dnl# find lastlogx
406AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, 407AC_CACHE_CHECK(where lastlogx is located, pt_cv_path_lastlogx,
407[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 408[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
409#include <stdlib.h>
408#ifdef HAVE_UTMPX_H 410#ifdef HAVE_UTMPX_H
409#include <utmpx.h> 411#include <utmpx.h>
410#endif 412#endif
411#include <errno.h> 413#include <errno.h>
412main() 414main()
427 fprintf(f, "%s\n", *w); 429 fprintf(f, "%s\n", *w);
428 exit(0); 430 exit(0);
429 } 431 }
430 } 432 }
431 exit(0); 433 exit(0);
432}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl 434}]])],[pt_cv_path_lastlogx=`cat conftestval`],[pt_cv_path_lastlogx=],[dnl
433 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) 435 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])])
434if test x$path_lastlogx != x; then 436if test x$pt_cv_path_lastlogx != x; then
435 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) 437 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$pt_cv_path_lastlogx", Define location of lastlogx)
436fi
437
438if test x$support_utmp != xyes; then
439 echo " utmp support: disabled"
440 echo
441else
442 echo " utmp support: enabled
443 utmp file: $path_utmp
444 utmpx file: $path_utmpx
445 wtmp file: $path_wtmp
446 wtmpx file: $path_wtmpx
447 lastlog file: $path_lastlog
448 lastlogx file: $path_lastlogx"
449fi 438fi
450]) 439])
451 440
452AC_DEFUN([SCM_RIGHTS_CHECK], 441AC_DEFUN([SCM_RIGHTS_CHECK],
453[ 442[
454AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, 443AC_CACHE_CHECK(for unix-compliant filehandle passing ability, pt_cv_can_pass_fds,
455[AC_TRY_LINK([ 444[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
456#include <cstddef> // broken bsds (is that redundant) need this 445#include <cstddef> // broken bsds (is that redundant?) need this
457#include <sys/types.h> 446#include <sys/types.h>
458#include <sys/socket.h> 447#include <sys/socket.h>
459#include <sys/uio.h> 448#include <sys/uio.h>
460],[ 449]], [[
461{ 450{
462 msghdr msg; 451 msghdr msg;
463 iovec iov; 452 iovec iov;
464 char buf [100]; 453 char buf [100];
465 char data = 0; 454 char data = 0;
479 468
480 *(int *)CMSG_DATA (cmsg) = 5; 469 *(int *)CMSG_DATA (cmsg) = 5;
481 470
482 return sendmsg (3, &msg, 0); 471 return sendmsg (3, &msg, 0);
483} 472}
484],[can_pass_fds=yes],[can_pass_fds=no])]) 473]])],[pt_cv_can_pass_fds=yes],[pt_cv_can_pass_fds=no])])
485if test x$can_pass_fds = xyes; then 474if test x$pt_cv_can_pass_fds = xyes; then
486 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) 475 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing)
487else 476else
488 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) 477 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability])
489fi 478fi
490]) 479])
491 480
492AC_DEFUN([TTY_GROUP_CHECK], 481AC_DEFUN([TTY_GROUP_CHECK],
493[ 482[
494AC_CACHE_CHECK([for tty group], tty_group, 483AC_CACHE_CHECK([for tty group], pt_cv_tty_group,
495[AC_TRY_RUN([ 484[AC_RUN_IFELSE([AC_LANG_SOURCE([[
496#include <sys/types.h> 485#include <sys/types.h>
497#include <sys/stat.h> 486#include <sys/stat.h>
498#include <unistd.h> 487#include <unistd.h>
499#include <grp.h> 488#include <grp.h>
500 489
510 && (stat(tty, &st)) == 0 499 && (stat(tty, &st)) == 0
511 && st.st_gid == gr->gr_gid) 500 && st.st_gid == gr->gr_gid)
512 return 0; 501 return 0;
513 else 502 else
514 return 1; 503 return 1;
515}],
516[tty_group=yes],[tty_group=no],[tty_group=no])]) 504}]])],[pt_cv_tty_group=yes],[pt_cv_tty_group=no],[pt_cv_tty_group=no])])
517if test x$tty_group = xyes; then 505if test x$pt_cv_tty_group = xyes; then
518 AC_DEFINE(TTY_GID_SUPPORT, 1, "") 506 AC_DEFINE(TTY_GID_SUPPORT, 1, "")
519fi]) 507fi])
520 508

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines