blob: 5321aedc4a0e77dfed7e74b089e8ea18d6640fc1 [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"
Damien Miller9a947342000-08-30 10:03:33 +110062 IPADDR_IN_DISPLAY=yes
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*)
Damien Miller1bead332000-04-30 00:47:29 +100078 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110079 IPADDR_IN_DISPLAY=yes
Damien Miller5552d7a2000-08-30 09:53:24 +110080 AC_DEFINE(USE_PIPES)
Damien Miller1bead332000-04-30 00:47:29 +100081 AC_MSG_CHECKING(for HPUX trusted system password database)
82 if test -f /tcb/files/auth/system/default; then
83 AC_MSG_RESULT(yes)
84 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
85 LIBS="$LIBS -lsec"
86 AC_MSG_WARN([This configuration is untested])
87 else
88 AC_MSG_RESULT(no)
89 AC_DEFINE(DISABLE_SHADOW)
90 fi
91 MANTYPE='$(CATMAN)'
92 mansubdir=cat
93 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110094*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110095 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100096 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110097 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110098 no_libsocket=1
99 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000100 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100101 ;;
102*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +1100103 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000104 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +1100105 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000106 AC_DEFINE(WITH_IRIX_ARRAY)
107 AC_DEFINE(WITH_IRIX_PROJECT)
108 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100109 no_libsocket=1
110 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000111 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100112 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100113*-*-linux*)
114 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100115 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000116 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100117 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100118 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100119*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100120 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100121 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000122*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000123 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100124 conf_utmp_location=/etc/utmp
125 conf_wtmp_location=/usr/adm/wtmp
126 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000127 AC_DEFINE(HAVE_NEXT)
128 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000129 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
Damien Miller0f91b4e2000-06-18 15:43:25 +1000130 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100131*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100132 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100133 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100134 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000135 # hardwire lastlog location (can't detect it on some versions)
136 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000137 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
138 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
139 if test "$sol2ver" -ge 8; then
140 AC_MSG_RESULT(yes)
141 AC_DEFINE(DISABLE_UTMP)
142 AC_DEFINE(DISABLE_WTMP)
143 else
144 AC_MSG_RESULT(no)
145 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100146 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000147*-*-sunos4*)
148 CFLAGS="$CFLAGS -DSUNOS4"
149 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000150 conf_utmp_location=/etc/utmp
151 conf_wtmp_location=/var/adm/wtmp
152 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000153 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000154 MANTYPE='$(CATMAN)'
155 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000156 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000157*-sni-sysv*)
158 CFLAGS="$CFLAGS -I/usr/local/include"
159 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
160 MANTYPE='$(CATMAN)'
161 AC_DEFINE(IP_TOS_IS_BROKEN)
162 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000163 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000164 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100165*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100166 CFLAGS="$CFLAGS -I/usr/local/include"
167 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100168 MANTYPE='$(CATMAN)'
169 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100170 LIBS="$LIBS -lgen -lsocket"
171 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000172*-*-sco3*)
173 CFLAGS="$CFLAGS -I/usr/local/include"
174 LDFLAGS="$LDFLAGS -L/usr/local/lib"
175 MANTYPE='$(CATMAN)'
176 mansubdir=cat
177 LIBS="$LIBS -lgen -lsocket"
178 no_dev_ptmx=1
179 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000180*-dec-osf*)
181# This is untested
182 if test ! -z "USE_SIA" ; then
183 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
184 if test -f /etc/sia/matrix.conf; then
185 AC_MSG_RESULT(yes)
186 AC_DEFINE(HAVE_OSF_SIA)
187 AC_DEFINE(DISABLE_LOGIN)
188 LIBS="$LIBS -lsecurity -ldb -lm -laud"
189 else
190 AC_MSG_RESULT(no)
191 fi
192 fi
193 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100194esac
195
Damien Millere37bfc12000-06-05 09:37:43 +1000196# Allow user to specify flags
197AC_ARG_WITH(cflags,
198 [ --with-cflags Specify additional flags to pass to compiler],
199 [
200 if test "x$withval" != "xno" ; then
201 CFLAGS="$CFLAGS $withval"
202 fi
203 ]
204)
205AC_ARG_WITH(ldflags,
206 [ --with-ldlags Specify additional flags to pass to linker],
207 [
208 if test "x$withval" != "xno" ; then
209 LDFLAGS="$LDFLAGS $withval"
210 fi
211 ]
212)
213AC_ARG_WITH(libs,
214 [ --with-libs Specify additional libraries to link with],
215 [
216 if test "x$withval" != "xno" ; then
217 LIBS="$LIBS $withval"
218 fi
219 ]
220)
221
222
Damien Millera22ba012000-03-02 23:09:20 +1100223# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100224AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
225AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100226
Damien Millerbeb4ba51999-12-28 15:09:35 +1100227if test -z "$no_libsocket" ; then
228 AC_CHECK_LIB(nsl, yp_match, , )
229fi
230if test -z "$no_libnsl" ; then
231 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100232fi
Damien Millerab18c411999-11-11 10:40:23 +1100233
Damien Millera22ba012000-03-02 23:09:20 +1100234# Checks for header files.
Damien Millerad833b32000-08-23 10:46:23 +1000235AC_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 +1100236
Damien Millerad833b32000-08-23 10:46:23 +1000237dnl Checks for library functions.
238AC_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)
239dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000240AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000241dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000242AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000243dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000244AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
245AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000246dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000247AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
248AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100249
Damien Miller5fc85652000-07-09 23:53:07 +1000250AC_CHECK_FUNC(getuserattr,
251 [AC_DEFINE(HAVE_GETUSERATTR)],
252 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
253)
254
Damien Miller04f80141999-11-19 15:32:34 +1100255AC_CHECK_FUNC(login,
256 [AC_DEFINE(HAVE_LOGIN)],
257 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
258)
259
260AC_CHECK_FUNC(daemon,
261 [AC_DEFINE(HAVE_DAEMON)],
262 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
263)
264
Damien Miller9fb07e42000-03-05 16:22:59 +1100265AC_CHECK_FUNC(getpagesize,
266 [AC_DEFINE(HAVE_GETPAGESIZE)],
267 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
268)
269
Damien Millercb170cb2000-07-01 16:52:55 +1000270# Check for broken snprintf
271if test "x$ac_cv_func_snprintf" = "xyes" ; then
272 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
273 AC_TRY_RUN(
274 [
275#include <stdio.h>
276int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
277 ],
278 [AC_MSG_RESULT(yes)],
279 [
280 AC_MSG_RESULT(no)
281 AC_DEFINE(BROKEN_SNPRINTF)
282 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
283 ]
284 )
285fi
286
Damien Miller7b22d652000-06-18 14:07:04 +1000287PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100288AC_ARG_WITH(pam,
289 [ --without-pam Disable PAM support ],
290 [
291 if test "x$withval" = "xno" ; then
292 no_pam=1
293 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000294 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100295 fi
296 ]
297)
Damien Milleredb82922000-06-20 13:25:52 +1000298if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100299 AC_CHECK_LIB(dl, dlopen, , )
300 LIBS="$LIBS -lpam"
301
Damien Miller0e65eed2000-05-17 22:16:05 +1000302 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000303
Damien Miller1f335fb2000-06-26 11:31:33 +1000304 disable_shadow=yes
305
Damien Miller7b22d652000-06-18 14:07:04 +1000306 PAM_MSG="yes"
307
Damien Millera22ba012000-03-02 23:09:20 +1100308 # Check PAM strerror arguments (old PAM)
309 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
310 AC_TRY_COMPILE(
311 [
Damien Miller81171112000-04-23 11:14:01 +1000312#include <stdlib.h>
313#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100314 ],
315 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
316 [AC_MSG_RESULT(no)],
317 [
318 AC_DEFINE(HAVE_OLD_PAM)
319 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000320 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100321 ]
322 )
323fi
324
325# The big search for OpenSSL
326AC_ARG_WITH(ssl-dir,
327 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
328 [
329 if test "x$withval" != "$xno" ; then
330 tryssldir=$withval
331 fi
332 ]
333)
334
335saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100336saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100337saved_CFLAGS="$CFLAGS"
338if test "x$prefix" != "xNONE" ; then
339 tryssldir="$tryssldir $prefix"
340fi
Damien Miller61e50f12000-05-08 20:49:37 +1000341AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100342
Damien Miller61e50f12000-05-08 20:49:37 +1000343 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
344 if test ! -z "$ssldir" ; then
345 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
346 CFLAGS="$saved_CFLAGS -I$ssldir/include"
347 if test ! -z "$need_dash_r" ; then
348 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
349 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100350 else
Damien Miller61e50f12000-05-08 20:49:37 +1000351 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100352 fi
353
Damien Miller3b512e12000-05-17 23:29:18 +1000354 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000355
Damien Miller3b512e12000-05-17 23:29:18 +1000356 # Basic test to check for compatible version and correct linking
357 # *does not* test for RSA - that comes later.
358 AC_TRY_RUN(
359 [
Damien Millere59ce622000-05-01 20:54:17 +1000360#include <string.h>
361#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000362int main(void)
363{
Damien Miller3b512e12000-05-17 23:29:18 +1000364 char a[2048];
365 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000366 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000367 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000368}
Damien Miller3b512e12000-05-17 23:29:18 +1000369 ],
370 [
371 found_crypto=1
372 break;
373 ], []
374 )
Damien Miller61e50f12000-05-08 20:49:37 +1000375
376 if test ! -z "$found_crypto" ; then
377 break;
378 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100379 done
380
Damien Miller61e50f12000-05-08 20:49:37 +1000381 if test -z "$found_crypto" ; then
382 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100383 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000384 if test -z "$ssldir" ; then
385 ssldir="(system)"
386 fi
Damien Millera22ba012000-03-02 23:09:20 +1100387
Damien Miller61e50f12000-05-08 20:49:37 +1000388 ac_cv_openssldir=$ssldir
389])
390
Damien Milleredb82922000-06-20 13:25:52 +1000391if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000392 AC_DEFINE(HAVE_OPENSSL)
393 dnl Need to recover ssldir - test above runs in subshell
394 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100395 CFLAGS="$saved_CFLAGS -I$ssldir/include"
396 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
397 if test ! -z "$need_dash_r" ; then
398 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100399 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100400 if test ! -z "$blibpath" ; then
401 blibpath="$blibpath:$ssldir:$ssldir/lib"
402 fi
Damien Millera22ba012000-03-02 23:09:20 +1100403fi
Damien Miller3b512e12000-05-17 23:29:18 +1000404LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000405
Damien Miller3b512e12000-05-17 23:29:18 +1000406# Now test RSA support
407saved_LIBS="$LIBS"
408AC_MSG_CHECKING([for RSA support])
409for WANTS_RSAREF in "" 1 ; do
410 if test -z "$WANTS_RSAREF" ; then
411 LIBS="$saved_LIBS"
412 else
413 LIBS="$saved_LIBS -lRSAglue -lrsaref"
414 fi
415 AC_TRY_RUN([
416#include <string.h>
417#include <openssl/rand.h>
418#include <openssl/rsa.h>
419#include <openssl/bn.h>
420#include <openssl/sha.h>
421int main(void)
422{
423 int num; RSA *key; static unsigned char p_in[] = "blahblah";
424 unsigned char c[256], p[256];
425 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
426 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
427 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
428 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
429}
430 ],
431 [
432 rsa_works=1
433 break;
434 ], [])
435done
436
437if test ! -z "$no_rsa" ; then
438 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000439 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000440else
441 if test -z "$rsa_works" ; then
442 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000443 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000444 else
445 if test -z "$WANTS_RSAREF" ; then
446 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000447 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000448 else
Damien Miller7b22d652000-06-18 14:07:04 +1000449 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000450 AC_MSG_RESULT(using RSAref)
451 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
452 fi
453 fi
454fi
Damien Millera22ba012000-03-02 23:09:20 +1100455
456# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100457AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100458AC_CHECK_SIZEOF(short int, 2)
459AC_CHECK_SIZEOF(int, 4)
460AC_CHECK_SIZEOF(long int, 4)
461AC_CHECK_SIZEOF(long long int, 8)
462
Damien Millera22ba012000-03-02 23:09:20 +1100463# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100464AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
465 AC_TRY_COMPILE(
466 [ #include <sys/types.h> ],
467 [ u_int a; a = 1;],
468 [ ac_cv_have_u_int="yes" ],
469 [ ac_cv_have_u_int="no" ]
470 )
471])
472if test "x$ac_cv_have_u_int" = "xyes" ; then
473 AC_DEFINE(HAVE_U_INT)
474 have_u_int=1
475fi
476
Damien Miller61e50f12000-05-08 20:49:37 +1000477AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
478 AC_TRY_COMPILE(
479 [ #include <sys/types.h> ],
480 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
481 [ ac_cv_have_intxx_t="yes" ],
482 [ ac_cv_have_intxx_t="no" ]
483 )
484])
485if test "x$ac_cv_have_intxx_t" = "xyes" ; then
486 AC_DEFINE(HAVE_INTXX_T)
487 have_intxx_t=1
488fi
489
490AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
491 AC_TRY_COMPILE(
492 [ #include <sys/types.h> ],
493 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
494 [ ac_cv_have_u_intxx_t="yes" ],
495 [ ac_cv_have_u_intxx_t="no" ]
496 )
497])
498if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
499 AC_DEFINE(HAVE_U_INTXX_T)
500 have_u_intxx_t=1
501fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100502
Damien Milleredb82922000-06-20 13:25:52 +1000503if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
504 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100505then
506 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
507 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000508 [
509#include <sys/bitypes.h>
510 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100511 [
Damien Miller70494d12000-04-03 15:57:06 +1000512 int8_t a; int16_t b; int32_t c;
513 u_int8_t e; u_int16_t f; u_int32_t g;
514 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100515 ],
516 [
517 AC_DEFINE(HAVE_U_INTXX_T)
518 AC_DEFINE(HAVE_INTXX_T)
519 AC_MSG_RESULT(yes)
520 ],
521 [AC_MSG_RESULT(no)]
522 )
523fi
524
Damien Millerd6121d22000-03-17 23:26:46 +1100525if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000526 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
527 AC_TRY_COMPILE(
528 [
529#include <sys/types.h>
530 ],
531 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
532 [ ac_cv_have_uintxx_t="yes" ],
533 [ ac_cv_have_uintxx_t="no" ]
534 )
535 ])
536 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
537 AC_DEFINE(HAVE_UINTXX_T)
538 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100539fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100540
Damien Miller61e50f12000-05-08 20:49:37 +1000541AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
542 AC_TRY_COMPILE(
543 [
Damien Miller81171112000-04-23 11:14:01 +1000544#include <sys/types.h>
545#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000546 ],
547 [socklen_t foo; foo = 1235;],
548 [ ac_cv_have_socklen_t="yes" ],
549 [ ac_cv_have_socklen_t="no" ]
550 )
551])
552if test "x$ac_cv_have_socklen_t" = "xyes" ; then
553 AC_DEFINE(HAVE_SOCKLEN_T)
554fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100555
Damien Miller61e50f12000-05-08 20:49:37 +1000556AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
557 AC_TRY_COMPILE(
558 [
559#include <sys/types.h>
560 ],
561 [ size_t foo; foo = 1235; ],
562 [ ac_cv_have_size_t="yes" ],
563 [ ac_cv_have_size_t="no" ]
564 )
565])
566if test "x$ac_cv_have_size_t" = "xyes" ; then
567 AC_DEFINE(HAVE_SIZE_T)
568fi
Damien Miller95058511999-12-29 10:36:45 +1100569
Damien Miller615f9392000-05-17 22:53:33 +1000570AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
571 AC_TRY_COMPILE(
572 [
573#include <sys/types.h>
574 ],
575 [ ssize_t foo; foo = 1235; ],
576 [ ac_cv_have_ssize_t="yes" ],
577 [ ac_cv_have_ssize_t="no" ]
578 )
579])
580if test "x$ac_cv_have_ssize_t" = "xyes" ; then
581 AC_DEFINE(HAVE_SSIZE_T)
582fi
583
Damien Millerb54b40e2000-06-23 08:23:34 +1000584AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
585 AC_TRY_COMPILE(
586 [
587#include <sys/types.h>
588#include <sys/socket.h>
589 ],
590 [ sa_family_t foo; foo = 1235; ],
591 [ ac_cv_have_sa_family_t="yes" ],
592 [ ac_cv_have_sa_family_t="no" ]
593 )
594])
595if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
596 AC_DEFINE(HAVE_SA_FAMILY_T)
597fi
598
Damien Miller0f91b4e2000-06-18 15:43:25 +1000599AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
600 AC_TRY_COMPILE(
601 [
602#include <sys/types.h>
603 ],
604 [ pid_t foo; foo = 1235; ],
605 [ ac_cv_have_pid_t="yes" ],
606 [ ac_cv_have_pid_t="no" ]
607 )
608])
609if test "x$ac_cv_have_pid_t" = "xyes" ; then
610 AC_DEFINE(HAVE_PID_T)
611fi
612
613AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
614 AC_TRY_COMPILE(
615 [
616#include <sys/types.h>
617 ],
618 [ mode_t foo; foo = 1235; ],
619 [ ac_cv_have_mode_t="yes" ],
620 [ ac_cv_have_mode_t="no" ]
621 )
622])
623if test "x$ac_cv_have_mode_t" = "xyes" ; then
624 AC_DEFINE(HAVE_MODE_T)
625fi
626
Damien Miller61e50f12000-05-08 20:49:37 +1000627
628AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
629 AC_TRY_COMPILE(
630 [
Damien Miller81171112000-04-23 11:14:01 +1000631#include <sys/types.h>
632#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000633 ],
634 [ struct sockaddr_storage s; ],
635 [ ac_cv_have_struct_sockaddr_storage="yes" ],
636 [ ac_cv_have_struct_sockaddr_storage="no" ]
637 )
638])
639if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
640 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
641fi
Damien Miller34132e52000-01-14 15:45:46 +1100642
Damien Miller61e50f12000-05-08 20:49:37 +1000643AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
644 AC_TRY_COMPILE(
645 [
Damien Miller7b22d652000-06-18 14:07:04 +1000646#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000647#include <netinet/in.h>
648 ],
649 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
650 [ ac_cv_have_struct_sockaddr_in6="yes" ],
651 [ ac_cv_have_struct_sockaddr_in6="no" ]
652 )
653])
654if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
655 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
656fi
Damien Miller34132e52000-01-14 15:45:46 +1100657
Damien Miller61e50f12000-05-08 20:49:37 +1000658AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
659 AC_TRY_COMPILE(
660 [
Damien Miller7b22d652000-06-18 14:07:04 +1000661#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000662#include <netinet/in.h>
663 ],
664 [ struct in6_addr s; s.s6_addr[0] = 0; ],
665 [ ac_cv_have_struct_in6_addr="yes" ],
666 [ ac_cv_have_struct_in6_addr="no" ]
667 )
668])
669if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
670 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
671fi
Damien Miller34132e52000-01-14 15:45:46 +1100672
Damien Miller61e50f12000-05-08 20:49:37 +1000673AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
674 AC_TRY_COMPILE(
675 [
Damien Miller81171112000-04-23 11:14:01 +1000676#include <sys/types.h>
677#include <sys/socket.h>
678#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000679 ],
680 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
681 [ ac_cv_have_struct_addrinfo="yes" ],
682 [ ac_cv_have_struct_addrinfo="no" ]
683 )
684])
685if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
686 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
687fi
688
Damien Miller34132e52000-01-14 15:45:46 +1100689
Damien Millera22ba012000-03-02 23:09:20 +1100690# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100691
Damien Miller61e50f12000-05-08 20:49:37 +1000692OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
693OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
694OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
695OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
696OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000697OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000698OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
699OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000700OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000701OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
702OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
703OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
704OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000705OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
706OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
707OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
708OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
709
Damien Miller942da032000-08-18 13:59:06 +1000710AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
711 ac_cv_have_sun_len_in_struct_sockaddr_un, [
712 AC_TRY_COMPILE(
713 [
714#include <sys/types.h>
715#include <sys/socket.h>
716 ],
717 [ struct sockaddr_un s; s.sun_len = 1; ],
718 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
719 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
720 )
721])
722if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
723 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
724fi
725
Damien Miller61e50f12000-05-08 20:49:37 +1000726AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
727 ac_cv_have_ss_family_in_struct_ss, [
728 AC_TRY_COMPILE(
729 [
Damien Miller81171112000-04-23 11:14:01 +1000730#include <sys/types.h>
731#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000732 ],
733 [ struct sockaddr_storage s; s.ss_family = 1; ],
734 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
735 [ ac_cv_have_ss_family_in_struct_ss="no" ],
736 )
737])
738if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
739 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
740fi
741
Damien Miller61e50f12000-05-08 20:49:37 +1000742AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
743 ac_cv_have___ss_family_in_struct_ss, [
744 AC_TRY_COMPILE(
745 [
Damien Miller81171112000-04-23 11:14:01 +1000746#include <sys/types.h>
747#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000748 ],
749 [ struct sockaddr_storage s; s.__ss_family = 1; ],
750 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
751 [ ac_cv_have___ss_family_in_struct_ss="no" ]
752 )
753])
754if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
755 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
756fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100757
Damien Millerad833b32000-08-23 10:46:23 +1000758AC_CACHE_CHECK([for pw_class field in struct passwd],
759 ac_cv_have_pw_class_in_struct_passwd, [
760 AC_TRY_COMPILE(
761 [
762#include <sys/types.h>
763#include <pwd.h>
764 ],
765 [ struct passwd p s; p.pw_class = NULL; ],
766 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
767 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
768 )
769])
770if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
771 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
772fi
773
Damien Miller61e50f12000-05-08 20:49:37 +1000774
775AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
776 AC_TRY_LINK([],
777 [ extern char *__progname; printf("%s", __progname); ],
778 [ ac_cv_libc_defines___progname="yes" ],
779 [ ac_cv_libc_defines___progname="no" ]
780 )
781])
782if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
783 AC_DEFINE(HAVE___PROGNAME)
784fi
785
Damien Millera22ba012000-03-02 23:09:20 +1100786
Damien Millerecbb26d2000-07-15 14:59:14 +1000787AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
788 AC_TRY_LINK([],
789 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
790 [ ac_cv_libc_defines_sys_errlist="yes" ],
791 [ ac_cv_libc_defines_sys_errlist="no" ]
792 )
793])
794if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
795 AC_DEFINE(HAVE_SYS_ERRLIST)
796fi
797
798
Damien Miller11fa2cc2000-08-16 10:35:58 +1000799AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
800 AC_TRY_LINK([],
801 [ extern int sys_nerr; printf("%i", sys_nerr);],
802 [ ac_cv_libc_defines_sys_nerr="yes" ],
803 [ ac_cv_libc_defines_sys_nerr="no" ]
804 )
805])
806if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
807 AC_DEFINE(HAVE_SYS_NERR)
808fi
809
810
Damien Millera22ba012000-03-02 23:09:20 +1100811# Looking for programs, paths and files
812AC_ARG_WITH(rsh,
813 [ --with-rsh=PATH Specify path to remote shell program ],
814 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100815 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000816 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100817 fi
818 ],
819 [
820 AC_PATH_PROG(rsh_path, rsh)
821 ]
822)
823
824AC_ARG_WITH(xauth,
825 [ --with-xauth=PATH Specify path to xauth program ],
826 [
827 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000828 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100829 fi
830 ],
831 [
832 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000833 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100834 xauth_path="/usr/openwin/bin/xauth"
835 fi
836 ]
837)
838
839if test ! -z "$xauth_path" ; then
840 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
841fi
842if test ! -z "$rsh_path" ; then
843 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
844fi
845
846# Check for mail directory (last resort if we cannot get it from headers)
847if test ! -z "$MAIL" ; then
848 maildir=`dirname $MAIL`
849 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
850fi
851
Damien Millera22ba012000-03-02 23:09:20 +1100852if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100853 AC_CHECK_FILE("/dev/ptmx",
854 [
855 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
856 have_dev_ptmx=1
857 ]
858 )
Damien Millera22ba012000-03-02 23:09:20 +1100859fi
Damien Miller204ad072000-03-02 23:56:12 +1100860AC_CHECK_FILE("/dev/ptc",
861 [
862 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
863 have_dev_ptc=1
864 ]
865)
866
Damien Millera22ba012000-03-02 23:09:20 +1100867# Options from here on. Some of these are preset by platform above
868
Damien Millera22ba012000-03-02 23:09:20 +1100869# Check for user-specified random device, otherwise check /dev/urandom
870AC_ARG_WITH(random,
871 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
872 [
Damien Miller040f3832000-04-03 14:50:43 +1000873 if test "x$withval" != "xno" ; then
874 RANDOM_POOL="$withval";
875 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
876 fi
Damien Millera22ba012000-03-02 23:09:20 +1100877 ],
878 [
879 # Check for random device
880 AC_CHECK_FILE("/dev/urandom",
881 [
882 RANDOM_POOL="/dev/urandom";
883 AC_SUBST(RANDOM_POOL)
884 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
885 ]
886 )
887 ]
888)
889
890# Check for EGD pool file
891AC_ARG_WITH(egd-pool,
892 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
893 [
Damien Miller040f3832000-04-03 14:50:43 +1000894 if test "x$withval" != "xno" ; then
895 EGD_SOCKET="$withval";
896 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
897 fi
Damien Millera22ba012000-03-02 23:09:20 +1100898 ]
899)
900
Damien Miller0437b332000-05-02 09:56:41 +1000901# detect pathnames for entropy gathering commands, if we need them
902INSTALL_SSH_PRNG_CMDS=""
903rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000904if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000905 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000906 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
907 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
908 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
909 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
910 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
911 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
912 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
913 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
914 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
915 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
916 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
917 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
918 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
919 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
920 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000921
922 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000923fi
Damien Miller0437b332000-05-02 09:56:41 +1000924AC_SUBST(INSTALL_SSH_PRNG_CMDS)
925
Damien Miller11e37f62000-04-08 18:23:30 +1000926
Damien Miller670a4b82000-01-22 13:53:11 +1100927AC_ARG_WITH(catman,
928 [ --with-catman=man|cat Install preformatted manpages[no]],
929 [
930 MANTYPE='$(CATMAN)'
931 if test x"$withval" != x"yes" ; then
932 mansubdir=$withval
933 else
934 mansubdir=cat
935 fi
936 ], [
937 if test -z "$MANTYPE" ; then
938 MANTYPE='$(TROFFMAN)'
939 mansubdir=man
940 fi
941 ]
942)
943AC_SUBST(MANTYPE)
944AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100945
Damien Millera22ba012000-03-02 23:09:20 +1100946# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000947KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100948AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100949 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100950 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100951 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100952
953 if test "x$withval" != "$xyes" ; then
954 CFLAGS="$CFLAGS -I${withval}/include"
955 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100956 if test ! -z "$need_dash_r" ; then
957 LDFLAGS="$LDFLAGS -R${withval}/lib"
958 fi
959 if test ! -z "$blibpath" ; then
960 blibpath="$blibpath:${withval}/lib"
961 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100962 else
963 if test -d /usr/include/kerberosIV ; then
964 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
965 fi
966 fi
967
968 AC_CHECK_HEADERS(krb.h)
969 AC_CHECK_LIB(krb, main)
970 if test "$ac_cv_header_krb_h" != yes; then
971 AC_MSG_WARN([Cannot find krb.h, build may fail])
972 fi
973 if test "$ac_cv_lib_krb_main" != yes; then
974 AC_MSG_WARN([Cannot find libkrb, build may fail])
975 fi
976
Damien Millerc85f9b42000-01-29 10:20:21 +1100977 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100978 AC_CHECK_LIB(resolv, dn_expand, , )
979 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000980 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100981 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100982 fi
Damien Miller80297751999-11-19 13:03:25 +1100983 ]
984)
985
Damien Millera22ba012000-03-02 23:09:20 +1100986# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000987AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100988AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100989 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100990 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100991 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100992
993 if test "x$withval" != "$xyes" ; then
994 CFLAGS="$CFLAGS -I${withval}/include"
995 LFLAGS="$LFLAGS -L${withval}/lib"
996 fi
997
998 if test -z "$KRB4" ; then
999 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1000 fi
1001
Damien Miller8bdeee21999-12-30 15:50:54 +11001002 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001003 if test ! -z "$AFS_LIBS" ; then
1004 LIBS="$LIBS $AFS_LIBS"
1005 fi
1006 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001007 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001008 fi
Damien Miller80297751999-11-19 13:03:25 +11001009 ]
1010)
Damien Millerc85f9b42000-01-29 10:20:21 +11001011LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001012
Damien Millera22ba012000-03-02 23:09:20 +11001013# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001014SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001015AC_ARG_WITH(skey,
1016 [ --with-skey Enable S/Key support],
1017 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001018 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001019 AC_DEFINE(SKEY)
1020 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001021 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001022 fi
Damien Miller80297751999-11-19 13:03:25 +11001023 ]
1024)
1025
Damien Millera22ba012000-03-02 23:09:20 +11001026# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001027TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001028AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001029 [ --with-tcp-wrappers Enable tcpwrappers support],
1030 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001031 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001032 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001033 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001034 AC_MSG_CHECKING(for libwrap)
1035 AC_TRY_LINK(
1036 [
Damien Miller81171112000-04-23 11:14:01 +10001037#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001038 int deny_severity = 0, allow_severity = 0;
1039 ],
1040 [hosts_access(0);],
1041 [
1042 AC_MSG_RESULT(yes)
1043 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001044 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001045 ],
1046 [
Damien Miller7b22d652000-06-18 14:07:04 +10001047 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001048 ]
1049 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001050 fi
Damien Miller80297751999-11-19 13:03:25 +11001051 ]
1052)
1053
Damien Millera22ba012000-03-02 23:09:20 +11001054# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001055MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001056AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001057 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001058 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001059 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001060 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001061 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001062 fi
1063 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001064)
1065
Damien Millera22ba012000-03-02 23:09:20 +11001066# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001067AC_ARG_WITH(shadow,
1068 [ --without-shadow Disable shadow password support],
1069 [
1070 if test "x$withval" = "xno" ; then
1071 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001072 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001073 fi
1074 ]
1075)
1076
Damien Miller1f335fb2000-06-26 11:31:33 +10001077if test -z "$disable_shadow" ; then
1078 AC_MSG_CHECKING([if the systems has expire shadow information])
1079 AC_TRY_COMPILE(
1080 [
1081#include <sys/types.h>
1082#include <shadow.h>
1083 struct spwd sp;
1084 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1085 [ sp_expire_available=yes ], []
1086 )
1087
1088 if test "x$sp_expire_available" = "xyes" ; then
1089 AC_MSG_RESULT(yes)
1090 AC_DEFINE(HAS_SHADOW_EXPIRE)
1091 else
1092 AC_MSG_RESULT(no)
1093 fi
1094fi
1095
Damien Millera22ba012000-03-02 23:09:20 +11001096# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001097if test ! -z "$IPADDR_IN_DISPLAY" ; then
1098 DISPLAY_HACK_MSG="yes"
1099 AC_DEFINE(IPADDR_IN_DISPLAY)
1100else
1101 DISPLAY_HACK_MSG="no"
1102 AC_ARG_WITH(ipaddr-display,
1103 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1104 [
1105 if test "x$withval" != "xno" ; then
1106 AC_DEFINE(IPADDR_IN_DISPLAY)
1107 DISPLAY_HACK_MSG="yes"
1108 fi
1109 ]
1110 )
1111fi
Damien Miller76112de1999-12-21 11:18:08 +11001112
Damien Millera22ba012000-03-02 23:09:20 +11001113# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001114SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001115AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001116 [ --with-default-path=PATH Specify default \$PATH environment for server],
1117 [
1118 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001119 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001120 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001121 fi
1122 ]
1123)
1124
Damien Millera22ba012000-03-02 23:09:20 +11001125# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001126IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001127AC_ARG_WITH(ipv4-default,
1128 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1129 [
1130 if test "x$withval" != "xno" ; then
1131 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001132 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001133 fi
1134 ]
1135)
1136
Damien Miller61e50f12000-05-08 20:49:37 +10001137AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001138IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001139AC_ARG_WITH(4in6,
1140 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1141 [
1142 if test "x$withval" != "xno" ; then
1143 AC_MSG_RESULT(yes)
1144 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001145 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001146 else
1147 AC_MSG_RESULT(no)
1148 fi
1149 ],[
1150 if test "x$inet6_default_4in6" = "xyes"; then
1151 AC_MSG_RESULT([yes (default)])
1152 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001153 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001154 else
1155 AC_MSG_RESULT([no (default)])
1156 fi
1157 ]
1158)
1159
Damien Millera22ba012000-03-02 23:09:20 +11001160# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001161piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001162AC_ARG_WITH(pid-dir,
1163 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1164 [
1165 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001166 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001167 fi
1168 ]
1169)
Damien Miller4018c192000-04-30 09:30:44 +10001170
Damien Millerdbd250f2000-01-18 08:57:14 +11001171AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001172AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001173
andre2ff7b5d2000-06-03 14:57:40 +00001174dnl allow user to disable some login recording features
1175AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001176 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001177 [ AC_DEFINE(DISABLE_LASTLOG) ]
1178)
1179AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001180 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001181 [ AC_DEFINE(DISABLE_UTMP) ]
1182)
1183AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001184 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001185 [ AC_DEFINE(DISABLE_UTMPX) ]
1186)
1187AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001188 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001189 [ AC_DEFINE(DISABLE_WTMP) ]
1190)
1191AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001192 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001193 [ AC_DEFINE(DISABLE_WTMPX) ]
1194)
1195AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001196 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001197 [ AC_DEFINE(DISABLE_LOGIN) ]
1198)
1199AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001200 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001201 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1202)
1203AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001204 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001205 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1206)
1207AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001208 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001209 [ conf_lastlog_location="$withval"; ],)
1210
1211dnl lastlog, [uw]tmpx? detection
1212dnl NOTE: set the paths in the platform section to avoid the
1213dnl need for command-line parameters
1214dnl lastlog and [uw]tmp are subject to a file search if all else fails
1215
1216dnl lastlog detection
1217dnl NOTE: the code itself will detect if lastlog is a directory
1218AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1219AC_TRY_COMPILE([
1220#include <sys/types.h>
1221#include <utmp.h>
1222#ifdef HAVE_LASTLOG_H
1223# include <lastlog.h>
1224#endif
Damien Miller2994e082000-06-04 15:51:47 +10001225#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001226# include <paths.h>
1227#endif
1228 ],
1229 [ char *lastlog = LASTLOG_FILE; ],
1230 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001231 [
1232 AC_MSG_RESULT(no)
1233 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1234 AC_TRY_COMPILE([
1235#include <sys/types.h>
1236#include <utmp.h>
1237#ifdef HAVE_LASTLOG_H
1238# include <lastlog.h>
1239#endif
1240#ifdef HAVE_PATHS_H
1241# include <paths.h>
1242#endif
1243 ],
1244 [ char *lastlog = _PATH_LASTLOG; ],
1245 [ AC_MSG_RESULT(yes) ],
1246 [
andree441aa32000-06-12 22:34:38 +00001247 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001248 system_lastlog_path=no
1249 ])
1250 ]
andre2ff7b5d2000-06-03 14:57:40 +00001251)
Damien Miller2994e082000-06-04 15:51:47 +10001252
andre2ff7b5d2000-06-03 14:57:40 +00001253if test -z "$conf_lastlog_location"; then
1254 if test x"$system_lastlog_path" = x"no" ; then
1255 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001256 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001257 conf_lastlog_location=$f
1258 fi
1259 done
1260 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001261 AC_MSG_WARN([** Cannot find lastlog **])
1262 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001263 fi
1264 fi
1265fi
1266
1267if test -n "$conf_lastlog_location"; then
1268 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1269fi
1270
1271dnl utmp detection
1272AC_MSG_CHECKING([if your system defines UTMP_FILE])
1273AC_TRY_COMPILE([
1274#include <sys/types.h>
1275#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001276#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001277# include <paths.h>
1278#endif
1279 ],
1280 [ char *utmp = UTMP_FILE; ],
1281 [ AC_MSG_RESULT(yes) ],
1282 [ AC_MSG_RESULT(no)
1283 system_utmp_path=no ]
1284)
1285if test -z "$conf_utmp_location"; then
1286 if test x"$system_utmp_path" = x"no" ; then
1287 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1288 if test -f $f ; then
1289 conf_utmp_location=$f
1290 fi
1291 done
1292 if test -z "$conf_utmp_location"; then
1293 AC_DEFINE(DISABLE_UTMP)
1294 fi
1295 fi
1296fi
1297if test -n "$conf_utmp_location"; then
1298 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1299fi
1300
1301dnl wtmp detection
1302AC_MSG_CHECKING([if your system defines WTMP_FILE])
1303AC_TRY_COMPILE([
1304#include <sys/types.h>
1305#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001306#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001307# include <paths.h>
1308#endif
1309 ],
1310 [ char *wtmp = WTMP_FILE; ],
1311 [ AC_MSG_RESULT(yes) ],
1312 [ AC_MSG_RESULT(no)
1313 system_wtmp_path=no ]
1314)
1315if test -z "$conf_wtmp_location"; then
1316 if test x"$system_wtmp_path" = x"no" ; then
1317 for f in /usr/adm/wtmp /var/log/wtmp; do
1318 if test -f $f ; then
1319 conf_wtmp_location=$f
1320 fi
1321 done
1322 if test -z "$conf_wtmp_location"; then
1323 AC_DEFINE(DISABLE_WTMP)
1324 fi
1325 fi
1326fi
1327if test -n "$conf_wtmp_location"; then
1328 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1329fi
1330
1331
1332dnl utmpx detection - I don't know any system so perverse as to require
1333dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1334dnl there, though.
1335AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1336AC_TRY_COMPILE([
1337#include <sys/types.h>
1338#include <utmp.h>
1339#ifdef HAVE_UTMPX_H
1340#include <utmpx.h>
1341#endif
Damien Miller2994e082000-06-04 15:51:47 +10001342#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001343# include <paths.h>
1344#endif
1345 ],
1346 [ char *utmpx = UTMPX_FILE; ],
1347 [ AC_MSG_RESULT(yes) ],
1348 [ AC_MSG_RESULT(no)
1349 system_utmpx_path=no ]
1350)
1351if test -z "$conf_utmpx_location"; then
1352 if test x"$system_utmpx_path" = x"no" ; then
1353 AC_DEFINE(DISABLE_UTMPX)
1354 fi
1355else
1356 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1357fi
1358
1359dnl wtmpx detection
1360AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1361AC_TRY_COMPILE([
1362#include <sys/types.h>
1363#include <utmp.h>
1364#ifdef HAVE_UTMPX_H
1365#include <utmpx.h>
1366#endif
Damien Miller2994e082000-06-04 15:51:47 +10001367#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001368# include <paths.h>
1369#endif
1370 ],
1371 [ char *wtmpx = WTMPX_FILE; ],
1372 [ AC_MSG_RESULT(yes) ],
1373 [ AC_MSG_RESULT(no)
1374 system_wtmpx_path=no ]
1375)
1376if test -z "$conf_wtmpx_location"; then
1377 if test x"$system_wtmpx_path" = x"no" ; then
1378 AC_DEFINE(DISABLE_WTMPX)
1379 fi
1380else
1381 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1382fi
1383
Damien Miller4018c192000-04-30 09:30:44 +10001384
1385# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001386entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001387AC_ARG_WITH(entropy-timeout,
1388 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1389 [
1390 if test "x$withval" != "xno" ; then
1391 entropy_timeout=$withval
1392 fi
1393 ]
1394)
1395AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1396
1397
Damien Miller29ea30d2000-03-17 10:54:15 +11001398if test ! -z "$blibpath" ; then
1399 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1400 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1401fi
1402
Damien Miller0437b332000-05-02 09:56:41 +10001403AC_OUTPUT(Makefile ssh_prng_cmds)
1404
Damien Miller7b22d652000-06-18 14:07:04 +10001405# Print summary of options
1406
1407if test x$MANTYPE = x'$(CATMAN)' ; then
1408 MAN_MSG=cat
1409else
1410 MAN_MSG=man
1411fi
1412if test ! -z "$RANDOM_POOL" ; then
1413 RAND_MSG="Device ($RANDOM_POOL)"
1414else
1415 if test ! -z "$EGD_SOCKET" ; then
1416 RAND_MSG="EGD ($EGD_SOCKET)"
1417 else
1418 RAND_MSG="Builtin (timeout $entropy_timeout)"
1419 fi
1420fi
1421
1422# Someone please show me a better way :)
1423A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1424B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1425C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1426D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1427E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1428F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1429G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1430
1431echo ""
1432echo "OpenSSH configured has been configured with the following options."
1433echo " User binaries: $B"
1434echo " System binaries: $C"
1435echo " Configuration files: $D"
1436echo " Askpass program: $E"
1437echo " Manual pages: $F"
1438echo " PID file: $G"
1439echo " Random number collection: $RAND_MSG"
1440echo " Manpage format: $MAN_MSG"
1441echo " PAM support: ${PAM_MSG}"
1442echo " KerberosIV support: $KRB4_MSG"
1443echo " AFS support: $AFS_MSG"
1444echo " S/KEY support: $SKEY_MSG"
1445echo " TCP Wrappers support: $TCPW_MSG"
1446echo " MD5 password support: $MD5_MSG"
1447echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1448echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1449echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1450
1451echo ""
1452
1453echo "Compiler flags: ${CFLAGS}"
1454echo "Linker flags: ${LDFLAGS}"
1455echo "Libraries: ${LIBS}"
1456
1457echo ""
1458