blob: c74f65b91d625d6be6d0aac212f8d00e0e07e5a3 [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 Milleredb82922000-06-20 13:25:52 +100034 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110035 blibpath="/usr/lib:/lib:/usr/local/lib"
36 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100037 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110038 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000039 MANTYPE='$(CATMAN)'
40 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000041 dnl AIX handles lastlog as part of its login message
42 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100043 MANTYPE='$(CATMAN)'
44 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110045 ;;
Damien Miller76112de1999-12-21 11:18:08 +110046*-*-hpux10*)
47 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100048 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110049 fi
50 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
51 AC_DEFINE(IPADDR_IN_DISPLAY)
52 AC_MSG_CHECKING(for HPUX trusted system password database)
53 if test -f /tcb/files/auth/system/default; then
54 AC_MSG_RESULT(yes)
55 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
56 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110057 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110058 else
59 AC_MSG_RESULT(no)
60 AC_DEFINE(DISABLE_SHADOW)
61 fi
Damien Miller670a4b82000-01-22 13:53:11 +110062 MANTYPE='$(CATMAN)'
63 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110064 ;;
Damien Miller1bead332000-04-30 00:47:29 +100065*-*-hpux11*)
66 if test -z "$GCC"; then
67 CFLAGS="$CFLAGS -Ae"
68 fi
69 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100070 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100071 AC_MSG_CHECKING(for HPUX trusted system password database)
72 if test -f /tcb/files/auth/system/default; then
73 AC_MSG_RESULT(yes)
74 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
75 LIBS="$LIBS -lsec"
76 AC_MSG_WARN([This configuration is untested])
77 else
78 AC_MSG_RESULT(no)
79 AC_DEFINE(DISABLE_SHADOW)
80 fi
81 MANTYPE='$(CATMAN)'
82 mansubdir=cat
83 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110084*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110085 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100086 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110087 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110088 no_libsocket=1
89 no_libnsl=1
90 ;;
91*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110092 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100093 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110094 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +100095 AC_DEFINE(WITH_IRIX_ARRAY)
96 AC_DEFINE(WITH_IRIX_PROJECT)
97 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +110098 no_libsocket=1
99 no_libnsl=1
100 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100101*-*-linux*)
102 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100103 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000104 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100105 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100106 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100107*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100108 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100109 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000110*-next-*)
111 # hardwire lastlog location (can't detect it on some versions)
112 conf_lastlog_location="/usr/adm/lastlog"
Damien Miller31abc9a2000-07-09 23:26:27 +1000113 conf_utmp_location=/etc/utmp
Damien Miller0f91b4e2000-06-18 15:43:25 +1000114 AC_DEFINE(HAVE_NEXT)
115 CFLAGS="$CFLAGS -I/usr/local/include"
116 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000117 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
118 AC_MSG_WARN([*** Expect 'scp' to fail!])
119 AC_MSG_WARN([*** Please report any problems, thanks])
120 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100121*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100122 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100123 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100124 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000125 # hardwire lastlog location (can't detect it on some versions)
126 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000127 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
128 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
129 if test "$sol2ver" -ge 8; then
130 AC_MSG_RESULT(yes)
131 AC_DEFINE(DISABLE_UTMP)
132 AC_DEFINE(DISABLE_WTMP)
133 else
134 AC_MSG_RESULT(no)
135 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100136 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000137*-*-sunos4*)
138 CFLAGS="$CFLAGS -DSUNOS4"
139 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000140 conf_utmp_location=/etc/utmp
141 conf_wtmp_location=/var/adm/wtmp
142 conf_lastlog_location=/var/adm/lastlog
143 MANTYPE='$(CATMAN)'
144 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000145 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000146*-sni-sysv*)
147 CFLAGS="$CFLAGS -I/usr/local/include"
148 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
149 MANTYPE='$(CATMAN)'
150 AC_DEFINE(IP_TOS_IS_BROKEN)
151 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000152 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000153 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100154*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100155 CFLAGS="$CFLAGS -I/usr/local/include"
156 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100157 MANTYPE='$(CATMAN)'
158 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100159 LIBS="$LIBS -lgen -lsocket"
160 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000161*-*-sco3*)
162 CFLAGS="$CFLAGS -I/usr/local/include"
163 LDFLAGS="$LDFLAGS -L/usr/local/lib"
164 MANTYPE='$(CATMAN)'
165 mansubdir=cat
166 LIBS="$LIBS -lgen -lsocket"
167 no_dev_ptmx=1
168 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000169*-dec-osf*)
170# This is untested
171 if test ! -z "USE_SIA" ; then
172 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
173 if test -f /etc/sia/matrix.conf; then
174 AC_MSG_RESULT(yes)
175 AC_DEFINE(HAVE_OSF_SIA)
176 AC_DEFINE(DISABLE_LOGIN)
177 LIBS="$LIBS -lsecurity -ldb -lm -laud"
178 else
179 AC_MSG_RESULT(no)
180 fi
181 fi
182 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100183esac
184
Damien Millere37bfc12000-06-05 09:37:43 +1000185# Allow user to specify flags
186AC_ARG_WITH(cflags,
187 [ --with-cflags Specify additional flags to pass to compiler],
188 [
189 if test "x$withval" != "xno" ; then
190 CFLAGS="$CFLAGS $withval"
191 fi
192 ]
193)
194AC_ARG_WITH(ldflags,
195 [ --with-ldlags Specify additional flags to pass to linker],
196 [
197 if test "x$withval" != "xno" ; then
198 LDFLAGS="$LDFLAGS $withval"
199 fi
200 ]
201)
202AC_ARG_WITH(libs,
203 [ --with-libs Specify additional libraries to link with],
204 [
205 if test "x$withval" != "xno" ; then
206 LIBS="$LIBS $withval"
207 fi
208 ]
209)
210
211
Damien Millera22ba012000-03-02 23:09:20 +1100212# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100213AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
214AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100215
Damien Millerbeb4ba51999-12-28 15:09:35 +1100216if test -z "$no_libsocket" ; then
217 AC_CHECK_LIB(nsl, yp_match, , )
218fi
219if test -z "$no_libnsl" ; then
220 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100221fi
Damien Millerab18c411999-11-11 10:40:23 +1100222
Damien Millera22ba012000-03-02 23:09:20 +1100223# Checks for header files.
Damien Millerecbb26d2000-07-15 14:59:14 +1000224AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h usersec.h util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100225
Damien Millera22ba012000-03-02 23:09:20 +1100226# Checks for library functions.
Damien Millerecbb26d2000-07-15 14:59:14 +1000227AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage inet_aton innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop)
andre2ff7b5d2000-06-03 14:57:40 +0000228dnl checks for time functions
229AC_CHECK_FUNCS(gettimeofday time)
230dnl checks for libutil functions
231AC_CHECK_FUNCS(login logout updwtmp logwtmp)
232dnl checks for utmp functions
233AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
234AC_CHECK_FUNCS(utmpname)
235dnl checks for utmpx functions
236AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
237AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100238
Damien Miller5fc85652000-07-09 23:53:07 +1000239AC_CHECK_FUNC(getuserattr,
240 [AC_DEFINE(HAVE_GETUSERATTR)],
241 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
242)
243
Damien Miller04f80141999-11-19 15:32:34 +1100244AC_CHECK_FUNC(login,
245 [AC_DEFINE(HAVE_LOGIN)],
246 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
247)
248
249AC_CHECK_FUNC(daemon,
250 [AC_DEFINE(HAVE_DAEMON)],
251 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
252)
253
Damien Miller9fb07e42000-03-05 16:22:59 +1100254AC_CHECK_FUNC(getpagesize,
255 [AC_DEFINE(HAVE_GETPAGESIZE)],
256 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
257)
258
Damien Millercb170cb2000-07-01 16:52:55 +1000259# Check for broken snprintf
260if test "x$ac_cv_func_snprintf" = "xyes" ; then
261 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
262 AC_TRY_RUN(
263 [
264#include <stdio.h>
265int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
266 ],
267 [AC_MSG_RESULT(yes)],
268 [
269 AC_MSG_RESULT(no)
270 AC_DEFINE(BROKEN_SNPRINTF)
271 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
272 ]
273 )
274fi
275
Damien Miller7b22d652000-06-18 14:07:04 +1000276PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100277AC_ARG_WITH(pam,
278 [ --without-pam Disable PAM support ],
279 [
280 if test "x$withval" = "xno" ; then
281 no_pam=1
282 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000283 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100284 fi
285 ]
286)
Damien Milleredb82922000-06-20 13:25:52 +1000287if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100288 AC_CHECK_LIB(dl, dlopen, , )
289 LIBS="$LIBS -lpam"
290
Damien Miller0e65eed2000-05-17 22:16:05 +1000291 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000292
Damien Miller1f335fb2000-06-26 11:31:33 +1000293 disable_shadow=yes
294
Damien Miller7b22d652000-06-18 14:07:04 +1000295 PAM_MSG="yes"
296
Damien Millera22ba012000-03-02 23:09:20 +1100297 # Check PAM strerror arguments (old PAM)
298 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
299 AC_TRY_COMPILE(
300 [
Damien Miller81171112000-04-23 11:14:01 +1000301#include <stdlib.h>
302#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100303 ],
304 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
305 [AC_MSG_RESULT(no)],
306 [
307 AC_DEFINE(HAVE_OLD_PAM)
308 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000309 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100310 ]
311 )
312fi
313
314# The big search for OpenSSL
315AC_ARG_WITH(ssl-dir,
316 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
317 [
318 if test "x$withval" != "$xno" ; then
319 tryssldir=$withval
320 fi
321 ]
322)
323
324saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100325saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100326saved_CFLAGS="$CFLAGS"
327if test "x$prefix" != "xNONE" ; then
328 tryssldir="$tryssldir $prefix"
329fi
Damien Miller61e50f12000-05-08 20:49:37 +1000330AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100331
Damien Miller61e50f12000-05-08 20:49:37 +1000332 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
333 if test ! -z "$ssldir" ; then
334 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
335 CFLAGS="$saved_CFLAGS -I$ssldir/include"
336 if test ! -z "$need_dash_r" ; then
337 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
338 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100339 else
Damien Miller61e50f12000-05-08 20:49:37 +1000340 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100341 fi
342
Damien Miller3b512e12000-05-17 23:29:18 +1000343 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000344
Damien Miller3b512e12000-05-17 23:29:18 +1000345 # Basic test to check for compatible version and correct linking
346 # *does not* test for RSA - that comes later.
347 AC_TRY_RUN(
348 [
Damien Millere59ce622000-05-01 20:54:17 +1000349#include <string.h>
350#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000351int main(void)
352{
Damien Miller3b512e12000-05-17 23:29:18 +1000353 char a[2048];
354 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000355 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000356 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000357}
Damien Miller3b512e12000-05-17 23:29:18 +1000358 ],
359 [
360 found_crypto=1
361 break;
362 ], []
363 )
Damien Miller61e50f12000-05-08 20:49:37 +1000364
365 if test ! -z "$found_crypto" ; then
366 break;
367 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100368 done
369
Damien Miller61e50f12000-05-08 20:49:37 +1000370 if test -z "$found_crypto" ; then
371 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100372 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000373 if test -z "$ssldir" ; then
374 ssldir="(system)"
375 fi
Damien Millera22ba012000-03-02 23:09:20 +1100376
Damien Miller61e50f12000-05-08 20:49:37 +1000377 ac_cv_openssldir=$ssldir
378])
379
Damien Milleredb82922000-06-20 13:25:52 +1000380if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000381 AC_DEFINE(HAVE_OPENSSL)
382 dnl Need to recover ssldir - test above runs in subshell
383 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100384 CFLAGS="$saved_CFLAGS -I$ssldir/include"
385 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
386 if test ! -z "$need_dash_r" ; then
387 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100388 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100389 if test ! -z "$blibpath" ; then
390 blibpath="$blibpath:$ssldir:$ssldir/lib"
391 fi
Damien Millera22ba012000-03-02 23:09:20 +1100392fi
Damien Miller3b512e12000-05-17 23:29:18 +1000393LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000394
Damien Miller3b512e12000-05-17 23:29:18 +1000395# Now test RSA support
396saved_LIBS="$LIBS"
397AC_MSG_CHECKING([for RSA support])
398for WANTS_RSAREF in "" 1 ; do
399 if test -z "$WANTS_RSAREF" ; then
400 LIBS="$saved_LIBS"
401 else
402 LIBS="$saved_LIBS -lRSAglue -lrsaref"
403 fi
404 AC_TRY_RUN([
405#include <string.h>
406#include <openssl/rand.h>
407#include <openssl/rsa.h>
408#include <openssl/bn.h>
409#include <openssl/sha.h>
410int main(void)
411{
412 int num; RSA *key; static unsigned char p_in[] = "blahblah";
413 unsigned char c[256], p[256];
414 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
415 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
416 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
417 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
418}
419 ],
420 [
421 rsa_works=1
422 break;
423 ], [])
424done
425
426if test ! -z "$no_rsa" ; then
427 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000428 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000429else
430 if test -z "$rsa_works" ; then
431 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000432 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000433 else
434 if test -z "$WANTS_RSAREF" ; then
435 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000436 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000437 else
Damien Miller7b22d652000-06-18 14:07:04 +1000438 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000439 AC_MSG_RESULT(using RSAref)
440 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
441 fi
442 fi
443fi
Damien Millera22ba012000-03-02 23:09:20 +1100444
445# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100446AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100447AC_CHECK_SIZEOF(short int, 2)
448AC_CHECK_SIZEOF(int, 4)
449AC_CHECK_SIZEOF(long int, 4)
450AC_CHECK_SIZEOF(long long int, 8)
451
Damien Millera22ba012000-03-02 23:09:20 +1100452# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000453AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
454 AC_TRY_COMPILE(
455 [ #include <sys/types.h> ],
456 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
457 [ ac_cv_have_intxx_t="yes" ],
458 [ ac_cv_have_intxx_t="no" ]
459 )
460])
461if test "x$ac_cv_have_intxx_t" = "xyes" ; then
462 AC_DEFINE(HAVE_INTXX_T)
463 have_intxx_t=1
464fi
465
466AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
467 AC_TRY_COMPILE(
468 [ #include <sys/types.h> ],
469 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
470 [ ac_cv_have_u_intxx_t="yes" ],
471 [ ac_cv_have_u_intxx_t="no" ]
472 )
473])
474if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
475 AC_DEFINE(HAVE_U_INTXX_T)
476 have_u_intxx_t=1
477fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100478
Damien Millerc6398ef1999-11-20 12:18:40 +1100479
Damien Milleredb82922000-06-20 13:25:52 +1000480if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
481 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100482then
483 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
484 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000485 [
486#include <sys/bitypes.h>
487 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100488 [
Damien Miller70494d12000-04-03 15:57:06 +1000489 int8_t a; int16_t b; int32_t c;
490 u_int8_t e; u_int16_t f; u_int32_t g;
491 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100492 ],
493 [
494 AC_DEFINE(HAVE_U_INTXX_T)
495 AC_DEFINE(HAVE_INTXX_T)
496 AC_MSG_RESULT(yes)
497 ],
498 [AC_MSG_RESULT(no)]
499 )
500fi
501
Damien Millerd6121d22000-03-17 23:26:46 +1100502if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000503 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
504 AC_TRY_COMPILE(
505 [
506#include <sys/types.h>
507 ],
508 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
509 [ ac_cv_have_uintxx_t="yes" ],
510 [ ac_cv_have_uintxx_t="no" ]
511 )
512 ])
513 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
514 AC_DEFINE(HAVE_UINTXX_T)
515 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100516fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100517
Damien Miller61e50f12000-05-08 20:49:37 +1000518AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
519 AC_TRY_COMPILE(
520 [
Damien Miller81171112000-04-23 11:14:01 +1000521#include <sys/types.h>
522#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000523 ],
524 [socklen_t foo; foo = 1235;],
525 [ ac_cv_have_socklen_t="yes" ],
526 [ ac_cv_have_socklen_t="no" ]
527 )
528])
529if test "x$ac_cv_have_socklen_t" = "xyes" ; then
530 AC_DEFINE(HAVE_SOCKLEN_T)
531fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100532
Damien Miller61e50f12000-05-08 20:49:37 +1000533AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
534 AC_TRY_COMPILE(
535 [
536#include <sys/types.h>
537 ],
538 [ size_t foo; foo = 1235; ],
539 [ ac_cv_have_size_t="yes" ],
540 [ ac_cv_have_size_t="no" ]
541 )
542])
543if test "x$ac_cv_have_size_t" = "xyes" ; then
544 AC_DEFINE(HAVE_SIZE_T)
545fi
Damien Miller95058511999-12-29 10:36:45 +1100546
Damien Miller615f9392000-05-17 22:53:33 +1000547AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
548 AC_TRY_COMPILE(
549 [
550#include <sys/types.h>
551 ],
552 [ ssize_t foo; foo = 1235; ],
553 [ ac_cv_have_ssize_t="yes" ],
554 [ ac_cv_have_ssize_t="no" ]
555 )
556])
557if test "x$ac_cv_have_ssize_t" = "xyes" ; then
558 AC_DEFINE(HAVE_SSIZE_T)
559fi
560
Damien Millerb54b40e2000-06-23 08:23:34 +1000561AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
562 AC_TRY_COMPILE(
563 [
564#include <sys/types.h>
565#include <sys/socket.h>
566 ],
567 [ sa_family_t foo; foo = 1235; ],
568 [ ac_cv_have_sa_family_t="yes" ],
569 [ ac_cv_have_sa_family_t="no" ]
570 )
571])
572if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
573 AC_DEFINE(HAVE_SA_FAMILY_T)
574fi
575
Damien Miller0f91b4e2000-06-18 15:43:25 +1000576AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
577 AC_TRY_COMPILE(
578 [
579#include <sys/types.h>
580 ],
581 [ pid_t foo; foo = 1235; ],
582 [ ac_cv_have_pid_t="yes" ],
583 [ ac_cv_have_pid_t="no" ]
584 )
585])
586if test "x$ac_cv_have_pid_t" = "xyes" ; then
587 AC_DEFINE(HAVE_PID_T)
588fi
589
590AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
591 AC_TRY_COMPILE(
592 [
593#include <sys/types.h>
594 ],
595 [ mode_t foo; foo = 1235; ],
596 [ ac_cv_have_mode_t="yes" ],
597 [ ac_cv_have_mode_t="no" ]
598 )
599])
600if test "x$ac_cv_have_mode_t" = "xyes" ; then
601 AC_DEFINE(HAVE_MODE_T)
602fi
603
Damien Miller61e50f12000-05-08 20:49:37 +1000604
605AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
606 AC_TRY_COMPILE(
607 [
Damien Miller81171112000-04-23 11:14:01 +1000608#include <sys/types.h>
609#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000610 ],
611 [ struct sockaddr_storage s; ],
612 [ ac_cv_have_struct_sockaddr_storage="yes" ],
613 [ ac_cv_have_struct_sockaddr_storage="no" ]
614 )
615])
616if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
617 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
618fi
Damien Miller34132e52000-01-14 15:45:46 +1100619
Damien Miller61e50f12000-05-08 20:49:37 +1000620AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
621 AC_TRY_COMPILE(
622 [
Damien Miller7b22d652000-06-18 14:07:04 +1000623#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000624#include <netinet/in.h>
625 ],
626 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
627 [ ac_cv_have_struct_sockaddr_in6="yes" ],
628 [ ac_cv_have_struct_sockaddr_in6="no" ]
629 )
630])
631if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
632 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
633fi
Damien Miller34132e52000-01-14 15:45:46 +1100634
Damien Miller61e50f12000-05-08 20:49:37 +1000635AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
636 AC_TRY_COMPILE(
637 [
Damien Miller7b22d652000-06-18 14:07:04 +1000638#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000639#include <netinet/in.h>
640 ],
641 [ struct in6_addr s; s.s6_addr[0] = 0; ],
642 [ ac_cv_have_struct_in6_addr="yes" ],
643 [ ac_cv_have_struct_in6_addr="no" ]
644 )
645])
646if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
647 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
648fi
Damien Miller34132e52000-01-14 15:45:46 +1100649
Damien Miller61e50f12000-05-08 20:49:37 +1000650AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
651 AC_TRY_COMPILE(
652 [
Damien Miller81171112000-04-23 11:14:01 +1000653#include <sys/types.h>
654#include <sys/socket.h>
655#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000656 ],
657 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
658 [ ac_cv_have_struct_addrinfo="yes" ],
659 [ ac_cv_have_struct_addrinfo="no" ]
660 )
661])
662if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
663 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
664fi
665
Damien Miller34132e52000-01-14 15:45:46 +1100666
Damien Millera22ba012000-03-02 23:09:20 +1100667# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100668
Damien Miller61e50f12000-05-08 20:49:37 +1000669OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
670OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
671OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
672OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
673OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000674OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000675OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
676OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000677OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000678OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
679OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
680OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
681OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000682OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
683OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
684OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
685OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
686
Damien Miller61e50f12000-05-08 20:49:37 +1000687AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
688 ac_cv_have_ss_family_in_struct_ss, [
689 AC_TRY_COMPILE(
690 [
Damien Miller81171112000-04-23 11:14:01 +1000691#include <sys/types.h>
692#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000693 ],
694 [ struct sockaddr_storage s; s.ss_family = 1; ],
695 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
696 [ ac_cv_have_ss_family_in_struct_ss="no" ],
697 )
698])
699if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
700 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
701fi
702
Damien Miller61e50f12000-05-08 20:49:37 +1000703AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
704 ac_cv_have___ss_family_in_struct_ss, [
705 AC_TRY_COMPILE(
706 [
Damien Miller81171112000-04-23 11:14:01 +1000707#include <sys/types.h>
708#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000709 ],
710 [ struct sockaddr_storage s; s.__ss_family = 1; ],
711 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
712 [ ac_cv_have___ss_family_in_struct_ss="no" ]
713 )
714])
715if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
716 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
717fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100718
Damien Miller61e50f12000-05-08 20:49:37 +1000719
720AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
721 AC_TRY_LINK([],
722 [ extern char *__progname; printf("%s", __progname); ],
723 [ ac_cv_libc_defines___progname="yes" ],
724 [ ac_cv_libc_defines___progname="no" ]
725 )
726])
727if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
728 AC_DEFINE(HAVE___PROGNAME)
729fi
730
Damien Millera22ba012000-03-02 23:09:20 +1100731
Damien Millerecbb26d2000-07-15 14:59:14 +1000732AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
733 AC_TRY_LINK([],
734 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
735 [ ac_cv_libc_defines_sys_errlist="yes" ],
736 [ ac_cv_libc_defines_sys_errlist="no" ]
737 )
738])
739if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
740 AC_DEFINE(HAVE_SYS_ERRLIST)
741fi
742
743
Damien Millera22ba012000-03-02 23:09:20 +1100744# Looking for programs, paths and files
745AC_ARG_WITH(rsh,
746 [ --with-rsh=PATH Specify path to remote shell program ],
747 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100748 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000749 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100750 fi
751 ],
752 [
753 AC_PATH_PROG(rsh_path, rsh)
754 ]
755)
756
757AC_ARG_WITH(xauth,
758 [ --with-xauth=PATH Specify path to xauth program ],
759 [
760 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000761 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100762 fi
763 ],
764 [
765 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000766 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100767 xauth_path="/usr/openwin/bin/xauth"
768 fi
769 ]
770)
771
772if test ! -z "$xauth_path" ; then
773 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
774fi
775if test ! -z "$rsh_path" ; then
776 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
777fi
778
779# Check for mail directory (last resort if we cannot get it from headers)
780if test ! -z "$MAIL" ; then
781 maildir=`dirname $MAIL`
782 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
783fi
784
Damien Millera22ba012000-03-02 23:09:20 +1100785if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100786 AC_CHECK_FILE("/dev/ptmx",
787 [
788 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
789 have_dev_ptmx=1
790 ]
791 )
Damien Millera22ba012000-03-02 23:09:20 +1100792fi
Damien Miller204ad072000-03-02 23:56:12 +1100793AC_CHECK_FILE("/dev/ptc",
794 [
795 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
796 have_dev_ptc=1
797 ]
798)
799
Damien Millera22ba012000-03-02 23:09:20 +1100800# Options from here on. Some of these are preset by platform above
801
Damien Millera22ba012000-03-02 23:09:20 +1100802# Check for user-specified random device, otherwise check /dev/urandom
803AC_ARG_WITH(random,
804 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
805 [
Damien Miller040f3832000-04-03 14:50:43 +1000806 if test "x$withval" != "xno" ; then
807 RANDOM_POOL="$withval";
808 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
809 fi
Damien Millera22ba012000-03-02 23:09:20 +1100810 ],
811 [
812 # Check for random device
813 AC_CHECK_FILE("/dev/urandom",
814 [
815 RANDOM_POOL="/dev/urandom";
816 AC_SUBST(RANDOM_POOL)
817 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
818 ]
819 )
820 ]
821)
822
823# Check for EGD pool file
824AC_ARG_WITH(egd-pool,
825 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
826 [
Damien Miller040f3832000-04-03 14:50:43 +1000827 if test "x$withval" != "xno" ; then
828 EGD_SOCKET="$withval";
829 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
830 fi
Damien Millera22ba012000-03-02 23:09:20 +1100831 ]
832)
833
Damien Miller0437b332000-05-02 09:56:41 +1000834# detect pathnames for entropy gathering commands, if we need them
835INSTALL_SSH_PRNG_CMDS=""
836rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000837if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000838 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000839 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
840 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
841 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
842 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
843 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
844 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
845 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
846 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
847 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
848 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
849 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
850 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
851 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
852 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
853 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000854
855 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000856fi
Damien Miller0437b332000-05-02 09:56:41 +1000857AC_SUBST(INSTALL_SSH_PRNG_CMDS)
858
Damien Miller11e37f62000-04-08 18:23:30 +1000859
Damien Miller670a4b82000-01-22 13:53:11 +1100860AC_ARG_WITH(catman,
861 [ --with-catman=man|cat Install preformatted manpages[no]],
862 [
863 MANTYPE='$(CATMAN)'
864 if test x"$withval" != x"yes" ; then
865 mansubdir=$withval
866 else
867 mansubdir=cat
868 fi
869 ], [
870 if test -z "$MANTYPE" ; then
871 MANTYPE='$(TROFFMAN)'
872 mansubdir=man
873 fi
874 ]
875)
876AC_SUBST(MANTYPE)
877AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100878
Damien Millera22ba012000-03-02 23:09:20 +1100879# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000880KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100881AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100882 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100883 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100884 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100885
886 if test "x$withval" != "$xyes" ; then
887 CFLAGS="$CFLAGS -I${withval}/include"
888 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100889 if test ! -z "$need_dash_r" ; then
890 LDFLAGS="$LDFLAGS -R${withval}/lib"
891 fi
892 if test ! -z "$blibpath" ; then
893 blibpath="$blibpath:${withval}/lib"
894 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100895 else
896 if test -d /usr/include/kerberosIV ; then
897 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
898 fi
899 fi
900
901 AC_CHECK_HEADERS(krb.h)
902 AC_CHECK_LIB(krb, main)
903 if test "$ac_cv_header_krb_h" != yes; then
904 AC_MSG_WARN([Cannot find krb.h, build may fail])
905 fi
906 if test "$ac_cv_lib_krb_main" != yes; then
907 AC_MSG_WARN([Cannot find libkrb, build may fail])
908 fi
909
Damien Millerc85f9b42000-01-29 10:20:21 +1100910 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100911 AC_CHECK_LIB(resolv, dn_expand, , )
912 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000913 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100914 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100915 fi
Damien Miller80297751999-11-19 13:03:25 +1100916 ]
917)
918
Damien Millera22ba012000-03-02 23:09:20 +1100919# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000920AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100921AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100922 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100923 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100924 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100925
926 if test "x$withval" != "$xyes" ; then
927 CFLAGS="$CFLAGS -I${withval}/include"
928 LFLAGS="$LFLAGS -L${withval}/lib"
929 fi
930
931 if test -z "$KRB4" ; then
932 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
933 fi
934
Damien Miller8bdeee21999-12-30 15:50:54 +1100935 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100936 if test ! -z "$AFS_LIBS" ; then
937 LIBS="$LIBS $AFS_LIBS"
938 fi
939 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000940 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100941 fi
Damien Miller80297751999-11-19 13:03:25 +1100942 ]
943)
Damien Millerc85f9b42000-01-29 10:20:21 +1100944LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100945
Damien Millera22ba012000-03-02 23:09:20 +1100946# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000947SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100948AC_ARG_WITH(skey,
949 [ --with-skey Enable S/Key support],
950 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100951 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100952 AC_DEFINE(SKEY)
953 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000954 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100955 fi
Damien Miller80297751999-11-19 13:03:25 +1100956 ]
957)
958
Damien Millera22ba012000-03-02 23:09:20 +1100959# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000960TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100961AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100962 [ --with-tcp-wrappers Enable tcpwrappers support],
963 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100964 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100965 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100966 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100967 AC_MSG_CHECKING(for libwrap)
968 AC_TRY_LINK(
969 [
Damien Miller81171112000-04-23 11:14:01 +1000970#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100971 int deny_severity = 0, allow_severity = 0;
972 ],
973 [hosts_access(0);],
974 [
975 AC_MSG_RESULT(yes)
976 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +1000977 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +1100978 ],
979 [
Damien Miller7b22d652000-06-18 14:07:04 +1000980 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +1100981 ]
982 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100983 fi
Damien Miller80297751999-11-19 13:03:25 +1100984 ]
985)
986
Damien Millera22ba012000-03-02 23:09:20 +1100987# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +1000988MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100989AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100990 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100991 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100992 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100993 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +1000994 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100995 fi
996 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100997)
998
Damien Millera22ba012000-03-02 23:09:20 +1100999# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001000AC_ARG_WITH(shadow,
1001 [ --without-shadow Disable shadow password support],
1002 [
1003 if test "x$withval" = "xno" ; then
1004 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001005 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001006 fi
1007 ]
1008)
1009
Damien Miller1f335fb2000-06-26 11:31:33 +10001010if test -z "$disable_shadow" ; then
1011 AC_MSG_CHECKING([if the systems has expire shadow information])
1012 AC_TRY_COMPILE(
1013 [
1014#include <sys/types.h>
1015#include <shadow.h>
1016 struct spwd sp;
1017 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1018 [ sp_expire_available=yes ], []
1019 )
1020
1021 if test "x$sp_expire_available" = "xyes" ; then
1022 AC_MSG_RESULT(yes)
1023 AC_DEFINE(HAS_SHADOW_EXPIRE)
1024 else
1025 AC_MSG_RESULT(no)
1026 fi
1027fi
1028
Damien Millera22ba012000-03-02 23:09:20 +11001029# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001030DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001031AC_ARG_WITH(ipaddr-display,
1032 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1033 [
Damien Miller66409952000-01-17 21:40:06 +11001034 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001035 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001036 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001037 fi
1038 ]
1039)
1040
Damien Millera22ba012000-03-02 23:09:20 +11001041# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001042SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001043AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001044 [ --with-default-path=PATH Specify default \$PATH environment for server],
1045 [
1046 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001047 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001048 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001049 fi
1050 ]
1051)
1052
Damien Millera22ba012000-03-02 23:09:20 +11001053# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001054IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001055AC_ARG_WITH(ipv4-default,
1056 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1057 [
1058 if test "x$withval" != "xno" ; then
1059 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001060 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001061 fi
1062 ]
1063)
1064
Damien Miller61e50f12000-05-08 20:49:37 +10001065AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001066IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001067AC_ARG_WITH(4in6,
1068 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1069 [
1070 if test "x$withval" != "xno" ; then
1071 AC_MSG_RESULT(yes)
1072 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001073 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001074 else
1075 AC_MSG_RESULT(no)
1076 fi
1077 ],[
1078 if test "x$inet6_default_4in6" = "xyes"; then
1079 AC_MSG_RESULT([yes (default)])
1080 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001081 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001082 else
1083 AC_MSG_RESULT([no (default)])
1084 fi
1085 ]
1086)
1087
Damien Millera22ba012000-03-02 23:09:20 +11001088# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001089piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001090AC_ARG_WITH(pid-dir,
1091 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1092 [
1093 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001094 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001095 fi
1096 ]
1097)
Damien Miller4018c192000-04-30 09:30:44 +10001098
Damien Millerdbd250f2000-01-18 08:57:14 +11001099AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001100AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001101
andre2ff7b5d2000-06-03 14:57:40 +00001102dnl allow user to disable some login recording features
1103AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001104 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001105 [ AC_DEFINE(DISABLE_LASTLOG) ]
1106)
1107AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001108 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001109 [ AC_DEFINE(DISABLE_UTMP) ]
1110)
1111AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001112 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001113 [ AC_DEFINE(DISABLE_UTMPX) ]
1114)
1115AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001116 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001117 [ AC_DEFINE(DISABLE_WTMP) ]
1118)
1119AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001120 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001121 [ AC_DEFINE(DISABLE_WTMPX) ]
1122)
1123AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001124 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001125 [ AC_DEFINE(DISABLE_LOGIN) ]
1126)
1127AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001128 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001129 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1130)
1131AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001132 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001133 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1134)
1135AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001136 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001137 [ conf_lastlog_location="$withval"; ],)
1138
1139dnl lastlog, [uw]tmpx? detection
1140dnl NOTE: set the paths in the platform section to avoid the
1141dnl need for command-line parameters
1142dnl lastlog and [uw]tmp are subject to a file search if all else fails
1143
1144dnl lastlog detection
1145dnl NOTE: the code itself will detect if lastlog is a directory
1146AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1147AC_TRY_COMPILE([
1148#include <sys/types.h>
1149#include <utmp.h>
1150#ifdef HAVE_LASTLOG_H
1151# include <lastlog.h>
1152#endif
Damien Miller2994e082000-06-04 15:51:47 +10001153#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001154# include <paths.h>
1155#endif
1156 ],
1157 [ char *lastlog = LASTLOG_FILE; ],
1158 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001159 [
1160 AC_MSG_RESULT(no)
1161 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1162 AC_TRY_COMPILE([
1163#include <sys/types.h>
1164#include <utmp.h>
1165#ifdef HAVE_LASTLOG_H
1166# include <lastlog.h>
1167#endif
1168#ifdef HAVE_PATHS_H
1169# include <paths.h>
1170#endif
1171 ],
1172 [ char *lastlog = _PATH_LASTLOG; ],
1173 [ AC_MSG_RESULT(yes) ],
1174 [
andree441aa32000-06-12 22:34:38 +00001175 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001176 system_lastlog_path=no
1177 ])
1178 ]
andre2ff7b5d2000-06-03 14:57:40 +00001179)
Damien Miller2994e082000-06-04 15:51:47 +10001180
andre2ff7b5d2000-06-03 14:57:40 +00001181if test -z "$conf_lastlog_location"; then
1182 if test x"$system_lastlog_path" = x"no" ; then
1183 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001184 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001185 conf_lastlog_location=$f
1186 fi
1187 done
1188 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001189 AC_MSG_WARN([** Cannot find lastlog **])
1190 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001191 fi
1192 fi
1193fi
1194
1195if test -n "$conf_lastlog_location"; then
1196 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1197fi
1198
1199dnl utmp detection
1200AC_MSG_CHECKING([if your system defines UTMP_FILE])
1201AC_TRY_COMPILE([
1202#include <sys/types.h>
1203#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001204#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001205# include <paths.h>
1206#endif
1207 ],
1208 [ char *utmp = UTMP_FILE; ],
1209 [ AC_MSG_RESULT(yes) ],
1210 [ AC_MSG_RESULT(no)
1211 system_utmp_path=no ]
1212)
1213if test -z "$conf_utmp_location"; then
1214 if test x"$system_utmp_path" = x"no" ; then
1215 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1216 if test -f $f ; then
1217 conf_utmp_location=$f
1218 fi
1219 done
1220 if test -z "$conf_utmp_location"; then
1221 AC_DEFINE(DISABLE_UTMP)
1222 fi
1223 fi
1224fi
1225if test -n "$conf_utmp_location"; then
1226 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1227fi
1228
1229dnl wtmp detection
1230AC_MSG_CHECKING([if your system defines WTMP_FILE])
1231AC_TRY_COMPILE([
1232#include <sys/types.h>
1233#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001234#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001235# include <paths.h>
1236#endif
1237 ],
1238 [ char *wtmp = WTMP_FILE; ],
1239 [ AC_MSG_RESULT(yes) ],
1240 [ AC_MSG_RESULT(no)
1241 system_wtmp_path=no ]
1242)
1243if test -z "$conf_wtmp_location"; then
1244 if test x"$system_wtmp_path" = x"no" ; then
1245 for f in /usr/adm/wtmp /var/log/wtmp; do
1246 if test -f $f ; then
1247 conf_wtmp_location=$f
1248 fi
1249 done
1250 if test -z "$conf_wtmp_location"; then
1251 AC_DEFINE(DISABLE_WTMP)
1252 fi
1253 fi
1254fi
1255if test -n "$conf_wtmp_location"; then
1256 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1257fi
1258
1259
1260dnl utmpx detection - I don't know any system so perverse as to require
1261dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1262dnl there, though.
1263AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1264AC_TRY_COMPILE([
1265#include <sys/types.h>
1266#include <utmp.h>
1267#ifdef HAVE_UTMPX_H
1268#include <utmpx.h>
1269#endif
Damien Miller2994e082000-06-04 15:51:47 +10001270#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001271# include <paths.h>
1272#endif
1273 ],
1274 [ char *utmpx = UTMPX_FILE; ],
1275 [ AC_MSG_RESULT(yes) ],
1276 [ AC_MSG_RESULT(no)
1277 system_utmpx_path=no ]
1278)
1279if test -z "$conf_utmpx_location"; then
1280 if test x"$system_utmpx_path" = x"no" ; then
1281 AC_DEFINE(DISABLE_UTMPX)
1282 fi
1283else
1284 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1285fi
1286
1287dnl wtmpx detection
1288AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1289AC_TRY_COMPILE([
1290#include <sys/types.h>
1291#include <utmp.h>
1292#ifdef HAVE_UTMPX_H
1293#include <utmpx.h>
1294#endif
Damien Miller2994e082000-06-04 15:51:47 +10001295#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001296# include <paths.h>
1297#endif
1298 ],
1299 [ char *wtmpx = WTMPX_FILE; ],
1300 [ AC_MSG_RESULT(yes) ],
1301 [ AC_MSG_RESULT(no)
1302 system_wtmpx_path=no ]
1303)
1304if test -z "$conf_wtmpx_location"; then
1305 if test x"$system_wtmpx_path" = x"no" ; then
1306 AC_DEFINE(DISABLE_WTMPX)
1307 fi
1308else
1309 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1310fi
1311
Damien Miller4018c192000-04-30 09:30:44 +10001312
1313# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001314entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001315AC_ARG_WITH(entropy-timeout,
1316 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1317 [
1318 if test "x$withval" != "xno" ; then
1319 entropy_timeout=$withval
1320 fi
1321 ]
1322)
1323AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1324
1325
Damien Miller29ea30d2000-03-17 10:54:15 +11001326if test ! -z "$blibpath" ; then
1327 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1328 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1329fi
1330
Damien Miller0437b332000-05-02 09:56:41 +10001331AC_OUTPUT(Makefile ssh_prng_cmds)
1332
Damien Miller7b22d652000-06-18 14:07:04 +10001333# Print summary of options
1334
1335if test x$MANTYPE = x'$(CATMAN)' ; then
1336 MAN_MSG=cat
1337else
1338 MAN_MSG=man
1339fi
1340if test ! -z "$RANDOM_POOL" ; then
1341 RAND_MSG="Device ($RANDOM_POOL)"
1342else
1343 if test ! -z "$EGD_SOCKET" ; then
1344 RAND_MSG="EGD ($EGD_SOCKET)"
1345 else
1346 RAND_MSG="Builtin (timeout $entropy_timeout)"
1347 fi
1348fi
1349
1350# Someone please show me a better way :)
1351A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1352B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1353C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1354D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1355E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1356F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1357G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1358
1359echo ""
1360echo "OpenSSH configured has been configured with the following options."
1361echo " User binaries: $B"
1362echo " System binaries: $C"
1363echo " Configuration files: $D"
1364echo " Askpass program: $E"
1365echo " Manual pages: $F"
1366echo " PID file: $G"
1367echo " Random number collection: $RAND_MSG"
1368echo " Manpage format: $MAN_MSG"
1369echo " PAM support: ${PAM_MSG}"
1370echo " KerberosIV support: $KRB4_MSG"
1371echo " AFS support: $AFS_MSG"
1372echo " S/KEY support: $SKEY_MSG"
1373echo " TCP Wrappers support: $TCPW_MSG"
1374echo " MD5 password support: $MD5_MSG"
1375echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1376echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1377echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1378
1379echo ""
1380
1381echo "Compiler flags: ${CFLAGS}"
1382echo "Linker flags: ${LDFLAGS}"
1383echo "Libraries: ${LIBS}"
1384
1385echo ""
1386