blob: b7f216bb9f123d6d0ce22b5decc9fcf875b1426e [file] [log] [blame]
Damien Millerab18c411999-11-11 10:40:23 +11001AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10002
3AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11004AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11005AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10006
Damien Millera22ba012000-03-02 23:09:20 +11007# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +11008AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +10009AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110010AC_PROG_INSTALL
Damien Millerc7b38ce1999-11-09 10:28:04 +110011AC_CHECK_PROG(AR, ar, ar)
Damien Millere79334a1999-12-29 10:03:37 +110012AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100014AC_PATH_PROG(ENT, ent)
15AC_SUBST(ENT)
Damien Miller2e1b0821999-12-25 10:11:29 +110016
Damien Millerad833b32000-08-23 10:46:23 +100017# Use LOGIN_PROGRAM from environment if possible
18if test ! -z "$LOGIN_PROGRAM" ; then
19 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
20else
21 # Search for login
22 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
23 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
25 fi
26fi
27
Damien Miller166bd442000-03-16 10:48:25 +110028if test -z "$LD" ; then
29 LD=$CC
30fi
31AC_SUBST(LD)
32
33# C Compiler features
34AC_C_INLINE
35if test "$GCC" = "yes"; then
36 CFLAGS="$CFLAGS -Wall"
37fi
38
Damien Millera22ba012000-03-02 23:09:20 +110039# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110040case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110041*-*-aix*)
42 AFS_LIBS="-lld"
Damien Millerdb819592000-03-14 13:44:01 +110043 CFLAGS="$CFLAGS -I/usr/local/include"
44 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100045 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110046 blibpath="/usr/lib:/lib:/usr/local/lib"
47 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100048 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110049 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000050 MANTYPE='$(CATMAN)'
51 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000052 dnl AIX handles lastlog as part of its login message
53 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100054 MANTYPE='$(CATMAN)'
55 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110056 ;;
Damien Miller76112de1999-12-21 11:18:08 +110057*-*-hpux10*)
58 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100059 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110060 fi
61 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
62 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millerb0785672000-08-23 09:10:39 +100063 AC_DEFINE(USE_PIPES)
Damien Miller76112de1999-12-21 11:18:08 +110064 AC_MSG_CHECKING(for HPUX trusted system password database)
65 if test -f /tcb/files/auth/system/default; then
66 AC_MSG_RESULT(yes)
67 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
68 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110069 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110070 else
71 AC_MSG_RESULT(no)
72 AC_DEFINE(DISABLE_SHADOW)
73 fi
Damien Miller670a4b82000-01-22 13:53:11 +110074 MANTYPE='$(CATMAN)'
75 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110076 ;;
Damien Miller1bead332000-04-30 00:47:29 +100077*-*-hpux11*)
78 if test -z "$GCC"; then
79 CFLAGS="$CFLAGS -Ae"
80 fi
81 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100082 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100083 AC_MSG_CHECKING(for HPUX trusted system password database)
84 if test -f /tcb/files/auth/system/default; then
85 AC_MSG_RESULT(yes)
86 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
87 LIBS="$LIBS -lsec"
88 AC_MSG_WARN([This configuration is untested])
89 else
90 AC_MSG_RESULT(no)
91 AC_DEFINE(DISABLE_SHADOW)
92 fi
93 MANTYPE='$(CATMAN)'
94 mansubdir=cat
95 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110096*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110097 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100098 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110099 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100100 no_libsocket=1
101 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000102 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100103 ;;
104*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +1100105 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000106 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +1100107 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000108 AC_DEFINE(WITH_IRIX_ARRAY)
109 AC_DEFINE(WITH_IRIX_PROJECT)
110 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100111 no_libsocket=1
112 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000113 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100114 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100115*-*-linux*)
116 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100117 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000118 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100119 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100120 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100121*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100122 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100123 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000124*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000125 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100126 conf_utmp_location=/etc/utmp
127 conf_wtmp_location=/usr/adm/wtmp
128 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000129 AC_DEFINE(HAVE_NEXT)
130 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000131 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
Damien Miller0f91b4e2000-06-18 15:43:25 +1000132 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100133*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100134 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100135 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100136 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000137 # hardwire lastlog location (can't detect it on some versions)
138 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000139 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
140 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
141 if test "$sol2ver" -ge 8; then
142 AC_MSG_RESULT(yes)
143 AC_DEFINE(DISABLE_UTMP)
144 AC_DEFINE(DISABLE_WTMP)
145 else
146 AC_MSG_RESULT(no)
147 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100148 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000149*-*-sunos4*)
150 CFLAGS="$CFLAGS -DSUNOS4"
151 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000152 conf_utmp_location=/etc/utmp
153 conf_wtmp_location=/var/adm/wtmp
154 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000155 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000156 MANTYPE='$(CATMAN)'
157 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000158 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000159*-sni-sysv*)
160 CFLAGS="$CFLAGS -I/usr/local/include"
161 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
162 MANTYPE='$(CATMAN)'
163 AC_DEFINE(IP_TOS_IS_BROKEN)
164 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000165 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000166 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100167*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100168 CFLAGS="$CFLAGS -I/usr/local/include"
169 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100170 MANTYPE='$(CATMAN)'
171 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100172 LIBS="$LIBS -lgen -lsocket"
173 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000174*-*-sco3*)
175 CFLAGS="$CFLAGS -I/usr/local/include"
176 LDFLAGS="$LDFLAGS -L/usr/local/lib"
177 MANTYPE='$(CATMAN)'
178 mansubdir=cat
179 LIBS="$LIBS -lgen -lsocket"
180 no_dev_ptmx=1
181 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000182*-dec-osf*)
183# This is untested
184 if test ! -z "USE_SIA" ; then
185 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
186 if test -f /etc/sia/matrix.conf; then
187 AC_MSG_RESULT(yes)
188 AC_DEFINE(HAVE_OSF_SIA)
189 AC_DEFINE(DISABLE_LOGIN)
190 LIBS="$LIBS -lsecurity -ldb -lm -laud"
191 else
192 AC_MSG_RESULT(no)
193 fi
194 fi
195 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100196esac
197
Damien Millere37bfc12000-06-05 09:37:43 +1000198# Allow user to specify flags
199AC_ARG_WITH(cflags,
200 [ --with-cflags Specify additional flags to pass to compiler],
201 [
202 if test "x$withval" != "xno" ; then
203 CFLAGS="$CFLAGS $withval"
204 fi
205 ]
206)
207AC_ARG_WITH(ldflags,
208 [ --with-ldlags Specify additional flags to pass to linker],
209 [
210 if test "x$withval" != "xno" ; then
211 LDFLAGS="$LDFLAGS $withval"
212 fi
213 ]
214)
215AC_ARG_WITH(libs,
216 [ --with-libs Specify additional libraries to link with],
217 [
218 if test "x$withval" != "xno" ; then
219 LIBS="$LIBS $withval"
220 fi
221 ]
222)
223
224
Damien Millera22ba012000-03-02 23:09:20 +1100225# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100226AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
227AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100228
Damien Millerbeb4ba51999-12-28 15:09:35 +1100229if test -z "$no_libsocket" ; then
230 AC_CHECK_LIB(nsl, yp_match, , )
231fi
232if test -z "$no_libnsl" ; then
233 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100234fi
Damien Millerab18c411999-11-11 10:40:23 +1100235
Damien Millera22ba012000-03-02 23:09:20 +1100236# Checks for header files.
Damien Millerad833b32000-08-23 10:46:23 +1000237AC_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 +1100238
Damien Millerad833b32000-08-23 10:46:23 +1000239dnl Checks for library functions.
240AC_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)
241dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000242AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000243dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000244AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000245dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000246AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
247AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000248dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000249AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
250AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100251
Damien Miller5fc85652000-07-09 23:53:07 +1000252AC_CHECK_FUNC(getuserattr,
253 [AC_DEFINE(HAVE_GETUSERATTR)],
254 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
255)
256
Damien Miller04f80141999-11-19 15:32:34 +1100257AC_CHECK_FUNC(login,
258 [AC_DEFINE(HAVE_LOGIN)],
259 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
260)
261
262AC_CHECK_FUNC(daemon,
263 [AC_DEFINE(HAVE_DAEMON)],
264 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
265)
266
Damien Miller9fb07e42000-03-05 16:22:59 +1100267AC_CHECK_FUNC(getpagesize,
268 [AC_DEFINE(HAVE_GETPAGESIZE)],
269 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
270)
271
Damien Millercb170cb2000-07-01 16:52:55 +1000272# Check for broken snprintf
273if test "x$ac_cv_func_snprintf" = "xyes" ; then
274 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
275 AC_TRY_RUN(
276 [
277#include <stdio.h>
278int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
279 ],
280 [AC_MSG_RESULT(yes)],
281 [
282 AC_MSG_RESULT(no)
283 AC_DEFINE(BROKEN_SNPRINTF)
284 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
285 ]
286 )
287fi
288
Damien Miller7b22d652000-06-18 14:07:04 +1000289PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100290AC_ARG_WITH(pam,
291 [ --without-pam Disable PAM support ],
292 [
293 if test "x$withval" = "xno" ; then
294 no_pam=1
295 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000296 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100297 fi
298 ]
299)
Damien Milleredb82922000-06-20 13:25:52 +1000300if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100301 AC_CHECK_LIB(dl, dlopen, , )
302 LIBS="$LIBS -lpam"
303
Damien Miller0e65eed2000-05-17 22:16:05 +1000304 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000305
Damien Miller1f335fb2000-06-26 11:31:33 +1000306 disable_shadow=yes
307
Damien Miller7b22d652000-06-18 14:07:04 +1000308 PAM_MSG="yes"
309
Damien Millera22ba012000-03-02 23:09:20 +1100310 # Check PAM strerror arguments (old PAM)
311 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
312 AC_TRY_COMPILE(
313 [
Damien Miller81171112000-04-23 11:14:01 +1000314#include <stdlib.h>
315#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100316 ],
317 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
318 [AC_MSG_RESULT(no)],
319 [
320 AC_DEFINE(HAVE_OLD_PAM)
321 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000322 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100323 ]
324 )
325fi
326
327# The big search for OpenSSL
328AC_ARG_WITH(ssl-dir,
329 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
330 [
331 if test "x$withval" != "$xno" ; then
332 tryssldir=$withval
333 fi
334 ]
335)
336
337saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100338saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100339saved_CFLAGS="$CFLAGS"
340if test "x$prefix" != "xNONE" ; then
341 tryssldir="$tryssldir $prefix"
342fi
Damien Miller61e50f12000-05-08 20:49:37 +1000343AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100344
Damien Miller61e50f12000-05-08 20:49:37 +1000345 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
346 if test ! -z "$ssldir" ; then
347 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
348 CFLAGS="$saved_CFLAGS -I$ssldir/include"
349 if test ! -z "$need_dash_r" ; then
350 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
351 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100352 else
Damien Miller61e50f12000-05-08 20:49:37 +1000353 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100354 fi
355
Damien Miller3b512e12000-05-17 23:29:18 +1000356 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000357
Damien Miller3b512e12000-05-17 23:29:18 +1000358 # Basic test to check for compatible version and correct linking
359 # *does not* test for RSA - that comes later.
360 AC_TRY_RUN(
361 [
Damien Millere59ce622000-05-01 20:54:17 +1000362#include <string.h>
363#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000364int main(void)
365{
Damien Miller3b512e12000-05-17 23:29:18 +1000366 char a[2048];
367 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000368 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000369 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000370}
Damien Miller3b512e12000-05-17 23:29:18 +1000371 ],
372 [
373 found_crypto=1
374 break;
375 ], []
376 )
Damien Miller61e50f12000-05-08 20:49:37 +1000377
378 if test ! -z "$found_crypto" ; then
379 break;
380 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100381 done
382
Damien Miller61e50f12000-05-08 20:49:37 +1000383 if test -z "$found_crypto" ; then
384 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100385 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000386 if test -z "$ssldir" ; then
387 ssldir="(system)"
388 fi
Damien Millera22ba012000-03-02 23:09:20 +1100389
Damien Miller61e50f12000-05-08 20:49:37 +1000390 ac_cv_openssldir=$ssldir
391])
392
Damien Milleredb82922000-06-20 13:25:52 +1000393if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000394 AC_DEFINE(HAVE_OPENSSL)
395 dnl Need to recover ssldir - test above runs in subshell
396 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100397 CFLAGS="$saved_CFLAGS -I$ssldir/include"
398 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
399 if test ! -z "$need_dash_r" ; then
400 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100401 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100402 if test ! -z "$blibpath" ; then
403 blibpath="$blibpath:$ssldir:$ssldir/lib"
404 fi
Damien Millera22ba012000-03-02 23:09:20 +1100405fi
Damien Miller3b512e12000-05-17 23:29:18 +1000406LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000407
Damien Miller3b512e12000-05-17 23:29:18 +1000408# Now test RSA support
409saved_LIBS="$LIBS"
410AC_MSG_CHECKING([for RSA support])
411for WANTS_RSAREF in "" 1 ; do
412 if test -z "$WANTS_RSAREF" ; then
413 LIBS="$saved_LIBS"
414 else
415 LIBS="$saved_LIBS -lRSAglue -lrsaref"
416 fi
417 AC_TRY_RUN([
418#include <string.h>
419#include <openssl/rand.h>
420#include <openssl/rsa.h>
421#include <openssl/bn.h>
422#include <openssl/sha.h>
423int main(void)
424{
425 int num; RSA *key; static unsigned char p_in[] = "blahblah";
426 unsigned char c[256], p[256];
427 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
428 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
429 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
430 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
431}
432 ],
433 [
434 rsa_works=1
435 break;
436 ], [])
437done
438
439if test ! -z "$no_rsa" ; then
440 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000441 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000442else
443 if test -z "$rsa_works" ; then
444 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000445 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000446 else
447 if test -z "$WANTS_RSAREF" ; then
448 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000449 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000450 else
Damien Miller7b22d652000-06-18 14:07:04 +1000451 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000452 AC_MSG_RESULT(using RSAref)
453 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
454 fi
455 fi
456fi
Damien Millera22ba012000-03-02 23:09:20 +1100457
458# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100459AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100460AC_CHECK_SIZEOF(short int, 2)
461AC_CHECK_SIZEOF(int, 4)
462AC_CHECK_SIZEOF(long int, 4)
463AC_CHECK_SIZEOF(long long int, 8)
464
Damien Millera22ba012000-03-02 23:09:20 +1100465# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100466AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
467 AC_TRY_COMPILE(
468 [ #include <sys/types.h> ],
469 [ u_int a; a = 1;],
470 [ ac_cv_have_u_int="yes" ],
471 [ ac_cv_have_u_int="no" ]
472 )
473])
474if test "x$ac_cv_have_u_int" = "xyes" ; then
475 AC_DEFINE(HAVE_U_INT)
476 have_u_int=1
477fi
478
Damien Miller61e50f12000-05-08 20:49:37 +1000479AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
480 AC_TRY_COMPILE(
481 [ #include <sys/types.h> ],
482 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
483 [ ac_cv_have_intxx_t="yes" ],
484 [ ac_cv_have_intxx_t="no" ]
485 )
486])
487if test "x$ac_cv_have_intxx_t" = "xyes" ; then
488 AC_DEFINE(HAVE_INTXX_T)
489 have_intxx_t=1
490fi
491
492AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
493 AC_TRY_COMPILE(
494 [ #include <sys/types.h> ],
495 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
496 [ ac_cv_have_u_intxx_t="yes" ],
497 [ ac_cv_have_u_intxx_t="no" ]
498 )
499])
500if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
501 AC_DEFINE(HAVE_U_INTXX_T)
502 have_u_intxx_t=1
503fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100504
Damien Milleredb82922000-06-20 13:25:52 +1000505if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
506 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100507then
508 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
509 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000510 [
511#include <sys/bitypes.h>
512 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100513 [
Damien Miller70494d12000-04-03 15:57:06 +1000514 int8_t a; int16_t b; int32_t c;
515 u_int8_t e; u_int16_t f; u_int32_t g;
516 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100517 ],
518 [
519 AC_DEFINE(HAVE_U_INTXX_T)
520 AC_DEFINE(HAVE_INTXX_T)
521 AC_MSG_RESULT(yes)
522 ],
523 [AC_MSG_RESULT(no)]
524 )
525fi
526
Damien Millerd6121d22000-03-17 23:26:46 +1100527if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000528 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
529 AC_TRY_COMPILE(
530 [
531#include <sys/types.h>
532 ],
533 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
534 [ ac_cv_have_uintxx_t="yes" ],
535 [ ac_cv_have_uintxx_t="no" ]
536 )
537 ])
538 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
539 AC_DEFINE(HAVE_UINTXX_T)
540 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100541fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100542
Damien Miller61e50f12000-05-08 20:49:37 +1000543AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
544 AC_TRY_COMPILE(
545 [
Damien Miller81171112000-04-23 11:14:01 +1000546#include <sys/types.h>
547#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000548 ],
549 [socklen_t foo; foo = 1235;],
550 [ ac_cv_have_socklen_t="yes" ],
551 [ ac_cv_have_socklen_t="no" ]
552 )
553])
554if test "x$ac_cv_have_socklen_t" = "xyes" ; then
555 AC_DEFINE(HAVE_SOCKLEN_T)
556fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100557
Damien Miller61e50f12000-05-08 20:49:37 +1000558AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
559 AC_TRY_COMPILE(
560 [
561#include <sys/types.h>
562 ],
563 [ size_t foo; foo = 1235; ],
564 [ ac_cv_have_size_t="yes" ],
565 [ ac_cv_have_size_t="no" ]
566 )
567])
568if test "x$ac_cv_have_size_t" = "xyes" ; then
569 AC_DEFINE(HAVE_SIZE_T)
570fi
Damien Miller95058511999-12-29 10:36:45 +1100571
Damien Miller615f9392000-05-17 22:53:33 +1000572AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
573 AC_TRY_COMPILE(
574 [
575#include <sys/types.h>
576 ],
577 [ ssize_t foo; foo = 1235; ],
578 [ ac_cv_have_ssize_t="yes" ],
579 [ ac_cv_have_ssize_t="no" ]
580 )
581])
582if test "x$ac_cv_have_ssize_t" = "xyes" ; then
583 AC_DEFINE(HAVE_SSIZE_T)
584fi
585
Damien Millerb54b40e2000-06-23 08:23:34 +1000586AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
587 AC_TRY_COMPILE(
588 [
589#include <sys/types.h>
590#include <sys/socket.h>
591 ],
592 [ sa_family_t foo; foo = 1235; ],
593 [ ac_cv_have_sa_family_t="yes" ],
594 [ ac_cv_have_sa_family_t="no" ]
595 )
596])
597if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
598 AC_DEFINE(HAVE_SA_FAMILY_T)
599fi
600
Damien Miller0f91b4e2000-06-18 15:43:25 +1000601AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
602 AC_TRY_COMPILE(
603 [
604#include <sys/types.h>
605 ],
606 [ pid_t foo; foo = 1235; ],
607 [ ac_cv_have_pid_t="yes" ],
608 [ ac_cv_have_pid_t="no" ]
609 )
610])
611if test "x$ac_cv_have_pid_t" = "xyes" ; then
612 AC_DEFINE(HAVE_PID_T)
613fi
614
615AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
616 AC_TRY_COMPILE(
617 [
618#include <sys/types.h>
619 ],
620 [ mode_t foo; foo = 1235; ],
621 [ ac_cv_have_mode_t="yes" ],
622 [ ac_cv_have_mode_t="no" ]
623 )
624])
625if test "x$ac_cv_have_mode_t" = "xyes" ; then
626 AC_DEFINE(HAVE_MODE_T)
627fi
628
Damien Miller61e50f12000-05-08 20:49:37 +1000629
630AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
631 AC_TRY_COMPILE(
632 [
Damien Miller81171112000-04-23 11:14:01 +1000633#include <sys/types.h>
634#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000635 ],
636 [ struct sockaddr_storage s; ],
637 [ ac_cv_have_struct_sockaddr_storage="yes" ],
638 [ ac_cv_have_struct_sockaddr_storage="no" ]
639 )
640])
641if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
642 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
643fi
Damien Miller34132e52000-01-14 15:45:46 +1100644
Damien Miller61e50f12000-05-08 20:49:37 +1000645AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
646 AC_TRY_COMPILE(
647 [
Damien Miller7b22d652000-06-18 14:07:04 +1000648#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000649#include <netinet/in.h>
650 ],
651 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
652 [ ac_cv_have_struct_sockaddr_in6="yes" ],
653 [ ac_cv_have_struct_sockaddr_in6="no" ]
654 )
655])
656if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
657 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
658fi
Damien Miller34132e52000-01-14 15:45:46 +1100659
Damien Miller61e50f12000-05-08 20:49:37 +1000660AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
661 AC_TRY_COMPILE(
662 [
Damien Miller7b22d652000-06-18 14:07:04 +1000663#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000664#include <netinet/in.h>
665 ],
666 [ struct in6_addr s; s.s6_addr[0] = 0; ],
667 [ ac_cv_have_struct_in6_addr="yes" ],
668 [ ac_cv_have_struct_in6_addr="no" ]
669 )
670])
671if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
672 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
673fi
Damien Miller34132e52000-01-14 15:45:46 +1100674
Damien Miller61e50f12000-05-08 20:49:37 +1000675AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
676 AC_TRY_COMPILE(
677 [
Damien Miller81171112000-04-23 11:14:01 +1000678#include <sys/types.h>
679#include <sys/socket.h>
680#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000681 ],
682 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
683 [ ac_cv_have_struct_addrinfo="yes" ],
684 [ ac_cv_have_struct_addrinfo="no" ]
685 )
686])
687if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
688 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
689fi
690
Damien Miller34132e52000-01-14 15:45:46 +1100691
Damien Millera22ba012000-03-02 23:09:20 +1100692# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100693
Damien Miller61e50f12000-05-08 20:49:37 +1000694OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
695OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
696OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
697OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
698OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000699OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000700OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
701OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000702OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000703OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
704OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
705OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
706OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000707OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
708OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
709OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
710OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
711
Damien Miller942da032000-08-18 13:59:06 +1000712AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
713 ac_cv_have_sun_len_in_struct_sockaddr_un, [
714 AC_TRY_COMPILE(
715 [
716#include <sys/types.h>
717#include <sys/socket.h>
718 ],
719 [ struct sockaddr_un s; s.sun_len = 1; ],
720 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
721 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
722 )
723])
724if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
725 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
726fi
727
Damien Miller61e50f12000-05-08 20:49:37 +1000728AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
729 ac_cv_have_ss_family_in_struct_ss, [
730 AC_TRY_COMPILE(
731 [
Damien Miller81171112000-04-23 11:14:01 +1000732#include <sys/types.h>
733#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000734 ],
735 [ struct sockaddr_storage s; s.ss_family = 1; ],
736 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
737 [ ac_cv_have_ss_family_in_struct_ss="no" ],
738 )
739])
740if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
741 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
742fi
743
Damien Miller61e50f12000-05-08 20:49:37 +1000744AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
745 ac_cv_have___ss_family_in_struct_ss, [
746 AC_TRY_COMPILE(
747 [
Damien Miller81171112000-04-23 11:14:01 +1000748#include <sys/types.h>
749#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000750 ],
751 [ struct sockaddr_storage s; s.__ss_family = 1; ],
752 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
753 [ ac_cv_have___ss_family_in_struct_ss="no" ]
754 )
755])
756if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
757 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
758fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100759
Damien Millerad833b32000-08-23 10:46:23 +1000760AC_CACHE_CHECK([for pw_class field in struct passwd],
761 ac_cv_have_pw_class_in_struct_passwd, [
762 AC_TRY_COMPILE(
763 [
764#include <sys/types.h>
765#include <pwd.h>
766 ],
767 [ struct passwd p s; p.pw_class = NULL; ],
768 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
769 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
770 )
771])
772if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
773 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
774fi
775
Damien Miller61e50f12000-05-08 20:49:37 +1000776
777AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
778 AC_TRY_LINK([],
779 [ extern char *__progname; printf("%s", __progname); ],
780 [ ac_cv_libc_defines___progname="yes" ],
781 [ ac_cv_libc_defines___progname="no" ]
782 )
783])
784if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
785 AC_DEFINE(HAVE___PROGNAME)
786fi
787
Damien Millera22ba012000-03-02 23:09:20 +1100788
Damien Millerecbb26d2000-07-15 14:59:14 +1000789AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
790 AC_TRY_LINK([],
791 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
792 [ ac_cv_libc_defines_sys_errlist="yes" ],
793 [ ac_cv_libc_defines_sys_errlist="no" ]
794 )
795])
796if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
797 AC_DEFINE(HAVE_SYS_ERRLIST)
798fi
799
800
Damien Miller11fa2cc2000-08-16 10:35:58 +1000801AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
802 AC_TRY_LINK([],
803 [ extern int sys_nerr; printf("%i", sys_nerr);],
804 [ ac_cv_libc_defines_sys_nerr="yes" ],
805 [ ac_cv_libc_defines_sys_nerr="no" ]
806 )
807])
808if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
809 AC_DEFINE(HAVE_SYS_NERR)
810fi
811
812
Damien Millera22ba012000-03-02 23:09:20 +1100813# Looking for programs, paths and files
814AC_ARG_WITH(rsh,
815 [ --with-rsh=PATH Specify path to remote shell program ],
816 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100817 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000818 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100819 fi
820 ],
821 [
822 AC_PATH_PROG(rsh_path, rsh)
823 ]
824)
825
826AC_ARG_WITH(xauth,
827 [ --with-xauth=PATH Specify path to xauth program ],
828 [
829 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000830 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100831 fi
832 ],
833 [
834 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000835 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100836 xauth_path="/usr/openwin/bin/xauth"
837 fi
838 ]
839)
840
841if test ! -z "$xauth_path" ; then
842 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
843fi
844if test ! -z "$rsh_path" ; then
845 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
846fi
847
848# Check for mail directory (last resort if we cannot get it from headers)
849if test ! -z "$MAIL" ; then
850 maildir=`dirname $MAIL`
851 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
852fi
853
Damien Millera22ba012000-03-02 23:09:20 +1100854if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100855 AC_CHECK_FILE("/dev/ptmx",
856 [
857 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
858 have_dev_ptmx=1
859 ]
860 )
Damien Millera22ba012000-03-02 23:09:20 +1100861fi
Damien Miller204ad072000-03-02 23:56:12 +1100862AC_CHECK_FILE("/dev/ptc",
863 [
864 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
865 have_dev_ptc=1
866 ]
867)
868
Damien Millera22ba012000-03-02 23:09:20 +1100869# Options from here on. Some of these are preset by platform above
870
Damien Millera22ba012000-03-02 23:09:20 +1100871# Check for user-specified random device, otherwise check /dev/urandom
872AC_ARG_WITH(random,
873 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
874 [
Damien Miller040f3832000-04-03 14:50:43 +1000875 if test "x$withval" != "xno" ; then
876 RANDOM_POOL="$withval";
877 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
878 fi
Damien Millera22ba012000-03-02 23:09:20 +1100879 ],
880 [
881 # Check for random device
882 AC_CHECK_FILE("/dev/urandom",
883 [
884 RANDOM_POOL="/dev/urandom";
885 AC_SUBST(RANDOM_POOL)
886 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
887 ]
888 )
889 ]
890)
891
892# Check for EGD pool file
893AC_ARG_WITH(egd-pool,
894 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
895 [
Damien Miller040f3832000-04-03 14:50:43 +1000896 if test "x$withval" != "xno" ; then
897 EGD_SOCKET="$withval";
898 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
899 fi
Damien Millera22ba012000-03-02 23:09:20 +1100900 ]
901)
902
Damien Miller0437b332000-05-02 09:56:41 +1000903# detect pathnames for entropy gathering commands, if we need them
904INSTALL_SSH_PRNG_CMDS=""
905rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000906if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000907 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000908 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
909 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
910 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
911 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
912 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
913 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
914 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
915 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
916 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
917 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
918 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
919 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
920 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
921 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
922 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000923
924 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000925fi
Damien Miller0437b332000-05-02 09:56:41 +1000926AC_SUBST(INSTALL_SSH_PRNG_CMDS)
927
Damien Miller11e37f62000-04-08 18:23:30 +1000928
Damien Miller670a4b82000-01-22 13:53:11 +1100929AC_ARG_WITH(catman,
930 [ --with-catman=man|cat Install preformatted manpages[no]],
931 [
932 MANTYPE='$(CATMAN)'
933 if test x"$withval" != x"yes" ; then
934 mansubdir=$withval
935 else
936 mansubdir=cat
937 fi
938 ], [
939 if test -z "$MANTYPE" ; then
940 MANTYPE='$(TROFFMAN)'
941 mansubdir=man
942 fi
943 ]
944)
945AC_SUBST(MANTYPE)
946AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100947
Damien Millera22ba012000-03-02 23:09:20 +1100948# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000949KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100950AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100951 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100952 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100953 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100954
955 if test "x$withval" != "$xyes" ; then
956 CFLAGS="$CFLAGS -I${withval}/include"
957 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100958 if test ! -z "$need_dash_r" ; then
959 LDFLAGS="$LDFLAGS -R${withval}/lib"
960 fi
961 if test ! -z "$blibpath" ; then
962 blibpath="$blibpath:${withval}/lib"
963 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100964 else
965 if test -d /usr/include/kerberosIV ; then
966 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
967 fi
968 fi
969
970 AC_CHECK_HEADERS(krb.h)
971 AC_CHECK_LIB(krb, main)
972 if test "$ac_cv_header_krb_h" != yes; then
973 AC_MSG_WARN([Cannot find krb.h, build may fail])
974 fi
975 if test "$ac_cv_lib_krb_main" != yes; then
976 AC_MSG_WARN([Cannot find libkrb, build may fail])
977 fi
978
Damien Millerc85f9b42000-01-29 10:20:21 +1100979 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100980 AC_CHECK_LIB(resolv, dn_expand, , )
981 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000982 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100983 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100984 fi
Damien Miller80297751999-11-19 13:03:25 +1100985 ]
986)
987
Damien Millera22ba012000-03-02 23:09:20 +1100988# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000989AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100990AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100991 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100992 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100993 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100994
995 if test "x$withval" != "$xyes" ; then
996 CFLAGS="$CFLAGS -I${withval}/include"
997 LFLAGS="$LFLAGS -L${withval}/lib"
998 fi
999
1000 if test -z "$KRB4" ; then
1001 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1002 fi
1003
Damien Miller8bdeee21999-12-30 15:50:54 +11001004 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001005 if test ! -z "$AFS_LIBS" ; then
1006 LIBS="$LIBS $AFS_LIBS"
1007 fi
1008 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001009 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001010 fi
Damien Miller80297751999-11-19 13:03:25 +11001011 ]
1012)
Damien Millerc85f9b42000-01-29 10:20:21 +11001013LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001014
Damien Millera22ba012000-03-02 23:09:20 +11001015# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001016SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001017AC_ARG_WITH(skey,
1018 [ --with-skey Enable S/Key support],
1019 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001020 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001021 AC_DEFINE(SKEY)
1022 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001023 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001024 fi
Damien Miller80297751999-11-19 13:03:25 +11001025 ]
1026)
1027
Damien Millera22ba012000-03-02 23:09:20 +11001028# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001029TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001030AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001031 [ --with-tcp-wrappers Enable tcpwrappers support],
1032 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001033 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001034 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001035 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001036 AC_MSG_CHECKING(for libwrap)
1037 AC_TRY_LINK(
1038 [
Damien Miller81171112000-04-23 11:14:01 +10001039#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001040 int deny_severity = 0, allow_severity = 0;
1041 ],
1042 [hosts_access(0);],
1043 [
1044 AC_MSG_RESULT(yes)
1045 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001046 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001047 ],
1048 [
Damien Miller7b22d652000-06-18 14:07:04 +10001049 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001050 ]
1051 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001052 fi
Damien Miller80297751999-11-19 13:03:25 +11001053 ]
1054)
1055
Damien Millera22ba012000-03-02 23:09:20 +11001056# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001057MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001058AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001059 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001060 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001061 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001062 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001063 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001064 fi
1065 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001066)
1067
Damien Millera22ba012000-03-02 23:09:20 +11001068# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001069AC_ARG_WITH(shadow,
1070 [ --without-shadow Disable shadow password support],
1071 [
1072 if test "x$withval" = "xno" ; then
1073 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001074 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001075 fi
1076 ]
1077)
1078
Damien Miller1f335fb2000-06-26 11:31:33 +10001079if test -z "$disable_shadow" ; then
1080 AC_MSG_CHECKING([if the systems has expire shadow information])
1081 AC_TRY_COMPILE(
1082 [
1083#include <sys/types.h>
1084#include <shadow.h>
1085 struct spwd sp;
1086 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1087 [ sp_expire_available=yes ], []
1088 )
1089
1090 if test "x$sp_expire_available" = "xyes" ; then
1091 AC_MSG_RESULT(yes)
1092 AC_DEFINE(HAS_SHADOW_EXPIRE)
1093 else
1094 AC_MSG_RESULT(no)
1095 fi
1096fi
1097
Damien Millera22ba012000-03-02 23:09:20 +11001098# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001099DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001100AC_ARG_WITH(ipaddr-display,
1101 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1102 [
Damien Millere477ef62000-08-15 10:21:17 +10001103 if test "x$withval" != "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001104 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001105 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001106 fi
1107 ]
1108)
1109
Damien Millera22ba012000-03-02 23:09:20 +11001110# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001111SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001112AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001113 [ --with-default-path=PATH Specify default \$PATH environment for server],
1114 [
1115 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001116 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001117 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001118 fi
1119 ]
1120)
1121
Damien Millera22ba012000-03-02 23:09:20 +11001122# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001123IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001124AC_ARG_WITH(ipv4-default,
1125 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1126 [
1127 if test "x$withval" != "xno" ; then
1128 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001129 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001130 fi
1131 ]
1132)
1133
Damien Miller61e50f12000-05-08 20:49:37 +10001134AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001135IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001136AC_ARG_WITH(4in6,
1137 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1138 [
1139 if test "x$withval" != "xno" ; then
1140 AC_MSG_RESULT(yes)
1141 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001142 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001143 else
1144 AC_MSG_RESULT(no)
1145 fi
1146 ],[
1147 if test "x$inet6_default_4in6" = "xyes"; then
1148 AC_MSG_RESULT([yes (default)])
1149 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001150 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001151 else
1152 AC_MSG_RESULT([no (default)])
1153 fi
1154 ]
1155)
1156
Damien Millera22ba012000-03-02 23:09:20 +11001157# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001158piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001159AC_ARG_WITH(pid-dir,
1160 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1161 [
1162 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001163 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001164 fi
1165 ]
1166)
Damien Miller4018c192000-04-30 09:30:44 +10001167
Damien Millerdbd250f2000-01-18 08:57:14 +11001168AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001169AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001170
andre2ff7b5d2000-06-03 14:57:40 +00001171dnl allow user to disable some login recording features
1172AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001173 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001174 [ AC_DEFINE(DISABLE_LASTLOG) ]
1175)
1176AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001177 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001178 [ AC_DEFINE(DISABLE_UTMP) ]
1179)
1180AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001181 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001182 [ AC_DEFINE(DISABLE_UTMPX) ]
1183)
1184AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001185 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001186 [ AC_DEFINE(DISABLE_WTMP) ]
1187)
1188AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001189 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001190 [ AC_DEFINE(DISABLE_WTMPX) ]
1191)
1192AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001193 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001194 [ AC_DEFINE(DISABLE_LOGIN) ]
1195)
1196AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001197 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001198 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1199)
1200AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001201 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001202 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1203)
1204AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001205 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001206 [ conf_lastlog_location="$withval"; ],)
1207
1208dnl lastlog, [uw]tmpx? detection
1209dnl NOTE: set the paths in the platform section to avoid the
1210dnl need for command-line parameters
1211dnl lastlog and [uw]tmp are subject to a file search if all else fails
1212
1213dnl lastlog detection
1214dnl NOTE: the code itself will detect if lastlog is a directory
1215AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1216AC_TRY_COMPILE([
1217#include <sys/types.h>
1218#include <utmp.h>
1219#ifdef HAVE_LASTLOG_H
1220# include <lastlog.h>
1221#endif
Damien Miller2994e082000-06-04 15:51:47 +10001222#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001223# include <paths.h>
1224#endif
1225 ],
1226 [ char *lastlog = LASTLOG_FILE; ],
1227 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001228 [
1229 AC_MSG_RESULT(no)
1230 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1231 AC_TRY_COMPILE([
1232#include <sys/types.h>
1233#include <utmp.h>
1234#ifdef HAVE_LASTLOG_H
1235# include <lastlog.h>
1236#endif
1237#ifdef HAVE_PATHS_H
1238# include <paths.h>
1239#endif
1240 ],
1241 [ char *lastlog = _PATH_LASTLOG; ],
1242 [ AC_MSG_RESULT(yes) ],
1243 [
andree441aa32000-06-12 22:34:38 +00001244 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001245 system_lastlog_path=no
1246 ])
1247 ]
andre2ff7b5d2000-06-03 14:57:40 +00001248)
Damien Miller2994e082000-06-04 15:51:47 +10001249
andre2ff7b5d2000-06-03 14:57:40 +00001250if test -z "$conf_lastlog_location"; then
1251 if test x"$system_lastlog_path" = x"no" ; then
1252 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001253 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001254 conf_lastlog_location=$f
1255 fi
1256 done
1257 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001258 AC_MSG_WARN([** Cannot find lastlog **])
1259 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001260 fi
1261 fi
1262fi
1263
1264if test -n "$conf_lastlog_location"; then
1265 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1266fi
1267
1268dnl utmp detection
1269AC_MSG_CHECKING([if your system defines UTMP_FILE])
1270AC_TRY_COMPILE([
1271#include <sys/types.h>
1272#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001273#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001274# include <paths.h>
1275#endif
1276 ],
1277 [ char *utmp = UTMP_FILE; ],
1278 [ AC_MSG_RESULT(yes) ],
1279 [ AC_MSG_RESULT(no)
1280 system_utmp_path=no ]
1281)
1282if test -z "$conf_utmp_location"; then
1283 if test x"$system_utmp_path" = x"no" ; then
1284 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1285 if test -f $f ; then
1286 conf_utmp_location=$f
1287 fi
1288 done
1289 if test -z "$conf_utmp_location"; then
1290 AC_DEFINE(DISABLE_UTMP)
1291 fi
1292 fi
1293fi
1294if test -n "$conf_utmp_location"; then
1295 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1296fi
1297
1298dnl wtmp detection
1299AC_MSG_CHECKING([if your system defines WTMP_FILE])
1300AC_TRY_COMPILE([
1301#include <sys/types.h>
1302#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001303#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001304# include <paths.h>
1305#endif
1306 ],
1307 [ char *wtmp = WTMP_FILE; ],
1308 [ AC_MSG_RESULT(yes) ],
1309 [ AC_MSG_RESULT(no)
1310 system_wtmp_path=no ]
1311)
1312if test -z "$conf_wtmp_location"; then
1313 if test x"$system_wtmp_path" = x"no" ; then
1314 for f in /usr/adm/wtmp /var/log/wtmp; do
1315 if test -f $f ; then
1316 conf_wtmp_location=$f
1317 fi
1318 done
1319 if test -z "$conf_wtmp_location"; then
1320 AC_DEFINE(DISABLE_WTMP)
1321 fi
1322 fi
1323fi
1324if test -n "$conf_wtmp_location"; then
1325 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1326fi
1327
1328
1329dnl utmpx detection - I don't know any system so perverse as to require
1330dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1331dnl there, though.
1332AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1333AC_TRY_COMPILE([
1334#include <sys/types.h>
1335#include <utmp.h>
1336#ifdef HAVE_UTMPX_H
1337#include <utmpx.h>
1338#endif
Damien Miller2994e082000-06-04 15:51:47 +10001339#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001340# include <paths.h>
1341#endif
1342 ],
1343 [ char *utmpx = UTMPX_FILE; ],
1344 [ AC_MSG_RESULT(yes) ],
1345 [ AC_MSG_RESULT(no)
1346 system_utmpx_path=no ]
1347)
1348if test -z "$conf_utmpx_location"; then
1349 if test x"$system_utmpx_path" = x"no" ; then
1350 AC_DEFINE(DISABLE_UTMPX)
1351 fi
1352else
1353 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1354fi
1355
1356dnl wtmpx detection
1357AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1358AC_TRY_COMPILE([
1359#include <sys/types.h>
1360#include <utmp.h>
1361#ifdef HAVE_UTMPX_H
1362#include <utmpx.h>
1363#endif
Damien Miller2994e082000-06-04 15:51:47 +10001364#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001365# include <paths.h>
1366#endif
1367 ],
1368 [ char *wtmpx = WTMPX_FILE; ],
1369 [ AC_MSG_RESULT(yes) ],
1370 [ AC_MSG_RESULT(no)
1371 system_wtmpx_path=no ]
1372)
1373if test -z "$conf_wtmpx_location"; then
1374 if test x"$system_wtmpx_path" = x"no" ; then
1375 AC_DEFINE(DISABLE_WTMPX)
1376 fi
1377else
1378 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1379fi
1380
Damien Miller4018c192000-04-30 09:30:44 +10001381
1382# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001383entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001384AC_ARG_WITH(entropy-timeout,
1385 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1386 [
1387 if test "x$withval" != "xno" ; then
1388 entropy_timeout=$withval
1389 fi
1390 ]
1391)
1392AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1393
1394
Damien Miller29ea30d2000-03-17 10:54:15 +11001395if test ! -z "$blibpath" ; then
1396 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1397 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1398fi
1399
Damien Miller0437b332000-05-02 09:56:41 +10001400AC_OUTPUT(Makefile ssh_prng_cmds)
1401
Damien Miller7b22d652000-06-18 14:07:04 +10001402# Print summary of options
1403
1404if test x$MANTYPE = x'$(CATMAN)' ; then
1405 MAN_MSG=cat
1406else
1407 MAN_MSG=man
1408fi
1409if test ! -z "$RANDOM_POOL" ; then
1410 RAND_MSG="Device ($RANDOM_POOL)"
1411else
1412 if test ! -z "$EGD_SOCKET" ; then
1413 RAND_MSG="EGD ($EGD_SOCKET)"
1414 else
1415 RAND_MSG="Builtin (timeout $entropy_timeout)"
1416 fi
1417fi
1418
1419# Someone please show me a better way :)
1420A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1421B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1422C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1423D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1424E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1425F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1426G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1427
1428echo ""
1429echo "OpenSSH configured has been configured with the following options."
1430echo " User binaries: $B"
1431echo " System binaries: $C"
1432echo " Configuration files: $D"
1433echo " Askpass program: $E"
1434echo " Manual pages: $F"
1435echo " PID file: $G"
1436echo " Random number collection: $RAND_MSG"
1437echo " Manpage format: $MAN_MSG"
1438echo " PAM support: ${PAM_MSG}"
1439echo " KerberosIV support: $KRB4_MSG"
1440echo " AFS support: $AFS_MSG"
1441echo " S/KEY support: $SKEY_MSG"
1442echo " TCP Wrappers support: $TCPW_MSG"
1443echo " MD5 password support: $MD5_MSG"
1444echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1445echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1446echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1447
1448echo ""
1449
1450echo "Compiler flags: ${CFLAGS}"
1451echo "Linker flags: ${LDFLAGS}"
1452echo "Libraries: ${LIBS}"
1453
1454echo ""
1455