blob: 4158b99b2d680f9d09acc8739d562264b71b9201 [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 Miller76112de1999-12-21 11:18:08 +11004AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10005
6dnl Checks for programs.
7AC_PROG_CC
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 Miller2e1b0821999-12-25 10:11:29 +110014
Damien Miller2e1b0821999-12-25 10:11:29 +110015AC_ARG_WITH(rsh,
16 [ --with-rsh=PATH Specify path to remote shell program ],
17 [
Damien Miller8bdeee21999-12-30 15:50:54 +110018 if test "x$withval" != "$xno" ; then
19 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
20 fi
Damien Miller2e1b0821999-12-25 10:11:29 +110021 ],
22 [
23 AC_PATH_PROG(rsh_path, rsh)
24 ]
25)
26
Damien Miller5eed6a22000-01-16 12:05:18 +110027AC_ARG_WITH(xauth,
28 [ --with-xauth=PATH Specify path to xauth program ],
Damien Millerb29ea912000-01-15 14:12:03 +110029 [
30 if test "x$withval" != "$xno" ; then
31 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
32 fi
33 ],
34 [
35 AC_PATH_PROG(xauth_path, xauth)
36 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
37 xauth_path="/usr/openwin/bin/xauth"
38 fi
39 ]
40)
41
Damien Miller2e1b0821999-12-25 10:11:29 +110042if test ! -z "$xauth_path" ; then
43 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
44fi
45if test ! -z "$rsh_path" ; then
46 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
47fi
Damien Miller76112de1999-12-21 11:18:08 +110048
Damien Miller3b9d5e91999-12-15 09:34:31 +110049dnl Checks for compiler characteristics
Damien Millerc7b38ce1999-11-09 10:28:04 +110050if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
Damien Miller76112de1999-12-21 11:18:08 +110051
Damien Miller3b9d5e91999-12-15 09:34:31 +110052AC_C_INLINE
Damien Miller7f6ea021999-10-28 13:25:17 +100053
Damien Milleree1c0b32000-01-21 00:18:15 +110054dnl Check for OpenSSL/SSLeay directories.
55AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
56for ssldir in $prefix /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
57 if test -f "$ssldir/include/openssl/crypto.h"; then
58 AC_DEFINE(HAVE_OPENSSL)
59 GOT_SSL="yes"
60 break
61 fi
62 if test -f "$ssldir/include/ssl/crypto.h"; then
63 AC_DEFINE(HAVE_SSL)
64 GOT_SSL="yes"
65 break
66 fi
67done
68if test -z "$GOT_SSL" ; then
69 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
70fi
71AC_SUBST(ssldir)
72AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
73if test "$ssldir" != "/usr"; then
74 CFLAGS="$CFLAGS -I$ssldir/include"
75 LDFLAGS="$LDFLAGS -L$ssldir/lib"
76fi
77AC_MSG_RESULT($ssldir)
78
Damien Miller76112de1999-12-21 11:18:08 +110079dnl Check for some target-specific stuff
80case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110081*-*-aix*)
82 AFS_LIBS="-lld"
Damien Millereca71f82000-01-20 22:38:27 +110083 AC_DEFINE(BROKEN_GETADDRINFO)
Damien Miller75b1d102000-01-07 14:01:41 +110084 ;;
Damien Miller76112de1999-12-21 11:18:08 +110085*-*-hpux10*)
86 if test -z "$GCC"; then
87 CFLAGS="$CFLAGS -Aa"
88 fi
89 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
90 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller2e1b0821999-12-25 10:11:29 +110091 AC_DEFINE(USE_UTMPX)
Damien Miller76112de1999-12-21 11:18:08 +110092 AC_MSG_CHECKING(for HPUX trusted system password database)
93 if test -f /tcb/files/auth/system/default; then
94 AC_MSG_RESULT(yes)
95 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
96 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110097 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110098 else
99 AC_MSG_RESULT(no)
100 AC_DEFINE(DISABLE_SHADOW)
101 fi
102 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100103*-*-irix5*)
Damien Miller1808f382000-01-06 12:03:12 +1100104 no_libsocket=1
105 no_libnsl=1
106 ;;
107*-*-irix6*)
108 AC_MSG_WARN([*** Irix 6.x is not tested *** ])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100109 no_libsocket=1
110 no_libnsl=1
111 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100112*-*-linux*)
113 no_dev_ptmx=1
114 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100115*-*-netbsd*)
116 if test "$GOT_SSL" = "yes"; then
117 LDFLAGS="$LDFLAGS -R$ssldir/lib"
118 fi
119 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100120*-*-solaris*)
121 AC_DEFINE(USE_UTMPX)
122 ;;
123*-*-sysv*)
124 LIBS="$LIBS -lgen -lsocket"
125 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100126esac
127
Damien Millerc7b38ce1999-11-09 10:28:04 +1100128dnl Check for RSAref library.
129AC_MSG_CHECKING([for RSAref library])
130saved_LIBS="$LIBS"
131LIBS="$saved_LIBS -lRSAglue -lrsaref"
132AC_TRY_LINK([], [],
Damien Millerd00d1611999-12-29 10:17:09 +1100133[AC_MSG_RESULT(yes);
134 AC_DEFINE(RSAREF)],
Damien Millerc7b38ce1999-11-09 10:28:04 +1100135[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
Damien Miller7f6ea021999-10-28 13:25:17 +1000136
Damien Millerab18c411999-11-11 10:40:23 +1100137dnl Checks for libraries.
138AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
139AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
140AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100141
Damien Millerbeb4ba51999-12-28 15:09:35 +1100142if test -z "$no_libsocket" ; then
143 AC_CHECK_LIB(nsl, yp_match, , )
144fi
145if test -z "$no_libnsl" ; then
146 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100147fi
Damien Millerab18c411999-11-11 10:40:23 +1100148
Damien Miller7f6ea021999-10-28 13:25:17 +1000149dnl Checks for header files.
Damien Millereaf99942000-01-19 13:45:07 +1100150AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.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/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100151
Damien Millercedfecc1999-11-15 14:36:53 +1100152dnl Checks for library functions.
Damien Miller834171e2000-01-17 09:59:41 +1100153AC_CHECK_FUNCS(arc4random bindresvport_af freeaddrinfo gai_strerror getaddrinfo getpagesize getnameinfo innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf _getpty)
Damien Millercedfecc1999-11-15 14:36:53 +1100154
Damien Miller04f80141999-11-19 15:32:34 +1100155AC_CHECK_FUNC(login,
156 [AC_DEFINE(HAVE_LOGIN)],
157 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
158)
159
160AC_CHECK_FUNC(daemon,
161 [AC_DEFINE(HAVE_DAEMON)],
162 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
163)
164
Damien Millerc6398ef1999-11-20 12:18:40 +1100165dnl Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100166AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100167AC_CHECK_SIZEOF(short int, 2)
168AC_CHECK_SIZEOF(int, 4)
169AC_CHECK_SIZEOF(long int, 4)
170AC_CHECK_SIZEOF(long long int, 8)
171
172dnl More checks for data types
Damien Miller859cec01999-11-22 14:27:24 +1100173AC_MSG_CHECKING([for intXX_t types])
Damien Millerc6398ef1999-11-20 12:18:40 +1100174AC_TRY_COMPILE(
175 [#include <sys/types.h>],
176 [int16_t a; int32_t b; a = 1235; b = 1235;],
177 [
178 AC_DEFINE(HAVE_INTXX_T)
179 AC_MSG_RESULT(yes)
Damien Millerb29ea912000-01-15 14:12:03 +1100180 have_intxx_t=1
Damien Millerc6398ef1999-11-20 12:18:40 +1100181 ],
182 [AC_MSG_RESULT(no)]
183)
184
Damien Miller859cec01999-11-22 14:27:24 +1100185AC_MSG_CHECKING([for u_intXX_t types])
Damien Millerc6398ef1999-11-20 12:18:40 +1100186AC_TRY_COMPILE(
187 [#include <sys/types.h>],
188 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
189 [
190 AC_DEFINE(HAVE_U_INTXX_T)
191 AC_MSG_RESULT(yes)
Damien Millerb29ea912000-01-15 14:12:03 +1100192 have_u_intxx_t=1
Damien Millerc6398ef1999-11-20 12:18:40 +1100193 ],
194 [AC_MSG_RESULT(no)]
195)
196
Damien Millereaf99942000-01-19 13:45:07 +1100197if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
Damien Millerb29ea912000-01-15 14:12:03 +1100198 "x$ac_cv_header_sys_bitypes_h" = "xyes"
199then
200 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
201 AC_TRY_COMPILE(
202 [#include <sys/bitypes.h>],
203 [
204 u_int16_t c; u_int32_t d;
205 int16_t e; int32_t f;
206 c = 1235; d = 1235;
207 e = 1235; f = 1235;
208 ],
209 [
210 AC_DEFINE(HAVE_U_INTXX_T)
211 AC_DEFINE(HAVE_INTXX_T)
212 AC_MSG_RESULT(yes)
213 ],
214 [AC_MSG_RESULT(no)]
215 )
216fi
217
Damien Miller34132e52000-01-14 15:45:46 +1100218AC_MSG_CHECKING([for uintXX_t types])
Damien Millerc6398ef1999-11-20 12:18:40 +1100219AC_TRY_COMPILE(
220 [#include <sys/types.h>],
221 [uint16_t c; uint32_t d; c = 1235; d = 1235;],
222 [
223 AC_DEFINE(HAVE_UINTXX_T)
224 AC_MSG_RESULT(yes)
225 ],
226 [AC_MSG_RESULT(no)]
227)
228
Damien Miller34132e52000-01-14 15:45:46 +1100229AC_MSG_CHECKING([for socklen_t])
Damien Miller74d0d4a1999-12-29 02:24:35 +1100230AC_TRY_COMPILE(
Damien Millerf3e8be81999-12-31 08:59:04 +1100231 [
232 #include <sys/types.h>
233 #include <sys/socket.h>
234 ],
Damien Miller74d0d4a1999-12-29 02:24:35 +1100235 [socklen_t foo; foo = 1235;],
236 [
237 AC_DEFINE(HAVE_SOCKLEN_T)
238 AC_MSG_RESULT(yes)
239 ],
240 [AC_MSG_RESULT(no)]
241)
242
Damien Miller34132e52000-01-14 15:45:46 +1100243AC_MSG_CHECKING([for size_t])
Damien Miller95058511999-12-29 10:36:45 +1100244AC_TRY_COMPILE(
245 [#include <sys/types.h>],
Damien Miller95058511999-12-29 10:36:45 +1100246 [size_t foo; foo = 1235;],
247 [
248 AC_DEFINE(HAVE_SIZE_T)
249 AC_MSG_RESULT(yes)
250 ],
251 [AC_MSG_RESULT(no)]
252)
253
Damien Miller34132e52000-01-14 15:45:46 +1100254AC_MSG_CHECKING([for struct sockaddr_storage])
255AC_TRY_COMPILE(
Damien Miller66409952000-01-17 21:40:06 +1100256 [
257 #include <sys/types.h>
258 #include <sys/socket.h>
259 ],
Damien Miller34132e52000-01-14 15:45:46 +1100260 [struct sockaddr_storage s;],
261 [
262 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
263 AC_MSG_RESULT(yes)
264 ],
265 [AC_MSG_RESULT(no)]
266)
267
268AC_MSG_CHECKING([for struct sockaddr_in6])
269AC_TRY_COMPILE(
270 [#include <netinet/in.h>],
271 [struct sockaddr_in6 s; s.sin6_family = 0;],
272 [
273 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
274 AC_MSG_RESULT(yes)
275 ],
276 [AC_MSG_RESULT(no)]
277)
278
279AC_MSG_CHECKING([for struct in6_addr])
280AC_TRY_COMPILE(
281 [#include <netinet/in.h>],
282 [struct in6_addr s; s.s6_addr[0] = 0;],
283 [
284 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
285 AC_MSG_RESULT(yes)
286 ],
287 [AC_MSG_RESULT(no)]
288)
289
290AC_MSG_CHECKING([for struct addrinfo])
291AC_TRY_COMPILE(
292 [
Damien Miller66409952000-01-17 21:40:06 +1100293 #include <sys/types.h>
Damien Miller34132e52000-01-14 15:45:46 +1100294 #include <sys/socket.h>
295 #include <netdb.h>
296 ],
297 [struct addrinfo s; s.ai_flags = AI_PASSIVE;],
298 [
299 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
300 AC_MSG_RESULT(yes)
301 ],
302 [AC_MSG_RESULT(no)]
303)
304
Damien Millerbeb4ba51999-12-28 15:09:35 +1100305AC_ARG_WITH(pam,
306 [ --without-pam Disable PAM support ],
Damien Miller859cec01999-11-22 14:27:24 +1100307 [
Damien Millerbeb4ba51999-12-28 15:09:35 +1100308 if test "x$withval" = "xno" ; then
309 no_pam=1
310 AC_DEFINE(DISABLE_PAM)
311 fi
Damien Miller859cec01999-11-22 14:27:24 +1100312 ]
Damien Millerbeb4ba51999-12-28 15:09:35 +1100313)
314
315if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
316 AC_CHECK_LIB(dl, dlopen, , )
317 LIBS="$LIBS -lpam"
318 dnl Check PAM strerror arguments
319 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
320 AC_TRY_COMPILE(
321 [
322 #include <stdlib.h>
323 #include <security/pam_appl.h>
324 ],
325 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
326 [AC_MSG_RESULT(no)],
327 [
328 AC_DEFINE(HAVE_OLD_PAM)
329 AC_MSG_RESULT(yes)
330 ]
331 )
332fi
Damien Miller859cec01999-11-22 14:27:24 +1100333
Damien Miller98ac0071999-11-25 13:19:55 +1100334AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
335dnl Check whether user wants GNOME ssh-askpass
336AC_ARG_WITH(gnome-askpass,
337 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
Damien Millercedfecc1999-11-15 14:36:53 +1100338 [
339 if test x$withval = xno ; then
Damien Miller98ac0071999-11-25 13:19:55 +1100340 GNOME_ASKPASS="";
Damien Millercedfecc1999-11-15 14:36:53 +1100341 else
Damien Miller98ac0071999-11-25 13:19:55 +1100342 GNOME_ASKPASS="gnome-ssh-askpass";
Damien Millercedfecc1999-11-15 14:36:53 +1100343 fi
Damien Miller98ac0071999-11-25 13:19:55 +1100344 ])
345AC_SUBST(GNOME_ASKPASS)
346
347if test -z "$GNOME_ASKPASS" ; then
Damien Millercedfecc1999-11-15 14:36:53 +1100348 AC_MSG_RESULT(no)
Damien Miller98ac0071999-11-25 13:19:55 +1100349else
350 AC_MSG_RESULT(yes)
Damien Millercedfecc1999-11-15 14:36:53 +1100351fi
Damien Millere0d444c1999-11-09 14:23:45 +1100352
Damien Millerab18c411999-11-11 10:40:23 +1100353dnl Check for user-specified random device
354AC_ARG_WITH(random,
Damien Millercedfecc1999-11-15 14:36:53 +1100355 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
Damien Millerab18c411999-11-11 10:40:23 +1100356 [
357 RANDOM_POOL="$withval";
Damien Miller0a6e6681999-11-15 09:56:06 +1100358 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
Damien Millerab18c411999-11-11 10:40:23 +1100359 ],
360 [
361 dnl Check for random device
362 AC_CHECK_FILE("/dev/urandom",
363 [
364 RANDOM_POOL="/dev/urandom";
Damien Millera82feb31999-11-11 11:04:17 +1100365 AC_SUBST(RANDOM_POOL)
366 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
Damien Millerab18c411999-11-11 10:40:23 +1100367 ]
368 )
369 ]
370)
371
372dnl Check for EGD pool file
373AC_ARG_WITH(egd-pool,
Damien Millercedfecc1999-11-15 14:36:53 +1100374 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
Damien Millerab18c411999-11-11 10:40:23 +1100375 [
376 RANDOM_POOL="$withval";
377 AC_DEFINE(HAVE_EGD)
Damien Millera82feb31999-11-11 11:04:17 +1100378 AC_SUBST(RANDOM_POOL)
379 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
Damien Millerab18c411999-11-11 10:40:23 +1100380 ]
381)
382
Damien Millercedfecc1999-11-15 14:36:53 +1100383dnl Make sure we have random number support
Damien Millerab18c411999-11-11 10:40:23 +1100384if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
385 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
386fi
387
Damien Miller3f905871999-11-15 17:10:57 +1100388AC_MSG_CHECKING([whether utmp.h has ut_host field])
389AC_EGREP_HEADER(ut_host, utmp.h,
390 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
391 [AC_MSG_RESULT(no)]
392)
Damien Millerbf1c9b21999-12-09 10:16:54 +1100393AC_MSG_CHECKING([whether utmpx.h has ut_host field])
394AC_EGREP_HEADER(ut_host, utmpx.h,
395 [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ],
396 [AC_MSG_RESULT(no)]
397)
Damien Miller2e1b0821999-12-25 10:11:29 +1100398AC_MSG_CHECKING([whether utmpx.h has syslen field])
399AC_EGREP_HEADER(syslen, utmpx.h,
400 [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ],
401 [AC_MSG_RESULT(no)]
402)
Damien Miller4ff2b9b1999-12-28 10:41:12 +1100403AC_MSG_CHECKING([whether utmp.h has ut_pid field])
404AC_EGREP_HEADER(ut_pid, utmp.h,
405 [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ],
406 [AC_MSG_RESULT(no)]
407)
408AC_MSG_CHECKING([whether utmp.h has ut_type field])
409AC_EGREP_HEADER(ut_type, utmp.h,
410 [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ],
411 [AC_MSG_RESULT(no)]
412)
413AC_MSG_CHECKING([whether utmp.h has ut_tv field])
414AC_EGREP_HEADER(ut_tv, utmp.h,
415 [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ],
416 [AC_MSG_RESULT(no)]
417)
Damien Miller9550a761999-12-29 02:32:22 +1100418AC_MSG_CHECKING([whether utmp.h has ut_id field])
419AC_EGREP_HEADER(ut_id, utmp.h,
420 [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ],
421 [AC_MSG_RESULT(no)]
422)
Damien Miller3131d8b1999-12-31 09:42:24 +1100423AC_MSG_CHECKING([whether utmp.h has ut_addr field])
424AC_EGREP_HEADER(ut_addr, utmp.h,
425 [AC_DEFINE(HAVE_ADDR_IN_UTMP) AC_MSG_RESULT(yes); ],
426 [AC_MSG_RESULT(no)]
427)
428AC_MSG_CHECKING([whether utmpx.h has ut_addr field])
429AC_EGREP_HEADER(ut_addr, utmpx.h,
Damien Miller34132e52000-01-14 15:45:46 +1100430 [AC_DEFINE(HAVE_ADDR_IN_UTMPX) AC_MSG_RESULT(yes); ],
431 [AC_MSG_RESULT(no)]
432)
433AC_MSG_CHECKING([whether utmp.h has ut_addr_v6 field])
434AC_EGREP_HEADER(ut_addr_v6, utmp.h,
435 [AC_DEFINE(HAVE_ADDR_V6_IN_UTMP) AC_MSG_RESULT(yes); ],
436 [AC_MSG_RESULT(no)]
437)
438AC_MSG_CHECKING([whether utmpx.h has ut_addr_v6 field])
439AC_EGREP_HEADER(ut_addr_v6, utmpx.h,
440 [AC_DEFINE(HAVE_ADDR_V6_IN_UTMPX) AC_MSG_RESULT(yes); ],
441 [AC_MSG_RESULT(no)]
442)
443
444AC_MSG_CHECKING([whether struct sockaddr_storage has ss_family field])
445AC_TRY_COMPILE(
Damien Miller66409952000-01-17 21:40:06 +1100446 [
447 #include <sys/types.h>
448 #include <sys/socket.h>
449 ],
Damien Miller34132e52000-01-14 15:45:46 +1100450 [struct sockaddr_storage s; s.ss_family = 1;],
451 [
452 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
453 AC_MSG_RESULT(yes)
454 ],
455 [AC_MSG_RESULT(no)]
456)
457AC_MSG_CHECKING([whether struct sockaddr_storage has __ss_family field])
458AC_TRY_COMPILE(
Damien Miller66409952000-01-17 21:40:06 +1100459 [
460 #include <sys/types.h>
461 #include <sys/socket.h>
462 ],
Damien Miller34132e52000-01-14 15:45:46 +1100463 [struct sockaddr_storage s; s.__ss_family = 1;],
464 [
465 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
466 AC_MSG_RESULT(yes)
467 ],
Damien Miller3131d8b1999-12-31 09:42:24 +1100468 [AC_MSG_RESULT(no)]
469)
Damien Millerbf1c9b21999-12-09 10:16:54 +1100470
Damien Miller3f905871999-11-15 17:10:57 +1100471dnl Look for lastlog location
Damien Miller76112de1999-12-21 11:18:08 +1100472AC_ARG_WITH(lastlog,
Damien Miller5a3e6831999-12-27 09:48:56 +1100473 [ --with-lastlog=FILE Location of lastlog file],
Damien Miller76112de1999-12-21 11:18:08 +1100474 [
475 if test "x$withval" = "xno" ; then
476 AC_DEFINE(DISABLE_LASTLOG)
477 else
478 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval")
479 fi
480 ],
481 [
482 AC_MSG_CHECKING([location of lastlog file])
483 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
484 if test -f $lastlog ; then
485 gotlastlog="file"
486 break
487 fi
488 if test -d $lastlog ; then
489 gotlastlog="dir"
490 break
491 fi
492 done
493 if test -z "$gotlastlog" ; then
Damien Millerbeb4ba51999-12-28 15:09:35 +1100494 AC_MSG_RESULT(not found)
Damien Miller76112de1999-12-21 11:18:08 +1100495 nolastlog=1
496 else
497 if test "x$gotlastlog" = "xdir" ; then
Damien Millerbeb4ba51999-12-28 15:09:35 +1100498 AC_MSG_RESULT(${lastlog}/)
Damien Miller76112de1999-12-21 11:18:08 +1100499 AC_DEFINE(LASTLOG_IS_DIR)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100500 else
501 AC_MSG_RESULT($lastlog)
502 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
Damien Miller76112de1999-12-21 11:18:08 +1100503 fi
Damien Miller76112de1999-12-21 11:18:08 +1100504 fi
505 ]
506)
507
508if test ! -z "$nolastlog" ; then
509 AC_MSG_WARN([*** Disabling lastlog support *** ])
510 AC_DEFINE(DISABLE_LASTLOG)
511fi
Damien Miller3f905871999-11-15 17:10:57 +1100512
Damien Miller8bdeee21999-12-30 15:50:54 +1100513dnl Compile with dante SOCKS library
514AC_ARG_WITH(dante,
515 [ --with-dante=DIR Use Dante SOCKS lib (default is system library path)],
516 [
517 AC_DEFINE(HAVE_DANTE)
518 if test "x$withval" != "xno" ; then
519 if test -n $withval ; then
520 LIBS="$LIBS -L$withval"
521 fi
522 LIBS="$LIBS -lsocks"
523 fi
524 ]
525)
526
Damien Miller62a52ef2000-01-16 23:03:56 +1100527if test -z "$no_dev_ptmx" ; then
Damien Millerb29ea912000-01-15 14:12:03 +1100528 AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
529fi
Damien Miller037a0dc1999-12-07 15:38:31 +1100530AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
531
Damien Miller3f905871999-11-15 17:10:57 +1100532AC_MSG_CHECKING([whether libc defines __progname])
533AC_TRY_LINK([],
Damien Miller04f80141999-11-19 15:32:34 +1100534 [extern char *__progname; printf("%s", __progname);],
Damien Miller3f905871999-11-15 17:10:57 +1100535 [
536 AC_DEFINE(HAVE___PROGNAME)
537 AC_MSG_RESULT(yes)
538 ],
539 [
540 AC_MSG_RESULT(no)
541 ]
542)
543
Damien Miller80297751999-11-19 13:03:25 +1100544dnl Check whether user wants Kerberos support
545AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100546 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100547 [
Damien Miller8bdeee21999-12-30 15:50:54 +1100548 if test "x$withval" != "$xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100549
550 if test "x$withval" != "$xyes" ; then
551 CFLAGS="$CFLAGS -I${withval}/include"
552 LDFLAGS="$LDFLAGS -L${withval}/lib"
553 else
554 if test -d /usr/include/kerberosIV ; then
555 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
556 fi
557 fi
558
559 AC_CHECK_HEADERS(krb.h)
560 AC_CHECK_LIB(krb, main)
561 if test "$ac_cv_header_krb_h" != yes; then
562 AC_MSG_WARN([Cannot find krb.h, build may fail])
563 fi
564 if test "$ac_cv_lib_krb_main" != yes; then
565 AC_MSG_WARN([Cannot find libkrb, build may fail])
566 fi
567
568 LIBS="$LIBS -lkrb -ldes"
569 AC_CHECK_LIB(resolv, dn_expand, , )
570 KRB4=yes
Damien Miller8bdeee21999-12-30 15:50:54 +1100571 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100572 fi
Damien Miller80297751999-11-19 13:03:25 +1100573 ]
574)
575
576dnl Check whether user wants AFS support
Damien Millerc6398ef1999-11-20 12:18:40 +1100577AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100578 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100579 [
Damien Miller8bdeee21999-12-30 15:50:54 +1100580 if test "x$withval" != "$xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100581
582 if test "x$withval" != "$xyes" ; then
583 CFLAGS="$CFLAGS -I${withval}/include"
584 LFLAGS="$LFLAGS -L${withval}/lib"
585 fi
586
587 if test -z "$KRB4" ; then
588 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
589 fi
590
Damien Miller8bdeee21999-12-30 15:50:54 +1100591 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100592 if test ! -z "$AFS_LIBS" ; then
593 LIBS="$LIBS $AFS_LIBS"
594 fi
595 AC_DEFINE(AFS)
Damien Miller8bdeee21999-12-30 15:50:54 +1100596 fi
Damien Miller80297751999-11-19 13:03:25 +1100597 ]
598)
599
600dnl Check whether user wants S/Key support
601AC_ARG_WITH(skey,
602 [ --with-skey Enable S/Key support],
603 [
Damien Miller8bdeee21999-12-30 15:50:54 +1100604 if test "x$withval" != "$xno" ; then
605 AC_DEFINE(SKEY)
606 LIBS="$LIBS -lskey"
607 fi
Damien Miller80297751999-11-19 13:03:25 +1100608 ]
609)
610
611dnl Check whether user wants TCP wrappers support
Damien Millerf7c0f821999-11-22 22:31:49 +1100612AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100613 [ --with-tcp-wrappers Enable tcpwrappers support],
614 [
Damien Miller8bdeee21999-12-30 15:50:54 +1100615 if test "x$withval" != "$xno" ; then
616 AC_DEFINE(LIBWRAP)
Damien Miller105b7f02000-01-07 08:45:55 +1100617 LIBS="$LIBS -lwrap"
Damien Miller8bdeee21999-12-30 15:50:54 +1100618 fi
Damien Miller80297751999-11-19 13:03:25 +1100619 ]
620)
621
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100622dnl Check whether to enable MD5 passwords
Damien Millerf7c0f821999-11-22 22:31:49 +1100623AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100624 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100625 [
626 if test "x$withval" != "$xno" ; then
627 AC_DEFINE(HAVE_MD5_PASSWORDS)
628 fi
629 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100630)
631
Damien Miller368cf641999-12-21 09:51:36 +1100632dnl Check whether to enable utmpx support
633AC_ARG_WITH(utmpx,
634 [ --with-utmpx Enable utmpx support],
Damien Miller76112de1999-12-21 11:18:08 +1100635 [
636 if test "x$withval" != "xno" ; then
637 AC_DEFINE(USE_UTMPX)
638 fi
639 ]
Damien Miller368cf641999-12-21 09:51:36 +1100640)
641
Damien Miller76112de1999-12-21 11:18:08 +1100642dnl Whether to disable shadow password support
643AC_ARG_WITH(shadow,
644 [ --without-shadow Disable shadow password support],
645 [
646 if test "x$withval" = "xno" ; then
647 AC_DEFINE(DISABLE_SHADOW)
648 fi
649 ]
650)
651
652dnl Use ip address instead of hostname in $DISPLAY
653AC_ARG_WITH(ipaddr-display,
654 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
655 [
Damien Miller66409952000-01-17 21:40:06 +1100656 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +1100657 AC_DEFINE(IPADDR_IN_DISPLAY)
658 fi
659 ]
660)
661
Damien Millere7f626c1999-12-31 09:49:44 +1100662AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +1100663 [ --with-default-path=PATH Specify default \$PATH environment for server],
664 [
665 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +1100666 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller5a3e6831999-12-27 09:48:56 +1100667 fi
668 ]
669)
670
Damien Miller7d80e342000-01-19 14:36:49 +1100671AC_ARG_WITH(ipv4-default,
672 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
673 [
674 if test "x$withval" != "xno" ; then
675 AC_DEFINE(IPV4_DEFAULT)
676 fi
677 ]
678)
679
Damien Millerb13c73e2000-01-17 22:02:17 +1100680piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +1100681AC_ARG_WITH(pid-dir,
682 [ --with-pid-dir=PATH Specify location of ssh.pid file],
683 [
684 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +1100685 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +1100686 fi
687 ]
688)
Damien Millerdbd250f2000-01-18 08:57:14 +1100689AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +1100690AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +1100691
Damien Miller76112de1999-12-21 11:18:08 +1100692dnl Check for mail directory (last resort if we cannot get it from headers)
693if test ! -z "$MAIL" ; then
694 maildir=`dirname $MAIL`
695 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
696fi
Damien Millerc6b3bbe1999-12-13 08:27:33 +1100697
Damien Miller7f6ea021999-10-28 13:25:17 +1000698AC_OUTPUT(Makefile)