blob: d574cfc5c55c1a86820d648b73d073f4f2bcc8a4 [file] [log] [blame]
Damien Millerab18c411999-11-11 10:40:23 +11001AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10002
3AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11004AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11005AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10006
Damien Millera22ba012000-03-02 23:09:20 +11007# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +11008AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +10009AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110010AC_PROG_INSTALL
Damien Millerc7b38ce1999-11-09 10:28:04 +110011AC_CHECK_PROG(AR, ar, ar)
Damien Millere79334a1999-12-29 10:03:37 +110012AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100014AC_PATH_PROG(ENT, ent)
15AC_SUBST(ENT)
Damien Miller2e1b0821999-12-25 10:11:29 +110016
Damien Miller166bd442000-03-16 10:48:25 +110017if 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
Damien Millera22ba012000-03-02 23:09:20 +110028# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110029case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110030*-*-aix*)
31 AFS_LIBS="-lld"
Damien Millerdb819592000-03-14 13:44:01 +110032 CFLAGS="$CFLAGS -I/usr/local/include"
33 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +110034 if test "$LD" != "gcc" -a -z "$blibpath"; then
35 blibpath="/usr/lib:/lib:/usr/local/lib"
36 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100037 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110038 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000039 MANTYPE='$(CATMAN)'
40 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000041 dnl AIX handles lastlog as part of its login message
42 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110043 ;;
Damien Miller76112de1999-12-21 11:18:08 +110044*-*-hpux10*)
45 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100046 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110047 fi
48 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
49 AC_DEFINE(IPADDR_IN_DISPLAY)
50 AC_MSG_CHECKING(for HPUX trusted system password database)
51 if test -f /tcb/files/auth/system/default; then
52 AC_MSG_RESULT(yes)
53 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
54 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110055 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110056 else
57 AC_MSG_RESULT(no)
58 AC_DEFINE(DISABLE_SHADOW)
59 fi
Damien Miller670a4b82000-01-22 13:53:11 +110060 MANTYPE='$(CATMAN)'
61 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110062 ;;
Damien Miller1bead332000-04-30 00:47:29 +100063*-*-hpux11*)
64 if test -z "$GCC"; then
65 CFLAGS="$CFLAGS -Ae"
66 fi
67 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100068 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100069 AC_MSG_CHECKING(for HPUX trusted system password database)
70 if test -f /tcb/files/auth/system/default; then
71 AC_MSG_RESULT(yes)
72 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
73 LIBS="$LIBS -lsec"
74 AC_MSG_WARN([This configuration is untested])
75 else
76 AC_MSG_RESULT(no)
77 AC_DEFINE(DISABLE_SHADOW)
78 fi
79 MANTYPE='$(CATMAN)'
80 mansubdir=cat
81 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110082*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110083 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100084 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110085 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110086 no_libsocket=1
87 no_libnsl=1
88 ;;
89*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110090 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100091 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110092 MANTYPE='$(CATMAN)'
93 AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
Damien Millerbeb4ba51999-12-28 15:09:35 +110094 no_libsocket=1
95 no_libnsl=1
96 ;;
Damien Millerb29ea912000-01-15 14:12:03 +110097*-*-linux*)
98 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +110099 AC_DEFINE(DONT_TRY_OTHER_AF)
100 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100101 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100102*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100103 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100104 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000105*-next-*)
106 # hardwire lastlog location (can't detect it on some versions)
107 conf_lastlog_location="/usr/adm/lastlog"
108 AC_DEFINE(HAVE_NEXT)
109 CFLAGS="$CFLAGS -I/usr/local/include"
110 MAIL=/usr/spool/mail
111 conf_utmp_location=/etc/utmp
112 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
113 AC_MSG_WARN([*** Expect 'scp' to fail!])
114 AC_MSG_WARN([*** Please report any problems, thanks])
115 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100116*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100117 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100118 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100119 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000120 # hardwire lastlog location (can't detect it on some versions)
121 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000122 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
123 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
124 if test "$sol2ver" -ge 8; then
125 AC_MSG_RESULT(yes)
126 AC_DEFINE(DISABLE_UTMP)
127 AC_DEFINE(DISABLE_WTMP)
128 else
129 AC_MSG_RESULT(no)
130 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100131 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000132*-*-sunos4*)
133 CFLAGS="$CFLAGS -DSUNOS4"
134 AC_CHECK_FUNCS(getpwanam)
135 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100136*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100137 CFLAGS="$CFLAGS -I/usr/local/include"
138 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100139 MANTYPE='$(CATMAN)'
140 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100141 LIBS="$LIBS -lgen -lsocket"
142 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000143*-*-sco3*)
144 CFLAGS="$CFLAGS -I/usr/local/include"
145 LDFLAGS="$LDFLAGS -L/usr/local/lib"
146 MANTYPE='$(CATMAN)'
147 mansubdir=cat
148 LIBS="$LIBS -lgen -lsocket"
149 no_dev_ptmx=1
150 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100151esac
152
Damien Millere37bfc12000-06-05 09:37:43 +1000153# Allow user to specify flags
154AC_ARG_WITH(cflags,
155 [ --with-cflags Specify additional flags to pass to compiler],
156 [
157 if test "x$withval" != "xno" ; then
158 CFLAGS="$CFLAGS $withval"
159 fi
160 ]
161)
162AC_ARG_WITH(ldflags,
163 [ --with-ldlags Specify additional flags to pass to linker],
164 [
165 if test "x$withval" != "xno" ; then
166 LDFLAGS="$LDFLAGS $withval"
167 fi
168 ]
169)
170AC_ARG_WITH(libs,
171 [ --with-libs Specify additional libraries to link with],
172 [
173 if test "x$withval" != "xno" ; then
174 LIBS="$LIBS $withval"
175 fi
176 ]
177)
178
179
Damien Millera22ba012000-03-02 23:09:20 +1100180# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100181AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
182AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100183
Damien Millerbeb4ba51999-12-28 15:09:35 +1100184if test -z "$no_libsocket" ; then
185 AC_CHECK_LIB(nsl, yp_match, , )
186fi
187if test -z "$no_libnsl" ; then
188 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100189fi
Damien Millerab18c411999-11-11 10:40:23 +1100190
Damien Millera22ba012000-03-02 23:09:20 +1100191# Checks for header files.
Damien Miller0f91b4e2000-06-18 15:43:25 +1000192AC_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 util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100193
Damien Millera22ba012000-03-02 23:09:20 +1100194# Checks for library functions.
andre2ff7b5d2000-06-03 14:57:40 +0000195AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop)
196dnl checks for time functions
197AC_CHECK_FUNCS(gettimeofday time)
198dnl checks for libutil functions
199AC_CHECK_FUNCS(login logout updwtmp logwtmp)
200dnl checks for utmp functions
201AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
202AC_CHECK_FUNCS(utmpname)
203dnl checks for utmpx functions
204AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
205AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100206
Damien Miller04f80141999-11-19 15:32:34 +1100207AC_CHECK_FUNC(login,
208 [AC_DEFINE(HAVE_LOGIN)],
209 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
210)
211
212AC_CHECK_FUNC(daemon,
213 [AC_DEFINE(HAVE_DAEMON)],
214 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
215)
216
Damien Miller9fb07e42000-03-05 16:22:59 +1100217AC_CHECK_FUNC(getpagesize,
218 [AC_DEFINE(HAVE_GETPAGESIZE)],
219 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
220)
221
Damien Miller7b22d652000-06-18 14:07:04 +1000222PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100223AC_ARG_WITH(pam,
224 [ --without-pam Disable PAM support ],
225 [
226 if test "x$withval" = "xno" ; then
227 no_pam=1
228 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000229 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100230 fi
231 ]
232)
233if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
234 AC_CHECK_LIB(dl, dlopen, , )
235 LIBS="$LIBS -lpam"
236
Damien Miller0e65eed2000-05-17 22:16:05 +1000237 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000238
Damien Miller7b22d652000-06-18 14:07:04 +1000239 PAM_MSG="yes"
240
Damien Millera22ba012000-03-02 23:09:20 +1100241 # Check PAM strerror arguments (old PAM)
242 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
243 AC_TRY_COMPILE(
244 [
Damien Miller81171112000-04-23 11:14:01 +1000245#include <stdlib.h>
246#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100247 ],
248 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
249 [AC_MSG_RESULT(no)],
250 [
251 AC_DEFINE(HAVE_OLD_PAM)
252 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000253 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100254 ]
255 )
256fi
257
258# The big search for OpenSSL
259AC_ARG_WITH(ssl-dir,
260 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
261 [
262 if test "x$withval" != "$xno" ; then
263 tryssldir=$withval
264 fi
265 ]
266)
267
268saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100269saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100270saved_CFLAGS="$CFLAGS"
271if test "x$prefix" != "xNONE" ; then
272 tryssldir="$tryssldir $prefix"
273fi
Damien Miller61e50f12000-05-08 20:49:37 +1000274AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100275
Damien Miller61e50f12000-05-08 20:49:37 +1000276 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
277 if test ! -z "$ssldir" ; then
278 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
279 CFLAGS="$saved_CFLAGS -I$ssldir/include"
280 if test ! -z "$need_dash_r" ; then
281 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
282 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100283 else
Damien Miller61e50f12000-05-08 20:49:37 +1000284 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100285 fi
286
Damien Miller3b512e12000-05-17 23:29:18 +1000287 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000288
Damien Miller3b512e12000-05-17 23:29:18 +1000289 # Basic test to check for compatible version and correct linking
290 # *does not* test for RSA - that comes later.
291 AC_TRY_RUN(
292 [
Damien Millere59ce622000-05-01 20:54:17 +1000293#include <string.h>
294#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000295int main(void)
296{
Damien Miller3b512e12000-05-17 23:29:18 +1000297 char a[2048];
298 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000299 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000300 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000301}
Damien Miller3b512e12000-05-17 23:29:18 +1000302 ],
303 [
304 found_crypto=1
305 break;
306 ], []
307 )
Damien Miller61e50f12000-05-08 20:49:37 +1000308
309 if test ! -z "$found_crypto" ; then
310 break;
311 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100312 done
313
Damien Miller61e50f12000-05-08 20:49:37 +1000314 if test -z "$found_crypto" ; then
315 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100316 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000317 if test -z "$ssldir" ; then
318 ssldir="(system)"
319 fi
Damien Millera22ba012000-03-02 23:09:20 +1100320
Damien Miller61e50f12000-05-08 20:49:37 +1000321 ac_cv_openssldir=$ssldir
322])
323
324if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
325 AC_DEFINE(HAVE_OPENSSL)
326 dnl Need to recover ssldir - test above runs in subshell
327 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100328 CFLAGS="$saved_CFLAGS -I$ssldir/include"
329 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
330 if test ! -z "$need_dash_r" ; then
331 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100332 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100333 if test ! -z "$blibpath" ; then
334 blibpath="$blibpath:$ssldir:$ssldir/lib"
335 fi
Damien Millera22ba012000-03-02 23:09:20 +1100336fi
Damien Miller3b512e12000-05-17 23:29:18 +1000337LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000338
Damien Miller3b512e12000-05-17 23:29:18 +1000339# Now test RSA support
340saved_LIBS="$LIBS"
341AC_MSG_CHECKING([for RSA support])
342for WANTS_RSAREF in "" 1 ; do
343 if test -z "$WANTS_RSAREF" ; then
344 LIBS="$saved_LIBS"
345 else
346 LIBS="$saved_LIBS -lRSAglue -lrsaref"
347 fi
348 AC_TRY_RUN([
349#include <string.h>
350#include <openssl/rand.h>
351#include <openssl/rsa.h>
352#include <openssl/bn.h>
353#include <openssl/sha.h>
354int main(void)
355{
356 int num; RSA *key; static unsigned char p_in[] = "blahblah";
357 unsigned char c[256], p[256];
358 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
359 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
360 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
361 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
362}
363 ],
364 [
365 rsa_works=1
366 break;
367 ], [])
368done
369
370if test ! -z "$no_rsa" ; then
371 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000372 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000373else
374 if test -z "$rsa_works" ; then
375 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000376 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000377 else
378 if test -z "$WANTS_RSAREF" ; then
379 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000380 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000381 else
Damien Miller7b22d652000-06-18 14:07:04 +1000382 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000383 AC_MSG_RESULT(using RSAref)
384 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
385 fi
386 fi
387fi
Damien Millera22ba012000-03-02 23:09:20 +1100388
389# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100390AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100391AC_CHECK_SIZEOF(short int, 2)
392AC_CHECK_SIZEOF(int, 4)
393AC_CHECK_SIZEOF(long int, 4)
394AC_CHECK_SIZEOF(long long int, 8)
395
Damien Millera22ba012000-03-02 23:09:20 +1100396# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000397AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
398 AC_TRY_COMPILE(
399 [ #include <sys/types.h> ],
400 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
401 [ ac_cv_have_intxx_t="yes" ],
402 [ ac_cv_have_intxx_t="no" ]
403 )
404])
405if test "x$ac_cv_have_intxx_t" = "xyes" ; then
406 AC_DEFINE(HAVE_INTXX_T)
407 have_intxx_t=1
408fi
409
410AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
411 AC_TRY_COMPILE(
412 [ #include <sys/types.h> ],
413 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
414 [ ac_cv_have_u_intxx_t="yes" ],
415 [ ac_cv_have_u_intxx_t="no" ]
416 )
417])
418if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
419 AC_DEFINE(HAVE_U_INTXX_T)
420 have_u_intxx_t=1
421fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100422
Damien Millerc6398ef1999-11-20 12:18:40 +1100423
Damien Millereaf99942000-01-19 13:45:07 +1100424if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
Damien Millerb29ea912000-01-15 14:12:03 +1100425 "x$ac_cv_header_sys_bitypes_h" = "xyes"
426then
427 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
428 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000429 [
430#include <sys/bitypes.h>
431 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100432 [
Damien Miller70494d12000-04-03 15:57:06 +1000433 int8_t a; int16_t b; int32_t c;
434 u_int8_t e; u_int16_t f; u_int32_t g;
435 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100436 ],
437 [
438 AC_DEFINE(HAVE_U_INTXX_T)
439 AC_DEFINE(HAVE_INTXX_T)
440 AC_MSG_RESULT(yes)
441 ],
442 [AC_MSG_RESULT(no)]
443 )
444fi
445
Damien Millerd6121d22000-03-17 23:26:46 +1100446if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000447 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
448 AC_TRY_COMPILE(
449 [
450#include <sys/types.h>
451 ],
452 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
453 [ ac_cv_have_uintxx_t="yes" ],
454 [ ac_cv_have_uintxx_t="no" ]
455 )
456 ])
457 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
458 AC_DEFINE(HAVE_UINTXX_T)
459 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100460fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100461
Damien Miller61e50f12000-05-08 20:49:37 +1000462AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
463 AC_TRY_COMPILE(
464 [
Damien Miller81171112000-04-23 11:14:01 +1000465#include <sys/types.h>
466#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000467 ],
468 [socklen_t foo; foo = 1235;],
469 [ ac_cv_have_socklen_t="yes" ],
470 [ ac_cv_have_socklen_t="no" ]
471 )
472])
473if test "x$ac_cv_have_socklen_t" = "xyes" ; then
474 AC_DEFINE(HAVE_SOCKLEN_T)
475fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100476
Damien Miller61e50f12000-05-08 20:49:37 +1000477AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
478 AC_TRY_COMPILE(
479 [
480#include <sys/types.h>
481 ],
482 [ size_t foo; foo = 1235; ],
483 [ ac_cv_have_size_t="yes" ],
484 [ ac_cv_have_size_t="no" ]
485 )
486])
487if test "x$ac_cv_have_size_t" = "xyes" ; then
488 AC_DEFINE(HAVE_SIZE_T)
489fi
Damien Miller95058511999-12-29 10:36:45 +1100490
Damien Miller615f9392000-05-17 22:53:33 +1000491AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
492 AC_TRY_COMPILE(
493 [
494#include <sys/types.h>
495 ],
496 [ ssize_t foo; foo = 1235; ],
497 [ ac_cv_have_ssize_t="yes" ],
498 [ ac_cv_have_ssize_t="no" ]
499 )
500])
501if test "x$ac_cv_have_ssize_t" = "xyes" ; then
502 AC_DEFINE(HAVE_SSIZE_T)
503fi
504
Damien Miller0f91b4e2000-06-18 15:43:25 +1000505AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
506 AC_TRY_COMPILE(
507 [
508#include <sys/types.h>
509 ],
510 [ pid_t foo; foo = 1235; ],
511 [ ac_cv_have_pid_t="yes" ],
512 [ ac_cv_have_pid_t="no" ]
513 )
514])
515if test "x$ac_cv_have_pid_t" = "xyes" ; then
516 AC_DEFINE(HAVE_PID_T)
517fi
518
519AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
520 AC_TRY_COMPILE(
521 [
522#include <sys/types.h>
523 ],
524 [ mode_t foo; foo = 1235; ],
525 [ ac_cv_have_mode_t="yes" ],
526 [ ac_cv_have_mode_t="no" ]
527 )
528])
529if test "x$ac_cv_have_mode_t" = "xyes" ; then
530 AC_DEFINE(HAVE_MODE_T)
531fi
532
Damien Miller61e50f12000-05-08 20:49:37 +1000533
534AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
535 AC_TRY_COMPILE(
536 [
Damien Miller81171112000-04-23 11:14:01 +1000537#include <sys/types.h>
538#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000539 ],
540 [ struct sockaddr_storage s; ],
541 [ ac_cv_have_struct_sockaddr_storage="yes" ],
542 [ ac_cv_have_struct_sockaddr_storage="no" ]
543 )
544])
545if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
546 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
547fi
Damien Miller34132e52000-01-14 15:45:46 +1100548
Damien Miller61e50f12000-05-08 20:49:37 +1000549AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
550 AC_TRY_COMPILE(
551 [
Damien Miller7b22d652000-06-18 14:07:04 +1000552#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000553#include <netinet/in.h>
554 ],
555 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
556 [ ac_cv_have_struct_sockaddr_in6="yes" ],
557 [ ac_cv_have_struct_sockaddr_in6="no" ]
558 )
559])
560if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
561 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
562fi
Damien Miller34132e52000-01-14 15:45:46 +1100563
Damien Miller61e50f12000-05-08 20:49:37 +1000564AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
565 AC_TRY_COMPILE(
566 [
Damien Miller7b22d652000-06-18 14:07:04 +1000567#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000568#include <netinet/in.h>
569 ],
570 [ struct in6_addr s; s.s6_addr[0] = 0; ],
571 [ ac_cv_have_struct_in6_addr="yes" ],
572 [ ac_cv_have_struct_in6_addr="no" ]
573 )
574])
575if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
576 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
577fi
Damien Miller34132e52000-01-14 15:45:46 +1100578
Damien Miller61e50f12000-05-08 20:49:37 +1000579AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
580 AC_TRY_COMPILE(
581 [
Damien Miller81171112000-04-23 11:14:01 +1000582#include <sys/types.h>
583#include <sys/socket.h>
584#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000585 ],
586 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
587 [ ac_cv_have_struct_addrinfo="yes" ],
588 [ ac_cv_have_struct_addrinfo="no" ]
589 )
590])
591if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
592 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
593fi
594
Damien Miller34132e52000-01-14 15:45:46 +1100595
Damien Millera22ba012000-03-02 23:09:20 +1100596# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100597
Damien Miller61e50f12000-05-08 20:49:37 +1000598OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
599OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
600OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
601OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
602OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000603OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000604OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
605OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
606OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
607OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
608OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
609OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000610OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
611OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
612OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
613OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
614
Damien Miller61e50f12000-05-08 20:49:37 +1000615AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
616 ac_cv_have_ss_family_in_struct_ss, [
617 AC_TRY_COMPILE(
618 [
Damien Miller81171112000-04-23 11:14:01 +1000619#include <sys/types.h>
620#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000621 ],
622 [ struct sockaddr_storage s; s.ss_family = 1; ],
623 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
624 [ ac_cv_have_ss_family_in_struct_ss="no" ],
625 )
626])
627if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
628 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
629fi
630
Damien Miller61e50f12000-05-08 20:49:37 +1000631AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
632 ac_cv_have___ss_family_in_struct_ss, [
633 AC_TRY_COMPILE(
634 [
Damien Miller81171112000-04-23 11:14:01 +1000635#include <sys/types.h>
636#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000637 ],
638 [ struct sockaddr_storage s; s.__ss_family = 1; ],
639 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
640 [ ac_cv_have___ss_family_in_struct_ss="no" ]
641 )
642])
643if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
644 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
645fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100646
Damien Miller61e50f12000-05-08 20:49:37 +1000647
648AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
649 AC_TRY_LINK([],
650 [ extern char *__progname; printf("%s", __progname); ],
651 [ ac_cv_libc_defines___progname="yes" ],
652 [ ac_cv_libc_defines___progname="no" ]
653 )
654])
655if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
656 AC_DEFINE(HAVE___PROGNAME)
657fi
658
Damien Millera22ba012000-03-02 23:09:20 +1100659
660# Looking for programs, paths and files
661AC_ARG_WITH(rsh,
662 [ --with-rsh=PATH Specify path to remote shell program ],
663 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100664 if test "x$withval" != "$no" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000665 rsa_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100666 fi
667 ],
668 [
669 AC_PATH_PROG(rsh_path, rsh)
670 ]
671)
672
673AC_ARG_WITH(xauth,
674 [ --with-xauth=PATH Specify path to xauth program ],
675 [
676 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000677 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100678 fi
679 ],
680 [
681 AC_PATH_PROG(xauth_path, xauth)
682 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
683 xauth_path="/usr/openwin/bin/xauth"
684 fi
685 ]
686)
687
688if test ! -z "$xauth_path" ; then
689 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
690fi
691if test ! -z "$rsh_path" ; then
692 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
693fi
694
695# Check for mail directory (last resort if we cannot get it from headers)
696if test ! -z "$MAIL" ; then
697 maildir=`dirname $MAIL`
698 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
699fi
700
Damien Millera22ba012000-03-02 23:09:20 +1100701if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100702 AC_CHECK_FILE("/dev/ptmx",
703 [
704 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
705 have_dev_ptmx=1
706 ]
707 )
Damien Millera22ba012000-03-02 23:09:20 +1100708fi
Damien Miller204ad072000-03-02 23:56:12 +1100709AC_CHECK_FILE("/dev/ptc",
710 [
711 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
712 have_dev_ptc=1
713 ]
714)
715
Damien Millera22ba012000-03-02 23:09:20 +1100716# Options from here on. Some of these are preset by platform above
717
Damien Millera22ba012000-03-02 23:09:20 +1100718# Check for user-specified random device, otherwise check /dev/urandom
719AC_ARG_WITH(random,
720 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
721 [
Damien Miller040f3832000-04-03 14:50:43 +1000722 if test "x$withval" != "xno" ; then
723 RANDOM_POOL="$withval";
724 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
725 fi
Damien Millera22ba012000-03-02 23:09:20 +1100726 ],
727 [
728 # Check for random device
729 AC_CHECK_FILE("/dev/urandom",
730 [
731 RANDOM_POOL="/dev/urandom";
732 AC_SUBST(RANDOM_POOL)
733 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
734 ]
735 )
736 ]
737)
738
739# Check for EGD pool file
740AC_ARG_WITH(egd-pool,
741 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
742 [
Damien Miller040f3832000-04-03 14:50:43 +1000743 if test "x$withval" != "xno" ; then
744 EGD_SOCKET="$withval";
745 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
746 fi
Damien Millera22ba012000-03-02 23:09:20 +1100747 ]
748)
749
Damien Miller0437b332000-05-02 09:56:41 +1000750# detect pathnames for entropy gathering commands, if we need them
751INSTALL_SSH_PRNG_CMDS=""
752rm -f prng_commands
Damien Miller11e37f62000-04-08 18:23:30 +1000753if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
754 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000755 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
756 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
757 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
758 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
759 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
760 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
761 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
762 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
763 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
764 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
765 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
766 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
767 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
768 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
769 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000770
771 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000772fi
Damien Miller0437b332000-05-02 09:56:41 +1000773AC_SUBST(INSTALL_SSH_PRNG_CMDS)
774
Damien Miller11e37f62000-04-08 18:23:30 +1000775
Damien Miller670a4b82000-01-22 13:53:11 +1100776AC_ARG_WITH(catman,
777 [ --with-catman=man|cat Install preformatted manpages[no]],
778 [
779 MANTYPE='$(CATMAN)'
780 if test x"$withval" != x"yes" ; then
781 mansubdir=$withval
782 else
783 mansubdir=cat
784 fi
785 ], [
786 if test -z "$MANTYPE" ; then
787 MANTYPE='$(TROFFMAN)'
788 mansubdir=man
789 fi
790 ]
791)
792AC_SUBST(MANTYPE)
793AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100794
Damien Millera22ba012000-03-02 23:09:20 +1100795# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000796KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100797AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100798 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100799 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100800 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100801
802 if test "x$withval" != "$xyes" ; then
803 CFLAGS="$CFLAGS -I${withval}/include"
804 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100805 if test ! -z "$need_dash_r" ; then
806 LDFLAGS="$LDFLAGS -R${withval}/lib"
807 fi
808 if test ! -z "$blibpath" ; then
809 blibpath="$blibpath:${withval}/lib"
810 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100811 else
812 if test -d /usr/include/kerberosIV ; then
813 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
814 fi
815 fi
816
817 AC_CHECK_HEADERS(krb.h)
818 AC_CHECK_LIB(krb, main)
819 if test "$ac_cv_header_krb_h" != yes; then
820 AC_MSG_WARN([Cannot find krb.h, build may fail])
821 fi
822 if test "$ac_cv_lib_krb_main" != yes; then
823 AC_MSG_WARN([Cannot find libkrb, build may fail])
824 fi
825
Damien Millerc85f9b42000-01-29 10:20:21 +1100826 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100827 AC_CHECK_LIB(resolv, dn_expand, , )
828 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000829 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100830 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100831 fi
Damien Miller80297751999-11-19 13:03:25 +1100832 ]
833)
834
Damien Millera22ba012000-03-02 23:09:20 +1100835# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000836AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100837AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100838 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100839 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100840 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100841
842 if test "x$withval" != "$xyes" ; then
843 CFLAGS="$CFLAGS -I${withval}/include"
844 LFLAGS="$LFLAGS -L${withval}/lib"
845 fi
846
847 if test -z "$KRB4" ; then
848 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
849 fi
850
Damien Miller8bdeee21999-12-30 15:50:54 +1100851 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100852 if test ! -z "$AFS_LIBS" ; then
853 LIBS="$LIBS $AFS_LIBS"
854 fi
855 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000856 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100857 fi
Damien Miller80297751999-11-19 13:03:25 +1100858 ]
859)
Damien Millerc85f9b42000-01-29 10:20:21 +1100860LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100861
Damien Millera22ba012000-03-02 23:09:20 +1100862# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000863SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100864AC_ARG_WITH(skey,
865 [ --with-skey Enable S/Key support],
866 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100867 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100868 AC_DEFINE(SKEY)
869 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000870 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100871 fi
Damien Miller80297751999-11-19 13:03:25 +1100872 ]
873)
874
Damien Millera22ba012000-03-02 23:09:20 +1100875# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000876TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100877AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100878 [ --with-tcp-wrappers Enable tcpwrappers support],
879 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100880 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100881 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100882 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100883 AC_MSG_CHECKING(for libwrap)
884 AC_TRY_LINK(
885 [
Damien Miller81171112000-04-23 11:14:01 +1000886#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100887 int deny_severity = 0, allow_severity = 0;
888 ],
889 [hosts_access(0);],
890 [
891 AC_MSG_RESULT(yes)
892 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +1000893 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +1100894 ],
895 [
Damien Miller7b22d652000-06-18 14:07:04 +1000896 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +1100897 ]
898 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100899 fi
Damien Miller80297751999-11-19 13:03:25 +1100900 ]
901)
902
Damien Millera22ba012000-03-02 23:09:20 +1100903# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +1000904MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100905AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100906 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100907 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100908 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100909 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +1000910 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100911 fi
912 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100913)
914
Damien Millera22ba012000-03-02 23:09:20 +1100915# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +1100916AC_ARG_WITH(shadow,
917 [ --without-shadow Disable shadow password support],
918 [
919 if test "x$withval" = "xno" ; then
920 AC_DEFINE(DISABLE_SHADOW)
921 fi
922 ]
923)
924
Damien Millera22ba012000-03-02 23:09:20 +1100925# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +1000926DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +1100927AC_ARG_WITH(ipaddr-display,
928 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
929 [
Damien Miller66409952000-01-17 21:40:06 +1100930 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +1100931 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +1000932 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +1100933 fi
934 ]
935)
936
Damien Millera22ba012000-03-02 23:09:20 +1100937# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +1000938SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +1100939AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +1100940 [ --with-default-path=PATH Specify default \$PATH environment for server],
941 [
942 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +1100943 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +1000944 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +1100945 fi
946 ]
947)
948
Damien Millera22ba012000-03-02 23:09:20 +1100949# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +1000950IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +1100951AC_ARG_WITH(ipv4-default,
952 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
953 [
954 if test "x$withval" != "xno" ; then
955 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +1000956 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +1100957 fi
958 ]
959)
960
Damien Miller61e50f12000-05-08 20:49:37 +1000961AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +1000962IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +1100963AC_ARG_WITH(4in6,
964 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
965 [
966 if test "x$withval" != "xno" ; then
967 AC_MSG_RESULT(yes)
968 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +1000969 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +1100970 else
971 AC_MSG_RESULT(no)
972 fi
973 ],[
974 if test "x$inet6_default_4in6" = "xyes"; then
975 AC_MSG_RESULT([yes (default)])
976 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +1000977 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +1100978 else
979 AC_MSG_RESULT([no (default)])
980 fi
981 ]
982)
983
Damien Millera22ba012000-03-02 23:09:20 +1100984# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +1100985piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +1100986AC_ARG_WITH(pid-dir,
987 [ --with-pid-dir=PATH Specify location of ssh.pid file],
988 [
989 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +1100990 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +1100991 fi
992 ]
993)
Damien Miller4018c192000-04-30 09:30:44 +1000994
Damien Millerdbd250f2000-01-18 08:57:14 +1100995AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +1100996AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +1100997
andre2ff7b5d2000-06-03 14:57:40 +0000998dnl allow user to disable some login recording features
999AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001000 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001001 [ AC_DEFINE(DISABLE_LASTLOG) ]
1002)
1003AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001004 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001005 [ AC_DEFINE(DISABLE_UTMP) ]
1006)
1007AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001008 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001009 [ AC_DEFINE(DISABLE_UTMPX) ]
1010)
1011AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001012 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001013 [ AC_DEFINE(DISABLE_WTMP) ]
1014)
1015AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001016 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001017 [ AC_DEFINE(DISABLE_WTMPX) ]
1018)
1019AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001020 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001021 [ AC_DEFINE(DISABLE_LOGIN) ]
1022)
1023AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001024 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001025 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1026)
1027AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001028 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001029 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1030)
1031AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001032 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001033 [ conf_lastlog_location="$withval"; ],)
1034
1035dnl lastlog, [uw]tmpx? detection
1036dnl NOTE: set the paths in the platform section to avoid the
1037dnl need for command-line parameters
1038dnl lastlog and [uw]tmp are subject to a file search if all else fails
1039
1040dnl lastlog detection
1041dnl NOTE: the code itself will detect if lastlog is a directory
1042AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1043AC_TRY_COMPILE([
1044#include <sys/types.h>
1045#include <utmp.h>
1046#ifdef HAVE_LASTLOG_H
1047# include <lastlog.h>
1048#endif
Damien Miller2994e082000-06-04 15:51:47 +10001049#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001050# include <paths.h>
1051#endif
1052 ],
1053 [ char *lastlog = LASTLOG_FILE; ],
1054 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001055 [
1056 AC_MSG_RESULT(no)
1057 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1058 AC_TRY_COMPILE([
1059#include <sys/types.h>
1060#include <utmp.h>
1061#ifdef HAVE_LASTLOG_H
1062# include <lastlog.h>
1063#endif
1064#ifdef HAVE_PATHS_H
1065# include <paths.h>
1066#endif
1067 ],
1068 [ char *lastlog = _PATH_LASTLOG; ],
1069 [ AC_MSG_RESULT(yes) ],
1070 [
andree441aa32000-06-12 22:34:38 +00001071 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001072 system_lastlog_path=no
1073 ])
1074 ]
andre2ff7b5d2000-06-03 14:57:40 +00001075)
Damien Miller2994e082000-06-04 15:51:47 +10001076
andre2ff7b5d2000-06-03 14:57:40 +00001077if test -z "$conf_lastlog_location"; then
1078 if test x"$system_lastlog_path" = x"no" ; then
1079 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Millerc29de952000-06-12 23:04:18 +10001080 if test -d "$f" -o -f "$f" ; then
andre2ff7b5d2000-06-03 14:57:40 +00001081 conf_lastlog_location=$f
1082 fi
1083 done
1084 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001085 AC_MSG_WARN([** Cannot find lastlog **])
1086 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001087 fi
1088 fi
1089fi
1090
1091if test -n "$conf_lastlog_location"; then
1092 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1093fi
1094
1095dnl utmp detection
1096AC_MSG_CHECKING([if your system defines UTMP_FILE])
1097AC_TRY_COMPILE([
1098#include <sys/types.h>
1099#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001100#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001101# include <paths.h>
1102#endif
1103 ],
1104 [ char *utmp = UTMP_FILE; ],
1105 [ AC_MSG_RESULT(yes) ],
1106 [ AC_MSG_RESULT(no)
1107 system_utmp_path=no ]
1108)
1109if test -z "$conf_utmp_location"; then
1110 if test x"$system_utmp_path" = x"no" ; then
1111 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1112 if test -f $f ; then
1113 conf_utmp_location=$f
1114 fi
1115 done
1116 if test -z "$conf_utmp_location"; then
1117 AC_DEFINE(DISABLE_UTMP)
1118 fi
1119 fi
1120fi
1121if test -n "$conf_utmp_location"; then
1122 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1123fi
1124
1125dnl wtmp detection
1126AC_MSG_CHECKING([if your system defines WTMP_FILE])
1127AC_TRY_COMPILE([
1128#include <sys/types.h>
1129#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001130#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001131# include <paths.h>
1132#endif
1133 ],
1134 [ char *wtmp = WTMP_FILE; ],
1135 [ AC_MSG_RESULT(yes) ],
1136 [ AC_MSG_RESULT(no)
1137 system_wtmp_path=no ]
1138)
1139if test -z "$conf_wtmp_location"; then
1140 if test x"$system_wtmp_path" = x"no" ; then
1141 for f in /usr/adm/wtmp /var/log/wtmp; do
1142 if test -f $f ; then
1143 conf_wtmp_location=$f
1144 fi
1145 done
1146 if test -z "$conf_wtmp_location"; then
1147 AC_DEFINE(DISABLE_WTMP)
1148 fi
1149 fi
1150fi
1151if test -n "$conf_wtmp_location"; then
1152 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1153fi
1154
1155
1156dnl utmpx detection - I don't know any system so perverse as to require
1157dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1158dnl there, though.
1159AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1160AC_TRY_COMPILE([
1161#include <sys/types.h>
1162#include <utmp.h>
1163#ifdef HAVE_UTMPX_H
1164#include <utmpx.h>
1165#endif
Damien Miller2994e082000-06-04 15:51:47 +10001166#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001167# include <paths.h>
1168#endif
1169 ],
1170 [ char *utmpx = UTMPX_FILE; ],
1171 [ AC_MSG_RESULT(yes) ],
1172 [ AC_MSG_RESULT(no)
1173 system_utmpx_path=no ]
1174)
1175if test -z "$conf_utmpx_location"; then
1176 if test x"$system_utmpx_path" = x"no" ; then
1177 AC_DEFINE(DISABLE_UTMPX)
1178 fi
1179else
1180 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1181fi
1182
1183dnl wtmpx detection
1184AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1185AC_TRY_COMPILE([
1186#include <sys/types.h>
1187#include <utmp.h>
1188#ifdef HAVE_UTMPX_H
1189#include <utmpx.h>
1190#endif
Damien Miller2994e082000-06-04 15:51:47 +10001191#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001192# include <paths.h>
1193#endif
1194 ],
1195 [ char *wtmpx = WTMPX_FILE; ],
1196 [ AC_MSG_RESULT(yes) ],
1197 [ AC_MSG_RESULT(no)
1198 system_wtmpx_path=no ]
1199)
1200if test -z "$conf_wtmpx_location"; then
1201 if test x"$system_wtmpx_path" = x"no" ; then
1202 AC_DEFINE(DISABLE_WTMPX)
1203 fi
1204else
1205 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1206fi
1207
Damien Miller4018c192000-04-30 09:30:44 +10001208
1209# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001210entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001211AC_ARG_WITH(entropy-timeout,
1212 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1213 [
1214 if test "x$withval" != "xno" ; then
1215 entropy_timeout=$withval
1216 fi
1217 ]
1218)
1219AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1220
1221
Damien Miller29ea30d2000-03-17 10:54:15 +11001222if test ! -z "$blibpath" ; then
1223 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1224 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1225fi
1226
Damien Miller0437b332000-05-02 09:56:41 +10001227AC_OUTPUT(Makefile ssh_prng_cmds)
1228
Damien Miller7b22d652000-06-18 14:07:04 +10001229# Print summary of options
1230
1231if test x$MANTYPE = x'$(CATMAN)' ; then
1232 MAN_MSG=cat
1233else
1234 MAN_MSG=man
1235fi
1236if test ! -z "$RANDOM_POOL" ; then
1237 RAND_MSG="Device ($RANDOM_POOL)"
1238else
1239 if test ! -z "$EGD_SOCKET" ; then
1240 RAND_MSG="EGD ($EGD_SOCKET)"
1241 else
1242 RAND_MSG="Builtin (timeout $entropy_timeout)"
1243 fi
1244fi
1245
1246# Someone please show me a better way :)
1247A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1248B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1249C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1250D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1251E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1252F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1253G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1254
1255echo ""
1256echo "OpenSSH configured has been configured with the following options."
1257echo " User binaries: $B"
1258echo " System binaries: $C"
1259echo " Configuration files: $D"
1260echo " Askpass program: $E"
1261echo " Manual pages: $F"
1262echo " PID file: $G"
1263echo " Random number collection: $RAND_MSG"
1264echo " Manpage format: $MAN_MSG"
1265echo " PAM support: ${PAM_MSG}"
1266echo " KerberosIV support: $KRB4_MSG"
1267echo " AFS support: $AFS_MSG"
1268echo " S/KEY support: $SKEY_MSG"
1269echo " TCP Wrappers support: $TCPW_MSG"
1270echo " MD5 password support: $MD5_MSG"
1271echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1272echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1273echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1274
1275echo ""
1276
1277echo "Compiler flags: ${CFLAGS}"
1278echo "Linker flags: ${LDFLAGS}"
1279echo "Libraries: ${LIBS}"
1280
1281echo ""
1282