… | |
… | |
7 | #include <stdlib.h> |
7 | #include <stdlib.h> |
8 | #include <sys/stat.h> |
8 | #include <sys/stat.h> |
9 | $5 |
9 | $5 |
10 | int main() |
10 | int main() |
11 | { |
11 | { |
12 | char **path, *list[] = { $4, NULL }; |
12 | const char **path, *list[] = { $4, NULL }; |
13 | FILE *f = fopen("conftestval", "w"); |
13 | FILE *f = fopen("conftestval", "w"); |
14 | if (!f) return 1; |
14 | if (!f) return 1; |
15 | #ifdef $2 |
15 | #ifdef $2 |
16 | fprintf(f, "%s\n", $2); |
16 | fprintf(f, "%s\n", $2); |
17 | #elif defined($3) |
17 | #elif defined($3) |
… | |
… | |
53 | seteuid \ |
53 | seteuid \ |
54 | setreuid \ |
54 | setreuid \ |
55 | setresuid \ |
55 | setresuid \ |
56 | ) |
56 | ) |
57 | |
57 | |
58 | have_clone=no |
|
|
59 | |
|
|
60 | AC_MSG_CHECKING(for /dev/ptc) |
|
|
61 | if test -e /dev/ptc; then |
|
|
62 | AC_MSG_RESULT(yes) |
|
|
63 | AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename]) |
|
|
64 | have_clone=yes |
|
|
65 | else |
|
|
66 | AC_MSG_RESULT(no) |
|
|
67 | fi |
|
|
68 | |
|
|
69 | case $host in |
|
|
70 | *-*-cygwin*) |
|
|
71 | have_clone=yes |
|
|
72 | AC_DEFINE(CLONE_DEVICE, "/dev/ptmx", [clone device filename]) |
|
|
73 | ;; |
|
|
74 | *) |
|
|
75 | AC_MSG_CHECKING(for /dev/ptmx) |
|
|
76 | if test -e /dev/ptmx; then |
|
|
77 | AC_MSG_RESULT(yes) |
|
|
78 | AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if you have /dev/ptmx]) |
|
|
79 | AC_DEFINE(CLONE_DEVICE, "/dev/ptmx", [clone device filename]) |
|
|
80 | have_clone=yes |
|
|
81 | else |
|
|
82 | AC_MSG_RESULT(no) |
|
|
83 | fi |
|
|
84 | ;; |
|
|
85 | esac |
|
|
86 | |
|
|
87 | if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then |
|
|
88 | AC_MSG_CHECKING(for UNIX98 ptys) |
58 | AC_MSG_CHECKING(for UNIX98 ptys) |
89 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]], |
59 | AC_LINK_IFELSE( |
|
|
60 | [AC_LANG_PROGRAM( |
|
|
61 | [[#include <stdlib.h>]], |
90 | [[grantpt(0);unlockpt(0);ptsname(0);]])], |
62 | [[grantpt(0);unlockpt(0);ptsname(0);]])], |
91 | [unix98_pty=yes |
63 | [unix98_pty=yes |
92 | AC_DEFINE(UNIX98_PTY, 1, "") |
64 | AC_DEFINE(UNIX98_PTY, 1, "") |
93 | AC_MSG_RESULT(yes)], |
65 | AC_MSG_RESULT(yes)], |
94 | [AC_MSG_RESULT(no)]) |
66 | [AC_MSG_RESULT(no)]) |
95 | fi |
|
|
96 | |
67 | |
97 | if test -z "$unix98_pty"; then |
68 | if test -z "$unix98_pty"; then |
98 | AC_SEARCH_LIBS(openpty, util, AC_DEFINE(HAVE_OPENPTY, 1, "")) |
69 | AC_SEARCH_LIBS(openpty, util, AC_DEFINE(HAVE_OPENPTY, 1, "")) |
99 | fi |
70 | fi |
100 | ]) |
71 | ]) |
… | |
… | |
146 | dnl# -------------------------------------------------------------------------- |
117 | dnl# -------------------------------------------------------------------------- |
147 | dnl# check for host field in utmp structure |
118 | dnl# check for host field in utmp structure |
148 | |
119 | |
149 | dnl# -------------------------------------------- |
120 | dnl# -------------------------------------------- |
150 | AC_CHECK_HEADERS(utmp.h, |
121 | AC_CHECK_HEADERS(utmp.h, |
151 | [AC_CACHE_CHECK([for struct utmp], pt_cv_struct_utmp, |
122 | AC_CHECK_TYPES([struct utmp], [], [], [ |
152 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
123 | #include <sys/types.h> |
153 | #include <utmp.h>]], [[struct utmp ut;]])],[pt_cv_struct_utmp=yes],[pt_cv_struct_utmp=no])]) |
124 | #include <utmp.h> |
154 | if test x$pt_cv_struct_utmp = xyes; then |
125 | ]) |
155 | AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp) |
|
|
156 | fi |
|
|
157 | ] |
|
|
158 | |
126 | |
159 | AC_CACHE_CHECK(for ut_host in utmp struct, pt_cv_struct_utmp_host, |
127 | AC_CHECK_MEMBER([struct utmp.ut_host], |
160 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
161 | #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[pt_cv_struct_utmp_host=yes],[pt_cv_struct_utmp_host=no])]) |
|
|
162 | if test x$pt_cv_struct_utmp_host = xyes; then |
|
|
163 | AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host) |
128 | [AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)], [], [ |
164 | fi |
129 | #include <sys/types.h> |
|
|
130 | #include <utmp.h> |
|
|
131 | ]) |
165 | |
132 | |
166 | AC_CACHE_CHECK(for ut_pid in utmp struct, pt_cv_struct_utmp_pid, |
133 | AC_CHECK_MEMBER([struct utmp.ut_pid], |
167 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
168 | #include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[pt_cv_struct_utmp_pid=yes],[pt_cv_struct_utmp_pid=no])]) |
|
|
169 | if test x$pt_cv_struct_utmp_pid = xyes; then |
|
|
170 | AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid) |
134 | [AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)], [], [ |
171 | fi |
135 | #include <sys/types.h> |
|
|
136 | #include <utmp.h> |
|
|
137 | ]) |
172 | ) dnl# AC_CHECK_HEADERS(utmp.h |
138 | ) dnl# AC_CHECK_HEADERS(utmp.h |
173 | |
139 | |
174 | dnl# -------------------------------------------- |
140 | dnl# -------------------------------------------- |
175 | |
141 | |
176 | AC_CHECK_HEADERS(utmpx.h, |
142 | AC_CHECK_HEADERS(utmpx.h, |
177 | [AC_CACHE_CHECK([for struct utmpx], pt_cv_struct_utmpx, |
143 | AC_CHECK_TYPES([struct utmpx], [], [], [ |
178 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
144 | #include <sys/types.h> |
179 | #include <utmpx.h>]], [[struct utmpx ut;]])],[pt_cv_struct_utmpx=yes],[pt_cv_struct_utmpx=no])]) |
145 | #include <utmpx.h> |
180 | if test x$pt_cv_struct_utmpx = xyes; then |
146 | ]) |
181 | AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx) |
|
|
182 | fi |
|
|
183 | ] |
|
|
184 | |
147 | |
185 | AC_CACHE_CHECK(for host in utmpx struct, pt_cv_struct_utmpx_host, |
148 | AC_CHECK_MEMBER([struct utmpx.ut_host], |
186 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
187 | #include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[pt_cv_struct_utmpx_host=yes],[pt_cv_struct_utmpx_host=no])]) |
|
|
188 | if test x$pt_cv_struct_utmpx_host = xyes; then |
|
|
189 | AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host) |
149 | [AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)], [], [ |
190 | fi |
150 | #include <sys/types.h> |
|
|
151 | #include <utmpx.h> |
|
|
152 | ]) |
191 | |
153 | |
192 | AC_CACHE_CHECK(for session in utmpx struct, pt_cv_struct_utmpx_session, |
154 | AC_CHECK_MEMBER([struct utmpx.ut_session], |
193 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
|
|
194 | #include <utmpx.h>]], [[struct utmpx utx; utx.ut_session;]])],[pt_cv_struct_utmpx_session=yes],[pt_cv_struct_utmpx_session=no])]) |
|
|
195 | if test x$pt_cv_struct_utmpx_session = xyes; then |
|
|
196 | AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session) |
155 | [AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)], [], [ |
197 | fi |
156 | #include <sys/types.h> |
|
|
157 | #include <utmpx.h> |
|
|
158 | ]) |
198 | ) dnl# AC_CHECK_HEADERS(utmpx.h |
159 | ) dnl# AC_CHECK_HEADERS(utmpx.h |
199 | |
160 | |
200 | dnl# -------------------------------------------------------------------------- |
161 | dnl# -------------------------------------------------------------------------- |
201 | dnl# check for struct lastlog |
162 | dnl# check for struct lastlog |
202 | AC_CACHE_CHECK(for struct lastlog, pt_cv_struct_lastlog, |
163 | AC_CHECK_TYPES([struct lastlog], [], [], [ |
203 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
164 | #include <sys/types.h> |
204 | #include <utmp.h> |
165 | #include <utmp.h> |
205 | #ifdef HAVE_LASTLOG_H |
166 | #ifdef HAVE_LASTLOG_H |
206 | #include <lastlog.h> |
167 | #include <lastlog.h> |
207 | #endif |
168 | #endif |
208 | ]], [[struct lastlog ll;]])],[pt_cv_struct_lastlog=yes],[pt_cv_struct_lastlog=no])]) |
169 | ]) |
209 | if test x$pt_cv_struct_lastlog = xyes; then |
|
|
210 | AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog) |
|
|
211 | fi |
|
|
212 | |
170 | |
213 | dnl# check for struct lastlogx |
171 | dnl# check for struct lastlogx |
214 | AC_CACHE_CHECK(for struct lastlogx, pt_cv_struct_lastlogx, |
172 | AC_CHECK_TYPES([struct lastlogx], [], [], [ |
215 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
173 | #include <sys/types.h> |
216 | #include <utmpx.h> |
174 | #include <utmpx.h> |
217 | #ifdef HAVE_LASTLOG_H |
175 | #ifdef HAVE_LASTLOG_H |
218 | #include <lastlog.h> |
176 | #include <lastlog.h> |
219 | #endif |
177 | #endif |
220 | ]], [[struct lastlogx ll;]])],[pt_cv_struct_lastlogx=yes],[pt_cv_struct_lastlogx=no])]) |
178 | ]) |
221 | if test x$pt_cv_struct_lastlogx = xyes; then |
|
|
222 | AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx) |
|
|
223 | fi |
|
|
224 | |
179 | |
225 | dnl# -------------------------------------------------------------------------- |
180 | dnl# -------------------------------------------------------------------------- |
226 | dnl# FIND FILES |
181 | dnl# FIND FILES |
227 | dnl# -------------------------------------------------------------------------- |
182 | dnl# -------------------------------------------------------------------------- |
228 | |
183 | |