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

Comparing libptytty/ptytty.m4 (file contents):
Revision 1.6 by root, Wed Jan 25 21:17:46 2006 UTC vs.
Revision 1.15 by ayin, Mon Nov 5 22:06:56 2007 UTC

15 revoke \ 15 revoke \
16 _getpty \ 16 _getpty \
17 getpt \ 17 getpt \
18 posix_openpt \ 18 posix_openpt \
19 isastream \ 19 isastream \
20 setuid \
21 seteuid \
22 setreuid \
23 setresuid \
20) 24)
21 25
22have_clone=no 26have_clone=no
23 27
24AC_MSG_CHECKING(for /dev/ptym/clone) 28AC_MSG_CHECKING(for /dev/ptym/clone)
79support_utmp=yes 83support_utmp=yes
80support_wtmp=yes 84support_wtmp=yes
81support_lastlog=yes 85support_lastlog=yes
82 86
83AC_ARG_ENABLE(utmp, 87AC_ARG_ENABLE(utmp,
84 [ --enable-utmp enable utmp (utmpx) support], 88 [AS_HELP_STRING([--enable-utmp],[enable utmp (utmpx) support])],
85 [if test x$enableval = xyes -o x$enableval = xno; then 89 [if test x$enableval = xyes -o x$enableval = xno; then
86 support_utmp=$enableval 90 support_utmp=$enableval
87 fi]) 91 fi])
88 92
89AC_ARG_ENABLE(wtmp, 93AC_ARG_ENABLE(wtmp,
90 [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)], 94 [AS_HELP_STRING([--enable-wtmp],[enable wtmp (wtmpx) support (requires --enable-utmp)])],
91 [if test x$enableval = xyes -o x$enableval = xno; then 95 [if test x$enableval = xyes -o x$enableval = xno; then
92 support_wtmp=$enableval 96 support_wtmp=$enableval
93 fi]) 97 fi])
94 98
95AC_ARG_ENABLE(lastlog, 99AC_ARG_ENABLE(lastlog,
96 [ --enable-lastlog enable lastlog support (requires --enable-utmp)], 100 [AS_HELP_STRING([--enable-lastlog],[enable lastlog support (requires --enable-utmp)])],
97 [if test x$enableval = xyes -o x$enableval = xno; then 101 [if test x$enableval = xyes -o x$enableval = xno; then
98 support_lastlog=$enableval 102 support_lastlog=$enableval
99 fi]) 103 fi])
100 104
101if test x$support_utmp = xyes; then 105if test x$support_utmp = xyes; then
107if test x$support_lastlog = xyes; then 111if 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) 112 AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled)
109fi 113fi
110 114
111AC_CHECK_FUNCS( \ 115AC_CHECK_FUNCS( \
112 ttyslot \
113 updwtmp \ 116 updwtmp \
114 updwtmpx \ 117 updwtmpx \
118 updlastlogx \
115) 119)
116 120
117AC_CHECK_HEADERS( \ 121AC_CHECK_HEADERS(lastlog.h)
118 utmp.h \
119 utmpx.h \
120 lastlog.h \
121)
122 122
123dnl# -------------------------------------------------------------------------- 123dnl# --------------------------------------------------------------------------
124dnl# DO ALL UTMP AND WTMP CHECKING 124dnl# DO ALL UTMP AND WTMP CHECKING
125dnl# -------------------------------------------------------------------------- 125dnl# --------------------------------------------------------------------------
126dnl# check for host field in utmp structure 126dnl# check for host field in utmp structure
127 127
128dnl# -------------------------------------------- 128dnl# --------------------------------------------
129AC_CHECK_HEADER(utmp.h, 129AC_CHECK_HEADERS(utmp.h,
130[AC_CACHE_CHECK([for struct utmp], struct_utmp, 130[AC_CACHE_CHECK([for struct utmp], struct_utmp,
131[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 131[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
132#include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])]) 132#include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])])
133if test x$struct_utmp = xyes; then 133if test x$struct_utmp = xyes; then
134 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) 134 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)
146[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 146[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])]) 147#include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[struct_utmp_pid=yes],[struct_utmp_pid=no])])
148if test x$struct_utmp_pid = xyes; then 148if test x$struct_utmp_pid = xyes; then
149 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) 149 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)
150fi 150fi
151) dnl# AC_CHECK_HEADER(utmp.h 151) dnl# AC_CHECK_HEADERS(utmp.h
152 152
153dnl# -------------------------------------------- 153dnl# --------------------------------------------
154 154
155AC_CHECK_HEADER(utmpx.h, 155AC_CHECK_HEADERS(utmpx.h,
156[AC_CACHE_CHECK([for struct utmpx], struct_utmpx, 156[AC_CACHE_CHECK([for struct utmpx], struct_utmpx,
157[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 157[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
158#include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])]) 158#include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])])
159if test x$struct_utmpx = xyes; then 159if test x$struct_utmpx = xyes; then
160 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) 160 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)
174[struct utmpx utx; utx.ut_session;], 174[struct utmpx utx; utx.ut_session;],
175struct_utmpx_session=yes, struct_utmpx_session=no)]) 175struct_utmpx_session=yes, struct_utmpx_session=no)])
176if test x$struct_utmpx_session = xyes; then 176if test x$struct_utmpx_session = xyes; then
177 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) 177 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)
178fi 178fi
179) dnl# AC_CHECK_HEADER(utmpx.h 179) dnl# AC_CHECK_HEADERS(utmpx.h
180 180
181dnl# -------------------------------------------------------------------------- 181dnl# --------------------------------------------------------------------------
182dnl# check for struct lastlog 182dnl# check for struct lastlog
183AC_CACHE_CHECK(for struct lastlog, struct_lastlog, 183AC_CACHE_CHECK(for struct lastlog, struct_lastlog,
184[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 184[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
208dnl# -------------------------------------------------------------------------- 208dnl# --------------------------------------------------------------------------
209 209
210dnl# find utmp 210dnl# find utmp
211AC_CACHE_CHECK(where utmp is located, path_utmp, 211AC_CACHE_CHECK(where utmp is located, path_utmp,
212[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 212[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
213#include <stdlib.h>
213#include <sys/types.h> 214#include <sys/types.h>
214#include <utmp.h> 215#include <utmp.h>
215#include <errno.h> 216#include <errno.h>
216main() 217main()
217{ 218{
244 245
245dnl# find utmpx - if a utmp file exists at the same location and is more than 246dnl# 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. 247dnl# a day newer, then dump the utmpx. People leave lots of junk around.
247AC_CACHE_CHECK(where utmpx is located, path_utmpx, 248AC_CACHE_CHECK(where utmpx is located, path_utmpx,
248[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 249[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
250#include <stdlib.h>
249#include <sys/types.h> 251#include <sys/types.h>
250#include <utmpx.h> 252#include <utmpx.h>
251#include <errno.h> 253#include <errno.h>
252#include <sys/stat.h> 254#include <sys/stat.h>
253#ifdef HAVE_STRING_H 255#ifdef HAVE_STRING_H
289dnl# -------------------------------------------------------------------------- 291dnl# --------------------------------------------------------------------------
290 292
291dnl# find wtmp 293dnl# find wtmp
292AC_CACHE_CHECK(where wtmp is located, path_wtmp, 294AC_CACHE_CHECK(where wtmp is located, path_wtmp,
293[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 295[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
296#include <stdlib.h>
294#include <sys/types.h> 297#include <sys/types.h>
295#ifdef HAVE_UTMP_H 298#ifdef HAVE_UTMP_H
296#include <utmp.h> 299#include <utmp.h>
297#endif 300#endif
298#include <errno.h> 301#include <errno.h>
299main() 302main()
300{ 303{
301 char **w, *wtmplist[] = { 304 char **w, *wtmplist[] = {
302 "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; 305 "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL };
303 FILE *a, *f=fopen("conftestval", "w"); 306 FILE *a, *f=fopen("conftestval", "w");
304 if (!f) exit(1); 307 if (!f) exit(1);
305#ifdef WTMP_FILE 308#ifdef WTMP_FILE
306 fprintf(f, "%s\n", WTMP_FILE); 309 fprintf(f, "%s\n", WTMP_FILE);
307 exit(0); 310 exit(0);
325dnl# -------------------------------------------------------------------------- 328dnl# --------------------------------------------------------------------------
326 329
327dnl# find wtmpx 330dnl# find wtmpx
328AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, 331AC_CACHE_CHECK(where wtmpx is located, path_wtmpx,
329[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 332[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
333#include <stdlib.h>
330#ifdef HAVE_UTMPX_H 334#ifdef HAVE_UTMPX_H
331#include <utmpx.h> 335#include <utmpx.h>
332#endif 336#endif
333#include <errno.h> 337#include <errno.h>
334main() 338main()
335{ 339{
336 char **w, *wtmplist[] = { 340 char **w, *wtmplist[] = {
337 "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; 341 "/var/log/wtmpx", "/var/adm/wtmpx", NULL };
338 FILE *a, *f=fopen("conftestval", "w"); 342 FILE *a, *f=fopen("conftestval", "w");
339 if (!f) exit(1); 343 if (!f) exit(1);
340#ifdef WTMPX_FILE 344#ifdef WTMPX_FILE
341 fprintf(f, "%s\n", WTMPX_FILE); 345 fprintf(f, "%s\n", WTMPX_FILE);
342 exit(0); 346 exit(0);
360dnl# -------------------------------------------------------------------------- 364dnl# --------------------------------------------------------------------------
361 365
362dnl# find lastlog 366dnl# find lastlog
363AC_CACHE_CHECK(where lastlog is located, path_lastlog, 367AC_CACHE_CHECK(where lastlog is located, path_lastlog,
364[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 368[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
369#include <stdlib.h>
365#include <sys/types.h> 370#include <sys/types.h>
366#ifdef HAVE_UTMPX_H 371#ifdef HAVE_UTMPX_H
367#include <utmpx.h> 372#include <utmpx.h>
368#elif defined(HAVE_UTMP_H) 373#elif defined(HAVE_UTMP_H)
369#include <utmp.h> 374#include <utmp.h>
394 exit(0); 399 exit(0);
395}]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl 400}]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl
396 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])]) 401 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])])
397if test x$path_lastlog != x; then 402if test x$path_lastlog != x; then
398 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog) 403 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$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 404fi
403dnl# -------------------------------------------------------------------------- 405dnl# --------------------------------------------------------------------------
404 406
405dnl# find lastlogx 407dnl# find lastlogx
406AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, 408AC_CACHE_CHECK(where lastlogx is located, path_lastlogx,
407[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 409[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
410#include <stdlib.h>
408#ifdef HAVE_UTMPX_H 411#ifdef HAVE_UTMPX_H
409#include <utmpx.h> 412#include <utmpx.h>
410#endif 413#endif
411#include <errno.h> 414#include <errno.h>
412main() 415main()
431 exit(0); 434 exit(0);
432}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl 435}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl
433 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) 436 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])])
434if test x$path_lastlogx != x; then 437if test x$path_lastlogx != x; then
435 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) 438 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$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 439fi
450]) 440])
451 441
452AC_DEFUN([SCM_RIGHTS_CHECK], 442AC_DEFUN([SCM_RIGHTS_CHECK],
453[ 443[

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines