blob: 02287b802c494397bd59093aaa1618fe5b080970 [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 Miller61e50f12000-05-08 20:49:37 +1000468AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
469 AC_TRY_COMPILE(
470 [ #include <sys/types.h> ],
471 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
472 [ ac_cv_have_intxx_t="yes" ],
473 [ ac_cv_have_intxx_t="no" ]
474 )
475])
476if test "x$ac_cv_have_intxx_t" = "xyes" ; then
477 AC_DEFINE(HAVE_INTXX_T)
478 have_intxx_t=1
479fi
480
481AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
482 AC_TRY_COMPILE(
483 [ #include <sys/types.h> ],
484 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
485 [ ac_cv_have_u_intxx_t="yes" ],
486 [ ac_cv_have_u_intxx_t="no" ]
487 )
488])
489if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
490 AC_DEFINE(HAVE_U_INTXX_T)
491 have_u_intxx_t=1
492fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100493
Damien Millerc6398ef1999-11-20 12:18:40 +1100494
Damien Milleredb82922000-06-20 13:25:52 +1000495if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
496 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100497then
498 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
499 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000500 [
501#include <sys/bitypes.h>
502 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100503 [
Damien Miller70494d12000-04-03 15:57:06 +1000504 int8_t a; int16_t b; int32_t c;
505 u_int8_t e; u_int16_t f; u_int32_t g;
506 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100507 ],
508 [
509 AC_DEFINE(HAVE_U_INTXX_T)
510 AC_DEFINE(HAVE_INTXX_T)
511 AC_MSG_RESULT(yes)
512 ],
513 [AC_MSG_RESULT(no)]
514 )
515fi
516
Damien Millerd6121d22000-03-17 23:26:46 +1100517if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000518 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
519 AC_TRY_COMPILE(
520 [
521#include <sys/types.h>
522 ],
523 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
524 [ ac_cv_have_uintxx_t="yes" ],
525 [ ac_cv_have_uintxx_t="no" ]
526 )
527 ])
528 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
529 AC_DEFINE(HAVE_UINTXX_T)
530 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100531fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100532
Damien Miller61e50f12000-05-08 20:49:37 +1000533AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
534 AC_TRY_COMPILE(
535 [
Damien Miller81171112000-04-23 11:14:01 +1000536#include <sys/types.h>
537#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000538 ],
539 [socklen_t foo; foo = 1235;],
540 [ ac_cv_have_socklen_t="yes" ],
541 [ ac_cv_have_socklen_t="no" ]
542 )
543])
544if test "x$ac_cv_have_socklen_t" = "xyes" ; then
545 AC_DEFINE(HAVE_SOCKLEN_T)
546fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100547
Damien Miller61e50f12000-05-08 20:49:37 +1000548AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
549 AC_TRY_COMPILE(
550 [
551#include <sys/types.h>
552 ],
553 [ size_t foo; foo = 1235; ],
554 [ ac_cv_have_size_t="yes" ],
555 [ ac_cv_have_size_t="no" ]
556 )
557])
558if test "x$ac_cv_have_size_t" = "xyes" ; then
559 AC_DEFINE(HAVE_SIZE_T)
560fi
Damien Miller95058511999-12-29 10:36:45 +1100561
Damien Miller615f9392000-05-17 22:53:33 +1000562AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
563 AC_TRY_COMPILE(
564 [
565#include <sys/types.h>
566 ],
567 [ ssize_t foo; foo = 1235; ],
568 [ ac_cv_have_ssize_t="yes" ],
569 [ ac_cv_have_ssize_t="no" ]
570 )
571])
572if test "x$ac_cv_have_ssize_t" = "xyes" ; then
573 AC_DEFINE(HAVE_SSIZE_T)
574fi
575
Damien Millerb54b40e2000-06-23 08:23:34 +1000576AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
577 AC_TRY_COMPILE(
578 [
579#include <sys/types.h>
580#include <sys/socket.h>
581 ],
582 [ sa_family_t foo; foo = 1235; ],
583 [ ac_cv_have_sa_family_t="yes" ],
584 [ ac_cv_have_sa_family_t="no" ]
585 )
586])
587if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
588 AC_DEFINE(HAVE_SA_FAMILY_T)
589fi
590
Damien Miller0f91b4e2000-06-18 15:43:25 +1000591AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
592 AC_TRY_COMPILE(
593 [
594#include <sys/types.h>
595 ],
596 [ pid_t foo; foo = 1235; ],
597 [ ac_cv_have_pid_t="yes" ],
598 [ ac_cv_have_pid_t="no" ]
599 )
600])
601if test "x$ac_cv_have_pid_t" = "xyes" ; then
602 AC_DEFINE(HAVE_PID_T)
603fi
604
605AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
606 AC_TRY_COMPILE(
607 [
608#include <sys/types.h>
609 ],
610 [ mode_t foo; foo = 1235; ],
611 [ ac_cv_have_mode_t="yes" ],
612 [ ac_cv_have_mode_t="no" ]
613 )
614])
615if test "x$ac_cv_have_mode_t" = "xyes" ; then
616 AC_DEFINE(HAVE_MODE_T)
617fi
618
Damien Miller61e50f12000-05-08 20:49:37 +1000619
620AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
621 AC_TRY_COMPILE(
622 [
Damien Miller81171112000-04-23 11:14:01 +1000623#include <sys/types.h>
624#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000625 ],
626 [ struct sockaddr_storage s; ],
627 [ ac_cv_have_struct_sockaddr_storage="yes" ],
628 [ ac_cv_have_struct_sockaddr_storage="no" ]
629 )
630])
631if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
632 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
633fi
Damien Miller34132e52000-01-14 15:45:46 +1100634
Damien Miller61e50f12000-05-08 20:49:37 +1000635AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
636 AC_TRY_COMPILE(
637 [
Damien Miller7b22d652000-06-18 14:07:04 +1000638#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000639#include <netinet/in.h>
640 ],
641 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
642 [ ac_cv_have_struct_sockaddr_in6="yes" ],
643 [ ac_cv_have_struct_sockaddr_in6="no" ]
644 )
645])
646if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
647 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
648fi
Damien Miller34132e52000-01-14 15:45:46 +1100649
Damien Miller61e50f12000-05-08 20:49:37 +1000650AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
651 AC_TRY_COMPILE(
652 [
Damien Miller7b22d652000-06-18 14:07:04 +1000653#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000654#include <netinet/in.h>
655 ],
656 [ struct in6_addr s; s.s6_addr[0] = 0; ],
657 [ ac_cv_have_struct_in6_addr="yes" ],
658 [ ac_cv_have_struct_in6_addr="no" ]
659 )
660])
661if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
662 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
663fi
Damien Miller34132e52000-01-14 15:45:46 +1100664
Damien Miller61e50f12000-05-08 20:49:37 +1000665AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
666 AC_TRY_COMPILE(
667 [
Damien Miller81171112000-04-23 11:14:01 +1000668#include <sys/types.h>
669#include <sys/socket.h>
670#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000671 ],
672 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
673 [ ac_cv_have_struct_addrinfo="yes" ],
674 [ ac_cv_have_struct_addrinfo="no" ]
675 )
676])
677if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
678 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
679fi
680
Damien Miller34132e52000-01-14 15:45:46 +1100681
Damien Millera22ba012000-03-02 23:09:20 +1100682# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100683
Damien Miller61e50f12000-05-08 20:49:37 +1000684OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
685OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
686OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
687OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
688OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000689OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000690OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
691OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000692OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000693OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
694OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
695OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
696OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000697OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
698OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
699OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
700OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
701
Damien Miller942da032000-08-18 13:59:06 +1000702AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
703 ac_cv_have_sun_len_in_struct_sockaddr_un, [
704 AC_TRY_COMPILE(
705 [
706#include <sys/types.h>
707#include <sys/socket.h>
708 ],
709 [ struct sockaddr_un s; s.sun_len = 1; ],
710 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
711 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
712 )
713])
714if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
715 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
716fi
717
Damien Miller61e50f12000-05-08 20:49:37 +1000718AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
719 ac_cv_have_ss_family_in_struct_ss, [
720 AC_TRY_COMPILE(
721 [
Damien Miller81171112000-04-23 11:14:01 +1000722#include <sys/types.h>
723#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000724 ],
725 [ struct sockaddr_storage s; s.ss_family = 1; ],
726 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
727 [ ac_cv_have_ss_family_in_struct_ss="no" ],
728 )
729])
730if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
731 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
732fi
733
Damien Miller61e50f12000-05-08 20:49:37 +1000734AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
735 ac_cv_have___ss_family_in_struct_ss, [
736 AC_TRY_COMPILE(
737 [
Damien Miller81171112000-04-23 11:14:01 +1000738#include <sys/types.h>
739#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000740 ],
741 [ struct sockaddr_storage s; s.__ss_family = 1; ],
742 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
743 [ ac_cv_have___ss_family_in_struct_ss="no" ]
744 )
745])
746if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
747 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
748fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100749
Damien Millerad833b32000-08-23 10:46:23 +1000750AC_CACHE_CHECK([for pw_class field in struct passwd],
751 ac_cv_have_pw_class_in_struct_passwd, [
752 AC_TRY_COMPILE(
753 [
754#include <sys/types.h>
755#include <pwd.h>
756 ],
757 [ struct passwd p s; p.pw_class = NULL; ],
758 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
759 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
760 )
761])
762if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
763 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
764fi
765
Damien Miller61e50f12000-05-08 20:49:37 +1000766
767AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
768 AC_TRY_LINK([],
769 [ extern char *__progname; printf("%s", __progname); ],
770 [ ac_cv_libc_defines___progname="yes" ],
771 [ ac_cv_libc_defines___progname="no" ]
772 )
773])
774if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
775 AC_DEFINE(HAVE___PROGNAME)
776fi
777
Damien Millera22ba012000-03-02 23:09:20 +1100778
Damien Millerecbb26d2000-07-15 14:59:14 +1000779AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
780 AC_TRY_LINK([],
781 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
782 [ ac_cv_libc_defines_sys_errlist="yes" ],
783 [ ac_cv_libc_defines_sys_errlist="no" ]
784 )
785])
786if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
787 AC_DEFINE(HAVE_SYS_ERRLIST)
788fi
789
790
Damien Miller11fa2cc2000-08-16 10:35:58 +1000791AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
792 AC_TRY_LINK([],
793 [ extern int sys_nerr; printf("%i", sys_nerr);],
794 [ ac_cv_libc_defines_sys_nerr="yes" ],
795 [ ac_cv_libc_defines_sys_nerr="no" ]
796 )
797])
798if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
799 AC_DEFINE(HAVE_SYS_NERR)
800fi
801
802
Damien Millera22ba012000-03-02 23:09:20 +1100803# Looking for programs, paths and files
804AC_ARG_WITH(rsh,
805 [ --with-rsh=PATH Specify path to remote shell program ],
806 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100807 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000808 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100809 fi
810 ],
811 [
812 AC_PATH_PROG(rsh_path, rsh)
813 ]
814)
815
816AC_ARG_WITH(xauth,
817 [ --with-xauth=PATH Specify path to xauth program ],
818 [
819 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000820 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100821 fi
822 ],
823 [
824 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000825 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100826 xauth_path="/usr/openwin/bin/xauth"
827 fi
828 ]
829)
830
831if test ! -z "$xauth_path" ; then
832 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
833fi
834if test ! -z "$rsh_path" ; then
835 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
836fi
837
838# Check for mail directory (last resort if we cannot get it from headers)
839if test ! -z "$MAIL" ; then
840 maildir=`dirname $MAIL`
841 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
842fi
843
Damien Millera22ba012000-03-02 23:09:20 +1100844if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100845 AC_CHECK_FILE("/dev/ptmx",
846 [
847 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
848 have_dev_ptmx=1
849 ]
850 )
Damien Millera22ba012000-03-02 23:09:20 +1100851fi
Damien Miller204ad072000-03-02 23:56:12 +1100852AC_CHECK_FILE("/dev/ptc",
853 [
854 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
855 have_dev_ptc=1
856 ]
857)
858
Damien Millera22ba012000-03-02 23:09:20 +1100859# Options from here on. Some of these are preset by platform above
860
Damien Millera22ba012000-03-02 23:09:20 +1100861# Check for user-specified random device, otherwise check /dev/urandom
862AC_ARG_WITH(random,
863 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
864 [
Damien Miller040f3832000-04-03 14:50:43 +1000865 if test "x$withval" != "xno" ; then
866 RANDOM_POOL="$withval";
867 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
868 fi
Damien Millera22ba012000-03-02 23:09:20 +1100869 ],
870 [
871 # Check for random device
872 AC_CHECK_FILE("/dev/urandom",
873 [
874 RANDOM_POOL="/dev/urandom";
875 AC_SUBST(RANDOM_POOL)
876 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
877 ]
878 )
879 ]
880)
881
882# Check for EGD pool file
883AC_ARG_WITH(egd-pool,
884 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
885 [
Damien Miller040f3832000-04-03 14:50:43 +1000886 if test "x$withval" != "xno" ; then
887 EGD_SOCKET="$withval";
888 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
889 fi
Damien Millera22ba012000-03-02 23:09:20 +1100890 ]
891)
892
Damien Miller0437b332000-05-02 09:56:41 +1000893# detect pathnames for entropy gathering commands, if we need them
894INSTALL_SSH_PRNG_CMDS=""
895rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000896if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000897 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000898 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
899 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
900 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
901 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
902 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
903 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
904 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
905 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
906 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
907 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
908 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
909 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
910 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
911 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
912 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000913
914 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000915fi
Damien Miller0437b332000-05-02 09:56:41 +1000916AC_SUBST(INSTALL_SSH_PRNG_CMDS)
917
Damien Miller11e37f62000-04-08 18:23:30 +1000918
Damien Miller670a4b82000-01-22 13:53:11 +1100919AC_ARG_WITH(catman,
920 [ --with-catman=man|cat Install preformatted manpages[no]],
921 [
922 MANTYPE='$(CATMAN)'
923 if test x"$withval" != x"yes" ; then
924 mansubdir=$withval
925 else
926 mansubdir=cat
927 fi
928 ], [
929 if test -z "$MANTYPE" ; then
930 MANTYPE='$(TROFFMAN)'
931 mansubdir=man
932 fi
933 ]
934)
935AC_SUBST(MANTYPE)
936AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100937
Damien Millera22ba012000-03-02 23:09:20 +1100938# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000939KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100940AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100941 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100942 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100943 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100944
945 if test "x$withval" != "$xyes" ; then
946 CFLAGS="$CFLAGS -I${withval}/include"
947 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100948 if test ! -z "$need_dash_r" ; then
949 LDFLAGS="$LDFLAGS -R${withval}/lib"
950 fi
951 if test ! -z "$blibpath" ; then
952 blibpath="$blibpath:${withval}/lib"
953 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100954 else
955 if test -d /usr/include/kerberosIV ; then
956 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
957 fi
958 fi
959
960 AC_CHECK_HEADERS(krb.h)
961 AC_CHECK_LIB(krb, main)
962 if test "$ac_cv_header_krb_h" != yes; then
963 AC_MSG_WARN([Cannot find krb.h, build may fail])
964 fi
965 if test "$ac_cv_lib_krb_main" != yes; then
966 AC_MSG_WARN([Cannot find libkrb, build may fail])
967 fi
968
Damien Millerc85f9b42000-01-29 10:20:21 +1100969 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100970 AC_CHECK_LIB(resolv, dn_expand, , )
971 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000972 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100973 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100974 fi
Damien Miller80297751999-11-19 13:03:25 +1100975 ]
976)
977
Damien Millera22ba012000-03-02 23:09:20 +1100978# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000979AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100980AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100981 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100982 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100983 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100984
985 if test "x$withval" != "$xyes" ; then
986 CFLAGS="$CFLAGS -I${withval}/include"
987 LFLAGS="$LFLAGS -L${withval}/lib"
988 fi
989
990 if test -z "$KRB4" ; then
991 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
992 fi
993
Damien Miller8bdeee21999-12-30 15:50:54 +1100994 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100995 if test ! -z "$AFS_LIBS" ; then
996 LIBS="$LIBS $AFS_LIBS"
997 fi
998 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000999 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001000 fi
Damien Miller80297751999-11-19 13:03:25 +11001001 ]
1002)
Damien Millerc85f9b42000-01-29 10:20:21 +11001003LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001004
Damien Millera22ba012000-03-02 23:09:20 +11001005# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001006SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001007AC_ARG_WITH(skey,
1008 [ --with-skey Enable S/Key support],
1009 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001010 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001011 AC_DEFINE(SKEY)
1012 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001013 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001014 fi
Damien Miller80297751999-11-19 13:03:25 +11001015 ]
1016)
1017
Damien Millera22ba012000-03-02 23:09:20 +11001018# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001019TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001020AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001021 [ --with-tcp-wrappers Enable tcpwrappers support],
1022 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001023 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001024 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001025 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001026 AC_MSG_CHECKING(for libwrap)
1027 AC_TRY_LINK(
1028 [
Damien Miller81171112000-04-23 11:14:01 +10001029#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001030 int deny_severity = 0, allow_severity = 0;
1031 ],
1032 [hosts_access(0);],
1033 [
1034 AC_MSG_RESULT(yes)
1035 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001036 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001037 ],
1038 [
Damien Miller7b22d652000-06-18 14:07:04 +10001039 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001040 ]
1041 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001042 fi
Damien Miller80297751999-11-19 13:03:25 +11001043 ]
1044)
1045
Damien Millera22ba012000-03-02 23:09:20 +11001046# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001047MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001048AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001049 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001050 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001051 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001052 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001053 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001054 fi
1055 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001056)
1057
Damien Millera22ba012000-03-02 23:09:20 +11001058# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001059AC_ARG_WITH(shadow,
1060 [ --without-shadow Disable shadow password support],
1061 [
1062 if test "x$withval" = "xno" ; then
1063 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001064 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001065 fi
1066 ]
1067)
1068
Damien Miller1f335fb2000-06-26 11:31:33 +10001069if test -z "$disable_shadow" ; then
1070 AC_MSG_CHECKING([if the systems has expire shadow information])
1071 AC_TRY_COMPILE(
1072 [
1073#include <sys/types.h>
1074#include <shadow.h>
1075 struct spwd sp;
1076 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1077 [ sp_expire_available=yes ], []
1078 )
1079
1080 if test "x$sp_expire_available" = "xyes" ; then
1081 AC_MSG_RESULT(yes)
1082 AC_DEFINE(HAS_SHADOW_EXPIRE)
1083 else
1084 AC_MSG_RESULT(no)
1085 fi
1086fi
1087
Damien Millera22ba012000-03-02 23:09:20 +11001088# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001089DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001090AC_ARG_WITH(ipaddr-display,
1091 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1092 [
Damien Millere477ef62000-08-15 10:21:17 +10001093 if test "x$withval" != "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001094 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001095 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001096 fi
1097 ]
1098)
1099
Damien Millera22ba012000-03-02 23:09:20 +11001100# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001101SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001102AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001103 [ --with-default-path=PATH Specify default \$PATH environment for server],
1104 [
1105 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001106 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001107 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001108 fi
1109 ]
1110)
1111
Damien Millera22ba012000-03-02 23:09:20 +11001112# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001113IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001114AC_ARG_WITH(ipv4-default,
1115 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1116 [
1117 if test "x$withval" != "xno" ; then
1118 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001119 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001120 fi
1121 ]
1122)
1123
Damien Miller61e50f12000-05-08 20:49:37 +10001124AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001125IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001126AC_ARG_WITH(4in6,
1127 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1128 [
1129 if test "x$withval" != "xno" ; then
1130 AC_MSG_RESULT(yes)
1131 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001132 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001133 else
1134 AC_MSG_RESULT(no)
1135 fi
1136 ],[
1137 if test "x$inet6_default_4in6" = "xyes"; then
1138 AC_MSG_RESULT([yes (default)])
1139 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001140 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001141 else
1142 AC_MSG_RESULT([no (default)])
1143 fi
1144 ]
1145)
1146
Damien Millera22ba012000-03-02 23:09:20 +11001147# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001148piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001149AC_ARG_WITH(pid-dir,
1150 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1151 [
1152 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001153 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001154 fi
1155 ]
1156)
Damien Miller4018c192000-04-30 09:30:44 +10001157
Damien Millerdbd250f2000-01-18 08:57:14 +11001158AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001159AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001160
andre2ff7b5d2000-06-03 14:57:40 +00001161dnl allow user to disable some login recording features
1162AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001163 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001164 [ AC_DEFINE(DISABLE_LASTLOG) ]
1165)
1166AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001167 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001168 [ AC_DEFINE(DISABLE_UTMP) ]
1169)
1170AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001171 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001172 [ AC_DEFINE(DISABLE_UTMPX) ]
1173)
1174AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001175 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001176 [ AC_DEFINE(DISABLE_WTMP) ]
1177)
1178AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001179 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001180 [ AC_DEFINE(DISABLE_WTMPX) ]
1181)
1182AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001183 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001184 [ AC_DEFINE(DISABLE_LOGIN) ]
1185)
1186AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001187 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001188 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1189)
1190AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001191 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001192 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1193)
1194AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001195 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001196 [ conf_lastlog_location="$withval"; ],)
1197
1198dnl lastlog, [uw]tmpx? detection
1199dnl NOTE: set the paths in the platform section to avoid the
1200dnl need for command-line parameters
1201dnl lastlog and [uw]tmp are subject to a file search if all else fails
1202
1203dnl lastlog detection
1204dnl NOTE: the code itself will detect if lastlog is a directory
1205AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1206AC_TRY_COMPILE([
1207#include <sys/types.h>
1208#include <utmp.h>
1209#ifdef HAVE_LASTLOG_H
1210# include <lastlog.h>
1211#endif
Damien Miller2994e082000-06-04 15:51:47 +10001212#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001213# include <paths.h>
1214#endif
1215 ],
1216 [ char *lastlog = LASTLOG_FILE; ],
1217 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001218 [
1219 AC_MSG_RESULT(no)
1220 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1221 AC_TRY_COMPILE([
1222#include <sys/types.h>
1223#include <utmp.h>
1224#ifdef HAVE_LASTLOG_H
1225# include <lastlog.h>
1226#endif
1227#ifdef HAVE_PATHS_H
1228# include <paths.h>
1229#endif
1230 ],
1231 [ char *lastlog = _PATH_LASTLOG; ],
1232 [ AC_MSG_RESULT(yes) ],
1233 [
andree441aa32000-06-12 22:34:38 +00001234 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001235 system_lastlog_path=no
1236 ])
1237 ]
andre2ff7b5d2000-06-03 14:57:40 +00001238)
Damien Miller2994e082000-06-04 15:51:47 +10001239
andre2ff7b5d2000-06-03 14:57:40 +00001240if test -z "$conf_lastlog_location"; then
1241 if test x"$system_lastlog_path" = x"no" ; then
1242 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001243 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001244 conf_lastlog_location=$f
1245 fi
1246 done
1247 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001248 AC_MSG_WARN([** Cannot find lastlog **])
1249 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001250 fi
1251 fi
1252fi
1253
1254if test -n "$conf_lastlog_location"; then
1255 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1256fi
1257
1258dnl utmp detection
1259AC_MSG_CHECKING([if your system defines UTMP_FILE])
1260AC_TRY_COMPILE([
1261#include <sys/types.h>
1262#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001263#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001264# include <paths.h>
1265#endif
1266 ],
1267 [ char *utmp = UTMP_FILE; ],
1268 [ AC_MSG_RESULT(yes) ],
1269 [ AC_MSG_RESULT(no)
1270 system_utmp_path=no ]
1271)
1272if test -z "$conf_utmp_location"; then
1273 if test x"$system_utmp_path" = x"no" ; then
1274 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1275 if test -f $f ; then
1276 conf_utmp_location=$f
1277 fi
1278 done
1279 if test -z "$conf_utmp_location"; then
1280 AC_DEFINE(DISABLE_UTMP)
1281 fi
1282 fi
1283fi
1284if test -n "$conf_utmp_location"; then
1285 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1286fi
1287
1288dnl wtmp detection
1289AC_MSG_CHECKING([if your system defines WTMP_FILE])
1290AC_TRY_COMPILE([
1291#include <sys/types.h>
1292#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001293#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001294# include <paths.h>
1295#endif
1296 ],
1297 [ char *wtmp = WTMP_FILE; ],
1298 [ AC_MSG_RESULT(yes) ],
1299 [ AC_MSG_RESULT(no)
1300 system_wtmp_path=no ]
1301)
1302if test -z "$conf_wtmp_location"; then
1303 if test x"$system_wtmp_path" = x"no" ; then
1304 for f in /usr/adm/wtmp /var/log/wtmp; do
1305 if test -f $f ; then
1306 conf_wtmp_location=$f
1307 fi
1308 done
1309 if test -z "$conf_wtmp_location"; then
1310 AC_DEFINE(DISABLE_WTMP)
1311 fi
1312 fi
1313fi
1314if test -n "$conf_wtmp_location"; then
1315 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1316fi
1317
1318
1319dnl utmpx detection - I don't know any system so perverse as to require
1320dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1321dnl there, though.
1322AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1323AC_TRY_COMPILE([
1324#include <sys/types.h>
1325#include <utmp.h>
1326#ifdef HAVE_UTMPX_H
1327#include <utmpx.h>
1328#endif
Damien Miller2994e082000-06-04 15:51:47 +10001329#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001330# include <paths.h>
1331#endif
1332 ],
1333 [ char *utmpx = UTMPX_FILE; ],
1334 [ AC_MSG_RESULT(yes) ],
1335 [ AC_MSG_RESULT(no)
1336 system_utmpx_path=no ]
1337)
1338if test -z "$conf_utmpx_location"; then
1339 if test x"$system_utmpx_path" = x"no" ; then
1340 AC_DEFINE(DISABLE_UTMPX)
1341 fi
1342else
1343 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1344fi
1345
1346dnl wtmpx detection
1347AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1348AC_TRY_COMPILE([
1349#include <sys/types.h>
1350#include <utmp.h>
1351#ifdef HAVE_UTMPX_H
1352#include <utmpx.h>
1353#endif
Damien Miller2994e082000-06-04 15:51:47 +10001354#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001355# include <paths.h>
1356#endif
1357 ],
1358 [ char *wtmpx = WTMPX_FILE; ],
1359 [ AC_MSG_RESULT(yes) ],
1360 [ AC_MSG_RESULT(no)
1361 system_wtmpx_path=no ]
1362)
1363if test -z "$conf_wtmpx_location"; then
1364 if test x"$system_wtmpx_path" = x"no" ; then
1365 AC_DEFINE(DISABLE_WTMPX)
1366 fi
1367else
1368 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1369fi
1370
Damien Miller4018c192000-04-30 09:30:44 +10001371
1372# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001373entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001374AC_ARG_WITH(entropy-timeout,
1375 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1376 [
1377 if test "x$withval" != "xno" ; then
1378 entropy_timeout=$withval
1379 fi
1380 ]
1381)
1382AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1383
1384
Damien Miller29ea30d2000-03-17 10:54:15 +11001385if test ! -z "$blibpath" ; then
1386 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1387 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1388fi
1389
Damien Miller0437b332000-05-02 09:56:41 +10001390AC_OUTPUT(Makefile ssh_prng_cmds)
1391
Damien Miller7b22d652000-06-18 14:07:04 +10001392# Print summary of options
1393
1394if test x$MANTYPE = x'$(CATMAN)' ; then
1395 MAN_MSG=cat
1396else
1397 MAN_MSG=man
1398fi
1399if test ! -z "$RANDOM_POOL" ; then
1400 RAND_MSG="Device ($RANDOM_POOL)"
1401else
1402 if test ! -z "$EGD_SOCKET" ; then
1403 RAND_MSG="EGD ($EGD_SOCKET)"
1404 else
1405 RAND_MSG="Builtin (timeout $entropy_timeout)"
1406 fi
1407fi
1408
1409# Someone please show me a better way :)
1410A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1411B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1412C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1413D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1414E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1415F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1416G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1417
1418echo ""
1419echo "OpenSSH configured has been configured with the following options."
1420echo " User binaries: $B"
1421echo " System binaries: $C"
1422echo " Configuration files: $D"
1423echo " Askpass program: $E"
1424echo " Manual pages: $F"
1425echo " PID file: $G"
1426echo " Random number collection: $RAND_MSG"
1427echo " Manpage format: $MAN_MSG"
1428echo " PAM support: ${PAM_MSG}"
1429echo " KerberosIV support: $KRB4_MSG"
1430echo " AFS support: $AFS_MSG"
1431echo " S/KEY support: $SKEY_MSG"
1432echo " TCP Wrappers support: $TCPW_MSG"
1433echo " MD5 password support: $MD5_MSG"
1434echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1435echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1436echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1437
1438echo ""
1439
1440echo "Compiler flags: ${CFLAGS}"
1441echo "Linker flags: ${LDFLAGS}"
1442echo "Libraries: ${LIBS}"
1443
1444echo ""
1445