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