blob: 4d0f6ea43ba7582996d9d641b785501c30a49f57 [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 Miller75b1d102000-01-07 14:01:41 +110043 ;;
Damien Miller76112de1999-12-21 11:18:08 +110044*-*-hpux10*)
45 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100046 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110047 fi
48 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
49 AC_DEFINE(IPADDR_IN_DISPLAY)
50 AC_MSG_CHECKING(for HPUX trusted system password database)
51 if test -f /tcb/files/auth/system/default; then
52 AC_MSG_RESULT(yes)
53 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
54 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110055 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110056 else
57 AC_MSG_RESULT(no)
58 AC_DEFINE(DISABLE_SHADOW)
59 fi
Damien Miller670a4b82000-01-22 13:53:11 +110060 MANTYPE='$(CATMAN)'
61 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110062 ;;
Damien Miller1bead332000-04-30 00:47:29 +100063*-*-hpux11*)
64 if test -z "$GCC"; then
65 CFLAGS="$CFLAGS -Ae"
66 fi
67 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100068 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100069 AC_MSG_CHECKING(for HPUX trusted system password database)
70 if test -f /tcb/files/auth/system/default; then
71 AC_MSG_RESULT(yes)
72 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
73 LIBS="$LIBS -lsec"
74 AC_MSG_WARN([This configuration is untested])
75 else
76 AC_MSG_RESULT(no)
77 AC_DEFINE(DISABLE_SHADOW)
78 fi
79 MANTYPE='$(CATMAN)'
80 mansubdir=cat
81 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110082*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110083 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100084 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110085 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110086 no_libsocket=1
87 no_libnsl=1
88 ;;
89*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110090 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100091 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110092 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +100093 AC_DEFINE(WITH_IRIX_ARRAY)
94 AC_DEFINE(WITH_IRIX_PROJECT)
95 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +110096 no_libsocket=1
97 no_libnsl=1
98 ;;
Damien Millerb29ea912000-01-15 14:12:03 +110099*-*-linux*)
100 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100101 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000102 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100103 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100104 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100105*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100106 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100107 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000108*-next-*)
109 # hardwire lastlog location (can't detect it on some versions)
110 conf_lastlog_location="/usr/adm/lastlog"
111 AC_DEFINE(HAVE_NEXT)
112 CFLAGS="$CFLAGS -I/usr/local/include"
113 MAIL=/usr/spool/mail
114 conf_utmp_location=/etc/utmp
115 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
116 AC_MSG_WARN([*** Expect 'scp' to fail!])
117 AC_MSG_WARN([*** Please report any problems, thanks])
118 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100119*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100120 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100121 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100122 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000123 # hardwire lastlog location (can't detect it on some versions)
124 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000125 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
126 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
127 if test "$sol2ver" -ge 8; then
128 AC_MSG_RESULT(yes)
129 AC_DEFINE(DISABLE_UTMP)
130 AC_DEFINE(DISABLE_WTMP)
131 else
132 AC_MSG_RESULT(no)
133 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100134 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000135*-*-sunos4*)
136 CFLAGS="$CFLAGS -DSUNOS4"
137 AC_CHECK_FUNCS(getpwanam)
138 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100139*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100140 CFLAGS="$CFLAGS -I/usr/local/include"
141 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100142 MANTYPE='$(CATMAN)'
143 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100144 LIBS="$LIBS -lgen -lsocket"
145 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000146*-*-sco3*)
147 CFLAGS="$CFLAGS -I/usr/local/include"
148 LDFLAGS="$LDFLAGS -L/usr/local/lib"
149 MANTYPE='$(CATMAN)'
150 mansubdir=cat
151 LIBS="$LIBS -lgen -lsocket"
152 no_dev_ptmx=1
153 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000154*-dec-osf*)
155# This is untested
156 if test ! -z "USE_SIA" ; then
157 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
158 if test -f /etc/sia/matrix.conf; then
159 AC_MSG_RESULT(yes)
160 AC_DEFINE(HAVE_OSF_SIA)
161 AC_DEFINE(DISABLE_LOGIN)
162 LIBS="$LIBS -lsecurity -ldb -lm -laud"
163 else
164 AC_MSG_RESULT(no)
165 fi
166 fi
167 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100168esac
169
Damien Millere37bfc12000-06-05 09:37:43 +1000170# Allow user to specify flags
171AC_ARG_WITH(cflags,
172 [ --with-cflags Specify additional flags to pass to compiler],
173 [
174 if test "x$withval" != "xno" ; then
175 CFLAGS="$CFLAGS $withval"
176 fi
177 ]
178)
179AC_ARG_WITH(ldflags,
180 [ --with-ldlags Specify additional flags to pass to linker],
181 [
182 if test "x$withval" != "xno" ; then
183 LDFLAGS="$LDFLAGS $withval"
184 fi
185 ]
186)
187AC_ARG_WITH(libs,
188 [ --with-libs Specify additional libraries to link with],
189 [
190 if test "x$withval" != "xno" ; then
191 LIBS="$LIBS $withval"
192 fi
193 ]
194)
195
196
Damien Millera22ba012000-03-02 23:09:20 +1100197# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100198AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
199AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100200
Damien Millerbeb4ba51999-12-28 15:09:35 +1100201if test -z "$no_libsocket" ; then
202 AC_CHECK_LIB(nsl, yp_match, , )
203fi
204if test -z "$no_libnsl" ; then
205 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100206fi
Damien Millerab18c411999-11-11 10:40:23 +1100207
Damien Millera22ba012000-03-02 23:09:20 +1100208# Checks for header files.
Damien Miller0f91b4e2000-06-18 15:43:25 +1000209AC_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 util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100210
Damien Millera22ba012000-03-02 23:09:20 +1100211# Checks for library functions.
andre2ff7b5d2000-06-03 14:57:40 +0000212AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop)
213dnl checks for time functions
214AC_CHECK_FUNCS(gettimeofday time)
215dnl checks for libutil functions
216AC_CHECK_FUNCS(login logout updwtmp logwtmp)
217dnl checks for utmp functions
218AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
219AC_CHECK_FUNCS(utmpname)
220dnl checks for utmpx functions
221AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
222AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100223
Damien Miller04f80141999-11-19 15:32:34 +1100224AC_CHECK_FUNC(login,
225 [AC_DEFINE(HAVE_LOGIN)],
226 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
227)
228
229AC_CHECK_FUNC(daemon,
230 [AC_DEFINE(HAVE_DAEMON)],
231 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
232)
233
Damien Miller9fb07e42000-03-05 16:22:59 +1100234AC_CHECK_FUNC(getpagesize,
235 [AC_DEFINE(HAVE_GETPAGESIZE)],
236 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
237)
238
Damien Millercb170cb2000-07-01 16:52:55 +1000239# Check for broken snprintf
240if test "x$ac_cv_func_snprintf" = "xyes" ; then
241 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
242 AC_TRY_RUN(
243 [
244#include <stdio.h>
245int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
246 ],
247 [AC_MSG_RESULT(yes)],
248 [
249 AC_MSG_RESULT(no)
250 AC_DEFINE(BROKEN_SNPRINTF)
251 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
252 ]
253 )
254fi
255
Damien Miller7b22d652000-06-18 14:07:04 +1000256PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100257AC_ARG_WITH(pam,
258 [ --without-pam Disable PAM support ],
259 [
260 if test "x$withval" = "xno" ; then
261 no_pam=1
262 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000263 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100264 fi
265 ]
266)
Damien Milleredb82922000-06-20 13:25:52 +1000267if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100268 AC_CHECK_LIB(dl, dlopen, , )
269 LIBS="$LIBS -lpam"
270
Damien Miller0e65eed2000-05-17 22:16:05 +1000271 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000272
Damien Miller1f335fb2000-06-26 11:31:33 +1000273 disable_shadow=yes
274
Damien Miller7b22d652000-06-18 14:07:04 +1000275 PAM_MSG="yes"
276
Damien Millera22ba012000-03-02 23:09:20 +1100277 # Check PAM strerror arguments (old PAM)
278 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
279 AC_TRY_COMPILE(
280 [
Damien Miller81171112000-04-23 11:14:01 +1000281#include <stdlib.h>
282#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100283 ],
284 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
285 [AC_MSG_RESULT(no)],
286 [
287 AC_DEFINE(HAVE_OLD_PAM)
288 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000289 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100290 ]
291 )
292fi
293
294# The big search for OpenSSL
295AC_ARG_WITH(ssl-dir,
296 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
297 [
298 if test "x$withval" != "$xno" ; then
299 tryssldir=$withval
300 fi
301 ]
302)
303
304saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100305saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100306saved_CFLAGS="$CFLAGS"
307if test "x$prefix" != "xNONE" ; then
308 tryssldir="$tryssldir $prefix"
309fi
Damien Miller61e50f12000-05-08 20:49:37 +1000310AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100311
Damien Miller61e50f12000-05-08 20:49:37 +1000312 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
313 if test ! -z "$ssldir" ; then
314 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
315 CFLAGS="$saved_CFLAGS -I$ssldir/include"
316 if test ! -z "$need_dash_r" ; then
317 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
318 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100319 else
Damien Miller61e50f12000-05-08 20:49:37 +1000320 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100321 fi
322
Damien Miller3b512e12000-05-17 23:29:18 +1000323 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000324
Damien Miller3b512e12000-05-17 23:29:18 +1000325 # Basic test to check for compatible version and correct linking
326 # *does not* test for RSA - that comes later.
327 AC_TRY_RUN(
328 [
Damien Millere59ce622000-05-01 20:54:17 +1000329#include <string.h>
330#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000331int main(void)
332{
Damien Miller3b512e12000-05-17 23:29:18 +1000333 char a[2048];
334 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000335 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000336 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000337}
Damien Miller3b512e12000-05-17 23:29:18 +1000338 ],
339 [
340 found_crypto=1
341 break;
342 ], []
343 )
Damien Miller61e50f12000-05-08 20:49:37 +1000344
345 if test ! -z "$found_crypto" ; then
346 break;
347 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100348 done
349
Damien Miller61e50f12000-05-08 20:49:37 +1000350 if test -z "$found_crypto" ; then
351 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100352 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000353 if test -z "$ssldir" ; then
354 ssldir="(system)"
355 fi
Damien Millera22ba012000-03-02 23:09:20 +1100356
Damien Miller61e50f12000-05-08 20:49:37 +1000357 ac_cv_openssldir=$ssldir
358])
359
Damien Milleredb82922000-06-20 13:25:52 +1000360if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000361 AC_DEFINE(HAVE_OPENSSL)
362 dnl Need to recover ssldir - test above runs in subshell
363 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100364 CFLAGS="$saved_CFLAGS -I$ssldir/include"
365 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
366 if test ! -z "$need_dash_r" ; then
367 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100368 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100369 if test ! -z "$blibpath" ; then
370 blibpath="$blibpath:$ssldir:$ssldir/lib"
371 fi
Damien Millera22ba012000-03-02 23:09:20 +1100372fi
Damien Miller3b512e12000-05-17 23:29:18 +1000373LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000374
Damien Miller3b512e12000-05-17 23:29:18 +1000375# Now test RSA support
376saved_LIBS="$LIBS"
377AC_MSG_CHECKING([for RSA support])
378for WANTS_RSAREF in "" 1 ; do
379 if test -z "$WANTS_RSAREF" ; then
380 LIBS="$saved_LIBS"
381 else
382 LIBS="$saved_LIBS -lRSAglue -lrsaref"
383 fi
384 AC_TRY_RUN([
385#include <string.h>
386#include <openssl/rand.h>
387#include <openssl/rsa.h>
388#include <openssl/bn.h>
389#include <openssl/sha.h>
390int main(void)
391{
392 int num; RSA *key; static unsigned char p_in[] = "blahblah";
393 unsigned char c[256], p[256];
394 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
395 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
396 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
397 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
398}
399 ],
400 [
401 rsa_works=1
402 break;
403 ], [])
404done
405
406if test ! -z "$no_rsa" ; then
407 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000408 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000409else
410 if test -z "$rsa_works" ; then
411 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000412 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000413 else
414 if test -z "$WANTS_RSAREF" ; then
415 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000416 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000417 else
Damien Miller7b22d652000-06-18 14:07:04 +1000418 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000419 AC_MSG_RESULT(using RSAref)
420 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
421 fi
422 fi
423fi
Damien Millera22ba012000-03-02 23:09:20 +1100424
425# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100426AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100427AC_CHECK_SIZEOF(short int, 2)
428AC_CHECK_SIZEOF(int, 4)
429AC_CHECK_SIZEOF(long int, 4)
430AC_CHECK_SIZEOF(long long int, 8)
431
Damien Millera22ba012000-03-02 23:09:20 +1100432# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000433AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
434 AC_TRY_COMPILE(
435 [ #include <sys/types.h> ],
436 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
437 [ ac_cv_have_intxx_t="yes" ],
438 [ ac_cv_have_intxx_t="no" ]
439 )
440])
441if test "x$ac_cv_have_intxx_t" = "xyes" ; then
442 AC_DEFINE(HAVE_INTXX_T)
443 have_intxx_t=1
444fi
445
446AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
447 AC_TRY_COMPILE(
448 [ #include <sys/types.h> ],
449 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
450 [ ac_cv_have_u_intxx_t="yes" ],
451 [ ac_cv_have_u_intxx_t="no" ]
452 )
453])
454if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
455 AC_DEFINE(HAVE_U_INTXX_T)
456 have_u_intxx_t=1
457fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100458
Damien Millerc6398ef1999-11-20 12:18:40 +1100459
Damien Milleredb82922000-06-20 13:25:52 +1000460if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
461 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100462then
463 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
464 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000465 [
466#include <sys/bitypes.h>
467 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100468 [
Damien Miller70494d12000-04-03 15:57:06 +1000469 int8_t a; int16_t b; int32_t c;
470 u_int8_t e; u_int16_t f; u_int32_t g;
471 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100472 ],
473 [
474 AC_DEFINE(HAVE_U_INTXX_T)
475 AC_DEFINE(HAVE_INTXX_T)
476 AC_MSG_RESULT(yes)
477 ],
478 [AC_MSG_RESULT(no)]
479 )
480fi
481
Damien Millerd6121d22000-03-17 23:26:46 +1100482if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000483 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
484 AC_TRY_COMPILE(
485 [
486#include <sys/types.h>
487 ],
488 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
489 [ ac_cv_have_uintxx_t="yes" ],
490 [ ac_cv_have_uintxx_t="no" ]
491 )
492 ])
493 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
494 AC_DEFINE(HAVE_UINTXX_T)
495 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100496fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100497
Damien Miller61e50f12000-05-08 20:49:37 +1000498AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
499 AC_TRY_COMPILE(
500 [
Damien Miller81171112000-04-23 11:14:01 +1000501#include <sys/types.h>
502#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000503 ],
504 [socklen_t foo; foo = 1235;],
505 [ ac_cv_have_socklen_t="yes" ],
506 [ ac_cv_have_socklen_t="no" ]
507 )
508])
509if test "x$ac_cv_have_socklen_t" = "xyes" ; then
510 AC_DEFINE(HAVE_SOCKLEN_T)
511fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100512
Damien Miller61e50f12000-05-08 20:49:37 +1000513AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
514 AC_TRY_COMPILE(
515 [
516#include <sys/types.h>
517 ],
518 [ size_t foo; foo = 1235; ],
519 [ ac_cv_have_size_t="yes" ],
520 [ ac_cv_have_size_t="no" ]
521 )
522])
523if test "x$ac_cv_have_size_t" = "xyes" ; then
524 AC_DEFINE(HAVE_SIZE_T)
525fi
Damien Miller95058511999-12-29 10:36:45 +1100526
Damien Miller615f9392000-05-17 22:53:33 +1000527AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
528 AC_TRY_COMPILE(
529 [
530#include <sys/types.h>
531 ],
532 [ ssize_t foo; foo = 1235; ],
533 [ ac_cv_have_ssize_t="yes" ],
534 [ ac_cv_have_ssize_t="no" ]
535 )
536])
537if test "x$ac_cv_have_ssize_t" = "xyes" ; then
538 AC_DEFINE(HAVE_SSIZE_T)
539fi
540
Damien Millerb54b40e2000-06-23 08:23:34 +1000541AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
542 AC_TRY_COMPILE(
543 [
544#include <sys/types.h>
545#include <sys/socket.h>
546 ],
547 [ sa_family_t foo; foo = 1235; ],
548 [ ac_cv_have_sa_family_t="yes" ],
549 [ ac_cv_have_sa_family_t="no" ]
550 )
551])
552if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
553 AC_DEFINE(HAVE_SA_FAMILY_T)
554fi
555
Damien Miller0f91b4e2000-06-18 15:43:25 +1000556AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
557 AC_TRY_COMPILE(
558 [
559#include <sys/types.h>
560 ],
561 [ pid_t foo; foo = 1235; ],
562 [ ac_cv_have_pid_t="yes" ],
563 [ ac_cv_have_pid_t="no" ]
564 )
565])
566if test "x$ac_cv_have_pid_t" = "xyes" ; then
567 AC_DEFINE(HAVE_PID_T)
568fi
569
570AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
571 AC_TRY_COMPILE(
572 [
573#include <sys/types.h>
574 ],
575 [ mode_t foo; foo = 1235; ],
576 [ ac_cv_have_mode_t="yes" ],
577 [ ac_cv_have_mode_t="no" ]
578 )
579])
580if test "x$ac_cv_have_mode_t" = "xyes" ; then
581 AC_DEFINE(HAVE_MODE_T)
582fi
583
Damien Miller61e50f12000-05-08 20:49:37 +1000584
585AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
586 AC_TRY_COMPILE(
587 [
Damien Miller81171112000-04-23 11:14:01 +1000588#include <sys/types.h>
589#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000590 ],
591 [ struct sockaddr_storage s; ],
592 [ ac_cv_have_struct_sockaddr_storage="yes" ],
593 [ ac_cv_have_struct_sockaddr_storage="no" ]
594 )
595])
596if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
597 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
598fi
Damien Miller34132e52000-01-14 15:45:46 +1100599
Damien Miller61e50f12000-05-08 20:49:37 +1000600AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
601 AC_TRY_COMPILE(
602 [
Damien Miller7b22d652000-06-18 14:07:04 +1000603#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000604#include <netinet/in.h>
605 ],
606 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
607 [ ac_cv_have_struct_sockaddr_in6="yes" ],
608 [ ac_cv_have_struct_sockaddr_in6="no" ]
609 )
610])
611if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
612 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
613fi
Damien Miller34132e52000-01-14 15:45:46 +1100614
Damien Miller61e50f12000-05-08 20:49:37 +1000615AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
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 in6_addr s; s.s6_addr[0] = 0; ],
622 [ ac_cv_have_struct_in6_addr="yes" ],
623 [ ac_cv_have_struct_in6_addr="no" ]
624 )
625])
626if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
627 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
628fi
Damien Miller34132e52000-01-14 15:45:46 +1100629
Damien Miller61e50f12000-05-08 20:49:37 +1000630AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
631 AC_TRY_COMPILE(
632 [
Damien Miller81171112000-04-23 11:14:01 +1000633#include <sys/types.h>
634#include <sys/socket.h>
635#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000636 ],
637 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
638 [ ac_cv_have_struct_addrinfo="yes" ],
639 [ ac_cv_have_struct_addrinfo="no" ]
640 )
641])
642if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
643 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
644fi
645
Damien Miller34132e52000-01-14 15:45:46 +1100646
Damien Millera22ba012000-03-02 23:09:20 +1100647# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100648
Damien Miller61e50f12000-05-08 20:49:37 +1000649OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
650OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
651OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
652OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
653OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000654OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000655OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
656OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000657OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000658OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
659OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
660OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
661OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000662OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
663OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
664OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
665OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
666
Damien Miller61e50f12000-05-08 20:49:37 +1000667AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
668 ac_cv_have_ss_family_in_struct_ss, [
669 AC_TRY_COMPILE(
670 [
Damien Miller81171112000-04-23 11:14:01 +1000671#include <sys/types.h>
672#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000673 ],
674 [ struct sockaddr_storage s; s.ss_family = 1; ],
675 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
676 [ ac_cv_have_ss_family_in_struct_ss="no" ],
677 )
678])
679if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
680 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
681fi
682
Damien Miller61e50f12000-05-08 20:49:37 +1000683AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
684 ac_cv_have___ss_family_in_struct_ss, [
685 AC_TRY_COMPILE(
686 [
Damien Miller81171112000-04-23 11:14:01 +1000687#include <sys/types.h>
688#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000689 ],
690 [ struct sockaddr_storage s; s.__ss_family = 1; ],
691 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
692 [ ac_cv_have___ss_family_in_struct_ss="no" ]
693 )
694])
695if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
696 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
697fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100698
Damien Miller61e50f12000-05-08 20:49:37 +1000699
700AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
701 AC_TRY_LINK([],
702 [ extern char *__progname; printf("%s", __progname); ],
703 [ ac_cv_libc_defines___progname="yes" ],
704 [ ac_cv_libc_defines___progname="no" ]
705 )
706])
707if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
708 AC_DEFINE(HAVE___PROGNAME)
709fi
710
Damien Millera22ba012000-03-02 23:09:20 +1100711
712# Looking for programs, paths and files
713AC_ARG_WITH(rsh,
714 [ --with-rsh=PATH Specify path to remote shell program ],
715 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100716 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000717 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100718 fi
719 ],
720 [
721 AC_PATH_PROG(rsh_path, rsh)
722 ]
723)
724
725AC_ARG_WITH(xauth,
726 [ --with-xauth=PATH Specify path to xauth program ],
727 [
728 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000729 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100730 fi
731 ],
732 [
733 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000734 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100735 xauth_path="/usr/openwin/bin/xauth"
736 fi
737 ]
738)
739
740if test ! -z "$xauth_path" ; then
741 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
742fi
743if test ! -z "$rsh_path" ; then
744 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
745fi
746
747# Check for mail directory (last resort if we cannot get it from headers)
748if test ! -z "$MAIL" ; then
749 maildir=`dirname $MAIL`
750 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
751fi
752
Damien Millera22ba012000-03-02 23:09:20 +1100753if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100754 AC_CHECK_FILE("/dev/ptmx",
755 [
756 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
757 have_dev_ptmx=1
758 ]
759 )
Damien Millera22ba012000-03-02 23:09:20 +1100760fi
Damien Miller204ad072000-03-02 23:56:12 +1100761AC_CHECK_FILE("/dev/ptc",
762 [
763 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
764 have_dev_ptc=1
765 ]
766)
767
Damien Millera22ba012000-03-02 23:09:20 +1100768# Options from here on. Some of these are preset by platform above
769
Damien Millera22ba012000-03-02 23:09:20 +1100770# Check for user-specified random device, otherwise check /dev/urandom
771AC_ARG_WITH(random,
772 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
773 [
Damien Miller040f3832000-04-03 14:50:43 +1000774 if test "x$withval" != "xno" ; then
775 RANDOM_POOL="$withval";
776 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
777 fi
Damien Millera22ba012000-03-02 23:09:20 +1100778 ],
779 [
780 # Check for random device
781 AC_CHECK_FILE("/dev/urandom",
782 [
783 RANDOM_POOL="/dev/urandom";
784 AC_SUBST(RANDOM_POOL)
785 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
786 ]
787 )
788 ]
789)
790
791# Check for EGD pool file
792AC_ARG_WITH(egd-pool,
793 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
794 [
Damien Miller040f3832000-04-03 14:50:43 +1000795 if test "x$withval" != "xno" ; then
796 EGD_SOCKET="$withval";
797 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
798 fi
Damien Millera22ba012000-03-02 23:09:20 +1100799 ]
800)
801
Damien Miller0437b332000-05-02 09:56:41 +1000802# detect pathnames for entropy gathering commands, if we need them
803INSTALL_SSH_PRNG_CMDS=""
804rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000805if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000806 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000807 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
808 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
809 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
810 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
811 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
812 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
813 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
814 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
815 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
816 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
817 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
818 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
819 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
820 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
821 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000822
823 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000824fi
Damien Miller0437b332000-05-02 09:56:41 +1000825AC_SUBST(INSTALL_SSH_PRNG_CMDS)
826
Damien Miller11e37f62000-04-08 18:23:30 +1000827
Damien Miller670a4b82000-01-22 13:53:11 +1100828AC_ARG_WITH(catman,
829 [ --with-catman=man|cat Install preformatted manpages[no]],
830 [
831 MANTYPE='$(CATMAN)'
832 if test x"$withval" != x"yes" ; then
833 mansubdir=$withval
834 else
835 mansubdir=cat
836 fi
837 ], [
838 if test -z "$MANTYPE" ; then
839 MANTYPE='$(TROFFMAN)'
840 mansubdir=man
841 fi
842 ]
843)
844AC_SUBST(MANTYPE)
845AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100846
Damien Millera22ba012000-03-02 23:09:20 +1100847# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000848KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100849AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100850 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100851 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100852 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100853
854 if test "x$withval" != "$xyes" ; then
855 CFLAGS="$CFLAGS -I${withval}/include"
856 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100857 if test ! -z "$need_dash_r" ; then
858 LDFLAGS="$LDFLAGS -R${withval}/lib"
859 fi
860 if test ! -z "$blibpath" ; then
861 blibpath="$blibpath:${withval}/lib"
862 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100863 else
864 if test -d /usr/include/kerberosIV ; then
865 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
866 fi
867 fi
868
869 AC_CHECK_HEADERS(krb.h)
870 AC_CHECK_LIB(krb, main)
871 if test "$ac_cv_header_krb_h" != yes; then
872 AC_MSG_WARN([Cannot find krb.h, build may fail])
873 fi
874 if test "$ac_cv_lib_krb_main" != yes; then
875 AC_MSG_WARN([Cannot find libkrb, build may fail])
876 fi
877
Damien Millerc85f9b42000-01-29 10:20:21 +1100878 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100879 AC_CHECK_LIB(resolv, dn_expand, , )
880 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000881 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100882 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100883 fi
Damien Miller80297751999-11-19 13:03:25 +1100884 ]
885)
886
Damien Millera22ba012000-03-02 23:09:20 +1100887# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000888AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100889AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100890 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100891 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100892 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100893
894 if test "x$withval" != "$xyes" ; then
895 CFLAGS="$CFLAGS -I${withval}/include"
896 LFLAGS="$LFLAGS -L${withval}/lib"
897 fi
898
899 if test -z "$KRB4" ; then
900 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
901 fi
902
Damien Miller8bdeee21999-12-30 15:50:54 +1100903 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100904 if test ! -z "$AFS_LIBS" ; then
905 LIBS="$LIBS $AFS_LIBS"
906 fi
907 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000908 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100909 fi
Damien Miller80297751999-11-19 13:03:25 +1100910 ]
911)
Damien Millerc85f9b42000-01-29 10:20:21 +1100912LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100913
Damien Millera22ba012000-03-02 23:09:20 +1100914# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000915SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100916AC_ARG_WITH(skey,
917 [ --with-skey Enable S/Key support],
918 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100919 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100920 AC_DEFINE(SKEY)
921 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000922 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100923 fi
Damien Miller80297751999-11-19 13:03:25 +1100924 ]
925)
926
Damien Millera22ba012000-03-02 23:09:20 +1100927# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000928TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100929AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100930 [ --with-tcp-wrappers Enable tcpwrappers support],
931 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100932 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100933 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100934 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100935 AC_MSG_CHECKING(for libwrap)
936 AC_TRY_LINK(
937 [
Damien Miller81171112000-04-23 11:14:01 +1000938#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100939 int deny_severity = 0, allow_severity = 0;
940 ],
941 [hosts_access(0);],
942 [
943 AC_MSG_RESULT(yes)
944 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +1000945 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +1100946 ],
947 [
Damien Miller7b22d652000-06-18 14:07:04 +1000948 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +1100949 ]
950 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100951 fi
Damien Miller80297751999-11-19 13:03:25 +1100952 ]
953)
954
Damien Millera22ba012000-03-02 23:09:20 +1100955# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +1000956MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100957AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100958 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100959 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100960 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100961 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +1000962 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100963 fi
964 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100965)
966
Damien Millera22ba012000-03-02 23:09:20 +1100967# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +1100968AC_ARG_WITH(shadow,
969 [ --without-shadow Disable shadow password support],
970 [
971 if test "x$withval" = "xno" ; then
972 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +1000973 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +1100974 fi
975 ]
976)
977
Damien Miller1f335fb2000-06-26 11:31:33 +1000978if test -z "$disable_shadow" ; then
979 AC_MSG_CHECKING([if the systems has expire shadow information])
980 AC_TRY_COMPILE(
981 [
982#include <sys/types.h>
983#include <shadow.h>
984 struct spwd sp;
985 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
986 [ sp_expire_available=yes ], []
987 )
988
989 if test "x$sp_expire_available" = "xyes" ; then
990 AC_MSG_RESULT(yes)
991 AC_DEFINE(HAS_SHADOW_EXPIRE)
992 else
993 AC_MSG_RESULT(no)
994 fi
995fi
996
Damien Millera22ba012000-03-02 23:09:20 +1100997# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +1000998DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +1100999AC_ARG_WITH(ipaddr-display,
1000 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1001 [
Damien Miller66409952000-01-17 21:40:06 +11001002 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001003 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001004 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001005 fi
1006 ]
1007)
1008
Damien Millera22ba012000-03-02 23:09:20 +11001009# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001010SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001011AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001012 [ --with-default-path=PATH Specify default \$PATH environment for server],
1013 [
1014 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001015 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001016 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001017 fi
1018 ]
1019)
1020
Damien Millera22ba012000-03-02 23:09:20 +11001021# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001022IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001023AC_ARG_WITH(ipv4-default,
1024 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1025 [
1026 if test "x$withval" != "xno" ; then
1027 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001028 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001029 fi
1030 ]
1031)
1032
Damien Miller61e50f12000-05-08 20:49:37 +10001033AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001034IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001035AC_ARG_WITH(4in6,
1036 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1037 [
1038 if test "x$withval" != "xno" ; then
1039 AC_MSG_RESULT(yes)
1040 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001041 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001042 else
1043 AC_MSG_RESULT(no)
1044 fi
1045 ],[
1046 if test "x$inet6_default_4in6" = "xyes"; then
1047 AC_MSG_RESULT([yes (default)])
1048 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001049 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001050 else
1051 AC_MSG_RESULT([no (default)])
1052 fi
1053 ]
1054)
1055
Damien Millera22ba012000-03-02 23:09:20 +11001056# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001057piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001058AC_ARG_WITH(pid-dir,
1059 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1060 [
1061 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001062 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001063 fi
1064 ]
1065)
Damien Miller4018c192000-04-30 09:30:44 +10001066
Damien Millerdbd250f2000-01-18 08:57:14 +11001067AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001068AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001069
andre2ff7b5d2000-06-03 14:57:40 +00001070dnl allow user to disable some login recording features
1071AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001072 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001073 [ AC_DEFINE(DISABLE_LASTLOG) ]
1074)
1075AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001076 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001077 [ AC_DEFINE(DISABLE_UTMP) ]
1078)
1079AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001080 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001081 [ AC_DEFINE(DISABLE_UTMPX) ]
1082)
1083AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001084 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001085 [ AC_DEFINE(DISABLE_WTMP) ]
1086)
1087AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001088 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001089 [ AC_DEFINE(DISABLE_WTMPX) ]
1090)
1091AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001092 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001093 [ AC_DEFINE(DISABLE_LOGIN) ]
1094)
1095AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001096 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001097 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1098)
1099AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001100 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001101 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1102)
1103AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001104 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001105 [ conf_lastlog_location="$withval"; ],)
1106
1107dnl lastlog, [uw]tmpx? detection
1108dnl NOTE: set the paths in the platform section to avoid the
1109dnl need for command-line parameters
1110dnl lastlog and [uw]tmp are subject to a file search if all else fails
1111
1112dnl lastlog detection
1113dnl NOTE: the code itself will detect if lastlog is a directory
1114AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1115AC_TRY_COMPILE([
1116#include <sys/types.h>
1117#include <utmp.h>
1118#ifdef HAVE_LASTLOG_H
1119# include <lastlog.h>
1120#endif
Damien Miller2994e082000-06-04 15:51:47 +10001121#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001122# include <paths.h>
1123#endif
1124 ],
1125 [ char *lastlog = LASTLOG_FILE; ],
1126 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001127 [
1128 AC_MSG_RESULT(no)
1129 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1130 AC_TRY_COMPILE([
1131#include <sys/types.h>
1132#include <utmp.h>
1133#ifdef HAVE_LASTLOG_H
1134# include <lastlog.h>
1135#endif
1136#ifdef HAVE_PATHS_H
1137# include <paths.h>
1138#endif
1139 ],
1140 [ char *lastlog = _PATH_LASTLOG; ],
1141 [ AC_MSG_RESULT(yes) ],
1142 [
andree441aa32000-06-12 22:34:38 +00001143 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001144 system_lastlog_path=no
1145 ])
1146 ]
andre2ff7b5d2000-06-03 14:57:40 +00001147)
Damien Miller2994e082000-06-04 15:51:47 +10001148
andre2ff7b5d2000-06-03 14:57:40 +00001149if test -z "$conf_lastlog_location"; then
1150 if test x"$system_lastlog_path" = x"no" ; then
1151 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001152 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001153 conf_lastlog_location=$f
1154 fi
1155 done
1156 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001157 AC_MSG_WARN([** Cannot find lastlog **])
1158 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001159 fi
1160 fi
1161fi
1162
1163if test -n "$conf_lastlog_location"; then
1164 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1165fi
1166
1167dnl utmp detection
1168AC_MSG_CHECKING([if your system defines UTMP_FILE])
1169AC_TRY_COMPILE([
1170#include <sys/types.h>
1171#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001172#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001173# include <paths.h>
1174#endif
1175 ],
1176 [ char *utmp = UTMP_FILE; ],
1177 [ AC_MSG_RESULT(yes) ],
1178 [ AC_MSG_RESULT(no)
1179 system_utmp_path=no ]
1180)
1181if test -z "$conf_utmp_location"; then
1182 if test x"$system_utmp_path" = x"no" ; then
1183 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1184 if test -f $f ; then
1185 conf_utmp_location=$f
1186 fi
1187 done
1188 if test -z "$conf_utmp_location"; then
1189 AC_DEFINE(DISABLE_UTMP)
1190 fi
1191 fi
1192fi
1193if test -n "$conf_utmp_location"; then
1194 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1195fi
1196
1197dnl wtmp detection
1198AC_MSG_CHECKING([if your system defines WTMP_FILE])
1199AC_TRY_COMPILE([
1200#include <sys/types.h>
1201#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001202#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001203# include <paths.h>
1204#endif
1205 ],
1206 [ char *wtmp = WTMP_FILE; ],
1207 [ AC_MSG_RESULT(yes) ],
1208 [ AC_MSG_RESULT(no)
1209 system_wtmp_path=no ]
1210)
1211if test -z "$conf_wtmp_location"; then
1212 if test x"$system_wtmp_path" = x"no" ; then
1213 for f in /usr/adm/wtmp /var/log/wtmp; do
1214 if test -f $f ; then
1215 conf_wtmp_location=$f
1216 fi
1217 done
1218 if test -z "$conf_wtmp_location"; then
1219 AC_DEFINE(DISABLE_WTMP)
1220 fi
1221 fi
1222fi
1223if test -n "$conf_wtmp_location"; then
1224 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1225fi
1226
1227
1228dnl utmpx detection - I don't know any system so perverse as to require
1229dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1230dnl there, though.
1231AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1232AC_TRY_COMPILE([
1233#include <sys/types.h>
1234#include <utmp.h>
1235#ifdef HAVE_UTMPX_H
1236#include <utmpx.h>
1237#endif
Damien Miller2994e082000-06-04 15:51:47 +10001238#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001239# include <paths.h>
1240#endif
1241 ],
1242 [ char *utmpx = UTMPX_FILE; ],
1243 [ AC_MSG_RESULT(yes) ],
1244 [ AC_MSG_RESULT(no)
1245 system_utmpx_path=no ]
1246)
1247if test -z "$conf_utmpx_location"; then
1248 if test x"$system_utmpx_path" = x"no" ; then
1249 AC_DEFINE(DISABLE_UTMPX)
1250 fi
1251else
1252 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1253fi
1254
1255dnl wtmpx detection
1256AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1257AC_TRY_COMPILE([
1258#include <sys/types.h>
1259#include <utmp.h>
1260#ifdef HAVE_UTMPX_H
1261#include <utmpx.h>
1262#endif
Damien Miller2994e082000-06-04 15:51:47 +10001263#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001264# include <paths.h>
1265#endif
1266 ],
1267 [ char *wtmpx = WTMPX_FILE; ],
1268 [ AC_MSG_RESULT(yes) ],
1269 [ AC_MSG_RESULT(no)
1270 system_wtmpx_path=no ]
1271)
1272if test -z "$conf_wtmpx_location"; then
1273 if test x"$system_wtmpx_path" = x"no" ; then
1274 AC_DEFINE(DISABLE_WTMPX)
1275 fi
1276else
1277 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1278fi
1279
Damien Miller4018c192000-04-30 09:30:44 +10001280
1281# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001282entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001283AC_ARG_WITH(entropy-timeout,
1284 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1285 [
1286 if test "x$withval" != "xno" ; then
1287 entropy_timeout=$withval
1288 fi
1289 ]
1290)
1291AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1292
1293
Damien Miller29ea30d2000-03-17 10:54:15 +11001294if test ! -z "$blibpath" ; then
1295 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1296 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1297fi
1298
Damien Miller0437b332000-05-02 09:56:41 +10001299AC_OUTPUT(Makefile ssh_prng_cmds)
1300
Damien Miller7b22d652000-06-18 14:07:04 +10001301# Print summary of options
1302
1303if test x$MANTYPE = x'$(CATMAN)' ; then
1304 MAN_MSG=cat
1305else
1306 MAN_MSG=man
1307fi
1308if test ! -z "$RANDOM_POOL" ; then
1309 RAND_MSG="Device ($RANDOM_POOL)"
1310else
1311 if test ! -z "$EGD_SOCKET" ; then
1312 RAND_MSG="EGD ($EGD_SOCKET)"
1313 else
1314 RAND_MSG="Builtin (timeout $entropy_timeout)"
1315 fi
1316fi
1317
1318# Someone please show me a better way :)
1319A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1320B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1321C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1322D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1323E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1324F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1325G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1326
1327echo ""
1328echo "OpenSSH configured has been configured with the following options."
1329echo " User binaries: $B"
1330echo " System binaries: $C"
1331echo " Configuration files: $D"
1332echo " Askpass program: $E"
1333echo " Manual pages: $F"
1334echo " PID file: $G"
1335echo " Random number collection: $RAND_MSG"
1336echo " Manpage format: $MAN_MSG"
1337echo " PAM support: ${PAM_MSG}"
1338echo " KerberosIV support: $KRB4_MSG"
1339echo " AFS support: $AFS_MSG"
1340echo " S/KEY support: $SKEY_MSG"
1341echo " TCP Wrappers support: $TCPW_MSG"
1342echo " MD5 password support: $MD5_MSG"
1343echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1344echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1345echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1346
1347echo ""
1348
1349echo "Compiler flags: ${CFLAGS}"
1350echo "Linker flags: ${LDFLAGS}"
1351echo "Libraries: ${LIBS}"
1352
1353echo ""
1354