]> andersk Git - openssh.git/blame_incremental - configure.in
- (djm) NeXT patch from Ben Lindstrom <mouring@pconline.com>
[openssh.git] / configure.in
... / ...
CommitLineData
1AC_INIT(ssh.c)
2
3AC_CONFIG_HEADER(config.h)
4AC_PROG_CC
5AC_CANONICAL_HOST
6
7# Checks for programs.
8AC_PROG_CPP
9AC_PROG_RANLIB
10AC_PROG_INSTALL
11AC_CHECK_PROG(AR, ar, ar)
12AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
14AC_PATH_PROG(ENT, ent)
15AC_SUBST(ENT)
16
17# Use LOGIN_PROGRAM from environment if possible
18if test ! -z "$LOGIN_PROGRAM" ; then
19 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
20else
21 # Search for login
22 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
23 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
25 fi
26fi
27
28if test -z "$LD" ; then
29 LD=$CC
30fi
31AC_SUBST(LD)
32
33# C Compiler features
34AC_C_INLINE
35if test "$GCC" = "yes"; then
36 CFLAGS="$CFLAGS -Wall"
37fi
38
39# Check for some target-specific stuff
40case "$host" in
41*-*-aix*)
42 AFS_LIBS="-lld"
43 CFLAGS="$CFLAGS -I/usr/local/include"
44 LDFLAGS="$LDFLAGS -L/usr/local/lib"
45 if (test "$LD" != "gcc" && test -z "$blibpath"); then
46 blibpath="/usr/lib:/lib:/usr/local/lib"
47 fi
48 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
49 AC_DEFINE(BROKEN_GETADDRINFO)
50 MANTYPE='$(CATMAN)'
51 mansubdir=cat
52 dnl AIX handles lastlog as part of its login message
53 AC_DEFINE(DISABLE_LASTLOG)
54 MANTYPE='$(CATMAN)'
55 mansubdir=cat
56 ;;
57*-*-hpux10*)
58 if test -z "$GCC"; then
59 CFLAGS="$CFLAGS -Ae"
60 fi
61 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
62 IPADDR_IN_DISPLAY=yes
63 AC_DEFINE(USE_PIPES)
64 AC_MSG_CHECKING(for HPUX trusted system password database)
65 if test -f /tcb/files/auth/system/default; then
66 AC_MSG_RESULT(yes)
67 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
68 LIBS="$LIBS -lsec"
69 AC_MSG_WARN([This configuration is untested])
70 else
71 AC_MSG_RESULT(no)
72 AC_DEFINE(DISABLE_SHADOW)
73 fi
74 MANTYPE='$(CATMAN)'
75 mansubdir=cat
76 ;;
77*-*-hpux11*)
78 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
79 IPADDR_IN_DISPLAY=yes
80 AC_DEFINE(USE_PIPES)
81 AC_MSG_CHECKING(for HPUX trusted system password database)
82 if test -f /tcb/files/auth/system/default; then
83 AC_MSG_RESULT(yes)
84 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
85 LIBS="$LIBS -lsec"
86 AC_MSG_WARN([This configuration is untested])
87 else
88 AC_MSG_RESULT(no)
89 AC_DEFINE(DISABLE_SHADOW)
90 fi
91 MANTYPE='$(CATMAN)'
92 mansubdir=cat
93 ;;
94*-*-irix5*)
95 CFLAGS="$CFLAGS -I/usr/local/include"
96 LDFLAGS="$LDFLAGS"
97 MANTYPE='$(CATMAN)'
98 no_libsocket=1
99 no_libnsl=1
100 AC_DEFINE(BROKEN_INET_NTOA)
101 ;;
102*-*-irix6*)
103 CFLAGS="$CFLAGS -I/usr/local/include"
104 LDFLAGS="$LDFLAGS"
105 MANTYPE='$(CATMAN)'
106 AC_DEFINE(WITH_IRIX_ARRAY)
107 AC_DEFINE(WITH_IRIX_PROJECT)
108 AC_DEFINE(WITH_IRIX_AUDIT)
109 no_libsocket=1
110 no_libnsl=1
111 AC_DEFINE(BROKEN_INET_NTOA)
112 ;;
113*-*-linux*)
114 no_dev_ptmx=1
115 AC_DEFINE(DONT_TRY_OTHER_AF)
116 AC_DEFINE(PAM_TTY_KLUDGE)
117 inet6_default_4in6=yes
118 ;;
119*-*-netbsd*)
120 need_dash_r=1
121 ;;
122*-next-*)
123 conf_lastlog_location="/usr/adm/lastlog"
124 conf_utmp_location=/etc/utmp
125 conf_wtmp_location=/usr/adm/wtmp
126 MAIL=/usr/spool/mail
127 AC_DEFINE(HAVE_NEXT)
128 CFLAGS="$CFLAGS -I/usr/local/include"
129 ;;
130*-*-solaris*)
131 CFLAGS="$CFLAGS -I/usr/local/include"
132 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
133 need_dash_r=1
134 # hardwire lastlog location (can't detect it on some versions)
135 conf_lastlog_location="/var/adm/lastlog"
136 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
137 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
138 if test "$sol2ver" -ge 8; then
139 AC_MSG_RESULT(yes)
140 AC_DEFINE(DISABLE_UTMP)
141 AC_DEFINE(DISABLE_WTMP)
142 else
143 AC_MSG_RESULT(no)
144 fi
145 ;;
146*-*-sunos4*)
147 CFLAGS="$CFLAGS -DSUNOS4"
148 AC_CHECK_FUNCS(getpwanam)
149 conf_utmp_location=/etc/utmp
150 conf_wtmp_location=/var/adm/wtmp
151 conf_lastlog_location=/var/adm/lastlog
152 AC_DEFINE(USE_PIPES)
153 MANTYPE='$(CATMAN)'
154 mansubdir=cat
155 ;;
156*-sni-sysv*)
157 CFLAGS="$CFLAGS -I/usr/local/include"
158 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
159 MANTYPE='$(CATMAN)'
160 AC_DEFINE(IP_TOS_IS_BROKEN)
161 mansubdir=cat
162 LIBS="$LIBS -lgen -lnsl -lucb"
163 ;;
164*-*-sysv*)
165 CFLAGS="$CFLAGS -I/usr/local/include"
166 LDFLAGS="$LDFLAGS -L/usr/local/lib"
167 MANTYPE='$(CATMAN)'
168 mansubdir=cat
169 LIBS="$LIBS -lgen -lsocket"
170 ;;
171*-*-sco3*)
172 CFLAGS="$CFLAGS -I/usr/local/include"
173 LDFLAGS="$LDFLAGS -L/usr/local/lib"
174 MANTYPE='$(CATMAN)'
175 mansubdir=cat
176 LIBS="$LIBS -lgen -lsocket"
177 no_dev_ptmx=1
178 ;;
179*-dec-osf*)
180# This is untested
181 if test ! -z "USE_SIA" ; then
182 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
183 if test -f /etc/sia/matrix.conf; then
184 AC_MSG_RESULT(yes)
185 AC_DEFINE(HAVE_OSF_SIA)
186 AC_DEFINE(DISABLE_LOGIN)
187 LIBS="$LIBS -lsecurity -ldb -lm -laud"
188 else
189 AC_MSG_RESULT(no)
190 fi
191 fi
192 ;;
193esac
194
195# Allow user to specify flags
196AC_ARG_WITH(cflags,
197 [ --with-cflags Specify additional flags to pass to compiler],
198 [
199 if test "x$withval" != "xno" ; then
200 CFLAGS="$CFLAGS $withval"
201 fi
202 ]
203)
204AC_ARG_WITH(ldflags,
205 [ --with-ldlags Specify additional flags to pass to linker],
206 [
207 if test "x$withval" != "xno" ; then
208 LDFLAGS="$LDFLAGS $withval"
209 fi
210 ]
211)
212AC_ARG_WITH(libs,
213 [ --with-libs Specify additional libraries to link with],
214 [
215 if test "x$withval" != "xno" ; then
216 LIBS="$LIBS $withval"
217 fi
218 ]
219)
220
221
222# Checks for libraries.
223AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
224AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
225
226if test -z "$no_libsocket" ; then
227 AC_CHECK_LIB(nsl, yp_match, , )
228fi
229if test -z "$no_libnsl" ; then
230 AC_CHECK_LIB(socket, main, , )
231fi
232
233# Checks for header files.
234AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h)
235
236dnl Checks for library functions.
237AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop)
238dnl Checks for time functions
239AC_CHECK_FUNCS(gettimeofday time)
240dnl Checks for libutil functions
241AC_CHECK_FUNCS(login logout updwtmp logwtmp)
242dnl Checks for utmp functions
243AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
244AC_CHECK_FUNCS(utmpname)
245dnl Checks for utmpx functions
246AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
247AC_CHECK_FUNCS(setutxent utmpxname)
248
249AC_CHECK_FUNC(getuserattr,
250 [AC_DEFINE(HAVE_GETUSERATTR)],
251 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
252)
253
254AC_CHECK_FUNC(login,
255 [AC_DEFINE(HAVE_LOGIN)],
256 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
257)
258
259AC_CHECK_FUNC(daemon,
260 [AC_DEFINE(HAVE_DAEMON)],
261 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
262)
263
264AC_CHECK_FUNC(getpagesize,
265 [AC_DEFINE(HAVE_GETPAGESIZE)],
266 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
267)
268
269# Check for broken snprintf
270if test "x$ac_cv_func_snprintf" = "xyes" ; then
271 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
272 AC_TRY_RUN(
273 [
274#include <stdio.h>
275int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
276 ],
277 [AC_MSG_RESULT(yes)],
278 [
279 AC_MSG_RESULT(no)
280 AC_DEFINE(BROKEN_SNPRINTF)
281 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
282 ]
283 )
284fi
285
286PAM_MSG="no"
287AC_ARG_WITH(pam,
288 [ --without-pam Disable PAM support ],
289 [
290 if test "x$withval" = "xno" ; then
291 no_pam=1
292 AC_DEFINE(DISABLE_PAM)
293 PAM_MSG="disabled"
294 fi
295 ]
296)
297if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
298 AC_CHECK_LIB(dl, dlopen, , )
299 LIBS="$LIBS -lpam"
300
301 AC_CHECK_FUNCS(pam_getenvlist)
302
303 disable_shadow=yes
304
305 PAM_MSG="yes"
306
307 # Check PAM strerror arguments (old PAM)
308 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
309 AC_TRY_COMPILE(
310 [
311#include <stdlib.h>
312#include <security/pam_appl.h>
313 ],
314 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
315 [AC_MSG_RESULT(no)],
316 [
317 AC_DEFINE(HAVE_OLD_PAM)
318 AC_MSG_RESULT(yes)
319 PAM_MSG="yes (old library)"
320 ]
321 )
322fi
323
324# The big search for OpenSSL
325AC_ARG_WITH(ssl-dir,
326 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
327 [
328 if test "x$withval" != "$xno" ; then
329 tryssldir=$withval
330 fi
331 ]
332)
333
334saved_LIBS="$LIBS"
335saved_LDFLAGS="$LDFLAGS"
336saved_CFLAGS="$CFLAGS"
337if test "x$prefix" != "xNONE" ; then
338 tryssldir="$tryssldir $prefix"
339fi
340AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
341
342 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
343 if test ! -z "$ssldir" ; then
344 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
345 CFLAGS="$saved_CFLAGS -I$ssldir/include"
346 if test ! -z "$need_dash_r" ; then
347 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
348 fi
349 else
350 LDFLAGS="$saved_LDFLAGS"
351 fi
352
353 LIBS="$saved_LIBS -lcrypto"
354
355 # Basic test to check for compatible version and correct linking
356 # *does not* test for RSA - that comes later.
357 AC_TRY_RUN(
358 [
359#include <string.h>
360#include <openssl/rand.h>
361int main(void)
362{
363 char a[2048];
364 memset(a, 0, sizeof(a));
365 RAND_add(a, sizeof(a), sizeof(a));
366 return(RAND_status() <= 0);
367}
368 ],
369 [
370 found_crypto=1
371 break;
372 ], []
373 )
374
375 if test ! -z "$found_crypto" ; then
376 break;
377 fi
378 done
379
380 if test -z "$found_crypto" ; then
381 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
382 fi
383 if test -z "$ssldir" ; then
384 ssldir="(system)"
385 fi
386
387 ac_cv_openssldir=$ssldir
388])
389
390if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
391 AC_DEFINE(HAVE_OPENSSL)
392 dnl Need to recover ssldir - test above runs in subshell
393 ssldir=$ac_cv_openssldir
394 CFLAGS="$saved_CFLAGS -I$ssldir/include"
395 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
396 if test ! -z "$need_dash_r" ; then
397 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
398 fi
399 if test ! -z "$blibpath" ; then
400 blibpath="$blibpath:$ssldir:$ssldir/lib"
401 fi
402fi
403LIBS="$saved_LIBS -lcrypto"
404
405# Now test RSA support
406saved_LIBS="$LIBS"
407AC_MSG_CHECKING([for RSA support])
408for WANTS_RSAREF in "" 1 ; do
409 if test -z "$WANTS_RSAREF" ; then
410 LIBS="$saved_LIBS"
411 else
412 LIBS="$saved_LIBS -lRSAglue -lrsaref"
413 fi
414 AC_TRY_RUN([
415#include <string.h>
416#include <openssl/rand.h>
417#include <openssl/rsa.h>
418#include <openssl/bn.h>
419#include <openssl/sha.h>
420int main(void)
421{
422 int num; RSA *key; static unsigned char p_in[] = "blahblah";
423 unsigned char c[256], p[256];
424 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
425 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
426 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
427 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
428}
429 ],
430 [
431 rsa_works=1
432 break;
433 ], [])
434done
435
436if test ! -z "$no_rsa" ; then
437 AC_MSG_RESULT(disabled)
438 RSA_MSG="disabled"
439else
440 if test -z "$rsa_works" ; then
441 AC_MSG_WARN([*** No RSA support found *** ])
442 RSA_MSG="no"
443 else
444 if test -z "$WANTS_RSAREF" ; then
445 AC_MSG_RESULT(yes)
446 RSA_MSG="yes"
447 else
448 RSA_MSG="yes (using RSAref)"
449 AC_MSG_RESULT(using RSAref)
450 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
451 fi
452 fi
453fi
454
455# Checks for data types
456AC_CHECK_SIZEOF(char, 1)
457AC_CHECK_SIZEOF(short int, 2)
458AC_CHECK_SIZEOF(int, 4)
459AC_CHECK_SIZEOF(long int, 4)
460AC_CHECK_SIZEOF(long long int, 8)
461
462# More checks for data types
463AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
464 AC_TRY_COMPILE(
465 [ #include <sys/types.h> ],
466 [ u_int a; a = 1;],
467 [ ac_cv_have_u_int="yes" ],
468 [ ac_cv_have_u_int="no" ]
469 )
470])
471if test "x$ac_cv_have_u_int" = "xyes" ; then
472 AC_DEFINE(HAVE_U_INT)
473 have_u_int=1
474fi
475
476AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
477 AC_TRY_COMPILE(
478 [ #include <sys/types.h> ],
479 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
480 [ ac_cv_have_intxx_t="yes" ],
481 [ ac_cv_have_intxx_t="no" ]
482 )
483])
484if test "x$ac_cv_have_intxx_t" = "xyes" ; then
485 AC_DEFINE(HAVE_INTXX_T)
486 have_intxx_t=1
487fi
488
489AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
490 AC_TRY_COMPILE(
491 [ #include <sys/types.h> ],
492 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
493 [ ac_cv_have_u_intxx_t="yes" ],
494 [ ac_cv_have_u_intxx_t="no" ]
495 )
496])
497if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
498 AC_DEFINE(HAVE_U_INTXX_T)
499 have_u_intxx_t=1
500fi
501
502if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
503 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
504then
505 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
506 AC_TRY_COMPILE(
507 [
508#include <sys/bitypes.h>
509 ],
510 [
511 int8_t a; int16_t b; int32_t c;
512 u_int8_t e; u_int16_t f; u_int32_t g;
513 a = b = c = e = f = g = 1;
514 ],
515 [
516 AC_DEFINE(HAVE_U_INTXX_T)
517 AC_DEFINE(HAVE_INTXX_T)
518 AC_MSG_RESULT(yes)
519 ],
520 [AC_MSG_RESULT(no)]
521 )
522fi
523
524if test -z "$have_u_intxx_t" ; then
525 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
526 AC_TRY_COMPILE(
527 [
528#include <sys/types.h>
529 ],
530 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
531 [ ac_cv_have_uintxx_t="yes" ],
532 [ ac_cv_have_uintxx_t="no" ]
533 )
534 ])
535 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
536 AC_DEFINE(HAVE_UINTXX_T)
537 fi
538fi
539
540AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
541 AC_TRY_COMPILE(
542 [
543#include <sys/types.h>
544#include <sys/socket.h>
545 ],
546 [socklen_t foo; foo = 1235;],
547 [ ac_cv_have_socklen_t="yes" ],
548 [ ac_cv_have_socklen_t="no" ]
549 )
550])
551if test "x$ac_cv_have_socklen_t" = "xyes" ; then
552 AC_DEFINE(HAVE_SOCKLEN_T)
553fi
554
555AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
556 AC_TRY_COMPILE(
557 [
558#include <sys/types.h>
559 ],
560 [ size_t foo; foo = 1235; ],
561 [ ac_cv_have_size_t="yes" ],
562 [ ac_cv_have_size_t="no" ]
563 )
564])
565if test "x$ac_cv_have_size_t" = "xyes" ; then
566 AC_DEFINE(HAVE_SIZE_T)
567fi
568
569AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
570 AC_TRY_COMPILE(
571 [
572#include <sys/types.h>
573 ],
574 [ ssize_t foo; foo = 1235; ],
575 [ ac_cv_have_ssize_t="yes" ],
576 [ ac_cv_have_ssize_t="no" ]
577 )
578])
579if test "x$ac_cv_have_ssize_t" = "xyes" ; then
580 AC_DEFINE(HAVE_SSIZE_T)
581fi
582
583AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
584 AC_TRY_COMPILE(
585 [
586#include <sys/types.h>
587#include <sys/socket.h>
588 ],
589 [ sa_family_t foo; foo = 1235; ],
590 [ ac_cv_have_sa_family_t="yes" ],
591 [ ac_cv_have_sa_family_t="no" ]
592 )
593])
594if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
595 AC_DEFINE(HAVE_SA_FAMILY_T)
596fi
597
598AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
599 AC_TRY_COMPILE(
600 [
601#include <sys/types.h>
602 ],
603 [ pid_t foo; foo = 1235; ],
604 [ ac_cv_have_pid_t="yes" ],
605 [ ac_cv_have_pid_t="no" ]
606 )
607])
608if test "x$ac_cv_have_pid_t" = "xyes" ; then
609 AC_DEFINE(HAVE_PID_T)
610fi
611
612AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
613 AC_TRY_COMPILE(
614 [
615#include <sys/types.h>
616 ],
617 [ mode_t foo; foo = 1235; ],
618 [ ac_cv_have_mode_t="yes" ],
619 [ ac_cv_have_mode_t="no" ]
620 )
621])
622if test "x$ac_cv_have_mode_t" = "xyes" ; then
623 AC_DEFINE(HAVE_MODE_T)
624fi
625
626
627AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
628 AC_TRY_COMPILE(
629 [
630#include <sys/types.h>
631#include <sys/socket.h>
632 ],
633 [ struct sockaddr_storage s; ],
634 [ ac_cv_have_struct_sockaddr_storage="yes" ],
635 [ ac_cv_have_struct_sockaddr_storage="no" ]
636 )
637])
638if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
639 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
640fi
641
642AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
643 AC_TRY_COMPILE(
644 [
645#include <sys/types.h>
646#include <netinet/in.h>
647 ],
648 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
649 [ ac_cv_have_struct_sockaddr_in6="yes" ],
650 [ ac_cv_have_struct_sockaddr_in6="no" ]
651 )
652])
653if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
654 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
655fi
656
657AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
658 AC_TRY_COMPILE(
659 [
660#include <sys/types.h>
661#include <netinet/in.h>
662 ],
663 [ struct in6_addr s; s.s6_addr[0] = 0; ],
664 [ ac_cv_have_struct_in6_addr="yes" ],
665 [ ac_cv_have_struct_in6_addr="no" ]
666 )
667])
668if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
669 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
670fi
671
672AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
673 AC_TRY_COMPILE(
674 [
675#include <sys/types.h>
676#include <sys/socket.h>
677#include <netdb.h>
678 ],
679 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
680 [ ac_cv_have_struct_addrinfo="yes" ],
681 [ ac_cv_have_struct_addrinfo="no" ]
682 )
683])
684if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
685 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
686fi
687
688
689# Checks for structure members
690
691OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
692OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
693OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
694OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
695OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
696OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
697OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
698OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
699OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
700OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
701OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
702OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
703OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
704OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
705OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
706OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
707OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
708
709AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
710 ac_cv_have_sun_len_in_struct_sockaddr_un, [
711 AC_TRY_COMPILE(
712 [
713#include <sys/types.h>
714#include <sys/socket.h>
715 ],
716 [ struct sockaddr_un s; s.sun_len = 1; ],
717 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
718 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
719 )
720])
721if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
722 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
723fi
724
725AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
726 ac_cv_have_ss_family_in_struct_ss, [
727 AC_TRY_COMPILE(
728 [
729#include <sys/types.h>
730#include <sys/socket.h>
731 ],
732 [ struct sockaddr_storage s; s.ss_family = 1; ],
733 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
734 [ ac_cv_have_ss_family_in_struct_ss="no" ],
735 )
736])
737if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
738 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
739fi
740
741AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
742 ac_cv_have___ss_family_in_struct_ss, [
743 AC_TRY_COMPILE(
744 [
745#include <sys/types.h>
746#include <sys/socket.h>
747 ],
748 [ struct sockaddr_storage s; s.__ss_family = 1; ],
749 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
750 [ ac_cv_have___ss_family_in_struct_ss="no" ]
751 )
752])
753if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
754 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
755fi
756
757AC_CACHE_CHECK([for pw_class field in struct passwd],
758 ac_cv_have_pw_class_in_struct_passwd, [
759 AC_TRY_COMPILE(
760 [
761#include <sys/types.h>
762#include <pwd.h>
763 ],
764 [ struct passwd p s; p.pw_class = NULL; ],
765 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
766 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
767 )
768])
769if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
770 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
771fi
772
773
774AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
775 AC_TRY_LINK([],
776 [ extern char *__progname; printf("%s", __progname); ],
777 [ ac_cv_libc_defines___progname="yes" ],
778 [ ac_cv_libc_defines___progname="no" ]
779 )
780])
781if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
782 AC_DEFINE(HAVE___PROGNAME)
783fi
784
785
786AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
787 AC_TRY_LINK([],
788 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
789 [ ac_cv_libc_defines_sys_errlist="yes" ],
790 [ ac_cv_libc_defines_sys_errlist="no" ]
791 )
792])
793if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
794 AC_DEFINE(HAVE_SYS_ERRLIST)
795fi
796
797
798AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
799 AC_TRY_LINK([],
800 [ extern int sys_nerr; printf("%i", sys_nerr);],
801 [ ac_cv_libc_defines_sys_nerr="yes" ],
802 [ ac_cv_libc_defines_sys_nerr="no" ]
803 )
804])
805if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
806 AC_DEFINE(HAVE_SYS_NERR)
807fi
808
809
810# Looking for programs, paths and files
811AC_ARG_WITH(rsh,
812 [ --with-rsh=PATH Specify path to remote shell program ],
813 [
814 if test "x$withval" != "$no" ; then
815 rsh_path=$withval
816 fi
817 ],
818 [
819 AC_PATH_PROG(rsh_path, rsh)
820 ]
821)
822
823AC_ARG_WITH(xauth,
824 [ --with-xauth=PATH Specify path to xauth program ],
825 [
826 if test "x$withval" != "$xno" ; then
827 xauth_path=$withval
828 fi
829 ],
830 [
831 AC_PATH_PROG(xauth_path, xauth)
832 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
833 xauth_path="/usr/openwin/bin/xauth"
834 fi
835 ]
836)
837
838if test ! -z "$xauth_path" ; then
839 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
840fi
841if test ! -z "$rsh_path" ; then
842 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
843fi
844
845# Check for mail directory (last resort if we cannot get it from headers)
846if test ! -z "$MAIL" ; then
847 maildir=`dirname $MAIL`
848 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
849fi
850
851if test -z "$no_dev_ptmx" ; then
852 AC_CHECK_FILE("/dev/ptmx",
853 [
854 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
855 have_dev_ptmx=1
856 ]
857 )
858fi
859AC_CHECK_FILE("/dev/ptc",
860 [
861 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
862 have_dev_ptc=1
863 ]
864)
865
866# Options from here on. Some of these are preset by platform above
867
868# Check for user-specified random device, otherwise check /dev/urandom
869AC_ARG_WITH(random,
870 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
871 [
872 if test "x$withval" != "xno" ; then
873 RANDOM_POOL="$withval";
874 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
875 fi
876 ],
877 [
878 # Check for random device
879 AC_CHECK_FILE("/dev/urandom",
880 [
881 RANDOM_POOL="/dev/urandom";
882 AC_SUBST(RANDOM_POOL)
883 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
884 ]
885 )
886 ]
887)
888
889# Check for EGD pool file
890AC_ARG_WITH(egd-pool,
891 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
892 [
893 if test "x$withval" != "xno" ; then
894 EGD_SOCKET="$withval";
895 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
896 fi
897 ]
898)
899
900# detect pathnames for entropy gathering commands, if we need them
901INSTALL_SSH_PRNG_CMDS=""
902rm -f prng_commands
903if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
904 # Use these commands to collect entropy
905 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
906 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
907 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
908 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
909 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
910 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
911 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
912 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
913 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
914 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
915 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
916 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
917 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
918 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
919 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
920
921 INSTALL_SSH_PRNG_CMDS="yes"
922fi
923AC_SUBST(INSTALL_SSH_PRNG_CMDS)
924
925
926AC_ARG_WITH(catman,
927 [ --with-catman=man|cat Install preformatted manpages[no]],
928 [
929 MANTYPE='$(CATMAN)'
930 if test x"$withval" != x"yes" ; then
931 mansubdir=$withval
932 else
933 mansubdir=cat
934 fi
935 ], [
936 if test -z "$MANTYPE" ; then
937 MANTYPE='$(TROFFMAN)'
938 mansubdir=man
939 fi
940 ]
941)
942AC_SUBST(MANTYPE)
943AC_SUBST(mansubdir)
944
945# Check whether user wants Kerberos support
946KRB4_MSG="no"
947AC_ARG_WITH(kerberos4,
948 [ --with-kerberos4=PATH Enable Kerberos 4 support],
949 [
950 if test "x$withval" != "xno" ; then
951
952 if test "x$withval" != "$xyes" ; then
953 CFLAGS="$CFLAGS -I${withval}/include"
954 LDFLAGS="$LDFLAGS -L${withval}/lib"
955 if test ! -z "$need_dash_r" ; then
956 LDFLAGS="$LDFLAGS -R${withval}/lib"
957 fi
958 if test ! -z "$blibpath" ; then
959 blibpath="$blibpath:${withval}/lib"
960 fi
961 else
962 if test -d /usr/include/kerberosIV ; then
963 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
964 fi
965 fi
966
967 AC_CHECK_HEADERS(krb.h)
968 AC_CHECK_LIB(krb, main)
969 if test "$ac_cv_header_krb_h" != yes; then
970 AC_MSG_WARN([Cannot find krb.h, build may fail])
971 fi
972 if test "$ac_cv_lib_krb_main" != yes; then
973 AC_MSG_WARN([Cannot find libkrb, build may fail])
974 fi
975
976 KLIBS="-lkrb -ldes"
977 AC_CHECK_LIB(resolv, dn_expand, , )
978 KRB4=yes
979 KRB4_MSG="yes"
980 AC_DEFINE(KRB4)
981 fi
982 ]
983)
984
985# Check whether user wants AFS support
986AFS_MSG="no"
987AC_ARG_WITH(afs,
988 [ --with-afs=PATH Enable AFS support],
989 [
990 if test "x$withval" != "xno" ; then
991
992 if test "x$withval" != "$xyes" ; then
993 CFLAGS="$CFLAGS -I${withval}/include"
994 LFLAGS="$LFLAGS -L${withval}/lib"
995 fi
996
997 if test -z "$KRB4" ; then
998 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
999 fi
1000
1001 LIBS="$LIBS -lkafs"
1002 if test ! -z "$AFS_LIBS" ; then
1003 LIBS="$LIBS $AFS_LIBS"
1004 fi
1005 AC_DEFINE(AFS)
1006 AFS_MSG="yes"
1007 fi
1008 ]
1009)
1010LIBS="$LIBS $KLIBS"
1011
1012# Check whether user wants S/Key support
1013SKEY_MSG="no"
1014AC_ARG_WITH(skey,
1015 [ --with-skey Enable S/Key support],
1016 [
1017 if test "x$withval" != "xno" ; then
1018 AC_DEFINE(SKEY)
1019 LIBS="$LIBS -lskey"
1020 SKEY_MSG="yes"
1021 fi
1022 ]
1023)
1024
1025# Check whether user wants TCP wrappers support
1026TCPW_MSG="no"
1027AC_ARG_WITH(tcp-wrappers,
1028 [ --with-tcp-wrappers Enable tcpwrappers support],
1029 [
1030 if test "x$withval" != "xno" ; then
1031 saved_LIBS="$LIBS"
1032 LIBS="$LIBS -lwrap"
1033 AC_MSG_CHECKING(for libwrap)
1034 AC_TRY_LINK(
1035 [
1036#include <tcpd.h>
1037 int deny_severity = 0, allow_severity = 0;
1038 ],
1039 [hosts_access(0);],
1040 [
1041 AC_MSG_RESULT(yes)
1042 AC_DEFINE(LIBWRAP)
1043 TCPW_MSG="yes"
1044 ],
1045 [
1046 AC_MSG_ERROR([*** libwrap missing])
1047 ]
1048 )
1049 fi
1050 ]
1051)
1052
1053# Check whether to enable MD5 passwords
1054MD5_MSG="no"
1055AC_ARG_WITH(md5-passwords,
1056 [ --with-md5-passwords Enable use of MD5 passwords],
1057 [
1058 if test "x$withval" != "xno" ; then
1059 AC_DEFINE(HAVE_MD5_PASSWORDS)
1060 MD5_MSG="yes"
1061 fi
1062 ]
1063)
1064
1065# Whether to disable shadow password support
1066AC_ARG_WITH(shadow,
1067 [ --without-shadow Disable shadow password support],
1068 [
1069 if test "x$withval" = "xno" ; then
1070 AC_DEFINE(DISABLE_SHADOW)
1071 disable_shadow=yes
1072 fi
1073 ]
1074)
1075
1076if test -z "$disable_shadow" ; then
1077 AC_MSG_CHECKING([if the systems has expire shadow information])
1078 AC_TRY_COMPILE(
1079 [
1080#include <sys/types.h>
1081#include <shadow.h>
1082 struct spwd sp;
1083 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1084 [ sp_expire_available=yes ], []
1085 )
1086
1087 if test "x$sp_expire_available" = "xyes" ; then
1088 AC_MSG_RESULT(yes)
1089 AC_DEFINE(HAS_SHADOW_EXPIRE)
1090 else
1091 AC_MSG_RESULT(no)
1092 fi
1093fi
1094
1095# Use ip address instead of hostname in $DISPLAY
1096if test ! -z "$IPADDR_IN_DISPLAY" ; then
1097 DISPLAY_HACK_MSG="yes"
1098 AC_DEFINE(IPADDR_IN_DISPLAY)
1099else
1100 DISPLAY_HACK_MSG="no"
1101 AC_ARG_WITH(ipaddr-display,
1102 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1103 [
1104 if test "x$withval" != "xno" ; then
1105 AC_DEFINE(IPADDR_IN_DISPLAY)
1106 DISPLAY_HACK_MSG="yes"
1107 fi
1108 ]
1109 )
1110fi
1111
1112# Whether to mess with the default path
1113SERVER_PATH_MSG="(default)"
1114AC_ARG_WITH(default-path,
1115 [ --with-default-path=PATH Specify default \$PATH environment for server],
1116 [
1117 if test "x$withval" != "xno" ; then
1118 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
1119 SERVER_PATH_MSG="$withval"
1120 fi
1121 ]
1122)
1123
1124# Whether to force IPv4 by default (needed on broken glibc Linux)
1125IPV4_HACK_MSG="no"
1126AC_ARG_WITH(ipv4-default,
1127 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1128 [
1129 if test "x$withval" != "xno" ; then
1130 AC_DEFINE(IPV4_DEFAULT)
1131 IPV4_HACK_MSG="yes"
1132 fi
1133 ]
1134)
1135
1136AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1137IPV4_IN6_HACK_MSG="no"
1138AC_ARG_WITH(4in6,
1139 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1140 [
1141 if test "x$withval" != "xno" ; then
1142 AC_MSG_RESULT(yes)
1143 AC_DEFINE(IPV4_IN_IPV6)
1144 IPV4_IN6_HACK_MSG="yes"
1145 else
1146 AC_MSG_RESULT(no)
1147 fi
1148 ],[
1149 if test "x$inet6_default_4in6" = "xyes"; then
1150 AC_MSG_RESULT([yes (default)])
1151 AC_DEFINE(IPV4_IN_IPV6)
1152 IPV4_IN6_HACK_MSG="yes"
1153 else
1154 AC_MSG_RESULT([no (default)])
1155 fi
1156 ]
1157)
1158
1159# Where to place sshd.pid
1160piddir=/var/run
1161AC_ARG_WITH(pid-dir,
1162 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1163 [
1164 if test "x$withval" != "xno" ; then
1165 piddir=$withval
1166 fi
1167 ]
1168)
1169
1170AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
1171AC_SUBST(piddir)
1172
1173dnl allow user to disable some login recording features
1174AC_ARG_ENABLE(lastlog,
1175 [ --disable-lastlog disable use of lastlog even if detected [no]],
1176 [ AC_DEFINE(DISABLE_LASTLOG) ]
1177)
1178AC_ARG_ENABLE(utmp,
1179 [ --disable-utmp disable use of utmp even if detected [no]],
1180 [ AC_DEFINE(DISABLE_UTMP) ]
1181)
1182AC_ARG_ENABLE(utmpx,
1183 [ --disable-utmpx disable use of utmpx even if detected [no]],
1184 [ AC_DEFINE(DISABLE_UTMPX) ]
1185)
1186AC_ARG_ENABLE(wtmp,
1187 [ --disable-wtmp disable use of wtmp even if detected [no]],
1188 [ AC_DEFINE(DISABLE_WTMP) ]
1189)
1190AC_ARG_ENABLE(wtmpx,
1191 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
1192 [ AC_DEFINE(DISABLE_WTMPX) ]
1193)
1194AC_ARG_ENABLE(libutil,
1195 [ --disable-libutil disable use of libutil (login() etc.) [no]],
1196 [ AC_DEFINE(DISABLE_LOGIN) ]
1197)
1198AC_ARG_ENABLE(pututline,
1199 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1200 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1201)
1202AC_ARG_ENABLE(pututxline,
1203 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
1204 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1205)
1206AC_ARG_WITH(lastlog,
1207 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
1208 [ conf_lastlog_location="$withval"; ],)
1209
1210dnl lastlog, [uw]tmpx? detection
1211dnl NOTE: set the paths in the platform section to avoid the
1212dnl need for command-line parameters
1213dnl lastlog and [uw]tmp are subject to a file search if all else fails
1214
1215dnl lastlog detection
1216dnl NOTE: the code itself will detect if lastlog is a directory
1217AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1218AC_TRY_COMPILE([
1219#include <sys/types.h>
1220#include <utmp.h>
1221#ifdef HAVE_LASTLOG_H
1222# include <lastlog.h>
1223#endif
1224#ifdef HAVE_PATHS_H
1225# include <paths.h>
1226#endif
1227 ],
1228 [ char *lastlog = LASTLOG_FILE; ],
1229 [ AC_MSG_RESULT(yes) ],
1230 [
1231 AC_MSG_RESULT(no)
1232 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1233 AC_TRY_COMPILE([
1234#include <sys/types.h>
1235#include <utmp.h>
1236#ifdef HAVE_LASTLOG_H
1237# include <lastlog.h>
1238#endif
1239#ifdef HAVE_PATHS_H
1240# include <paths.h>
1241#endif
1242 ],
1243 [ char *lastlog = _PATH_LASTLOG; ],
1244 [ AC_MSG_RESULT(yes) ],
1245 [
1246 AC_MSG_RESULT(no)
1247 system_lastlog_path=no
1248 ])
1249 ]
1250)
1251
1252if test -z "$conf_lastlog_location"; then
1253 if test x"$system_lastlog_path" = x"no" ; then
1254 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
1255 if (test -d "$f" || test -f "$f") ; then
1256 conf_lastlog_location=$f
1257 fi
1258 done
1259 if test -z "$conf_lastlog_location"; then
1260 AC_MSG_WARN([** Cannot find lastlog **])
1261 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
1262 fi
1263 fi
1264fi
1265
1266if test -n "$conf_lastlog_location"; then
1267 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1268fi
1269
1270dnl utmp detection
1271AC_MSG_CHECKING([if your system defines UTMP_FILE])
1272AC_TRY_COMPILE([
1273#include <sys/types.h>
1274#include <utmp.h>
1275#ifdef HAVE_PATHS_H
1276# include <paths.h>
1277#endif
1278 ],
1279 [ char *utmp = UTMP_FILE; ],
1280 [ AC_MSG_RESULT(yes) ],
1281 [ AC_MSG_RESULT(no)
1282 system_utmp_path=no ]
1283)
1284if test -z "$conf_utmp_location"; then
1285 if test x"$system_utmp_path" = x"no" ; then
1286 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1287 if test -f $f ; then
1288 conf_utmp_location=$f
1289 fi
1290 done
1291 if test -z "$conf_utmp_location"; then
1292 AC_DEFINE(DISABLE_UTMP)
1293 fi
1294 fi
1295fi
1296if test -n "$conf_utmp_location"; then
1297 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1298fi
1299
1300dnl wtmp detection
1301AC_MSG_CHECKING([if your system defines WTMP_FILE])
1302AC_TRY_COMPILE([
1303#include <sys/types.h>
1304#include <utmp.h>
1305#ifdef HAVE_PATHS_H
1306# include <paths.h>
1307#endif
1308 ],
1309 [ char *wtmp = WTMP_FILE; ],
1310 [ AC_MSG_RESULT(yes) ],
1311 [ AC_MSG_RESULT(no)
1312 system_wtmp_path=no ]
1313)
1314if test -z "$conf_wtmp_location"; then
1315 if test x"$system_wtmp_path" = x"no" ; then
1316 for f in /usr/adm/wtmp /var/log/wtmp; do
1317 if test -f $f ; then
1318 conf_wtmp_location=$f
1319 fi
1320 done
1321 if test -z "$conf_wtmp_location"; then
1322 AC_DEFINE(DISABLE_WTMP)
1323 fi
1324 fi
1325fi
1326if test -n "$conf_wtmp_location"; then
1327 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1328fi
1329
1330
1331dnl utmpx detection - I don't know any system so perverse as to require
1332dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1333dnl there, though.
1334AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1335AC_TRY_COMPILE([
1336#include <sys/types.h>
1337#include <utmp.h>
1338#ifdef HAVE_UTMPX_H
1339#include <utmpx.h>
1340#endif
1341#ifdef HAVE_PATHS_H
1342# include <paths.h>
1343#endif
1344 ],
1345 [ char *utmpx = UTMPX_FILE; ],
1346 [ AC_MSG_RESULT(yes) ],
1347 [ AC_MSG_RESULT(no)
1348 system_utmpx_path=no ]
1349)
1350if test -z "$conf_utmpx_location"; then
1351 if test x"$system_utmpx_path" = x"no" ; then
1352 AC_DEFINE(DISABLE_UTMPX)
1353 fi
1354else
1355 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1356fi
1357
1358dnl wtmpx detection
1359AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1360AC_TRY_COMPILE([
1361#include <sys/types.h>
1362#include <utmp.h>
1363#ifdef HAVE_UTMPX_H
1364#include <utmpx.h>
1365#endif
1366#ifdef HAVE_PATHS_H
1367# include <paths.h>
1368#endif
1369 ],
1370 [ char *wtmpx = WTMPX_FILE; ],
1371 [ AC_MSG_RESULT(yes) ],
1372 [ AC_MSG_RESULT(no)
1373 system_wtmpx_path=no ]
1374)
1375if test -z "$conf_wtmpx_location"; then
1376 if test x"$system_wtmpx_path" = x"no" ; then
1377 AC_DEFINE(DISABLE_WTMPX)
1378 fi
1379else
1380 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1381fi
1382
1383
1384# Change default command timeout for builtin PRNG
1385entropy_timeout=200
1386AC_ARG_WITH(entropy-timeout,
1387 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1388 [
1389 if test "x$withval" != "xno" ; then
1390 entropy_timeout=$withval
1391 fi
1392 ]
1393)
1394AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1395
1396
1397if test ! -z "$blibpath" ; then
1398 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1399 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1400fi
1401
1402AC_OUTPUT(Makefile ssh_prng_cmds)
1403
1404# Print summary of options
1405
1406if test x$MANTYPE = x'$(CATMAN)' ; then
1407 MAN_MSG=cat
1408else
1409 MAN_MSG=man
1410fi
1411if test ! -z "$RANDOM_POOL" ; then
1412 RAND_MSG="Device ($RANDOM_POOL)"
1413else
1414 if test ! -z "$EGD_SOCKET" ; then
1415 RAND_MSG="EGD ($EGD_SOCKET)"
1416 else
1417 RAND_MSG="Builtin (timeout $entropy_timeout)"
1418 fi
1419fi
1420
1421# Someone please show me a better way :)
1422A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1423B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1424C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1425D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1426E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1427F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1428G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1429
1430echo ""
1431echo "OpenSSH configured has been configured with the following options."
1432echo " User binaries: $B"
1433echo " System binaries: $C"
1434echo " Configuration files: $D"
1435echo " Askpass program: $E"
1436echo " Manual pages: $F"
1437echo " PID file: $G"
1438echo " Random number collection: $RAND_MSG"
1439echo " Manpage format: $MAN_MSG"
1440echo " PAM support: ${PAM_MSG}"
1441echo " KerberosIV support: $KRB4_MSG"
1442echo " AFS support: $AFS_MSG"
1443echo " S/KEY support: $SKEY_MSG"
1444echo " TCP Wrappers support: $TCPW_MSG"
1445echo " MD5 password support: $MD5_MSG"
1446echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1447echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1448echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1449
1450echo ""
1451
1452echo "Compiler flags: ${CFLAGS}"
1453echo "Linker flags: ${LDFLAGS}"
1454echo "Libraries: ${LIBS}"
1455
1456echo ""
1457
This page took 0.374032 seconds and 5 git commands to generate.