Mercurial > dropbear
comparison configure.in @ 284:eed26cff980b
propagate from branch 'au.asn.ucc.matt.ltm.dropbear' (head 6c790cad5a7fa866ad062cb3a0c279f7ba788583)
to branch 'au.asn.ucc.matt.dropbear' (head fff0894a0399405a9410ea1c6d118f342cf2aa64)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 08 Mar 2006 13:23:49 +0000 |
parents | a3a68c25035e |
children | fa9c45d09727 |
comparison
equal
deleted
inserted
replaced
283:bd240aa12ba7 | 284:eed26cff980b |
---|---|
1 # -*- Autoconf -*- | |
2 # Process this file with autoconf and autoheader to produce a configure script. | |
3 | |
4 # This Autoconf file was cobbled from various locations. In particular, a bunch | |
5 # of the platform checks have been taken straight from OpenSSH's configure.ac | |
6 # Huge thanks to them for dealing with the horrible platform-specifics :) | |
7 | |
8 AC_PREREQ(2.50) | |
9 AC_INIT(buffer.c) | |
10 | |
11 OLDCFLAGS=$CFLAGS | |
12 # Checks for programs. | |
13 AC_PROG_CC | |
14 AC_PROG_MAKE_SET | |
15 | |
16 if test -z "$LD" ; then | |
17 LD=$CC | |
18 fi | |
19 AC_SUBST(LD) | |
20 | |
21 if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then | |
22 AC_MSG_RESULT(No \$CFLAGS set... using "-Os -W -Wall" for GCC) | |
23 CFLAGS="-Os -W -Wall" | |
24 fi | |
25 | |
26 # Host specific options | |
27 # this isn't a definitive list of hosts, they are just added as required | |
28 AC_CANONICAL_HOST | |
29 | |
30 case "$host" in | |
31 | |
32 *-*-linux*) | |
33 no_ptmx_check=1 | |
34 ;; | |
35 | |
36 *-*-solaris*) | |
37 CFLAGS="$CFLAGS -I/usr/local/include" | |
38 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" | |
39 conf_lastlog_location="/var/adm/lastlog" | |
40 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) | |
41 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` | |
42 if test "$sol2ver" -ge 8; then | |
43 AC_MSG_RESULT(yes) | |
44 AC_DEFINE(DISABLE_UTMP,,Disable utmp) | |
45 AC_DEFINE(DISABLE_WTMP,,Disable wtmp) | |
46 else | |
47 AC_MSG_RESULT(no) | |
48 fi | |
49 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") | |
50 AC_CHECK_LIB(nsl, yp_match, LIBS="$LIBS -lnsl") | |
51 ;; | |
52 | |
53 *-*-aix*) | |
54 AC_DEFINE(AIX,,Using AIX) | |
55 # OpenSSH thinks it's broken. If it isn't, let me know. | |
56 AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo) | |
57 ;; | |
58 | |
59 *-*-hpux*) | |
60 LIBS="$LIBS -lsec" | |
61 # It's probably broken. | |
62 AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo) | |
63 ;; | |
64 *-dec-osf*) | |
65 AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo) | |
66 ;; | |
67 esac | |
68 | |
69 AC_CHECK_TOOL(AR, ar, :) | |
70 AC_CHECK_TOOL(RANLIB, ranlib, :) | |
71 AC_CHECK_TOOL(STRIP, strip, :) | |
72 AC_CHECK_TOOL(INSTALL, install, :) | |
73 | |
74 dnl Can't use login() or logout() with uclibc | |
75 AC_CHECK_DECL(__UCLIBC__, | |
76 [ | |
77 no_loginfunc_check=1 | |
78 AC_MSG_RESULT(Using uClibc - login() and logout() probably don't work, so we won't use them.) | |
79 ],,,) | |
80 | |
81 # Checks for libraries. | |
82 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") | |
83 | |
84 # Check if zlib is needed | |
85 AC_ARG_WITH(zlib, | |
86 [ --with-zlib=PATH Use zlib in PATH], | |
87 [ | |
88 # option is given | |
89 if test -d "$withval/lib"; then | |
90 LDFLAGS="-L${withval}/lib ${LDFLAGS}" | |
91 else | |
92 LDFLAGS="-L${withval} ${LDFLAGS}" | |
93 fi | |
94 if test -d "$withval/include"; then | |
95 CPPFLAGS="-I${withval}/include ${CPPFLAGS}" | |
96 else | |
97 CPPFLAGS="-I${withval} ${CPPFLAGS}" | |
98 fi | |
99 ] | |
100 ) | |
101 | |
102 AC_ARG_ENABLE(zlib, | |
103 [ --disable-zlib Don't include zlib support], | |
104 [ | |
105 if test "x$enableval" = "xno"; then | |
106 AC_DEFINE(DISABLE_ZLIB,, Use zlib) | |
107 AC_MSG_RESULT(Disabling zlib) | |
108 else | |
109 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***])) | |
110 AC_MSG_RESULT(Enabling zlib) | |
111 fi | |
112 ], | |
113 [ | |
114 # if not disabled, check for zlib | |
115 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***])) | |
116 AC_MSG_RESULT(Enabling zlib) | |
117 ] | |
118 ) | |
119 | |
120 # Check if pam is needed | |
121 AC_ARG_WITH(pam, | |
122 [ --with-pam=PATH Use pam in PATH], | |
123 [ | |
124 # option is given | |
125 if test -d "$withval/lib"; then | |
126 LDFLAGS="-L${withval}/lib ${LDFLAGS}" | |
127 else | |
128 LDFLAGS="-L${withval} ${LDFLAGS}" | |
129 fi | |
130 if test -d "$withval/include"; then | |
131 CPPFLAGS="-I${withval}/include ${CPPFLAGS}" | |
132 else | |
133 CPPFLAGS="-I${withval} ${CPPFLAGS}" | |
134 fi | |
135 ] | |
136 ) | |
137 | |
138 | |
139 AC_ARG_ENABLE(pam, | |
140 [ --enable-pam Try to include PAM support], | |
141 [ | |
142 if test "x$enableval" = "xyes"; then | |
143 AC_CHECK_LIB(pam, pam_authenticate, , AC_MSG_ERROR([*** PAM missing - install first or check config.log ***])) | |
144 AC_MSG_RESULT(Enabling PAM) | |
145 else | |
146 AC_DEFINE(DISABLE_PAM,, Use PAM) | |
147 AC_MSG_RESULT(Disabling PAM) | |
148 fi | |
149 ], | |
150 [ | |
151 # disable it by default | |
152 AC_DEFINE(DISABLE_PAM,, Use PAM) | |
153 AC_MSG_RESULT(Disabling PAM) | |
154 ] | |
155 ) | |
156 | |
157 AC_ARG_ENABLE(openpty, | |
158 [ --disable-openpty Don't use openpty, use alternative method], | |
159 [ | |
160 if test "x$enableval" = "xno"; then | |
161 AC_MSG_RESULT(Not using openpty) | |
162 else | |
163 AC_MSG_RESULT(Using openpty if available) | |
164 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)]) | |
165 fi | |
166 ], | |
167 [ | |
168 AC_MSG_RESULT(Using openpty if available) | |
169 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)]) | |
170 ] | |
171 ) | |
172 | |
173 | |
174 AC_ARG_ENABLE(syslog, | |
175 [ --disable-syslog Don't include syslog support], | |
176 [ | |
177 if test "x$enableval" = "xno"; then | |
178 AC_DEFINE(DISABLE_SYSLOG,, Using syslog) | |
179 AC_MSG_RESULT(Disabling syslog) | |
180 else | |
181 AC_MSG_RESULT(Enabling syslog) | |
182 fi | |
183 ], | |
184 [ | |
185 AC_MSG_RESULT(Enabling syslog) | |
186 ] | |
187 ) | |
188 | |
189 AC_ARG_ENABLE(shadow, | |
190 [ --disable-shadow Don't use shadow passwords (if available)], | |
191 [ | |
192 if test "x$enableval" = "xno"; then | |
193 AC_MSG_RESULT(Not using shadow passwords) | |
194 else | |
195 AC_CHECK_HEADERS([shadow.h]) | |
196 AC_MSG_RESULT(Using shadow passwords if available) | |
197 fi | |
198 ], | |
199 [ | |
200 AC_CHECK_HEADERS([shadow.h]) | |
201 AC_MSG_RESULT(Using shadow passwords if available) | |
202 ] | |
203 ) | |
204 | |
205 | |
206 # Checks for header files. | |
207 AC_HEADER_STDC | |
208 AC_HEADER_SYS_WAIT | |
209 AC_CHECK_HEADERS([fcntl.h limits.h netinet/in.h netinet/tcp.h stdlib.h string.h sys/socket.h sys/time.h termios.h unistd.h crypt.h pty.h ioctl.h libutil.h libgen.h inttypes.h stropts.h utmp.h utmpx.h lastlog.h paths.h util.h netdb.h security/pam_appl.h pam/pam_appl.h netinet/in_systm.h]) | |
210 | |
211 # Checks for typedefs, structures, and compiler characteristics. | |
212 AC_C_CONST | |
213 AC_TYPE_UID_T | |
214 AC_TYPE_MODE_T | |
215 AC_TYPE_PID_T | |
216 AC_TYPE_SIZE_T | |
217 AC_HEADER_TIME | |
218 | |
219 AC_CHECK_TYPES([uint16_t, u_int16_t, struct sockaddr_storage]) | |
220 AC_CHECK_TYPE([socklen_t], ,[ | |
221 AC_MSG_CHECKING([for socklen_t equivalent]) | |
222 AC_CACHE_VAL([curl_cv_socklen_t_equiv], | |
223 [ | |
224 # Systems have either "struct sockaddr *" or | |
225 # "void *" as the second argument to getpeername | |
226 curl_cv_socklen_t_equiv= | |
227 for arg2 in "struct sockaddr" void; do | |
228 for t in int size_t unsigned long "unsigned long"; do | |
229 AC_TRY_COMPILE([ | |
230 #include <sys/types.h> | |
231 #include <sys/socket.h> | |
232 | |
233 int getpeername (int, $arg2 *, $t *); | |
234 ],[ | |
235 $t len; | |
236 getpeername(0,0,&len); | |
237 ],[ | |
238 curl_cv_socklen_t_equiv="$t" | |
239 break | |
240 ]) | |
241 done | |
242 done | |
243 | |
244 if test "x$curl_cv_socklen_t_equiv" = x; then | |
245 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) | |
246 fi | |
247 ]) | |
248 AC_MSG_RESULT($curl_cv_socklen_t_equiv) | |
249 AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, | |
250 [type to use in place of socklen_t if not defined])], | |
251 [#include <sys/types.h> | |
252 #include <sys/socket.h>]) | |
253 | |
254 # for the fake-rfc2553 stuff - straight from OpenSSH | |
255 | |
256 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ | |
257 AC_TRY_COMPILE( | |
258 [ | |
259 #include <sys/types.h> | |
260 #include <sys/socket.h> | |
261 ], | |
262 [ struct sockaddr_storage s; ], | |
263 [ ac_cv_have_struct_sockaddr_storage="yes" ], | |
264 [ ac_cv_have_struct_sockaddr_storage="no" ] | |
265 ) | |
266 ]) | |
267 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then | |
268 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) | |
269 fi | |
270 | |
271 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ | |
272 AC_TRY_COMPILE( | |
273 [ | |
274 #include <sys/types.h> | |
275 #include <netinet/in.h> | |
276 ], | |
277 [ struct sockaddr_in6 s; s.sin6_family = 0; ], | |
278 [ ac_cv_have_struct_sockaddr_in6="yes" ], | |
279 [ ac_cv_have_struct_sockaddr_in6="no" ] | |
280 ) | |
281 ]) | |
282 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then | |
283 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,,Have struct sockaddr_in6) | |
284 fi | |
285 | |
286 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ | |
287 AC_TRY_COMPILE( | |
288 [ | |
289 #include <sys/types.h> | |
290 #include <netinet/in.h> | |
291 ], | |
292 [ struct in6_addr s; s.s6_addr[0] = 0; ], | |
293 [ ac_cv_have_struct_in6_addr="yes" ], | |
294 [ ac_cv_have_struct_in6_addr="no" ] | |
295 ) | |
296 ]) | |
297 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then | |
298 AC_DEFINE(HAVE_STRUCT_IN6_ADDR,,Have struct in6_addr) | |
299 fi | |
300 | |
301 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ | |
302 AC_TRY_COMPILE( | |
303 [ | |
304 #include <sys/types.h> | |
305 #include <sys/socket.h> | |
306 #include <netdb.h> | |
307 ], | |
308 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], | |
309 [ ac_cv_have_struct_addrinfo="yes" ], | |
310 [ ac_cv_have_struct_addrinfo="no" ] | |
311 ) | |
312 ]) | |
313 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then | |
314 AC_DEFINE(HAVE_STRUCT_ADDRINFO,,Have struct addrinfo) | |
315 fi | |
316 | |
317 | |
318 # IRIX has a const char return value for gai_strerror() | |
319 AC_CHECK_FUNCS(gai_strerror,[ | |
320 AC_DEFINE(HAVE_GAI_STRERROR) | |
321 AC_TRY_COMPILE([ | |
322 #include <sys/types.h> | |
323 #include <sys/socket.h> | |
324 #include <netdb.h> | |
325 | |
326 const char *gai_strerror(int);],[ | |
327 char *str; | |
328 | |
329 str = gai_strerror(0);],[ | |
330 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1, | |
331 [Define if gai_strerror() returns const char *])])]) | |
332 | |
333 # for loginrec.c | |
334 | |
335 AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_pid, struct utmp.ut_type, struct utmp.ut_tv, struct utmp.ut_id, struct utmp.ut_addr, struct utmp.ut_addr_v6, struct utmp.ut_exit, struct utmp.ut_time],,,[ | |
336 #include <sys/types.h> | |
337 #if HAVE_UTMP_H | |
338 #include <utmp.h> | |
339 #endif | |
340 ]) | |
341 | |
342 AC_CHECK_MEMBERS([struct utmpx.ut_host, struct utmpx.ut_syslen, struct utmpx.ut_type, struct utmpx.ut_id, struct utmpx.ut_addr, struct utmpx.ut_addr_v6, struct utmpx.ut_time, struct utmpx.ut_tv, struct sockaddr_storage.ss_family, struct sockadd_storage.__family],,,[ | |
343 #include <sys/types.h> | |
344 #include <sys/socket.h> | |
345 #if HAVE_UTMPX_H | |
346 #include <utmpx.h> | |
347 #endif | |
348 ]) | |
349 | |
350 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) | |
351 AC_CHECK_FUNCS(utmpname) | |
352 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) | |
353 AC_CHECK_FUNCS(setutxent utmpxname) | |
354 AC_CHECK_FUNCS(logout updwtmp logwtmp) | |
355 | |
356 dnl Added from OpenSSH 3.6.1p2's configure.ac | |
357 | |
358 dnl allow user to disable some login recording features | |
359 AC_ARG_ENABLE(lastlog, | |
360 [ --disable-lastlog Disable use of lastlog even if detected [no]], | |
361 [ AC_DEFINE(DISABLE_LASTLOG,,Disable use of lastlog()) ] | |
362 ) | |
363 AC_ARG_ENABLE(utmp, | |
364 [ --disable-utmp Disable use of utmp even if detected [no]], | |
365 [ AC_DEFINE(DISABLE_UTMP,,Disable use of utmp) ] | |
366 ) | |
367 AC_ARG_ENABLE(utmpx, | |
368 [ --disable-utmpx Disable use of utmpx even if detected [no]], | |
369 [ AC_DEFINE(DISABLE_UTMPX,,Disable use of utmpx) ] | |
370 ) | |
371 AC_ARG_ENABLE(wtmp, | |
372 [ --disable-wtmp Disable use of wtmp even if detected [no]], | |
373 [ AC_DEFINE(DISABLE_WTMP,,Disable use of wtmp) ] | |
374 ) | |
375 AC_ARG_ENABLE(wtmpx, | |
376 [ --disable-wtmpx Disable use of wtmpx even if detected [no]], | |
377 [ AC_DEFINE(DISABLE_WTMPX,,Disable use of wtmpx) ] | |
378 ) | |
379 AC_ARG_ENABLE(loginfunc, | |
380 [ --disable-loginfunc Disable use of login() etc. [no]], | |
381 [ no_loginfunc_check=1 | |
382 AC_MSG_RESULT(Not using login() etc) ] | |
383 ) | |
384 AC_ARG_ENABLE(pututline, | |
385 [ --disable-pututline Disable use of pututline() etc. ([uw]tmp) [no]], | |
386 [ AC_DEFINE(DISABLE_PUTUTLINE,,Disable use of pututline()) ] | |
387 ) | |
388 AC_ARG_ENABLE(pututxline, | |
389 [ --disable-pututxline Disable use of pututxline() etc. ([uw]tmpx) [no]], | |
390 [ AC_DEFINE(DISABLE_PUTUTXLINE,,Disable use of pututxline()) ] | |
391 ) | |
392 AC_ARG_WITH(lastlog, | |
393 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], | |
394 [ | |
395 if test "x$withval" = "xno" ; then | |
396 AC_DEFINE(DISABLE_LASTLOG) | |
397 else | |
398 conf_lastlog_location=$withval | |
399 fi | |
400 ] | |
401 ) | |
402 | |
403 if test -z "$no_loginfunc_check"; then | |
404 dnl Checks for libutil functions (login(), logout() etc, not openpty() ) | |
405 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN,,Have login() function)]) | |
406 AC_CHECK_FUNCS(logout updwtmp logwtmp) | |
407 fi | |
408 | |
409 dnl lastlog, [uw]tmpx? detection | |
410 dnl NOTE: set the paths in the platform section to avoid the | |
411 dnl need for command-line parameters | |
412 dnl lastlog and [uw]tmp are subject to a file search if all else fails | |
413 | |
414 dnl lastlog detection | |
415 dnl NOTE: the code itself will detect if lastlog is a directory | |
416 AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) | |
417 AC_TRY_COMPILE([ | |
418 #include <sys/types.h> | |
419 #include <utmp.h> | |
420 #ifdef HAVE_LASTLOG_H | |
421 # include <lastlog.h> | |
422 #endif | |
423 #ifdef HAVE_PATHS_H | |
424 # include <paths.h> | |
425 #endif | |
426 #ifdef HAVE_LOGIN_H | |
427 # include <login.h> | |
428 #endif | |
429 ], | |
430 [ char *lastlog = LASTLOG_FILE; ], | |
431 [ AC_MSG_RESULT(yes) ], | |
432 [ | |
433 AC_MSG_RESULT(no) | |
434 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) | |
435 AC_TRY_COMPILE([ | |
436 #include <sys/types.h> | |
437 #include <utmp.h> | |
438 #ifdef HAVE_LASTLOG_H | |
439 # include <lastlog.h> | |
440 #endif | |
441 #ifdef HAVE_PATHS_H | |
442 # include <paths.h> | |
443 #endif | |
444 ], | |
445 [ char *lastlog = _PATH_LASTLOG; ], | |
446 [ AC_MSG_RESULT(yes) ], | |
447 [ | |
448 AC_MSG_RESULT(no) | |
449 system_lastlog_path=no | |
450 ]) | |
451 ] | |
452 ) | |
453 | |
454 if test -z "$conf_lastlog_location"; then | |
455 if test x"$system_lastlog_path" = x"no" ; then | |
456 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do | |
457 if (test -d "$f" || test -f "$f") ; then | |
458 conf_lastlog_location=$f | |
459 fi | |
460 done | |
461 if test -z "$conf_lastlog_location"; then | |
462 AC_MSG_WARN([** Cannot find lastlog **]) | |
463 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx | |
464 fi | |
465 fi | |
466 fi | |
467 | |
468 if test -n "$conf_lastlog_location"; then | |
469 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location", lastlog file location) | |
470 fi | |
471 | |
472 dnl utmp detection | |
473 AC_MSG_CHECKING([if your system defines UTMP_FILE]) | |
474 AC_TRY_COMPILE([ | |
475 #include <sys/types.h> | |
476 #include <utmp.h> | |
477 #ifdef HAVE_PATHS_H | |
478 # include <paths.h> | |
479 #endif | |
480 ], | |
481 [ char *utmp = UTMP_FILE; ], | |
482 [ AC_MSG_RESULT(yes) ], | |
483 [ AC_MSG_RESULT(no) | |
484 system_utmp_path=no ] | |
485 ) | |
486 if test -z "$conf_utmp_location"; then | |
487 if test x"$system_utmp_path" = x"no" ; then | |
488 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do | |
489 if test -f $f ; then | |
490 conf_utmp_location=$f | |
491 fi | |
492 done | |
493 if test -z "$conf_utmp_location"; then | |
494 AC_DEFINE(DISABLE_UTMP) | |
495 fi | |
496 fi | |
497 fi | |
498 if test -n "$conf_utmp_location"; then | |
499 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location", utmp file location) | |
500 fi | |
501 | |
502 dnl wtmp detection | |
503 AC_MSG_CHECKING([if your system defines WTMP_FILE]) | |
504 AC_TRY_COMPILE([ | |
505 #include <sys/types.h> | |
506 #include <utmp.h> | |
507 #ifdef HAVE_PATHS_H | |
508 # include <paths.h> | |
509 #endif | |
510 ], | |
511 [ char *wtmp = WTMP_FILE; ], | |
512 [ AC_MSG_RESULT(yes) ], | |
513 [ AC_MSG_RESULT(no) | |
514 system_wtmp_path=no ] | |
515 ) | |
516 if test -z "$conf_wtmp_location"; then | |
517 if test x"$system_wtmp_path" = x"no" ; then | |
518 for f in /usr/adm/wtmp /var/log/wtmp; do | |
519 if test -f $f ; then | |
520 conf_wtmp_location=$f | |
521 fi | |
522 done | |
523 if test -z "$conf_wtmp_location"; then | |
524 AC_DEFINE(DISABLE_WTMP) | |
525 fi | |
526 fi | |
527 fi | |
528 if test -n "$conf_wtmp_location"; then | |
529 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location", wtmp file location) | |
530 fi | |
531 | |
532 | |
533 dnl utmpx detection - I don't know any system so perverse as to require | |
534 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out | |
535 dnl there, though. | |
536 AC_MSG_CHECKING([if your system defines UTMPX_FILE]) | |
537 AC_TRY_COMPILE([ | |
538 #include <sys/types.h> | |
539 #include <utmp.h> | |
540 #ifdef HAVE_UTMPX_H | |
541 #include <utmpx.h> | |
542 #endif | |
543 #ifdef HAVE_PATHS_H | |
544 # include <paths.h> | |
545 #endif | |
546 ], | |
547 [ char *utmpx = UTMPX_FILE; ], | |
548 [ AC_MSG_RESULT(yes) ], | |
549 [ AC_MSG_RESULT(no) | |
550 system_utmpx_path=no ] | |
551 ) | |
552 if test -z "$conf_utmpx_location"; then | |
553 if test x"$system_utmpx_path" = x"no" ; then | |
554 AC_DEFINE(DISABLE_UTMPX) | |
555 fi | |
556 else | |
557 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location", utmpx file location) | |
558 fi | |
559 | |
560 dnl wtmpx detection | |
561 AC_MSG_CHECKING([if your system defines WTMPX_FILE]) | |
562 AC_TRY_COMPILE([ | |
563 #include <sys/types.h> | |
564 #include <utmp.h> | |
565 #ifdef HAVE_UTMPX_H | |
566 #include <utmpx.h> | |
567 #endif | |
568 #ifdef HAVE_PATHS_H | |
569 # include <paths.h> | |
570 #endif | |
571 ], | |
572 [ char *wtmpx = WTMPX_FILE; ], | |
573 [ AC_MSG_RESULT(yes) ], | |
574 [ AC_MSG_RESULT(no) | |
575 system_wtmpx_path=no ] | |
576 ) | |
577 if test -z "$conf_wtmpx_location"; then | |
578 if test x"$system_wtmpx_path" = x"no" ; then | |
579 AC_DEFINE(DISABLE_WTMPX) | |
580 fi | |
581 else | |
582 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location", wtmpx file location) | |
583 fi | |
584 | |
585 # Checks for library functions. | |
586 AC_PROG_GCC_TRADITIONAL | |
587 AC_FUNC_MEMCMP | |
588 AC_FUNC_SELECT_ARGTYPES | |
589 AC_TYPE_SIGNAL | |
590 AC_CHECK_FUNCS([dup2 getspnam getusershell memset putenv select socket strdup clearenv strlcpy strlcat daemon basename _getpty getaddrinfo freeaddrinfo getnameinfo]) | |
591 | |
592 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME)) | |
593 | |
594 # Solaris needs ptmx | |
595 if test -z "$no_ptmx_check" ; then | |
596 if test x"$cross_compiling" = x"no" ; then | |
597 AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(USE_DEV_PTMX,,Use /dev/ptmx)) | |
598 else | |
599 AC_MSG_RESULT(Not checking for /dev/ptmx, we're cross-compiling) | |
600 fi | |
601 fi | |
602 | |
603 if test -z "$no_ptc_check" ; then | |
604 if test x"$cross_compiling" = x"no" ; then | |
605 AC_CHECK_FILE("/dev/ptc", AC_DEFINE(HAVE_DEV_PTS_AND_PTC,,Use /dev/ptc & /dev/pts)) | |
606 else | |
607 AC_MSG_RESULT(Not checking for /dev/ptc & /dev/pts\, we're cross-compiling) | |
608 fi | |
609 fi | |
610 | |
611 AC_EXEEXT | |
612 AC_CONFIG_HEADER(config.h) | |
613 AC_OUTPUT(Makefile) | |
614 AC_OUTPUT(libtomcrypt/Makefile) | |
615 AC_OUTPUT(libtommath/Makefile) | |
616 AC_MSG_RESULT() | |
617 AC_MSG_RESULT(Now edit options.h to choose features.) |