blob: 8bb647c1257887dcdf86a1a58e6c678ee0674f5d [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)
Damien Miller75b1d102000-01-07 14:01:41 +110039 ;;
Damien Miller76112de1999-12-21 11:18:08 +110040*-*-hpux10*)
41 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100042 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110043 fi
44 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
45 AC_DEFINE(IPADDR_IN_DISPLAY)
46 AC_MSG_CHECKING(for HPUX trusted system password database)
47 if test -f /tcb/files/auth/system/default; then
48 AC_MSG_RESULT(yes)
49 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
50 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110051 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110052 else
53 AC_MSG_RESULT(no)
54 AC_DEFINE(DISABLE_SHADOW)
55 fi
Damien Miller670a4b82000-01-22 13:53:11 +110056 MANTYPE='$(CATMAN)'
57 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110058 ;;
Damien Miller1bead332000-04-30 00:47:29 +100059*-*-hpux11*)
60 if test -z "$GCC"; then
61 CFLAGS="$CFLAGS -Ae"
62 fi
63 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100064 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100065 AC_MSG_CHECKING(for HPUX trusted system password database)
66 if test -f /tcb/files/auth/system/default; then
67 AC_MSG_RESULT(yes)
68 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
69 LIBS="$LIBS -lsec"
70 AC_MSG_WARN([This configuration is untested])
71 else
72 AC_MSG_RESULT(no)
73 AC_DEFINE(DISABLE_SHADOW)
74 fi
75 MANTYPE='$(CATMAN)'
76 mansubdir=cat
77 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110078*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110079 CFLAGS="$CFLAGS -I/usr/local/include"
80 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller07278932000-01-22 14:05:37 +110081 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110082 no_libsocket=1
83 no_libnsl=1
84 ;;
85*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110086 CFLAGS="$CFLAGS -I/usr/local/include"
87 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller07278932000-01-22 14:05:37 +110088 MANTYPE='$(CATMAN)'
89 AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
Damien Millerbeb4ba51999-12-28 15:09:35 +110090 no_libsocket=1
91 no_libnsl=1
92 ;;
Damien Millerb29ea912000-01-15 14:12:03 +110093*-*-linux*)
94 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +110095 AC_DEFINE(DONT_TRY_OTHER_AF)
96 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +110097 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +110098*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +110099 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100100 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100101*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100102 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100103 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100104 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000105 # hardwire lastlog location (can't detect it on some versions)
106 conf_lastlog_location="/var/adm/lastlog"
Damien Miller75b1d102000-01-07 14:01:41 +1100107 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000108*-*-sunos4*)
109 CFLAGS="$CFLAGS -DSUNOS4"
110 AC_CHECK_FUNCS(getpwanam)
111 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100112*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100113 CFLAGS="$CFLAGS -I/usr/local/include"
114 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100115 MANTYPE='$(CATMAN)'
116 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100117 LIBS="$LIBS -lgen -lsocket"
118 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100119esac
120
Damien Millera22ba012000-03-02 23:09:20 +1100121# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100122AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
123AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100124
Damien Millerbeb4ba51999-12-28 15:09:35 +1100125if test -z "$no_libsocket" ; then
126 AC_CHECK_LIB(nsl, yp_match, , )
127fi
128if test -z "$no_libnsl" ; then
129 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100130fi
Damien Millerab18c411999-11-11 10:40:23 +1100131
Damien Millera22ba012000-03-02 23:09:20 +1100132# Checks for header files.
andre2ff7b5d2000-06-03 14:57:40 +0000133AC_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 +1100134
Damien Millera22ba012000-03-02 23:09:20 +1100135# Checks for library functions.
andre2ff7b5d2000-06-03 14:57:40 +0000136AC_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)
137dnl checks for time functions
138AC_CHECK_FUNCS(gettimeofday time)
139dnl checks for libutil functions
140AC_CHECK_FUNCS(login logout updwtmp logwtmp)
141dnl checks for utmp functions
142AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
143AC_CHECK_FUNCS(utmpname)
144dnl checks for utmpx functions
145AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
146AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100147
Damien Miller04f80141999-11-19 15:32:34 +1100148AC_CHECK_FUNC(login,
149 [AC_DEFINE(HAVE_LOGIN)],
150 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
151)
152
153AC_CHECK_FUNC(daemon,
154 [AC_DEFINE(HAVE_DAEMON)],
155 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
156)
157
Damien Miller9fb07e42000-03-05 16:22:59 +1100158AC_CHECK_FUNC(getpagesize,
159 [AC_DEFINE(HAVE_GETPAGESIZE)],
160 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
161)
162
Damien Millera22ba012000-03-02 23:09:20 +1100163AC_ARG_WITH(pam,
164 [ --without-pam Disable PAM support ],
165 [
166 if test "x$withval" = "xno" ; then
167 no_pam=1
168 AC_DEFINE(DISABLE_PAM)
169 fi
170 ]
171)
172if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
173 AC_CHECK_LIB(dl, dlopen, , )
174 LIBS="$LIBS -lpam"
175
Damien Miller0e65eed2000-05-17 22:16:05 +1000176 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000177
Damien Millera22ba012000-03-02 23:09:20 +1100178 # Check PAM strerror arguments (old PAM)
179 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
180 AC_TRY_COMPILE(
181 [
Damien Miller81171112000-04-23 11:14:01 +1000182#include <stdlib.h>
183#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100184 ],
185 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
186 [AC_MSG_RESULT(no)],
187 [
188 AC_DEFINE(HAVE_OLD_PAM)
189 AC_MSG_RESULT(yes)
190 ]
191 )
192fi
193
194# The big search for OpenSSL
195AC_ARG_WITH(ssl-dir,
196 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
197 [
198 if test "x$withval" != "$xno" ; then
199 tryssldir=$withval
200 fi
201 ]
202)
203
204saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100205saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100206saved_CFLAGS="$CFLAGS"
207if test "x$prefix" != "xNONE" ; then
208 tryssldir="$tryssldir $prefix"
209fi
Damien Miller61e50f12000-05-08 20:49:37 +1000210AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100211
Damien Miller61e50f12000-05-08 20:49:37 +1000212 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
213 if test ! -z "$ssldir" ; then
214 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
215 CFLAGS="$saved_CFLAGS -I$ssldir/include"
216 if test ! -z "$need_dash_r" ; then
217 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
218 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100219 else
Damien Miller61e50f12000-05-08 20:49:37 +1000220 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100221 fi
222
Damien Miller3b512e12000-05-17 23:29:18 +1000223 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000224
Damien Miller3b512e12000-05-17 23:29:18 +1000225 # Basic test to check for compatible version and correct linking
226 # *does not* test for RSA - that comes later.
227 AC_TRY_RUN(
228 [
Damien Millere59ce622000-05-01 20:54:17 +1000229#include <string.h>
230#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000231int main(void)
232{
Damien Miller3b512e12000-05-17 23:29:18 +1000233 char a[2048];
234 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000235 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000236 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000237}
Damien Miller3b512e12000-05-17 23:29:18 +1000238 ],
239 [
240 found_crypto=1
241 break;
242 ], []
243 )
Damien Miller61e50f12000-05-08 20:49:37 +1000244
245 if test ! -z "$found_crypto" ; then
246 break;
247 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100248 done
249
Damien Miller61e50f12000-05-08 20:49:37 +1000250 if test -z "$found_crypto" ; then
251 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100252 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000253 if test -z "$ssldir" ; then
254 ssldir="(system)"
255 fi
Damien Millera22ba012000-03-02 23:09:20 +1100256
Damien Miller61e50f12000-05-08 20:49:37 +1000257 ac_cv_openssldir=$ssldir
258])
259
260if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
261 AC_DEFINE(HAVE_OPENSSL)
262 dnl Need to recover ssldir - test above runs in subshell
263 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100264 CFLAGS="$saved_CFLAGS -I$ssldir/include"
265 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
266 if test ! -z "$need_dash_r" ; then
267 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100268 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100269 if test ! -z "$blibpath" ; then
270 blibpath="$blibpath:$ssldir:$ssldir/lib"
271 fi
Damien Millera22ba012000-03-02 23:09:20 +1100272fi
Damien Miller3b512e12000-05-17 23:29:18 +1000273LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000274
Damien Miller3b512e12000-05-17 23:29:18 +1000275# Now test RSA support
276saved_LIBS="$LIBS"
277AC_MSG_CHECKING([for RSA support])
278for WANTS_RSAREF in "" 1 ; do
279 if test -z "$WANTS_RSAREF" ; then
280 LIBS="$saved_LIBS"
281 else
282 LIBS="$saved_LIBS -lRSAglue -lrsaref"
283 fi
284 AC_TRY_RUN([
285#include <string.h>
286#include <openssl/rand.h>
287#include <openssl/rsa.h>
288#include <openssl/bn.h>
289#include <openssl/sha.h>
290int main(void)
291{
292 int num; RSA *key; static unsigned char p_in[] = "blahblah";
293 unsigned char c[256], p[256];
294 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
295 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
296 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
297 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
298}
299 ],
300 [
301 rsa_works=1
302 break;
303 ], [])
304done
305
306if test ! -z "$no_rsa" ; then
307 AC_MSG_RESULT(disabled)
308else
309 if test -z "$rsa_works" ; then
310 AC_MSG_WARN([*** No RSA support found *** ])
311 else
312 if test -z "$WANTS_RSAREF" ; then
313 AC_MSG_RESULT(yes)
314 else
315 AC_MSG_RESULT(using RSAref)
316 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
317 fi
318 fi
319fi
Damien Millera22ba012000-03-02 23:09:20 +1100320
321# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100322AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100323AC_CHECK_SIZEOF(short int, 2)
324AC_CHECK_SIZEOF(int, 4)
325AC_CHECK_SIZEOF(long int, 4)
326AC_CHECK_SIZEOF(long long int, 8)
327
Damien Millera22ba012000-03-02 23:09:20 +1100328# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000329AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
330 AC_TRY_COMPILE(
331 [ #include <sys/types.h> ],
332 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
333 [ ac_cv_have_intxx_t="yes" ],
334 [ ac_cv_have_intxx_t="no" ]
335 )
336])
337if test "x$ac_cv_have_intxx_t" = "xyes" ; then
338 AC_DEFINE(HAVE_INTXX_T)
339 have_intxx_t=1
340fi
341
342AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
343 AC_TRY_COMPILE(
344 [ #include <sys/types.h> ],
345 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
346 [ ac_cv_have_u_intxx_t="yes" ],
347 [ ac_cv_have_u_intxx_t="no" ]
348 )
349])
350if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
351 AC_DEFINE(HAVE_U_INTXX_T)
352 have_u_intxx_t=1
353fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100354
Damien Millerc6398ef1999-11-20 12:18:40 +1100355
Damien Millereaf99942000-01-19 13:45:07 +1100356if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
Damien Millerb29ea912000-01-15 14:12:03 +1100357 "x$ac_cv_header_sys_bitypes_h" = "xyes"
358then
359 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
360 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000361 [
362#include <sys/bitypes.h>
363 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100364 [
Damien Miller70494d12000-04-03 15:57:06 +1000365 int8_t a; int16_t b; int32_t c;
366 u_int8_t e; u_int16_t f; u_int32_t g;
367 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100368 ],
369 [
370 AC_DEFINE(HAVE_U_INTXX_T)
371 AC_DEFINE(HAVE_INTXX_T)
372 AC_MSG_RESULT(yes)
373 ],
374 [AC_MSG_RESULT(no)]
375 )
376fi
377
Damien Millerd6121d22000-03-17 23:26:46 +1100378if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000379 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
380 AC_TRY_COMPILE(
381 [
382#include <sys/types.h>
383 ],
384 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
385 [ ac_cv_have_uintxx_t="yes" ],
386 [ ac_cv_have_uintxx_t="no" ]
387 )
388 ])
389 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
390 AC_DEFINE(HAVE_UINTXX_T)
391 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100392fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100393
Damien Miller61e50f12000-05-08 20:49:37 +1000394AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
395 AC_TRY_COMPILE(
396 [
Damien Miller81171112000-04-23 11:14:01 +1000397#include <sys/types.h>
398#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000399 ],
400 [socklen_t foo; foo = 1235;],
401 [ ac_cv_have_socklen_t="yes" ],
402 [ ac_cv_have_socklen_t="no" ]
403 )
404])
405if test "x$ac_cv_have_socklen_t" = "xyes" ; then
406 AC_DEFINE(HAVE_SOCKLEN_T)
407fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100408
Damien Miller61e50f12000-05-08 20:49:37 +1000409AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
410 AC_TRY_COMPILE(
411 [
412#include <sys/types.h>
413 ],
414 [ size_t foo; foo = 1235; ],
415 [ ac_cv_have_size_t="yes" ],
416 [ ac_cv_have_size_t="no" ]
417 )
418])
419if test "x$ac_cv_have_size_t" = "xyes" ; then
420 AC_DEFINE(HAVE_SIZE_T)
421fi
Damien Miller95058511999-12-29 10:36:45 +1100422
Damien Miller615f9392000-05-17 22:53:33 +1000423AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
424 AC_TRY_COMPILE(
425 [
426#include <sys/types.h>
427 ],
428 [ ssize_t foo; foo = 1235; ],
429 [ ac_cv_have_ssize_t="yes" ],
430 [ ac_cv_have_ssize_t="no" ]
431 )
432])
433if test "x$ac_cv_have_ssize_t" = "xyes" ; then
434 AC_DEFINE(HAVE_SSIZE_T)
435fi
436
Damien Miller61e50f12000-05-08 20:49:37 +1000437
438AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
439 AC_TRY_COMPILE(
440 [
Damien Miller81171112000-04-23 11:14:01 +1000441#include <sys/types.h>
442#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000443 ],
444 [ struct sockaddr_storage s; ],
445 [ ac_cv_have_struct_sockaddr_storage="yes" ],
446 [ ac_cv_have_struct_sockaddr_storage="no" ]
447 )
448])
449if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
450 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
451fi
Damien Miller34132e52000-01-14 15:45:46 +1100452
Damien Miller61e50f12000-05-08 20:49:37 +1000453AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
454 AC_TRY_COMPILE(
455 [
456#include <netinet/in.h>
457 ],
458 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
459 [ ac_cv_have_struct_sockaddr_in6="yes" ],
460 [ ac_cv_have_struct_sockaddr_in6="no" ]
461 )
462])
463if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
464 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
465fi
Damien Miller34132e52000-01-14 15:45:46 +1100466
Damien Miller61e50f12000-05-08 20:49:37 +1000467AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
468 AC_TRY_COMPILE(
469 [
470#include <netinet/in.h>
471 ],
472 [ struct in6_addr s; s.s6_addr[0] = 0; ],
473 [ ac_cv_have_struct_in6_addr="yes" ],
474 [ ac_cv_have_struct_in6_addr="no" ]
475 )
476])
477if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
478 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
479fi
Damien Miller34132e52000-01-14 15:45:46 +1100480
Damien Miller61e50f12000-05-08 20:49:37 +1000481AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
482 AC_TRY_COMPILE(
483 [
Damien Miller81171112000-04-23 11:14:01 +1000484#include <sys/types.h>
485#include <sys/socket.h>
486#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000487 ],
488 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
489 [ ac_cv_have_struct_addrinfo="yes" ],
490 [ ac_cv_have_struct_addrinfo="no" ]
491 )
492])
493if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
494 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
495fi
496
Damien Miller34132e52000-01-14 15:45:46 +1100497
Damien Millera22ba012000-03-02 23:09:20 +1100498# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100499
Damien Miller61e50f12000-05-08 20:49:37 +1000500OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
501OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
502OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
503OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
504OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000505OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000506OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
507OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
508OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
509OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
510OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
511OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000512OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
513OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
514OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
515OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
516
Damien Miller61e50f12000-05-08 20:49:37 +1000517
518
519AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
520 ac_cv_have_ss_family_in_struct_ss, [
521 AC_TRY_COMPILE(
522 [
Damien Miller81171112000-04-23 11:14:01 +1000523#include <sys/types.h>
524#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000525 ],
526 [ struct sockaddr_storage s; s.ss_family = 1; ],
527 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
528 [ ac_cv_have_ss_family_in_struct_ss="no" ],
529 )
530])
531if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
532 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
533fi
534
535
536AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
537 ac_cv_have___ss_family_in_struct_ss, [
538 AC_TRY_COMPILE(
539 [
Damien Miller81171112000-04-23 11:14:01 +1000540#include <sys/types.h>
541#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000542 ],
543 [ struct sockaddr_storage s; s.__ss_family = 1; ],
544 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
545 [ ac_cv_have___ss_family_in_struct_ss="no" ]
546 )
547])
548if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
549 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
550fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100551
Damien Miller61e50f12000-05-08 20:49:37 +1000552
553AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
554 AC_TRY_LINK([],
555 [ extern char *__progname; printf("%s", __progname); ],
556 [ ac_cv_libc_defines___progname="yes" ],
557 [ ac_cv_libc_defines___progname="no" ]
558 )
559])
560if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
561 AC_DEFINE(HAVE___PROGNAME)
562fi
563
Damien Millera22ba012000-03-02 23:09:20 +1100564
565# Looking for programs, paths and files
566AC_ARG_WITH(rsh,
567 [ --with-rsh=PATH Specify path to remote shell program ],
568 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100569 if test "x$withval" != "$no" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100570 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
571 fi
572 ],
573 [
574 AC_PATH_PROG(rsh_path, rsh)
575 ]
576)
577
578AC_ARG_WITH(xauth,
579 [ --with-xauth=PATH Specify path to xauth program ],
580 [
581 if test "x$withval" != "$xno" ; then
582 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval")
583 fi
584 ],
585 [
586 AC_PATH_PROG(xauth_path, xauth)
587 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
588 xauth_path="/usr/openwin/bin/xauth"
589 fi
590 ]
591)
592
593if test ! -z "$xauth_path" ; then
594 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
595fi
596if test ! -z "$rsh_path" ; then
597 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
598fi
599
600# Check for mail directory (last resort if we cannot get it from headers)
601if test ! -z "$MAIL" ; then
602 maildir=`dirname $MAIL`
603 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
604fi
605
Damien Millera22ba012000-03-02 23:09:20 +1100606if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100607 AC_CHECK_FILE("/dev/ptmx",
608 [
609 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
610 have_dev_ptmx=1
611 ]
612 )
Damien Millera22ba012000-03-02 23:09:20 +1100613fi
Damien Miller204ad072000-03-02 23:56:12 +1100614AC_CHECK_FILE("/dev/ptc",
615 [
616 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
617 have_dev_ptc=1
618 ]
619)
620
Damien Millera22ba012000-03-02 23:09:20 +1100621# Options from here on. Some of these are preset by platform above
622
Damien Millera22ba012000-03-02 23:09:20 +1100623# Check for user-specified random device, otherwise check /dev/urandom
624AC_ARG_WITH(random,
625 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
626 [
Damien Miller040f3832000-04-03 14:50:43 +1000627 if test "x$withval" != "xno" ; then
628 RANDOM_POOL="$withval";
629 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
630 fi
Damien Millera22ba012000-03-02 23:09:20 +1100631 ],
632 [
633 # Check for random device
634 AC_CHECK_FILE("/dev/urandom",
635 [
636 RANDOM_POOL="/dev/urandom";
637 AC_SUBST(RANDOM_POOL)
638 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
639 ]
640 )
641 ]
642)
643
644# Check for EGD pool file
645AC_ARG_WITH(egd-pool,
646 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
647 [
Damien Miller040f3832000-04-03 14:50:43 +1000648 if test "x$withval" != "xno" ; then
649 EGD_SOCKET="$withval";
650 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
651 fi
Damien Millera22ba012000-03-02 23:09:20 +1100652 ]
653)
654
Damien Miller0437b332000-05-02 09:56:41 +1000655# detect pathnames for entropy gathering commands, if we need them
656INSTALL_SSH_PRNG_CMDS=""
657rm -f prng_commands
Damien Miller11e37f62000-04-08 18:23:30 +1000658if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
659 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000660 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
661 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
662 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
663 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
664 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
665 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
666 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
667 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
668 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
669 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
670 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
671 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
672 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
673 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
674 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000675
676 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000677fi
Damien Miller0437b332000-05-02 09:56:41 +1000678AC_SUBST(INSTALL_SSH_PRNG_CMDS)
679
Damien Miller11e37f62000-04-08 18:23:30 +1000680
Damien Miller670a4b82000-01-22 13:53:11 +1100681AC_ARG_WITH(catman,
682 [ --with-catman=man|cat Install preformatted manpages[no]],
683 [
684 MANTYPE='$(CATMAN)'
685 if test x"$withval" != x"yes" ; then
686 mansubdir=$withval
687 else
688 mansubdir=cat
689 fi
690 ], [
691 if test -z "$MANTYPE" ; then
692 MANTYPE='$(TROFFMAN)'
693 mansubdir=man
694 fi
695 ]
696)
697AC_SUBST(MANTYPE)
698AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100699
Damien Millera22ba012000-03-02 23:09:20 +1100700# Check whether user wants Kerberos support
Damien Miller80297751999-11-19 13:03:25 +1100701AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100702 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100703 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100704 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100705
706 if test "x$withval" != "$xyes" ; then
707 CFLAGS="$CFLAGS -I${withval}/include"
708 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100709 if test ! -z "$need_dash_r" ; then
710 LDFLAGS="$LDFLAGS -R${withval}/lib"
711 fi
712 if test ! -z "$blibpath" ; then
713 blibpath="$blibpath:${withval}/lib"
714 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100715 else
716 if test -d /usr/include/kerberosIV ; then
717 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
718 fi
719 fi
720
721 AC_CHECK_HEADERS(krb.h)
722 AC_CHECK_LIB(krb, main)
723 if test "$ac_cv_header_krb_h" != yes; then
724 AC_MSG_WARN([Cannot find krb.h, build may fail])
725 fi
726 if test "$ac_cv_lib_krb_main" != yes; then
727 AC_MSG_WARN([Cannot find libkrb, build may fail])
728 fi
729
Damien Millerc85f9b42000-01-29 10:20:21 +1100730 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100731 AC_CHECK_LIB(resolv, dn_expand, , )
732 KRB4=yes
Damien Miller8bdeee21999-12-30 15:50:54 +1100733 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100734 fi
Damien Miller80297751999-11-19 13:03:25 +1100735 ]
736)
737
Damien Millera22ba012000-03-02 23:09:20 +1100738# Check whether user wants AFS support
Damien Millerc6398ef1999-11-20 12:18:40 +1100739AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100740 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100741 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100742 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100743
744 if test "x$withval" != "$xyes" ; then
745 CFLAGS="$CFLAGS -I${withval}/include"
746 LFLAGS="$LFLAGS -L${withval}/lib"
747 fi
748
749 if test -z "$KRB4" ; then
750 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
751 fi
752
Damien Miller8bdeee21999-12-30 15:50:54 +1100753 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100754 if test ! -z "$AFS_LIBS" ; then
755 LIBS="$LIBS $AFS_LIBS"
756 fi
757 AC_DEFINE(AFS)
Damien Miller8bdeee21999-12-30 15:50:54 +1100758 fi
Damien Miller80297751999-11-19 13:03:25 +1100759 ]
760)
Damien Millerc85f9b42000-01-29 10:20:21 +1100761LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100762
Damien Millera22ba012000-03-02 23:09:20 +1100763# Check whether user wants S/Key support
Damien Miller80297751999-11-19 13:03:25 +1100764AC_ARG_WITH(skey,
765 [ --with-skey Enable S/Key support],
766 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100767 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100768 AC_DEFINE(SKEY)
769 LIBS="$LIBS -lskey"
770 fi
Damien Miller80297751999-11-19 13:03:25 +1100771 ]
772)
773
Damien Millera22ba012000-03-02 23:09:20 +1100774# Check whether user wants TCP wrappers support
Damien Millerf7c0f821999-11-22 22:31:49 +1100775AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100776 [ --with-tcp-wrappers Enable tcpwrappers support],
777 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100778 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100779 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100780 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100781 AC_MSG_CHECKING(for libwrap)
782 AC_TRY_LINK(
783 [
Damien Miller81171112000-04-23 11:14:01 +1000784#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100785 int deny_severity = 0, allow_severity = 0;
786 ],
787 [hosts_access(0);],
788 [
789 AC_MSG_RESULT(yes)
790 AC_DEFINE(LIBWRAP)
791 ],
792 [
793 AC_MSG_RESULT(no)
794 AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***])
795 LIBS="$saved_LIBS"
796 ]
797 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100798 fi
Damien Miller80297751999-11-19 13:03:25 +1100799 ]
800)
801
Damien Millera22ba012000-03-02 23:09:20 +1100802# Check whether to enable MD5 passwords
Damien Millerf7c0f821999-11-22 22:31:49 +1100803AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100804 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100805 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100806 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100807 AC_DEFINE(HAVE_MD5_PASSWORDS)
808 fi
809 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100810)
811
Damien Millera22ba012000-03-02 23:09:20 +1100812# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +1100813AC_ARG_WITH(shadow,
814 [ --without-shadow Disable shadow password support],
815 [
816 if test "x$withval" = "xno" ; then
817 AC_DEFINE(DISABLE_SHADOW)
818 fi
819 ]
820)
821
Damien Millera22ba012000-03-02 23:09:20 +1100822# Use ip address instead of hostname in $DISPLAY
Damien Miller76112de1999-12-21 11:18:08 +1100823AC_ARG_WITH(ipaddr-display,
824 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
825 [
Damien Miller66409952000-01-17 21:40:06 +1100826 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +1100827 AC_DEFINE(IPADDR_IN_DISPLAY)
828 fi
829 ]
830)
831
Damien Millera22ba012000-03-02 23:09:20 +1100832# Whether to mess with the default path
Damien Millere7f626c1999-12-31 09:49:44 +1100833AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +1100834 [ --with-default-path=PATH Specify default \$PATH environment for server],
835 [
836 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +1100837 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller5a3e6831999-12-27 09:48:56 +1100838 fi
839 ]
840)
841
Damien Millera22ba012000-03-02 23:09:20 +1100842# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7d80e342000-01-19 14:36:49 +1100843AC_ARG_WITH(ipv4-default,
844 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
845 [
846 if test "x$withval" != "xno" ; then
847 AC_DEFINE(IPV4_DEFAULT)
848 fi
849 ]
850)
851
Damien Miller61e50f12000-05-08 20:49:37 +1000852AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7bcb0892000-03-11 20:45:40 +1100853AC_ARG_WITH(4in6,
854 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
855 [
856 if test "x$withval" != "xno" ; then
857 AC_MSG_RESULT(yes)
858 AC_DEFINE(IPV4_IN_IPV6)
859 else
860 AC_MSG_RESULT(no)
861 fi
862 ],[
863 if test "x$inet6_default_4in6" = "xyes"; then
864 AC_MSG_RESULT([yes (default)])
865 AC_DEFINE(IPV4_IN_IPV6)
866 else
867 AC_MSG_RESULT([no (default)])
868 fi
869 ]
870)
871
Damien Millera22ba012000-03-02 23:09:20 +1100872# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +1100873piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +1100874AC_ARG_WITH(pid-dir,
875 [ --with-pid-dir=PATH Specify location of ssh.pid file],
876 [
877 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +1100878 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +1100879 fi
880 ]
881)
Damien Miller4018c192000-04-30 09:30:44 +1000882
Damien Millerdbd250f2000-01-18 08:57:14 +1100883AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +1100884AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +1100885
andre2ff7b5d2000-06-03 14:57:40 +0000886dnl allow user to disable some login recording features
887AC_ARG_ENABLE(lastlog,
888 [ --disable-lastlog disable use of lastlog even if detected [no]],
889 [ AC_DEFINE(DISABLE_LASTLOG) ]
890)
891AC_ARG_ENABLE(utmp,
892 [ --disable-utmp disable use of utmp even if detected [no]],
893 [ AC_DEFINE(DISABLE_UTMP) ]
894)
895AC_ARG_ENABLE(utmpx,
896 [ --disable-utmpx disable use of utmpx even if detected [no]],
897 [ AC_DEFINE(DISABLE_UTMPX) ]
898)
899AC_ARG_ENABLE(wtmp,
900 [ --disable-wtmp disable use of wtmp even if detected [no]],
901 [ AC_DEFINE(DISABLE_WTMP) ]
902)
903AC_ARG_ENABLE(wtmpx,
904 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
905 [ AC_DEFINE(DISABLE_WTMPX) ]
906)
907AC_ARG_ENABLE(libutil,
908 [ --disable-libutil disable use of libutil (login() etc.) [no]],
909 [ AC_DEFINE(DISABLE_LOGIN) ]
910)
911AC_ARG_ENABLE(pututline,
912 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
913 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
914)
915AC_ARG_ENABLE(pututxline,
916 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
917 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
918)
919AC_ARG_WITH(lastlog,
920 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
921 [ conf_lastlog_location="$withval"; ],)
922
923dnl lastlog, [uw]tmpx? detection
924dnl NOTE: set the paths in the platform section to avoid the
925dnl need for command-line parameters
926dnl lastlog and [uw]tmp are subject to a file search if all else fails
927
928dnl lastlog detection
929dnl NOTE: the code itself will detect if lastlog is a directory
930AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
931AC_TRY_COMPILE([
932#include <sys/types.h>
933#include <utmp.h>
934#ifdef HAVE_LASTLOG_H
935# include <lastlog.h>
936#endif
937#ifdef PATHS_H
938# include <paths.h>
939#endif
940 ],
941 [ char *lastlog = LASTLOG_FILE; ],
942 [ AC_MSG_RESULT(yes) ],
943 [ AC_MSG_RESULT(no)
944 system_lastlog_path=no ]
945)
946if test -z "$conf_lastlog_location"; then
947 if test x"$system_lastlog_path" = x"no" ; then
948 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
949 if test -e $f ; then
950 conf_lastlog_location=$f
951 fi
952 done
953 if test -z "$conf_lastlog_location"; then
954 AC_MSG_WARN([** Cannot find lastlog - disabling feature **])
955 AC_DEFINE(DISABLE_LASTLOG)
956 fi
957 fi
958fi
959
960if test -n "$conf_lastlog_location"; then
961 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
962fi
963
964dnl utmp detection
965AC_MSG_CHECKING([if your system defines UTMP_FILE])
966AC_TRY_COMPILE([
967#include <sys/types.h>
968#include <utmp.h>
969#ifdef PATHS_H
970# include <paths.h>
971#endif
972 ],
973 [ char *utmp = UTMP_FILE; ],
974 [ AC_MSG_RESULT(yes) ],
975 [ AC_MSG_RESULT(no)
976 system_utmp_path=no ]
977)
978if test -z "$conf_utmp_location"; then
979 if test x"$system_utmp_path" = x"no" ; then
980 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
981 if test -f $f ; then
982 conf_utmp_location=$f
983 fi
984 done
985 if test -z "$conf_utmp_location"; then
986 AC_DEFINE(DISABLE_UTMP)
987 fi
988 fi
989fi
990if test -n "$conf_utmp_location"; then
991 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
992fi
993
994dnl wtmp detection
995AC_MSG_CHECKING([if your system defines WTMP_FILE])
996AC_TRY_COMPILE([
997#include <sys/types.h>
998#include <utmp.h>
999#ifdef PATHS_H
1000# include <paths.h>
1001#endif
1002 ],
1003 [ char *wtmp = WTMP_FILE; ],
1004 [ AC_MSG_RESULT(yes) ],
1005 [ AC_MSG_RESULT(no)
1006 system_wtmp_path=no ]
1007)
1008if test -z "$conf_wtmp_location"; then
1009 if test x"$system_wtmp_path" = x"no" ; then
1010 for f in /usr/adm/wtmp /var/log/wtmp; do
1011 if test -f $f ; then
1012 conf_wtmp_location=$f
1013 fi
1014 done
1015 if test -z "$conf_wtmp_location"; then
1016 AC_DEFINE(DISABLE_WTMP)
1017 fi
1018 fi
1019fi
1020if test -n "$conf_wtmp_location"; then
1021 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1022fi
1023
1024
1025dnl utmpx detection - I don't know any system so perverse as to require
1026dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1027dnl there, though.
1028AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1029AC_TRY_COMPILE([
1030#include <sys/types.h>
1031#include <utmp.h>
1032#ifdef HAVE_UTMPX_H
1033#include <utmpx.h>
1034#endif
1035#ifdef PATHS_H
1036# include <paths.h>
1037#endif
1038 ],
1039 [ char *utmpx = UTMPX_FILE; ],
1040 [ AC_MSG_RESULT(yes) ],
1041 [ AC_MSG_RESULT(no)
1042 system_utmpx_path=no ]
1043)
1044if test -z "$conf_utmpx_location"; then
1045 if test x"$system_utmpx_path" = x"no" ; then
1046 AC_DEFINE(DISABLE_UTMPX)
1047 fi
1048else
1049 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1050fi
1051
1052dnl wtmpx detection
1053AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1054AC_TRY_COMPILE([
1055#include <sys/types.h>
1056#include <utmp.h>
1057#ifdef HAVE_UTMPX_H
1058#include <utmpx.h>
1059#endif
1060#ifdef PATHS_H
1061# include <paths.h>
1062#endif
1063 ],
1064 [ char *wtmpx = WTMPX_FILE; ],
1065 [ AC_MSG_RESULT(yes) ],
1066 [ AC_MSG_RESULT(no)
1067 system_wtmpx_path=no ]
1068)
1069if test -z "$conf_wtmpx_location"; then
1070 if test x"$system_wtmpx_path" = x"no" ; then
1071 AC_DEFINE(DISABLE_WTMPX)
1072 fi
1073else
1074 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1075fi
1076
Damien Miller4018c192000-04-30 09:30:44 +10001077
1078# Change default command timeout for builtin PRNG
1079entropy_timeout=100
1080AC_ARG_WITH(entropy-timeout,
1081 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1082 [
1083 if test "x$withval" != "xno" ; then
1084 entropy_timeout=$withval
1085 fi
1086 ]
1087)
1088AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1089
1090
Damien Miller29ea30d2000-03-17 10:54:15 +11001091if test ! -z "$blibpath" ; then
1092 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1093 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1094fi
1095
Damien Miller0437b332000-05-02 09:56:41 +10001096AC_OUTPUT(Makefile ssh_prng_cmds)
1097
1098