blob: 7ff324bb068d1beb2e9420f5c98e726af216c8ce [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 Miller78315eb2000-09-29 23:01:36 +110016AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller2e1b0821999-12-25 10:11:29 +110017
Damien Millerad833b32000-08-23 10:46:23 +100018# Use LOGIN_PROGRAM from environment if possible
19if test ! -z "$LOGIN_PROGRAM" ; then
20 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
21else
22 # Search for login
23 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
24 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
25 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
26 fi
27fi
28
Damien Miller166bd442000-03-16 10:48:25 +110029if test -z "$LD" ; then
30 LD=$CC
31fi
32AC_SUBST(LD)
33
34# C Compiler features
35AC_C_INLINE
36if test "$GCC" = "yes"; then
37 CFLAGS="$CFLAGS -Wall"
38fi
39
Damien Miller78315eb2000-09-29 23:01:36 +110040CFLAGS="$CFLAGS -I. -I${srcdir-.}"
41
Damien Millera22ba012000-03-02 23:09:20 +110042# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110043case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110044*-*-aix*)
45 AFS_LIBS="-lld"
Damien Millerdb819592000-03-14 13:44:01 +110046 CFLAGS="$CFLAGS -I/usr/local/include"
47 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100048 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110049 blibpath="/usr/lib:/lib:/usr/local/lib"
50 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100051 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110052 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000053 MANTYPE='$(CATMAN)'
54 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000055 dnl AIX handles lastlog as part of its login message
56 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100057 MANTYPE='$(CATMAN)'
58 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110059 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110060*-*-cygwin*)
61 LIBS="$LIBS /usr/lib/textmode.o"
62 AC_DEFINE(HAVE_CYGWIN)
63 AC_DEFINE(DISABLE_PAM)
64 AC_DEFINE(DISABLE_SHADOW)
65 AC_DEFINE(IPV4_DEFAULT)
66 AC_DEFINE(IP_TOS_IS_BROKEN)
67 AC_DEFINE(BROKEN_VHANGUP)
68 no_pam=1
69 no_libsocket=1
70 no_libnsl=1
71 ;;
Damien Miller76112de1999-12-21 11:18:08 +110072*-*-hpux10*)
73 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100074 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110075 fi
76 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110077 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100078 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110079 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110080 AC_DEFINE(DISABLE_UTMP)
Damien Miller8a1e6a62000-09-16 15:55:52 +110081 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110082 MANTYPE='$(CATMAN)'
83 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110084 ;;
Damien Miller1bead332000-04-30 00:47:29 +100085*-*-hpux11*)
Damien Miller1bead332000-04-30 00:47:29 +100086 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110087 IPADDR_IN_DISPLAY=yes
Damien Miller5552d7a2000-08-30 09:53:24 +110088 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110089 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110090 AC_DEFINE(DISABLE_UTMP)
Damien Miller8a1e6a62000-09-16 15:55:52 +110091 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +100092 MANTYPE='$(CATMAN)'
93 mansubdir=cat
94 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110095*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110096 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100097 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +110098 PATH="$PATH:/usr/etc"
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 Miller190d5a82000-09-30 09:43:19 +1100107 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100108 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000109 AC_DEFINE(WITH_IRIX_ARRAY)
110 AC_DEFINE(WITH_IRIX_PROJECT)
111 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100112 no_libsocket=1
113 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000114 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100115 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100116*-*-linux*)
117 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100118 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000119 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100120 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100121 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100122*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100123 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100124 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000125*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000126 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100127 conf_utmp_location=/etc/utmp
128 conf_wtmp_location=/usr/adm/wtmp
129 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000130 AC_DEFINE(HAVE_NEXT)
131 CFLAGS="$CFLAGS -I/usr/local/include"
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 Miller78315eb2000-09-29 23:01:36 +1100167*-*-sysv4.2*)
168 CFLAGS="$CFLAGS -I/usr/local/include"
169 LDFLAGS="$LDFLAGS -L/usr/local/lib"
170 MANTYPE='$(CATMAN)'
171 mansubdir=cat
172 LIBS="$LIBS -lgen -lsocket -lnsl -lresolv"
173 enable_suid_ssh=no
174 ;;
175*-*-sysv5*)
176 CFLAGS="$CFLAGS -I/usr/local/include"
177 LDFLAGS="$LDFLAGS -L/usr/local/lib"
178 MANTYPE='$(CATMAN)'
179 mansubdir=cat
180 LIBS="$LIBS -lgen -lsocket"
181 enable_suid_ssh=no
182 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100183*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100184 CFLAGS="$CFLAGS -I/usr/local/include"
185 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100186 MANTYPE='$(CATMAN)'
187 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100188 LIBS="$LIBS -lgen -lsocket"
189 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100190*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100191 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100192 CFLAGS="$CFLAGS -Dftruncate=chsize -I/usr/local/include"
193 LDFLAGS="$LDFLAGS -L/usr/local/lib"
194 MANTYPE='$(CATMAN)'
195 mansubdir=cat
196 LIBS="$LIBS -lgen -lsocket -los -lprot -lx"
197 no_dev_ptmx=1
198 RANLIB=true
199 AC_DEFINE(BROKEN_SYS_TERMIO_H)
200 rsh_path="/usr/bin/rcmd"
201 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
202 ;;
203*-*-sco3.2v5*)
Damien Millera66626b2000-06-13 18:57:53 +1000204 CFLAGS="$CFLAGS -I/usr/local/include"
205 LDFLAGS="$LDFLAGS -L/usr/local/lib"
206 MANTYPE='$(CATMAN)'
207 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100208 LIBS="$LIBS -lgen -lsocket -lprot -lx"
Damien Millera66626b2000-06-13 18:57:53 +1000209 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100210 rsh_path="/usr/bin/rcmd"
211 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Damien Millera66626b2000-06-13 18:57:53 +1000212 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000213*-dec-osf*)
214# This is untested
215 if test ! -z "USE_SIA" ; then
216 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
217 if test -f /etc/sia/matrix.conf; then
218 AC_MSG_RESULT(yes)
219 AC_DEFINE(HAVE_OSF_SIA)
220 AC_DEFINE(DISABLE_LOGIN)
221 LIBS="$LIBS -lsecurity -ldb -lm -laud"
222 else
223 AC_MSG_RESULT(no)
224 fi
225 fi
226 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100227esac
228
Damien Millere37bfc12000-06-05 09:37:43 +1000229# Allow user to specify flags
230AC_ARG_WITH(cflags,
231 [ --with-cflags Specify additional flags to pass to compiler],
232 [
233 if test "x$withval" != "xno" ; then
234 CFLAGS="$CFLAGS $withval"
235 fi
236 ]
237)
238AC_ARG_WITH(ldflags,
239 [ --with-ldlags Specify additional flags to pass to linker],
240 [
241 if test "x$withval" != "xno" ; then
242 LDFLAGS="$LDFLAGS $withval"
243 fi
244 ]
245)
246AC_ARG_WITH(libs,
247 [ --with-libs Specify additional libraries to link with],
248 [
249 if test "x$withval" != "xno" ; then
250 LIBS="$LIBS $withval"
251 fi
252 ]
253)
254
255
Damien Millera22ba012000-03-02 23:09:20 +1100256# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100257AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
258AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100259
Damien Millerbeb4ba51999-12-28 15:09:35 +1100260if test -z "$no_libsocket" ; then
261 AC_CHECK_LIB(nsl, yp_match, , )
262fi
263if test -z "$no_libnsl" ; then
264 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100265fi
Damien Millerab18c411999-11-11 10:40:23 +1100266
Damien Millera22ba012000-03-02 23:09:20 +1100267# Checks for header files.
Damien Miller874d77b2000-10-14 16:23:11 +1100268AC_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 sys/un.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h vis.h)
Damien Millerab18c411999-11-11 10:40:23 +1100269
Damien Millerad833b32000-08-23 10:46:23 +1000270dnl Checks for library functions.
Damien Miller874d77b2000-10-14 16:23:11 +1100271AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod 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 setrlimit sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r vsnprintf vhangup vis _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000272dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000273AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000274dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000275AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000276dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000277AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
278AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000279dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000280AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
281AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100282
Damien Miller5fc85652000-07-09 23:53:07 +1000283AC_CHECK_FUNC(getuserattr,
284 [AC_DEFINE(HAVE_GETUSERATTR)],
285 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
286)
287
Damien Miller04f80141999-11-19 15:32:34 +1100288AC_CHECK_FUNC(login,
289 [AC_DEFINE(HAVE_LOGIN)],
290 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
291)
292
293AC_CHECK_FUNC(daemon,
294 [AC_DEFINE(HAVE_DAEMON)],
295 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
296)
297
Damien Miller9fb07e42000-03-05 16:22:59 +1100298AC_CHECK_FUNC(getpagesize,
299 [AC_DEFINE(HAVE_GETPAGESIZE)],
300 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
301)
302
Damien Millercb170cb2000-07-01 16:52:55 +1000303# Check for broken snprintf
304if test "x$ac_cv_func_snprintf" = "xyes" ; then
305 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
306 AC_TRY_RUN(
307 [
308#include <stdio.h>
309int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
310 ],
311 [AC_MSG_RESULT(yes)],
312 [
313 AC_MSG_RESULT(no)
314 AC_DEFINE(BROKEN_SNPRINTF)
315 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
316 ]
317 )
318fi
319
Damien Miller606f8802000-09-16 15:39:56 +1100320AC_FUNC_GETPGRP
321
Damien Miller7b22d652000-06-18 14:07:04 +1000322PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100323AC_ARG_WITH(pam,
324 [ --without-pam Disable PAM support ],
325 [
326 if test "x$withval" = "xno" ; then
327 no_pam=1
328 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000329 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100330 fi
331 ]
332)
Damien Milleredb82922000-06-20 13:25:52 +1000333if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100334 AC_CHECK_LIB(dl, dlopen, , )
335 LIBS="$LIBS -lpam"
336
Damien Miller0e65eed2000-05-17 22:16:05 +1000337 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000338
Damien Miller1f335fb2000-06-26 11:31:33 +1000339 disable_shadow=yes
340
Damien Miller7b22d652000-06-18 14:07:04 +1000341 PAM_MSG="yes"
342
Damien Millera22ba012000-03-02 23:09:20 +1100343 # Check PAM strerror arguments (old PAM)
344 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
345 AC_TRY_COMPILE(
346 [
Damien Miller81171112000-04-23 11:14:01 +1000347#include <stdlib.h>
348#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100349 ],
350 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
351 [AC_MSG_RESULT(no)],
352 [
353 AC_DEFINE(HAVE_OLD_PAM)
354 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000355 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100356 ]
357 )
358fi
359
360# The big search for OpenSSL
361AC_ARG_WITH(ssl-dir,
362 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
363 [
364 if test "x$withval" != "$xno" ; then
365 tryssldir=$withval
366 fi
367 ]
368)
369
370saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100371saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100372saved_CFLAGS="$CFLAGS"
373if test "x$prefix" != "xNONE" ; then
374 tryssldir="$tryssldir $prefix"
375fi
Damien Miller61e50f12000-05-08 20:49:37 +1000376AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100377
Damien Millera1b61e12000-09-16 17:02:16 +1100378 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 +1000379 if test ! -z "$ssldir" ; then
380 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
381 CFLAGS="$saved_CFLAGS -I$ssldir/include"
382 if test ! -z "$need_dash_r" ; then
383 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
384 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100385 else
Damien Miller61e50f12000-05-08 20:49:37 +1000386 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100387 fi
388
Damien Miller3b512e12000-05-17 23:29:18 +1000389 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000390
Damien Miller3b512e12000-05-17 23:29:18 +1000391 # Basic test to check for compatible version and correct linking
392 # *does not* test for RSA - that comes later.
393 AC_TRY_RUN(
394 [
Damien Millere59ce622000-05-01 20:54:17 +1000395#include <string.h>
396#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000397int main(void)
398{
Damien Miller3b512e12000-05-17 23:29:18 +1000399 char a[2048];
400 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000401 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000402 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000403}
Damien Miller3b512e12000-05-17 23:29:18 +1000404 ],
405 [
406 found_crypto=1
407 break;
408 ], []
409 )
Damien Miller61e50f12000-05-08 20:49:37 +1000410
411 if test ! -z "$found_crypto" ; then
412 break;
413 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100414 done
415
Damien Miller61e50f12000-05-08 20:49:37 +1000416 if test -z "$found_crypto" ; then
417 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100418 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000419 if test -z "$ssldir" ; then
420 ssldir="(system)"
421 fi
Damien Millera22ba012000-03-02 23:09:20 +1100422
Damien Miller61e50f12000-05-08 20:49:37 +1000423 ac_cv_openssldir=$ssldir
424])
425
Damien Milleredb82922000-06-20 13:25:52 +1000426if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000427 AC_DEFINE(HAVE_OPENSSL)
428 dnl Need to recover ssldir - test above runs in subshell
429 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100430 CFLAGS="$saved_CFLAGS -I$ssldir/include"
431 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
432 if test ! -z "$need_dash_r" ; then
433 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100434 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100435 if test ! -z "$blibpath" ; then
436 blibpath="$blibpath:$ssldir:$ssldir/lib"
437 fi
Damien Millera22ba012000-03-02 23:09:20 +1100438fi
Damien Miller3b512e12000-05-17 23:29:18 +1000439LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000440
Damien Miller3b512e12000-05-17 23:29:18 +1000441# Now test RSA support
442saved_LIBS="$LIBS"
443AC_MSG_CHECKING([for RSA support])
444for WANTS_RSAREF in "" 1 ; do
445 if test -z "$WANTS_RSAREF" ; then
446 LIBS="$saved_LIBS"
447 else
448 LIBS="$saved_LIBS -lRSAglue -lrsaref"
449 fi
450 AC_TRY_RUN([
451#include <string.h>
452#include <openssl/rand.h>
453#include <openssl/rsa.h>
454#include <openssl/bn.h>
455#include <openssl/sha.h>
456int main(void)
457{
458 int num; RSA *key; static unsigned char p_in[] = "blahblah";
459 unsigned char c[256], p[256];
460 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
461 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
462 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
463 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
464}
465 ],
466 [
467 rsa_works=1
468 break;
469 ], [])
470done
471
472if test ! -z "$no_rsa" ; then
473 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000474 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000475else
476 if test -z "$rsa_works" ; then
477 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000478 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000479 else
480 if test -z "$WANTS_RSAREF" ; then
481 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000482 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000483 else
Damien Miller7b22d652000-06-18 14:07:04 +1000484 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000485 AC_MSG_RESULT(using RSAref)
486 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
487 fi
488 fi
489fi
Damien Millera22ba012000-03-02 23:09:20 +1100490
491# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100492AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100493AC_CHECK_SIZEOF(short int, 2)
494AC_CHECK_SIZEOF(int, 4)
495AC_CHECK_SIZEOF(long int, 4)
496AC_CHECK_SIZEOF(long long int, 8)
497
Damien Millera22ba012000-03-02 23:09:20 +1100498# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100499AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
500 AC_TRY_COMPILE(
501 [ #include <sys/types.h> ],
502 [ u_int a; a = 1;],
503 [ ac_cv_have_u_int="yes" ],
504 [ ac_cv_have_u_int="no" ]
505 )
506])
507if test "x$ac_cv_have_u_int" = "xyes" ; then
508 AC_DEFINE(HAVE_U_INT)
509 have_u_int=1
510fi
511
Damien Miller61e50f12000-05-08 20:49:37 +1000512AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
513 AC_TRY_COMPILE(
514 [ #include <sys/types.h> ],
515 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
516 [ ac_cv_have_intxx_t="yes" ],
517 [ ac_cv_have_intxx_t="no" ]
518 )
519])
520if test "x$ac_cv_have_intxx_t" = "xyes" ; then
521 AC_DEFINE(HAVE_INTXX_T)
522 have_intxx_t=1
523fi
524
Damien Miller578783e2000-09-23 14:12:24 +1100525AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
526 AC_TRY_COMPILE(
527 [ #include <sys/types.h> ],
528 [ int64_t a; a = 1;],
529 [ ac_cv_have_int64_t="yes" ],
530 [ ac_cv_have_int64_t="no" ]
531 )
532])
533if test "x$ac_cv_have_int64_t" = "xyes" ; then
534 AC_DEFINE(HAVE_INT64_T)
535 have_int64_t=1
536fi
537
Damien Miller61e50f12000-05-08 20:49:37 +1000538AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
539 AC_TRY_COMPILE(
540 [ #include <sys/types.h> ],
541 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
542 [ ac_cv_have_u_intxx_t="yes" ],
543 [ ac_cv_have_u_intxx_t="no" ]
544 )
545])
546if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
547 AC_DEFINE(HAVE_U_INTXX_T)
548 have_u_intxx_t=1
549fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100550
Damien Miller578783e2000-09-23 14:12:24 +1100551AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
552 AC_TRY_COMPILE(
553 [ #include <sys/types.h> ],
554 [ u_int64_t a; a = 1;],
555 [ ac_cv_have_u_int64_t="yes" ],
556 [ ac_cv_have_u_int64_t="no" ]
557 )
558])
559if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
560 AC_DEFINE(HAVE_U_INT64_T)
561 have_u_int64_t=1
562fi
563
Damien Milleredb82922000-06-20 13:25:52 +1000564if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
565 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100566then
567 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
568 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000569 [
570#include <sys/bitypes.h>
571 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100572 [
Damien Miller70494d12000-04-03 15:57:06 +1000573 int8_t a; int16_t b; int32_t c;
574 u_int8_t e; u_int16_t f; u_int32_t g;
575 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100576 ],
577 [
578 AC_DEFINE(HAVE_U_INTXX_T)
579 AC_DEFINE(HAVE_INTXX_T)
580 AC_MSG_RESULT(yes)
581 ],
582 [AC_MSG_RESULT(no)]
583 )
584fi
585
Damien Millerd6121d22000-03-17 23:26:46 +1100586if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000587 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
588 AC_TRY_COMPILE(
589 [
590#include <sys/types.h>
591 ],
592 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
593 [ ac_cv_have_uintxx_t="yes" ],
594 [ ac_cv_have_uintxx_t="no" ]
595 )
596 ])
597 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
598 AC_DEFINE(HAVE_UINTXX_T)
599 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100600fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100601
Damien Miller61e50f12000-05-08 20:49:37 +1000602AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
603 AC_TRY_COMPILE(
604 [
Damien Miller81171112000-04-23 11:14:01 +1000605#include <sys/types.h>
606#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000607 ],
608 [socklen_t foo; foo = 1235;],
609 [ ac_cv_have_socklen_t="yes" ],
610 [ ac_cv_have_socklen_t="no" ]
611 )
612])
613if test "x$ac_cv_have_socklen_t" = "xyes" ; then
614 AC_DEFINE(HAVE_SOCKLEN_T)
615fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100616
Damien Miller61e50f12000-05-08 20:49:37 +1000617AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
618 AC_TRY_COMPILE(
619 [
620#include <sys/types.h>
621 ],
622 [ size_t foo; foo = 1235; ],
623 [ ac_cv_have_size_t="yes" ],
624 [ ac_cv_have_size_t="no" ]
625 )
626])
627if test "x$ac_cv_have_size_t" = "xyes" ; then
628 AC_DEFINE(HAVE_SIZE_T)
629fi
Damien Miller95058511999-12-29 10:36:45 +1100630
Damien Miller615f9392000-05-17 22:53:33 +1000631AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
632 AC_TRY_COMPILE(
633 [
634#include <sys/types.h>
635 ],
636 [ ssize_t foo; foo = 1235; ],
637 [ ac_cv_have_ssize_t="yes" ],
638 [ ac_cv_have_ssize_t="no" ]
639 )
640])
641if test "x$ac_cv_have_ssize_t" = "xyes" ; then
642 AC_DEFINE(HAVE_SSIZE_T)
643fi
644
Damien Millerb54b40e2000-06-23 08:23:34 +1000645AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
646 AC_TRY_COMPILE(
647 [
648#include <sys/types.h>
649#include <sys/socket.h>
650 ],
651 [ sa_family_t foo; foo = 1235; ],
652 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100653 [ AC_TRY_COMPILE(
654 [
655#include <sys/types.h>
656#include <sys/socket.h>
657#include <netinet/in.h>
658 ],
659 [ sa_family_t foo; foo = 1235; ],
660 [ ac_cv_have_sa_family_t="yes" ],
661
Damien Millerb54b40e2000-06-23 08:23:34 +1000662 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100663 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000664 )
665])
666if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
667 AC_DEFINE(HAVE_SA_FAMILY_T)
668fi
669
Damien Miller0f91b4e2000-06-18 15:43:25 +1000670AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
671 AC_TRY_COMPILE(
672 [
673#include <sys/types.h>
674 ],
675 [ pid_t foo; foo = 1235; ],
676 [ ac_cv_have_pid_t="yes" ],
677 [ ac_cv_have_pid_t="no" ]
678 )
679])
680if test "x$ac_cv_have_pid_t" = "xyes" ; then
681 AC_DEFINE(HAVE_PID_T)
682fi
683
684AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
685 AC_TRY_COMPILE(
686 [
687#include <sys/types.h>
688 ],
689 [ mode_t foo; foo = 1235; ],
690 [ ac_cv_have_mode_t="yes" ],
691 [ ac_cv_have_mode_t="no" ]
692 )
693])
694if test "x$ac_cv_have_mode_t" = "xyes" ; then
695 AC_DEFINE(HAVE_MODE_T)
696fi
697
Damien Miller61e50f12000-05-08 20:49:37 +1000698
699AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
700 AC_TRY_COMPILE(
701 [
Damien Miller81171112000-04-23 11:14:01 +1000702#include <sys/types.h>
703#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000704 ],
705 [ struct sockaddr_storage s; ],
706 [ ac_cv_have_struct_sockaddr_storage="yes" ],
707 [ ac_cv_have_struct_sockaddr_storage="no" ]
708 )
709])
710if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
711 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
712fi
Damien Miller34132e52000-01-14 15:45:46 +1100713
Damien Miller61e50f12000-05-08 20:49:37 +1000714AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
715 AC_TRY_COMPILE(
716 [
Damien Miller7b22d652000-06-18 14:07:04 +1000717#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000718#include <netinet/in.h>
719 ],
720 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
721 [ ac_cv_have_struct_sockaddr_in6="yes" ],
722 [ ac_cv_have_struct_sockaddr_in6="no" ]
723 )
724])
725if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
726 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
727fi
Damien Miller34132e52000-01-14 15:45:46 +1100728
Damien Miller61e50f12000-05-08 20:49:37 +1000729AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
730 AC_TRY_COMPILE(
731 [
Damien Miller7b22d652000-06-18 14:07:04 +1000732#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000733#include <netinet/in.h>
734 ],
735 [ struct in6_addr s; s.s6_addr[0] = 0; ],
736 [ ac_cv_have_struct_in6_addr="yes" ],
737 [ ac_cv_have_struct_in6_addr="no" ]
738 )
739])
740if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
741 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
742fi
Damien Miller34132e52000-01-14 15:45:46 +1100743
Damien Miller61e50f12000-05-08 20:49:37 +1000744AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
745 AC_TRY_COMPILE(
746 [
Damien Miller81171112000-04-23 11:14:01 +1000747#include <sys/types.h>
748#include <sys/socket.h>
749#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000750 ],
751 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
752 [ ac_cv_have_struct_addrinfo="yes" ],
753 [ ac_cv_have_struct_addrinfo="no" ]
754 )
755])
756if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
757 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
758fi
759
Damien Miller78315eb2000-09-29 23:01:36 +1100760dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000761OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
762OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
763OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
764OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
765OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000766OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000767OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
768OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000769OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000770OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
771OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
772OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
773OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000774OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
775OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
776OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
777OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100778AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000779
Damien Miller942da032000-08-18 13:59:06 +1000780AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
781 ac_cv_have_sun_len_in_struct_sockaddr_un, [
782 AC_TRY_COMPILE(
783 [
784#include <sys/types.h>
785#include <sys/socket.h>
786 ],
787 [ struct sockaddr_un s; s.sun_len = 1; ],
788 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
789 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
790 )
791])
792if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
793 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
794fi
795
Damien Miller61e50f12000-05-08 20:49:37 +1000796AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
797 ac_cv_have_ss_family_in_struct_ss, [
798 AC_TRY_COMPILE(
799 [
Damien Miller81171112000-04-23 11:14:01 +1000800#include <sys/types.h>
801#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000802 ],
803 [ struct sockaddr_storage s; s.ss_family = 1; ],
804 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
805 [ ac_cv_have_ss_family_in_struct_ss="no" ],
806 )
807])
808if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
809 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
810fi
811
Damien Miller61e50f12000-05-08 20:49:37 +1000812AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
813 ac_cv_have___ss_family_in_struct_ss, [
814 AC_TRY_COMPILE(
815 [
Damien Miller81171112000-04-23 11:14:01 +1000816#include <sys/types.h>
817#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000818 ],
819 [ struct sockaddr_storage s; s.__ss_family = 1; ],
820 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
821 [ ac_cv_have___ss_family_in_struct_ss="no" ]
822 )
823])
824if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
825 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
826fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100827
Damien Millerad833b32000-08-23 10:46:23 +1000828AC_CACHE_CHECK([for pw_class field in struct passwd],
829 ac_cv_have_pw_class_in_struct_passwd, [
830 AC_TRY_COMPILE(
831 [
Damien Millerad833b32000-08-23 10:46:23 +1000832#include <pwd.h>
833 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000834 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000835 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
836 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
837 )
838])
839if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
840 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
841fi
842
Damien Miller61e50f12000-05-08 20:49:37 +1000843
844AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
845 AC_TRY_LINK([],
846 [ extern char *__progname; printf("%s", __progname); ],
847 [ ac_cv_libc_defines___progname="yes" ],
848 [ ac_cv_libc_defines___progname="no" ]
849 )
850])
851if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
852 AC_DEFINE(HAVE___PROGNAME)
853fi
854
Damien Millera22ba012000-03-02 23:09:20 +1100855
Damien Millerecbb26d2000-07-15 14:59:14 +1000856AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
857 AC_TRY_LINK([],
858 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
859 [ ac_cv_libc_defines_sys_errlist="yes" ],
860 [ ac_cv_libc_defines_sys_errlist="no" ]
861 )
862])
863if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
864 AC_DEFINE(HAVE_SYS_ERRLIST)
865fi
866
867
Damien Miller11fa2cc2000-08-16 10:35:58 +1000868AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
869 AC_TRY_LINK([],
870 [ extern int sys_nerr; printf("%i", sys_nerr);],
871 [ ac_cv_libc_defines_sys_nerr="yes" ],
872 [ ac_cv_libc_defines_sys_nerr="no" ]
873 )
874])
875if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
876 AC_DEFINE(HAVE_SYS_NERR)
877fi
878
879
Damien Millera22ba012000-03-02 23:09:20 +1100880# Looking for programs, paths and files
881AC_ARG_WITH(rsh,
882 [ --with-rsh=PATH Specify path to remote shell program ],
883 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100884 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000885 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100886 fi
887 ],
888 [
889 AC_PATH_PROG(rsh_path, rsh)
890 ]
891)
892
893AC_ARG_WITH(xauth,
894 [ --with-xauth=PATH Specify path to xauth program ],
895 [
896 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000897 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100898 fi
899 ],
900 [
Damien Miller78315eb2000-09-29 23:01:36 +1100901 AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin)
Damien Milleredb82922000-06-20 13:25:52 +1000902 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100903 xauth_path="/usr/openwin/bin/xauth"
904 fi
905 ]
906)
907
908if test ! -z "$xauth_path" ; then
909 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
910fi
911if test ! -z "$rsh_path" ; then
912 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
913fi
914
915# Check for mail directory (last resort if we cannot get it from headers)
916if test ! -z "$MAIL" ; then
917 maildir=`dirname $MAIL`
918 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
919fi
920
Damien Millera22ba012000-03-02 23:09:20 +1100921if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100922 AC_CHECK_FILE("/dev/ptmx",
923 [
924 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
925 have_dev_ptmx=1
926 ]
927 )
Damien Millera22ba012000-03-02 23:09:20 +1100928fi
Damien Miller204ad072000-03-02 23:56:12 +1100929AC_CHECK_FILE("/dev/ptc",
930 [
931 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
932 have_dev_ptc=1
933 ]
934)
935
Damien Millera22ba012000-03-02 23:09:20 +1100936# Options from here on. Some of these are preset by platform above
937
Damien Millera22ba012000-03-02 23:09:20 +1100938# Check for user-specified random device, otherwise check /dev/urandom
939AC_ARG_WITH(random,
940 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
941 [
Damien Miller040f3832000-04-03 14:50:43 +1000942 if test "x$withval" != "xno" ; then
943 RANDOM_POOL="$withval";
944 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
945 fi
Damien Millera22ba012000-03-02 23:09:20 +1100946 ],
947 [
948 # Check for random device
949 AC_CHECK_FILE("/dev/urandom",
950 [
951 RANDOM_POOL="/dev/urandom";
952 AC_SUBST(RANDOM_POOL)
953 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
954 ]
955 )
956 ]
957)
958
959# Check for EGD pool file
960AC_ARG_WITH(egd-pool,
961 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
962 [
Damien Miller040f3832000-04-03 14:50:43 +1000963 if test "x$withval" != "xno" ; then
964 EGD_SOCKET="$withval";
965 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
966 fi
Damien Millera22ba012000-03-02 23:09:20 +1100967 ]
968)
969
Damien Miller0437b332000-05-02 09:56:41 +1000970# detect pathnames for entropy gathering commands, if we need them
971INSTALL_SSH_PRNG_CMDS=""
972rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000973if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000974 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000975 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
976 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
977 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
978 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
979 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
980 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
981 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
982 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
983 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
984 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
985 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
986 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
987 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
988 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
989 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000990
991 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000992fi
Damien Miller0437b332000-05-02 09:56:41 +1000993AC_SUBST(INSTALL_SSH_PRNG_CMDS)
994
Damien Miller11e37f62000-04-08 18:23:30 +1000995
Damien Miller670a4b82000-01-22 13:53:11 +1100996AC_ARG_WITH(catman,
997 [ --with-catman=man|cat Install preformatted manpages[no]],
998 [
999 MANTYPE='$(CATMAN)'
1000 if test x"$withval" != x"yes" ; then
1001 mansubdir=$withval
1002 else
1003 mansubdir=cat
1004 fi
1005 ], [
1006 if test -z "$MANTYPE" ; then
1007 MANTYPE='$(TROFFMAN)'
1008 mansubdir=man
1009 fi
1010 ]
1011)
1012AC_SUBST(MANTYPE)
1013AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001014
Damien Millera22ba012000-03-02 23:09:20 +11001015# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001016KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001017AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001018 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001019 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001020 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001021
1022 if test "x$withval" != "$xyes" ; then
1023 CFLAGS="$CFLAGS -I${withval}/include"
1024 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001025 if test ! -z "$need_dash_r" ; then
1026 LDFLAGS="$LDFLAGS -R${withval}/lib"
1027 fi
1028 if test ! -z "$blibpath" ; then
1029 blibpath="$blibpath:${withval}/lib"
1030 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001031 else
1032 if test -d /usr/include/kerberosIV ; then
1033 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
1034 fi
1035 fi
1036
1037 AC_CHECK_HEADERS(krb.h)
1038 AC_CHECK_LIB(krb, main)
1039 if test "$ac_cv_header_krb_h" != yes; then
1040 AC_MSG_WARN([Cannot find krb.h, build may fail])
1041 fi
1042 if test "$ac_cv_lib_krb_main" != yes; then
1043 AC_MSG_WARN([Cannot find libkrb, build may fail])
1044 fi
1045
Damien Millerc85f9b42000-01-29 10:20:21 +11001046 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001047 AC_CHECK_LIB(resolv, dn_expand, , )
1048 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001049 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001050 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001051 fi
Damien Miller80297751999-11-19 13:03:25 +11001052 ]
1053)
1054
Damien Millera22ba012000-03-02 23:09:20 +11001055# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001056AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001057AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001058 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001059 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001060 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001061
1062 if test "x$withval" != "$xyes" ; then
1063 CFLAGS="$CFLAGS -I${withval}/include"
1064 LFLAGS="$LFLAGS -L${withval}/lib"
1065 fi
1066
1067 if test -z "$KRB4" ; then
1068 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1069 fi
1070
Damien Miller8bdeee21999-12-30 15:50:54 +11001071 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001072 if test ! -z "$AFS_LIBS" ; then
1073 LIBS="$LIBS $AFS_LIBS"
1074 fi
1075 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001076 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001077 fi
Damien Miller80297751999-11-19 13:03:25 +11001078 ]
1079)
Damien Millerc85f9b42000-01-29 10:20:21 +11001080LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001081
Damien Millera22ba012000-03-02 23:09:20 +11001082# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001083SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001084AC_ARG_WITH(skey,
1085 [ --with-skey Enable S/Key support],
1086 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001087 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001088 AC_DEFINE(SKEY)
1089 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001090 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001091 fi
Damien Miller80297751999-11-19 13:03:25 +11001092 ]
1093)
1094
Damien Millera22ba012000-03-02 23:09:20 +11001095# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001096TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001097AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001098 [ --with-tcp-wrappers Enable tcpwrappers support],
1099 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001100 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001101 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001102 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001103 AC_MSG_CHECKING(for libwrap)
1104 AC_TRY_LINK(
1105 [
Damien Miller81171112000-04-23 11:14:01 +10001106#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001107 int deny_severity = 0, allow_severity = 0;
1108 ],
1109 [hosts_access(0);],
1110 [
1111 AC_MSG_RESULT(yes)
1112 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001113 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001114 ],
1115 [
Damien Miller7b22d652000-06-18 14:07:04 +10001116 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001117 ]
1118 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001119 fi
Damien Miller80297751999-11-19 13:03:25 +11001120 ]
1121)
1122
Damien Millera22ba012000-03-02 23:09:20 +11001123# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001124MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001125AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001126 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001127 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001128 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001129 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001130 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001131 fi
1132 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001133)
1134
Damien Millera22ba012000-03-02 23:09:20 +11001135# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001136AC_ARG_WITH(shadow,
1137 [ --without-shadow Disable shadow password support],
1138 [
1139 if test "x$withval" = "xno" ; then
1140 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001141 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001142 fi
1143 ]
1144)
1145
Damien Miller1f335fb2000-06-26 11:31:33 +10001146if test -z "$disable_shadow" ; then
1147 AC_MSG_CHECKING([if the systems has expire shadow information])
1148 AC_TRY_COMPILE(
1149 [
1150#include <sys/types.h>
1151#include <shadow.h>
1152 struct spwd sp;
1153 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1154 [ sp_expire_available=yes ], []
1155 )
1156
1157 if test "x$sp_expire_available" = "xyes" ; then
1158 AC_MSG_RESULT(yes)
1159 AC_DEFINE(HAS_SHADOW_EXPIRE)
1160 else
1161 AC_MSG_RESULT(no)
1162 fi
1163fi
1164
Damien Millera22ba012000-03-02 23:09:20 +11001165# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001166if test ! -z "$IPADDR_IN_DISPLAY" ; then
1167 DISPLAY_HACK_MSG="yes"
1168 AC_DEFINE(IPADDR_IN_DISPLAY)
1169else
1170 DISPLAY_HACK_MSG="no"
1171 AC_ARG_WITH(ipaddr-display,
1172 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1173 [
1174 if test "x$withval" != "xno" ; then
1175 AC_DEFINE(IPADDR_IN_DISPLAY)
1176 DISPLAY_HACK_MSG="yes"
1177 fi
1178 ]
1179 )
1180fi
Damien Miller76112de1999-12-21 11:18:08 +11001181
Damien Millera22ba012000-03-02 23:09:20 +11001182# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001183SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001184AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001185 [ --with-default-path=PATH Specify default \$PATH environment for server],
1186 [
1187 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001188 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001189 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001190 fi
1191 ]
1192)
1193
Damien Millera22ba012000-03-02 23:09:20 +11001194# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001195IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001196AC_ARG_WITH(ipv4-default,
1197 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1198 [
1199 if test "x$withval" != "xno" ; then
1200 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001201 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001202 fi
1203 ]
1204)
1205
Damien Miller61e50f12000-05-08 20:49:37 +10001206AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001207IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001208AC_ARG_WITH(4in6,
1209 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1210 [
1211 if test "x$withval" != "xno" ; then
1212 AC_MSG_RESULT(yes)
1213 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001214 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001215 else
1216 AC_MSG_RESULT(no)
1217 fi
1218 ],[
1219 if test "x$inet6_default_4in6" = "xyes"; then
1220 AC_MSG_RESULT([yes (default)])
1221 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001222 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001223 else
1224 AC_MSG_RESULT([no (default)])
1225 fi
1226 ]
1227)
1228
Damien Miller78315eb2000-09-29 23:01:36 +11001229AC_MSG_CHECKING(whether to install ssh as suid root)
1230AC_ARG_ENABLE(suid-ssh,
1231[ --enable-suid-ssh Install ssh as suid root (default)
1232 --disable-suid-ssh Install ssh without suid bit],
1233[ case "$enableval" in
1234 no)
1235 AC_MSG_RESULT(no)
1236 SSHMODE=0711
1237 ;;
1238 *) AC_MSG_RESULT(yes)
1239 SSHMODE=04711
1240 ;;
1241 esac ],
1242 AC_MSG_RESULT(yes)
1243 SSHMODE=04711
1244)
1245AC_SUBST(SSHMODE)
1246
1247
Damien Millera22ba012000-03-02 23:09:20 +11001248# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001249piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001250AC_ARG_WITH(pid-dir,
1251 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1252 [
1253 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001254 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001255 fi
1256 ]
1257)
Damien Miller4018c192000-04-30 09:30:44 +10001258
Damien Miller78315eb2000-09-29 23:01:36 +11001259# make sure the directory exists
1260if test ! -d $piddir ; then
1261 piddir=`eval echo ${sysconfdir}`
1262 case $piddir in
1263 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1264 esac
1265fi
1266
Damien Millerdbd250f2000-01-18 08:57:14 +11001267AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001268AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001269
andre2ff7b5d2000-06-03 14:57:40 +00001270dnl allow user to disable some login recording features
1271AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001272 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001273 [ AC_DEFINE(DISABLE_LASTLOG) ]
1274)
1275AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001276 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001277 [ AC_DEFINE(DISABLE_UTMP) ]
1278)
1279AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001280 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001281 [ AC_DEFINE(DISABLE_UTMPX) ]
1282)
1283AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001284 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001285 [ AC_DEFINE(DISABLE_WTMP) ]
1286)
1287AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001288 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001289 [ AC_DEFINE(DISABLE_WTMPX) ]
1290)
1291AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001292 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001293 [ AC_DEFINE(DISABLE_LOGIN) ]
1294)
1295AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001296 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001297 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1298)
1299AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001300 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001301 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1302)
1303AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001304 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001305 [ conf_lastlog_location="$withval"; ],)
1306
1307dnl lastlog, [uw]tmpx? detection
1308dnl NOTE: set the paths in the platform section to avoid the
1309dnl need for command-line parameters
1310dnl lastlog and [uw]tmp are subject to a file search if all else fails
1311
1312dnl lastlog detection
1313dnl NOTE: the code itself will detect if lastlog is a directory
1314AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1315AC_TRY_COMPILE([
1316#include <sys/types.h>
1317#include <utmp.h>
1318#ifdef HAVE_LASTLOG_H
1319# include <lastlog.h>
1320#endif
Damien Miller2994e082000-06-04 15:51:47 +10001321#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001322# include <paths.h>
1323#endif
1324 ],
1325 [ char *lastlog = LASTLOG_FILE; ],
1326 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001327 [
1328 AC_MSG_RESULT(no)
1329 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1330 AC_TRY_COMPILE([
1331#include <sys/types.h>
1332#include <utmp.h>
1333#ifdef HAVE_LASTLOG_H
1334# include <lastlog.h>
1335#endif
1336#ifdef HAVE_PATHS_H
1337# include <paths.h>
1338#endif
1339 ],
1340 [ char *lastlog = _PATH_LASTLOG; ],
1341 [ AC_MSG_RESULT(yes) ],
1342 [
andree441aa32000-06-12 22:34:38 +00001343 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001344 system_lastlog_path=no
1345 ])
1346 ]
andre2ff7b5d2000-06-03 14:57:40 +00001347)
Damien Miller2994e082000-06-04 15:51:47 +10001348
andre2ff7b5d2000-06-03 14:57:40 +00001349if test -z "$conf_lastlog_location"; then
1350 if test x"$system_lastlog_path" = x"no" ; then
1351 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001352 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001353 conf_lastlog_location=$f
1354 fi
1355 done
1356 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001357 AC_MSG_WARN([** Cannot find lastlog **])
1358 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001359 fi
1360 fi
1361fi
1362
1363if test -n "$conf_lastlog_location"; then
1364 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1365fi
1366
1367dnl utmp detection
1368AC_MSG_CHECKING([if your system defines UTMP_FILE])
1369AC_TRY_COMPILE([
1370#include <sys/types.h>
1371#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001372#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001373# include <paths.h>
1374#endif
1375 ],
1376 [ char *utmp = UTMP_FILE; ],
1377 [ AC_MSG_RESULT(yes) ],
1378 [ AC_MSG_RESULT(no)
1379 system_utmp_path=no ]
1380)
1381if test -z "$conf_utmp_location"; then
1382 if test x"$system_utmp_path" = x"no" ; then
1383 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1384 if test -f $f ; then
1385 conf_utmp_location=$f
1386 fi
1387 done
1388 if test -z "$conf_utmp_location"; then
1389 AC_DEFINE(DISABLE_UTMP)
1390 fi
1391 fi
1392fi
1393if test -n "$conf_utmp_location"; then
1394 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1395fi
1396
1397dnl wtmp detection
1398AC_MSG_CHECKING([if your system defines WTMP_FILE])
1399AC_TRY_COMPILE([
1400#include <sys/types.h>
1401#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001402#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001403# include <paths.h>
1404#endif
1405 ],
1406 [ char *wtmp = WTMP_FILE; ],
1407 [ AC_MSG_RESULT(yes) ],
1408 [ AC_MSG_RESULT(no)
1409 system_wtmp_path=no ]
1410)
1411if test -z "$conf_wtmp_location"; then
1412 if test x"$system_wtmp_path" = x"no" ; then
1413 for f in /usr/adm/wtmp /var/log/wtmp; do
1414 if test -f $f ; then
1415 conf_wtmp_location=$f
1416 fi
1417 done
1418 if test -z "$conf_wtmp_location"; then
1419 AC_DEFINE(DISABLE_WTMP)
1420 fi
1421 fi
1422fi
1423if test -n "$conf_wtmp_location"; then
1424 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1425fi
1426
1427
1428dnl utmpx detection - I don't know any system so perverse as to require
1429dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1430dnl there, though.
1431AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1432AC_TRY_COMPILE([
1433#include <sys/types.h>
1434#include <utmp.h>
1435#ifdef HAVE_UTMPX_H
1436#include <utmpx.h>
1437#endif
Damien Miller2994e082000-06-04 15:51:47 +10001438#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001439# include <paths.h>
1440#endif
1441 ],
1442 [ char *utmpx = UTMPX_FILE; ],
1443 [ AC_MSG_RESULT(yes) ],
1444 [ AC_MSG_RESULT(no)
1445 system_utmpx_path=no ]
1446)
1447if test -z "$conf_utmpx_location"; then
1448 if test x"$system_utmpx_path" = x"no" ; then
1449 AC_DEFINE(DISABLE_UTMPX)
1450 fi
1451else
1452 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1453fi
1454
1455dnl wtmpx detection
1456AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1457AC_TRY_COMPILE([
1458#include <sys/types.h>
1459#include <utmp.h>
1460#ifdef HAVE_UTMPX_H
1461#include <utmpx.h>
1462#endif
Damien Miller2994e082000-06-04 15:51:47 +10001463#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001464# include <paths.h>
1465#endif
1466 ],
1467 [ char *wtmpx = WTMPX_FILE; ],
1468 [ AC_MSG_RESULT(yes) ],
1469 [ AC_MSG_RESULT(no)
1470 system_wtmpx_path=no ]
1471)
1472if test -z "$conf_wtmpx_location"; then
1473 if test x"$system_wtmpx_path" = x"no" ; then
1474 AC_DEFINE(DISABLE_WTMPX)
1475 fi
1476else
1477 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1478fi
1479
Damien Miller4018c192000-04-30 09:30:44 +10001480
1481# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001482entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001483AC_ARG_WITH(entropy-timeout,
1484 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1485 [
1486 if test "x$withval" != "xno" ; then
1487 entropy_timeout=$withval
1488 fi
1489 ]
1490)
1491AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1492
1493
Damien Miller29ea30d2000-03-17 10:54:15 +11001494if test ! -z "$blibpath" ; then
1495 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1496 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1497fi
1498
Damien Millerbac2d8a2000-09-05 16:13:06 +11001499AC_EXEEXT
1500
Damien Miller0437b332000-05-02 09:56:41 +10001501AC_OUTPUT(Makefile ssh_prng_cmds)
1502
Damien Miller7b22d652000-06-18 14:07:04 +10001503# Print summary of options
1504
1505if test x$MANTYPE = x'$(CATMAN)' ; then
1506 MAN_MSG=cat
1507else
1508 MAN_MSG=man
1509fi
1510if test ! -z "$RANDOM_POOL" ; then
1511 RAND_MSG="Device ($RANDOM_POOL)"
1512else
1513 if test ! -z "$EGD_SOCKET" ; then
1514 RAND_MSG="EGD ($EGD_SOCKET)"
1515 else
1516 RAND_MSG="Builtin (timeout $entropy_timeout)"
1517 fi
1518fi
1519
1520# Someone please show me a better way :)
1521A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1522B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1523C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1524D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001525E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001526F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1527G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1528
1529echo ""
1530echo "OpenSSH configured has been configured with the following options."
1531echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001532echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001533echo " System binaries: $C"
1534echo " Configuration files: $D"
1535echo " Askpass program: $E"
1536echo " Manual pages: $F"
1537echo " PID file: $G"
1538echo " Random number collection: $RAND_MSG"
1539echo " Manpage format: $MAN_MSG"
1540echo " PAM support: ${PAM_MSG}"
1541echo " KerberosIV support: $KRB4_MSG"
1542echo " AFS support: $AFS_MSG"
1543echo " S/KEY support: $SKEY_MSG"
1544echo " TCP Wrappers support: $TCPW_MSG"
1545echo " MD5 password support: $MD5_MSG"
1546echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1547echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1548echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1549
1550echo ""
1551
Damien Millere68f92b2000-10-02 21:42:15 +11001552echo " Host: ${host}"
1553echo " Compiler: ${CC}"
1554echo " Compiler flags: ${CFLAGS}"
1555echo " Linker flags: ${LDFLAGS}"
1556echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001557
1558echo ""
1559