blob: f4f47cd453c938fa704a53876bf2202c7de8e0e9 [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)
140 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100141*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100142 CFLAGS="$CFLAGS -I/usr/local/include"
143 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100144 MANTYPE='$(CATMAN)'
145 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100146 LIBS="$LIBS -lgen -lsocket"
147 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000148*-*-sco3*)
149 CFLAGS="$CFLAGS -I/usr/local/include"
150 LDFLAGS="$LDFLAGS -L/usr/local/lib"
151 MANTYPE='$(CATMAN)'
152 mansubdir=cat
153 LIBS="$LIBS -lgen -lsocket"
154 no_dev_ptmx=1
155 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000156*-dec-osf*)
157# This is untested
158 if test ! -z "USE_SIA" ; then
159 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
160 if test -f /etc/sia/matrix.conf; then
161 AC_MSG_RESULT(yes)
162 AC_DEFINE(HAVE_OSF_SIA)
163 AC_DEFINE(DISABLE_LOGIN)
164 LIBS="$LIBS -lsecurity -ldb -lm -laud"
165 else
166 AC_MSG_RESULT(no)
167 fi
168 fi
169 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100170esac
171
Damien Millere37bfc12000-06-05 09:37:43 +1000172# Allow user to specify flags
173AC_ARG_WITH(cflags,
174 [ --with-cflags Specify additional flags to pass to compiler],
175 [
176 if test "x$withval" != "xno" ; then
177 CFLAGS="$CFLAGS $withval"
178 fi
179 ]
180)
181AC_ARG_WITH(ldflags,
182 [ --with-ldlags Specify additional flags to pass to linker],
183 [
184 if test "x$withval" != "xno" ; then
185 LDFLAGS="$LDFLAGS $withval"
186 fi
187 ]
188)
189AC_ARG_WITH(libs,
190 [ --with-libs Specify additional libraries to link with],
191 [
192 if test "x$withval" != "xno" ; then
193 LIBS="$LIBS $withval"
194 fi
195 ]
196)
197
198
Damien Millera22ba012000-03-02 23:09:20 +1100199# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100200AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
201AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100202
Damien Millerbeb4ba51999-12-28 15:09:35 +1100203if test -z "$no_libsocket" ; then
204 AC_CHECK_LIB(nsl, yp_match, , )
205fi
206if test -z "$no_libnsl" ; then
207 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100208fi
Damien Millerab18c411999-11-11 10:40:23 +1100209
Damien Millera22ba012000-03-02 23:09:20 +1100210# Checks for header files.
Damien Miller5fc85652000-07-09 23:53:07 +1000211AC_CHECK_HEADERS(bstring.h endian.h lastlog.h limits.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h usersec.h util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100212
Damien Millera22ba012000-03-02 23:09:20 +1100213# Checks for library functions.
Damien Miller31abc9a2000-07-09 23:26:27 +1000214AC_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 sigaction sigvec snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop)
andre2ff7b5d2000-06-03 14:57:40 +0000215dnl checks for time functions
216AC_CHECK_FUNCS(gettimeofday time)
217dnl checks for libutil functions
218AC_CHECK_FUNCS(login logout updwtmp logwtmp)
219dnl checks for utmp functions
220AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
221AC_CHECK_FUNCS(utmpname)
222dnl checks for utmpx functions
223AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
224AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100225
Damien Miller5fc85652000-07-09 23:53:07 +1000226AC_CHECK_FUNC(getuserattr,
227 [AC_DEFINE(HAVE_GETUSERATTR)],
228 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
229)
230
Damien Miller04f80141999-11-19 15:32:34 +1100231AC_CHECK_FUNC(login,
232 [AC_DEFINE(HAVE_LOGIN)],
233 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
234)
235
236AC_CHECK_FUNC(daemon,
237 [AC_DEFINE(HAVE_DAEMON)],
238 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
239)
240
Damien Miller9fb07e42000-03-05 16:22:59 +1100241AC_CHECK_FUNC(getpagesize,
242 [AC_DEFINE(HAVE_GETPAGESIZE)],
243 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
244)
245
Damien Millercb170cb2000-07-01 16:52:55 +1000246# Check for broken snprintf
247if test "x$ac_cv_func_snprintf" = "xyes" ; then
248 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
249 AC_TRY_RUN(
250 [
251#include <stdio.h>
252int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
253 ],
254 [AC_MSG_RESULT(yes)],
255 [
256 AC_MSG_RESULT(no)
257 AC_DEFINE(BROKEN_SNPRINTF)
258 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
259 ]
260 )
261fi
262
Damien Miller7b22d652000-06-18 14:07:04 +1000263PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100264AC_ARG_WITH(pam,
265 [ --without-pam Disable PAM support ],
266 [
267 if test "x$withval" = "xno" ; then
268 no_pam=1
269 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000270 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100271 fi
272 ]
273)
Damien Milleredb82922000-06-20 13:25:52 +1000274if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100275 AC_CHECK_LIB(dl, dlopen, , )
276 LIBS="$LIBS -lpam"
277
Damien Miller0e65eed2000-05-17 22:16:05 +1000278 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000279
Damien Miller1f335fb2000-06-26 11:31:33 +1000280 disable_shadow=yes
281
Damien Miller7b22d652000-06-18 14:07:04 +1000282 PAM_MSG="yes"
283
Damien Millera22ba012000-03-02 23:09:20 +1100284 # Check PAM strerror arguments (old PAM)
285 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
286 AC_TRY_COMPILE(
287 [
Damien Miller81171112000-04-23 11:14:01 +1000288#include <stdlib.h>
289#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100290 ],
291 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
292 [AC_MSG_RESULT(no)],
293 [
294 AC_DEFINE(HAVE_OLD_PAM)
295 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000296 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100297 ]
298 )
299fi
300
301# The big search for OpenSSL
302AC_ARG_WITH(ssl-dir,
303 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
304 [
305 if test "x$withval" != "$xno" ; then
306 tryssldir=$withval
307 fi
308 ]
309)
310
311saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100312saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100313saved_CFLAGS="$CFLAGS"
314if test "x$prefix" != "xNONE" ; then
315 tryssldir="$tryssldir $prefix"
316fi
Damien Miller61e50f12000-05-08 20:49:37 +1000317AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100318
Damien Miller61e50f12000-05-08 20:49:37 +1000319 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
320 if test ! -z "$ssldir" ; then
321 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
322 CFLAGS="$saved_CFLAGS -I$ssldir/include"
323 if test ! -z "$need_dash_r" ; then
324 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
325 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100326 else
Damien Miller61e50f12000-05-08 20:49:37 +1000327 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100328 fi
329
Damien Miller3b512e12000-05-17 23:29:18 +1000330 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000331
Damien Miller3b512e12000-05-17 23:29:18 +1000332 # Basic test to check for compatible version and correct linking
333 # *does not* test for RSA - that comes later.
334 AC_TRY_RUN(
335 [
Damien Millere59ce622000-05-01 20:54:17 +1000336#include <string.h>
337#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000338int main(void)
339{
Damien Miller3b512e12000-05-17 23:29:18 +1000340 char a[2048];
341 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000342 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000343 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000344}
Damien Miller3b512e12000-05-17 23:29:18 +1000345 ],
346 [
347 found_crypto=1
348 break;
349 ], []
350 )
Damien Miller61e50f12000-05-08 20:49:37 +1000351
352 if test ! -z "$found_crypto" ; then
353 break;
354 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100355 done
356
Damien Miller61e50f12000-05-08 20:49:37 +1000357 if test -z "$found_crypto" ; then
358 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100359 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000360 if test -z "$ssldir" ; then
361 ssldir="(system)"
362 fi
Damien Millera22ba012000-03-02 23:09:20 +1100363
Damien Miller61e50f12000-05-08 20:49:37 +1000364 ac_cv_openssldir=$ssldir
365])
366
Damien Milleredb82922000-06-20 13:25:52 +1000367if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000368 AC_DEFINE(HAVE_OPENSSL)
369 dnl Need to recover ssldir - test above runs in subshell
370 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100371 CFLAGS="$saved_CFLAGS -I$ssldir/include"
372 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
373 if test ! -z "$need_dash_r" ; then
374 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100375 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100376 if test ! -z "$blibpath" ; then
377 blibpath="$blibpath:$ssldir:$ssldir/lib"
378 fi
Damien Millera22ba012000-03-02 23:09:20 +1100379fi
Damien Miller3b512e12000-05-17 23:29:18 +1000380LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000381
Damien Miller3b512e12000-05-17 23:29:18 +1000382# Now test RSA support
383saved_LIBS="$LIBS"
384AC_MSG_CHECKING([for RSA support])
385for WANTS_RSAREF in "" 1 ; do
386 if test -z "$WANTS_RSAREF" ; then
387 LIBS="$saved_LIBS"
388 else
389 LIBS="$saved_LIBS -lRSAglue -lrsaref"
390 fi
391 AC_TRY_RUN([
392#include <string.h>
393#include <openssl/rand.h>
394#include <openssl/rsa.h>
395#include <openssl/bn.h>
396#include <openssl/sha.h>
397int main(void)
398{
399 int num; RSA *key; static unsigned char p_in[] = "blahblah";
400 unsigned char c[256], p[256];
401 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
402 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
403 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
404 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
405}
406 ],
407 [
408 rsa_works=1
409 break;
410 ], [])
411done
412
413if test ! -z "$no_rsa" ; then
414 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000415 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000416else
417 if test -z "$rsa_works" ; then
418 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000419 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000420 else
421 if test -z "$WANTS_RSAREF" ; then
422 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000423 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000424 else
Damien Miller7b22d652000-06-18 14:07:04 +1000425 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000426 AC_MSG_RESULT(using RSAref)
427 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
428 fi
429 fi
430fi
Damien Millera22ba012000-03-02 23:09:20 +1100431
432# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100433AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100434AC_CHECK_SIZEOF(short int, 2)
435AC_CHECK_SIZEOF(int, 4)
436AC_CHECK_SIZEOF(long int, 4)
437AC_CHECK_SIZEOF(long long int, 8)
438
Damien Millera22ba012000-03-02 23:09:20 +1100439# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000440AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
441 AC_TRY_COMPILE(
442 [ #include <sys/types.h> ],
443 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
444 [ ac_cv_have_intxx_t="yes" ],
445 [ ac_cv_have_intxx_t="no" ]
446 )
447])
448if test "x$ac_cv_have_intxx_t" = "xyes" ; then
449 AC_DEFINE(HAVE_INTXX_T)
450 have_intxx_t=1
451fi
452
453AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
454 AC_TRY_COMPILE(
455 [ #include <sys/types.h> ],
456 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
457 [ ac_cv_have_u_intxx_t="yes" ],
458 [ ac_cv_have_u_intxx_t="no" ]
459 )
460])
461if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
462 AC_DEFINE(HAVE_U_INTXX_T)
463 have_u_intxx_t=1
464fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100465
Damien Millerc6398ef1999-11-20 12:18:40 +1100466
Damien Milleredb82922000-06-20 13:25:52 +1000467if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
468 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100469then
470 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
471 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000472 [
473#include <sys/bitypes.h>
474 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100475 [
Damien Miller70494d12000-04-03 15:57:06 +1000476 int8_t a; int16_t b; int32_t c;
477 u_int8_t e; u_int16_t f; u_int32_t g;
478 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100479 ],
480 [
481 AC_DEFINE(HAVE_U_INTXX_T)
482 AC_DEFINE(HAVE_INTXX_T)
483 AC_MSG_RESULT(yes)
484 ],
485 [AC_MSG_RESULT(no)]
486 )
487fi
488
Damien Millerd6121d22000-03-17 23:26:46 +1100489if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000490 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
491 AC_TRY_COMPILE(
492 [
493#include <sys/types.h>
494 ],
495 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
496 [ ac_cv_have_uintxx_t="yes" ],
497 [ ac_cv_have_uintxx_t="no" ]
498 )
499 ])
500 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
501 AC_DEFINE(HAVE_UINTXX_T)
502 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100503fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100504
Damien Miller61e50f12000-05-08 20:49:37 +1000505AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
506 AC_TRY_COMPILE(
507 [
Damien Miller81171112000-04-23 11:14:01 +1000508#include <sys/types.h>
509#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000510 ],
511 [socklen_t foo; foo = 1235;],
512 [ ac_cv_have_socklen_t="yes" ],
513 [ ac_cv_have_socklen_t="no" ]
514 )
515])
516if test "x$ac_cv_have_socklen_t" = "xyes" ; then
517 AC_DEFINE(HAVE_SOCKLEN_T)
518fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100519
Damien Miller61e50f12000-05-08 20:49:37 +1000520AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
521 AC_TRY_COMPILE(
522 [
523#include <sys/types.h>
524 ],
525 [ size_t foo; foo = 1235; ],
526 [ ac_cv_have_size_t="yes" ],
527 [ ac_cv_have_size_t="no" ]
528 )
529])
530if test "x$ac_cv_have_size_t" = "xyes" ; then
531 AC_DEFINE(HAVE_SIZE_T)
532fi
Damien Miller95058511999-12-29 10:36:45 +1100533
Damien Miller615f9392000-05-17 22:53:33 +1000534AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
535 AC_TRY_COMPILE(
536 [
537#include <sys/types.h>
538 ],
539 [ ssize_t foo; foo = 1235; ],
540 [ ac_cv_have_ssize_t="yes" ],
541 [ ac_cv_have_ssize_t="no" ]
542 )
543])
544if test "x$ac_cv_have_ssize_t" = "xyes" ; then
545 AC_DEFINE(HAVE_SSIZE_T)
546fi
547
Damien Millerb54b40e2000-06-23 08:23:34 +1000548AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
549 AC_TRY_COMPILE(
550 [
551#include <sys/types.h>
552#include <sys/socket.h>
553 ],
554 [ sa_family_t foo; foo = 1235; ],
555 [ ac_cv_have_sa_family_t="yes" ],
556 [ ac_cv_have_sa_family_t="no" ]
557 )
558])
559if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
560 AC_DEFINE(HAVE_SA_FAMILY_T)
561fi
562
Damien Miller0f91b4e2000-06-18 15:43:25 +1000563AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
564 AC_TRY_COMPILE(
565 [
566#include <sys/types.h>
567 ],
568 [ pid_t foo; foo = 1235; ],
569 [ ac_cv_have_pid_t="yes" ],
570 [ ac_cv_have_pid_t="no" ]
571 )
572])
573if test "x$ac_cv_have_pid_t" = "xyes" ; then
574 AC_DEFINE(HAVE_PID_T)
575fi
576
577AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
578 AC_TRY_COMPILE(
579 [
580#include <sys/types.h>
581 ],
582 [ mode_t foo; foo = 1235; ],
583 [ ac_cv_have_mode_t="yes" ],
584 [ ac_cv_have_mode_t="no" ]
585 )
586])
587if test "x$ac_cv_have_mode_t" = "xyes" ; then
588 AC_DEFINE(HAVE_MODE_T)
589fi
590
Damien Miller61e50f12000-05-08 20:49:37 +1000591
592AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
593 AC_TRY_COMPILE(
594 [
Damien Miller81171112000-04-23 11:14:01 +1000595#include <sys/types.h>
596#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000597 ],
598 [ struct sockaddr_storage s; ],
599 [ ac_cv_have_struct_sockaddr_storage="yes" ],
600 [ ac_cv_have_struct_sockaddr_storage="no" ]
601 )
602])
603if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
604 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
605fi
Damien Miller34132e52000-01-14 15:45:46 +1100606
Damien Miller61e50f12000-05-08 20:49:37 +1000607AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
608 AC_TRY_COMPILE(
609 [
Damien Miller7b22d652000-06-18 14:07:04 +1000610#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000611#include <netinet/in.h>
612 ],
613 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
614 [ ac_cv_have_struct_sockaddr_in6="yes" ],
615 [ ac_cv_have_struct_sockaddr_in6="no" ]
616 )
617])
618if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
619 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
620fi
Damien Miller34132e52000-01-14 15:45:46 +1100621
Damien Miller61e50f12000-05-08 20:49:37 +1000622AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
623 AC_TRY_COMPILE(
624 [
Damien Miller7b22d652000-06-18 14:07:04 +1000625#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000626#include <netinet/in.h>
627 ],
628 [ struct in6_addr s; s.s6_addr[0] = 0; ],
629 [ ac_cv_have_struct_in6_addr="yes" ],
630 [ ac_cv_have_struct_in6_addr="no" ]
631 )
632])
633if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
634 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
635fi
Damien Miller34132e52000-01-14 15:45:46 +1100636
Damien Miller61e50f12000-05-08 20:49:37 +1000637AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
638 AC_TRY_COMPILE(
639 [
Damien Miller81171112000-04-23 11:14:01 +1000640#include <sys/types.h>
641#include <sys/socket.h>
642#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000643 ],
644 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
645 [ ac_cv_have_struct_addrinfo="yes" ],
646 [ ac_cv_have_struct_addrinfo="no" ]
647 )
648])
649if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
650 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
651fi
652
Damien Miller34132e52000-01-14 15:45:46 +1100653
Damien Millera22ba012000-03-02 23:09:20 +1100654# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100655
Damien Miller61e50f12000-05-08 20:49:37 +1000656OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
657OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
658OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
659OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
660OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000661OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000662OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
663OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000664OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000665OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
666OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
667OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
668OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000669OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
670OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
671OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
672OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
673
Damien Miller61e50f12000-05-08 20:49:37 +1000674AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
675 ac_cv_have_ss_family_in_struct_ss, [
676 AC_TRY_COMPILE(
677 [
Damien Miller81171112000-04-23 11:14:01 +1000678#include <sys/types.h>
679#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000680 ],
681 [ struct sockaddr_storage s; s.ss_family = 1; ],
682 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
683 [ ac_cv_have_ss_family_in_struct_ss="no" ],
684 )
685])
686if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
687 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
688fi
689
Damien Miller61e50f12000-05-08 20:49:37 +1000690AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
691 ac_cv_have___ss_family_in_struct_ss, [
692 AC_TRY_COMPILE(
693 [
Damien Miller81171112000-04-23 11:14:01 +1000694#include <sys/types.h>
695#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000696 ],
697 [ struct sockaddr_storage s; s.__ss_family = 1; ],
698 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
699 [ ac_cv_have___ss_family_in_struct_ss="no" ]
700 )
701])
702if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
703 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
704fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100705
Damien Miller61e50f12000-05-08 20:49:37 +1000706
707AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
708 AC_TRY_LINK([],
709 [ extern char *__progname; printf("%s", __progname); ],
710 [ ac_cv_libc_defines___progname="yes" ],
711 [ ac_cv_libc_defines___progname="no" ]
712 )
713])
714if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
715 AC_DEFINE(HAVE___PROGNAME)
716fi
717
Damien Millera22ba012000-03-02 23:09:20 +1100718
719# Looking for programs, paths and files
720AC_ARG_WITH(rsh,
721 [ --with-rsh=PATH Specify path to remote shell program ],
722 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100723 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000724 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100725 fi
726 ],
727 [
728 AC_PATH_PROG(rsh_path, rsh)
729 ]
730)
731
732AC_ARG_WITH(xauth,
733 [ --with-xauth=PATH Specify path to xauth program ],
734 [
735 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000736 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100737 fi
738 ],
739 [
740 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000741 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100742 xauth_path="/usr/openwin/bin/xauth"
743 fi
744 ]
745)
746
747if test ! -z "$xauth_path" ; then
748 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
749fi
750if test ! -z "$rsh_path" ; then
751 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
752fi
753
754# Check for mail directory (last resort if we cannot get it from headers)
755if test ! -z "$MAIL" ; then
756 maildir=`dirname $MAIL`
757 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
758fi
759
Damien Millera22ba012000-03-02 23:09:20 +1100760if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100761 AC_CHECK_FILE("/dev/ptmx",
762 [
763 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
764 have_dev_ptmx=1
765 ]
766 )
Damien Millera22ba012000-03-02 23:09:20 +1100767fi
Damien Miller204ad072000-03-02 23:56:12 +1100768AC_CHECK_FILE("/dev/ptc",
769 [
770 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
771 have_dev_ptc=1
772 ]
773)
774
Damien Millera22ba012000-03-02 23:09:20 +1100775# Options from here on. Some of these are preset by platform above
776
Damien Millera22ba012000-03-02 23:09:20 +1100777# Check for user-specified random device, otherwise check /dev/urandom
778AC_ARG_WITH(random,
779 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
780 [
Damien Miller040f3832000-04-03 14:50:43 +1000781 if test "x$withval" != "xno" ; then
782 RANDOM_POOL="$withval";
783 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
784 fi
Damien Millera22ba012000-03-02 23:09:20 +1100785 ],
786 [
787 # Check for random device
788 AC_CHECK_FILE("/dev/urandom",
789 [
790 RANDOM_POOL="/dev/urandom";
791 AC_SUBST(RANDOM_POOL)
792 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
793 ]
794 )
795 ]
796)
797
798# Check for EGD pool file
799AC_ARG_WITH(egd-pool,
800 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
801 [
Damien Miller040f3832000-04-03 14:50:43 +1000802 if test "x$withval" != "xno" ; then
803 EGD_SOCKET="$withval";
804 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
805 fi
Damien Millera22ba012000-03-02 23:09:20 +1100806 ]
807)
808
Damien Miller0437b332000-05-02 09:56:41 +1000809# detect pathnames for entropy gathering commands, if we need them
810INSTALL_SSH_PRNG_CMDS=""
811rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000812if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000813 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000814 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
815 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
816 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
817 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
818 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
819 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
820 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
821 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
822 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
823 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
824 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
825 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
826 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
827 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
828 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000829
830 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000831fi
Damien Miller0437b332000-05-02 09:56:41 +1000832AC_SUBST(INSTALL_SSH_PRNG_CMDS)
833
Damien Miller11e37f62000-04-08 18:23:30 +1000834
Damien Miller670a4b82000-01-22 13:53:11 +1100835AC_ARG_WITH(catman,
836 [ --with-catman=man|cat Install preformatted manpages[no]],
837 [
838 MANTYPE='$(CATMAN)'
839 if test x"$withval" != x"yes" ; then
840 mansubdir=$withval
841 else
842 mansubdir=cat
843 fi
844 ], [
845 if test -z "$MANTYPE" ; then
846 MANTYPE='$(TROFFMAN)'
847 mansubdir=man
848 fi
849 ]
850)
851AC_SUBST(MANTYPE)
852AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100853
Damien Millera22ba012000-03-02 23:09:20 +1100854# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000855KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100856AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100857 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100858 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100859 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100860
861 if test "x$withval" != "$xyes" ; then
862 CFLAGS="$CFLAGS -I${withval}/include"
863 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100864 if test ! -z "$need_dash_r" ; then
865 LDFLAGS="$LDFLAGS -R${withval}/lib"
866 fi
867 if test ! -z "$blibpath" ; then
868 blibpath="$blibpath:${withval}/lib"
869 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100870 else
871 if test -d /usr/include/kerberosIV ; then
872 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
873 fi
874 fi
875
876 AC_CHECK_HEADERS(krb.h)
877 AC_CHECK_LIB(krb, main)
878 if test "$ac_cv_header_krb_h" != yes; then
879 AC_MSG_WARN([Cannot find krb.h, build may fail])
880 fi
881 if test "$ac_cv_lib_krb_main" != yes; then
882 AC_MSG_WARN([Cannot find libkrb, build may fail])
883 fi
884
Damien Millerc85f9b42000-01-29 10:20:21 +1100885 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100886 AC_CHECK_LIB(resolv, dn_expand, , )
887 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000888 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100889 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100890 fi
Damien Miller80297751999-11-19 13:03:25 +1100891 ]
892)
893
Damien Millera22ba012000-03-02 23:09:20 +1100894# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000895AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100896AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100897 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100898 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100899 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100900
901 if test "x$withval" != "$xyes" ; then
902 CFLAGS="$CFLAGS -I${withval}/include"
903 LFLAGS="$LFLAGS -L${withval}/lib"
904 fi
905
906 if test -z "$KRB4" ; then
907 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
908 fi
909
Damien Miller8bdeee21999-12-30 15:50:54 +1100910 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100911 if test ! -z "$AFS_LIBS" ; then
912 LIBS="$LIBS $AFS_LIBS"
913 fi
914 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000915 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100916 fi
Damien Miller80297751999-11-19 13:03:25 +1100917 ]
918)
Damien Millerc85f9b42000-01-29 10:20:21 +1100919LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100920
Damien Millera22ba012000-03-02 23:09:20 +1100921# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000922SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100923AC_ARG_WITH(skey,
924 [ --with-skey Enable S/Key support],
925 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100926 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100927 AC_DEFINE(SKEY)
928 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000929 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100930 fi
Damien Miller80297751999-11-19 13:03:25 +1100931 ]
932)
933
Damien Millera22ba012000-03-02 23:09:20 +1100934# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000935TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100936AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100937 [ --with-tcp-wrappers Enable tcpwrappers support],
938 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100939 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100940 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100941 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100942 AC_MSG_CHECKING(for libwrap)
943 AC_TRY_LINK(
944 [
Damien Miller81171112000-04-23 11:14:01 +1000945#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100946 int deny_severity = 0, allow_severity = 0;
947 ],
948 [hosts_access(0);],
949 [
950 AC_MSG_RESULT(yes)
951 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +1000952 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +1100953 ],
954 [
Damien Miller7b22d652000-06-18 14:07:04 +1000955 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +1100956 ]
957 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100958 fi
Damien Miller80297751999-11-19 13:03:25 +1100959 ]
960)
961
Damien Millera22ba012000-03-02 23:09:20 +1100962# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +1000963MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100964AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100965 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100966 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100967 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100968 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +1000969 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100970 fi
971 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100972)
973
Damien Millera22ba012000-03-02 23:09:20 +1100974# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +1100975AC_ARG_WITH(shadow,
976 [ --without-shadow Disable shadow password support],
977 [
978 if test "x$withval" = "xno" ; then
979 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +1000980 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +1100981 fi
982 ]
983)
984
Damien Miller1f335fb2000-06-26 11:31:33 +1000985if test -z "$disable_shadow" ; then
986 AC_MSG_CHECKING([if the systems has expire shadow information])
987 AC_TRY_COMPILE(
988 [
989#include <sys/types.h>
990#include <shadow.h>
991 struct spwd sp;
992 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
993 [ sp_expire_available=yes ], []
994 )
995
996 if test "x$sp_expire_available" = "xyes" ; then
997 AC_MSG_RESULT(yes)
998 AC_DEFINE(HAS_SHADOW_EXPIRE)
999 else
1000 AC_MSG_RESULT(no)
1001 fi
1002fi
1003
Damien Millera22ba012000-03-02 23:09:20 +11001004# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001005DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001006AC_ARG_WITH(ipaddr-display,
1007 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1008 [
Damien Miller66409952000-01-17 21:40:06 +11001009 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001010 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001011 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001012 fi
1013 ]
1014)
1015
Damien Millera22ba012000-03-02 23:09:20 +11001016# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001017SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001018AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001019 [ --with-default-path=PATH Specify default \$PATH environment for server],
1020 [
1021 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001022 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001023 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001024 fi
1025 ]
1026)
1027
Damien Millera22ba012000-03-02 23:09:20 +11001028# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001029IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001030AC_ARG_WITH(ipv4-default,
1031 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1032 [
1033 if test "x$withval" != "xno" ; then
1034 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001035 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001036 fi
1037 ]
1038)
1039
Damien Miller61e50f12000-05-08 20:49:37 +10001040AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001041IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001042AC_ARG_WITH(4in6,
1043 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1044 [
1045 if test "x$withval" != "xno" ; then
1046 AC_MSG_RESULT(yes)
1047 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001048 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001049 else
1050 AC_MSG_RESULT(no)
1051 fi
1052 ],[
1053 if test "x$inet6_default_4in6" = "xyes"; then
1054 AC_MSG_RESULT([yes (default)])
1055 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001056 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001057 else
1058 AC_MSG_RESULT([no (default)])
1059 fi
1060 ]
1061)
1062
Damien Millera22ba012000-03-02 23:09:20 +11001063# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001064piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001065AC_ARG_WITH(pid-dir,
1066 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1067 [
1068 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001069 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001070 fi
1071 ]
1072)
Damien Miller4018c192000-04-30 09:30:44 +10001073
Damien Millerdbd250f2000-01-18 08:57:14 +11001074AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001075AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001076
andre2ff7b5d2000-06-03 14:57:40 +00001077dnl allow user to disable some login recording features
1078AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001079 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001080 [ AC_DEFINE(DISABLE_LASTLOG) ]
1081)
1082AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001083 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001084 [ AC_DEFINE(DISABLE_UTMP) ]
1085)
1086AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001087 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001088 [ AC_DEFINE(DISABLE_UTMPX) ]
1089)
1090AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001091 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001092 [ AC_DEFINE(DISABLE_WTMP) ]
1093)
1094AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001095 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001096 [ AC_DEFINE(DISABLE_WTMPX) ]
1097)
1098AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001099 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001100 [ AC_DEFINE(DISABLE_LOGIN) ]
1101)
1102AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001103 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001104 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1105)
1106AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001107 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001108 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1109)
1110AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001111 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001112 [ conf_lastlog_location="$withval"; ],)
1113
1114dnl lastlog, [uw]tmpx? detection
1115dnl NOTE: set the paths in the platform section to avoid the
1116dnl need for command-line parameters
1117dnl lastlog and [uw]tmp are subject to a file search if all else fails
1118
1119dnl lastlog detection
1120dnl NOTE: the code itself will detect if lastlog is a directory
1121AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1122AC_TRY_COMPILE([
1123#include <sys/types.h>
1124#include <utmp.h>
1125#ifdef HAVE_LASTLOG_H
1126# include <lastlog.h>
1127#endif
Damien Miller2994e082000-06-04 15:51:47 +10001128#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001129# include <paths.h>
1130#endif
1131 ],
1132 [ char *lastlog = LASTLOG_FILE; ],
1133 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001134 [
1135 AC_MSG_RESULT(no)
1136 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1137 AC_TRY_COMPILE([
1138#include <sys/types.h>
1139#include <utmp.h>
1140#ifdef HAVE_LASTLOG_H
1141# include <lastlog.h>
1142#endif
1143#ifdef HAVE_PATHS_H
1144# include <paths.h>
1145#endif
1146 ],
1147 [ char *lastlog = _PATH_LASTLOG; ],
1148 [ AC_MSG_RESULT(yes) ],
1149 [
andree441aa32000-06-12 22:34:38 +00001150 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001151 system_lastlog_path=no
1152 ])
1153 ]
andre2ff7b5d2000-06-03 14:57:40 +00001154)
Damien Miller2994e082000-06-04 15:51:47 +10001155
andre2ff7b5d2000-06-03 14:57:40 +00001156if test -z "$conf_lastlog_location"; then
1157 if test x"$system_lastlog_path" = x"no" ; then
1158 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001159 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001160 conf_lastlog_location=$f
1161 fi
1162 done
1163 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001164 AC_MSG_WARN([** Cannot find lastlog **])
1165 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001166 fi
1167 fi
1168fi
1169
1170if test -n "$conf_lastlog_location"; then
1171 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1172fi
1173
1174dnl utmp detection
1175AC_MSG_CHECKING([if your system defines UTMP_FILE])
1176AC_TRY_COMPILE([
1177#include <sys/types.h>
1178#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001179#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001180# include <paths.h>
1181#endif
1182 ],
1183 [ char *utmp = UTMP_FILE; ],
1184 [ AC_MSG_RESULT(yes) ],
1185 [ AC_MSG_RESULT(no)
1186 system_utmp_path=no ]
1187)
1188if test -z "$conf_utmp_location"; then
1189 if test x"$system_utmp_path" = x"no" ; then
1190 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1191 if test -f $f ; then
1192 conf_utmp_location=$f
1193 fi
1194 done
1195 if test -z "$conf_utmp_location"; then
1196 AC_DEFINE(DISABLE_UTMP)
1197 fi
1198 fi
1199fi
1200if test -n "$conf_utmp_location"; then
1201 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1202fi
1203
1204dnl wtmp detection
1205AC_MSG_CHECKING([if your system defines WTMP_FILE])
1206AC_TRY_COMPILE([
1207#include <sys/types.h>
1208#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001209#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001210# include <paths.h>
1211#endif
1212 ],
1213 [ char *wtmp = WTMP_FILE; ],
1214 [ AC_MSG_RESULT(yes) ],
1215 [ AC_MSG_RESULT(no)
1216 system_wtmp_path=no ]
1217)
1218if test -z "$conf_wtmp_location"; then
1219 if test x"$system_wtmp_path" = x"no" ; then
1220 for f in /usr/adm/wtmp /var/log/wtmp; do
1221 if test -f $f ; then
1222 conf_wtmp_location=$f
1223 fi
1224 done
1225 if test -z "$conf_wtmp_location"; then
1226 AC_DEFINE(DISABLE_WTMP)
1227 fi
1228 fi
1229fi
1230if test -n "$conf_wtmp_location"; then
1231 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1232fi
1233
1234
1235dnl utmpx detection - I don't know any system so perverse as to require
1236dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1237dnl there, though.
1238AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1239AC_TRY_COMPILE([
1240#include <sys/types.h>
1241#include <utmp.h>
1242#ifdef HAVE_UTMPX_H
1243#include <utmpx.h>
1244#endif
Damien Miller2994e082000-06-04 15:51:47 +10001245#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001246# include <paths.h>
1247#endif
1248 ],
1249 [ char *utmpx = UTMPX_FILE; ],
1250 [ AC_MSG_RESULT(yes) ],
1251 [ AC_MSG_RESULT(no)
1252 system_utmpx_path=no ]
1253)
1254if test -z "$conf_utmpx_location"; then
1255 if test x"$system_utmpx_path" = x"no" ; then
1256 AC_DEFINE(DISABLE_UTMPX)
1257 fi
1258else
1259 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1260fi
1261
1262dnl wtmpx detection
1263AC_MSG_CHECKING([if your system defines WTMPX_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 *wtmpx = WTMPX_FILE; ],
1275 [ AC_MSG_RESULT(yes) ],
1276 [ AC_MSG_RESULT(no)
1277 system_wtmpx_path=no ]
1278)
1279if test -z "$conf_wtmpx_location"; then
1280 if test x"$system_wtmpx_path" = x"no" ; then
1281 AC_DEFINE(DISABLE_WTMPX)
1282 fi
1283else
1284 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1285fi
1286
Damien Miller4018c192000-04-30 09:30:44 +10001287
1288# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001289entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001290AC_ARG_WITH(entropy-timeout,
1291 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1292 [
1293 if test "x$withval" != "xno" ; then
1294 entropy_timeout=$withval
1295 fi
1296 ]
1297)
1298AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1299
1300
Damien Miller29ea30d2000-03-17 10:54:15 +11001301if test ! -z "$blibpath" ; then
1302 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1303 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1304fi
1305
Damien Miller0437b332000-05-02 09:56:41 +10001306AC_OUTPUT(Makefile ssh_prng_cmds)
1307
Damien Miller7b22d652000-06-18 14:07:04 +10001308# Print summary of options
1309
1310if test x$MANTYPE = x'$(CATMAN)' ; then
1311 MAN_MSG=cat
1312else
1313 MAN_MSG=man
1314fi
1315if test ! -z "$RANDOM_POOL" ; then
1316 RAND_MSG="Device ($RANDOM_POOL)"
1317else
1318 if test ! -z "$EGD_SOCKET" ; then
1319 RAND_MSG="EGD ($EGD_SOCKET)"
1320 else
1321 RAND_MSG="Builtin (timeout $entropy_timeout)"
1322 fi
1323fi
1324
1325# Someone please show me a better way :)
1326A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1327B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1328C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1329D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1330E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1331F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1332G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1333
1334echo ""
1335echo "OpenSSH configured has been configured with the following options."
1336echo " User binaries: $B"
1337echo " System binaries: $C"
1338echo " Configuration files: $D"
1339echo " Askpass program: $E"
1340echo " Manual pages: $F"
1341echo " PID file: $G"
1342echo " Random number collection: $RAND_MSG"
1343echo " Manpage format: $MAN_MSG"
1344echo " PAM support: ${PAM_MSG}"
1345echo " KerberosIV support: $KRB4_MSG"
1346echo " AFS support: $AFS_MSG"
1347echo " S/KEY support: $SKEY_MSG"
1348echo " TCP Wrappers support: $TCPW_MSG"
1349echo " MD5 password support: $MD5_MSG"
1350echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1351echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1352echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1353
1354echo ""
1355
1356echo "Compiler flags: ${CFLAGS}"
1357echo "Linker flags: ${LDFLAGS}"
1358echo "Libraries: ${LIBS}"
1359
1360echo ""
1361