blob: 1c228dd9ca51114aef19345ebf0cf6b8154149cd [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 Miller8a1e6a62000-09-16 15:55:52 +110076 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110077 AC_DEFINE(DISABLE_UTMP)
Damien Miller8a1e6a62000-09-16 15:55:52 +110078 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110079 MANTYPE='$(CATMAN)'
80 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110081 ;;
Damien Miller1bead332000-04-30 00:47:29 +100082*-*-hpux11*)
Damien Miller1bead332000-04-30 00:47:29 +100083 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110084 IPADDR_IN_DISPLAY=yes
Damien Miller5552d7a2000-08-30 09:53:24 +110085 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110086 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110087 AC_DEFINE(DISABLE_UTMP)
Damien Miller8a1e6a62000-09-16 15:55:52 +110088 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +100089 MANTYPE='$(CATMAN)'
90 mansubdir=cat
91 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110092*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110093 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100094 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110095 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110096 no_libsocket=1
97 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +100098 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +110099 ;;
100*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +1100101 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000102 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +1100103 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000104 AC_DEFINE(WITH_IRIX_ARRAY)
105 AC_DEFINE(WITH_IRIX_PROJECT)
106 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100107 no_libsocket=1
108 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000109 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100110 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100111*-*-linux*)
112 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100113 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000114 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100115 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100116 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100117*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100118 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100119 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000120*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000121 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100122 conf_utmp_location=/etc/utmp
123 conf_wtmp_location=/usr/adm/wtmp
124 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000125 AC_DEFINE(HAVE_NEXT)
126 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000127 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100128*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100129 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100130 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100131 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000132 # hardwire lastlog location (can't detect it on some versions)
133 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000134 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
135 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
136 if test "$sol2ver" -ge 8; then
137 AC_MSG_RESULT(yes)
138 AC_DEFINE(DISABLE_UTMP)
139 AC_DEFINE(DISABLE_WTMP)
140 else
141 AC_MSG_RESULT(no)
142 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100143 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000144*-*-sunos4*)
145 CFLAGS="$CFLAGS -DSUNOS4"
146 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000147 conf_utmp_location=/etc/utmp
148 conf_wtmp_location=/var/adm/wtmp
149 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000150 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000151 MANTYPE='$(CATMAN)'
152 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000153 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000154*-sni-sysv*)
155 CFLAGS="$CFLAGS -I/usr/local/include"
156 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
157 MANTYPE='$(CATMAN)'
158 AC_DEFINE(IP_TOS_IS_BROKEN)
159 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000160 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000161 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100162*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100163 CFLAGS="$CFLAGS -I/usr/local/include"
164 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100165 MANTYPE='$(CATMAN)'
166 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100167 LIBS="$LIBS -lgen -lsocket"
168 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000169*-*-sco3*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100170 AC_DEFINE(USE_PIPES)
Damien Millera66626b2000-06-13 18:57:53 +1000171 CFLAGS="$CFLAGS -I/usr/local/include"
172 LDFLAGS="$LDFLAGS -L/usr/local/lib"
173 MANTYPE='$(CATMAN)'
174 mansubdir=cat
175 LIBS="$LIBS -lgen -lsocket"
176 no_dev_ptmx=1
177 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000178*-dec-osf*)
179# This is untested
180 if test ! -z "USE_SIA" ; then
181 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
182 if test -f /etc/sia/matrix.conf; then
183 AC_MSG_RESULT(yes)
184 AC_DEFINE(HAVE_OSF_SIA)
185 AC_DEFINE(DISABLE_LOGIN)
186 LIBS="$LIBS -lsecurity -ldb -lm -laud"
187 else
188 AC_MSG_RESULT(no)
189 fi
190 fi
191 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100192esac
193
Damien Millere37bfc12000-06-05 09:37:43 +1000194# Allow user to specify flags
195AC_ARG_WITH(cflags,
196 [ --with-cflags Specify additional flags to pass to compiler],
197 [
198 if test "x$withval" != "xno" ; then
199 CFLAGS="$CFLAGS $withval"
200 fi
201 ]
202)
203AC_ARG_WITH(ldflags,
204 [ --with-ldlags Specify additional flags to pass to linker],
205 [
206 if test "x$withval" != "xno" ; then
207 LDFLAGS="$LDFLAGS $withval"
208 fi
209 ]
210)
211AC_ARG_WITH(libs,
212 [ --with-libs Specify additional libraries to link with],
213 [
214 if test "x$withval" != "xno" ; then
215 LIBS="$LIBS $withval"
216 fi
217 ]
218)
219
220
Damien Millera22ba012000-03-02 23:09:20 +1100221# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100222AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
223AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100224
Damien Millerbeb4ba51999-12-28 15:09:35 +1100225if test -z "$no_libsocket" ; then
226 AC_CHECK_LIB(nsl, yp_match, , )
227fi
228if test -z "$no_libnsl" ; then
229 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100230fi
Damien Millerab18c411999-11-11 10:40:23 +1100231
Damien Millera22ba012000-03-02 23:09:20 +1100232# Checks for header files.
Damien Miller72c9a7e2000-09-24 11:10:13 +1100233AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.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 +1100234
Damien Millerad833b32000-08-23 10:46:23 +1000235dnl Checks for library functions.
Damien Miller80ecfe82000-09-24 11:21:31 +1100236AC_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 strtok_r vsnprintf vhangup _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000237dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000238AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000239dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000240AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000241dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000242AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
243AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000244dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000245AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
246AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100247
Damien Miller5fc85652000-07-09 23:53:07 +1000248AC_CHECK_FUNC(getuserattr,
249 [AC_DEFINE(HAVE_GETUSERATTR)],
250 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
251)
252
Damien Miller04f80141999-11-19 15:32:34 +1100253AC_CHECK_FUNC(login,
254 [AC_DEFINE(HAVE_LOGIN)],
255 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
256)
257
258AC_CHECK_FUNC(daemon,
259 [AC_DEFINE(HAVE_DAEMON)],
260 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
261)
262
Damien Miller9fb07e42000-03-05 16:22:59 +1100263AC_CHECK_FUNC(getpagesize,
264 [AC_DEFINE(HAVE_GETPAGESIZE)],
265 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
266)
267
Damien Millercb170cb2000-07-01 16:52:55 +1000268# Check for broken snprintf
269if test "x$ac_cv_func_snprintf" = "xyes" ; then
270 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
271 AC_TRY_RUN(
272 [
273#include <stdio.h>
274int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
275 ],
276 [AC_MSG_RESULT(yes)],
277 [
278 AC_MSG_RESULT(no)
279 AC_DEFINE(BROKEN_SNPRINTF)
280 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
281 ]
282 )
283fi
284
Damien Miller606f8802000-09-16 15:39:56 +1100285AC_FUNC_GETPGRP
286
Damien Miller7b22d652000-06-18 14:07:04 +1000287PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100288AC_ARG_WITH(pam,
289 [ --without-pam Disable PAM support ],
290 [
291 if test "x$withval" = "xno" ; then
292 no_pam=1
293 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000294 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100295 fi
296 ]
297)
Damien Milleredb82922000-06-20 13:25:52 +1000298if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100299 AC_CHECK_LIB(dl, dlopen, , )
300 LIBS="$LIBS -lpam"
301
Damien Miller0e65eed2000-05-17 22:16:05 +1000302 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000303
Damien Miller1f335fb2000-06-26 11:31:33 +1000304 disable_shadow=yes
305
Damien Miller7b22d652000-06-18 14:07:04 +1000306 PAM_MSG="yes"
307
Damien Millera22ba012000-03-02 23:09:20 +1100308 # Check PAM strerror arguments (old PAM)
309 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
310 AC_TRY_COMPILE(
311 [
Damien Miller81171112000-04-23 11:14:01 +1000312#include <stdlib.h>
313#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100314 ],
315 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
316 [AC_MSG_RESULT(no)],
317 [
318 AC_DEFINE(HAVE_OLD_PAM)
319 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000320 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100321 ]
322 )
323fi
324
325# The big search for OpenSSL
326AC_ARG_WITH(ssl-dir,
327 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
328 [
329 if test "x$withval" != "$xno" ; then
330 tryssldir=$withval
331 fi
332 ]
333)
334
335saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100336saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100337saved_CFLAGS="$CFLAGS"
338if test "x$prefix" != "xNONE" ; then
339 tryssldir="$tryssldir $prefix"
340fi
Damien Miller61e50f12000-05-08 20:49:37 +1000341AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100342
Damien Millera1b61e12000-09-16 17:02:16 +1100343 for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
Damien Miller61e50f12000-05-08 20:49:37 +1000344 if test ! -z "$ssldir" ; then
345 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
346 CFLAGS="$saved_CFLAGS -I$ssldir/include"
347 if test ! -z "$need_dash_r" ; then
348 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
349 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100350 else
Damien Miller61e50f12000-05-08 20:49:37 +1000351 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100352 fi
353
Damien Miller3b512e12000-05-17 23:29:18 +1000354 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000355
Damien Miller3b512e12000-05-17 23:29:18 +1000356 # Basic test to check for compatible version and correct linking
357 # *does not* test for RSA - that comes later.
358 AC_TRY_RUN(
359 [
Damien Millere59ce622000-05-01 20:54:17 +1000360#include <string.h>
361#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000362int main(void)
363{
Damien Miller3b512e12000-05-17 23:29:18 +1000364 char a[2048];
365 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000366 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000367 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000368}
Damien Miller3b512e12000-05-17 23:29:18 +1000369 ],
370 [
371 found_crypto=1
372 break;
373 ], []
374 )
Damien Miller61e50f12000-05-08 20:49:37 +1000375
376 if test ! -z "$found_crypto" ; then
377 break;
378 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100379 done
380
Damien Miller61e50f12000-05-08 20:49:37 +1000381 if test -z "$found_crypto" ; then
382 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100383 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000384 if test -z "$ssldir" ; then
385 ssldir="(system)"
386 fi
Damien Millera22ba012000-03-02 23:09:20 +1100387
Damien Miller61e50f12000-05-08 20:49:37 +1000388 ac_cv_openssldir=$ssldir
389])
390
Damien Milleredb82922000-06-20 13:25:52 +1000391if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000392 AC_DEFINE(HAVE_OPENSSL)
393 dnl Need to recover ssldir - test above runs in subshell
394 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100395 CFLAGS="$saved_CFLAGS -I$ssldir/include"
396 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
397 if test ! -z "$need_dash_r" ; then
398 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100399 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100400 if test ! -z "$blibpath" ; then
401 blibpath="$blibpath:$ssldir:$ssldir/lib"
402 fi
Damien Millera22ba012000-03-02 23:09:20 +1100403fi
Damien Miller3b512e12000-05-17 23:29:18 +1000404LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000405
Damien Miller3b512e12000-05-17 23:29:18 +1000406# Now test RSA support
407saved_LIBS="$LIBS"
408AC_MSG_CHECKING([for RSA support])
409for WANTS_RSAREF in "" 1 ; do
410 if test -z "$WANTS_RSAREF" ; then
411 LIBS="$saved_LIBS"
412 else
413 LIBS="$saved_LIBS -lRSAglue -lrsaref"
414 fi
415 AC_TRY_RUN([
416#include <string.h>
417#include <openssl/rand.h>
418#include <openssl/rsa.h>
419#include <openssl/bn.h>
420#include <openssl/sha.h>
421int main(void)
422{
423 int num; RSA *key; static unsigned char p_in[] = "blahblah";
424 unsigned char c[256], p[256];
425 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
426 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
427 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
428 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
429}
430 ],
431 [
432 rsa_works=1
433 break;
434 ], [])
435done
436
437if test ! -z "$no_rsa" ; then
438 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000439 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000440else
441 if test -z "$rsa_works" ; then
442 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000443 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000444 else
445 if test -z "$WANTS_RSAREF" ; then
446 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000447 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000448 else
Damien Miller7b22d652000-06-18 14:07:04 +1000449 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000450 AC_MSG_RESULT(using RSAref)
451 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
452 fi
453 fi
454fi
Damien Millera22ba012000-03-02 23:09:20 +1100455
456# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100457AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100458AC_CHECK_SIZEOF(short int, 2)
459AC_CHECK_SIZEOF(int, 4)
460AC_CHECK_SIZEOF(long int, 4)
461AC_CHECK_SIZEOF(long long int, 8)
462
Damien Millera22ba012000-03-02 23:09:20 +1100463# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100464AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
465 AC_TRY_COMPILE(
466 [ #include <sys/types.h> ],
467 [ u_int a; a = 1;],
468 [ ac_cv_have_u_int="yes" ],
469 [ ac_cv_have_u_int="no" ]
470 )
471])
472if test "x$ac_cv_have_u_int" = "xyes" ; then
473 AC_DEFINE(HAVE_U_INT)
474 have_u_int=1
475fi
476
Damien Miller61e50f12000-05-08 20:49:37 +1000477AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
478 AC_TRY_COMPILE(
479 [ #include <sys/types.h> ],
480 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
481 [ ac_cv_have_intxx_t="yes" ],
482 [ ac_cv_have_intxx_t="no" ]
483 )
484])
485if test "x$ac_cv_have_intxx_t" = "xyes" ; then
486 AC_DEFINE(HAVE_INTXX_T)
487 have_intxx_t=1
488fi
489
Damien Miller578783e2000-09-23 14:12:24 +1100490AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
491 AC_TRY_COMPILE(
492 [ #include <sys/types.h> ],
493 [ int64_t a; a = 1;],
494 [ ac_cv_have_int64_t="yes" ],
495 [ ac_cv_have_int64_t="no" ]
496 )
497])
498if test "x$ac_cv_have_int64_t" = "xyes" ; then
499 AC_DEFINE(HAVE_INT64_T)
500 have_int64_t=1
501fi
502
Damien Miller61e50f12000-05-08 20:49:37 +1000503AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
504 AC_TRY_COMPILE(
505 [ #include <sys/types.h> ],
506 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
507 [ ac_cv_have_u_intxx_t="yes" ],
508 [ ac_cv_have_u_intxx_t="no" ]
509 )
510])
511if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
512 AC_DEFINE(HAVE_U_INTXX_T)
513 have_u_intxx_t=1
514fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100515
Damien Miller578783e2000-09-23 14:12:24 +1100516AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
517 AC_TRY_COMPILE(
518 [ #include <sys/types.h> ],
519 [ u_int64_t a; a = 1;],
520 [ ac_cv_have_u_int64_t="yes" ],
521 [ ac_cv_have_u_int64_t="no" ]
522 )
523])
524if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
525 AC_DEFINE(HAVE_U_INT64_T)
526 have_u_int64_t=1
527fi
528
Damien Milleredb82922000-06-20 13:25:52 +1000529if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
530 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100531then
532 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
533 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000534 [
535#include <sys/bitypes.h>
536 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100537 [
Damien Miller70494d12000-04-03 15:57:06 +1000538 int8_t a; int16_t b; int32_t c;
539 u_int8_t e; u_int16_t f; u_int32_t g;
540 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100541 ],
542 [
543 AC_DEFINE(HAVE_U_INTXX_T)
544 AC_DEFINE(HAVE_INTXX_T)
545 AC_MSG_RESULT(yes)
546 ],
547 [AC_MSG_RESULT(no)]
548 )
549fi
550
Damien Millerd6121d22000-03-17 23:26:46 +1100551if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000552 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
553 AC_TRY_COMPILE(
554 [
555#include <sys/types.h>
556 ],
557 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
558 [ ac_cv_have_uintxx_t="yes" ],
559 [ ac_cv_have_uintxx_t="no" ]
560 )
561 ])
562 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
563 AC_DEFINE(HAVE_UINTXX_T)
564 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100565fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100566
Damien Miller61e50f12000-05-08 20:49:37 +1000567AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
568 AC_TRY_COMPILE(
569 [
Damien Miller81171112000-04-23 11:14:01 +1000570#include <sys/types.h>
571#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000572 ],
573 [socklen_t foo; foo = 1235;],
574 [ ac_cv_have_socklen_t="yes" ],
575 [ ac_cv_have_socklen_t="no" ]
576 )
577])
578if test "x$ac_cv_have_socklen_t" = "xyes" ; then
579 AC_DEFINE(HAVE_SOCKLEN_T)
580fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100581
Damien Miller61e50f12000-05-08 20:49:37 +1000582AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
583 AC_TRY_COMPILE(
584 [
585#include <sys/types.h>
586 ],
587 [ size_t foo; foo = 1235; ],
588 [ ac_cv_have_size_t="yes" ],
589 [ ac_cv_have_size_t="no" ]
590 )
591])
592if test "x$ac_cv_have_size_t" = "xyes" ; then
593 AC_DEFINE(HAVE_SIZE_T)
594fi
Damien Miller95058511999-12-29 10:36:45 +1100595
Damien Miller615f9392000-05-17 22:53:33 +1000596AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
597 AC_TRY_COMPILE(
598 [
599#include <sys/types.h>
600 ],
601 [ ssize_t foo; foo = 1235; ],
602 [ ac_cv_have_ssize_t="yes" ],
603 [ ac_cv_have_ssize_t="no" ]
604 )
605])
606if test "x$ac_cv_have_ssize_t" = "xyes" ; then
607 AC_DEFINE(HAVE_SSIZE_T)
608fi
609
Damien Millerb54b40e2000-06-23 08:23:34 +1000610AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
611 AC_TRY_COMPILE(
612 [
613#include <sys/types.h>
614#include <sys/socket.h>
615 ],
616 [ sa_family_t foo; foo = 1235; ],
617 [ ac_cv_have_sa_family_t="yes" ],
618 [ ac_cv_have_sa_family_t="no" ]
619 )
620])
621if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
622 AC_DEFINE(HAVE_SA_FAMILY_T)
623fi
624
Damien Miller0f91b4e2000-06-18 15:43:25 +1000625AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
626 AC_TRY_COMPILE(
627 [
628#include <sys/types.h>
629 ],
630 [ pid_t foo; foo = 1235; ],
631 [ ac_cv_have_pid_t="yes" ],
632 [ ac_cv_have_pid_t="no" ]
633 )
634])
635if test "x$ac_cv_have_pid_t" = "xyes" ; then
636 AC_DEFINE(HAVE_PID_T)
637fi
638
639AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
640 AC_TRY_COMPILE(
641 [
642#include <sys/types.h>
643 ],
644 [ mode_t foo; foo = 1235; ],
645 [ ac_cv_have_mode_t="yes" ],
646 [ ac_cv_have_mode_t="no" ]
647 )
648])
649if test "x$ac_cv_have_mode_t" = "xyes" ; then
650 AC_DEFINE(HAVE_MODE_T)
651fi
652
Damien Miller61e50f12000-05-08 20:49:37 +1000653
654AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
655 AC_TRY_COMPILE(
656 [
Damien Miller81171112000-04-23 11:14:01 +1000657#include <sys/types.h>
658#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000659 ],
660 [ struct sockaddr_storage s; ],
661 [ ac_cv_have_struct_sockaddr_storage="yes" ],
662 [ ac_cv_have_struct_sockaddr_storage="no" ]
663 )
664])
665if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
666 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
667fi
Damien Miller34132e52000-01-14 15:45:46 +1100668
Damien Miller61e50f12000-05-08 20:49:37 +1000669AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
670 AC_TRY_COMPILE(
671 [
Damien Miller7b22d652000-06-18 14:07:04 +1000672#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000673#include <netinet/in.h>
674 ],
675 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
676 [ ac_cv_have_struct_sockaddr_in6="yes" ],
677 [ ac_cv_have_struct_sockaddr_in6="no" ]
678 )
679])
680if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
681 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
682fi
Damien Miller34132e52000-01-14 15:45:46 +1100683
Damien Miller61e50f12000-05-08 20:49:37 +1000684AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
685 AC_TRY_COMPILE(
686 [
Damien Miller7b22d652000-06-18 14:07:04 +1000687#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000688#include <netinet/in.h>
689 ],
690 [ struct in6_addr s; s.s6_addr[0] = 0; ],
691 [ ac_cv_have_struct_in6_addr="yes" ],
692 [ ac_cv_have_struct_in6_addr="no" ]
693 )
694])
695if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
696 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
697fi
Damien Miller34132e52000-01-14 15:45:46 +1100698
Damien Miller61e50f12000-05-08 20:49:37 +1000699AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
700 AC_TRY_COMPILE(
701 [
Damien Miller81171112000-04-23 11:14:01 +1000702#include <sys/types.h>
703#include <sys/socket.h>
704#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000705 ],
706 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
707 [ ac_cv_have_struct_addrinfo="yes" ],
708 [ ac_cv_have_struct_addrinfo="no" ]
709 )
710])
711if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
712 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
713fi
714
Damien Miller34132e52000-01-14 15:45:46 +1100715
Damien Millera22ba012000-03-02 23:09:20 +1100716# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100717
Damien Miller61e50f12000-05-08 20:49:37 +1000718OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
719OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
720OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
721OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
722OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000723OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000724OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
725OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000726OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000727OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
728OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
729OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
730OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000731OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
732OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
733OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
734OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
735
Damien Miller942da032000-08-18 13:59:06 +1000736AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
737 ac_cv_have_sun_len_in_struct_sockaddr_un, [
738 AC_TRY_COMPILE(
739 [
740#include <sys/types.h>
741#include <sys/socket.h>
742 ],
743 [ struct sockaddr_un s; s.sun_len = 1; ],
744 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
745 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
746 )
747])
748if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
749 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
750fi
751
Damien Miller61e50f12000-05-08 20:49:37 +1000752AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
753 ac_cv_have_ss_family_in_struct_ss, [
754 AC_TRY_COMPILE(
755 [
Damien Miller81171112000-04-23 11:14:01 +1000756#include <sys/types.h>
757#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000758 ],
759 [ struct sockaddr_storage s; s.ss_family = 1; ],
760 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
761 [ ac_cv_have_ss_family_in_struct_ss="no" ],
762 )
763])
764if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
765 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
766fi
767
Damien Miller61e50f12000-05-08 20:49:37 +1000768AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
769 ac_cv_have___ss_family_in_struct_ss, [
770 AC_TRY_COMPILE(
771 [
Damien Miller81171112000-04-23 11:14:01 +1000772#include <sys/types.h>
773#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000774 ],
775 [ struct sockaddr_storage s; s.__ss_family = 1; ],
776 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
777 [ ac_cv_have___ss_family_in_struct_ss="no" ]
778 )
779])
780if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
781 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
782fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100783
Damien Millerad833b32000-08-23 10:46:23 +1000784AC_CACHE_CHECK([for pw_class field in struct passwd],
785 ac_cv_have_pw_class_in_struct_passwd, [
786 AC_TRY_COMPILE(
787 [
788#include <sys/types.h>
789#include <pwd.h>
790 ],
791 [ struct passwd p s; p.pw_class = NULL; ],
792 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
793 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
794 )
795])
796if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
797 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
798fi
799
Damien Miller61e50f12000-05-08 20:49:37 +1000800
801AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
802 AC_TRY_LINK([],
803 [ extern char *__progname; printf("%s", __progname); ],
804 [ ac_cv_libc_defines___progname="yes" ],
805 [ ac_cv_libc_defines___progname="no" ]
806 )
807])
808if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
809 AC_DEFINE(HAVE___PROGNAME)
810fi
811
Damien Millera22ba012000-03-02 23:09:20 +1100812
Damien Millerecbb26d2000-07-15 14:59:14 +1000813AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
814 AC_TRY_LINK([],
815 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
816 [ ac_cv_libc_defines_sys_errlist="yes" ],
817 [ ac_cv_libc_defines_sys_errlist="no" ]
818 )
819])
820if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
821 AC_DEFINE(HAVE_SYS_ERRLIST)
822fi
823
824
Damien Miller11fa2cc2000-08-16 10:35:58 +1000825AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
826 AC_TRY_LINK([],
827 [ extern int sys_nerr; printf("%i", sys_nerr);],
828 [ ac_cv_libc_defines_sys_nerr="yes" ],
829 [ ac_cv_libc_defines_sys_nerr="no" ]
830 )
831])
832if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
833 AC_DEFINE(HAVE_SYS_NERR)
834fi
835
836
Damien Millera22ba012000-03-02 23:09:20 +1100837# Looking for programs, paths and files
838AC_ARG_WITH(rsh,
839 [ --with-rsh=PATH Specify path to remote shell program ],
840 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100841 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000842 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100843 fi
844 ],
845 [
846 AC_PATH_PROG(rsh_path, rsh)
847 ]
848)
849
850AC_ARG_WITH(xauth,
851 [ --with-xauth=PATH Specify path to xauth program ],
852 [
853 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000854 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100855 fi
856 ],
857 [
858 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000859 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100860 xauth_path="/usr/openwin/bin/xauth"
861 fi
862 ]
863)
864
865if test ! -z "$xauth_path" ; then
866 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
867fi
868if test ! -z "$rsh_path" ; then
869 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
870fi
871
872# Check for mail directory (last resort if we cannot get it from headers)
873if test ! -z "$MAIL" ; then
874 maildir=`dirname $MAIL`
875 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
876fi
877
Damien Millera22ba012000-03-02 23:09:20 +1100878if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100879 AC_CHECK_FILE("/dev/ptmx",
880 [
881 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
882 have_dev_ptmx=1
883 ]
884 )
Damien Millera22ba012000-03-02 23:09:20 +1100885fi
Damien Miller204ad072000-03-02 23:56:12 +1100886AC_CHECK_FILE("/dev/ptc",
887 [
888 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
889 have_dev_ptc=1
890 ]
891)
892
Damien Millera22ba012000-03-02 23:09:20 +1100893# Options from here on. Some of these are preset by platform above
894
Damien Millera22ba012000-03-02 23:09:20 +1100895# Check for user-specified random device, otherwise check /dev/urandom
896AC_ARG_WITH(random,
897 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
898 [
Damien Miller040f3832000-04-03 14:50:43 +1000899 if test "x$withval" != "xno" ; then
900 RANDOM_POOL="$withval";
901 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
902 fi
Damien Millera22ba012000-03-02 23:09:20 +1100903 ],
904 [
905 # Check for random device
906 AC_CHECK_FILE("/dev/urandom",
907 [
908 RANDOM_POOL="/dev/urandom";
909 AC_SUBST(RANDOM_POOL)
910 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
911 ]
912 )
913 ]
914)
915
916# Check for EGD pool file
917AC_ARG_WITH(egd-pool,
918 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
919 [
Damien Miller040f3832000-04-03 14:50:43 +1000920 if test "x$withval" != "xno" ; then
921 EGD_SOCKET="$withval";
922 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
923 fi
Damien Millera22ba012000-03-02 23:09:20 +1100924 ]
925)
926
Damien Miller0437b332000-05-02 09:56:41 +1000927# detect pathnames for entropy gathering commands, if we need them
928INSTALL_SSH_PRNG_CMDS=""
929rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000930if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000931 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000932 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
933 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
934 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
935 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
936 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
937 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
938 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
939 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
940 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
941 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
942 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
943 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
944 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
945 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
946 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000947
948 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000949fi
Damien Miller0437b332000-05-02 09:56:41 +1000950AC_SUBST(INSTALL_SSH_PRNG_CMDS)
951
Damien Miller11e37f62000-04-08 18:23:30 +1000952
Damien Miller670a4b82000-01-22 13:53:11 +1100953AC_ARG_WITH(catman,
954 [ --with-catman=man|cat Install preformatted manpages[no]],
955 [
956 MANTYPE='$(CATMAN)'
957 if test x"$withval" != x"yes" ; then
958 mansubdir=$withval
959 else
960 mansubdir=cat
961 fi
962 ], [
963 if test -z "$MANTYPE" ; then
964 MANTYPE='$(TROFFMAN)'
965 mansubdir=man
966 fi
967 ]
968)
969AC_SUBST(MANTYPE)
970AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100971
Damien Millera22ba012000-03-02 23:09:20 +1100972# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000973KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100974AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100975 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100976 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100977 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100978
979 if test "x$withval" != "$xyes" ; then
980 CFLAGS="$CFLAGS -I${withval}/include"
981 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100982 if test ! -z "$need_dash_r" ; then
983 LDFLAGS="$LDFLAGS -R${withval}/lib"
984 fi
985 if test ! -z "$blibpath" ; then
986 blibpath="$blibpath:${withval}/lib"
987 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100988 else
989 if test -d /usr/include/kerberosIV ; then
990 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
991 fi
992 fi
993
994 AC_CHECK_HEADERS(krb.h)
995 AC_CHECK_LIB(krb, main)
996 if test "$ac_cv_header_krb_h" != yes; then
997 AC_MSG_WARN([Cannot find krb.h, build may fail])
998 fi
999 if test "$ac_cv_lib_krb_main" != yes; then
1000 AC_MSG_WARN([Cannot find libkrb, build may fail])
1001 fi
1002
Damien Millerc85f9b42000-01-29 10:20:21 +11001003 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001004 AC_CHECK_LIB(resolv, dn_expand, , )
1005 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001006 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001007 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001008 fi
Damien Miller80297751999-11-19 13:03:25 +11001009 ]
1010)
1011
Damien Millera22ba012000-03-02 23:09:20 +11001012# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001013AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001014AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001015 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001016 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001017 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001018
1019 if test "x$withval" != "$xyes" ; then
1020 CFLAGS="$CFLAGS -I${withval}/include"
1021 LFLAGS="$LFLAGS -L${withval}/lib"
1022 fi
1023
1024 if test -z "$KRB4" ; then
1025 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1026 fi
1027
Damien Miller8bdeee21999-12-30 15:50:54 +11001028 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001029 if test ! -z "$AFS_LIBS" ; then
1030 LIBS="$LIBS $AFS_LIBS"
1031 fi
1032 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001033 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001034 fi
Damien Miller80297751999-11-19 13:03:25 +11001035 ]
1036)
Damien Millerc85f9b42000-01-29 10:20:21 +11001037LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001038
Damien Millera22ba012000-03-02 23:09:20 +11001039# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001040SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001041AC_ARG_WITH(skey,
1042 [ --with-skey Enable S/Key support],
1043 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001044 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001045 AC_DEFINE(SKEY)
1046 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001047 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001048 fi
Damien Miller80297751999-11-19 13:03:25 +11001049 ]
1050)
1051
Damien Millera22ba012000-03-02 23:09:20 +11001052# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001053TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001054AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001055 [ --with-tcp-wrappers Enable tcpwrappers support],
1056 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001057 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001058 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001059 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001060 AC_MSG_CHECKING(for libwrap)
1061 AC_TRY_LINK(
1062 [
Damien Miller81171112000-04-23 11:14:01 +10001063#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001064 int deny_severity = 0, allow_severity = 0;
1065 ],
1066 [hosts_access(0);],
1067 [
1068 AC_MSG_RESULT(yes)
1069 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001070 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001071 ],
1072 [
Damien Miller7b22d652000-06-18 14:07:04 +10001073 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001074 ]
1075 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001076 fi
Damien Miller80297751999-11-19 13:03:25 +11001077 ]
1078)
1079
Damien Millera22ba012000-03-02 23:09:20 +11001080# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001081MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001082AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001083 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001084 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001085 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001086 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001087 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001088 fi
1089 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001090)
1091
Damien Millera22ba012000-03-02 23:09:20 +11001092# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001093AC_ARG_WITH(shadow,
1094 [ --without-shadow Disable shadow password support],
1095 [
1096 if test "x$withval" = "xno" ; then
1097 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001098 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001099 fi
1100 ]
1101)
1102
Damien Miller1f335fb2000-06-26 11:31:33 +10001103if test -z "$disable_shadow" ; then
1104 AC_MSG_CHECKING([if the systems has expire shadow information])
1105 AC_TRY_COMPILE(
1106 [
1107#include <sys/types.h>
1108#include <shadow.h>
1109 struct spwd sp;
1110 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1111 [ sp_expire_available=yes ], []
1112 )
1113
1114 if test "x$sp_expire_available" = "xyes" ; then
1115 AC_MSG_RESULT(yes)
1116 AC_DEFINE(HAS_SHADOW_EXPIRE)
1117 else
1118 AC_MSG_RESULT(no)
1119 fi
1120fi
1121
Damien Millera22ba012000-03-02 23:09:20 +11001122# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001123if test ! -z "$IPADDR_IN_DISPLAY" ; then
1124 DISPLAY_HACK_MSG="yes"
1125 AC_DEFINE(IPADDR_IN_DISPLAY)
1126else
1127 DISPLAY_HACK_MSG="no"
1128 AC_ARG_WITH(ipaddr-display,
1129 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1130 [
1131 if test "x$withval" != "xno" ; then
1132 AC_DEFINE(IPADDR_IN_DISPLAY)
1133 DISPLAY_HACK_MSG="yes"
1134 fi
1135 ]
1136 )
1137fi
Damien Miller76112de1999-12-21 11:18:08 +11001138
Damien Millera22ba012000-03-02 23:09:20 +11001139# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001140SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001141AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001142 [ --with-default-path=PATH Specify default \$PATH environment for server],
1143 [
1144 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001145 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001146 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001147 fi
1148 ]
1149)
1150
Damien Millera22ba012000-03-02 23:09:20 +11001151# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001152IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001153AC_ARG_WITH(ipv4-default,
1154 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1155 [
1156 if test "x$withval" != "xno" ; then
1157 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001158 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001159 fi
1160 ]
1161)
1162
Damien Miller61e50f12000-05-08 20:49:37 +10001163AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001164IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001165AC_ARG_WITH(4in6,
1166 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1167 [
1168 if test "x$withval" != "xno" ; then
1169 AC_MSG_RESULT(yes)
1170 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001171 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001172 else
1173 AC_MSG_RESULT(no)
1174 fi
1175 ],[
1176 if test "x$inet6_default_4in6" = "xyes"; then
1177 AC_MSG_RESULT([yes (default)])
1178 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001179 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001180 else
1181 AC_MSG_RESULT([no (default)])
1182 fi
1183 ]
1184)
1185
Damien Millera22ba012000-03-02 23:09:20 +11001186# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001187piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001188AC_ARG_WITH(pid-dir,
1189 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1190 [
1191 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001192 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001193 fi
1194 ]
1195)
Damien Miller4018c192000-04-30 09:30:44 +10001196
Damien Millerdbd250f2000-01-18 08:57:14 +11001197AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001198AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001199
andre2ff7b5d2000-06-03 14:57:40 +00001200dnl allow user to disable some login recording features
1201AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001202 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001203 [ AC_DEFINE(DISABLE_LASTLOG) ]
1204)
1205AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001206 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001207 [ AC_DEFINE(DISABLE_UTMP) ]
1208)
1209AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001210 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001211 [ AC_DEFINE(DISABLE_UTMPX) ]
1212)
1213AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001214 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001215 [ AC_DEFINE(DISABLE_WTMP) ]
1216)
1217AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001218 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001219 [ AC_DEFINE(DISABLE_WTMPX) ]
1220)
1221AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001222 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001223 [ AC_DEFINE(DISABLE_LOGIN) ]
1224)
1225AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001226 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001227 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1228)
1229AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001230 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001231 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1232)
1233AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001234 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001235 [ conf_lastlog_location="$withval"; ],)
1236
1237dnl lastlog, [uw]tmpx? detection
1238dnl NOTE: set the paths in the platform section to avoid the
1239dnl need for command-line parameters
1240dnl lastlog and [uw]tmp are subject to a file search if all else fails
1241
1242dnl lastlog detection
1243dnl NOTE: the code itself will detect if lastlog is a directory
1244AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1245AC_TRY_COMPILE([
1246#include <sys/types.h>
1247#include <utmp.h>
1248#ifdef HAVE_LASTLOG_H
1249# include <lastlog.h>
1250#endif
Damien Miller2994e082000-06-04 15:51:47 +10001251#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001252# include <paths.h>
1253#endif
1254 ],
1255 [ char *lastlog = LASTLOG_FILE; ],
1256 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001257 [
1258 AC_MSG_RESULT(no)
1259 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1260 AC_TRY_COMPILE([
1261#include <sys/types.h>
1262#include <utmp.h>
1263#ifdef HAVE_LASTLOG_H
1264# include <lastlog.h>
1265#endif
1266#ifdef HAVE_PATHS_H
1267# include <paths.h>
1268#endif
1269 ],
1270 [ char *lastlog = _PATH_LASTLOG; ],
1271 [ AC_MSG_RESULT(yes) ],
1272 [
andree441aa32000-06-12 22:34:38 +00001273 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001274 system_lastlog_path=no
1275 ])
1276 ]
andre2ff7b5d2000-06-03 14:57:40 +00001277)
Damien Miller2994e082000-06-04 15:51:47 +10001278
andre2ff7b5d2000-06-03 14:57:40 +00001279if test -z "$conf_lastlog_location"; then
1280 if test x"$system_lastlog_path" = x"no" ; then
1281 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001282 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001283 conf_lastlog_location=$f
1284 fi
1285 done
1286 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001287 AC_MSG_WARN([** Cannot find lastlog **])
1288 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001289 fi
1290 fi
1291fi
1292
1293if test -n "$conf_lastlog_location"; then
1294 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1295fi
1296
1297dnl utmp detection
1298AC_MSG_CHECKING([if your system defines UTMP_FILE])
1299AC_TRY_COMPILE([
1300#include <sys/types.h>
1301#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001302#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001303# include <paths.h>
1304#endif
1305 ],
1306 [ char *utmp = UTMP_FILE; ],
1307 [ AC_MSG_RESULT(yes) ],
1308 [ AC_MSG_RESULT(no)
1309 system_utmp_path=no ]
1310)
1311if test -z "$conf_utmp_location"; then
1312 if test x"$system_utmp_path" = x"no" ; then
1313 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1314 if test -f $f ; then
1315 conf_utmp_location=$f
1316 fi
1317 done
1318 if test -z "$conf_utmp_location"; then
1319 AC_DEFINE(DISABLE_UTMP)
1320 fi
1321 fi
1322fi
1323if test -n "$conf_utmp_location"; then
1324 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1325fi
1326
1327dnl wtmp detection
1328AC_MSG_CHECKING([if your system defines WTMP_FILE])
1329AC_TRY_COMPILE([
1330#include <sys/types.h>
1331#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001332#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001333# include <paths.h>
1334#endif
1335 ],
1336 [ char *wtmp = WTMP_FILE; ],
1337 [ AC_MSG_RESULT(yes) ],
1338 [ AC_MSG_RESULT(no)
1339 system_wtmp_path=no ]
1340)
1341if test -z "$conf_wtmp_location"; then
1342 if test x"$system_wtmp_path" = x"no" ; then
1343 for f in /usr/adm/wtmp /var/log/wtmp; do
1344 if test -f $f ; then
1345 conf_wtmp_location=$f
1346 fi
1347 done
1348 if test -z "$conf_wtmp_location"; then
1349 AC_DEFINE(DISABLE_WTMP)
1350 fi
1351 fi
1352fi
1353if test -n "$conf_wtmp_location"; then
1354 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1355fi
1356
1357
1358dnl utmpx detection - I don't know any system so perverse as to require
1359dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1360dnl there, though.
1361AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1362AC_TRY_COMPILE([
1363#include <sys/types.h>
1364#include <utmp.h>
1365#ifdef HAVE_UTMPX_H
1366#include <utmpx.h>
1367#endif
Damien Miller2994e082000-06-04 15:51:47 +10001368#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001369# include <paths.h>
1370#endif
1371 ],
1372 [ char *utmpx = UTMPX_FILE; ],
1373 [ AC_MSG_RESULT(yes) ],
1374 [ AC_MSG_RESULT(no)
1375 system_utmpx_path=no ]
1376)
1377if test -z "$conf_utmpx_location"; then
1378 if test x"$system_utmpx_path" = x"no" ; then
1379 AC_DEFINE(DISABLE_UTMPX)
1380 fi
1381else
1382 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1383fi
1384
1385dnl wtmpx detection
1386AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1387AC_TRY_COMPILE([
1388#include <sys/types.h>
1389#include <utmp.h>
1390#ifdef HAVE_UTMPX_H
1391#include <utmpx.h>
1392#endif
Damien Miller2994e082000-06-04 15:51:47 +10001393#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001394# include <paths.h>
1395#endif
1396 ],
1397 [ char *wtmpx = WTMPX_FILE; ],
1398 [ AC_MSG_RESULT(yes) ],
1399 [ AC_MSG_RESULT(no)
1400 system_wtmpx_path=no ]
1401)
1402if test -z "$conf_wtmpx_location"; then
1403 if test x"$system_wtmpx_path" = x"no" ; then
1404 AC_DEFINE(DISABLE_WTMPX)
1405 fi
1406else
1407 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1408fi
1409
Damien Miller4018c192000-04-30 09:30:44 +10001410
1411# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001412entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001413AC_ARG_WITH(entropy-timeout,
1414 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1415 [
1416 if test "x$withval" != "xno" ; then
1417 entropy_timeout=$withval
1418 fi
1419 ]
1420)
1421AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1422
1423
Damien Miller29ea30d2000-03-17 10:54:15 +11001424if test ! -z "$blibpath" ; then
1425 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1426 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1427fi
1428
Damien Millerbac2d8a2000-09-05 16:13:06 +11001429AC_EXEEXT
1430
Damien Miller0437b332000-05-02 09:56:41 +10001431AC_OUTPUT(Makefile ssh_prng_cmds)
1432
Damien Miller7b22d652000-06-18 14:07:04 +10001433# Print summary of options
1434
1435if test x$MANTYPE = x'$(CATMAN)' ; then
1436 MAN_MSG=cat
1437else
1438 MAN_MSG=man
1439fi
1440if test ! -z "$RANDOM_POOL" ; then
1441 RAND_MSG="Device ($RANDOM_POOL)"
1442else
1443 if test ! -z "$EGD_SOCKET" ; then
1444 RAND_MSG="EGD ($EGD_SOCKET)"
1445 else
1446 RAND_MSG="Builtin (timeout $entropy_timeout)"
1447 fi
1448fi
1449
1450# Someone please show me a better way :)
1451A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1452B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1453C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1454D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1455E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1456F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1457G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1458
1459echo ""
1460echo "OpenSSH configured has been configured with the following options."
1461echo " User binaries: $B"
1462echo " System binaries: $C"
1463echo " Configuration files: $D"
1464echo " Askpass program: $E"
1465echo " Manual pages: $F"
1466echo " PID file: $G"
1467echo " Random number collection: $RAND_MSG"
1468echo " Manpage format: $MAN_MSG"
1469echo " PAM support: ${PAM_MSG}"
1470echo " KerberosIV support: $KRB4_MSG"
1471echo " AFS support: $AFS_MSG"
1472echo " S/KEY support: $SKEY_MSG"
1473echo " TCP Wrappers support: $TCPW_MSG"
1474echo " MD5 password support: $MD5_MSG"
1475echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1476echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1477echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1478
1479echo ""
1480
1481echo "Compiler flags: ${CFLAGS}"
1482echo "Linker flags: ${LDFLAGS}"
1483echo "Libraries: ${LIBS}"
1484
1485echo ""
1486