blob: 824ff5c02de9f75f436c56cfe56f9f83417937a7 [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 Millerad833b32000-08-23 10:46:23 +100017# Use LOGIN_PROGRAM from environment if possible
18if test ! -z "$LOGIN_PROGRAM" ; then
19 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
20else
21 # Search for login
22 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
23 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
25 fi
26fi
27
Damien Miller166bd442000-03-16 10:48:25 +110028if test -z "$LD" ; then
29 LD=$CC
30fi
31AC_SUBST(LD)
32
33# C Compiler features
34AC_C_INLINE
35if test "$GCC" = "yes"; then
36 CFLAGS="$CFLAGS -Wall"
37fi
38
Damien Millera22ba012000-03-02 23:09:20 +110039# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110040case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110041*-*-aix*)
42 AFS_LIBS="-lld"
Damien Millerdb819592000-03-14 13:44:01 +110043 CFLAGS="$CFLAGS -I/usr/local/include"
44 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100045 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110046 blibpath="/usr/lib:/lib:/usr/local/lib"
47 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100048 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110049 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000050 MANTYPE='$(CATMAN)'
51 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000052 dnl AIX handles lastlog as part of its login message
53 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100054 MANTYPE='$(CATMAN)'
55 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110056 ;;
Damien Miller76112de1999-12-21 11:18:08 +110057*-*-hpux10*)
58 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100059 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110060 fi
61 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
62 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millerb0785672000-08-23 09:10:39 +100063 AC_DEFINE(USE_PIPES)
Damien Miller76112de1999-12-21 11:18:08 +110064 AC_MSG_CHECKING(for HPUX trusted system password database)
65 if test -f /tcb/files/auth/system/default; then
66 AC_MSG_RESULT(yes)
67 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
68 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110069 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110070 else
71 AC_MSG_RESULT(no)
72 AC_DEFINE(DISABLE_SHADOW)
73 fi
Damien Miller670a4b82000-01-22 13:53:11 +110074 MANTYPE='$(CATMAN)'
75 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110076 ;;
Damien Miller1bead332000-04-30 00:47:29 +100077*-*-hpux11*)
78 if test -z "$GCC"; then
79 CFLAGS="$CFLAGS -Ae"
80 fi
81 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100082 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100083 AC_MSG_CHECKING(for HPUX trusted system password database)
84 if test -f /tcb/files/auth/system/default; then
85 AC_MSG_RESULT(yes)
86 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
87 LIBS="$LIBS -lsec"
88 AC_MSG_WARN([This configuration is untested])
89 else
90 AC_MSG_RESULT(no)
91 AC_DEFINE(DISABLE_SHADOW)
92 fi
93 MANTYPE='$(CATMAN)'
94 mansubdir=cat
95 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110096*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110097 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100098 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110099 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100100 no_libsocket=1
101 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000102 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100103 ;;
104*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +1100105 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000106 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +1100107 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000108 AC_DEFINE(WITH_IRIX_ARRAY)
109 AC_DEFINE(WITH_IRIX_PROJECT)
110 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100111 no_libsocket=1
112 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000113 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100114 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100115*-*-linux*)
116 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100117 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000118 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100119 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100120 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100121*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100122 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100123 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000124*-next-*)
125 # hardwire lastlog location (can't detect it on some versions)
126 conf_lastlog_location="/usr/adm/lastlog"
Damien Miller31abc9a2000-07-09 23:26:27 +1000127 conf_utmp_location=/etc/utmp
Damien Miller0f91b4e2000-06-18 15:43:25 +1000128 AC_DEFINE(HAVE_NEXT)
129 CFLAGS="$CFLAGS -I/usr/local/include"
130 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000131 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
132 AC_MSG_WARN([*** Expect 'scp' to fail!])
133 AC_MSG_WARN([*** Please report any problems, thanks])
134 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100135*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100136 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100137 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100138 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000139 # hardwire lastlog location (can't detect it on some versions)
140 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000141 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
142 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
143 if test "$sol2ver" -ge 8; then
144 AC_MSG_RESULT(yes)
145 AC_DEFINE(DISABLE_UTMP)
146 AC_DEFINE(DISABLE_WTMP)
147 else
148 AC_MSG_RESULT(no)
149 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100150 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000151*-*-sunos4*)
152 CFLAGS="$CFLAGS -DSUNOS4"
153 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000154 conf_utmp_location=/etc/utmp
155 conf_wtmp_location=/var/adm/wtmp
156 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000157 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000158 MANTYPE='$(CATMAN)'
159 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000160 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000161*-sni-sysv*)
162 CFLAGS="$CFLAGS -I/usr/local/include"
163 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
164 MANTYPE='$(CATMAN)'
165 AC_DEFINE(IP_TOS_IS_BROKEN)
166 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000167 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000168 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100169*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100170 CFLAGS="$CFLAGS -I/usr/local/include"
171 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100172 MANTYPE='$(CATMAN)'
173 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100174 LIBS="$LIBS -lgen -lsocket"
175 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000176*-*-sco3*)
177 CFLAGS="$CFLAGS -I/usr/local/include"
178 LDFLAGS="$LDFLAGS -L/usr/local/lib"
179 MANTYPE='$(CATMAN)'
180 mansubdir=cat
181 LIBS="$LIBS -lgen -lsocket"
182 no_dev_ptmx=1
183 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000184*-dec-osf*)
185# This is untested
186 if test ! -z "USE_SIA" ; then
187 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
188 if test -f /etc/sia/matrix.conf; then
189 AC_MSG_RESULT(yes)
190 AC_DEFINE(HAVE_OSF_SIA)
191 AC_DEFINE(DISABLE_LOGIN)
192 LIBS="$LIBS -lsecurity -ldb -lm -laud"
193 else
194 AC_MSG_RESULT(no)
195 fi
196 fi
197 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100198esac
199
Damien Millere37bfc12000-06-05 09:37:43 +1000200# Allow user to specify flags
201AC_ARG_WITH(cflags,
202 [ --with-cflags Specify additional flags to pass to compiler],
203 [
204 if test "x$withval" != "xno" ; then
205 CFLAGS="$CFLAGS $withval"
206 fi
207 ]
208)
209AC_ARG_WITH(ldflags,
210 [ --with-ldlags Specify additional flags to pass to linker],
211 [
212 if test "x$withval" != "xno" ; then
213 LDFLAGS="$LDFLAGS $withval"
214 fi
215 ]
216)
217AC_ARG_WITH(libs,
218 [ --with-libs Specify additional libraries to link with],
219 [
220 if test "x$withval" != "xno" ; then
221 LIBS="$LIBS $withval"
222 fi
223 ]
224)
225
226
Damien Millera22ba012000-03-02 23:09:20 +1100227# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100228AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
229AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100230
Damien Millerbeb4ba51999-12-28 15:09:35 +1100231if test -z "$no_libsocket" ; then
232 AC_CHECK_LIB(nsl, yp_match, , )
233fi
234if test -z "$no_libnsl" ; then
235 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100236fi
Damien Millerab18c411999-11-11 10:40:23 +1100237
Damien Millera22ba012000-03-02 23:09:20 +1100238# Checks for header files.
Damien Millerad833b32000-08-23 10:46:23 +1000239AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h login_cap.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 +1100240
Damien Millerad833b32000-08-23 10:46:23 +1000241dnl Checks for library functions.
242AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool 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)
243dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000244AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000245dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000246AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000247dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000248AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
249AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000250dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000251AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
252AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100253
Damien Miller5fc85652000-07-09 23:53:07 +1000254AC_CHECK_FUNC(getuserattr,
255 [AC_DEFINE(HAVE_GETUSERATTR)],
256 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
257)
258
Damien Miller04f80141999-11-19 15:32:34 +1100259AC_CHECK_FUNC(login,
260 [AC_DEFINE(HAVE_LOGIN)],
261 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
262)
263
264AC_CHECK_FUNC(daemon,
265 [AC_DEFINE(HAVE_DAEMON)],
266 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
267)
268
Damien Miller9fb07e42000-03-05 16:22:59 +1100269AC_CHECK_FUNC(getpagesize,
270 [AC_DEFINE(HAVE_GETPAGESIZE)],
271 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
272)
273
Damien Millercb170cb2000-07-01 16:52:55 +1000274# Check for broken snprintf
275if test "x$ac_cv_func_snprintf" = "xyes" ; then
276 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
277 AC_TRY_RUN(
278 [
279#include <stdio.h>
280int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
281 ],
282 [AC_MSG_RESULT(yes)],
283 [
284 AC_MSG_RESULT(no)
285 AC_DEFINE(BROKEN_SNPRINTF)
286 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
287 ]
288 )
289fi
290
Damien Miller7b22d652000-06-18 14:07:04 +1000291PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100292AC_ARG_WITH(pam,
293 [ --without-pam Disable PAM support ],
294 [
295 if test "x$withval" = "xno" ; then
296 no_pam=1
297 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000298 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100299 fi
300 ]
301)
Damien Milleredb82922000-06-20 13:25:52 +1000302if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100303 AC_CHECK_LIB(dl, dlopen, , )
304 LIBS="$LIBS -lpam"
305
Damien Miller0e65eed2000-05-17 22:16:05 +1000306 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000307
Damien Miller1f335fb2000-06-26 11:31:33 +1000308 disable_shadow=yes
309
Damien Miller7b22d652000-06-18 14:07:04 +1000310 PAM_MSG="yes"
311
Damien Millera22ba012000-03-02 23:09:20 +1100312 # Check PAM strerror arguments (old PAM)
313 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
314 AC_TRY_COMPILE(
315 [
Damien Miller81171112000-04-23 11:14:01 +1000316#include <stdlib.h>
317#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100318 ],
319 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
320 [AC_MSG_RESULT(no)],
321 [
322 AC_DEFINE(HAVE_OLD_PAM)
323 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000324 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100325 ]
326 )
327fi
328
329# The big search for OpenSSL
330AC_ARG_WITH(ssl-dir,
331 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
332 [
333 if test "x$withval" != "$xno" ; then
334 tryssldir=$withval
335 fi
336 ]
337)
338
339saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100340saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100341saved_CFLAGS="$CFLAGS"
342if test "x$prefix" != "xNONE" ; then
343 tryssldir="$tryssldir $prefix"
344fi
Damien Miller61e50f12000-05-08 20:49:37 +1000345AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100346
Damien Miller61e50f12000-05-08 20:49:37 +1000347 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
348 if test ! -z "$ssldir" ; then
349 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
350 CFLAGS="$saved_CFLAGS -I$ssldir/include"
351 if test ! -z "$need_dash_r" ; then
352 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
353 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100354 else
Damien Miller61e50f12000-05-08 20:49:37 +1000355 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100356 fi
357
Damien Miller3b512e12000-05-17 23:29:18 +1000358 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000359
Damien Miller3b512e12000-05-17 23:29:18 +1000360 # Basic test to check for compatible version and correct linking
361 # *does not* test for RSA - that comes later.
362 AC_TRY_RUN(
363 [
Damien Millere59ce622000-05-01 20:54:17 +1000364#include <string.h>
365#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000366int main(void)
367{
Damien Miller3b512e12000-05-17 23:29:18 +1000368 char a[2048];
369 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000370 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000371 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000372}
Damien Miller3b512e12000-05-17 23:29:18 +1000373 ],
374 [
375 found_crypto=1
376 break;
377 ], []
378 )
Damien Miller61e50f12000-05-08 20:49:37 +1000379
380 if test ! -z "$found_crypto" ; then
381 break;
382 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100383 done
384
Damien Miller61e50f12000-05-08 20:49:37 +1000385 if test -z "$found_crypto" ; then
386 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100387 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000388 if test -z "$ssldir" ; then
389 ssldir="(system)"
390 fi
Damien Millera22ba012000-03-02 23:09:20 +1100391
Damien Miller61e50f12000-05-08 20:49:37 +1000392 ac_cv_openssldir=$ssldir
393])
394
Damien Milleredb82922000-06-20 13:25:52 +1000395if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000396 AC_DEFINE(HAVE_OPENSSL)
397 dnl Need to recover ssldir - test above runs in subshell
398 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100399 CFLAGS="$saved_CFLAGS -I$ssldir/include"
400 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
401 if test ! -z "$need_dash_r" ; then
402 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100403 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100404 if test ! -z "$blibpath" ; then
405 blibpath="$blibpath:$ssldir:$ssldir/lib"
406 fi
Damien Millera22ba012000-03-02 23:09:20 +1100407fi
Damien Miller3b512e12000-05-17 23:29:18 +1000408LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000409
Damien Miller3b512e12000-05-17 23:29:18 +1000410# Now test RSA support
411saved_LIBS="$LIBS"
412AC_MSG_CHECKING([for RSA support])
413for WANTS_RSAREF in "" 1 ; do
414 if test -z "$WANTS_RSAREF" ; then
415 LIBS="$saved_LIBS"
416 else
417 LIBS="$saved_LIBS -lRSAglue -lrsaref"
418 fi
419 AC_TRY_RUN([
420#include <string.h>
421#include <openssl/rand.h>
422#include <openssl/rsa.h>
423#include <openssl/bn.h>
424#include <openssl/sha.h>
425int main(void)
426{
427 int num; RSA *key; static unsigned char p_in[] = "blahblah";
428 unsigned char c[256], p[256];
429 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
430 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
431 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
432 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
433}
434 ],
435 [
436 rsa_works=1
437 break;
438 ], [])
439done
440
441if test ! -z "$no_rsa" ; then
442 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000443 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000444else
445 if test -z "$rsa_works" ; then
446 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000447 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000448 else
449 if test -z "$WANTS_RSAREF" ; then
450 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000451 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000452 else
Damien Miller7b22d652000-06-18 14:07:04 +1000453 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000454 AC_MSG_RESULT(using RSAref)
455 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
456 fi
457 fi
458fi
Damien Millera22ba012000-03-02 23:09:20 +1100459
460# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100461AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100462AC_CHECK_SIZEOF(short int, 2)
463AC_CHECK_SIZEOF(int, 4)
464AC_CHECK_SIZEOF(long int, 4)
465AC_CHECK_SIZEOF(long long int, 8)
466
Damien Millera22ba012000-03-02 23:09:20 +1100467# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100468AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
469 AC_TRY_COMPILE(
470 [ #include <sys/types.h> ],
471 [ u_int a; a = 1;],
472 [ ac_cv_have_u_int="yes" ],
473 [ ac_cv_have_u_int="no" ]
474 )
475])
476if test "x$ac_cv_have_u_int" = "xyes" ; then
477 AC_DEFINE(HAVE_U_INT)
478 have_u_int=1
479fi
480
Damien Miller61e50f12000-05-08 20:49:37 +1000481AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
482 AC_TRY_COMPILE(
483 [ #include <sys/types.h> ],
484 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
485 [ ac_cv_have_intxx_t="yes" ],
486 [ ac_cv_have_intxx_t="no" ]
487 )
488])
489if test "x$ac_cv_have_intxx_t" = "xyes" ; then
490 AC_DEFINE(HAVE_INTXX_T)
491 have_intxx_t=1
492fi
493
494AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
495 AC_TRY_COMPILE(
496 [ #include <sys/types.h> ],
497 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
498 [ ac_cv_have_u_intxx_t="yes" ],
499 [ ac_cv_have_u_intxx_t="no" ]
500 )
501])
502if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
503 AC_DEFINE(HAVE_U_INTXX_T)
504 have_u_intxx_t=1
505fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100506
Damien Milleredb82922000-06-20 13:25:52 +1000507if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
508 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100509then
510 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
511 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000512 [
513#include <sys/bitypes.h>
514 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100515 [
Damien Miller70494d12000-04-03 15:57:06 +1000516 int8_t a; int16_t b; int32_t c;
517 u_int8_t e; u_int16_t f; u_int32_t g;
518 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100519 ],
520 [
521 AC_DEFINE(HAVE_U_INTXX_T)
522 AC_DEFINE(HAVE_INTXX_T)
523 AC_MSG_RESULT(yes)
524 ],
525 [AC_MSG_RESULT(no)]
526 )
527fi
528
Damien Millerd6121d22000-03-17 23:26:46 +1100529if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000530 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
531 AC_TRY_COMPILE(
532 [
533#include <sys/types.h>
534 ],
535 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
536 [ ac_cv_have_uintxx_t="yes" ],
537 [ ac_cv_have_uintxx_t="no" ]
538 )
539 ])
540 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
541 AC_DEFINE(HAVE_UINTXX_T)
542 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100543fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100544
Damien Miller61e50f12000-05-08 20:49:37 +1000545AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
546 AC_TRY_COMPILE(
547 [
Damien Miller81171112000-04-23 11:14:01 +1000548#include <sys/types.h>
549#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000550 ],
551 [socklen_t foo; foo = 1235;],
552 [ ac_cv_have_socklen_t="yes" ],
553 [ ac_cv_have_socklen_t="no" ]
554 )
555])
556if test "x$ac_cv_have_socklen_t" = "xyes" ; then
557 AC_DEFINE(HAVE_SOCKLEN_T)
558fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100559
Damien Miller61e50f12000-05-08 20:49:37 +1000560AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
561 AC_TRY_COMPILE(
562 [
563#include <sys/types.h>
564 ],
565 [ size_t foo; foo = 1235; ],
566 [ ac_cv_have_size_t="yes" ],
567 [ ac_cv_have_size_t="no" ]
568 )
569])
570if test "x$ac_cv_have_size_t" = "xyes" ; then
571 AC_DEFINE(HAVE_SIZE_T)
572fi
Damien Miller95058511999-12-29 10:36:45 +1100573
Damien Miller615f9392000-05-17 22:53:33 +1000574AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
575 AC_TRY_COMPILE(
576 [
577#include <sys/types.h>
578 ],
579 [ ssize_t foo; foo = 1235; ],
580 [ ac_cv_have_ssize_t="yes" ],
581 [ ac_cv_have_ssize_t="no" ]
582 )
583])
584if test "x$ac_cv_have_ssize_t" = "xyes" ; then
585 AC_DEFINE(HAVE_SSIZE_T)
586fi
587
Damien Millerb54b40e2000-06-23 08:23:34 +1000588AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
589 AC_TRY_COMPILE(
590 [
591#include <sys/types.h>
592#include <sys/socket.h>
593 ],
594 [ sa_family_t foo; foo = 1235; ],
595 [ ac_cv_have_sa_family_t="yes" ],
596 [ ac_cv_have_sa_family_t="no" ]
597 )
598])
599if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
600 AC_DEFINE(HAVE_SA_FAMILY_T)
601fi
602
Damien Miller0f91b4e2000-06-18 15:43:25 +1000603AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
604 AC_TRY_COMPILE(
605 [
606#include <sys/types.h>
607 ],
608 [ pid_t foo; foo = 1235; ],
609 [ ac_cv_have_pid_t="yes" ],
610 [ ac_cv_have_pid_t="no" ]
611 )
612])
613if test "x$ac_cv_have_pid_t" = "xyes" ; then
614 AC_DEFINE(HAVE_PID_T)
615fi
616
617AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
618 AC_TRY_COMPILE(
619 [
620#include <sys/types.h>
621 ],
622 [ mode_t foo; foo = 1235; ],
623 [ ac_cv_have_mode_t="yes" ],
624 [ ac_cv_have_mode_t="no" ]
625 )
626])
627if test "x$ac_cv_have_mode_t" = "xyes" ; then
628 AC_DEFINE(HAVE_MODE_T)
629fi
630
Damien Miller61e50f12000-05-08 20:49:37 +1000631
632AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
633 AC_TRY_COMPILE(
634 [
Damien Miller81171112000-04-23 11:14:01 +1000635#include <sys/types.h>
636#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000637 ],
638 [ struct sockaddr_storage s; ],
639 [ ac_cv_have_struct_sockaddr_storage="yes" ],
640 [ ac_cv_have_struct_sockaddr_storage="no" ]
641 )
642])
643if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
644 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
645fi
Damien Miller34132e52000-01-14 15:45:46 +1100646
Damien Miller61e50f12000-05-08 20:49:37 +1000647AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
648 AC_TRY_COMPILE(
649 [
Damien Miller7b22d652000-06-18 14:07:04 +1000650#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000651#include <netinet/in.h>
652 ],
653 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
654 [ ac_cv_have_struct_sockaddr_in6="yes" ],
655 [ ac_cv_have_struct_sockaddr_in6="no" ]
656 )
657])
658if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
659 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
660fi
Damien Miller34132e52000-01-14 15:45:46 +1100661
Damien Miller61e50f12000-05-08 20:49:37 +1000662AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
663 AC_TRY_COMPILE(
664 [
Damien Miller7b22d652000-06-18 14:07:04 +1000665#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000666#include <netinet/in.h>
667 ],
668 [ struct in6_addr s; s.s6_addr[0] = 0; ],
669 [ ac_cv_have_struct_in6_addr="yes" ],
670 [ ac_cv_have_struct_in6_addr="no" ]
671 )
672])
673if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
674 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
675fi
Damien Miller34132e52000-01-14 15:45:46 +1100676
Damien Miller61e50f12000-05-08 20:49:37 +1000677AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
678 AC_TRY_COMPILE(
679 [
Damien Miller81171112000-04-23 11:14:01 +1000680#include <sys/types.h>
681#include <sys/socket.h>
682#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000683 ],
684 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
685 [ ac_cv_have_struct_addrinfo="yes" ],
686 [ ac_cv_have_struct_addrinfo="no" ]
687 )
688])
689if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
690 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
691fi
692
Damien Miller34132e52000-01-14 15:45:46 +1100693
Damien Millera22ba012000-03-02 23:09:20 +1100694# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100695
Damien Miller61e50f12000-05-08 20:49:37 +1000696OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
697OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
698OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
699OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
700OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000701OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000702OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
703OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000704OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000705OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
706OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
707OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
708OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000709OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
710OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
711OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
712OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
713
Damien Miller942da032000-08-18 13:59:06 +1000714AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
715 ac_cv_have_sun_len_in_struct_sockaddr_un, [
716 AC_TRY_COMPILE(
717 [
718#include <sys/types.h>
719#include <sys/socket.h>
720 ],
721 [ struct sockaddr_un s; s.sun_len = 1; ],
722 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
723 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
724 )
725])
726if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
727 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
728fi
729
Damien Miller61e50f12000-05-08 20:49:37 +1000730AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
731 ac_cv_have_ss_family_in_struct_ss, [
732 AC_TRY_COMPILE(
733 [
Damien Miller81171112000-04-23 11:14:01 +1000734#include <sys/types.h>
735#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000736 ],
737 [ struct sockaddr_storage s; s.ss_family = 1; ],
738 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
739 [ ac_cv_have_ss_family_in_struct_ss="no" ],
740 )
741])
742if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
743 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
744fi
745
Damien Miller61e50f12000-05-08 20:49:37 +1000746AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
747 ac_cv_have___ss_family_in_struct_ss, [
748 AC_TRY_COMPILE(
749 [
Damien Miller81171112000-04-23 11:14:01 +1000750#include <sys/types.h>
751#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000752 ],
753 [ struct sockaddr_storage s; s.__ss_family = 1; ],
754 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
755 [ ac_cv_have___ss_family_in_struct_ss="no" ]
756 )
757])
758if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
759 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
760fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100761
Damien Millerad833b32000-08-23 10:46:23 +1000762AC_CACHE_CHECK([for pw_class field in struct passwd],
763 ac_cv_have_pw_class_in_struct_passwd, [
764 AC_TRY_COMPILE(
765 [
766#include <sys/types.h>
767#include <pwd.h>
768 ],
769 [ struct passwd p s; p.pw_class = NULL; ],
770 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
771 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
772 )
773])
774if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
775 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
776fi
777
Damien Miller61e50f12000-05-08 20:49:37 +1000778
779AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
780 AC_TRY_LINK([],
781 [ extern char *__progname; printf("%s", __progname); ],
782 [ ac_cv_libc_defines___progname="yes" ],
783 [ ac_cv_libc_defines___progname="no" ]
784 )
785])
786if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
787 AC_DEFINE(HAVE___PROGNAME)
788fi
789
Damien Millera22ba012000-03-02 23:09:20 +1100790
Damien Millerecbb26d2000-07-15 14:59:14 +1000791AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
792 AC_TRY_LINK([],
793 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
794 [ ac_cv_libc_defines_sys_errlist="yes" ],
795 [ ac_cv_libc_defines_sys_errlist="no" ]
796 )
797])
798if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
799 AC_DEFINE(HAVE_SYS_ERRLIST)
800fi
801
802
Damien Miller11fa2cc2000-08-16 10:35:58 +1000803AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
804 AC_TRY_LINK([],
805 [ extern int sys_nerr; printf("%i", sys_nerr);],
806 [ ac_cv_libc_defines_sys_nerr="yes" ],
807 [ ac_cv_libc_defines_sys_nerr="no" ]
808 )
809])
810if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
811 AC_DEFINE(HAVE_SYS_NERR)
812fi
813
814
Damien Millera22ba012000-03-02 23:09:20 +1100815# Looking for programs, paths and files
816AC_ARG_WITH(rsh,
817 [ --with-rsh=PATH Specify path to remote shell program ],
818 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100819 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000820 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100821 fi
822 ],
823 [
824 AC_PATH_PROG(rsh_path, rsh)
825 ]
826)
827
828AC_ARG_WITH(xauth,
829 [ --with-xauth=PATH Specify path to xauth program ],
830 [
831 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000832 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100833 fi
834 ],
835 [
836 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000837 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100838 xauth_path="/usr/openwin/bin/xauth"
839 fi
840 ]
841)
842
843if test ! -z "$xauth_path" ; then
844 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
845fi
846if test ! -z "$rsh_path" ; then
847 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
848fi
849
850# Check for mail directory (last resort if we cannot get it from headers)
851if test ! -z "$MAIL" ; then
852 maildir=`dirname $MAIL`
853 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
854fi
855
Damien Millera22ba012000-03-02 23:09:20 +1100856if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100857 AC_CHECK_FILE("/dev/ptmx",
858 [
859 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
860 have_dev_ptmx=1
861 ]
862 )
Damien Millera22ba012000-03-02 23:09:20 +1100863fi
Damien Miller204ad072000-03-02 23:56:12 +1100864AC_CHECK_FILE("/dev/ptc",
865 [
866 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
867 have_dev_ptc=1
868 ]
869)
870
Damien Millera22ba012000-03-02 23:09:20 +1100871# Options from here on. Some of these are preset by platform above
872
Damien Millera22ba012000-03-02 23:09:20 +1100873# Check for user-specified random device, otherwise check /dev/urandom
874AC_ARG_WITH(random,
875 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
876 [
Damien Miller040f3832000-04-03 14:50:43 +1000877 if test "x$withval" != "xno" ; then
878 RANDOM_POOL="$withval";
879 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
880 fi
Damien Millera22ba012000-03-02 23:09:20 +1100881 ],
882 [
883 # Check for random device
884 AC_CHECK_FILE("/dev/urandom",
885 [
886 RANDOM_POOL="/dev/urandom";
887 AC_SUBST(RANDOM_POOL)
888 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
889 ]
890 )
891 ]
892)
893
894# Check for EGD pool file
895AC_ARG_WITH(egd-pool,
896 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
897 [
Damien Miller040f3832000-04-03 14:50:43 +1000898 if test "x$withval" != "xno" ; then
899 EGD_SOCKET="$withval";
900 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
901 fi
Damien Millera22ba012000-03-02 23:09:20 +1100902 ]
903)
904
Damien Miller0437b332000-05-02 09:56:41 +1000905# detect pathnames for entropy gathering commands, if we need them
906INSTALL_SSH_PRNG_CMDS=""
907rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000908if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000909 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000910 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
911 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
912 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
913 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
914 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
915 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
916 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
917 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
918 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
919 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
920 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
921 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
922 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
923 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
924 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000925
926 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000927fi
Damien Miller0437b332000-05-02 09:56:41 +1000928AC_SUBST(INSTALL_SSH_PRNG_CMDS)
929
Damien Miller11e37f62000-04-08 18:23:30 +1000930
Damien Miller670a4b82000-01-22 13:53:11 +1100931AC_ARG_WITH(catman,
932 [ --with-catman=man|cat Install preformatted manpages[no]],
933 [
934 MANTYPE='$(CATMAN)'
935 if test x"$withval" != x"yes" ; then
936 mansubdir=$withval
937 else
938 mansubdir=cat
939 fi
940 ], [
941 if test -z "$MANTYPE" ; then
942 MANTYPE='$(TROFFMAN)'
943 mansubdir=man
944 fi
945 ]
946)
947AC_SUBST(MANTYPE)
948AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100949
Damien Millera22ba012000-03-02 23:09:20 +1100950# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000951KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100952AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100953 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100954 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100955 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100956
957 if test "x$withval" != "$xyes" ; then
958 CFLAGS="$CFLAGS -I${withval}/include"
959 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100960 if test ! -z "$need_dash_r" ; then
961 LDFLAGS="$LDFLAGS -R${withval}/lib"
962 fi
963 if test ! -z "$blibpath" ; then
964 blibpath="$blibpath:${withval}/lib"
965 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100966 else
967 if test -d /usr/include/kerberosIV ; then
968 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
969 fi
970 fi
971
972 AC_CHECK_HEADERS(krb.h)
973 AC_CHECK_LIB(krb, main)
974 if test "$ac_cv_header_krb_h" != yes; then
975 AC_MSG_WARN([Cannot find krb.h, build may fail])
976 fi
977 if test "$ac_cv_lib_krb_main" != yes; then
978 AC_MSG_WARN([Cannot find libkrb, build may fail])
979 fi
980
Damien Millerc85f9b42000-01-29 10:20:21 +1100981 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100982 AC_CHECK_LIB(resolv, dn_expand, , )
983 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000984 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100985 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100986 fi
Damien Miller80297751999-11-19 13:03:25 +1100987 ]
988)
989
Damien Millera22ba012000-03-02 23:09:20 +1100990# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000991AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100992AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100993 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100994 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100995 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100996
997 if test "x$withval" != "$xyes" ; then
998 CFLAGS="$CFLAGS -I${withval}/include"
999 LFLAGS="$LFLAGS -L${withval}/lib"
1000 fi
1001
1002 if test -z "$KRB4" ; then
1003 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1004 fi
1005
Damien Miller8bdeee21999-12-30 15:50:54 +11001006 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001007 if test ! -z "$AFS_LIBS" ; then
1008 LIBS="$LIBS $AFS_LIBS"
1009 fi
1010 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001011 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001012 fi
Damien Miller80297751999-11-19 13:03:25 +11001013 ]
1014)
Damien Millerc85f9b42000-01-29 10:20:21 +11001015LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001016
Damien Millera22ba012000-03-02 23:09:20 +11001017# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001018SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001019AC_ARG_WITH(skey,
1020 [ --with-skey Enable S/Key support],
1021 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001022 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001023 AC_DEFINE(SKEY)
1024 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001025 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001026 fi
Damien Miller80297751999-11-19 13:03:25 +11001027 ]
1028)
1029
Damien Millera22ba012000-03-02 23:09:20 +11001030# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001031TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001032AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001033 [ --with-tcp-wrappers Enable tcpwrappers support],
1034 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001035 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001036 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001037 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001038 AC_MSG_CHECKING(for libwrap)
1039 AC_TRY_LINK(
1040 [
Damien Miller81171112000-04-23 11:14:01 +10001041#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001042 int deny_severity = 0, allow_severity = 0;
1043 ],
1044 [hosts_access(0);],
1045 [
1046 AC_MSG_RESULT(yes)
1047 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001048 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001049 ],
1050 [
Damien Miller7b22d652000-06-18 14:07:04 +10001051 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001052 ]
1053 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001054 fi
Damien Miller80297751999-11-19 13:03:25 +11001055 ]
1056)
1057
Damien Millera22ba012000-03-02 23:09:20 +11001058# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001059MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001060AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001061 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001062 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001063 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001064 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001065 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001066 fi
1067 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001068)
1069
Damien Millera22ba012000-03-02 23:09:20 +11001070# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001071AC_ARG_WITH(shadow,
1072 [ --without-shadow Disable shadow password support],
1073 [
1074 if test "x$withval" = "xno" ; then
1075 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001076 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001077 fi
1078 ]
1079)
1080
Damien Miller1f335fb2000-06-26 11:31:33 +10001081if test -z "$disable_shadow" ; then
1082 AC_MSG_CHECKING([if the systems has expire shadow information])
1083 AC_TRY_COMPILE(
1084 [
1085#include <sys/types.h>
1086#include <shadow.h>
1087 struct spwd sp;
1088 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1089 [ sp_expire_available=yes ], []
1090 )
1091
1092 if test "x$sp_expire_available" = "xyes" ; then
1093 AC_MSG_RESULT(yes)
1094 AC_DEFINE(HAS_SHADOW_EXPIRE)
1095 else
1096 AC_MSG_RESULT(no)
1097 fi
1098fi
1099
Damien Millera22ba012000-03-02 23:09:20 +11001100# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001101DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001102AC_ARG_WITH(ipaddr-display,
1103 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1104 [
Damien Millere477ef62000-08-15 10:21:17 +10001105 if test "x$withval" != "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001106 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001107 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001108 fi
1109 ]
1110)
1111
Damien Millera22ba012000-03-02 23:09:20 +11001112# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001113SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001114AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001115 [ --with-default-path=PATH Specify default \$PATH environment for server],
1116 [
1117 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001118 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001119 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001120 fi
1121 ]
1122)
1123
Damien Millera22ba012000-03-02 23:09:20 +11001124# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001125IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001126AC_ARG_WITH(ipv4-default,
1127 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1128 [
1129 if test "x$withval" != "xno" ; then
1130 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001131 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001132 fi
1133 ]
1134)
1135
Damien Miller61e50f12000-05-08 20:49:37 +10001136AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001137IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001138AC_ARG_WITH(4in6,
1139 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1140 [
1141 if test "x$withval" != "xno" ; then
1142 AC_MSG_RESULT(yes)
1143 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001144 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001145 else
1146 AC_MSG_RESULT(no)
1147 fi
1148 ],[
1149 if test "x$inet6_default_4in6" = "xyes"; then
1150 AC_MSG_RESULT([yes (default)])
1151 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001152 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001153 else
1154 AC_MSG_RESULT([no (default)])
1155 fi
1156 ]
1157)
1158
Damien Millera22ba012000-03-02 23:09:20 +11001159# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001160piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001161AC_ARG_WITH(pid-dir,
1162 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1163 [
1164 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001165 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001166 fi
1167 ]
1168)
Damien Miller4018c192000-04-30 09:30:44 +10001169
Damien Millerdbd250f2000-01-18 08:57:14 +11001170AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001171AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001172
andre2ff7b5d2000-06-03 14:57:40 +00001173dnl allow user to disable some login recording features
1174AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001175 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001176 [ AC_DEFINE(DISABLE_LASTLOG) ]
1177)
1178AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001179 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001180 [ AC_DEFINE(DISABLE_UTMP) ]
1181)
1182AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001183 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001184 [ AC_DEFINE(DISABLE_UTMPX) ]
1185)
1186AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001187 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001188 [ AC_DEFINE(DISABLE_WTMP) ]
1189)
1190AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001191 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001192 [ AC_DEFINE(DISABLE_WTMPX) ]
1193)
1194AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001195 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001196 [ AC_DEFINE(DISABLE_LOGIN) ]
1197)
1198AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001199 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001200 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1201)
1202AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001203 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001204 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1205)
1206AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001207 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001208 [ conf_lastlog_location="$withval"; ],)
1209
1210dnl lastlog, [uw]tmpx? detection
1211dnl NOTE: set the paths in the platform section to avoid the
1212dnl need for command-line parameters
1213dnl lastlog and [uw]tmp are subject to a file search if all else fails
1214
1215dnl lastlog detection
1216dnl NOTE: the code itself will detect if lastlog is a directory
1217AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1218AC_TRY_COMPILE([
1219#include <sys/types.h>
1220#include <utmp.h>
1221#ifdef HAVE_LASTLOG_H
1222# include <lastlog.h>
1223#endif
Damien Miller2994e082000-06-04 15:51:47 +10001224#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001225# include <paths.h>
1226#endif
1227 ],
1228 [ char *lastlog = LASTLOG_FILE; ],
1229 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001230 [
1231 AC_MSG_RESULT(no)
1232 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1233 AC_TRY_COMPILE([
1234#include <sys/types.h>
1235#include <utmp.h>
1236#ifdef HAVE_LASTLOG_H
1237# include <lastlog.h>
1238#endif
1239#ifdef HAVE_PATHS_H
1240# include <paths.h>
1241#endif
1242 ],
1243 [ char *lastlog = _PATH_LASTLOG; ],
1244 [ AC_MSG_RESULT(yes) ],
1245 [
andree441aa32000-06-12 22:34:38 +00001246 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001247 system_lastlog_path=no
1248 ])
1249 ]
andre2ff7b5d2000-06-03 14:57:40 +00001250)
Damien Miller2994e082000-06-04 15:51:47 +10001251
andre2ff7b5d2000-06-03 14:57:40 +00001252if test -z "$conf_lastlog_location"; then
1253 if test x"$system_lastlog_path" = x"no" ; then
1254 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001255 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001256 conf_lastlog_location=$f
1257 fi
1258 done
1259 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001260 AC_MSG_WARN([** Cannot find lastlog **])
1261 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001262 fi
1263 fi
1264fi
1265
1266if test -n "$conf_lastlog_location"; then
1267 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1268fi
1269
1270dnl utmp detection
1271AC_MSG_CHECKING([if your system defines UTMP_FILE])
1272AC_TRY_COMPILE([
1273#include <sys/types.h>
1274#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001275#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001276# include <paths.h>
1277#endif
1278 ],
1279 [ char *utmp = UTMP_FILE; ],
1280 [ AC_MSG_RESULT(yes) ],
1281 [ AC_MSG_RESULT(no)
1282 system_utmp_path=no ]
1283)
1284if test -z "$conf_utmp_location"; then
1285 if test x"$system_utmp_path" = x"no" ; then
1286 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1287 if test -f $f ; then
1288 conf_utmp_location=$f
1289 fi
1290 done
1291 if test -z "$conf_utmp_location"; then
1292 AC_DEFINE(DISABLE_UTMP)
1293 fi
1294 fi
1295fi
1296if test -n "$conf_utmp_location"; then
1297 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1298fi
1299
1300dnl wtmp detection
1301AC_MSG_CHECKING([if your system defines WTMP_FILE])
1302AC_TRY_COMPILE([
1303#include <sys/types.h>
1304#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001305#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001306# include <paths.h>
1307#endif
1308 ],
1309 [ char *wtmp = WTMP_FILE; ],
1310 [ AC_MSG_RESULT(yes) ],
1311 [ AC_MSG_RESULT(no)
1312 system_wtmp_path=no ]
1313)
1314if test -z "$conf_wtmp_location"; then
1315 if test x"$system_wtmp_path" = x"no" ; then
1316 for f in /usr/adm/wtmp /var/log/wtmp; do
1317 if test -f $f ; then
1318 conf_wtmp_location=$f
1319 fi
1320 done
1321 if test -z "$conf_wtmp_location"; then
1322 AC_DEFINE(DISABLE_WTMP)
1323 fi
1324 fi
1325fi
1326if test -n "$conf_wtmp_location"; then
1327 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1328fi
1329
1330
1331dnl utmpx detection - I don't know any system so perverse as to require
1332dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1333dnl there, though.
1334AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1335AC_TRY_COMPILE([
1336#include <sys/types.h>
1337#include <utmp.h>
1338#ifdef HAVE_UTMPX_H
1339#include <utmpx.h>
1340#endif
Damien Miller2994e082000-06-04 15:51:47 +10001341#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001342# include <paths.h>
1343#endif
1344 ],
1345 [ char *utmpx = UTMPX_FILE; ],
1346 [ AC_MSG_RESULT(yes) ],
1347 [ AC_MSG_RESULT(no)
1348 system_utmpx_path=no ]
1349)
1350if test -z "$conf_utmpx_location"; then
1351 if test x"$system_utmpx_path" = x"no" ; then
1352 AC_DEFINE(DISABLE_UTMPX)
1353 fi
1354else
1355 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1356fi
1357
1358dnl wtmpx detection
1359AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1360AC_TRY_COMPILE([
1361#include <sys/types.h>
1362#include <utmp.h>
1363#ifdef HAVE_UTMPX_H
1364#include <utmpx.h>
1365#endif
Damien Miller2994e082000-06-04 15:51:47 +10001366#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001367# include <paths.h>
1368#endif
1369 ],
1370 [ char *wtmpx = WTMPX_FILE; ],
1371 [ AC_MSG_RESULT(yes) ],
1372 [ AC_MSG_RESULT(no)
1373 system_wtmpx_path=no ]
1374)
1375if test -z "$conf_wtmpx_location"; then
1376 if test x"$system_wtmpx_path" = x"no" ; then
1377 AC_DEFINE(DISABLE_WTMPX)
1378 fi
1379else
1380 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1381fi
1382
Damien Miller4018c192000-04-30 09:30:44 +10001383
1384# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001385entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001386AC_ARG_WITH(entropy-timeout,
1387 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1388 [
1389 if test "x$withval" != "xno" ; then
1390 entropy_timeout=$withval
1391 fi
1392 ]
1393)
1394AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1395
1396
Damien Miller29ea30d2000-03-17 10:54:15 +11001397if test ! -z "$blibpath" ; then
1398 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1399 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1400fi
1401
Damien Miller0437b332000-05-02 09:56:41 +10001402AC_OUTPUT(Makefile ssh_prng_cmds)
1403
Damien Miller7b22d652000-06-18 14:07:04 +10001404# Print summary of options
1405
1406if test x$MANTYPE = x'$(CATMAN)' ; then
1407 MAN_MSG=cat
1408else
1409 MAN_MSG=man
1410fi
1411if test ! -z "$RANDOM_POOL" ; then
1412 RAND_MSG="Device ($RANDOM_POOL)"
1413else
1414 if test ! -z "$EGD_SOCKET" ; then
1415 RAND_MSG="EGD ($EGD_SOCKET)"
1416 else
1417 RAND_MSG="Builtin (timeout $entropy_timeout)"
1418 fi
1419fi
1420
1421# Someone please show me a better way :)
1422A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1423B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1424C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1425D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1426E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1427F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1428G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1429
1430echo ""
1431echo "OpenSSH configured has been configured with the following options."
1432echo " User binaries: $B"
1433echo " System binaries: $C"
1434echo " Configuration files: $D"
1435echo " Askpass program: $E"
1436echo " Manual pages: $F"
1437echo " PID file: $G"
1438echo " Random number collection: $RAND_MSG"
1439echo " Manpage format: $MAN_MSG"
1440echo " PAM support: ${PAM_MSG}"
1441echo " KerberosIV support: $KRB4_MSG"
1442echo " AFS support: $AFS_MSG"
1443echo " S/KEY support: $SKEY_MSG"
1444echo " TCP Wrappers support: $TCPW_MSG"
1445echo " MD5 password support: $MD5_MSG"
1446echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1447echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1448echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1449
1450echo ""
1451
1452echo "Compiler flags: ${CFLAGS}"
1453echo "Linker flags: ${LDFLAGS}"
1454echo "Libraries: ${LIBS}"
1455
1456echo ""
1457