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

Comparing libptytty/ptytty.m4 (file contents):
Revision 1.10 by ayin, Wed Jun 13 17:30:54 2007 UTC vs.
Revision 1.19 by sf-exg, Sun Mar 28 08:39:34 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 \
23 setresuid \ 24 setresuid \
24) 25)
25 26
26have_clone=no 27have_clone=no
27 28
28AC_MSG_CHECKING(for /dev/ptym/clone)
29if test -e /dev/ptym/clone; then
30 AC_MSG_RESULT(yes)
31 AC_DEFINE(HAVE_DEV_CLONE, 1, [Define to 1 if you have /dev/ptym/clone])
32 AC_DEFINE(CLONE_DEVICE, "/dev/ptym/clone", [clone device filename])
33 have_clone=yes
34else
35 AC_MSG_RESULT(no)
36fi
37
38AC_MSG_CHECKING(for /dev/ptc) 29AC_MSG_CHECKING(for /dev/ptc)
39if test -e /dev/ptc; then 30if test -e /dev/ptc; then
40 AC_MSG_RESULT(yes) 31 AC_MSG_RESULT(yes)
41 AC_DEFINE(HAVE_DEV_PTC, 1, [Define to 1 if you have /dev/ptc])
42 AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename]) 32 AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename])
43 have_clone=yes 33 have_clone=yes
44else 34else
45 AC_MSG_RESULT(no) 35 AC_MSG_RESULT(no)
46fi 36fi
63 ;; 53 ;;
64esac 54esac
65 55
66if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then 56if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then
67 AC_MSG_CHECKING(for UNIX98 ptys) 57 AC_MSG_CHECKING(for UNIX98 ptys)
68 AC_TRY_LINK([#include <stdlib.h>], 58 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]],
69 [grantpt(0);unlockpt(0);ptsname(0);], 59 [[grantpt(0);unlockpt(0);ptsname(0);]])],
70 [unix98_pty=yes 60 [unix98_pty=yes
71 AC_DEFINE(UNIX98_PTY, 1, "") 61 AC_DEFINE(UNIX98_PTY, 1, "")
72 AC_MSG_RESULT(yes)], 62 AC_MSG_RESULT(yes)],
73 [AC_MSG_RESULT(no)]) 63 [AC_MSG_RESULT(no)])
74fi 64fi
83support_utmp=yes 73support_utmp=yes
84support_wtmp=yes 74support_wtmp=yes
85support_lastlog=yes 75support_lastlog=yes
86 76
87AC_ARG_ENABLE(utmp, 77AC_ARG_ENABLE(utmp,
88 [ --enable-utmp enable utmp (utmpx) support], 78 [AS_HELP_STRING([--enable-utmp],[enable utmp (utmpx) support])],
89 [if test x$enableval = xyes -o x$enableval = xno; then 79 [if test x$enableval = xyes -o x$enableval = xno; then
90 support_utmp=$enableval 80 support_utmp=$enableval
91 fi]) 81 fi])
92 82
93AC_ARG_ENABLE(wtmp, 83AC_ARG_ENABLE(wtmp,
94 [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)], 84 [AS_HELP_STRING([--enable-wtmp],[enable wtmp (wtmpx) support (requires --enable-utmp)])],
95 [if test x$enableval = xyes -o x$enableval = xno; then 85 [if test x$enableval = xyes -o x$enableval = xno; then
96 support_wtmp=$enableval 86 support_wtmp=$enableval
97 fi]) 87 fi])
98 88
99AC_ARG_ENABLE(lastlog, 89AC_ARG_ENABLE(lastlog,
100 [ --enable-lastlog enable lastlog support (requires --enable-utmp)], 90 [AS_HELP_STRING([--enable-lastlog],[enable lastlog support (requires --enable-utmp)])],
101 [if test x$enableval = xyes -o x$enableval = xno; then 91 [if test x$enableval = xyes -o x$enableval = xno; then
102 support_lastlog=$enableval 92 support_lastlog=$enableval
103 fi]) 93 fi])
104 94
105if test x$support_utmp = xyes; then 95if test x$support_utmp = xyes; then
111if test x$support_lastlog = xyes; then 101if test x$support_lastlog = xyes; then
112 AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled) 102 AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled)
113fi 103fi
114 104
115AC_CHECK_FUNCS( \ 105AC_CHECK_FUNCS( \
116 ttyslot \
117 updwtmp \ 106 updwtmp \
118 updwtmpx \ 107 updwtmpx \
108 updlastlogx \
119) 109)
120 110
121AC_CHECK_HEADERS( \ 111AC_CHECK_HEADERS(lastlog.h)
122 utmp.h \
123 utmpx.h \
124 lastlog.h \
125)
126 112
127dnl# -------------------------------------------------------------------------- 113dnl# --------------------------------------------------------------------------
128dnl# DO ALL UTMP AND WTMP CHECKING 114dnl# DO ALL UTMP AND WTMP CHECKING
129dnl# -------------------------------------------------------------------------- 115dnl# --------------------------------------------------------------------------
130dnl# check for host field in utmp structure 116dnl# check for host field in utmp structure
131 117
132dnl# -------------------------------------------- 118dnl# --------------------------------------------
133AC_CHECK_HEADER(utmp.h, 119AC_CHECK_HEADERS(utmp.h,
134[AC_CACHE_CHECK([for struct utmp], struct_utmp, 120[AC_CACHE_CHECK([for struct utmp], pt_cv_struct_utmp,
135[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 121[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
136#include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])]) 122#include <utmp.h>]], [[struct utmp ut;]])],[pt_cv_struct_utmp=yes],[pt_cv_struct_utmp=no])])
137if test x$struct_utmp = xyes; then 123if test x$pt_cv_struct_utmp = xyes; then
138 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) 124 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)
139fi 125fi
140] 126]
141 127
142AC_CACHE_CHECK(for ut_host in utmp struct, struct_utmp_host, 128AC_CACHE_CHECK(for ut_host in utmp struct, pt_cv_struct_utmp_host,
143[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 129[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
144#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[struct_utmp_host=yes],[struct_utmp_host=no])]) 130#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[pt_cv_struct_utmp_host=yes],[pt_cv_struct_utmp_host=no])])
145if test x$struct_utmp_host = xyes; then 131if test x$pt_cv_struct_utmp_host = xyes; then
146 AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) 132 AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)
147fi 133fi
148 134
149AC_CACHE_CHECK(for ut_pid in utmp struct, struct_utmp_pid, 135AC_CACHE_CHECK(for ut_pid in utmp struct, pt_cv_struct_utmp_pid,
150[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 136[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
151#include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[struct_utmp_pid=yes],[struct_utmp_pid=no])]) 137#include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[pt_cv_struct_utmp_pid=yes],[pt_cv_struct_utmp_pid=no])])
152if test x$struct_utmp_pid = xyes; then 138if test x$pt_cv_struct_utmp_pid = xyes; then
153 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) 139 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)
154fi 140fi
155) dnl# AC_CHECK_HEADER(utmp.h 141) dnl# AC_CHECK_HEADERS(utmp.h
156 142
157dnl# -------------------------------------------- 143dnl# --------------------------------------------
158 144
159AC_CHECK_HEADER(utmpx.h, 145AC_CHECK_HEADERS(utmpx.h,
160[AC_CACHE_CHECK([for struct utmpx], struct_utmpx, 146[AC_CACHE_CHECK([for struct utmpx], pt_cv_struct_utmpx,
161[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 147[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
162#include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])]) 148#include <utmpx.h>]], [[struct utmpx ut;]])],[pt_cv_struct_utmpx=yes],[pt_cv_struct_utmpx=no])])
163if test x$struct_utmpx = xyes; then 149if test x$pt_cv_struct_utmpx = xyes; then
164 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) 150 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)
165fi 151fi
166] 152]
167 153
168AC_CACHE_CHECK(for host in utmpx struct, struct_utmpx_host, 154AC_CACHE_CHECK(for host in utmpx struct, pt_cv_struct_utmpx_host,
169[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 155[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
170#include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[struct_utmpx_host=yes],[struct_utmpx_host=no])]) 156#include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[pt_cv_struct_utmpx_host=yes],[pt_cv_struct_utmpx_host=no])])
171if test x$struct_utmpx_host = xyes; then 157if test x$pt_cv_struct_utmpx_host = xyes; then
172 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) 158 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)
173fi 159fi
174 160
175AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session, 161AC_CACHE_CHECK(for session in utmpx struct, pt_cv_struct_utmpx_session,
176[AC_TRY_COMPILE([#include <sys/types.h> 162[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
177#include <utmpx.h>], 163#include <utmpx.h>]], [[struct utmpx utx; utx.ut_session;]])],[pt_cv_struct_utmpx_session=yes],[pt_cv_struct_utmpx_session=no])])
178[struct utmpx utx; utx.ut_session;],
179struct_utmpx_session=yes, struct_utmpx_session=no)])
180if test x$struct_utmpx_session = xyes; then 164if test x$pt_cv_struct_utmpx_session = xyes; then
181 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) 165 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)
182fi 166fi
183) dnl# AC_CHECK_HEADER(utmpx.h 167) dnl# AC_CHECK_HEADERS(utmpx.h
184 168
185dnl# -------------------------------------------------------------------------- 169dnl# --------------------------------------------------------------------------
186dnl# check for struct lastlog 170dnl# check for struct lastlog
187AC_CACHE_CHECK(for struct lastlog, struct_lastlog, 171AC_CACHE_CHECK(for struct lastlog, pt_cv_struct_lastlog,
188[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 172[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
189#include <utmp.h> 173#include <utmp.h>
190#ifdef HAVE_LASTLOG_H 174#ifdef HAVE_LASTLOG_H
191#include <lastlog.h> 175#include <lastlog.h>
192#endif 176#endif
193]], [[struct lastlog ll;]])],[struct_lastlog=yes],[struct_lastlog=no])]) 177]], [[struct lastlog ll;]])],[pt_cv_struct_lastlog=yes],[pt_cv_struct_lastlog=no])])
194if test x$struct_lastlog = xyes; then 178if test x$pt_cv_struct_lastlog = xyes; then
195 AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog) 179 AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)
196fi 180fi
197 181
198dnl# check for struct lastlogx 182dnl# check for struct lastlogx
199AC_CACHE_CHECK(for struct lastlogx, struct_lastlogx, 183AC_CACHE_CHECK(for struct lastlogx, pt_cv_struct_lastlogx,
200[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 184[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
201#include <utmpx.h> 185#include <utmpx.h>
202#ifdef HAVE_LASTLOG_H 186#ifdef HAVE_LASTLOG_H
203#include <lastlog.h> 187#include <lastlog.h>
204#endif 188#endif
205]], [[struct lastlogx ll;]])],[struct_lastlogx=yes],[struct_lastlogx=no])]) 189]], [[struct lastlogx ll;]])],[pt_cv_struct_lastlogx=yes],[pt_cv_struct_lastlogx=no])])
206if test x$struct_lastlogx = xyes; then 190if test x$pt_cv_struct_lastlogx = xyes; then
207 AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx) 191 AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)
208fi 192fi
209 193
210dnl# -------------------------------------------------------------------------- 194dnl# --------------------------------------------------------------------------
211dnl# FIND FILES 195dnl# FIND FILES
212dnl# -------------------------------------------------------------------------- 196dnl# --------------------------------------------------------------------------
213 197
214dnl# find utmp 198dnl# find utmp
215AC_CACHE_CHECK(where utmp is located, path_utmp, 199AC_CACHE_CHECK(where utmp is located, pt_cv_path_utmp,
216[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 200[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
217#include <stdlib.h> 201#include <stdlib.h>
218#include <sys/types.h> 202#include <sys/types.h>
219#include <utmp.h> 203#include <utmp.h>
220#include <errno.h> 204#include <errno.h>
237 fprintf(f, "%s\n", *u); 221 fprintf(f, "%s\n", *u);
238 exit(0); 222 exit(0);
239 } 223 }
240 } 224 }
241 exit(0); 225 exit(0);
242}]])],[path_utmp=`cat conftestval`],[path_utmp=],[dnl 226}]])],[pt_cv_path_utmp=`cat conftestval`],[pt_cv_path_utmp=],[dnl
243 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])]) 227 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])])
244if test x$path_utmp != x; then 228if test x$pt_cv_path_utmp != x; then
245 AC_DEFINE_UNQUOTED(UTMP_FILE, "$path_utmp", Define location of utmp) 229 AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp)
246fi 230fi
247 231
248dnl# -------------------------------------------------------------------------- 232dnl# --------------------------------------------------------------------------
249 233
250dnl# find utmpx - if a utmp file exists at the same location and is more than 234dnl# find utmpx - if a utmp file exists at the same location and is more than
251dnl# a day newer, then dump the utmpx. People leave lots of junk around. 235dnl# a day newer, then dump the utmpx. People leave lots of junk around.
252AC_CACHE_CHECK(where utmpx is located, path_utmpx, 236AC_CACHE_CHECK(where utmpx is located, pt_cv_path_utmpx,
253[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 237[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
254#include <stdlib.h> 238#include <stdlib.h>
255#include <sys/types.h> 239#include <sys/types.h>
256#include <utmpx.h> 240#include <utmpx.h>
257#include <errno.h> 241#include <errno.h>
284 fprintf(f, "%s\n", *u); 268 fprintf(f, "%s\n", *u);
285 exit(0); 269 exit(0);
286 } 270 }
287 } 271 }
288 exit(0); 272 exit(0);
289}]])],[path_utmpx=`cat conftestval`],[path_utmpx=],[dnl 273}]])],[pt_cv_path_utmpx=`cat conftestval`],[pt_cv_path_utmpx=],[dnl
290 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])]) 274 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])])
291if test x$path_utmpx != x; then 275if test x$pt_cv_path_utmpx != x; then
292 AC_DEFINE_UNQUOTED(UTMPX_FILE, "$path_utmpx", Define location of utmpx) 276 AC_DEFINE_UNQUOTED(UTMPX_FILE, "$pt_cv_path_utmpx", Define location of utmpx)
293fi 277fi
294 278
295dnl# -------------------------------------------------------------------------- 279dnl# --------------------------------------------------------------------------
296 280
297dnl# find wtmp 281dnl# find wtmp
298AC_CACHE_CHECK(where wtmp is located, path_wtmp, 282AC_CACHE_CHECK(where wtmp is located, pt_cv_path_wtmp,
299[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 283[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
300#include <stdlib.h> 284#include <stdlib.h>
301#include <sys/types.h> 285#include <sys/types.h>
302#ifdef HAVE_UTMP_H 286#ifdef HAVE_UTMP_H
303#include <utmp.h> 287#include <utmp.h>
322 fprintf(f, "%s\n", *w); 306 fprintf(f, "%s\n", *w);
323 exit(0); 307 exit(0);
324 } 308 }
325 } 309 }
326 exit(0); 310 exit(0);
327}]])],[path_wtmp=`cat conftestval`],[path_wtmp=],[dnl 311}]])],[pt_cv_path_wtmp=`cat conftestval`],[pt_cv_path_wtmp=],[dnl
328 AC_MSG_WARN(Define WTMP_FILE in config.h manually)])]) 312 AC_MSG_WARN(Define WTMP_FILE in config.h manually)])])
329if test x$path_wtmp != x; then 313if test x$pt_cv_path_wtmp != x; then
330 AC_DEFINE_UNQUOTED(WTMP_FILE, "$path_wtmp", Define location of wtmp) 314 AC_DEFINE_UNQUOTED(WTMP_FILE, "$pt_cv_path_wtmp", Define location of wtmp)
331fi 315fi
332dnl# -------------------------------------------------------------------------- 316dnl# --------------------------------------------------------------------------
333 317
334dnl# find wtmpx 318dnl# find wtmpx
335AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, 319AC_CACHE_CHECK(where wtmpx is located, pt_cv_path_wtmpx,
336[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 320[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
337#include <stdlib.h> 321#include <stdlib.h>
338#ifdef HAVE_UTMPX_H 322#ifdef HAVE_UTMPX_H
339#include <utmpx.h> 323#include <utmpx.h>
340#endif 324#endif
358 fprintf(f, "%s\n", *w); 342 fprintf(f, "%s\n", *w);
359 exit(0); 343 exit(0);
360 } 344 }
361 } 345 }
362 exit(0); 346 exit(0);
363}]])],[path_wtmpx=`cat conftestval`],[path_wtmpx=],[dnl 347}]])],[pt_cv_path_wtmpx=`cat conftestval`],[pt_cv_path_wtmpx=],[dnl
364 AC_MSG_WARN(Define WTMPX_FILE in config.h manually)])]) 348 AC_MSG_WARN(Define WTMPX_FILE in config.h manually)])])
365if test x$path_wtmpx != x; then 349if test x$pt_cv_path_wtmpx != x; then
366 AC_DEFINE_UNQUOTED(WTMPX_FILE, "$path_wtmpx", Define location of wtmpx) 350 AC_DEFINE_UNQUOTED(WTMPX_FILE, "$pt_cv_path_wtmpx", Define location of wtmpx)
367fi 351fi
368dnl# -------------------------------------------------------------------------- 352dnl# --------------------------------------------------------------------------
369 353
370dnl# find lastlog 354dnl# find lastlog
371AC_CACHE_CHECK(where lastlog is located, path_lastlog, 355AC_CACHE_CHECK(where lastlog is located, pt_cv_path_lastlog,
372[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 356[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
373#include <stdlib.h> 357#include <stdlib.h>
374#include <sys/types.h> 358#include <sys/types.h>
375#ifdef HAVE_UTMPX_H 359#ifdef HAVE_UTMPX_H
376#include <utmpx.h> 360#include <utmpx.h>
399 fprintf(f, "%s\n", *w); 383 fprintf(f, "%s\n", *w);
400 exit(0); 384 exit(0);
401 } 385 }
402 } 386 }
403 exit(0); 387 exit(0);
404}]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl 388}]])],[pt_cv_path_lastlog=`cat conftestval`],[pt_cv_path_lastlog=],[dnl
405 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])]) 389 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])])
406if test x$path_lastlog != x; then 390if test x$pt_cv_path_lastlog != x; then
407 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog) 391 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$pt_cv_path_lastlog", Define location of lastlog)
408 if test -d "$path_lastlog"; then
409 AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory)
410 fi
411fi 392fi
412dnl# -------------------------------------------------------------------------- 393dnl# --------------------------------------------------------------------------
413 394
414dnl# find lastlogx 395dnl# find lastlogx
415AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, 396AC_CACHE_CHECK(where lastlogx is located, pt_cv_path_lastlogx,
416[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 397[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
417#include <stdlib.h> 398#include <stdlib.h>
418#ifdef HAVE_UTMPX_H 399#ifdef HAVE_UTMPX_H
419#include <utmpx.h> 400#include <utmpx.h>
420#endif 401#endif
437 fprintf(f, "%s\n", *w); 418 fprintf(f, "%s\n", *w);
438 exit(0); 419 exit(0);
439 } 420 }
440 } 421 }
441 exit(0); 422 exit(0);
442}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl 423}]])],[pt_cv_path_lastlogx=`cat conftestval`],[pt_cv_path_lastlogx=],[dnl
443 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])]) 424 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])])
444if test x$path_lastlogx != x; then 425if test x$pt_cv_path_lastlogx != x; then
445 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx) 426 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$pt_cv_path_lastlogx", Define location of lastlogx)
446fi 427fi
447]) 428])
448 429
449AC_DEFUN([SCM_RIGHTS_CHECK], 430AC_DEFUN([SCM_RIGHTS_CHECK],
450[ 431[
451AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, 432AC_CACHE_CHECK(for unix-compliant filehandle passing ability, pt_cv_can_pass_fds,
452[AC_TRY_LINK([ 433[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
453#include <cstddef> // broken bsds (is that redundant?) need this 434#include <cstddef> // broken bsds (is that redundant?) need this
454#include <sys/types.h> 435#include <sys/types.h>
455#include <sys/socket.h> 436#include <sys/socket.h>
456#include <sys/uio.h> 437#include <sys/uio.h>
457],[ 438]], [[
458{ 439{
459 msghdr msg; 440 msghdr msg;
460 iovec iov; 441 iovec iov;
461 char buf [100]; 442 char buf [100];
462 char data = 0; 443 char data = 0;
476 457
477 *(int *)CMSG_DATA (cmsg) = 5; 458 *(int *)CMSG_DATA (cmsg) = 5;
478 459
479 return sendmsg (3, &msg, 0); 460 return sendmsg (3, &msg, 0);
480} 461}
481],[can_pass_fds=yes],[can_pass_fds=no])]) 462]])],[pt_cv_can_pass_fds=yes],[pt_cv_can_pass_fds=no])])
482if test x$can_pass_fds = xyes; then 463if test x$pt_cv_can_pass_fds = xyes; then
483 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) 464 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing)
484else 465else
485 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) 466 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability])
486fi 467fi
487]) 468])
488 469
489AC_DEFUN([TTY_GROUP_CHECK], 470AC_DEFUN([TTY_GROUP_CHECK],
490[ 471[
491AC_CACHE_CHECK([for tty group], tty_group, 472AC_CACHE_CHECK([for tty group], pt_cv_tty_group,
492[AC_TRY_RUN([ 473[AC_RUN_IFELSE([AC_LANG_SOURCE([[
493#include <sys/types.h> 474#include <sys/types.h>
494#include <sys/stat.h> 475#include <sys/stat.h>
495#include <unistd.h> 476#include <unistd.h>
496#include <grp.h> 477#include <grp.h>
497 478
507 && (stat(tty, &st)) == 0 488 && (stat(tty, &st)) == 0
508 && st.st_gid == gr->gr_gid) 489 && st.st_gid == gr->gr_gid)
509 return 0; 490 return 0;
510 else 491 else
511 return 1; 492 return 1;
512}],
513[tty_group=yes],[tty_group=no],[tty_group=no])]) 493}]])],[pt_cv_tty_group=yes],[pt_cv_tty_group=no],[pt_cv_tty_group=no])])
514if test x$tty_group = xyes; then 494if test x$pt_cv_tty_group = xyes; then
515 AC_DEFINE(TTY_GID_SUPPORT, 1, "") 495 AC_DEFINE(TTY_GID_SUPPORT, 1, "")
516fi]) 496fi])
517 497

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines