blob: 974d0df6b6011fe445936619037319828dc93de7 [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
Damien Miller11fa2cc2000-08-16 10:35:58 +100090 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +110091 ;;
92*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110093 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100094 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110095 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +100096 AC_DEFINE(WITH_IRIX_ARRAY)
97 AC_DEFINE(WITH_IRIX_PROJECT)
98 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +110099 no_libsocket=1
100 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000101 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100102 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100103*-*-linux*)
104 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100105 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000106 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100107 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100108 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100109*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100110 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100111 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000112*-next-*)
113 # hardwire lastlog location (can't detect it on some versions)
114 conf_lastlog_location="/usr/adm/lastlog"
Damien Miller31abc9a2000-07-09 23:26:27 +1000115 conf_utmp_location=/etc/utmp
Damien Miller0f91b4e2000-06-18 15:43:25 +1000116 AC_DEFINE(HAVE_NEXT)
117 CFLAGS="$CFLAGS -I/usr/local/include"
118 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000119 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
120 AC_MSG_WARN([*** Expect 'scp' to fail!])
121 AC_MSG_WARN([*** Please report any problems, thanks])
122 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100123*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100124 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100125 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100126 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000127 # hardwire lastlog location (can't detect it on some versions)
128 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000129 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
130 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
131 if test "$sol2ver" -ge 8; then
132 AC_MSG_RESULT(yes)
133 AC_DEFINE(DISABLE_UTMP)
134 AC_DEFINE(DISABLE_WTMP)
135 else
136 AC_MSG_RESULT(no)
137 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100138 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000139*-*-sunos4*)
140 CFLAGS="$CFLAGS -DSUNOS4"
141 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000142 conf_utmp_location=/etc/utmp
143 conf_wtmp_location=/var/adm/wtmp
144 conf_lastlog_location=/var/adm/lastlog
145 MANTYPE='$(CATMAN)'
146 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000147 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000148*-sni-sysv*)
149 CFLAGS="$CFLAGS -I/usr/local/include"
150 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
151 MANTYPE='$(CATMAN)'
152 AC_DEFINE(IP_TOS_IS_BROKEN)
153 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000154 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000155 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100156*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100157 CFLAGS="$CFLAGS -I/usr/local/include"
158 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100159 MANTYPE='$(CATMAN)'
160 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100161 LIBS="$LIBS -lgen -lsocket"
162 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000163*-*-sco3*)
164 CFLAGS="$CFLAGS -I/usr/local/include"
165 LDFLAGS="$LDFLAGS -L/usr/local/lib"
166 MANTYPE='$(CATMAN)'
167 mansubdir=cat
168 LIBS="$LIBS -lgen -lsocket"
169 no_dev_ptmx=1
170 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000171*-dec-osf*)
172# This is untested
173 if test ! -z "USE_SIA" ; then
174 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
175 if test -f /etc/sia/matrix.conf; then
176 AC_MSG_RESULT(yes)
177 AC_DEFINE(HAVE_OSF_SIA)
178 AC_DEFINE(DISABLE_LOGIN)
179 LIBS="$LIBS -lsecurity -ldb -lm -laud"
180 else
181 AC_MSG_RESULT(no)
182 fi
183 fi
184 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100185esac
186
Damien Millere37bfc12000-06-05 09:37:43 +1000187# Allow user to specify flags
188AC_ARG_WITH(cflags,
189 [ --with-cflags Specify additional flags to pass to compiler],
190 [
191 if test "x$withval" != "xno" ; then
192 CFLAGS="$CFLAGS $withval"
193 fi
194 ]
195)
196AC_ARG_WITH(ldflags,
197 [ --with-ldlags Specify additional flags to pass to linker],
198 [
199 if test "x$withval" != "xno" ; then
200 LDFLAGS="$LDFLAGS $withval"
201 fi
202 ]
203)
204AC_ARG_WITH(libs,
205 [ --with-libs Specify additional libraries to link with],
206 [
207 if test "x$withval" != "xno" ; then
208 LIBS="$LIBS $withval"
209 fi
210 ]
211)
212
213
Damien Millera22ba012000-03-02 23:09:20 +1100214# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100215AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
216AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100217
Damien Millerbeb4ba51999-12-28 15:09:35 +1100218if test -z "$no_libsocket" ; then
219 AC_CHECK_LIB(nsl, yp_match, , )
220fi
221if test -z "$no_libnsl" ; then
222 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100223fi
Damien Millerab18c411999-11-11 10:40:23 +1100224
Damien Millera22ba012000-03-02 23:09:20 +1100225# Checks for header files.
Damien Miller348c9b72000-08-15 10:01:22 +1000226AC_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 ttyent.h usersec.h util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100227
Damien Millera22ba012000-03-02 23:09:20 +1100228# Checks for library functions.
Damien Miller11fa2cc2000-08-16 10:35:58 +1000229AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa 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 +0000230dnl checks for time functions
231AC_CHECK_FUNCS(gettimeofday time)
232dnl checks for libutil functions
233AC_CHECK_FUNCS(login logout updwtmp logwtmp)
234dnl checks for utmp functions
235AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
236AC_CHECK_FUNCS(utmpname)
237dnl checks for utmpx functions
238AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
239AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100240
Damien Miller5fc85652000-07-09 23:53:07 +1000241AC_CHECK_FUNC(getuserattr,
242 [AC_DEFINE(HAVE_GETUSERATTR)],
243 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
244)
245
Damien Miller04f80141999-11-19 15:32:34 +1100246AC_CHECK_FUNC(login,
247 [AC_DEFINE(HAVE_LOGIN)],
248 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
249)
250
251AC_CHECK_FUNC(daemon,
252 [AC_DEFINE(HAVE_DAEMON)],
253 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
254)
255
Damien Miller9fb07e42000-03-05 16:22:59 +1100256AC_CHECK_FUNC(getpagesize,
257 [AC_DEFINE(HAVE_GETPAGESIZE)],
258 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
259)
260
Damien Millercb170cb2000-07-01 16:52:55 +1000261# Check for broken snprintf
262if test "x$ac_cv_func_snprintf" = "xyes" ; then
263 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
264 AC_TRY_RUN(
265 [
266#include <stdio.h>
267int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
268 ],
269 [AC_MSG_RESULT(yes)],
270 [
271 AC_MSG_RESULT(no)
272 AC_DEFINE(BROKEN_SNPRINTF)
273 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
274 ]
275 )
276fi
277
Damien Miller7b22d652000-06-18 14:07:04 +1000278PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100279AC_ARG_WITH(pam,
280 [ --without-pam Disable PAM support ],
281 [
282 if test "x$withval" = "xno" ; then
283 no_pam=1
284 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000285 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100286 fi
287 ]
288)
Damien Milleredb82922000-06-20 13:25:52 +1000289if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100290 AC_CHECK_LIB(dl, dlopen, , )
291 LIBS="$LIBS -lpam"
292
Damien Miller0e65eed2000-05-17 22:16:05 +1000293 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000294
Damien Miller1f335fb2000-06-26 11:31:33 +1000295 disable_shadow=yes
296
Damien Miller7b22d652000-06-18 14:07:04 +1000297 PAM_MSG="yes"
298
Damien Millera22ba012000-03-02 23:09:20 +1100299 # Check PAM strerror arguments (old PAM)
300 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
301 AC_TRY_COMPILE(
302 [
Damien Miller81171112000-04-23 11:14:01 +1000303#include <stdlib.h>
304#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100305 ],
306 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
307 [AC_MSG_RESULT(no)],
308 [
309 AC_DEFINE(HAVE_OLD_PAM)
310 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000311 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100312 ]
313 )
314fi
315
316# The big search for OpenSSL
317AC_ARG_WITH(ssl-dir,
318 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
319 [
320 if test "x$withval" != "$xno" ; then
321 tryssldir=$withval
322 fi
323 ]
324)
325
326saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100327saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100328saved_CFLAGS="$CFLAGS"
329if test "x$prefix" != "xNONE" ; then
330 tryssldir="$tryssldir $prefix"
331fi
Damien Miller61e50f12000-05-08 20:49:37 +1000332AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100333
Damien Miller61e50f12000-05-08 20:49:37 +1000334 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
335 if test ! -z "$ssldir" ; then
336 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
337 CFLAGS="$saved_CFLAGS -I$ssldir/include"
338 if test ! -z "$need_dash_r" ; then
339 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
340 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100341 else
Damien Miller61e50f12000-05-08 20:49:37 +1000342 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100343 fi
344
Damien Miller3b512e12000-05-17 23:29:18 +1000345 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000346
Damien Miller3b512e12000-05-17 23:29:18 +1000347 # Basic test to check for compatible version and correct linking
348 # *does not* test for RSA - that comes later.
349 AC_TRY_RUN(
350 [
Damien Millere59ce622000-05-01 20:54:17 +1000351#include <string.h>
352#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000353int main(void)
354{
Damien Miller3b512e12000-05-17 23:29:18 +1000355 char a[2048];
356 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000357 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000358 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000359}
Damien Miller3b512e12000-05-17 23:29:18 +1000360 ],
361 [
362 found_crypto=1
363 break;
364 ], []
365 )
Damien Miller61e50f12000-05-08 20:49:37 +1000366
367 if test ! -z "$found_crypto" ; then
368 break;
369 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100370 done
371
Damien Miller61e50f12000-05-08 20:49:37 +1000372 if test -z "$found_crypto" ; then
373 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100374 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000375 if test -z "$ssldir" ; then
376 ssldir="(system)"
377 fi
Damien Millera22ba012000-03-02 23:09:20 +1100378
Damien Miller61e50f12000-05-08 20:49:37 +1000379 ac_cv_openssldir=$ssldir
380])
381
Damien Milleredb82922000-06-20 13:25:52 +1000382if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000383 AC_DEFINE(HAVE_OPENSSL)
384 dnl Need to recover ssldir - test above runs in subshell
385 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100386 CFLAGS="$saved_CFLAGS -I$ssldir/include"
387 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
388 if test ! -z "$need_dash_r" ; then
389 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100390 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100391 if test ! -z "$blibpath" ; then
392 blibpath="$blibpath:$ssldir:$ssldir/lib"
393 fi
Damien Millera22ba012000-03-02 23:09:20 +1100394fi
Damien Miller3b512e12000-05-17 23:29:18 +1000395LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000396
Damien Miller3b512e12000-05-17 23:29:18 +1000397# Now test RSA support
398saved_LIBS="$LIBS"
399AC_MSG_CHECKING([for RSA support])
400for WANTS_RSAREF in "" 1 ; do
401 if test -z "$WANTS_RSAREF" ; then
402 LIBS="$saved_LIBS"
403 else
404 LIBS="$saved_LIBS -lRSAglue -lrsaref"
405 fi
406 AC_TRY_RUN([
407#include <string.h>
408#include <openssl/rand.h>
409#include <openssl/rsa.h>
410#include <openssl/bn.h>
411#include <openssl/sha.h>
412int main(void)
413{
414 int num; RSA *key; static unsigned char p_in[] = "blahblah";
415 unsigned char c[256], p[256];
416 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
417 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
418 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
419 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
420}
421 ],
422 [
423 rsa_works=1
424 break;
425 ], [])
426done
427
428if test ! -z "$no_rsa" ; then
429 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000430 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000431else
432 if test -z "$rsa_works" ; then
433 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000434 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000435 else
436 if test -z "$WANTS_RSAREF" ; then
437 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000438 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000439 else
Damien Miller7b22d652000-06-18 14:07:04 +1000440 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000441 AC_MSG_RESULT(using RSAref)
442 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
443 fi
444 fi
445fi
Damien Millera22ba012000-03-02 23:09:20 +1100446
447# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100448AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100449AC_CHECK_SIZEOF(short int, 2)
450AC_CHECK_SIZEOF(int, 4)
451AC_CHECK_SIZEOF(long int, 4)
452AC_CHECK_SIZEOF(long long int, 8)
453
Damien Millera22ba012000-03-02 23:09:20 +1100454# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000455AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
456 AC_TRY_COMPILE(
457 [ #include <sys/types.h> ],
458 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
459 [ ac_cv_have_intxx_t="yes" ],
460 [ ac_cv_have_intxx_t="no" ]
461 )
462])
463if test "x$ac_cv_have_intxx_t" = "xyes" ; then
464 AC_DEFINE(HAVE_INTXX_T)
465 have_intxx_t=1
466fi
467
468AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
469 AC_TRY_COMPILE(
470 [ #include <sys/types.h> ],
471 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
472 [ ac_cv_have_u_intxx_t="yes" ],
473 [ ac_cv_have_u_intxx_t="no" ]
474 )
475])
476if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
477 AC_DEFINE(HAVE_U_INTXX_T)
478 have_u_intxx_t=1
479fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100480
Damien Millerc6398ef1999-11-20 12:18:40 +1100481
Damien Milleredb82922000-06-20 13:25:52 +1000482if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
483 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100484then
485 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
486 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000487 [
488#include <sys/bitypes.h>
489 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100490 [
Damien Miller70494d12000-04-03 15:57:06 +1000491 int8_t a; int16_t b; int32_t c;
492 u_int8_t e; u_int16_t f; u_int32_t g;
493 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100494 ],
495 [
496 AC_DEFINE(HAVE_U_INTXX_T)
497 AC_DEFINE(HAVE_INTXX_T)
498 AC_MSG_RESULT(yes)
499 ],
500 [AC_MSG_RESULT(no)]
501 )
502fi
503
Damien Millerd6121d22000-03-17 23:26:46 +1100504if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000505 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
506 AC_TRY_COMPILE(
507 [
508#include <sys/types.h>
509 ],
510 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
511 [ ac_cv_have_uintxx_t="yes" ],
512 [ ac_cv_have_uintxx_t="no" ]
513 )
514 ])
515 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
516 AC_DEFINE(HAVE_UINTXX_T)
517 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100518fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100519
Damien Miller61e50f12000-05-08 20:49:37 +1000520AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
521 AC_TRY_COMPILE(
522 [
Damien Miller81171112000-04-23 11:14:01 +1000523#include <sys/types.h>
524#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000525 ],
526 [socklen_t foo; foo = 1235;],
527 [ ac_cv_have_socklen_t="yes" ],
528 [ ac_cv_have_socklen_t="no" ]
529 )
530])
531if test "x$ac_cv_have_socklen_t" = "xyes" ; then
532 AC_DEFINE(HAVE_SOCKLEN_T)
533fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100534
Damien Miller61e50f12000-05-08 20:49:37 +1000535AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
536 AC_TRY_COMPILE(
537 [
538#include <sys/types.h>
539 ],
540 [ size_t foo; foo = 1235; ],
541 [ ac_cv_have_size_t="yes" ],
542 [ ac_cv_have_size_t="no" ]
543 )
544])
545if test "x$ac_cv_have_size_t" = "xyes" ; then
546 AC_DEFINE(HAVE_SIZE_T)
547fi
Damien Miller95058511999-12-29 10:36:45 +1100548
Damien Miller615f9392000-05-17 22:53:33 +1000549AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
550 AC_TRY_COMPILE(
551 [
552#include <sys/types.h>
553 ],
554 [ ssize_t foo; foo = 1235; ],
555 [ ac_cv_have_ssize_t="yes" ],
556 [ ac_cv_have_ssize_t="no" ]
557 )
558])
559if test "x$ac_cv_have_ssize_t" = "xyes" ; then
560 AC_DEFINE(HAVE_SSIZE_T)
561fi
562
Damien Millerb54b40e2000-06-23 08:23:34 +1000563AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
564 AC_TRY_COMPILE(
565 [
566#include <sys/types.h>
567#include <sys/socket.h>
568 ],
569 [ sa_family_t foo; foo = 1235; ],
570 [ ac_cv_have_sa_family_t="yes" ],
571 [ ac_cv_have_sa_family_t="no" ]
572 )
573])
574if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
575 AC_DEFINE(HAVE_SA_FAMILY_T)
576fi
577
Damien Miller0f91b4e2000-06-18 15:43:25 +1000578AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
579 AC_TRY_COMPILE(
580 [
581#include <sys/types.h>
582 ],
583 [ pid_t foo; foo = 1235; ],
584 [ ac_cv_have_pid_t="yes" ],
585 [ ac_cv_have_pid_t="no" ]
586 )
587])
588if test "x$ac_cv_have_pid_t" = "xyes" ; then
589 AC_DEFINE(HAVE_PID_T)
590fi
591
592AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
593 AC_TRY_COMPILE(
594 [
595#include <sys/types.h>
596 ],
597 [ mode_t foo; foo = 1235; ],
598 [ ac_cv_have_mode_t="yes" ],
599 [ ac_cv_have_mode_t="no" ]
600 )
601])
602if test "x$ac_cv_have_mode_t" = "xyes" ; then
603 AC_DEFINE(HAVE_MODE_T)
604fi
605
Damien Miller61e50f12000-05-08 20:49:37 +1000606
607AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
608 AC_TRY_COMPILE(
609 [
Damien Miller81171112000-04-23 11:14:01 +1000610#include <sys/types.h>
611#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000612 ],
613 [ struct sockaddr_storage s; ],
614 [ ac_cv_have_struct_sockaddr_storage="yes" ],
615 [ ac_cv_have_struct_sockaddr_storage="no" ]
616 )
617])
618if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
619 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
620fi
Damien Miller34132e52000-01-14 15:45:46 +1100621
Damien Miller61e50f12000-05-08 20:49:37 +1000622AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
623 AC_TRY_COMPILE(
624 [
Damien Miller7b22d652000-06-18 14:07:04 +1000625#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000626#include <netinet/in.h>
627 ],
628 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
629 [ ac_cv_have_struct_sockaddr_in6="yes" ],
630 [ ac_cv_have_struct_sockaddr_in6="no" ]
631 )
632])
633if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
634 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
635fi
Damien Miller34132e52000-01-14 15:45:46 +1100636
Damien Miller61e50f12000-05-08 20:49:37 +1000637AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
638 AC_TRY_COMPILE(
639 [
Damien Miller7b22d652000-06-18 14:07:04 +1000640#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000641#include <netinet/in.h>
642 ],
643 [ struct in6_addr s; s.s6_addr[0] = 0; ],
644 [ ac_cv_have_struct_in6_addr="yes" ],
645 [ ac_cv_have_struct_in6_addr="no" ]
646 )
647])
648if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
649 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
650fi
Damien Miller34132e52000-01-14 15:45:46 +1100651
Damien Miller61e50f12000-05-08 20:49:37 +1000652AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
653 AC_TRY_COMPILE(
654 [
Damien Miller81171112000-04-23 11:14:01 +1000655#include <sys/types.h>
656#include <sys/socket.h>
657#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000658 ],
659 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
660 [ ac_cv_have_struct_addrinfo="yes" ],
661 [ ac_cv_have_struct_addrinfo="no" ]
662 )
663])
664if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
665 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
666fi
667
Damien Miller34132e52000-01-14 15:45:46 +1100668
Damien Millera22ba012000-03-02 23:09:20 +1100669# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100670
Damien Miller61e50f12000-05-08 20:49:37 +1000671OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
672OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
673OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
674OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
675OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000676OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000677OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
678OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000679OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000680OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
681OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
682OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
683OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000684OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
685OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
686OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
687OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
688
Damien Miller61e50f12000-05-08 20:49:37 +1000689AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
690 ac_cv_have_ss_family_in_struct_ss, [
691 AC_TRY_COMPILE(
692 [
Damien Miller81171112000-04-23 11:14:01 +1000693#include <sys/types.h>
694#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000695 ],
696 [ struct sockaddr_storage s; s.ss_family = 1; ],
697 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
698 [ ac_cv_have_ss_family_in_struct_ss="no" ],
699 )
700])
701if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
702 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
703fi
704
Damien Miller61e50f12000-05-08 20:49:37 +1000705AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
706 ac_cv_have___ss_family_in_struct_ss, [
707 AC_TRY_COMPILE(
708 [
Damien Miller81171112000-04-23 11:14:01 +1000709#include <sys/types.h>
710#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000711 ],
712 [ struct sockaddr_storage s; s.__ss_family = 1; ],
713 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
714 [ ac_cv_have___ss_family_in_struct_ss="no" ]
715 )
716])
717if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
718 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
719fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100720
Damien Miller61e50f12000-05-08 20:49:37 +1000721
722AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
723 AC_TRY_LINK([],
724 [ extern char *__progname; printf("%s", __progname); ],
725 [ ac_cv_libc_defines___progname="yes" ],
726 [ ac_cv_libc_defines___progname="no" ]
727 )
728])
729if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
730 AC_DEFINE(HAVE___PROGNAME)
731fi
732
Damien Millera22ba012000-03-02 23:09:20 +1100733
Damien Millerecbb26d2000-07-15 14:59:14 +1000734AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
735 AC_TRY_LINK([],
736 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
737 [ ac_cv_libc_defines_sys_errlist="yes" ],
738 [ ac_cv_libc_defines_sys_errlist="no" ]
739 )
740])
741if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
742 AC_DEFINE(HAVE_SYS_ERRLIST)
743fi
744
745
Damien Miller11fa2cc2000-08-16 10:35:58 +1000746AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
747 AC_TRY_LINK([],
748 [ extern int sys_nerr; printf("%i", sys_nerr);],
749 [ ac_cv_libc_defines_sys_nerr="yes" ],
750 [ ac_cv_libc_defines_sys_nerr="no" ]
751 )
752])
753if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
754 AC_DEFINE(HAVE_SYS_NERR)
755fi
756
757
Damien Millera22ba012000-03-02 23:09:20 +1100758# Looking for programs, paths and files
759AC_ARG_WITH(rsh,
760 [ --with-rsh=PATH Specify path to remote shell program ],
761 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100762 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000763 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100764 fi
765 ],
766 [
767 AC_PATH_PROG(rsh_path, rsh)
768 ]
769)
770
771AC_ARG_WITH(xauth,
772 [ --with-xauth=PATH Specify path to xauth program ],
773 [
774 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000775 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100776 fi
777 ],
778 [
779 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000780 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100781 xauth_path="/usr/openwin/bin/xauth"
782 fi
783 ]
784)
785
786if test ! -z "$xauth_path" ; then
787 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
788fi
789if test ! -z "$rsh_path" ; then
790 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
791fi
792
793# Check for mail directory (last resort if we cannot get it from headers)
794if test ! -z "$MAIL" ; then
795 maildir=`dirname $MAIL`
796 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
797fi
798
Damien Millera22ba012000-03-02 23:09:20 +1100799if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100800 AC_CHECK_FILE("/dev/ptmx",
801 [
802 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
803 have_dev_ptmx=1
804 ]
805 )
Damien Millera22ba012000-03-02 23:09:20 +1100806fi
Damien Miller204ad072000-03-02 23:56:12 +1100807AC_CHECK_FILE("/dev/ptc",
808 [
809 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
810 have_dev_ptc=1
811 ]
812)
813
Damien Millera22ba012000-03-02 23:09:20 +1100814# Options from here on. Some of these are preset by platform above
815
Damien Millera22ba012000-03-02 23:09:20 +1100816# Check for user-specified random device, otherwise check /dev/urandom
817AC_ARG_WITH(random,
818 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
819 [
Damien Miller040f3832000-04-03 14:50:43 +1000820 if test "x$withval" != "xno" ; then
821 RANDOM_POOL="$withval";
822 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
823 fi
Damien Millera22ba012000-03-02 23:09:20 +1100824 ],
825 [
826 # Check for random device
827 AC_CHECK_FILE("/dev/urandom",
828 [
829 RANDOM_POOL="/dev/urandom";
830 AC_SUBST(RANDOM_POOL)
831 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
832 ]
833 )
834 ]
835)
836
837# Check for EGD pool file
838AC_ARG_WITH(egd-pool,
839 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
840 [
Damien Miller040f3832000-04-03 14:50:43 +1000841 if test "x$withval" != "xno" ; then
842 EGD_SOCKET="$withval";
843 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
844 fi
Damien Millera22ba012000-03-02 23:09:20 +1100845 ]
846)
847
Damien Miller0437b332000-05-02 09:56:41 +1000848# detect pathnames for entropy gathering commands, if we need them
849INSTALL_SSH_PRNG_CMDS=""
850rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000851if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000852 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000853 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
854 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
855 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
856 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
857 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
858 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
859 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
860 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
861 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
862 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
863 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
864 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
865 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
866 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
867 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000868
869 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000870fi
Damien Miller0437b332000-05-02 09:56:41 +1000871AC_SUBST(INSTALL_SSH_PRNG_CMDS)
872
Damien Miller11e37f62000-04-08 18:23:30 +1000873
Damien Miller670a4b82000-01-22 13:53:11 +1100874AC_ARG_WITH(catman,
875 [ --with-catman=man|cat Install preformatted manpages[no]],
876 [
877 MANTYPE='$(CATMAN)'
878 if test x"$withval" != x"yes" ; then
879 mansubdir=$withval
880 else
881 mansubdir=cat
882 fi
883 ], [
884 if test -z "$MANTYPE" ; then
885 MANTYPE='$(TROFFMAN)'
886 mansubdir=man
887 fi
888 ]
889)
890AC_SUBST(MANTYPE)
891AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100892
Damien Millera22ba012000-03-02 23:09:20 +1100893# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000894KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100895AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100896 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100897 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100898 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100899
900 if test "x$withval" != "$xyes" ; then
901 CFLAGS="$CFLAGS -I${withval}/include"
902 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100903 if test ! -z "$need_dash_r" ; then
904 LDFLAGS="$LDFLAGS -R${withval}/lib"
905 fi
906 if test ! -z "$blibpath" ; then
907 blibpath="$blibpath:${withval}/lib"
908 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100909 else
910 if test -d /usr/include/kerberosIV ; then
911 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
912 fi
913 fi
914
915 AC_CHECK_HEADERS(krb.h)
916 AC_CHECK_LIB(krb, main)
917 if test "$ac_cv_header_krb_h" != yes; then
918 AC_MSG_WARN([Cannot find krb.h, build may fail])
919 fi
920 if test "$ac_cv_lib_krb_main" != yes; then
921 AC_MSG_WARN([Cannot find libkrb, build may fail])
922 fi
923
Damien Millerc85f9b42000-01-29 10:20:21 +1100924 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100925 AC_CHECK_LIB(resolv, dn_expand, , )
926 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000927 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100928 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100929 fi
Damien Miller80297751999-11-19 13:03:25 +1100930 ]
931)
932
Damien Millera22ba012000-03-02 23:09:20 +1100933# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000934AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100935AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100936 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100937 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100938 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100939
940 if test "x$withval" != "$xyes" ; then
941 CFLAGS="$CFLAGS -I${withval}/include"
942 LFLAGS="$LFLAGS -L${withval}/lib"
943 fi
944
945 if test -z "$KRB4" ; then
946 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
947 fi
948
Damien Miller8bdeee21999-12-30 15:50:54 +1100949 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100950 if test ! -z "$AFS_LIBS" ; then
951 LIBS="$LIBS $AFS_LIBS"
952 fi
953 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000954 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100955 fi
Damien Miller80297751999-11-19 13:03:25 +1100956 ]
957)
Damien Millerc85f9b42000-01-29 10:20:21 +1100958LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100959
Damien Millera22ba012000-03-02 23:09:20 +1100960# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000961SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100962AC_ARG_WITH(skey,
963 [ --with-skey Enable S/Key support],
964 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100965 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100966 AC_DEFINE(SKEY)
967 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000968 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100969 fi
Damien Miller80297751999-11-19 13:03:25 +1100970 ]
971)
972
Damien Millera22ba012000-03-02 23:09:20 +1100973# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000974TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100975AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100976 [ --with-tcp-wrappers Enable tcpwrappers support],
977 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100978 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100979 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100980 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100981 AC_MSG_CHECKING(for libwrap)
982 AC_TRY_LINK(
983 [
Damien Miller81171112000-04-23 11:14:01 +1000984#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100985 int deny_severity = 0, allow_severity = 0;
986 ],
987 [hosts_access(0);],
988 [
989 AC_MSG_RESULT(yes)
990 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +1000991 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +1100992 ],
993 [
Damien Miller7b22d652000-06-18 14:07:04 +1000994 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +1100995 ]
996 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100997 fi
Damien Miller80297751999-11-19 13:03:25 +1100998 ]
999)
1000
Damien Millera22ba012000-03-02 23:09:20 +11001001# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001002MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001003AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001004 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001005 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001006 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001007 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001008 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001009 fi
1010 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001011)
1012
Damien Millera22ba012000-03-02 23:09:20 +11001013# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001014AC_ARG_WITH(shadow,
1015 [ --without-shadow Disable shadow password support],
1016 [
1017 if test "x$withval" = "xno" ; then
1018 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001019 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001020 fi
1021 ]
1022)
1023
Damien Miller1f335fb2000-06-26 11:31:33 +10001024if test -z "$disable_shadow" ; then
1025 AC_MSG_CHECKING([if the systems has expire shadow information])
1026 AC_TRY_COMPILE(
1027 [
1028#include <sys/types.h>
1029#include <shadow.h>
1030 struct spwd sp;
1031 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1032 [ sp_expire_available=yes ], []
1033 )
1034
1035 if test "x$sp_expire_available" = "xyes" ; then
1036 AC_MSG_RESULT(yes)
1037 AC_DEFINE(HAS_SHADOW_EXPIRE)
1038 else
1039 AC_MSG_RESULT(no)
1040 fi
1041fi
1042
Damien Millera22ba012000-03-02 23:09:20 +11001043# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001044DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001045AC_ARG_WITH(ipaddr-display,
1046 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1047 [
Damien Millere477ef62000-08-15 10:21:17 +10001048 if test "x$withval" != "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001049 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001050 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001051 fi
1052 ]
1053)
1054
Damien Millera22ba012000-03-02 23:09:20 +11001055# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001056SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001057AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001058 [ --with-default-path=PATH Specify default \$PATH environment for server],
1059 [
1060 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001061 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001062 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001063 fi
1064 ]
1065)
1066
Damien Millera22ba012000-03-02 23:09:20 +11001067# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001068IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001069AC_ARG_WITH(ipv4-default,
1070 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1071 [
1072 if test "x$withval" != "xno" ; then
1073 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001074 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001075 fi
1076 ]
1077)
1078
Damien Miller61e50f12000-05-08 20:49:37 +10001079AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001080IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001081AC_ARG_WITH(4in6,
1082 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1083 [
1084 if test "x$withval" != "xno" ; then
1085 AC_MSG_RESULT(yes)
1086 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001087 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001088 else
1089 AC_MSG_RESULT(no)
1090 fi
1091 ],[
1092 if test "x$inet6_default_4in6" = "xyes"; then
1093 AC_MSG_RESULT([yes (default)])
1094 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001095 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001096 else
1097 AC_MSG_RESULT([no (default)])
1098 fi
1099 ]
1100)
1101
Damien Millera22ba012000-03-02 23:09:20 +11001102# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001103piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001104AC_ARG_WITH(pid-dir,
1105 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1106 [
1107 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001108 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001109 fi
1110 ]
1111)
Damien Miller4018c192000-04-30 09:30:44 +10001112
Damien Millerdbd250f2000-01-18 08:57:14 +11001113AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001114AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001115
andre2ff7b5d2000-06-03 14:57:40 +00001116dnl allow user to disable some login recording features
1117AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001118 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001119 [ AC_DEFINE(DISABLE_LASTLOG) ]
1120)
1121AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001122 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001123 [ AC_DEFINE(DISABLE_UTMP) ]
1124)
1125AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001126 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001127 [ AC_DEFINE(DISABLE_UTMPX) ]
1128)
1129AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001130 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001131 [ AC_DEFINE(DISABLE_WTMP) ]
1132)
1133AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001134 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001135 [ AC_DEFINE(DISABLE_WTMPX) ]
1136)
1137AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001138 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001139 [ AC_DEFINE(DISABLE_LOGIN) ]
1140)
1141AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001142 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001143 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1144)
1145AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001146 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001147 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1148)
1149AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001150 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001151 [ conf_lastlog_location="$withval"; ],)
1152
1153dnl lastlog, [uw]tmpx? detection
1154dnl NOTE: set the paths in the platform section to avoid the
1155dnl need for command-line parameters
1156dnl lastlog and [uw]tmp are subject to a file search if all else fails
1157
1158dnl lastlog detection
1159dnl NOTE: the code itself will detect if lastlog is a directory
1160AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1161AC_TRY_COMPILE([
1162#include <sys/types.h>
1163#include <utmp.h>
1164#ifdef HAVE_LASTLOG_H
1165# include <lastlog.h>
1166#endif
Damien Miller2994e082000-06-04 15:51:47 +10001167#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001168# include <paths.h>
1169#endif
1170 ],
1171 [ char *lastlog = LASTLOG_FILE; ],
1172 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001173 [
1174 AC_MSG_RESULT(no)
1175 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1176 AC_TRY_COMPILE([
1177#include <sys/types.h>
1178#include <utmp.h>
1179#ifdef HAVE_LASTLOG_H
1180# include <lastlog.h>
1181#endif
1182#ifdef HAVE_PATHS_H
1183# include <paths.h>
1184#endif
1185 ],
1186 [ char *lastlog = _PATH_LASTLOG; ],
1187 [ AC_MSG_RESULT(yes) ],
1188 [
andree441aa32000-06-12 22:34:38 +00001189 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001190 system_lastlog_path=no
1191 ])
1192 ]
andre2ff7b5d2000-06-03 14:57:40 +00001193)
Damien Miller2994e082000-06-04 15:51:47 +10001194
andre2ff7b5d2000-06-03 14:57:40 +00001195if test -z "$conf_lastlog_location"; then
1196 if test x"$system_lastlog_path" = x"no" ; then
1197 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001198 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001199 conf_lastlog_location=$f
1200 fi
1201 done
1202 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001203 AC_MSG_WARN([** Cannot find lastlog **])
1204 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001205 fi
1206 fi
1207fi
1208
1209if test -n "$conf_lastlog_location"; then
1210 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1211fi
1212
1213dnl utmp detection
1214AC_MSG_CHECKING([if your system defines UTMP_FILE])
1215AC_TRY_COMPILE([
1216#include <sys/types.h>
1217#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001218#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001219# include <paths.h>
1220#endif
1221 ],
1222 [ char *utmp = UTMP_FILE; ],
1223 [ AC_MSG_RESULT(yes) ],
1224 [ AC_MSG_RESULT(no)
1225 system_utmp_path=no ]
1226)
1227if test -z "$conf_utmp_location"; then
1228 if test x"$system_utmp_path" = x"no" ; then
1229 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1230 if test -f $f ; then
1231 conf_utmp_location=$f
1232 fi
1233 done
1234 if test -z "$conf_utmp_location"; then
1235 AC_DEFINE(DISABLE_UTMP)
1236 fi
1237 fi
1238fi
1239if test -n "$conf_utmp_location"; then
1240 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1241fi
1242
1243dnl wtmp detection
1244AC_MSG_CHECKING([if your system defines WTMP_FILE])
1245AC_TRY_COMPILE([
1246#include <sys/types.h>
1247#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001248#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001249# include <paths.h>
1250#endif
1251 ],
1252 [ char *wtmp = WTMP_FILE; ],
1253 [ AC_MSG_RESULT(yes) ],
1254 [ AC_MSG_RESULT(no)
1255 system_wtmp_path=no ]
1256)
1257if test -z "$conf_wtmp_location"; then
1258 if test x"$system_wtmp_path" = x"no" ; then
1259 for f in /usr/adm/wtmp /var/log/wtmp; do
1260 if test -f $f ; then
1261 conf_wtmp_location=$f
1262 fi
1263 done
1264 if test -z "$conf_wtmp_location"; then
1265 AC_DEFINE(DISABLE_WTMP)
1266 fi
1267 fi
1268fi
1269if test -n "$conf_wtmp_location"; then
1270 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1271fi
1272
1273
1274dnl utmpx detection - I don't know any system so perverse as to require
1275dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1276dnl there, though.
1277AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1278AC_TRY_COMPILE([
1279#include <sys/types.h>
1280#include <utmp.h>
1281#ifdef HAVE_UTMPX_H
1282#include <utmpx.h>
1283#endif
Damien Miller2994e082000-06-04 15:51:47 +10001284#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001285# include <paths.h>
1286#endif
1287 ],
1288 [ char *utmpx = UTMPX_FILE; ],
1289 [ AC_MSG_RESULT(yes) ],
1290 [ AC_MSG_RESULT(no)
1291 system_utmpx_path=no ]
1292)
1293if test -z "$conf_utmpx_location"; then
1294 if test x"$system_utmpx_path" = x"no" ; then
1295 AC_DEFINE(DISABLE_UTMPX)
1296 fi
1297else
1298 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1299fi
1300
1301dnl wtmpx detection
1302AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1303AC_TRY_COMPILE([
1304#include <sys/types.h>
1305#include <utmp.h>
1306#ifdef HAVE_UTMPX_H
1307#include <utmpx.h>
1308#endif
Damien Miller2994e082000-06-04 15:51:47 +10001309#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001310# include <paths.h>
1311#endif
1312 ],
1313 [ char *wtmpx = WTMPX_FILE; ],
1314 [ AC_MSG_RESULT(yes) ],
1315 [ AC_MSG_RESULT(no)
1316 system_wtmpx_path=no ]
1317)
1318if test -z "$conf_wtmpx_location"; then
1319 if test x"$system_wtmpx_path" = x"no" ; then
1320 AC_DEFINE(DISABLE_WTMPX)
1321 fi
1322else
1323 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1324fi
1325
Damien Miller4018c192000-04-30 09:30:44 +10001326
1327# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001328entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001329AC_ARG_WITH(entropy-timeout,
1330 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1331 [
1332 if test "x$withval" != "xno" ; then
1333 entropy_timeout=$withval
1334 fi
1335 ]
1336)
1337AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1338
1339
Damien Miller29ea30d2000-03-17 10:54:15 +11001340if test ! -z "$blibpath" ; then
1341 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1342 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1343fi
1344
Damien Miller0437b332000-05-02 09:56:41 +10001345AC_OUTPUT(Makefile ssh_prng_cmds)
1346
Damien Miller7b22d652000-06-18 14:07:04 +10001347# Print summary of options
1348
1349if test x$MANTYPE = x'$(CATMAN)' ; then
1350 MAN_MSG=cat
1351else
1352 MAN_MSG=man
1353fi
1354if test ! -z "$RANDOM_POOL" ; then
1355 RAND_MSG="Device ($RANDOM_POOL)"
1356else
1357 if test ! -z "$EGD_SOCKET" ; then
1358 RAND_MSG="EGD ($EGD_SOCKET)"
1359 else
1360 RAND_MSG="Builtin (timeout $entropy_timeout)"
1361 fi
1362fi
1363
1364# Someone please show me a better way :)
1365A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1366B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1367C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1368D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1369E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1370F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1371G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1372
1373echo ""
1374echo "OpenSSH configured has been configured with the following options."
1375echo " User binaries: $B"
1376echo " System binaries: $C"
1377echo " Configuration files: $D"
1378echo " Askpass program: $E"
1379echo " Manual pages: $F"
1380echo " PID file: $G"
1381echo " Random number collection: $RAND_MSG"
1382echo " Manpage format: $MAN_MSG"
1383echo " PAM support: ${PAM_MSG}"
1384echo " KerberosIV support: $KRB4_MSG"
1385echo " AFS support: $AFS_MSG"
1386echo " S/KEY support: $SKEY_MSG"
1387echo " TCP Wrappers support: $TCPW_MSG"
1388echo " MD5 password support: $MD5_MSG"
1389echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1390echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1391echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1392
1393echo ""
1394
1395echo "Compiler flags: ${CFLAGS}"
1396echo "Linker flags: ${LDFLAGS}"
1397echo "Libraries: ${LIBS}"
1398
1399echo ""
1400