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

Comparing libptytty/ptytty.m4 (file contents):
Revision 1.17 by root, Mon May 5 16:51:28 2008 UTC vs.
Revision 1.26 by sf-exg, Mon May 23 11:04:41 2011 UTC

1dnl this file is part of libptytty, do not make local modifications 1dnl this file is part of libptytty, do not make local modifications
2dnl http://software.schmorp.de/pkg/libptytty 2dnl http://software.schmorp.de/pkg/libptytty
3
4AC_DEFUN([PT_FIND_FILE],
5[AC_CACHE_CHECK(where $1 is located, pt_cv_path_$1,
6[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
7#include <stdlib.h>
8#include <sys/stat.h>
9$5
10int main()
11{
12 char **path, *list[] = { $4, NULL };
13 FILE *f = fopen("conftestval", "w");
14 if (!f) return 1;
15#ifdef $2
16 fprintf(f, "%s\n", $2);
17#elif defined($3)
18 fprintf(f, "%s\n", $3);
19#else
20 for (path = list; *path; path++) {
21 struct stat st;
22 if (stat(*path, &st) == 0) {
23 fprintf(f, "%s\n", *path);
24 break;
25 }
26 }
27#endif
28 return fclose(f) != 0;
29}]])],[pt_cv_path_$1=`cat conftestval`],[pt_cv_path_$1=],
30[AC_MSG_WARN(Define $2 in config.h manually)])])
31if test x$pt_cv_path_$1 != x; then
32 AC_DEFINE_UNQUOTED($2, "$pt_cv_path_$1", Define location of $1)
33fi])
3 34
4AC_DEFUN([PTY_CHECK], 35AC_DEFUN([PTY_CHECK],
5[ 36[
6AC_CHECK_HEADERS( \ 37AC_CHECK_HEADERS( \
7 pty.h \ 38 pty.h \
24 setresuid \ 55 setresuid \
25) 56)
26 57
27have_clone=no 58have_clone=no
28 59
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) 60AC_MSG_CHECKING(for /dev/ptc)
40if test -e /dev/ptc; then 61if test -e /dev/ptc; then
41 AC_MSG_RESULT(yes) 62 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]) 63 AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename])
44 have_clone=yes 64 have_clone=yes
45else 65else
46 AC_MSG_RESULT(no) 66 AC_MSG_RESULT(no)
47fi 67fi
73 AC_MSG_RESULT(yes)], 93 AC_MSG_RESULT(yes)],
74 [AC_MSG_RESULT(no)]) 94 [AC_MSG_RESULT(no)])
75fi 95fi
76 96
77if test -z "$unix98_pty"; then 97if test -z "$unix98_pty"; then
78 AC_CHECK_FUNCS(openpty, [], [AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"])]) 98 AC_SEARCH_LIBS(openpty, util, AC_DEFINE(HAVE_OPENPTY, 1, ""))
79fi 99fi
80]) 100])
81 101
82AC_DEFUN([UTMP_CHECK], 102AC_DEFUN([UTMP_CHECK],
83[ 103[
126dnl# -------------------------------------------------------------------------- 146dnl# --------------------------------------------------------------------------
127dnl# check for host field in utmp structure 147dnl# check for host field in utmp structure
128 148
129dnl# -------------------------------------------- 149dnl# --------------------------------------------
130AC_CHECK_HEADERS(utmp.h, 150AC_CHECK_HEADERS(utmp.h,
131[AC_CACHE_CHECK([for struct utmp], struct_utmp, 151AC_CHECK_TYPES([struct utmp], [], [], [
132[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 152#include <sys/types.h>
133#include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])]) 153#include <utmp.h>
134if test x$struct_utmp = xyes; then 154])
135 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)
136fi
137]
138 155
139AC_CACHE_CHECK(for ut_host in utmp struct, struct_utmp_host, 156AC_CHECK_MEMBER([struct utmp.ut_host],
140[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
141#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[struct_utmp_host=yes],[struct_utmp_host=no])])
142if test x$struct_utmp_host = xyes; then
143 AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) 157[AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)], [], [
144fi 158#include <sys/types.h>
159#include <utmp.h>
160])
145 161
146AC_CACHE_CHECK(for ut_pid in utmp struct, struct_utmp_pid, 162AC_CHECK_MEMBER([struct utmp.ut_pid],
147[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
148#include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[struct_utmp_pid=yes],[struct_utmp_pid=no])])
149if test x$struct_utmp_pid = xyes; then
150 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) 163[AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)], [], [
151fi 164#include <sys/types.h>
165#include <utmp.h>
166])
152) dnl# AC_CHECK_HEADERS(utmp.h 167) dnl# AC_CHECK_HEADERS(utmp.h
153 168
154dnl# -------------------------------------------- 169dnl# --------------------------------------------
155 170
156AC_CHECK_HEADERS(utmpx.h, 171AC_CHECK_HEADERS(utmpx.h,
157[AC_CACHE_CHECK([for struct utmpx], struct_utmpx, 172AC_CHECK_TYPES([struct utmpx], [], [], [
158[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 173#include <sys/types.h>
159#include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])]) 174#include <utmpx.h>
160if test x$struct_utmpx = xyes; then 175])
161 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)
162fi
163]
164 176
165AC_CACHE_CHECK(for host in utmpx struct, struct_utmpx_host, 177AC_CHECK_MEMBER([struct utmpx.ut_host],
166[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
167#include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[struct_utmpx_host=yes],[struct_utmpx_host=no])])
168if test x$struct_utmpx_host = xyes; then
169 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) 178[AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)], [], [
170fi 179#include <sys/types.h>
180#include <utmpx.h>
181])
171 182
172AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session, 183AC_CHECK_MEMBER([struct utmpx.ut_session],
173[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
174#include <utmpx.h>]], [[struct utmpx utx; utx.ut_session;]])],[struct_utmpx_session=yes],[struct_utmpx_session=no])])
175if test x$struct_utmpx_session = xyes; then
176 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) 184[AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)], [], [
177fi 185#include <sys/types.h>
186#include <utmpx.h>
187])
178) dnl# AC_CHECK_HEADERS(utmpx.h 188) dnl# AC_CHECK_HEADERS(utmpx.h
179 189
180dnl# -------------------------------------------------------------------------- 190dnl# --------------------------------------------------------------------------
181dnl# check for struct lastlog 191dnl# check for struct lastlog
182AC_CACHE_CHECK(for struct lastlog, struct_lastlog, 192AC_CHECK_TYPES([struct lastlog], [], [], [
183[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 193#include <sys/types.h>
184#include <utmp.h> 194#include <utmp.h>
185#ifdef HAVE_LASTLOG_H 195#ifdef HAVE_LASTLOG_H
186#include <lastlog.h> 196#include <lastlog.h>
187#endif 197#endif
188]], [[struct lastlog ll;]])],[struct_lastlog=yes],[struct_lastlog=no])]) 198])
189if test x$struct_lastlog = xyes; then
190 AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)
191fi
192 199
193dnl# check for struct lastlogx 200dnl# check for struct lastlogx
194AC_CACHE_CHECK(for struct lastlogx, struct_lastlogx, 201AC_CHECK_TYPES([struct lastlogx], [], [], [
195[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 202#include <sys/types.h>
196#include <utmpx.h> 203#include <utmpx.h>
197#ifdef HAVE_LASTLOG_H 204#ifdef HAVE_LASTLOG_H
198#include <lastlog.h> 205#include <lastlog.h>
199#endif 206#endif
200]], [[struct lastlogx ll;]])],[struct_lastlogx=yes],[struct_lastlogx=no])]) 207])
201if test x$struct_lastlogx = xyes; then
202 AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)
203fi
204 208
205dnl# -------------------------------------------------------------------------- 209dnl# --------------------------------------------------------------------------
206dnl# FIND FILES 210dnl# FIND FILES
207dnl# -------------------------------------------------------------------------- 211dnl# --------------------------------------------------------------------------
208 212
209dnl# find utmp 213dnl# find utmp
210AC_CACHE_CHECK(where utmp is located, path_utmp, 214PT_FIND_FILE([utmp], [UTMP_FILE], [_PATH_UTMP],
211[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
212#include <stdlib.h>
213#include <sys/types.h>
214#include <utmp.h>
215#include <errno.h>
216main()
217{
218 char **u, *utmplist[] = {
219 "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL }; 215["/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp"],[
220 FILE *a, *f=fopen("conftestval", "w");
221 if (!f) exit(1);
222#ifdef UTMP_FILE
223 fprintf(f, "%s\n", UTMP_FILE);
224 exit(0);
225#endif
226#ifdef _PATH_UTMP
227 fprintf(f, "%s\n", _PATH_UTMP);
228 exit(0);
229#endif
230 for (u = utmplist; *u; u++) {
231 if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
232 fprintf(f, "%s\n", *u);
233 exit(0);
234 }
235 }
236 exit(0);
237}]])],[path_utmp=`cat conftestval`],[path_utmp=],[dnl
238 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])])
239if test x$path_utmp != x; then
240 AC_DEFINE_UNQUOTED(UTMP_FILE, "$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, path_utmpx,
248[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
249#include <stdlib.h>
250#include <sys/types.h> 216#include <sys/types.h>
251#include <utmpx.h> 217#include <utmp.h>
252#include <errno.h> 218])
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}]])],[path_utmpx=`cat conftestval`],[path_utmpx=],[dnl
285 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])])
286if test x$path_utmpx != x; then
287 AC_DEFINE_UNQUOTED(UTMPX_FILE, "$path_utmpx", Define location of utmpx)
288fi
289 219
290dnl# -------------------------------------------------------------------------- 220dnl# --------------------------------------------------------------------------
291 221
292dnl# find wtmp 222dnl# find wtmp
293AC_CACHE_CHECK(where wtmp is located, path_wtmp, 223PT_FIND_FILE([wtmp], [WTMP_FILE], [_PATH_WTMP],
294[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 224["/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp"],[
295#include <stdlib.h>
296#include <sys/types.h> 225#include <sys/types.h>
297#ifdef HAVE_UTMP_H 226#ifdef HAVE_UTMP_H
298#include <utmp.h> 227#include <utmp.h>
299#endif 228#endif
300#include <errno.h> 229])
301main()
302{
303 char **w, *wtmplist[] = {
304 "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL };
305 FILE *a, *f=fopen("conftestval", "w");
306 if (!f) exit(1);
307#ifdef WTMP_FILE
308 fprintf(f, "%s\n", WTMP_FILE);
309 exit(0);
310#endif
311#ifdef _PATH_WTMP
312 fprintf(f, "%s\n", _PATH_WTMP);
313 exit(0);
314#endif
315 for (w = wtmplist; *w; w++) {
316 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
317 fprintf(f, "%s\n", *w);
318 exit(0);
319 }
320 }
321 exit(0);
322}]])],[path_wtmp=`cat conftestval`],[path_wtmp=],[dnl
323 AC_MSG_WARN(Define WTMP_FILE in config.h manually)])])
324if test x$path_wtmp != x; then
325 AC_DEFINE_UNQUOTED(WTMP_FILE, "$path_wtmp", Define location of wtmp)
326fi
327dnl# -------------------------------------------------------------------------- 230dnl# --------------------------------------------------------------------------
328 231
329dnl# find wtmpx 232dnl# find wtmpx
330AC_CACHE_CHECK(where wtmpx is located, path_wtmpx, 233PT_FIND_FILE([wtmpx], [WTMPX_FILE], [_PATH_WTMPX],
331[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 234["/var/log/wtmpx", "/var/adm/wtmpx"],[
332#include <stdlib.h>
333#ifdef HAVE_UTMPX_H 235#ifdef HAVE_UTMPX_H
334#include <utmpx.h> 236#include <utmpx.h>
335#endif 237#endif
336#include <errno.h> 238])
337main()
338{
339 char **w, *wtmplist[] = {
340 "/var/log/wtmpx", "/var/adm/wtmpx", NULL };
341 FILE *a, *f=fopen("conftestval", "w");
342 if (!f) exit(1);
343#ifdef WTMPX_FILE
344 fprintf(f, "%s\n", WTMPX_FILE);
345 exit(0);
346#endif
347#ifdef _PATH_WTMPX
348 fprintf(f, "%s\n", _PATH_WTMPX);
349 exit(0);
350#endif
351 for (w = wtmplist; *w; w++) {
352 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
353 fprintf(f, "%s\n", *w);
354 exit(0);
355 }
356 }
357 exit(0);
358}]])],[path_wtmpx=`cat conftestval`],[path_wtmpx=],[dnl
359 AC_MSG_WARN(Define WTMPX_FILE in config.h manually)])])
360if test x$path_wtmpx != x; then
361 AC_DEFINE_UNQUOTED(WTMPX_FILE, "$path_wtmpx", Define location of wtmpx)
362fi
363dnl# -------------------------------------------------------------------------- 239dnl# --------------------------------------------------------------------------
364 240
365dnl# find lastlog 241dnl# find lastlog
366AC_CACHE_CHECK(where lastlog is located, path_lastlog, 242PT_FIND_FILE([lastlog], [LASTLOG_FILE], [_PATH_LASTLOG],
367[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 243["/var/log/lastlog"],[
368#include <stdlib.h>
369#include <sys/types.h> 244#include <sys/types.h>
370#ifdef HAVE_UTMPX_H 245#ifdef HAVE_UTMP_H
371#include <utmpx.h>
372#elif defined(HAVE_UTMP_H)
373#include <utmp.h> 246#include <utmp.h>
374#endif 247#endif
375#ifdef HAVE_LASTLOG_H 248#ifdef HAVE_LASTLOG_H
376#include <lastlog.h> 249#include <lastlog.h>
377#endif 250#endif
378#include <errno.h> 251])
379main()
380{
381 char **w, *lastloglist[] = { "/var/log/lastlog", NULL };
382 FILE *a, *f=fopen("conftestval", "w");
383 if (!f) exit(1);
384#ifdef LASTLOG_FILE
385 fprintf(f, "%s\n", LASTLOG_FILE);
386 exit(0);
387#endif
388#ifdef _PATH_LASTLOG
389 fprintf(f, "%s\n", _PATH_LASTLOG);
390 exit(0);
391#endif
392 for (w = lastloglist; *w; w++) {
393 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
394 fprintf(f, "%s\n", *w);
395 exit(0);
396 }
397 }
398 exit(0);
399}]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl
400 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])])
401if test x$path_lastlog != x; then
402 AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog)
403fi
404dnl# -------------------------------------------------------------------------- 252dnl# --------------------------------------------------------------------------
405 253
406dnl# find lastlogx 254dnl# find lastlogx
407AC_CACHE_CHECK(where lastlogx is located, path_lastlogx, 255PT_FIND_FILE([lastlogx], [LASTLOGX_FILE], [_PATH_LASTLOGX],
408[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 256["/var/log/lastlogx", "/var/adm/lastlogx"],[
409#include <stdlib.h>
410#ifdef HAVE_UTMPX_H 257#ifdef HAVE_UTMPX_H
411#include <utmpx.h> 258#include <utmpx.h>
412#endif 259#endif
413#include <errno.h> 260])
414main()
415{
416 char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL };
417 FILE *a, *f=fopen("conftestval", "w");
418 if (!f) exit(1);
419#ifdef LASTLOGX_FILE
420 fprintf(f, "%s\n", LASTLOGX_FILE);
421 exit(0);
422#endif
423#ifdef _PATH_LASTLOGX
424 fprintf(f, "%s\n", _PATH_LASTLOGX);
425 exit(0);
426#endif
427 for (w = wtmplist; *w; w++) {
428 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
429 fprintf(f, "%s\n", *w);
430 exit(0);
431 }
432 }
433 exit(0);
434}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl
435 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])])
436if test x$path_lastlogx != x; then
437 AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx)
438fi
439]) 261])
440 262
441AC_DEFUN([SCM_RIGHTS_CHECK], 263AC_DEFUN([SCM_RIGHTS_CHECK],
442[ 264[
443AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds, 265AC_CACHE_CHECK(for unix-compliant filehandle passing ability, pt_cv_can_pass_fds,
444[AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 266[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
445#include <cstddef> // broken bsds (is that redundant?) need this 267#include <cstddef> // broken bsds (is that redundant?) need this
446#include <sys/types.h> 268#include <sys/types.h>
447#include <sys/socket.h> 269#include <sys/socket.h>
448#include <sys/uio.h> 270#include <sys/uio.h>
468 290
469 *(int *)CMSG_DATA (cmsg) = 5; 291 *(int *)CMSG_DATA (cmsg) = 5;
470 292
471 return sendmsg (3, &msg, 0); 293 return sendmsg (3, &msg, 0);
472} 294}
473]])],[can_pass_fds=yes],[can_pass_fds=no])]) 295]])],[pt_cv_can_pass_fds=yes],[pt_cv_can_pass_fds=no])])
474if test x$can_pass_fds = xyes; then 296if test x$pt_cv_can_pass_fds = xyes; then
475 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing) 297 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing)
476else 298else
477 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability]) 299 AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability])
478fi 300fi
479]) 301])
480 302
481AC_DEFUN([TTY_GROUP_CHECK], 303AC_DEFUN([TTY_GROUP_CHECK],
482[ 304[
483AC_CACHE_CHECK([for tty group], tty_group, 305AC_CACHE_CHECK([for tty group], pt_cv_tty_group,
484[AC_RUN_IFELSE([AC_LANG_SOURCE([[ 306[AC_RUN_IFELSE([AC_LANG_SOURCE([[
485#include <sys/types.h> 307#include <sys/types.h>
486#include <sys/stat.h> 308#include <sys/stat.h>
487#include <unistd.h> 309#include <unistd.h>
488#include <grp.h> 310#include <grp.h>
489 311
490main() 312int main()
491{ 313{
492 struct stat st; 314 struct stat st;
493 struct group *gr; 315 struct group *gr;
494 char *tty; 316 char *tty;
495 gr = getgrnam("tty"); 317 gr = getgrnam("tty");
499 && (stat(tty, &st)) == 0 321 && (stat(tty, &st)) == 0
500 && st.st_gid == gr->gr_gid) 322 && st.st_gid == gr->gr_gid)
501 return 0; 323 return 0;
502 else 324 else
503 return 1; 325 return 1;
504}]])],[tty_group=yes],[tty_group=no],[tty_group=no])]) 326}]])],[pt_cv_tty_group=yes],[pt_cv_tty_group=no],[pt_cv_tty_group=no])])
505if test x$tty_group = xyes; then 327if test x$pt_cv_tty_group = xyes; then
506 AC_DEFINE(TTY_GID_SUPPORT, 1, "") 328 AC_DEFINE(TTY_GID_SUPPORT, 1, "")
507fi]) 329fi])
508 330

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines