blob: c242246d3f104fe1e963caaf9ceb35767c6d8cb2 [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)
andre60f3c982000-06-03 16:18:19 +000039 dnl AIX handles lastlog as part of its login message
40 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110041 ;;
Damien Miller76112de1999-12-21 11:18:08 +110042*-*-hpux10*)
43 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100044 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110045 fi
46 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
47 AC_DEFINE(IPADDR_IN_DISPLAY)
48 AC_MSG_CHECKING(for HPUX trusted system password database)
49 if test -f /tcb/files/auth/system/default; then
50 AC_MSG_RESULT(yes)
51 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
52 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110053 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110054 else
55 AC_MSG_RESULT(no)
56 AC_DEFINE(DISABLE_SHADOW)
57 fi
Damien Miller670a4b82000-01-22 13:53:11 +110058 MANTYPE='$(CATMAN)'
59 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110060 ;;
Damien Miller1bead332000-04-30 00:47:29 +100061*-*-hpux11*)
62 if test -z "$GCC"; then
63 CFLAGS="$CFLAGS -Ae"
64 fi
65 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100066 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100067 AC_MSG_CHECKING(for HPUX trusted system password database)
68 if test -f /tcb/files/auth/system/default; then
69 AC_MSG_RESULT(yes)
70 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
71 LIBS="$LIBS -lsec"
72 AC_MSG_WARN([This configuration is untested])
73 else
74 AC_MSG_RESULT(no)
75 AC_DEFINE(DISABLE_SHADOW)
76 fi
77 MANTYPE='$(CATMAN)'
78 mansubdir=cat
79 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110080*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110081 CFLAGS="$CFLAGS -I/usr/local/include"
82 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller07278932000-01-22 14:05:37 +110083 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110084 no_libsocket=1
85 no_libnsl=1
86 ;;
87*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110088 CFLAGS="$CFLAGS -I/usr/local/include"
89 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller07278932000-01-22 14:05:37 +110090 MANTYPE='$(CATMAN)'
91 AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
Damien Millerbeb4ba51999-12-28 15:09:35 +110092 no_libsocket=1
93 no_libnsl=1
94 ;;
Damien Millerb29ea912000-01-15 14:12:03 +110095*-*-linux*)
96 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +110097 AC_DEFINE(DONT_TRY_OTHER_AF)
98 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +110099 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100100*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100101 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100102 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100103*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100104 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100105 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100106 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000107 # hardwire lastlog location (can't detect it on some versions)
108 conf_lastlog_location="/var/adm/lastlog"
Damien Miller75b1d102000-01-07 14:01:41 +1100109 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000110*-*-sunos4*)
111 CFLAGS="$CFLAGS -DSUNOS4"
112 AC_CHECK_FUNCS(getpwanam)
113 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100114*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100115 CFLAGS="$CFLAGS -I/usr/local/include"
116 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100117 MANTYPE='$(CATMAN)'
118 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100119 LIBS="$LIBS -lgen -lsocket"
120 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100121esac
122
Damien Millere37bfc12000-06-05 09:37:43 +1000123# Allow user to specify flags
124AC_ARG_WITH(cflags,
125 [ --with-cflags Specify additional flags to pass to compiler],
126 [
127 if test "x$withval" != "xno" ; then
128 CFLAGS="$CFLAGS $withval"
129 fi
130 ]
131)
132AC_ARG_WITH(ldflags,
133 [ --with-ldlags Specify additional flags to pass to linker],
134 [
135 if test "x$withval" != "xno" ; then
136 LDFLAGS="$LDFLAGS $withval"
137 fi
138 ]
139)
140AC_ARG_WITH(libs,
141 [ --with-libs Specify additional libraries to link with],
142 [
143 if test "x$withval" != "xno" ; then
144 LIBS="$LIBS $withval"
145 fi
146 ]
147)
148
149
Damien Millera22ba012000-03-02 23:09:20 +1100150# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100151AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
152AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100153
Damien Millerbeb4ba51999-12-28 15:09:35 +1100154if test -z "$no_libsocket" ; then
155 AC_CHECK_LIB(nsl, yp_match, , )
156fi
157if test -z "$no_libnsl" ; then
158 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100159fi
Damien Millerab18c411999-11-11 10:40:23 +1100160
Damien Millera22ba012000-03-02 23:09:20 +1100161# Checks for header files.
andre2ff7b5d2000-06-03 14:57:40 +0000162AC_CHECK_HEADERS(bstring.h endian.h lastlog.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/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 +1100163
Damien Millera22ba012000-03-02 23:09:20 +1100164# Checks for library functions.
andre2ff7b5d2000-06-03 14:57:40 +0000165AC_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)
166dnl checks for time functions
167AC_CHECK_FUNCS(gettimeofday time)
168dnl checks for libutil functions
169AC_CHECK_FUNCS(login logout updwtmp logwtmp)
170dnl checks for utmp functions
171AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
172AC_CHECK_FUNCS(utmpname)
173dnl checks for utmpx functions
174AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
175AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100176
Damien Miller04f80141999-11-19 15:32:34 +1100177AC_CHECK_FUNC(login,
178 [AC_DEFINE(HAVE_LOGIN)],
179 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
180)
181
182AC_CHECK_FUNC(daemon,
183 [AC_DEFINE(HAVE_DAEMON)],
184 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
185)
186
Damien Miller9fb07e42000-03-05 16:22:59 +1100187AC_CHECK_FUNC(getpagesize,
188 [AC_DEFINE(HAVE_GETPAGESIZE)],
189 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
190)
191
Damien Millera22ba012000-03-02 23:09:20 +1100192AC_ARG_WITH(pam,
193 [ --without-pam Disable PAM support ],
194 [
195 if test "x$withval" = "xno" ; then
196 no_pam=1
197 AC_DEFINE(DISABLE_PAM)
198 fi
199 ]
200)
201if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
202 AC_CHECK_LIB(dl, dlopen, , )
203 LIBS="$LIBS -lpam"
204
Damien Miller0e65eed2000-05-17 22:16:05 +1000205 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000206
Damien Millera22ba012000-03-02 23:09:20 +1100207 # Check PAM strerror arguments (old PAM)
208 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
209 AC_TRY_COMPILE(
210 [
Damien Miller81171112000-04-23 11:14:01 +1000211#include <stdlib.h>
212#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100213 ],
214 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
215 [AC_MSG_RESULT(no)],
216 [
217 AC_DEFINE(HAVE_OLD_PAM)
218 AC_MSG_RESULT(yes)
219 ]
220 )
221fi
222
223# The big search for OpenSSL
224AC_ARG_WITH(ssl-dir,
225 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
226 [
227 if test "x$withval" != "$xno" ; then
228 tryssldir=$withval
229 fi
230 ]
231)
232
233saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100234saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100235saved_CFLAGS="$CFLAGS"
236if test "x$prefix" != "xNONE" ; then
237 tryssldir="$tryssldir $prefix"
238fi
Damien Miller61e50f12000-05-08 20:49:37 +1000239AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100240
Damien Miller61e50f12000-05-08 20:49:37 +1000241 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
242 if test ! -z "$ssldir" ; then
243 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
244 CFLAGS="$saved_CFLAGS -I$ssldir/include"
245 if test ! -z "$need_dash_r" ; then
246 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
247 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100248 else
Damien Miller61e50f12000-05-08 20:49:37 +1000249 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100250 fi
251
Damien Miller3b512e12000-05-17 23:29:18 +1000252 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000253
Damien Miller3b512e12000-05-17 23:29:18 +1000254 # Basic test to check for compatible version and correct linking
255 # *does not* test for RSA - that comes later.
256 AC_TRY_RUN(
257 [
Damien Millere59ce622000-05-01 20:54:17 +1000258#include <string.h>
259#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000260int main(void)
261{
Damien Miller3b512e12000-05-17 23:29:18 +1000262 char a[2048];
263 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000264 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000265 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000266}
Damien Miller3b512e12000-05-17 23:29:18 +1000267 ],
268 [
269 found_crypto=1
270 break;
271 ], []
272 )
Damien Miller61e50f12000-05-08 20:49:37 +1000273
274 if test ! -z "$found_crypto" ; then
275 break;
276 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100277 done
278
Damien Miller61e50f12000-05-08 20:49:37 +1000279 if test -z "$found_crypto" ; then
280 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100281 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000282 if test -z "$ssldir" ; then
283 ssldir="(system)"
284 fi
Damien Millera22ba012000-03-02 23:09:20 +1100285
Damien Miller61e50f12000-05-08 20:49:37 +1000286 ac_cv_openssldir=$ssldir
287])
288
289if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
290 AC_DEFINE(HAVE_OPENSSL)
291 dnl Need to recover ssldir - test above runs in subshell
292 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100293 CFLAGS="$saved_CFLAGS -I$ssldir/include"
294 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
295 if test ! -z "$need_dash_r" ; then
296 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100297 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100298 if test ! -z "$blibpath" ; then
299 blibpath="$blibpath:$ssldir:$ssldir/lib"
300 fi
Damien Millera22ba012000-03-02 23:09:20 +1100301fi
Damien Miller3b512e12000-05-17 23:29:18 +1000302LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000303
Damien Miller3b512e12000-05-17 23:29:18 +1000304# Now test RSA support
305saved_LIBS="$LIBS"
306AC_MSG_CHECKING([for RSA support])
307for WANTS_RSAREF in "" 1 ; do
308 if test -z "$WANTS_RSAREF" ; then
309 LIBS="$saved_LIBS"
310 else
311 LIBS="$saved_LIBS -lRSAglue -lrsaref"
312 fi
313 AC_TRY_RUN([
314#include <string.h>
315#include <openssl/rand.h>
316#include <openssl/rsa.h>
317#include <openssl/bn.h>
318#include <openssl/sha.h>
319int main(void)
320{
321 int num; RSA *key; static unsigned char p_in[] = "blahblah";
322 unsigned char c[256], p[256];
323 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
324 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
325 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
326 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
327}
328 ],
329 [
330 rsa_works=1
331 break;
332 ], [])
333done
334
335if test ! -z "$no_rsa" ; then
336 AC_MSG_RESULT(disabled)
337else
338 if test -z "$rsa_works" ; then
339 AC_MSG_WARN([*** No RSA support found *** ])
340 else
341 if test -z "$WANTS_RSAREF" ; then
342 AC_MSG_RESULT(yes)
343 else
344 AC_MSG_RESULT(using RSAref)
345 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
346 fi
347 fi
348fi
Damien Millera22ba012000-03-02 23:09:20 +1100349
350# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100351AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100352AC_CHECK_SIZEOF(short int, 2)
353AC_CHECK_SIZEOF(int, 4)
354AC_CHECK_SIZEOF(long int, 4)
355AC_CHECK_SIZEOF(long long int, 8)
356
Damien Millera22ba012000-03-02 23:09:20 +1100357# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000358AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
359 AC_TRY_COMPILE(
360 [ #include <sys/types.h> ],
361 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
362 [ ac_cv_have_intxx_t="yes" ],
363 [ ac_cv_have_intxx_t="no" ]
364 )
365])
366if test "x$ac_cv_have_intxx_t" = "xyes" ; then
367 AC_DEFINE(HAVE_INTXX_T)
368 have_intxx_t=1
369fi
370
371AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
372 AC_TRY_COMPILE(
373 [ #include <sys/types.h> ],
374 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
375 [ ac_cv_have_u_intxx_t="yes" ],
376 [ ac_cv_have_u_intxx_t="no" ]
377 )
378])
379if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
380 AC_DEFINE(HAVE_U_INTXX_T)
381 have_u_intxx_t=1
382fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100383
Damien Millerc6398ef1999-11-20 12:18:40 +1100384
Damien Millereaf99942000-01-19 13:45:07 +1100385if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
Damien Millerb29ea912000-01-15 14:12:03 +1100386 "x$ac_cv_header_sys_bitypes_h" = "xyes"
387then
388 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
389 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000390 [
391#include <sys/bitypes.h>
392 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100393 [
Damien Miller70494d12000-04-03 15:57:06 +1000394 int8_t a; int16_t b; int32_t c;
395 u_int8_t e; u_int16_t f; u_int32_t g;
396 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100397 ],
398 [
399 AC_DEFINE(HAVE_U_INTXX_T)
400 AC_DEFINE(HAVE_INTXX_T)
401 AC_MSG_RESULT(yes)
402 ],
403 [AC_MSG_RESULT(no)]
404 )
405fi
406
Damien Millerd6121d22000-03-17 23:26:46 +1100407if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000408 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
409 AC_TRY_COMPILE(
410 [
411#include <sys/types.h>
412 ],
413 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
414 [ ac_cv_have_uintxx_t="yes" ],
415 [ ac_cv_have_uintxx_t="no" ]
416 )
417 ])
418 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
419 AC_DEFINE(HAVE_UINTXX_T)
420 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100421fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100422
Damien Miller61e50f12000-05-08 20:49:37 +1000423AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
424 AC_TRY_COMPILE(
425 [
Damien Miller81171112000-04-23 11:14:01 +1000426#include <sys/types.h>
427#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000428 ],
429 [socklen_t foo; foo = 1235;],
430 [ ac_cv_have_socklen_t="yes" ],
431 [ ac_cv_have_socklen_t="no" ]
432 )
433])
434if test "x$ac_cv_have_socklen_t" = "xyes" ; then
435 AC_DEFINE(HAVE_SOCKLEN_T)
436fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100437
Damien Miller61e50f12000-05-08 20:49:37 +1000438AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
439 AC_TRY_COMPILE(
440 [
441#include <sys/types.h>
442 ],
443 [ size_t foo; foo = 1235; ],
444 [ ac_cv_have_size_t="yes" ],
445 [ ac_cv_have_size_t="no" ]
446 )
447])
448if test "x$ac_cv_have_size_t" = "xyes" ; then
449 AC_DEFINE(HAVE_SIZE_T)
450fi
Damien Miller95058511999-12-29 10:36:45 +1100451
Damien Miller615f9392000-05-17 22:53:33 +1000452AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
453 AC_TRY_COMPILE(
454 [
455#include <sys/types.h>
456 ],
457 [ ssize_t foo; foo = 1235; ],
458 [ ac_cv_have_ssize_t="yes" ],
459 [ ac_cv_have_ssize_t="no" ]
460 )
461])
462if test "x$ac_cv_have_ssize_t" = "xyes" ; then
463 AC_DEFINE(HAVE_SSIZE_T)
464fi
465
Damien Miller61e50f12000-05-08 20:49:37 +1000466
467AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
468 AC_TRY_COMPILE(
469 [
Damien Miller81171112000-04-23 11:14:01 +1000470#include <sys/types.h>
471#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000472 ],
473 [ struct sockaddr_storage s; ],
474 [ ac_cv_have_struct_sockaddr_storage="yes" ],
475 [ ac_cv_have_struct_sockaddr_storage="no" ]
476 )
477])
478if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
479 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
480fi
Damien Miller34132e52000-01-14 15:45:46 +1100481
Damien Miller61e50f12000-05-08 20:49:37 +1000482AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
483 AC_TRY_COMPILE(
484 [
485#include <netinet/in.h>
486 ],
487 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
488 [ ac_cv_have_struct_sockaddr_in6="yes" ],
489 [ ac_cv_have_struct_sockaddr_in6="no" ]
490 )
491])
492if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
493 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
494fi
Damien Miller34132e52000-01-14 15:45:46 +1100495
Damien Miller61e50f12000-05-08 20:49:37 +1000496AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
497 AC_TRY_COMPILE(
498 [
499#include <netinet/in.h>
500 ],
501 [ struct in6_addr s; s.s6_addr[0] = 0; ],
502 [ ac_cv_have_struct_in6_addr="yes" ],
503 [ ac_cv_have_struct_in6_addr="no" ]
504 )
505])
506if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
507 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
508fi
Damien Miller34132e52000-01-14 15:45:46 +1100509
Damien Miller61e50f12000-05-08 20:49:37 +1000510AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
511 AC_TRY_COMPILE(
512 [
Damien Miller81171112000-04-23 11:14:01 +1000513#include <sys/types.h>
514#include <sys/socket.h>
515#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000516 ],
517 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
518 [ ac_cv_have_struct_addrinfo="yes" ],
519 [ ac_cv_have_struct_addrinfo="no" ]
520 )
521])
522if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
523 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
524fi
525
Damien Miller34132e52000-01-14 15:45:46 +1100526
Damien Millera22ba012000-03-02 23:09:20 +1100527# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100528
Damien Miller61e50f12000-05-08 20:49:37 +1000529OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
530OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
531OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
532OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
533OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000534OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000535OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
536OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
537OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
538OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
539OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
540OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000541OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
542OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
543OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
544OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
545
Damien Miller61e50f12000-05-08 20:49:37 +1000546
547
548AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
549 ac_cv_have_ss_family_in_struct_ss, [
550 AC_TRY_COMPILE(
551 [
Damien Miller81171112000-04-23 11:14:01 +1000552#include <sys/types.h>
553#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000554 ],
555 [ struct sockaddr_storage s; s.ss_family = 1; ],
556 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
557 [ ac_cv_have_ss_family_in_struct_ss="no" ],
558 )
559])
560if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
561 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
562fi
563
564
565AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
566 ac_cv_have___ss_family_in_struct_ss, [
567 AC_TRY_COMPILE(
568 [
Damien Miller81171112000-04-23 11:14:01 +1000569#include <sys/types.h>
570#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000571 ],
572 [ struct sockaddr_storage s; s.__ss_family = 1; ],
573 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
574 [ ac_cv_have___ss_family_in_struct_ss="no" ]
575 )
576])
577if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
578 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
579fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100580
Damien Miller61e50f12000-05-08 20:49:37 +1000581
582AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
583 AC_TRY_LINK([],
584 [ extern char *__progname; printf("%s", __progname); ],
585 [ ac_cv_libc_defines___progname="yes" ],
586 [ ac_cv_libc_defines___progname="no" ]
587 )
588])
589if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
590 AC_DEFINE(HAVE___PROGNAME)
591fi
592
Damien Millera22ba012000-03-02 23:09:20 +1100593
594# Looking for programs, paths and files
595AC_ARG_WITH(rsh,
596 [ --with-rsh=PATH Specify path to remote shell program ],
597 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100598 if test "x$withval" != "$no" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100599 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
600 fi
601 ],
602 [
603 AC_PATH_PROG(rsh_path, rsh)
604 ]
605)
606
607AC_ARG_WITH(xauth,
608 [ --with-xauth=PATH Specify path to xauth program ],
609 [
610 if test "x$withval" != "$xno" ; then
611 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
612 fi
613 ],
614 [
615 AC_PATH_PROG(xauth_path, xauth)
616 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
617 xauth_path="/usr/openwin/bin/xauth"
618 fi
619 ]
620)
621
622if test ! -z "$xauth_path" ; then
623 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
624fi
625if test ! -z "$rsh_path" ; then
626 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
627fi
628
629# Check for mail directory (last resort if we cannot get it from headers)
630if test ! -z "$MAIL" ; then
631 maildir=`dirname $MAIL`
632 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
633fi
634
Damien Millera22ba012000-03-02 23:09:20 +1100635if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100636 AC_CHECK_FILE("/dev/ptmx",
637 [
638 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
639 have_dev_ptmx=1
640 ]
641 )
Damien Millera22ba012000-03-02 23:09:20 +1100642fi
Damien Miller204ad072000-03-02 23:56:12 +1100643AC_CHECK_FILE("/dev/ptc",
644 [
645 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
646 have_dev_ptc=1
647 ]
648)
649
Damien Millera22ba012000-03-02 23:09:20 +1100650# Options from here on. Some of these are preset by platform above
651
Damien Millera22ba012000-03-02 23:09:20 +1100652# Check for user-specified random device, otherwise check /dev/urandom
653AC_ARG_WITH(random,
654 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
655 [
Damien Miller040f3832000-04-03 14:50:43 +1000656 if test "x$withval" != "xno" ; then
657 RANDOM_POOL="$withval";
658 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
659 fi
Damien Millera22ba012000-03-02 23:09:20 +1100660 ],
661 [
662 # Check for random device
663 AC_CHECK_FILE("/dev/urandom",
664 [
665 RANDOM_POOL="/dev/urandom";
666 AC_SUBST(RANDOM_POOL)
667 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
668 ]
669 )
670 ]
671)
672
673# Check for EGD pool file
674AC_ARG_WITH(egd-pool,
675 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
676 [
Damien Miller040f3832000-04-03 14:50:43 +1000677 if test "x$withval" != "xno" ; then
678 EGD_SOCKET="$withval";
679 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
680 fi
Damien Millera22ba012000-03-02 23:09:20 +1100681 ]
682)
683
Damien Miller0437b332000-05-02 09:56:41 +1000684# detect pathnames for entropy gathering commands, if we need them
685INSTALL_SSH_PRNG_CMDS=""
686rm -f prng_commands
Damien Miller11e37f62000-04-08 18:23:30 +1000687if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
688 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000689 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
690 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
691 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
692 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
693 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
694 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
695 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
696 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
697 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
698 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
699 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
700 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
701 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
702 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
703 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000704
705 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000706fi
Damien Miller0437b332000-05-02 09:56:41 +1000707AC_SUBST(INSTALL_SSH_PRNG_CMDS)
708
Damien Miller11e37f62000-04-08 18:23:30 +1000709
Damien Miller670a4b82000-01-22 13:53:11 +1100710AC_ARG_WITH(catman,
711 [ --with-catman=man|cat Install preformatted manpages[no]],
712 [
713 MANTYPE='$(CATMAN)'
714 if test x"$withval" != x"yes" ; then
715 mansubdir=$withval
716 else
717 mansubdir=cat
718 fi
719 ], [
720 if test -z "$MANTYPE" ; then
721 MANTYPE='$(TROFFMAN)'
722 mansubdir=man
723 fi
724 ]
725)
726AC_SUBST(MANTYPE)
727AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100728
Damien Millera22ba012000-03-02 23:09:20 +1100729# Check whether user wants Kerberos support
Damien Miller80297751999-11-19 13:03:25 +1100730AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100731 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100732 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100733 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100734
735 if test "x$withval" != "$xyes" ; then
736 CFLAGS="$CFLAGS -I${withval}/include"
737 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100738 if test ! -z "$need_dash_r" ; then
739 LDFLAGS="$LDFLAGS -R${withval}/lib"
740 fi
741 if test ! -z "$blibpath" ; then
742 blibpath="$blibpath:${withval}/lib"
743 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100744 else
745 if test -d /usr/include/kerberosIV ; then
746 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
747 fi
748 fi
749
750 AC_CHECK_HEADERS(krb.h)
751 AC_CHECK_LIB(krb, main)
752 if test "$ac_cv_header_krb_h" != yes; then
753 AC_MSG_WARN([Cannot find krb.h, build may fail])
754 fi
755 if test "$ac_cv_lib_krb_main" != yes; then
756 AC_MSG_WARN([Cannot find libkrb, build may fail])
757 fi
758
Damien Millerc85f9b42000-01-29 10:20:21 +1100759 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100760 AC_CHECK_LIB(resolv, dn_expand, , )
761 KRB4=yes
Damien Miller8bdeee21999-12-30 15:50:54 +1100762 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100763 fi
Damien Miller80297751999-11-19 13:03:25 +1100764 ]
765)
766
Damien Millera22ba012000-03-02 23:09:20 +1100767# Check whether user wants AFS support
Damien Millerc6398ef1999-11-20 12:18:40 +1100768AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100769 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100770 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100771 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100772
773 if test "x$withval" != "$xyes" ; then
774 CFLAGS="$CFLAGS -I${withval}/include"
775 LFLAGS="$LFLAGS -L${withval}/lib"
776 fi
777
778 if test -z "$KRB4" ; then
779 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
780 fi
781
Damien Miller8bdeee21999-12-30 15:50:54 +1100782 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100783 if test ! -z "$AFS_LIBS" ; then
784 LIBS="$LIBS $AFS_LIBS"
785 fi
786 AC_DEFINE(AFS)
Damien Miller8bdeee21999-12-30 15:50:54 +1100787 fi
Damien Miller80297751999-11-19 13:03:25 +1100788 ]
789)
Damien Millerc85f9b42000-01-29 10:20:21 +1100790LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100791
Damien Millera22ba012000-03-02 23:09:20 +1100792# Check whether user wants S/Key support
Damien Miller80297751999-11-19 13:03:25 +1100793AC_ARG_WITH(skey,
794 [ --with-skey Enable S/Key support],
795 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100796 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100797 AC_DEFINE(SKEY)
798 LIBS="$LIBS -lskey"
799 fi
Damien Miller80297751999-11-19 13:03:25 +1100800 ]
801)
802
Damien Millera22ba012000-03-02 23:09:20 +1100803# Check whether user wants TCP wrappers support
Damien Millerf7c0f821999-11-22 22:31:49 +1100804AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100805 [ --with-tcp-wrappers Enable tcpwrappers support],
806 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100807 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100808 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100809 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100810 AC_MSG_CHECKING(for libwrap)
811 AC_TRY_LINK(
812 [
Damien Miller81171112000-04-23 11:14:01 +1000813#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100814 int deny_severity = 0, allow_severity = 0;
815 ],
816 [hosts_access(0);],
817 [
818 AC_MSG_RESULT(yes)
819 AC_DEFINE(LIBWRAP)
820 ],
821 [
822 AC_MSG_RESULT(no)
823 AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
824 LIBS="$saved_LIBS"
825 ]
826 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100827 fi
Damien Miller80297751999-11-19 13:03:25 +1100828 ]
829)
830
Damien Millera22ba012000-03-02 23:09:20 +1100831# Check whether to enable MD5 passwords
Damien Millerf7c0f821999-11-22 22:31:49 +1100832AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100833 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100834 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100835 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100836 AC_DEFINE(HAVE_MD5_PASSWORDS)
837 fi
838 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100839)
840
Damien Millera22ba012000-03-02 23:09:20 +1100841# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +1100842AC_ARG_WITH(shadow,
843 [ --without-shadow Disable shadow password support],
844 [
845 if test "x$withval" = "xno" ; then
846 AC_DEFINE(DISABLE_SHADOW)
847 fi
848 ]
849)
850
Damien Millera22ba012000-03-02 23:09:20 +1100851# Use ip address instead of hostname in $DISPLAY
Damien Miller76112de1999-12-21 11:18:08 +1100852AC_ARG_WITH(ipaddr-display,
853 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
854 [
Damien Miller66409952000-01-17 21:40:06 +1100855 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +1100856 AC_DEFINE(IPADDR_IN_DISPLAY)
857 fi
858 ]
859)
860
Damien Millera22ba012000-03-02 23:09:20 +1100861# Whether to mess with the default path
Damien Millere7f626c1999-12-31 09:49:44 +1100862AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +1100863 [ --with-default-path=PATH Specify default \$PATH environment for server],
864 [
865 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +1100866 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller5a3e6831999-12-27 09:48:56 +1100867 fi
868 ]
869)
870
Damien Millera22ba012000-03-02 23:09:20 +1100871# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7d80e342000-01-19 14:36:49 +1100872AC_ARG_WITH(ipv4-default,
873 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
874 [
875 if test "x$withval" != "xno" ; then
876 AC_DEFINE(IPV4_DEFAULT)
877 fi
878 ]
879)
880
Damien Miller61e50f12000-05-08 20:49:37 +1000881AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7bcb0892000-03-11 20:45:40 +1100882AC_ARG_WITH(4in6,
883 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
884 [
885 if test "x$withval" != "xno" ; then
886 AC_MSG_RESULT(yes)
887 AC_DEFINE(IPV4_IN_IPV6)
888 else
889 AC_MSG_RESULT(no)
890 fi
891 ],[
892 if test "x$inet6_default_4in6" = "xyes"; then
893 AC_MSG_RESULT([yes (default)])
894 AC_DEFINE(IPV4_IN_IPV6)
895 else
896 AC_MSG_RESULT([no (default)])
897 fi
898 ]
899)
900
Damien Millera22ba012000-03-02 23:09:20 +1100901# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +1100902piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +1100903AC_ARG_WITH(pid-dir,
904 [ --with-pid-dir=PATH Specify location of ssh.pid file],
905 [
906 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +1100907 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +1100908 fi
909 ]
910)
Damien Miller4018c192000-04-30 09:30:44 +1000911
Damien Millerdbd250f2000-01-18 08:57:14 +1100912AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +1100913AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +1100914
andre2ff7b5d2000-06-03 14:57:40 +0000915dnl allow user to disable some login recording features
916AC_ARG_ENABLE(lastlog,
917 [ --disable-lastlog disable use of lastlog even if detected [no]],
918 [ AC_DEFINE(DISABLE_LASTLOG) ]
919)
920AC_ARG_ENABLE(utmp,
921 [ --disable-utmp disable use of utmp even if detected [no]],
922 [ AC_DEFINE(DISABLE_UTMP) ]
923)
924AC_ARG_ENABLE(utmpx,
925 [ --disable-utmpx disable use of utmpx even if detected [no]],
926 [ AC_DEFINE(DISABLE_UTMPX) ]
927)
928AC_ARG_ENABLE(wtmp,
929 [ --disable-wtmp disable use of wtmp even if detected [no]],
930 [ AC_DEFINE(DISABLE_WTMP) ]
931)
932AC_ARG_ENABLE(wtmpx,
933 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
934 [ AC_DEFINE(DISABLE_WTMPX) ]
935)
936AC_ARG_ENABLE(libutil,
937 [ --disable-libutil disable use of libutil (login() etc.) [no]],
938 [ AC_DEFINE(DISABLE_LOGIN) ]
939)
940AC_ARG_ENABLE(pututline,
941 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
942 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
943)
944AC_ARG_ENABLE(pututxline,
945 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
946 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
947)
948AC_ARG_WITH(lastlog,
949 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
950 [ conf_lastlog_location="$withval"; ],)
951
952dnl lastlog, [uw]tmpx? detection
953dnl NOTE: set the paths in the platform section to avoid the
954dnl need for command-line parameters
955dnl lastlog and [uw]tmp are subject to a file search if all else fails
956
957dnl lastlog detection
958dnl NOTE: the code itself will detect if lastlog is a directory
959AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
960AC_TRY_COMPILE([
961#include <sys/types.h>
962#include <utmp.h>
963#ifdef HAVE_LASTLOG_H
964# include <lastlog.h>
965#endif
Damien Miller2994e082000-06-04 15:51:47 +1000966#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +0000967# include <paths.h>
968#endif
969 ],
970 [ char *lastlog = LASTLOG_FILE; ],
971 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +1000972 [
973 AC_MSG_RESULT(no)
974 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
975 AC_TRY_COMPILE([
976#include <sys/types.h>
977#include <utmp.h>
978#ifdef HAVE_LASTLOG_H
979# include <lastlog.h>
980#endif
981#ifdef HAVE_PATHS_H
982# include <paths.h>
983#endif
984 ],
985 [ char *lastlog = _PATH_LASTLOG; ],
986 [ AC_MSG_RESULT(yes) ],
987 [
988 AC_MSG_RESULT(no),
989 system_lastlog_path=no
990 ])
991 ]
andre2ff7b5d2000-06-03 14:57:40 +0000992)
Damien Miller2994e082000-06-04 15:51:47 +1000993
andre2ff7b5d2000-06-03 14:57:40 +0000994if test -z "$conf_lastlog_location"; then
995 if test x"$system_lastlog_path" = x"no" ; then
996 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Miller2994e082000-06-04 15:51:47 +1000997 if test -d "$f" -o -e "$f" ; then
andre2ff7b5d2000-06-03 14:57:40 +0000998 conf_lastlog_location=$f
999 fi
1000 done
1001 if test -z "$conf_lastlog_location"; then
1002 AC_MSG_WARN([** Cannot find lastlog - disabling feature **])
1003 AC_DEFINE(DISABLE_LASTLOG)
1004 fi
1005 fi
1006fi
1007
1008if test -n "$conf_lastlog_location"; then
1009 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1010fi
1011
1012dnl utmp detection
1013AC_MSG_CHECKING([if your system defines UTMP_FILE])
1014AC_TRY_COMPILE([
1015#include <sys/types.h>
1016#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001017#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001018# include <paths.h>
1019#endif
1020 ],
1021 [ char *utmp = UTMP_FILE; ],
1022 [ AC_MSG_RESULT(yes) ],
1023 [ AC_MSG_RESULT(no)
1024 system_utmp_path=no ]
1025)
1026if test -z "$conf_utmp_location"; then
1027 if test x"$system_utmp_path" = x"no" ; then
1028 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1029 if test -f $f ; then
1030 conf_utmp_location=$f
1031 fi
1032 done
1033 if test -z "$conf_utmp_location"; then
1034 AC_DEFINE(DISABLE_UTMP)
1035 fi
1036 fi
1037fi
1038if test -n "$conf_utmp_location"; then
1039 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1040fi
1041
1042dnl wtmp detection
1043AC_MSG_CHECKING([if your system defines WTMP_FILE])
1044AC_TRY_COMPILE([
1045#include <sys/types.h>
1046#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001047#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001048# include <paths.h>
1049#endif
1050 ],
1051 [ char *wtmp = WTMP_FILE; ],
1052 [ AC_MSG_RESULT(yes) ],
1053 [ AC_MSG_RESULT(no)
1054 system_wtmp_path=no ]
1055)
1056if test -z "$conf_wtmp_location"; then
1057 if test x"$system_wtmp_path" = x"no" ; then
1058 for f in /usr/adm/wtmp /var/log/wtmp; do
1059 if test -f $f ; then
1060 conf_wtmp_location=$f
1061 fi
1062 done
1063 if test -z "$conf_wtmp_location"; then
1064 AC_DEFINE(DISABLE_WTMP)
1065 fi
1066 fi
1067fi
1068if test -n "$conf_wtmp_location"; then
1069 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1070fi
1071
1072
1073dnl utmpx detection - I don't know any system so perverse as to require
1074dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1075dnl there, though.
1076AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1077AC_TRY_COMPILE([
1078#include <sys/types.h>
1079#include <utmp.h>
1080#ifdef HAVE_UTMPX_H
1081#include <utmpx.h>
1082#endif
Damien Miller2994e082000-06-04 15:51:47 +10001083#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001084# include <paths.h>
1085#endif
1086 ],
1087 [ char *utmpx = UTMPX_FILE; ],
1088 [ AC_MSG_RESULT(yes) ],
1089 [ AC_MSG_RESULT(no)
1090 system_utmpx_path=no ]
1091)
1092if test -z "$conf_utmpx_location"; then
1093 if test x"$system_utmpx_path" = x"no" ; then
1094 AC_DEFINE(DISABLE_UTMPX)
1095 fi
1096else
1097 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1098fi
1099
1100dnl wtmpx detection
1101AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1102AC_TRY_COMPILE([
1103#include <sys/types.h>
1104#include <utmp.h>
1105#ifdef HAVE_UTMPX_H
1106#include <utmpx.h>
1107#endif
Damien Miller2994e082000-06-04 15:51:47 +10001108#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001109# include <paths.h>
1110#endif
1111 ],
1112 [ char *wtmpx = WTMPX_FILE; ],
1113 [ AC_MSG_RESULT(yes) ],
1114 [ AC_MSG_RESULT(no)
1115 system_wtmpx_path=no ]
1116)
1117if test -z "$conf_wtmpx_location"; then
1118 if test x"$system_wtmpx_path" = x"no" ; then
1119 AC_DEFINE(DISABLE_WTMPX)
1120 fi
1121else
1122 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1123fi
1124
Damien Miller4018c192000-04-30 09:30:44 +10001125
1126# Change default command timeout for builtin PRNG
1127entropy_timeout=100
1128AC_ARG_WITH(entropy-timeout,
1129 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1130 [
1131 if test "x$withval" != "xno" ; then
1132 entropy_timeout=$withval
1133 fi
1134 ]
1135)
1136AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1137
1138
Damien Miller29ea30d2000-03-17 10:54:15 +11001139if test ! -z "$blibpath" ; then
1140 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1141 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1142fi
1143
Damien Miller0437b332000-05-02 09:56:41 +10001144AC_OUTPUT(Makefile ssh_prng_cmds)
1145
1146