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