blob: d509619ffa52a481af40720c3f7dea60478a6d5b [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 Millerbac2d8a2000-09-05 16:13:06 +110057*-*-cygwin*)
58 LIBS="$LIBS /usr/lib/textmode.o"
59 AC_DEFINE(HAVE_CYGWIN)
60 AC_DEFINE(DISABLE_PAM)
61 AC_DEFINE(DISABLE_SHADOW)
62 AC_DEFINE(IPV4_DEFAULT)
63 AC_DEFINE(IP_TOS_IS_BROKEN)
64 AC_DEFINE(BROKEN_VHANGUP)
65 no_pam=1
66 no_libsocket=1
67 no_libnsl=1
68 ;;
Damien Miller76112de1999-12-21 11:18:08 +110069*-*-hpux10*)
70 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100071 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110072 fi
73 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110074 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100075 AC_DEFINE(USE_PIPES)
Damien Miller76112de1999-12-21 11:18:08 +110076 AC_MSG_CHECKING(for HPUX trusted system password database)
77 if test -f /tcb/files/auth/system/default; then
78 AC_MSG_RESULT(yes)
79 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
80 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110081 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110082 else
83 AC_MSG_RESULT(no)
84 AC_DEFINE(DISABLE_SHADOW)
85 fi
Damien Miller670a4b82000-01-22 13:53:11 +110086 MANTYPE='$(CATMAN)'
87 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110088 ;;
Damien Miller1bead332000-04-30 00:47:29 +100089*-*-hpux11*)
Damien Miller1bead332000-04-30 00:47:29 +100090 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110091 IPADDR_IN_DISPLAY=yes
Damien Miller5552d7a2000-08-30 09:53:24 +110092 AC_DEFINE(USE_PIPES)
Damien Miller1bead332000-04-30 00:47:29 +100093 AC_MSG_CHECKING(for HPUX trusted system password database)
94 if test -f /tcb/files/auth/system/default; then
95 AC_MSG_RESULT(yes)
96 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
97 LIBS="$LIBS -lsec"
98 AC_MSG_WARN([This configuration is untested])
99 else
100 AC_MSG_RESULT(no)
101 AC_DEFINE(DISABLE_SHADOW)
102 fi
103 MANTYPE='$(CATMAN)'
104 mansubdir=cat
105 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100106*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +1100107 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000108 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +1100109 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100110 no_libsocket=1
111 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000112 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100113 ;;
114*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +1100115 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000116 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +1100117 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000118 AC_DEFINE(WITH_IRIX_ARRAY)
119 AC_DEFINE(WITH_IRIX_PROJECT)
120 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100121 no_libsocket=1
122 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000123 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100124 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100125*-*-linux*)
126 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100127 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000128 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100129 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100130 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100131*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100132 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100133 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000134*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000135 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100136 conf_utmp_location=/etc/utmp
137 conf_wtmp_location=/usr/adm/wtmp
138 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000139 AC_DEFINE(HAVE_NEXT)
140 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000141 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100142*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100143 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100144 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100145 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000146 # hardwire lastlog location (can't detect it on some versions)
147 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000148 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
149 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
150 if test "$sol2ver" -ge 8; then
151 AC_MSG_RESULT(yes)
152 AC_DEFINE(DISABLE_UTMP)
153 AC_DEFINE(DISABLE_WTMP)
154 else
155 AC_MSG_RESULT(no)
156 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100157 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000158*-*-sunos4*)
159 CFLAGS="$CFLAGS -DSUNOS4"
160 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000161 conf_utmp_location=/etc/utmp
162 conf_wtmp_location=/var/adm/wtmp
163 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000164 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000165 MANTYPE='$(CATMAN)'
166 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000167 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000168*-sni-sysv*)
169 CFLAGS="$CFLAGS -I/usr/local/include"
170 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
171 MANTYPE='$(CATMAN)'
172 AC_DEFINE(IP_TOS_IS_BROKEN)
173 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000174 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000175 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100176*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100177 CFLAGS="$CFLAGS -I/usr/local/include"
178 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100179 MANTYPE='$(CATMAN)'
180 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100181 LIBS="$LIBS -lgen -lsocket"
182 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000183*-*-sco3*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100184 AC_DEFINE(USE_PIPES)
Damien Millera66626b2000-06-13 18:57:53 +1000185 CFLAGS="$CFLAGS -I/usr/local/include"
186 LDFLAGS="$LDFLAGS -L/usr/local/lib"
187 MANTYPE='$(CATMAN)'
188 mansubdir=cat
189 LIBS="$LIBS -lgen -lsocket"
190 no_dev_ptmx=1
191 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000192*-dec-osf*)
193# This is untested
194 if test ! -z "USE_SIA" ; then
195 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
196 if test -f /etc/sia/matrix.conf; then
197 AC_MSG_RESULT(yes)
198 AC_DEFINE(HAVE_OSF_SIA)
199 AC_DEFINE(DISABLE_LOGIN)
200 LIBS="$LIBS -lsecurity -ldb -lm -laud"
201 else
202 AC_MSG_RESULT(no)
203 fi
204 fi
205 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100206esac
207
Damien Millere37bfc12000-06-05 09:37:43 +1000208# Allow user to specify flags
209AC_ARG_WITH(cflags,
210 [ --with-cflags Specify additional flags to pass to compiler],
211 [
212 if test "x$withval" != "xno" ; then
213 CFLAGS="$CFLAGS $withval"
214 fi
215 ]
216)
217AC_ARG_WITH(ldflags,
218 [ --with-ldlags Specify additional flags to pass to linker],
219 [
220 if test "x$withval" != "xno" ; then
221 LDFLAGS="$LDFLAGS $withval"
222 fi
223 ]
224)
225AC_ARG_WITH(libs,
226 [ --with-libs Specify additional libraries to link with],
227 [
228 if test "x$withval" != "xno" ; then
229 LIBS="$LIBS $withval"
230 fi
231 ]
232)
233
234
Damien Millera22ba012000-03-02 23:09:20 +1100235# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100236AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
237AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100238
Damien Millerbeb4ba51999-12-28 15:09:35 +1100239if test -z "$no_libsocket" ; then
240 AC_CHECK_LIB(nsl, yp_match, , )
241fi
242if test -z "$no_libnsl" ; then
243 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100244fi
Damien Millerab18c411999-11-11 10:40:23 +1100245
Damien Millera22ba012000-03-02 23:09:20 +1100246# Checks for header files.
Damien Millerad833b32000-08-23 10:46:23 +1000247AC_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 +1100248
Damien Millerad833b32000-08-23 10:46:23 +1000249dnl Checks for library functions.
Damien Miller7b28dc52000-09-05 13:34:53 +1100250AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo futimes 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)
Damien Millerad833b32000-08-23 10:46:23 +1000251dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000252AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000253dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000254AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000255dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000256AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
257AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000258dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000259AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
260AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100261
Damien Miller5fc85652000-07-09 23:53:07 +1000262AC_CHECK_FUNC(getuserattr,
263 [AC_DEFINE(HAVE_GETUSERATTR)],
264 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
265)
266
Damien Miller04f80141999-11-19 15:32:34 +1100267AC_CHECK_FUNC(login,
268 [AC_DEFINE(HAVE_LOGIN)],
269 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
270)
271
272AC_CHECK_FUNC(daemon,
273 [AC_DEFINE(HAVE_DAEMON)],
274 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
275)
276
Damien Miller9fb07e42000-03-05 16:22:59 +1100277AC_CHECK_FUNC(getpagesize,
278 [AC_DEFINE(HAVE_GETPAGESIZE)],
279 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
280)
281
Damien Millercb170cb2000-07-01 16:52:55 +1000282# Check for broken snprintf
283if test "x$ac_cv_func_snprintf" = "xyes" ; then
284 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
285 AC_TRY_RUN(
286 [
287#include <stdio.h>
288int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
289 ],
290 [AC_MSG_RESULT(yes)],
291 [
292 AC_MSG_RESULT(no)
293 AC_DEFINE(BROKEN_SNPRINTF)
294 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
295 ]
296 )
297fi
298
Damien Miller606f8802000-09-16 15:39:56 +1100299AC_FUNC_GETPGRP
300
Damien Miller7b22d652000-06-18 14:07:04 +1000301PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100302AC_ARG_WITH(pam,
303 [ --without-pam Disable PAM support ],
304 [
305 if test "x$withval" = "xno" ; then
306 no_pam=1
307 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000308 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100309 fi
310 ]
311)
Damien Milleredb82922000-06-20 13:25:52 +1000312if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100313 AC_CHECK_LIB(dl, dlopen, , )
314 LIBS="$LIBS -lpam"
315
Damien Miller0e65eed2000-05-17 22:16:05 +1000316 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000317
Damien Miller1f335fb2000-06-26 11:31:33 +1000318 disable_shadow=yes
319
Damien Miller7b22d652000-06-18 14:07:04 +1000320 PAM_MSG="yes"
321
Damien Millera22ba012000-03-02 23:09:20 +1100322 # Check PAM strerror arguments (old PAM)
323 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
324 AC_TRY_COMPILE(
325 [
Damien Miller81171112000-04-23 11:14:01 +1000326#include <stdlib.h>
327#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100328 ],
329 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
330 [AC_MSG_RESULT(no)],
331 [
332 AC_DEFINE(HAVE_OLD_PAM)
333 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000334 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100335 ]
336 )
337fi
338
339# The big search for OpenSSL
340AC_ARG_WITH(ssl-dir,
341 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
342 [
343 if test "x$withval" != "$xno" ; then
344 tryssldir=$withval
345 fi
346 ]
347)
348
349saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100350saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100351saved_CFLAGS="$CFLAGS"
352if test "x$prefix" != "xNONE" ; then
353 tryssldir="$tryssldir $prefix"
354fi
Damien Miller61e50f12000-05-08 20:49:37 +1000355AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100356
Damien Miller61e50f12000-05-08 20:49:37 +1000357 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
358 if test ! -z "$ssldir" ; then
359 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
360 CFLAGS="$saved_CFLAGS -I$ssldir/include"
361 if test ! -z "$need_dash_r" ; then
362 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
363 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100364 else
Damien Miller61e50f12000-05-08 20:49:37 +1000365 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100366 fi
367
Damien Miller3b512e12000-05-17 23:29:18 +1000368 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000369
Damien Miller3b512e12000-05-17 23:29:18 +1000370 # Basic test to check for compatible version and correct linking
371 # *does not* test for RSA - that comes later.
372 AC_TRY_RUN(
373 [
Damien Millere59ce622000-05-01 20:54:17 +1000374#include <string.h>
375#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000376int main(void)
377{
Damien Miller3b512e12000-05-17 23:29:18 +1000378 char a[2048];
379 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000380 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000381 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000382}
Damien Miller3b512e12000-05-17 23:29:18 +1000383 ],
384 [
385 found_crypto=1
386 break;
387 ], []
388 )
Damien Miller61e50f12000-05-08 20:49:37 +1000389
390 if test ! -z "$found_crypto" ; then
391 break;
392 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100393 done
394
Damien Miller61e50f12000-05-08 20:49:37 +1000395 if test -z "$found_crypto" ; then
396 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100397 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000398 if test -z "$ssldir" ; then
399 ssldir="(system)"
400 fi
Damien Millera22ba012000-03-02 23:09:20 +1100401
Damien Miller61e50f12000-05-08 20:49:37 +1000402 ac_cv_openssldir=$ssldir
403])
404
Damien Milleredb82922000-06-20 13:25:52 +1000405if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000406 AC_DEFINE(HAVE_OPENSSL)
407 dnl Need to recover ssldir - test above runs in subshell
408 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100409 CFLAGS="$saved_CFLAGS -I$ssldir/include"
410 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
411 if test ! -z "$need_dash_r" ; then
412 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100413 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100414 if test ! -z "$blibpath" ; then
415 blibpath="$blibpath:$ssldir:$ssldir/lib"
416 fi
Damien Millera22ba012000-03-02 23:09:20 +1100417fi
Damien Miller3b512e12000-05-17 23:29:18 +1000418LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000419
Damien Miller3b512e12000-05-17 23:29:18 +1000420# Now test RSA support
421saved_LIBS="$LIBS"
422AC_MSG_CHECKING([for RSA support])
423for WANTS_RSAREF in "" 1 ; do
424 if test -z "$WANTS_RSAREF" ; then
425 LIBS="$saved_LIBS"
426 else
427 LIBS="$saved_LIBS -lRSAglue -lrsaref"
428 fi
429 AC_TRY_RUN([
430#include <string.h>
431#include <openssl/rand.h>
432#include <openssl/rsa.h>
433#include <openssl/bn.h>
434#include <openssl/sha.h>
435int main(void)
436{
437 int num; RSA *key; static unsigned char p_in[] = "blahblah";
438 unsigned char c[256], p[256];
439 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
440 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
441 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
442 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
443}
444 ],
445 [
446 rsa_works=1
447 break;
448 ], [])
449done
450
451if test ! -z "$no_rsa" ; then
452 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000453 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000454else
455 if test -z "$rsa_works" ; then
456 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000457 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000458 else
459 if test -z "$WANTS_RSAREF" ; then
460 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000461 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000462 else
Damien Miller7b22d652000-06-18 14:07:04 +1000463 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000464 AC_MSG_RESULT(using RSAref)
465 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
466 fi
467 fi
468fi
Damien Millera22ba012000-03-02 23:09:20 +1100469
470# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100471AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100472AC_CHECK_SIZEOF(short int, 2)
473AC_CHECK_SIZEOF(int, 4)
474AC_CHECK_SIZEOF(long int, 4)
475AC_CHECK_SIZEOF(long long int, 8)
476
Damien Millera22ba012000-03-02 23:09:20 +1100477# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100478AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
479 AC_TRY_COMPILE(
480 [ #include <sys/types.h> ],
481 [ u_int a; a = 1;],
482 [ ac_cv_have_u_int="yes" ],
483 [ ac_cv_have_u_int="no" ]
484 )
485])
486if test "x$ac_cv_have_u_int" = "xyes" ; then
487 AC_DEFINE(HAVE_U_INT)
488 have_u_int=1
489fi
490
Damien Miller61e50f12000-05-08 20:49:37 +1000491AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
492 AC_TRY_COMPILE(
493 [ #include <sys/types.h> ],
494 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
495 [ ac_cv_have_intxx_t="yes" ],
496 [ ac_cv_have_intxx_t="no" ]
497 )
498])
499if test "x$ac_cv_have_intxx_t" = "xyes" ; then
500 AC_DEFINE(HAVE_INTXX_T)
501 have_intxx_t=1
502fi
503
504AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
505 AC_TRY_COMPILE(
506 [ #include <sys/types.h> ],
507 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
508 [ ac_cv_have_u_intxx_t="yes" ],
509 [ ac_cv_have_u_intxx_t="no" ]
510 )
511])
512if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
513 AC_DEFINE(HAVE_U_INTXX_T)
514 have_u_intxx_t=1
515fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100516
Damien Milleredb82922000-06-20 13:25:52 +1000517if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
518 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100519then
520 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
521 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000522 [
523#include <sys/bitypes.h>
524 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100525 [
Damien Miller70494d12000-04-03 15:57:06 +1000526 int8_t a; int16_t b; int32_t c;
527 u_int8_t e; u_int16_t f; u_int32_t g;
528 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100529 ],
530 [
531 AC_DEFINE(HAVE_U_INTXX_T)
532 AC_DEFINE(HAVE_INTXX_T)
533 AC_MSG_RESULT(yes)
534 ],
535 [AC_MSG_RESULT(no)]
536 )
537fi
538
Damien Millerd6121d22000-03-17 23:26:46 +1100539if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000540 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
541 AC_TRY_COMPILE(
542 [
543#include <sys/types.h>
544 ],
545 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
546 [ ac_cv_have_uintxx_t="yes" ],
547 [ ac_cv_have_uintxx_t="no" ]
548 )
549 ])
550 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
551 AC_DEFINE(HAVE_UINTXX_T)
552 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100553fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100554
Damien Miller61e50f12000-05-08 20:49:37 +1000555AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
556 AC_TRY_COMPILE(
557 [
Damien Miller81171112000-04-23 11:14:01 +1000558#include <sys/types.h>
559#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000560 ],
561 [socklen_t foo; foo = 1235;],
562 [ ac_cv_have_socklen_t="yes" ],
563 [ ac_cv_have_socklen_t="no" ]
564 )
565])
566if test "x$ac_cv_have_socklen_t" = "xyes" ; then
567 AC_DEFINE(HAVE_SOCKLEN_T)
568fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100569
Damien Miller61e50f12000-05-08 20:49:37 +1000570AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
571 AC_TRY_COMPILE(
572 [
573#include <sys/types.h>
574 ],
575 [ size_t foo; foo = 1235; ],
576 [ ac_cv_have_size_t="yes" ],
577 [ ac_cv_have_size_t="no" ]
578 )
579])
580if test "x$ac_cv_have_size_t" = "xyes" ; then
581 AC_DEFINE(HAVE_SIZE_T)
582fi
Damien Miller95058511999-12-29 10:36:45 +1100583
Damien Miller615f9392000-05-17 22:53:33 +1000584AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
585 AC_TRY_COMPILE(
586 [
587#include <sys/types.h>
588 ],
589 [ ssize_t foo; foo = 1235; ],
590 [ ac_cv_have_ssize_t="yes" ],
591 [ ac_cv_have_ssize_t="no" ]
592 )
593])
594if test "x$ac_cv_have_ssize_t" = "xyes" ; then
595 AC_DEFINE(HAVE_SSIZE_T)
596fi
597
Damien Millerb54b40e2000-06-23 08:23:34 +1000598AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
599 AC_TRY_COMPILE(
600 [
601#include <sys/types.h>
602#include <sys/socket.h>
603 ],
604 [ sa_family_t foo; foo = 1235; ],
605 [ ac_cv_have_sa_family_t="yes" ],
606 [ ac_cv_have_sa_family_t="no" ]
607 )
608])
609if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
610 AC_DEFINE(HAVE_SA_FAMILY_T)
611fi
612
Damien Miller0f91b4e2000-06-18 15:43:25 +1000613AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
614 AC_TRY_COMPILE(
615 [
616#include <sys/types.h>
617 ],
618 [ pid_t foo; foo = 1235; ],
619 [ ac_cv_have_pid_t="yes" ],
620 [ ac_cv_have_pid_t="no" ]
621 )
622])
623if test "x$ac_cv_have_pid_t" = "xyes" ; then
624 AC_DEFINE(HAVE_PID_T)
625fi
626
627AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
628 AC_TRY_COMPILE(
629 [
630#include <sys/types.h>
631 ],
632 [ mode_t foo; foo = 1235; ],
633 [ ac_cv_have_mode_t="yes" ],
634 [ ac_cv_have_mode_t="no" ]
635 )
636])
637if test "x$ac_cv_have_mode_t" = "xyes" ; then
638 AC_DEFINE(HAVE_MODE_T)
639fi
640
Damien Miller61e50f12000-05-08 20:49:37 +1000641
642AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
643 AC_TRY_COMPILE(
644 [
Damien Miller81171112000-04-23 11:14:01 +1000645#include <sys/types.h>
646#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000647 ],
648 [ struct sockaddr_storage s; ],
649 [ ac_cv_have_struct_sockaddr_storage="yes" ],
650 [ ac_cv_have_struct_sockaddr_storage="no" ]
651 )
652])
653if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
654 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
655fi
Damien Miller34132e52000-01-14 15:45:46 +1100656
Damien Miller61e50f12000-05-08 20:49:37 +1000657AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
658 AC_TRY_COMPILE(
659 [
Damien Miller7b22d652000-06-18 14:07:04 +1000660#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000661#include <netinet/in.h>
662 ],
663 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
664 [ ac_cv_have_struct_sockaddr_in6="yes" ],
665 [ ac_cv_have_struct_sockaddr_in6="no" ]
666 )
667])
668if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
669 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
670fi
Damien Miller34132e52000-01-14 15:45:46 +1100671
Damien Miller61e50f12000-05-08 20:49:37 +1000672AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
673 AC_TRY_COMPILE(
674 [
Damien Miller7b22d652000-06-18 14:07:04 +1000675#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000676#include <netinet/in.h>
677 ],
678 [ struct in6_addr s; s.s6_addr[0] = 0; ],
679 [ ac_cv_have_struct_in6_addr="yes" ],
680 [ ac_cv_have_struct_in6_addr="no" ]
681 )
682])
683if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
684 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
685fi
Damien Miller34132e52000-01-14 15:45:46 +1100686
Damien Miller61e50f12000-05-08 20:49:37 +1000687AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
688 AC_TRY_COMPILE(
689 [
Damien Miller81171112000-04-23 11:14:01 +1000690#include <sys/types.h>
691#include <sys/socket.h>
692#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000693 ],
694 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
695 [ ac_cv_have_struct_addrinfo="yes" ],
696 [ ac_cv_have_struct_addrinfo="no" ]
697 )
698])
699if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
700 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
701fi
702
Damien Miller34132e52000-01-14 15:45:46 +1100703
Damien Millera22ba012000-03-02 23:09:20 +1100704# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100705
Damien Miller61e50f12000-05-08 20:49:37 +1000706OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
707OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
708OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
709OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
710OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000711OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000712OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
713OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000714OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000715OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
716OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
717OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
718OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000719OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
720OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
721OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
722OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
723
Damien Miller942da032000-08-18 13:59:06 +1000724AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
725 ac_cv_have_sun_len_in_struct_sockaddr_un, [
726 AC_TRY_COMPILE(
727 [
728#include <sys/types.h>
729#include <sys/socket.h>
730 ],
731 [ struct sockaddr_un s; s.sun_len = 1; ],
732 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
733 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
734 )
735])
736if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
737 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
738fi
739
Damien Miller61e50f12000-05-08 20:49:37 +1000740AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
741 ac_cv_have_ss_family_in_struct_ss, [
742 AC_TRY_COMPILE(
743 [
Damien Miller81171112000-04-23 11:14:01 +1000744#include <sys/types.h>
745#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000746 ],
747 [ struct sockaddr_storage s; s.ss_family = 1; ],
748 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
749 [ ac_cv_have_ss_family_in_struct_ss="no" ],
750 )
751])
752if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
753 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
754fi
755
Damien Miller61e50f12000-05-08 20:49:37 +1000756AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
757 ac_cv_have___ss_family_in_struct_ss, [
758 AC_TRY_COMPILE(
759 [
Damien Miller81171112000-04-23 11:14:01 +1000760#include <sys/types.h>
761#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000762 ],
763 [ struct sockaddr_storage s; s.__ss_family = 1; ],
764 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
765 [ ac_cv_have___ss_family_in_struct_ss="no" ]
766 )
767])
768if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
769 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
770fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100771
Damien Millerad833b32000-08-23 10:46:23 +1000772AC_CACHE_CHECK([for pw_class field in struct passwd],
773 ac_cv_have_pw_class_in_struct_passwd, [
774 AC_TRY_COMPILE(
775 [
776#include <sys/types.h>
777#include <pwd.h>
778 ],
779 [ struct passwd p s; p.pw_class = NULL; ],
780 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
781 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
782 )
783])
784if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
785 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
786fi
787
Damien Miller61e50f12000-05-08 20:49:37 +1000788
789AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
790 AC_TRY_LINK([],
791 [ extern char *__progname; printf("%s", __progname); ],
792 [ ac_cv_libc_defines___progname="yes" ],
793 [ ac_cv_libc_defines___progname="no" ]
794 )
795])
796if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
797 AC_DEFINE(HAVE___PROGNAME)
798fi
799
Damien Millera22ba012000-03-02 23:09:20 +1100800
Damien Millerecbb26d2000-07-15 14:59:14 +1000801AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
802 AC_TRY_LINK([],
803 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
804 [ ac_cv_libc_defines_sys_errlist="yes" ],
805 [ ac_cv_libc_defines_sys_errlist="no" ]
806 )
807])
808if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
809 AC_DEFINE(HAVE_SYS_ERRLIST)
810fi
811
812
Damien Miller11fa2cc2000-08-16 10:35:58 +1000813AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
814 AC_TRY_LINK([],
815 [ extern int sys_nerr; printf("%i", sys_nerr);],
816 [ ac_cv_libc_defines_sys_nerr="yes" ],
817 [ ac_cv_libc_defines_sys_nerr="no" ]
818 )
819])
820if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
821 AC_DEFINE(HAVE_SYS_NERR)
822fi
823
824
Damien Millera22ba012000-03-02 23:09:20 +1100825# Looking for programs, paths and files
826AC_ARG_WITH(rsh,
827 [ --with-rsh=PATH Specify path to remote shell program ],
828 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100829 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000830 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100831 fi
832 ],
833 [
834 AC_PATH_PROG(rsh_path, rsh)
835 ]
836)
837
838AC_ARG_WITH(xauth,
839 [ --with-xauth=PATH Specify path to xauth program ],
840 [
841 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000842 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100843 fi
844 ],
845 [
846 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000847 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100848 xauth_path="/usr/openwin/bin/xauth"
849 fi
850 ]
851)
852
853if test ! -z "$xauth_path" ; then
854 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
855fi
856if test ! -z "$rsh_path" ; then
857 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
858fi
859
860# Check for mail directory (last resort if we cannot get it from headers)
861if test ! -z "$MAIL" ; then
862 maildir=`dirname $MAIL`
863 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
864fi
865
Damien Millera22ba012000-03-02 23:09:20 +1100866if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100867 AC_CHECK_FILE("/dev/ptmx",
868 [
869 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
870 have_dev_ptmx=1
871 ]
872 )
Damien Millera22ba012000-03-02 23:09:20 +1100873fi
Damien Miller204ad072000-03-02 23:56:12 +1100874AC_CHECK_FILE("/dev/ptc",
875 [
876 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
877 have_dev_ptc=1
878 ]
879)
880
Damien Millera22ba012000-03-02 23:09:20 +1100881# Options from here on. Some of these are preset by platform above
882
Damien Millera22ba012000-03-02 23:09:20 +1100883# Check for user-specified random device, otherwise check /dev/urandom
884AC_ARG_WITH(random,
885 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
886 [
Damien Miller040f3832000-04-03 14:50:43 +1000887 if test "x$withval" != "xno" ; then
888 RANDOM_POOL="$withval";
889 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
890 fi
Damien Millera22ba012000-03-02 23:09:20 +1100891 ],
892 [
893 # Check for random device
894 AC_CHECK_FILE("/dev/urandom",
895 [
896 RANDOM_POOL="/dev/urandom";
897 AC_SUBST(RANDOM_POOL)
898 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
899 ]
900 )
901 ]
902)
903
904# Check for EGD pool file
905AC_ARG_WITH(egd-pool,
906 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
907 [
Damien Miller040f3832000-04-03 14:50:43 +1000908 if test "x$withval" != "xno" ; then
909 EGD_SOCKET="$withval";
910 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
911 fi
Damien Millera22ba012000-03-02 23:09:20 +1100912 ]
913)
914
Damien Miller0437b332000-05-02 09:56:41 +1000915# detect pathnames for entropy gathering commands, if we need them
916INSTALL_SSH_PRNG_CMDS=""
917rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000918if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000919 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000920 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
921 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
922 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
923 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
924 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
925 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
926 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
927 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
928 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
929 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
930 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
931 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
932 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
933 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
934 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000935
936 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000937fi
Damien Miller0437b332000-05-02 09:56:41 +1000938AC_SUBST(INSTALL_SSH_PRNG_CMDS)
939
Damien Miller11e37f62000-04-08 18:23:30 +1000940
Damien Miller670a4b82000-01-22 13:53:11 +1100941AC_ARG_WITH(catman,
942 [ --with-catman=man|cat Install preformatted manpages[no]],
943 [
944 MANTYPE='$(CATMAN)'
945 if test x"$withval" != x"yes" ; then
946 mansubdir=$withval
947 else
948 mansubdir=cat
949 fi
950 ], [
951 if test -z "$MANTYPE" ; then
952 MANTYPE='$(TROFFMAN)'
953 mansubdir=man
954 fi
955 ]
956)
957AC_SUBST(MANTYPE)
958AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100959
Damien Millera22ba012000-03-02 23:09:20 +1100960# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000961KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100962AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100963 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100964 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100965 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100966
967 if test "x$withval" != "$xyes" ; then
968 CFLAGS="$CFLAGS -I${withval}/include"
969 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100970 if test ! -z "$need_dash_r" ; then
971 LDFLAGS="$LDFLAGS -R${withval}/lib"
972 fi
973 if test ! -z "$blibpath" ; then
974 blibpath="$blibpath:${withval}/lib"
975 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100976 else
977 if test -d /usr/include/kerberosIV ; then
978 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
979 fi
980 fi
981
982 AC_CHECK_HEADERS(krb.h)
983 AC_CHECK_LIB(krb, main)
984 if test "$ac_cv_header_krb_h" != yes; then
985 AC_MSG_WARN([Cannot find krb.h, build may fail])
986 fi
987 if test "$ac_cv_lib_krb_main" != yes; then
988 AC_MSG_WARN([Cannot find libkrb, build may fail])
989 fi
990
Damien Millerc85f9b42000-01-29 10:20:21 +1100991 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100992 AC_CHECK_LIB(resolv, dn_expand, , )
993 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000994 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100995 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100996 fi
Damien Miller80297751999-11-19 13:03:25 +1100997 ]
998)
999
Damien Millera22ba012000-03-02 23:09:20 +11001000# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001001AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001002AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001003 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001004 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001005 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001006
1007 if test "x$withval" != "$xyes" ; then
1008 CFLAGS="$CFLAGS -I${withval}/include"
1009 LFLAGS="$LFLAGS -L${withval}/lib"
1010 fi
1011
1012 if test -z "$KRB4" ; then
1013 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1014 fi
1015
Damien Miller8bdeee21999-12-30 15:50:54 +11001016 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001017 if test ! -z "$AFS_LIBS" ; then
1018 LIBS="$LIBS $AFS_LIBS"
1019 fi
1020 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001021 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001022 fi
Damien Miller80297751999-11-19 13:03:25 +11001023 ]
1024)
Damien Millerc85f9b42000-01-29 10:20:21 +11001025LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001026
Damien Millera22ba012000-03-02 23:09:20 +11001027# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001028SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001029AC_ARG_WITH(skey,
1030 [ --with-skey Enable S/Key support],
1031 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001032 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001033 AC_DEFINE(SKEY)
1034 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001035 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001036 fi
Damien Miller80297751999-11-19 13:03:25 +11001037 ]
1038)
1039
Damien Millera22ba012000-03-02 23:09:20 +11001040# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001041TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001042AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001043 [ --with-tcp-wrappers Enable tcpwrappers support],
1044 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001045 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001046 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001047 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001048 AC_MSG_CHECKING(for libwrap)
1049 AC_TRY_LINK(
1050 [
Damien Miller81171112000-04-23 11:14:01 +10001051#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001052 int deny_severity = 0, allow_severity = 0;
1053 ],
1054 [hosts_access(0);],
1055 [
1056 AC_MSG_RESULT(yes)
1057 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001058 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001059 ],
1060 [
Damien Miller7b22d652000-06-18 14:07:04 +10001061 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001062 ]
1063 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001064 fi
Damien Miller80297751999-11-19 13:03:25 +11001065 ]
1066)
1067
Damien Millera22ba012000-03-02 23:09:20 +11001068# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001069MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001070AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001071 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001072 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001073 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001074 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001075 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001076 fi
1077 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001078)
1079
Damien Millera22ba012000-03-02 23:09:20 +11001080# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001081AC_ARG_WITH(shadow,
1082 [ --without-shadow Disable shadow password support],
1083 [
1084 if test "x$withval" = "xno" ; then
1085 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001086 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001087 fi
1088 ]
1089)
1090
Damien Miller1f335fb2000-06-26 11:31:33 +10001091if test -z "$disable_shadow" ; then
1092 AC_MSG_CHECKING([if the systems has expire shadow information])
1093 AC_TRY_COMPILE(
1094 [
1095#include <sys/types.h>
1096#include <shadow.h>
1097 struct spwd sp;
1098 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1099 [ sp_expire_available=yes ], []
1100 )
1101
1102 if test "x$sp_expire_available" = "xyes" ; then
1103 AC_MSG_RESULT(yes)
1104 AC_DEFINE(HAS_SHADOW_EXPIRE)
1105 else
1106 AC_MSG_RESULT(no)
1107 fi
1108fi
1109
Damien Millera22ba012000-03-02 23:09:20 +11001110# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001111if test ! -z "$IPADDR_IN_DISPLAY" ; then
1112 DISPLAY_HACK_MSG="yes"
1113 AC_DEFINE(IPADDR_IN_DISPLAY)
1114else
1115 DISPLAY_HACK_MSG="no"
1116 AC_ARG_WITH(ipaddr-display,
1117 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1118 [
1119 if test "x$withval" != "xno" ; then
1120 AC_DEFINE(IPADDR_IN_DISPLAY)
1121 DISPLAY_HACK_MSG="yes"
1122 fi
1123 ]
1124 )
1125fi
Damien Miller76112de1999-12-21 11:18:08 +11001126
Damien Millera22ba012000-03-02 23:09:20 +11001127# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001128SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001129AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001130 [ --with-default-path=PATH Specify default \$PATH environment for server],
1131 [
1132 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001133 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001134 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001135 fi
1136 ]
1137)
1138
Damien Millera22ba012000-03-02 23:09:20 +11001139# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001140IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001141AC_ARG_WITH(ipv4-default,
1142 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1143 [
1144 if test "x$withval" != "xno" ; then
1145 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001146 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001147 fi
1148 ]
1149)
1150
Damien Miller61e50f12000-05-08 20:49:37 +10001151AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001152IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001153AC_ARG_WITH(4in6,
1154 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1155 [
1156 if test "x$withval" != "xno" ; then
1157 AC_MSG_RESULT(yes)
1158 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001159 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001160 else
1161 AC_MSG_RESULT(no)
1162 fi
1163 ],[
1164 if test "x$inet6_default_4in6" = "xyes"; then
1165 AC_MSG_RESULT([yes (default)])
1166 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001167 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001168 else
1169 AC_MSG_RESULT([no (default)])
1170 fi
1171 ]
1172)
1173
Damien Millera22ba012000-03-02 23:09:20 +11001174# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001175piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001176AC_ARG_WITH(pid-dir,
1177 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1178 [
1179 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001180 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001181 fi
1182 ]
1183)
Damien Miller4018c192000-04-30 09:30:44 +10001184
Damien Millerdbd250f2000-01-18 08:57:14 +11001185AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001186AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001187
andre2ff7b5d2000-06-03 14:57:40 +00001188dnl allow user to disable some login recording features
1189AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001190 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001191 [ AC_DEFINE(DISABLE_LASTLOG) ]
1192)
1193AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001194 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001195 [ AC_DEFINE(DISABLE_UTMP) ]
1196)
1197AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001198 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001199 [ AC_DEFINE(DISABLE_UTMPX) ]
1200)
1201AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001202 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001203 [ AC_DEFINE(DISABLE_WTMP) ]
1204)
1205AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001206 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001207 [ AC_DEFINE(DISABLE_WTMPX) ]
1208)
1209AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001210 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001211 [ AC_DEFINE(DISABLE_LOGIN) ]
1212)
1213AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001214 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001215 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1216)
1217AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001218 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001219 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1220)
1221AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001222 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001223 [ conf_lastlog_location="$withval"; ],)
1224
1225dnl lastlog, [uw]tmpx? detection
1226dnl NOTE: set the paths in the platform section to avoid the
1227dnl need for command-line parameters
1228dnl lastlog and [uw]tmp are subject to a file search if all else fails
1229
1230dnl lastlog detection
1231dnl NOTE: the code itself will detect if lastlog is a directory
1232AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1233AC_TRY_COMPILE([
1234#include <sys/types.h>
1235#include <utmp.h>
1236#ifdef HAVE_LASTLOG_H
1237# include <lastlog.h>
1238#endif
Damien Miller2994e082000-06-04 15:51:47 +10001239#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001240# include <paths.h>
1241#endif
1242 ],
1243 [ char *lastlog = LASTLOG_FILE; ],
1244 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001245 [
1246 AC_MSG_RESULT(no)
1247 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1248 AC_TRY_COMPILE([
1249#include <sys/types.h>
1250#include <utmp.h>
1251#ifdef HAVE_LASTLOG_H
1252# include <lastlog.h>
1253#endif
1254#ifdef HAVE_PATHS_H
1255# include <paths.h>
1256#endif
1257 ],
1258 [ char *lastlog = _PATH_LASTLOG; ],
1259 [ AC_MSG_RESULT(yes) ],
1260 [
andree441aa32000-06-12 22:34:38 +00001261 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001262 system_lastlog_path=no
1263 ])
1264 ]
andre2ff7b5d2000-06-03 14:57:40 +00001265)
Damien Miller2994e082000-06-04 15:51:47 +10001266
andre2ff7b5d2000-06-03 14:57:40 +00001267if test -z "$conf_lastlog_location"; then
1268 if test x"$system_lastlog_path" = x"no" ; then
1269 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001270 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001271 conf_lastlog_location=$f
1272 fi
1273 done
1274 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001275 AC_MSG_WARN([** Cannot find lastlog **])
1276 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001277 fi
1278 fi
1279fi
1280
1281if test -n "$conf_lastlog_location"; then
1282 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1283fi
1284
1285dnl utmp detection
1286AC_MSG_CHECKING([if your system defines UTMP_FILE])
1287AC_TRY_COMPILE([
1288#include <sys/types.h>
1289#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001290#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001291# include <paths.h>
1292#endif
1293 ],
1294 [ char *utmp = UTMP_FILE; ],
1295 [ AC_MSG_RESULT(yes) ],
1296 [ AC_MSG_RESULT(no)
1297 system_utmp_path=no ]
1298)
1299if test -z "$conf_utmp_location"; then
1300 if test x"$system_utmp_path" = x"no" ; then
1301 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1302 if test -f $f ; then
1303 conf_utmp_location=$f
1304 fi
1305 done
1306 if test -z "$conf_utmp_location"; then
1307 AC_DEFINE(DISABLE_UTMP)
1308 fi
1309 fi
1310fi
1311if test -n "$conf_utmp_location"; then
1312 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1313fi
1314
1315dnl wtmp detection
1316AC_MSG_CHECKING([if your system defines WTMP_FILE])
1317AC_TRY_COMPILE([
1318#include <sys/types.h>
1319#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001320#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001321# include <paths.h>
1322#endif
1323 ],
1324 [ char *wtmp = WTMP_FILE; ],
1325 [ AC_MSG_RESULT(yes) ],
1326 [ AC_MSG_RESULT(no)
1327 system_wtmp_path=no ]
1328)
1329if test -z "$conf_wtmp_location"; then
1330 if test x"$system_wtmp_path" = x"no" ; then
1331 for f in /usr/adm/wtmp /var/log/wtmp; do
1332 if test -f $f ; then
1333 conf_wtmp_location=$f
1334 fi
1335 done
1336 if test -z "$conf_wtmp_location"; then
1337 AC_DEFINE(DISABLE_WTMP)
1338 fi
1339 fi
1340fi
1341if test -n "$conf_wtmp_location"; then
1342 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1343fi
1344
1345
1346dnl utmpx detection - I don't know any system so perverse as to require
1347dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1348dnl there, though.
1349AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1350AC_TRY_COMPILE([
1351#include <sys/types.h>
1352#include <utmp.h>
1353#ifdef HAVE_UTMPX_H
1354#include <utmpx.h>
1355#endif
Damien Miller2994e082000-06-04 15:51:47 +10001356#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001357# include <paths.h>
1358#endif
1359 ],
1360 [ char *utmpx = UTMPX_FILE; ],
1361 [ AC_MSG_RESULT(yes) ],
1362 [ AC_MSG_RESULT(no)
1363 system_utmpx_path=no ]
1364)
1365if test -z "$conf_utmpx_location"; then
1366 if test x"$system_utmpx_path" = x"no" ; then
1367 AC_DEFINE(DISABLE_UTMPX)
1368 fi
1369else
1370 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1371fi
1372
1373dnl wtmpx detection
1374AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1375AC_TRY_COMPILE([
1376#include <sys/types.h>
1377#include <utmp.h>
1378#ifdef HAVE_UTMPX_H
1379#include <utmpx.h>
1380#endif
Damien Miller2994e082000-06-04 15:51:47 +10001381#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001382# include <paths.h>
1383#endif
1384 ],
1385 [ char *wtmpx = WTMPX_FILE; ],
1386 [ AC_MSG_RESULT(yes) ],
1387 [ AC_MSG_RESULT(no)
1388 system_wtmpx_path=no ]
1389)
1390if test -z "$conf_wtmpx_location"; then
1391 if test x"$system_wtmpx_path" = x"no" ; then
1392 AC_DEFINE(DISABLE_WTMPX)
1393 fi
1394else
1395 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1396fi
1397
Damien Miller4018c192000-04-30 09:30:44 +10001398
1399# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001400entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001401AC_ARG_WITH(entropy-timeout,
1402 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1403 [
1404 if test "x$withval" != "xno" ; then
1405 entropy_timeout=$withval
1406 fi
1407 ]
1408)
1409AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1410
1411
Damien Miller29ea30d2000-03-17 10:54:15 +11001412if test ! -z "$blibpath" ; then
1413 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1414 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1415fi
1416
Damien Millerbac2d8a2000-09-05 16:13:06 +11001417AC_EXEEXT
1418
Damien Miller0437b332000-05-02 09:56:41 +10001419AC_OUTPUT(Makefile ssh_prng_cmds)
1420
Damien Miller7b22d652000-06-18 14:07:04 +10001421# Print summary of options
1422
1423if test x$MANTYPE = x'$(CATMAN)' ; then
1424 MAN_MSG=cat
1425else
1426 MAN_MSG=man
1427fi
1428if test ! -z "$RANDOM_POOL" ; then
1429 RAND_MSG="Device ($RANDOM_POOL)"
1430else
1431 if test ! -z "$EGD_SOCKET" ; then
1432 RAND_MSG="EGD ($EGD_SOCKET)"
1433 else
1434 RAND_MSG="Builtin (timeout $entropy_timeout)"
1435 fi
1436fi
1437
1438# Someone please show me a better way :)
1439A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1440B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1441C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1442D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1443E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1444F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1445G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1446
1447echo ""
1448echo "OpenSSH configured has been configured with the following options."
1449echo " User binaries: $B"
1450echo " System binaries: $C"
1451echo " Configuration files: $D"
1452echo " Askpass program: $E"
1453echo " Manual pages: $F"
1454echo " PID file: $G"
1455echo " Random number collection: $RAND_MSG"
1456echo " Manpage format: $MAN_MSG"
1457echo " PAM support: ${PAM_MSG}"
1458echo " KerberosIV support: $KRB4_MSG"
1459echo " AFS support: $AFS_MSG"
1460echo " S/KEY support: $SKEY_MSG"
1461echo " TCP Wrappers support: $TCPW_MSG"
1462echo " MD5 password support: $MD5_MSG"
1463echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1464echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1465echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1466
1467echo ""
1468
1469echo "Compiler flags: ${CFLAGS}"
1470echo "Linker flags: ${LDFLAGS}"
1471echo "Libraries: ${LIBS}"
1472
1473echo ""
1474