blob: 92659857c647c91286d09c32ba2db294581e5ce9 [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 Miller2ae714f2000-07-11 09:29:50 +1000141*-sni-sysv*)
142 CFLAGS="$CFLAGS -I/usr/local/include"
143 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
144 MANTYPE='$(CATMAN)'
145 AC_DEFINE(IP_TOS_IS_BROKEN)
146 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000147 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000148 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100149*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100150 CFLAGS="$CFLAGS -I/usr/local/include"
151 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100152 MANTYPE='$(CATMAN)'
153 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100154 LIBS="$LIBS -lgen -lsocket"
155 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000156*-*-sco3*)
157 CFLAGS="$CFLAGS -I/usr/local/include"
158 LDFLAGS="$LDFLAGS -L/usr/local/lib"
159 MANTYPE='$(CATMAN)'
160 mansubdir=cat
161 LIBS="$LIBS -lgen -lsocket"
162 no_dev_ptmx=1
163 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000164*-dec-osf*)
165# This is untested
166 if test ! -z "USE_SIA" ; then
167 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
168 if test -f /etc/sia/matrix.conf; then
169 AC_MSG_RESULT(yes)
170 AC_DEFINE(HAVE_OSF_SIA)
171 AC_DEFINE(DISABLE_LOGIN)
172 LIBS="$LIBS -lsecurity -ldb -lm -laud"
173 else
174 AC_MSG_RESULT(no)
175 fi
176 fi
177 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100178esac
179
Damien Millere37bfc12000-06-05 09:37:43 +1000180# Allow user to specify flags
181AC_ARG_WITH(cflags,
182 [ --with-cflags Specify additional flags to pass to compiler],
183 [
184 if test "x$withval" != "xno" ; then
185 CFLAGS="$CFLAGS $withval"
186 fi
187 ]
188)
189AC_ARG_WITH(ldflags,
190 [ --with-ldlags Specify additional flags to pass to linker],
191 [
192 if test "x$withval" != "xno" ; then
193 LDFLAGS="$LDFLAGS $withval"
194 fi
195 ]
196)
197AC_ARG_WITH(libs,
198 [ --with-libs Specify additional libraries to link with],
199 [
200 if test "x$withval" != "xno" ; then
201 LIBS="$LIBS $withval"
202 fi
203 ]
204)
205
206
Damien Millera22ba012000-03-02 23:09:20 +1100207# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100208AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
209AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100210
Damien Millerbeb4ba51999-12-28 15:09:35 +1100211if test -z "$no_libsocket" ; then
212 AC_CHECK_LIB(nsl, yp_match, , )
213fi
214if test -z "$no_libnsl" ; then
215 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100216fi
Damien Millerab18c411999-11-11 10:40:23 +1100217
Damien Millera22ba012000-03-02 23:09:20 +1100218# Checks for header files.
Damien Millerecbb26d2000-07-15 14:59:14 +1000219AC_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 +1100220
Damien Millera22ba012000-03-02 23:09:20 +1100221# Checks for library functions.
Damien Millerecbb26d2000-07-15 14:59:14 +1000222AC_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 +0000223dnl checks for time functions
224AC_CHECK_FUNCS(gettimeofday time)
225dnl checks for libutil functions
226AC_CHECK_FUNCS(login logout updwtmp logwtmp)
227dnl checks for utmp functions
228AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
229AC_CHECK_FUNCS(utmpname)
230dnl checks for utmpx functions
231AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
232AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100233
Damien Miller5fc85652000-07-09 23:53:07 +1000234AC_CHECK_FUNC(getuserattr,
235 [AC_DEFINE(HAVE_GETUSERATTR)],
236 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
237)
238
Damien Miller04f80141999-11-19 15:32:34 +1100239AC_CHECK_FUNC(login,
240 [AC_DEFINE(HAVE_LOGIN)],
241 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
242)
243
244AC_CHECK_FUNC(daemon,
245 [AC_DEFINE(HAVE_DAEMON)],
246 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
247)
248
Damien Miller9fb07e42000-03-05 16:22:59 +1100249AC_CHECK_FUNC(getpagesize,
250 [AC_DEFINE(HAVE_GETPAGESIZE)],
251 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
252)
253
Damien Millercb170cb2000-07-01 16:52:55 +1000254# Check for broken snprintf
255if test "x$ac_cv_func_snprintf" = "xyes" ; then
256 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
257 AC_TRY_RUN(
258 [
259#include <stdio.h>
260int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
261 ],
262 [AC_MSG_RESULT(yes)],
263 [
264 AC_MSG_RESULT(no)
265 AC_DEFINE(BROKEN_SNPRINTF)
266 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
267 ]
268 )
269fi
270
Damien Miller7b22d652000-06-18 14:07:04 +1000271PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100272AC_ARG_WITH(pam,
273 [ --without-pam Disable PAM support ],
274 [
275 if test "x$withval" = "xno" ; then
276 no_pam=1
277 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000278 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100279 fi
280 ]
281)
Damien Milleredb82922000-06-20 13:25:52 +1000282if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100283 AC_CHECK_LIB(dl, dlopen, , )
284 LIBS="$LIBS -lpam"
285
Damien Miller0e65eed2000-05-17 22:16:05 +1000286 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000287
Damien Miller1f335fb2000-06-26 11:31:33 +1000288 disable_shadow=yes
289
Damien Miller7b22d652000-06-18 14:07:04 +1000290 PAM_MSG="yes"
291
Damien Millera22ba012000-03-02 23:09:20 +1100292 # Check PAM strerror arguments (old PAM)
293 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
294 AC_TRY_COMPILE(
295 [
Damien Miller81171112000-04-23 11:14:01 +1000296#include <stdlib.h>
297#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100298 ],
299 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
300 [AC_MSG_RESULT(no)],
301 [
302 AC_DEFINE(HAVE_OLD_PAM)
303 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000304 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100305 ]
306 )
307fi
308
309# The big search for OpenSSL
310AC_ARG_WITH(ssl-dir,
311 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
312 [
313 if test "x$withval" != "$xno" ; then
314 tryssldir=$withval
315 fi
316 ]
317)
318
319saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100320saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100321saved_CFLAGS="$CFLAGS"
322if test "x$prefix" != "xNONE" ; then
323 tryssldir="$tryssldir $prefix"
324fi
Damien Miller61e50f12000-05-08 20:49:37 +1000325AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100326
Damien Miller61e50f12000-05-08 20:49:37 +1000327 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
328 if test ! -z "$ssldir" ; then
329 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
330 CFLAGS="$saved_CFLAGS -I$ssldir/include"
331 if test ! -z "$need_dash_r" ; then
332 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
333 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100334 else
Damien Miller61e50f12000-05-08 20:49:37 +1000335 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100336 fi
337
Damien Miller3b512e12000-05-17 23:29:18 +1000338 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000339
Damien Miller3b512e12000-05-17 23:29:18 +1000340 # Basic test to check for compatible version and correct linking
341 # *does not* test for RSA - that comes later.
342 AC_TRY_RUN(
343 [
Damien Millere59ce622000-05-01 20:54:17 +1000344#include <string.h>
345#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000346int main(void)
347{
Damien Miller3b512e12000-05-17 23:29:18 +1000348 char a[2048];
349 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000350 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000351 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000352}
Damien Miller3b512e12000-05-17 23:29:18 +1000353 ],
354 [
355 found_crypto=1
356 break;
357 ], []
358 )
Damien Miller61e50f12000-05-08 20:49:37 +1000359
360 if test ! -z "$found_crypto" ; then
361 break;
362 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100363 done
364
Damien Miller61e50f12000-05-08 20:49:37 +1000365 if test -z "$found_crypto" ; then
366 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100367 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000368 if test -z "$ssldir" ; then
369 ssldir="(system)"
370 fi
Damien Millera22ba012000-03-02 23:09:20 +1100371
Damien Miller61e50f12000-05-08 20:49:37 +1000372 ac_cv_openssldir=$ssldir
373])
374
Damien Milleredb82922000-06-20 13:25:52 +1000375if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000376 AC_DEFINE(HAVE_OPENSSL)
377 dnl Need to recover ssldir - test above runs in subshell
378 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100379 CFLAGS="$saved_CFLAGS -I$ssldir/include"
380 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
381 if test ! -z "$need_dash_r" ; then
382 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100383 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100384 if test ! -z "$blibpath" ; then
385 blibpath="$blibpath:$ssldir:$ssldir/lib"
386 fi
Damien Millera22ba012000-03-02 23:09:20 +1100387fi
Damien Miller3b512e12000-05-17 23:29:18 +1000388LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000389
Damien Miller3b512e12000-05-17 23:29:18 +1000390# Now test RSA support
391saved_LIBS="$LIBS"
392AC_MSG_CHECKING([for RSA support])
393for WANTS_RSAREF in "" 1 ; do
394 if test -z "$WANTS_RSAREF" ; then
395 LIBS="$saved_LIBS"
396 else
397 LIBS="$saved_LIBS -lRSAglue -lrsaref"
398 fi
399 AC_TRY_RUN([
400#include <string.h>
401#include <openssl/rand.h>
402#include <openssl/rsa.h>
403#include <openssl/bn.h>
404#include <openssl/sha.h>
405int main(void)
406{
407 int num; RSA *key; static unsigned char p_in[] = "blahblah";
408 unsigned char c[256], p[256];
409 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
410 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
411 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
412 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
413}
414 ],
415 [
416 rsa_works=1
417 break;
418 ], [])
419done
420
421if test ! -z "$no_rsa" ; then
422 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000423 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000424else
425 if test -z "$rsa_works" ; then
426 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000427 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000428 else
429 if test -z "$WANTS_RSAREF" ; then
430 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000431 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000432 else
Damien Miller7b22d652000-06-18 14:07:04 +1000433 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000434 AC_MSG_RESULT(using RSAref)
435 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
436 fi
437 fi
438fi
Damien Millera22ba012000-03-02 23:09:20 +1100439
440# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100441AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100442AC_CHECK_SIZEOF(short int, 2)
443AC_CHECK_SIZEOF(int, 4)
444AC_CHECK_SIZEOF(long int, 4)
445AC_CHECK_SIZEOF(long long int, 8)
446
Damien Millera22ba012000-03-02 23:09:20 +1100447# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000448AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
449 AC_TRY_COMPILE(
450 [ #include <sys/types.h> ],
451 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
452 [ ac_cv_have_intxx_t="yes" ],
453 [ ac_cv_have_intxx_t="no" ]
454 )
455])
456if test "x$ac_cv_have_intxx_t" = "xyes" ; then
457 AC_DEFINE(HAVE_INTXX_T)
458 have_intxx_t=1
459fi
460
461AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
462 AC_TRY_COMPILE(
463 [ #include <sys/types.h> ],
464 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
465 [ ac_cv_have_u_intxx_t="yes" ],
466 [ ac_cv_have_u_intxx_t="no" ]
467 )
468])
469if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
470 AC_DEFINE(HAVE_U_INTXX_T)
471 have_u_intxx_t=1
472fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100473
Damien Millerc6398ef1999-11-20 12:18:40 +1100474
Damien Milleredb82922000-06-20 13:25:52 +1000475if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
476 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100477then
478 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
479 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000480 [
481#include <sys/bitypes.h>
482 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100483 [
Damien Miller70494d12000-04-03 15:57:06 +1000484 int8_t a; int16_t b; int32_t c;
485 u_int8_t e; u_int16_t f; u_int32_t g;
486 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100487 ],
488 [
489 AC_DEFINE(HAVE_U_INTXX_T)
490 AC_DEFINE(HAVE_INTXX_T)
491 AC_MSG_RESULT(yes)
492 ],
493 [AC_MSG_RESULT(no)]
494 )
495fi
496
Damien Millerd6121d22000-03-17 23:26:46 +1100497if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000498 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
499 AC_TRY_COMPILE(
500 [
501#include <sys/types.h>
502 ],
503 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
504 [ ac_cv_have_uintxx_t="yes" ],
505 [ ac_cv_have_uintxx_t="no" ]
506 )
507 ])
508 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
509 AC_DEFINE(HAVE_UINTXX_T)
510 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100511fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100512
Damien Miller61e50f12000-05-08 20:49:37 +1000513AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
514 AC_TRY_COMPILE(
515 [
Damien Miller81171112000-04-23 11:14:01 +1000516#include <sys/types.h>
517#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000518 ],
519 [socklen_t foo; foo = 1235;],
520 [ ac_cv_have_socklen_t="yes" ],
521 [ ac_cv_have_socklen_t="no" ]
522 )
523])
524if test "x$ac_cv_have_socklen_t" = "xyes" ; then
525 AC_DEFINE(HAVE_SOCKLEN_T)
526fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100527
Damien Miller61e50f12000-05-08 20:49:37 +1000528AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
529 AC_TRY_COMPILE(
530 [
531#include <sys/types.h>
532 ],
533 [ size_t foo; foo = 1235; ],
534 [ ac_cv_have_size_t="yes" ],
535 [ ac_cv_have_size_t="no" ]
536 )
537])
538if test "x$ac_cv_have_size_t" = "xyes" ; then
539 AC_DEFINE(HAVE_SIZE_T)
540fi
Damien Miller95058511999-12-29 10:36:45 +1100541
Damien Miller615f9392000-05-17 22:53:33 +1000542AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
543 AC_TRY_COMPILE(
544 [
545#include <sys/types.h>
546 ],
547 [ ssize_t foo; foo = 1235; ],
548 [ ac_cv_have_ssize_t="yes" ],
549 [ ac_cv_have_ssize_t="no" ]
550 )
551])
552if test "x$ac_cv_have_ssize_t" = "xyes" ; then
553 AC_DEFINE(HAVE_SSIZE_T)
554fi
555
Damien Millerb54b40e2000-06-23 08:23:34 +1000556AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
557 AC_TRY_COMPILE(
558 [
559#include <sys/types.h>
560#include <sys/socket.h>
561 ],
562 [ sa_family_t foo; foo = 1235; ],
563 [ ac_cv_have_sa_family_t="yes" ],
564 [ ac_cv_have_sa_family_t="no" ]
565 )
566])
567if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
568 AC_DEFINE(HAVE_SA_FAMILY_T)
569fi
570
Damien Miller0f91b4e2000-06-18 15:43:25 +1000571AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
572 AC_TRY_COMPILE(
573 [
574#include <sys/types.h>
575 ],
576 [ pid_t foo; foo = 1235; ],
577 [ ac_cv_have_pid_t="yes" ],
578 [ ac_cv_have_pid_t="no" ]
579 )
580])
581if test "x$ac_cv_have_pid_t" = "xyes" ; then
582 AC_DEFINE(HAVE_PID_T)
583fi
584
585AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
586 AC_TRY_COMPILE(
587 [
588#include <sys/types.h>
589 ],
590 [ mode_t foo; foo = 1235; ],
591 [ ac_cv_have_mode_t="yes" ],
592 [ ac_cv_have_mode_t="no" ]
593 )
594])
595if test "x$ac_cv_have_mode_t" = "xyes" ; then
596 AC_DEFINE(HAVE_MODE_T)
597fi
598
Damien Miller61e50f12000-05-08 20:49:37 +1000599
600AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
601 AC_TRY_COMPILE(
602 [
Damien Miller81171112000-04-23 11:14:01 +1000603#include <sys/types.h>
604#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000605 ],
606 [ struct sockaddr_storage s; ],
607 [ ac_cv_have_struct_sockaddr_storage="yes" ],
608 [ ac_cv_have_struct_sockaddr_storage="no" ]
609 )
610])
611if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
612 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
613fi
Damien Miller34132e52000-01-14 15:45:46 +1100614
Damien Miller61e50f12000-05-08 20:49:37 +1000615AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
616 AC_TRY_COMPILE(
617 [
Damien Miller7b22d652000-06-18 14:07:04 +1000618#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000619#include <netinet/in.h>
620 ],
621 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
622 [ ac_cv_have_struct_sockaddr_in6="yes" ],
623 [ ac_cv_have_struct_sockaddr_in6="no" ]
624 )
625])
626if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
627 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
628fi
Damien Miller34132e52000-01-14 15:45:46 +1100629
Damien Miller61e50f12000-05-08 20:49:37 +1000630AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
631 AC_TRY_COMPILE(
632 [
Damien Miller7b22d652000-06-18 14:07:04 +1000633#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000634#include <netinet/in.h>
635 ],
636 [ struct in6_addr s; s.s6_addr[0] = 0; ],
637 [ ac_cv_have_struct_in6_addr="yes" ],
638 [ ac_cv_have_struct_in6_addr="no" ]
639 )
640])
641if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
642 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
643fi
Damien Miller34132e52000-01-14 15:45:46 +1100644
Damien Miller61e50f12000-05-08 20:49:37 +1000645AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
646 AC_TRY_COMPILE(
647 [
Damien Miller81171112000-04-23 11:14:01 +1000648#include <sys/types.h>
649#include <sys/socket.h>
650#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000651 ],
652 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
653 [ ac_cv_have_struct_addrinfo="yes" ],
654 [ ac_cv_have_struct_addrinfo="no" ]
655 )
656])
657if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
658 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
659fi
660
Damien Miller34132e52000-01-14 15:45:46 +1100661
Damien Millera22ba012000-03-02 23:09:20 +1100662# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100663
Damien Miller61e50f12000-05-08 20:49:37 +1000664OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
665OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
666OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
667OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
668OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000669OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000670OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
671OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000672OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000673OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
674OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
675OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
676OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000677OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
678OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
679OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
680OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
681
Damien Miller61e50f12000-05-08 20:49:37 +1000682AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
683 ac_cv_have_ss_family_in_struct_ss, [
684 AC_TRY_COMPILE(
685 [
Damien Miller81171112000-04-23 11:14:01 +1000686#include <sys/types.h>
687#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000688 ],
689 [ struct sockaddr_storage s; s.ss_family = 1; ],
690 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
691 [ ac_cv_have_ss_family_in_struct_ss="no" ],
692 )
693])
694if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
695 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
696fi
697
Damien Miller61e50f12000-05-08 20:49:37 +1000698AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
699 ac_cv_have___ss_family_in_struct_ss, [
700 AC_TRY_COMPILE(
701 [
Damien Miller81171112000-04-23 11:14:01 +1000702#include <sys/types.h>
703#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000704 ],
705 [ struct sockaddr_storage s; s.__ss_family = 1; ],
706 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
707 [ ac_cv_have___ss_family_in_struct_ss="no" ]
708 )
709])
710if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
711 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
712fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100713
Damien Miller61e50f12000-05-08 20:49:37 +1000714
715AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
716 AC_TRY_LINK([],
717 [ extern char *__progname; printf("%s", __progname); ],
718 [ ac_cv_libc_defines___progname="yes" ],
719 [ ac_cv_libc_defines___progname="no" ]
720 )
721])
722if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
723 AC_DEFINE(HAVE___PROGNAME)
724fi
725
Damien Millera22ba012000-03-02 23:09:20 +1100726
Damien Millerecbb26d2000-07-15 14:59:14 +1000727AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
728 AC_TRY_LINK([],
729 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
730 [ ac_cv_libc_defines_sys_errlist="yes" ],
731 [ ac_cv_libc_defines_sys_errlist="no" ]
732 )
733])
734if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
735 AC_DEFINE(HAVE_SYS_ERRLIST)
736fi
737
738
Damien Millera22ba012000-03-02 23:09:20 +1100739# Looking for programs, paths and files
740AC_ARG_WITH(rsh,
741 [ --with-rsh=PATH Specify path to remote shell program ],
742 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100743 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000744 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100745 fi
746 ],
747 [
748 AC_PATH_PROG(rsh_path, rsh)
749 ]
750)
751
752AC_ARG_WITH(xauth,
753 [ --with-xauth=PATH Specify path to xauth program ],
754 [
755 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000756 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100757 fi
758 ],
759 [
760 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000761 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100762 xauth_path="/usr/openwin/bin/xauth"
763 fi
764 ]
765)
766
767if test ! -z "$xauth_path" ; then
768 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
769fi
770if test ! -z "$rsh_path" ; then
771 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
772fi
773
774# Check for mail directory (last resort if we cannot get it from headers)
775if test ! -z "$MAIL" ; then
776 maildir=`dirname $MAIL`
777 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
778fi
779
Damien Millera22ba012000-03-02 23:09:20 +1100780if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100781 AC_CHECK_FILE("/dev/ptmx",
782 [
783 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
784 have_dev_ptmx=1
785 ]
786 )
Damien Millera22ba012000-03-02 23:09:20 +1100787fi
Damien Miller204ad072000-03-02 23:56:12 +1100788AC_CHECK_FILE("/dev/ptc",
789 [
790 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
791 have_dev_ptc=1
792 ]
793)
794
Damien Millera22ba012000-03-02 23:09:20 +1100795# Options from here on. Some of these are preset by platform above
796
Damien Millera22ba012000-03-02 23:09:20 +1100797# Check for user-specified random device, otherwise check /dev/urandom
798AC_ARG_WITH(random,
799 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
800 [
Damien Miller040f3832000-04-03 14:50:43 +1000801 if test "x$withval" != "xno" ; then
802 RANDOM_POOL="$withval";
803 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
804 fi
Damien Millera22ba012000-03-02 23:09:20 +1100805 ],
806 [
807 # Check for random device
808 AC_CHECK_FILE("/dev/urandom",
809 [
810 RANDOM_POOL="/dev/urandom";
811 AC_SUBST(RANDOM_POOL)
812 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
813 ]
814 )
815 ]
816)
817
818# Check for EGD pool file
819AC_ARG_WITH(egd-pool,
820 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
821 [
Damien Miller040f3832000-04-03 14:50:43 +1000822 if test "x$withval" != "xno" ; then
823 EGD_SOCKET="$withval";
824 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
825 fi
Damien Millera22ba012000-03-02 23:09:20 +1100826 ]
827)
828
Damien Miller0437b332000-05-02 09:56:41 +1000829# detect pathnames for entropy gathering commands, if we need them
830INSTALL_SSH_PRNG_CMDS=""
831rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000832if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000833 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000834 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
835 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
836 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
837 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
838 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
839 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
840 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
841 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
842 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
843 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
844 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
845 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
846 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
847 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
848 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000849
850 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000851fi
Damien Miller0437b332000-05-02 09:56:41 +1000852AC_SUBST(INSTALL_SSH_PRNG_CMDS)
853
Damien Miller11e37f62000-04-08 18:23:30 +1000854
Damien Miller670a4b82000-01-22 13:53:11 +1100855AC_ARG_WITH(catman,
856 [ --with-catman=man|cat Install preformatted manpages[no]],
857 [
858 MANTYPE='$(CATMAN)'
859 if test x"$withval" != x"yes" ; then
860 mansubdir=$withval
861 else
862 mansubdir=cat
863 fi
864 ], [
865 if test -z "$MANTYPE" ; then
866 MANTYPE='$(TROFFMAN)'
867 mansubdir=man
868 fi
869 ]
870)
871AC_SUBST(MANTYPE)
872AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100873
Damien Millera22ba012000-03-02 23:09:20 +1100874# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000875KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100876AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100877 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100878 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100879 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100880
881 if test "x$withval" != "$xyes" ; then
882 CFLAGS="$CFLAGS -I${withval}/include"
883 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100884 if test ! -z "$need_dash_r" ; then
885 LDFLAGS="$LDFLAGS -R${withval}/lib"
886 fi
887 if test ! -z "$blibpath" ; then
888 blibpath="$blibpath:${withval}/lib"
889 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100890 else
891 if test -d /usr/include/kerberosIV ; then
892 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
893 fi
894 fi
895
896 AC_CHECK_HEADERS(krb.h)
897 AC_CHECK_LIB(krb, main)
898 if test "$ac_cv_header_krb_h" != yes; then
899 AC_MSG_WARN([Cannot find krb.h, build may fail])
900 fi
901 if test "$ac_cv_lib_krb_main" != yes; then
902 AC_MSG_WARN([Cannot find libkrb, build may fail])
903 fi
904
Damien Millerc85f9b42000-01-29 10:20:21 +1100905 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100906 AC_CHECK_LIB(resolv, dn_expand, , )
907 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000908 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100909 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100910 fi
Damien Miller80297751999-11-19 13:03:25 +1100911 ]
912)
913
Damien Millera22ba012000-03-02 23:09:20 +1100914# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000915AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100916AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100917 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100918 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100919 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100920
921 if test "x$withval" != "$xyes" ; then
922 CFLAGS="$CFLAGS -I${withval}/include"
923 LFLAGS="$LFLAGS -L${withval}/lib"
924 fi
925
926 if test -z "$KRB4" ; then
927 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
928 fi
929
Damien Miller8bdeee21999-12-30 15:50:54 +1100930 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100931 if test ! -z "$AFS_LIBS" ; then
932 LIBS="$LIBS $AFS_LIBS"
933 fi
934 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000935 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100936 fi
Damien Miller80297751999-11-19 13:03:25 +1100937 ]
938)
Damien Millerc85f9b42000-01-29 10:20:21 +1100939LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100940
Damien Millera22ba012000-03-02 23:09:20 +1100941# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000942SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100943AC_ARG_WITH(skey,
944 [ --with-skey Enable S/Key support],
945 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100946 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100947 AC_DEFINE(SKEY)
948 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000949 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100950 fi
Damien Miller80297751999-11-19 13:03:25 +1100951 ]
952)
953
Damien Millera22ba012000-03-02 23:09:20 +1100954# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000955TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100956AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100957 [ --with-tcp-wrappers Enable tcpwrappers support],
958 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100959 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100960 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100961 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100962 AC_MSG_CHECKING(for libwrap)
963 AC_TRY_LINK(
964 [
Damien Miller81171112000-04-23 11:14:01 +1000965#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100966 int deny_severity = 0, allow_severity = 0;
967 ],
968 [hosts_access(0);],
969 [
970 AC_MSG_RESULT(yes)
971 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +1000972 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +1100973 ],
974 [
Damien Miller7b22d652000-06-18 14:07:04 +1000975 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +1100976 ]
977 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100978 fi
Damien Miller80297751999-11-19 13:03:25 +1100979 ]
980)
981
Damien Millera22ba012000-03-02 23:09:20 +1100982# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +1000983MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100984AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100985 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100986 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100987 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100988 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +1000989 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100990 fi
991 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100992)
993
Damien Millera22ba012000-03-02 23:09:20 +1100994# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +1100995AC_ARG_WITH(shadow,
996 [ --without-shadow Disable shadow password support],
997 [
998 if test "x$withval" = "xno" ; then
999 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001000 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001001 fi
1002 ]
1003)
1004
Damien Miller1f335fb2000-06-26 11:31:33 +10001005if test -z "$disable_shadow" ; then
1006 AC_MSG_CHECKING([if the systems has expire shadow information])
1007 AC_TRY_COMPILE(
1008 [
1009#include <sys/types.h>
1010#include <shadow.h>
1011 struct spwd sp;
1012 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1013 [ sp_expire_available=yes ], []
1014 )
1015
1016 if test "x$sp_expire_available" = "xyes" ; then
1017 AC_MSG_RESULT(yes)
1018 AC_DEFINE(HAS_SHADOW_EXPIRE)
1019 else
1020 AC_MSG_RESULT(no)
1021 fi
1022fi
1023
Damien Millera22ba012000-03-02 23:09:20 +11001024# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001025DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001026AC_ARG_WITH(ipaddr-display,
1027 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1028 [
Damien Miller66409952000-01-17 21:40:06 +11001029 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001030 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001031 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001032 fi
1033 ]
1034)
1035
Damien Millera22ba012000-03-02 23:09:20 +11001036# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001037SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001038AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001039 [ --with-default-path=PATH Specify default \$PATH environment for server],
1040 [
1041 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001042 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001043 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001044 fi
1045 ]
1046)
1047
Damien Millera22ba012000-03-02 23:09:20 +11001048# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001049IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001050AC_ARG_WITH(ipv4-default,
1051 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1052 [
1053 if test "x$withval" != "xno" ; then
1054 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001055 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001056 fi
1057 ]
1058)
1059
Damien Miller61e50f12000-05-08 20:49:37 +10001060AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001061IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001062AC_ARG_WITH(4in6,
1063 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1064 [
1065 if test "x$withval" != "xno" ; then
1066 AC_MSG_RESULT(yes)
1067 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001068 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001069 else
1070 AC_MSG_RESULT(no)
1071 fi
1072 ],[
1073 if test "x$inet6_default_4in6" = "xyes"; then
1074 AC_MSG_RESULT([yes (default)])
1075 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001076 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001077 else
1078 AC_MSG_RESULT([no (default)])
1079 fi
1080 ]
1081)
1082
Damien Millera22ba012000-03-02 23:09:20 +11001083# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001084piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001085AC_ARG_WITH(pid-dir,
1086 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1087 [
1088 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001089 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001090 fi
1091 ]
1092)
Damien Miller4018c192000-04-30 09:30:44 +10001093
Damien Millerdbd250f2000-01-18 08:57:14 +11001094AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001095AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001096
andre2ff7b5d2000-06-03 14:57:40 +00001097dnl allow user to disable some login recording features
1098AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001099 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001100 [ AC_DEFINE(DISABLE_LASTLOG) ]
1101)
1102AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001103 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001104 [ AC_DEFINE(DISABLE_UTMP) ]
1105)
1106AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001107 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001108 [ AC_DEFINE(DISABLE_UTMPX) ]
1109)
1110AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001111 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001112 [ AC_DEFINE(DISABLE_WTMP) ]
1113)
1114AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001115 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001116 [ AC_DEFINE(DISABLE_WTMPX) ]
1117)
1118AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001119 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001120 [ AC_DEFINE(DISABLE_LOGIN) ]
1121)
1122AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001123 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001124 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1125)
1126AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001127 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001128 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1129)
1130AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001131 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001132 [ conf_lastlog_location="$withval"; ],)
1133
1134dnl lastlog, [uw]tmpx? detection
1135dnl NOTE: set the paths in the platform section to avoid the
1136dnl need for command-line parameters
1137dnl lastlog and [uw]tmp are subject to a file search if all else fails
1138
1139dnl lastlog detection
1140dnl NOTE: the code itself will detect if lastlog is a directory
1141AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1142AC_TRY_COMPILE([
1143#include <sys/types.h>
1144#include <utmp.h>
1145#ifdef HAVE_LASTLOG_H
1146# include <lastlog.h>
1147#endif
Damien Miller2994e082000-06-04 15:51:47 +10001148#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001149# include <paths.h>
1150#endif
1151 ],
1152 [ char *lastlog = LASTLOG_FILE; ],
1153 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001154 [
1155 AC_MSG_RESULT(no)
1156 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1157 AC_TRY_COMPILE([
1158#include <sys/types.h>
1159#include <utmp.h>
1160#ifdef HAVE_LASTLOG_H
1161# include <lastlog.h>
1162#endif
1163#ifdef HAVE_PATHS_H
1164# include <paths.h>
1165#endif
1166 ],
1167 [ char *lastlog = _PATH_LASTLOG; ],
1168 [ AC_MSG_RESULT(yes) ],
1169 [
andree441aa32000-06-12 22:34:38 +00001170 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001171 system_lastlog_path=no
1172 ])
1173 ]
andre2ff7b5d2000-06-03 14:57:40 +00001174)
Damien Miller2994e082000-06-04 15:51:47 +10001175
andre2ff7b5d2000-06-03 14:57:40 +00001176if test -z "$conf_lastlog_location"; then
1177 if test x"$system_lastlog_path" = x"no" ; then
1178 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001179 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001180 conf_lastlog_location=$f
1181 fi
1182 done
1183 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001184 AC_MSG_WARN([** Cannot find lastlog **])
1185 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001186 fi
1187 fi
1188fi
1189
1190if test -n "$conf_lastlog_location"; then
1191 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1192fi
1193
1194dnl utmp detection
1195AC_MSG_CHECKING([if your system defines UTMP_FILE])
1196AC_TRY_COMPILE([
1197#include <sys/types.h>
1198#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001199#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001200# include <paths.h>
1201#endif
1202 ],
1203 [ char *utmp = UTMP_FILE; ],
1204 [ AC_MSG_RESULT(yes) ],
1205 [ AC_MSG_RESULT(no)
1206 system_utmp_path=no ]
1207)
1208if test -z "$conf_utmp_location"; then
1209 if test x"$system_utmp_path" = x"no" ; then
1210 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1211 if test -f $f ; then
1212 conf_utmp_location=$f
1213 fi
1214 done
1215 if test -z "$conf_utmp_location"; then
1216 AC_DEFINE(DISABLE_UTMP)
1217 fi
1218 fi
1219fi
1220if test -n "$conf_utmp_location"; then
1221 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1222fi
1223
1224dnl wtmp detection
1225AC_MSG_CHECKING([if your system defines WTMP_FILE])
1226AC_TRY_COMPILE([
1227#include <sys/types.h>
1228#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001229#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001230# include <paths.h>
1231#endif
1232 ],
1233 [ char *wtmp = WTMP_FILE; ],
1234 [ AC_MSG_RESULT(yes) ],
1235 [ AC_MSG_RESULT(no)
1236 system_wtmp_path=no ]
1237)
1238if test -z "$conf_wtmp_location"; then
1239 if test x"$system_wtmp_path" = x"no" ; then
1240 for f in /usr/adm/wtmp /var/log/wtmp; do
1241 if test -f $f ; then
1242 conf_wtmp_location=$f
1243 fi
1244 done
1245 if test -z "$conf_wtmp_location"; then
1246 AC_DEFINE(DISABLE_WTMP)
1247 fi
1248 fi
1249fi
1250if test -n "$conf_wtmp_location"; then
1251 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1252fi
1253
1254
1255dnl utmpx detection - I don't know any system so perverse as to require
1256dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1257dnl there, though.
1258AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1259AC_TRY_COMPILE([
1260#include <sys/types.h>
1261#include <utmp.h>
1262#ifdef HAVE_UTMPX_H
1263#include <utmpx.h>
1264#endif
Damien Miller2994e082000-06-04 15:51:47 +10001265#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001266# include <paths.h>
1267#endif
1268 ],
1269 [ char *utmpx = UTMPX_FILE; ],
1270 [ AC_MSG_RESULT(yes) ],
1271 [ AC_MSG_RESULT(no)
1272 system_utmpx_path=no ]
1273)
1274if test -z "$conf_utmpx_location"; then
1275 if test x"$system_utmpx_path" = x"no" ; then
1276 AC_DEFINE(DISABLE_UTMPX)
1277 fi
1278else
1279 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1280fi
1281
1282dnl wtmpx detection
1283AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1284AC_TRY_COMPILE([
1285#include <sys/types.h>
1286#include <utmp.h>
1287#ifdef HAVE_UTMPX_H
1288#include <utmpx.h>
1289#endif
Damien Miller2994e082000-06-04 15:51:47 +10001290#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001291# include <paths.h>
1292#endif
1293 ],
1294 [ char *wtmpx = WTMPX_FILE; ],
1295 [ AC_MSG_RESULT(yes) ],
1296 [ AC_MSG_RESULT(no)
1297 system_wtmpx_path=no ]
1298)
1299if test -z "$conf_wtmpx_location"; then
1300 if test x"$system_wtmpx_path" = x"no" ; then
1301 AC_DEFINE(DISABLE_WTMPX)
1302 fi
1303else
1304 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1305fi
1306
Damien Miller4018c192000-04-30 09:30:44 +10001307
1308# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001309entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001310AC_ARG_WITH(entropy-timeout,
1311 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1312 [
1313 if test "x$withval" != "xno" ; then
1314 entropy_timeout=$withval
1315 fi
1316 ]
1317)
1318AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1319
1320
Damien Miller29ea30d2000-03-17 10:54:15 +11001321if test ! -z "$blibpath" ; then
1322 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1323 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1324fi
1325
Damien Miller0437b332000-05-02 09:56:41 +10001326AC_OUTPUT(Makefile ssh_prng_cmds)
1327
Damien Miller7b22d652000-06-18 14:07:04 +10001328# Print summary of options
1329
1330if test x$MANTYPE = x'$(CATMAN)' ; then
1331 MAN_MSG=cat
1332else
1333 MAN_MSG=man
1334fi
1335if test ! -z "$RANDOM_POOL" ; then
1336 RAND_MSG="Device ($RANDOM_POOL)"
1337else
1338 if test ! -z "$EGD_SOCKET" ; then
1339 RAND_MSG="EGD ($EGD_SOCKET)"
1340 else
1341 RAND_MSG="Builtin (timeout $entropy_timeout)"
1342 fi
1343fi
1344
1345# Someone please show me a better way :)
1346A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1347B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1348C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1349D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1350E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1351F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1352G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1353
1354echo ""
1355echo "OpenSSH configured has been configured with the following options."
1356echo " User binaries: $B"
1357echo " System binaries: $C"
1358echo " Configuration files: $D"
1359echo " Askpass program: $E"
1360echo " Manual pages: $F"
1361echo " PID file: $G"
1362echo " Random number collection: $RAND_MSG"
1363echo " Manpage format: $MAN_MSG"
1364echo " PAM support: ${PAM_MSG}"
1365echo " KerberosIV support: $KRB4_MSG"
1366echo " AFS support: $AFS_MSG"
1367echo " S/KEY support: $SKEY_MSG"
1368echo " TCP Wrappers support: $TCPW_MSG"
1369echo " MD5 password support: $MD5_MSG"
1370echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1371echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1372echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1373
1374echo ""
1375
1376echo "Compiler flags: ${CFLAGS}"
1377echo "Linker flags: ${LDFLAGS}"
1378echo "Libraries: ${LIBS}"
1379
1380echo ""
1381