blob: 7cd7467f9f5725569088ccb37421658f6a8a83a4 [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)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000131 AC_DEFINE(BROKEN_REALPATH)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000132 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000133 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100134*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100135 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100136 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100137 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000138 # hardwire lastlog location (can't detect it on some versions)
139 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000140 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
141 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
142 if test "$sol2ver" -ge 8; then
143 AC_MSG_RESULT(yes)
144 AC_DEFINE(DISABLE_UTMP)
145 AC_DEFINE(DISABLE_WTMP)
146 else
147 AC_MSG_RESULT(no)
148 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100149 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000150*-*-sunos4*)
151 CFLAGS="$CFLAGS -DSUNOS4"
152 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000153 conf_utmp_location=/etc/utmp
154 conf_wtmp_location=/var/adm/wtmp
155 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000156 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000157 MANTYPE='$(CATMAN)'
158 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000159 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000160*-sni-sysv*)
161 CFLAGS="$CFLAGS -I/usr/local/include"
162 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
163 MANTYPE='$(CATMAN)'
164 AC_DEFINE(IP_TOS_IS_BROKEN)
165 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000166 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000167 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100168*-*-sysv4.2*)
169 CFLAGS="$CFLAGS -I/usr/local/include"
170 LDFLAGS="$LDFLAGS -L/usr/local/lib"
171 MANTYPE='$(CATMAN)'
172 mansubdir=cat
173 LIBS="$LIBS -lgen -lsocket -lnsl -lresolv"
174 enable_suid_ssh=no
175 ;;
176*-*-sysv5*)
177 CFLAGS="$CFLAGS -I/usr/local/include"
178 LDFLAGS="$LDFLAGS -L/usr/local/lib"
179 MANTYPE='$(CATMAN)'
180 mansubdir=cat
181 LIBS="$LIBS -lgen -lsocket"
182 enable_suid_ssh=no
183 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100184*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100185 CFLAGS="$CFLAGS -I/usr/local/include"
186 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100187 MANTYPE='$(CATMAN)'
188 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100189 LIBS="$LIBS -lgen -lsocket"
190 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100191*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100192 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100193 CFLAGS="$CFLAGS -Dftruncate=chsize -I/usr/local/include"
194 LDFLAGS="$LDFLAGS -L/usr/local/lib"
195 MANTYPE='$(CATMAN)'
196 mansubdir=cat
197 LIBS="$LIBS -lgen -lsocket -los -lprot -lx"
198 no_dev_ptmx=1
199 RANLIB=true
200 AC_DEFINE(BROKEN_SYS_TERMIO_H)
201 rsh_path="/usr/bin/rcmd"
202 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
203 ;;
204*-*-sco3.2v5*)
Damien Millera66626b2000-06-13 18:57:53 +1000205 CFLAGS="$CFLAGS -I/usr/local/include"
206 LDFLAGS="$LDFLAGS -L/usr/local/lib"
207 MANTYPE='$(CATMAN)'
208 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100209 LIBS="$LIBS -lgen -lsocket -lprot -lx"
Damien Millera66626b2000-06-13 18:57:53 +1000210 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100211 rsh_path="/usr/bin/rcmd"
212 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Damien Millera66626b2000-06-13 18:57:53 +1000213 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000214*-dec-osf*)
215# This is untested
216 if test ! -z "USE_SIA" ; then
217 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
218 if test -f /etc/sia/matrix.conf; then
219 AC_MSG_RESULT(yes)
220 AC_DEFINE(HAVE_OSF_SIA)
221 AC_DEFINE(DISABLE_LOGIN)
222 LIBS="$LIBS -lsecurity -ldb -lm -laud"
223 else
224 AC_MSG_RESULT(no)
225 fi
226 fi
227 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100228esac
229
Damien Millere37bfc12000-06-05 09:37:43 +1000230# Allow user to specify flags
231AC_ARG_WITH(cflags,
232 [ --with-cflags Specify additional flags to pass to compiler],
233 [
234 if test "x$withval" != "xno" ; then
235 CFLAGS="$CFLAGS $withval"
236 fi
237 ]
238)
239AC_ARG_WITH(ldflags,
240 [ --with-ldlags Specify additional flags to pass to linker],
241 [
242 if test "x$withval" != "xno" ; then
243 LDFLAGS="$LDFLAGS $withval"
244 fi
245 ]
246)
247AC_ARG_WITH(libs,
248 [ --with-libs Specify additional libraries to link with],
249 [
250 if test "x$withval" != "xno" ; then
251 LIBS="$LIBS $withval"
252 fi
253 ]
254)
255
256
Damien Millera22ba012000-03-02 23:09:20 +1100257# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100258AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
259AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Ben Lindstromca1c2a02000-10-14 21:33:19 +0000260AC_CHECK_LIB(rx, regcomp, AC_DEFINE(HAVE_LIBRX) LIBS="$LIBS -lrx")
Damien Millerab18c411999-11-11 10:40:23 +1100261
Damien Millerbeb4ba51999-12-28 15:09:35 +1100262if test -z "$no_libsocket" ; then
263 AC_CHECK_LIB(nsl, yp_match, , )
264fi
265if test -z "$no_libnsl" ; then
266 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100267fi
Damien Millerab18c411999-11-11 10:40:23 +1100268
Damien Millera22ba012000-03-02 23:09:20 +1100269# Checks for header files.
Damien Miller874d77b2000-10-14 16:23:11 +1100270AC_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 +1100271
Damien Millerad833b32000-08-23 10:46:23 +1000272dnl Checks for library functions.
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000273AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath 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 +1000274dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000275AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000276dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000277AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000278dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000279AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
280AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000281dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000282AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
283AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100284
Damien Miller5fc85652000-07-09 23:53:07 +1000285AC_CHECK_FUNC(getuserattr,
286 [AC_DEFINE(HAVE_GETUSERATTR)],
287 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
288)
289
Damien Miller04f80141999-11-19 15:32:34 +1100290AC_CHECK_FUNC(login,
291 [AC_DEFINE(HAVE_LOGIN)],
292 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
293)
294
295AC_CHECK_FUNC(daemon,
296 [AC_DEFINE(HAVE_DAEMON)],
297 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
298)
299
Damien Miller9fb07e42000-03-05 16:22:59 +1100300AC_CHECK_FUNC(getpagesize,
301 [AC_DEFINE(HAVE_GETPAGESIZE)],
302 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
303)
304
Damien Millercb170cb2000-07-01 16:52:55 +1000305# Check for broken snprintf
306if test "x$ac_cv_func_snprintf" = "xyes" ; then
307 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
308 AC_TRY_RUN(
309 [
310#include <stdio.h>
311int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
312 ],
313 [AC_MSG_RESULT(yes)],
314 [
315 AC_MSG_RESULT(no)
316 AC_DEFINE(BROKEN_SNPRINTF)
317 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
318 ]
319 )
320fi
321
Damien Miller606f8802000-09-16 15:39:56 +1100322AC_FUNC_GETPGRP
323
Damien Miller7b22d652000-06-18 14:07:04 +1000324PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100325AC_ARG_WITH(pam,
326 [ --without-pam Disable PAM support ],
327 [
328 if test "x$withval" = "xno" ; then
329 no_pam=1
330 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000331 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100332 fi
333 ]
334)
Damien Milleredb82922000-06-20 13:25:52 +1000335if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100336 AC_CHECK_LIB(dl, dlopen, , )
337 LIBS="$LIBS -lpam"
338
Damien Miller0e65eed2000-05-17 22:16:05 +1000339 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000340
Damien Miller1f335fb2000-06-26 11:31:33 +1000341 disable_shadow=yes
342
Damien Miller7b22d652000-06-18 14:07:04 +1000343 PAM_MSG="yes"
344
Damien Millera22ba012000-03-02 23:09:20 +1100345 # Check PAM strerror arguments (old PAM)
346 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
347 AC_TRY_COMPILE(
348 [
Damien Miller81171112000-04-23 11:14:01 +1000349#include <stdlib.h>
350#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100351 ],
352 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
353 [AC_MSG_RESULT(no)],
354 [
355 AC_DEFINE(HAVE_OLD_PAM)
356 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000357 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100358 ]
359 )
360fi
361
362# The big search for OpenSSL
363AC_ARG_WITH(ssl-dir,
364 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
365 [
366 if test "x$withval" != "$xno" ; then
367 tryssldir=$withval
368 fi
369 ]
370)
371
372saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100373saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100374saved_CFLAGS="$CFLAGS"
375if test "x$prefix" != "xNONE" ; then
376 tryssldir="$tryssldir $prefix"
377fi
Damien Miller61e50f12000-05-08 20:49:37 +1000378AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100379
Damien Millera1b61e12000-09-16 17:02:16 +1100380 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 +1000381 if test ! -z "$ssldir" ; then
382 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
383 CFLAGS="$saved_CFLAGS -I$ssldir/include"
384 if test ! -z "$need_dash_r" ; then
385 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
386 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100387 else
Damien Miller61e50f12000-05-08 20:49:37 +1000388 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100389 fi
390
Damien Miller3b512e12000-05-17 23:29:18 +1000391 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000392
Damien Miller3b512e12000-05-17 23:29:18 +1000393 # Basic test to check for compatible version and correct linking
394 # *does not* test for RSA - that comes later.
395 AC_TRY_RUN(
396 [
Damien Millere59ce622000-05-01 20:54:17 +1000397#include <string.h>
398#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000399int main(void)
400{
Damien Miller3b512e12000-05-17 23:29:18 +1000401 char a[2048];
402 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000403 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000404 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000405}
Damien Miller3b512e12000-05-17 23:29:18 +1000406 ],
407 [
408 found_crypto=1
409 break;
410 ], []
411 )
Damien Miller61e50f12000-05-08 20:49:37 +1000412
413 if test ! -z "$found_crypto" ; then
414 break;
415 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100416 done
417
Damien Miller61e50f12000-05-08 20:49:37 +1000418 if test -z "$found_crypto" ; then
419 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100420 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000421 if test -z "$ssldir" ; then
422 ssldir="(system)"
423 fi
Damien Millera22ba012000-03-02 23:09:20 +1100424
Damien Miller61e50f12000-05-08 20:49:37 +1000425 ac_cv_openssldir=$ssldir
426])
427
Damien Milleredb82922000-06-20 13:25:52 +1000428if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000429 AC_DEFINE(HAVE_OPENSSL)
430 dnl Need to recover ssldir - test above runs in subshell
431 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100432 CFLAGS="$saved_CFLAGS -I$ssldir/include"
433 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
434 if test ! -z "$need_dash_r" ; then
435 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100436 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100437 if test ! -z "$blibpath" ; then
438 blibpath="$blibpath:$ssldir:$ssldir/lib"
439 fi
Damien Millera22ba012000-03-02 23:09:20 +1100440fi
Damien Miller3b512e12000-05-17 23:29:18 +1000441LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000442
Damien Miller3b512e12000-05-17 23:29:18 +1000443# Now test RSA support
444saved_LIBS="$LIBS"
445AC_MSG_CHECKING([for RSA support])
446for WANTS_RSAREF in "" 1 ; do
447 if test -z "$WANTS_RSAREF" ; then
448 LIBS="$saved_LIBS"
449 else
450 LIBS="$saved_LIBS -lRSAglue -lrsaref"
451 fi
452 AC_TRY_RUN([
453#include <string.h>
454#include <openssl/rand.h>
455#include <openssl/rsa.h>
456#include <openssl/bn.h>
457#include <openssl/sha.h>
458int main(void)
459{
460 int num; RSA *key; static unsigned char p_in[] = "blahblah";
461 unsigned char c[256], p[256];
462 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
463 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
464 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
465 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
466}
467 ],
468 [
469 rsa_works=1
470 break;
471 ], [])
472done
473
474if test ! -z "$no_rsa" ; then
475 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000476 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000477else
478 if test -z "$rsa_works" ; then
479 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000480 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000481 else
482 if test -z "$WANTS_RSAREF" ; then
483 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000484 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000485 else
Damien Miller7b22d652000-06-18 14:07:04 +1000486 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000487 AC_MSG_RESULT(using RSAref)
488 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
489 fi
490 fi
491fi
Damien Millera22ba012000-03-02 23:09:20 +1100492
493# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100494AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100495AC_CHECK_SIZEOF(short int, 2)
496AC_CHECK_SIZEOF(int, 4)
497AC_CHECK_SIZEOF(long int, 4)
498AC_CHECK_SIZEOF(long long int, 8)
499
Damien Millera22ba012000-03-02 23:09:20 +1100500# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100501AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
502 AC_TRY_COMPILE(
503 [ #include <sys/types.h> ],
504 [ u_int a; a = 1;],
505 [ ac_cv_have_u_int="yes" ],
506 [ ac_cv_have_u_int="no" ]
507 )
508])
509if test "x$ac_cv_have_u_int" = "xyes" ; then
510 AC_DEFINE(HAVE_U_INT)
511 have_u_int=1
512fi
513
Damien Miller61e50f12000-05-08 20:49:37 +1000514AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
515 AC_TRY_COMPILE(
516 [ #include <sys/types.h> ],
517 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
518 [ ac_cv_have_intxx_t="yes" ],
519 [ ac_cv_have_intxx_t="no" ]
520 )
521])
522if test "x$ac_cv_have_intxx_t" = "xyes" ; then
523 AC_DEFINE(HAVE_INTXX_T)
524 have_intxx_t=1
525fi
526
Damien Miller578783e2000-09-23 14:12:24 +1100527AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
528 AC_TRY_COMPILE(
529 [ #include <sys/types.h> ],
530 [ int64_t a; a = 1;],
531 [ ac_cv_have_int64_t="yes" ],
532 [ ac_cv_have_int64_t="no" ]
533 )
534])
535if test "x$ac_cv_have_int64_t" = "xyes" ; then
536 AC_DEFINE(HAVE_INT64_T)
537 have_int64_t=1
538fi
539
Damien Miller61e50f12000-05-08 20:49:37 +1000540AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
541 AC_TRY_COMPILE(
542 [ #include <sys/types.h> ],
543 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
544 [ ac_cv_have_u_intxx_t="yes" ],
545 [ ac_cv_have_u_intxx_t="no" ]
546 )
547])
548if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
549 AC_DEFINE(HAVE_U_INTXX_T)
550 have_u_intxx_t=1
551fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100552
Damien Miller578783e2000-09-23 14:12:24 +1100553AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
554 AC_TRY_COMPILE(
555 [ #include <sys/types.h> ],
556 [ u_int64_t a; a = 1;],
557 [ ac_cv_have_u_int64_t="yes" ],
558 [ ac_cv_have_u_int64_t="no" ]
559 )
560])
561if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
562 AC_DEFINE(HAVE_U_INT64_T)
563 have_u_int64_t=1
564fi
565
Damien Milleredb82922000-06-20 13:25:52 +1000566if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
567 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100568then
569 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
570 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000571 [
572#include <sys/bitypes.h>
573 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100574 [
Damien Miller70494d12000-04-03 15:57:06 +1000575 int8_t a; int16_t b; int32_t c;
576 u_int8_t e; u_int16_t f; u_int32_t g;
577 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100578 ],
579 [
580 AC_DEFINE(HAVE_U_INTXX_T)
581 AC_DEFINE(HAVE_INTXX_T)
582 AC_MSG_RESULT(yes)
583 ],
584 [AC_MSG_RESULT(no)]
585 )
586fi
587
Damien Millerd6121d22000-03-17 23:26:46 +1100588if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000589 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
590 AC_TRY_COMPILE(
591 [
592#include <sys/types.h>
593 ],
594 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
595 [ ac_cv_have_uintxx_t="yes" ],
596 [ ac_cv_have_uintxx_t="no" ]
597 )
598 ])
599 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
600 AC_DEFINE(HAVE_UINTXX_T)
601 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100602fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100603
Damien Miller61e50f12000-05-08 20:49:37 +1000604AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
605 AC_TRY_COMPILE(
606 [
Damien Miller81171112000-04-23 11:14:01 +1000607#include <sys/types.h>
608#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000609 ],
610 [socklen_t foo; foo = 1235;],
611 [ ac_cv_have_socklen_t="yes" ],
612 [ ac_cv_have_socklen_t="no" ]
613 )
614])
615if test "x$ac_cv_have_socklen_t" = "xyes" ; then
616 AC_DEFINE(HAVE_SOCKLEN_T)
617fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100618
Damien Miller61e50f12000-05-08 20:49:37 +1000619AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
620 AC_TRY_COMPILE(
621 [
622#include <sys/types.h>
623 ],
624 [ size_t foo; foo = 1235; ],
625 [ ac_cv_have_size_t="yes" ],
626 [ ac_cv_have_size_t="no" ]
627 )
628])
629if test "x$ac_cv_have_size_t" = "xyes" ; then
630 AC_DEFINE(HAVE_SIZE_T)
631fi
Damien Miller95058511999-12-29 10:36:45 +1100632
Damien Miller615f9392000-05-17 22:53:33 +1000633AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
634 AC_TRY_COMPILE(
635 [
636#include <sys/types.h>
637 ],
638 [ ssize_t foo; foo = 1235; ],
639 [ ac_cv_have_ssize_t="yes" ],
640 [ ac_cv_have_ssize_t="no" ]
641 )
642])
643if test "x$ac_cv_have_ssize_t" = "xyes" ; then
644 AC_DEFINE(HAVE_SSIZE_T)
645fi
646
Damien Millerb54b40e2000-06-23 08:23:34 +1000647AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
648 AC_TRY_COMPILE(
649 [
650#include <sys/types.h>
651#include <sys/socket.h>
652 ],
653 [ sa_family_t foo; foo = 1235; ],
654 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100655 [ AC_TRY_COMPILE(
656 [
657#include <sys/types.h>
658#include <sys/socket.h>
659#include <netinet/in.h>
660 ],
661 [ sa_family_t foo; foo = 1235; ],
662 [ ac_cv_have_sa_family_t="yes" ],
663
Damien Millerb54b40e2000-06-23 08:23:34 +1000664 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100665 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000666 )
667])
668if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
669 AC_DEFINE(HAVE_SA_FAMILY_T)
670fi
671
Damien Miller0f91b4e2000-06-18 15:43:25 +1000672AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
673 AC_TRY_COMPILE(
674 [
675#include <sys/types.h>
676 ],
677 [ pid_t foo; foo = 1235; ],
678 [ ac_cv_have_pid_t="yes" ],
679 [ ac_cv_have_pid_t="no" ]
680 )
681])
682if test "x$ac_cv_have_pid_t" = "xyes" ; then
683 AC_DEFINE(HAVE_PID_T)
684fi
685
686AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
687 AC_TRY_COMPILE(
688 [
689#include <sys/types.h>
690 ],
691 [ mode_t foo; foo = 1235; ],
692 [ ac_cv_have_mode_t="yes" ],
693 [ ac_cv_have_mode_t="no" ]
694 )
695])
696if test "x$ac_cv_have_mode_t" = "xyes" ; then
697 AC_DEFINE(HAVE_MODE_T)
698fi
699
Damien Miller61e50f12000-05-08 20:49:37 +1000700
701AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
702 AC_TRY_COMPILE(
703 [
Damien Miller81171112000-04-23 11:14:01 +1000704#include <sys/types.h>
705#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000706 ],
707 [ struct sockaddr_storage s; ],
708 [ ac_cv_have_struct_sockaddr_storage="yes" ],
709 [ ac_cv_have_struct_sockaddr_storage="no" ]
710 )
711])
712if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
713 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
714fi
Damien Miller34132e52000-01-14 15:45:46 +1100715
Damien Miller61e50f12000-05-08 20:49:37 +1000716AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
717 AC_TRY_COMPILE(
718 [
Damien Miller7b22d652000-06-18 14:07:04 +1000719#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000720#include <netinet/in.h>
721 ],
722 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
723 [ ac_cv_have_struct_sockaddr_in6="yes" ],
724 [ ac_cv_have_struct_sockaddr_in6="no" ]
725 )
726])
727if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
728 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
729fi
Damien Miller34132e52000-01-14 15:45:46 +1100730
Damien Miller61e50f12000-05-08 20:49:37 +1000731AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
732 AC_TRY_COMPILE(
733 [
Damien Miller7b22d652000-06-18 14:07:04 +1000734#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000735#include <netinet/in.h>
736 ],
737 [ struct in6_addr s; s.s6_addr[0] = 0; ],
738 [ ac_cv_have_struct_in6_addr="yes" ],
739 [ ac_cv_have_struct_in6_addr="no" ]
740 )
741])
742if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
743 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
744fi
Damien Miller34132e52000-01-14 15:45:46 +1100745
Damien Miller61e50f12000-05-08 20:49:37 +1000746AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
747 AC_TRY_COMPILE(
748 [
Damien Miller81171112000-04-23 11:14:01 +1000749#include <sys/types.h>
750#include <sys/socket.h>
751#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000752 ],
753 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
754 [ ac_cv_have_struct_addrinfo="yes" ],
755 [ ac_cv_have_struct_addrinfo="no" ]
756 )
757])
758if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
759 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
760fi
761
Damien Miller78315eb2000-09-29 23:01:36 +1100762dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000763OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
764OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
765OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
766OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
767OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000768OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000769OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
770OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000771OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000772OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
773OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
774OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
775OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000776OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
777OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
778OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
779OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100780AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000781
Damien Miller942da032000-08-18 13:59:06 +1000782AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
783 ac_cv_have_sun_len_in_struct_sockaddr_un, [
784 AC_TRY_COMPILE(
785 [
786#include <sys/types.h>
787#include <sys/socket.h>
788 ],
789 [ struct sockaddr_un s; s.sun_len = 1; ],
790 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
791 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
792 )
793])
794if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
795 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
796fi
797
Damien Miller61e50f12000-05-08 20:49:37 +1000798AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
799 ac_cv_have_ss_family_in_struct_ss, [
800 AC_TRY_COMPILE(
801 [
Damien Miller81171112000-04-23 11:14:01 +1000802#include <sys/types.h>
803#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000804 ],
805 [ struct sockaddr_storage s; s.ss_family = 1; ],
806 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
807 [ ac_cv_have_ss_family_in_struct_ss="no" ],
808 )
809])
810if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
811 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
812fi
813
Damien Miller61e50f12000-05-08 20:49:37 +1000814AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
815 ac_cv_have___ss_family_in_struct_ss, [
816 AC_TRY_COMPILE(
817 [
Damien Miller81171112000-04-23 11:14:01 +1000818#include <sys/types.h>
819#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000820 ],
821 [ struct sockaddr_storage s; s.__ss_family = 1; ],
822 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
823 [ ac_cv_have___ss_family_in_struct_ss="no" ]
824 )
825])
826if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
827 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
828fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100829
Damien Millerad833b32000-08-23 10:46:23 +1000830AC_CACHE_CHECK([for pw_class field in struct passwd],
831 ac_cv_have_pw_class_in_struct_passwd, [
832 AC_TRY_COMPILE(
833 [
Damien Millerad833b32000-08-23 10:46:23 +1000834#include <pwd.h>
835 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000836 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000837 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
838 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
839 )
840])
841if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
842 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
843fi
844
Damien Miller61e50f12000-05-08 20:49:37 +1000845
846AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
847 AC_TRY_LINK([],
848 [ extern char *__progname; printf("%s", __progname); ],
849 [ ac_cv_libc_defines___progname="yes" ],
850 [ ac_cv_libc_defines___progname="no" ]
851 )
852])
853if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
854 AC_DEFINE(HAVE___PROGNAME)
855fi
856
Damien Millera22ba012000-03-02 23:09:20 +1100857
Damien Millerecbb26d2000-07-15 14:59:14 +1000858AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
859 AC_TRY_LINK([],
860 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
861 [ ac_cv_libc_defines_sys_errlist="yes" ],
862 [ ac_cv_libc_defines_sys_errlist="no" ]
863 )
864])
865if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
866 AC_DEFINE(HAVE_SYS_ERRLIST)
867fi
868
869
Damien Miller11fa2cc2000-08-16 10:35:58 +1000870AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
871 AC_TRY_LINK([],
872 [ extern int sys_nerr; printf("%i", sys_nerr);],
873 [ ac_cv_libc_defines_sys_nerr="yes" ],
874 [ ac_cv_libc_defines_sys_nerr="no" ]
875 )
876])
877if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
878 AC_DEFINE(HAVE_SYS_NERR)
879fi
880
881
Damien Millera22ba012000-03-02 23:09:20 +1100882# Looking for programs, paths and files
883AC_ARG_WITH(rsh,
884 [ --with-rsh=PATH Specify path to remote shell program ],
885 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100886 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000887 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100888 fi
889 ],
890 [
891 AC_PATH_PROG(rsh_path, rsh)
892 ]
893)
894
895AC_ARG_WITH(xauth,
896 [ --with-xauth=PATH Specify path to xauth program ],
897 [
898 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000899 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100900 fi
901 ],
902 [
Damien Miller78315eb2000-09-29 23:01:36 +1100903 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 +1000904 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100905 xauth_path="/usr/openwin/bin/xauth"
906 fi
907 ]
908)
909
910if test ! -z "$xauth_path" ; then
911 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
912fi
913if test ! -z "$rsh_path" ; then
914 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
915fi
916
917# Check for mail directory (last resort if we cannot get it from headers)
918if test ! -z "$MAIL" ; then
919 maildir=`dirname $MAIL`
920 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
921fi
922
Damien Millera22ba012000-03-02 23:09:20 +1100923if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100924 AC_CHECK_FILE("/dev/ptmx",
925 [
926 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
927 have_dev_ptmx=1
928 ]
929 )
Damien Millera22ba012000-03-02 23:09:20 +1100930fi
Damien Miller204ad072000-03-02 23:56:12 +1100931AC_CHECK_FILE("/dev/ptc",
932 [
933 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
934 have_dev_ptc=1
935 ]
936)
937
Damien Millera22ba012000-03-02 23:09:20 +1100938# Options from here on. Some of these are preset by platform above
939
Damien Millera22ba012000-03-02 23:09:20 +1100940# Check for user-specified random device, otherwise check /dev/urandom
941AC_ARG_WITH(random,
942 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
943 [
Damien Miller040f3832000-04-03 14:50:43 +1000944 if test "x$withval" != "xno" ; then
945 RANDOM_POOL="$withval";
946 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
947 fi
Damien Millera22ba012000-03-02 23:09:20 +1100948 ],
949 [
950 # Check for random device
951 AC_CHECK_FILE("/dev/urandom",
952 [
953 RANDOM_POOL="/dev/urandom";
954 AC_SUBST(RANDOM_POOL)
955 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
956 ]
957 )
958 ]
959)
960
961# Check for EGD pool file
962AC_ARG_WITH(egd-pool,
963 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
964 [
Damien Miller040f3832000-04-03 14:50:43 +1000965 if test "x$withval" != "xno" ; then
966 EGD_SOCKET="$withval";
967 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
968 fi
Damien Millera22ba012000-03-02 23:09:20 +1100969 ]
970)
971
Damien Miller0437b332000-05-02 09:56:41 +1000972# detect pathnames for entropy gathering commands, if we need them
973INSTALL_SSH_PRNG_CMDS=""
974rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000975if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000976 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000977 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
978 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
979 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
980 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
981 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
982 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
983 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
984 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
985 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
986 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
987 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
988 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
989 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
990 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
991 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000992
993 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000994fi
Damien Miller0437b332000-05-02 09:56:41 +1000995AC_SUBST(INSTALL_SSH_PRNG_CMDS)
996
Damien Miller11e37f62000-04-08 18:23:30 +1000997
Damien Miller670a4b82000-01-22 13:53:11 +1100998AC_ARG_WITH(catman,
999 [ --with-catman=man|cat Install preformatted manpages[no]],
1000 [
1001 MANTYPE='$(CATMAN)'
1002 if test x"$withval" != x"yes" ; then
1003 mansubdir=$withval
1004 else
1005 mansubdir=cat
1006 fi
1007 ], [
1008 if test -z "$MANTYPE" ; then
1009 MANTYPE='$(TROFFMAN)'
1010 mansubdir=man
1011 fi
1012 ]
1013)
1014AC_SUBST(MANTYPE)
1015AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001016
Damien Millera22ba012000-03-02 23:09:20 +11001017# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001018KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001019AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001020 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001021 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001022 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001023
1024 if test "x$withval" != "$xyes" ; then
1025 CFLAGS="$CFLAGS -I${withval}/include"
1026 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001027 if test ! -z "$need_dash_r" ; then
1028 LDFLAGS="$LDFLAGS -R${withval}/lib"
1029 fi
1030 if test ! -z "$blibpath" ; then
1031 blibpath="$blibpath:${withval}/lib"
1032 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001033 else
1034 if test -d /usr/include/kerberosIV ; then
1035 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
1036 fi
1037 fi
1038
1039 AC_CHECK_HEADERS(krb.h)
1040 AC_CHECK_LIB(krb, main)
1041 if test "$ac_cv_header_krb_h" != yes; then
1042 AC_MSG_WARN([Cannot find krb.h, build may fail])
1043 fi
1044 if test "$ac_cv_lib_krb_main" != yes; then
1045 AC_MSG_WARN([Cannot find libkrb, build may fail])
1046 fi
1047
Damien Millerc85f9b42000-01-29 10:20:21 +11001048 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001049 AC_CHECK_LIB(resolv, dn_expand, , )
1050 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001051 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001052 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001053 fi
Damien Miller80297751999-11-19 13:03:25 +11001054 ]
1055)
1056
Damien Millera22ba012000-03-02 23:09:20 +11001057# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001058AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001059AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001060 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001061 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001062 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001063
1064 if test "x$withval" != "$xyes" ; then
1065 CFLAGS="$CFLAGS -I${withval}/include"
1066 LFLAGS="$LFLAGS -L${withval}/lib"
1067 fi
1068
1069 if test -z "$KRB4" ; then
1070 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1071 fi
1072
Damien Miller8bdeee21999-12-30 15:50:54 +11001073 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001074 if test ! -z "$AFS_LIBS" ; then
1075 LIBS="$LIBS $AFS_LIBS"
1076 fi
1077 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001078 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001079 fi
Damien Miller80297751999-11-19 13:03:25 +11001080 ]
1081)
Damien Millerc85f9b42000-01-29 10:20:21 +11001082LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001083
Damien Millera22ba012000-03-02 23:09:20 +11001084# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001085SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001086AC_ARG_WITH(skey,
1087 [ --with-skey Enable S/Key support],
1088 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001089 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001090 AC_DEFINE(SKEY)
1091 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001092 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001093 fi
Damien Miller80297751999-11-19 13:03:25 +11001094 ]
1095)
1096
Damien Millera22ba012000-03-02 23:09:20 +11001097# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001098TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001099AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001100 [ --with-tcp-wrappers Enable tcpwrappers support],
1101 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001102 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001103 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001104 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001105 AC_MSG_CHECKING(for libwrap)
1106 AC_TRY_LINK(
1107 [
Damien Miller81171112000-04-23 11:14:01 +10001108#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001109 int deny_severity = 0, allow_severity = 0;
1110 ],
1111 [hosts_access(0);],
1112 [
1113 AC_MSG_RESULT(yes)
1114 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001115 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001116 ],
1117 [
Damien Miller7b22d652000-06-18 14:07:04 +10001118 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001119 ]
1120 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001121 fi
Damien Miller80297751999-11-19 13:03:25 +11001122 ]
1123)
1124
Damien Millera22ba012000-03-02 23:09:20 +11001125# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001126MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001127AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001128 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001129 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001130 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001131 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001132 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001133 fi
1134 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001135)
1136
Damien Millera22ba012000-03-02 23:09:20 +11001137# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001138AC_ARG_WITH(shadow,
1139 [ --without-shadow Disable shadow password support],
1140 [
1141 if test "x$withval" = "xno" ; then
1142 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001143 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001144 fi
1145 ]
1146)
1147
Damien Miller1f335fb2000-06-26 11:31:33 +10001148if test -z "$disable_shadow" ; then
1149 AC_MSG_CHECKING([if the systems has expire shadow information])
1150 AC_TRY_COMPILE(
1151 [
1152#include <sys/types.h>
1153#include <shadow.h>
1154 struct spwd sp;
1155 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1156 [ sp_expire_available=yes ], []
1157 )
1158
1159 if test "x$sp_expire_available" = "xyes" ; then
1160 AC_MSG_RESULT(yes)
1161 AC_DEFINE(HAS_SHADOW_EXPIRE)
1162 else
1163 AC_MSG_RESULT(no)
1164 fi
1165fi
1166
Damien Millera22ba012000-03-02 23:09:20 +11001167# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001168if test ! -z "$IPADDR_IN_DISPLAY" ; then
1169 DISPLAY_HACK_MSG="yes"
1170 AC_DEFINE(IPADDR_IN_DISPLAY)
1171else
1172 DISPLAY_HACK_MSG="no"
1173 AC_ARG_WITH(ipaddr-display,
1174 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1175 [
1176 if test "x$withval" != "xno" ; then
1177 AC_DEFINE(IPADDR_IN_DISPLAY)
1178 DISPLAY_HACK_MSG="yes"
1179 fi
1180 ]
1181 )
1182fi
Damien Miller76112de1999-12-21 11:18:08 +11001183
Damien Millera22ba012000-03-02 23:09:20 +11001184# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001185SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001186AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001187 [ --with-default-path=PATH Specify default \$PATH environment for server],
1188 [
1189 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001190 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001191 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001192 fi
1193 ]
1194)
1195
Damien Millera22ba012000-03-02 23:09:20 +11001196# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001197IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001198AC_ARG_WITH(ipv4-default,
1199 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1200 [
1201 if test "x$withval" != "xno" ; then
1202 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001203 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001204 fi
1205 ]
1206)
1207
Damien Miller61e50f12000-05-08 20:49:37 +10001208AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001209IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001210AC_ARG_WITH(4in6,
1211 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1212 [
1213 if test "x$withval" != "xno" ; then
1214 AC_MSG_RESULT(yes)
1215 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001216 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001217 else
1218 AC_MSG_RESULT(no)
1219 fi
1220 ],[
1221 if test "x$inet6_default_4in6" = "xyes"; then
1222 AC_MSG_RESULT([yes (default)])
1223 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001224 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001225 else
1226 AC_MSG_RESULT([no (default)])
1227 fi
1228 ]
1229)
1230
Damien Miller78315eb2000-09-29 23:01:36 +11001231AC_MSG_CHECKING(whether to install ssh as suid root)
1232AC_ARG_ENABLE(suid-ssh,
1233[ --enable-suid-ssh Install ssh as suid root (default)
1234 --disable-suid-ssh Install ssh without suid bit],
1235[ case "$enableval" in
1236 no)
1237 AC_MSG_RESULT(no)
1238 SSHMODE=0711
1239 ;;
1240 *) AC_MSG_RESULT(yes)
1241 SSHMODE=04711
1242 ;;
1243 esac ],
1244 AC_MSG_RESULT(yes)
1245 SSHMODE=04711
1246)
1247AC_SUBST(SSHMODE)
1248
1249
Damien Millera22ba012000-03-02 23:09:20 +11001250# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001251piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001252AC_ARG_WITH(pid-dir,
1253 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1254 [
1255 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001256 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001257 fi
1258 ]
1259)
Damien Miller4018c192000-04-30 09:30:44 +10001260
Damien Miller78315eb2000-09-29 23:01:36 +11001261# make sure the directory exists
1262if test ! -d $piddir ; then
1263 piddir=`eval echo ${sysconfdir}`
1264 case $piddir in
1265 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1266 esac
1267fi
1268
Damien Millerdbd250f2000-01-18 08:57:14 +11001269AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001270AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001271
andre2ff7b5d2000-06-03 14:57:40 +00001272dnl allow user to disable some login recording features
1273AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001274 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001275 [ AC_DEFINE(DISABLE_LASTLOG) ]
1276)
1277AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001278 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001279 [ AC_DEFINE(DISABLE_UTMP) ]
1280)
1281AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001282 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001283 [ AC_DEFINE(DISABLE_UTMPX) ]
1284)
1285AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001286 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001287 [ AC_DEFINE(DISABLE_WTMP) ]
1288)
1289AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001290 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001291 [ AC_DEFINE(DISABLE_WTMPX) ]
1292)
1293AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001294 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001295 [ AC_DEFINE(DISABLE_LOGIN) ]
1296)
1297AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001298 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001299 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1300)
1301AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001302 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001303 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1304)
1305AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001306 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001307 [ conf_lastlog_location="$withval"; ],)
1308
1309dnl lastlog, [uw]tmpx? detection
1310dnl NOTE: set the paths in the platform section to avoid the
1311dnl need for command-line parameters
1312dnl lastlog and [uw]tmp are subject to a file search if all else fails
1313
1314dnl lastlog detection
1315dnl NOTE: the code itself will detect if lastlog is a directory
1316AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1317AC_TRY_COMPILE([
1318#include <sys/types.h>
1319#include <utmp.h>
1320#ifdef HAVE_LASTLOG_H
1321# include <lastlog.h>
1322#endif
Damien Miller2994e082000-06-04 15:51:47 +10001323#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001324# include <paths.h>
1325#endif
1326 ],
1327 [ char *lastlog = LASTLOG_FILE; ],
1328 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001329 [
1330 AC_MSG_RESULT(no)
1331 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1332 AC_TRY_COMPILE([
1333#include <sys/types.h>
1334#include <utmp.h>
1335#ifdef HAVE_LASTLOG_H
1336# include <lastlog.h>
1337#endif
1338#ifdef HAVE_PATHS_H
1339# include <paths.h>
1340#endif
1341 ],
1342 [ char *lastlog = _PATH_LASTLOG; ],
1343 [ AC_MSG_RESULT(yes) ],
1344 [
andree441aa32000-06-12 22:34:38 +00001345 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001346 system_lastlog_path=no
1347 ])
1348 ]
andre2ff7b5d2000-06-03 14:57:40 +00001349)
Damien Miller2994e082000-06-04 15:51:47 +10001350
andre2ff7b5d2000-06-03 14:57:40 +00001351if test -z "$conf_lastlog_location"; then
1352 if test x"$system_lastlog_path" = x"no" ; then
1353 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001354 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001355 conf_lastlog_location=$f
1356 fi
1357 done
1358 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001359 AC_MSG_WARN([** Cannot find lastlog **])
1360 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001361 fi
1362 fi
1363fi
1364
1365if test -n "$conf_lastlog_location"; then
1366 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1367fi
1368
1369dnl utmp detection
1370AC_MSG_CHECKING([if your system defines UTMP_FILE])
1371AC_TRY_COMPILE([
1372#include <sys/types.h>
1373#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001374#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001375# include <paths.h>
1376#endif
1377 ],
1378 [ char *utmp = UTMP_FILE; ],
1379 [ AC_MSG_RESULT(yes) ],
1380 [ AC_MSG_RESULT(no)
1381 system_utmp_path=no ]
1382)
1383if test -z "$conf_utmp_location"; then
1384 if test x"$system_utmp_path" = x"no" ; then
1385 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1386 if test -f $f ; then
1387 conf_utmp_location=$f
1388 fi
1389 done
1390 if test -z "$conf_utmp_location"; then
1391 AC_DEFINE(DISABLE_UTMP)
1392 fi
1393 fi
1394fi
1395if test -n "$conf_utmp_location"; then
1396 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1397fi
1398
1399dnl wtmp detection
1400AC_MSG_CHECKING([if your system defines WTMP_FILE])
1401AC_TRY_COMPILE([
1402#include <sys/types.h>
1403#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001404#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001405# include <paths.h>
1406#endif
1407 ],
1408 [ char *wtmp = WTMP_FILE; ],
1409 [ AC_MSG_RESULT(yes) ],
1410 [ AC_MSG_RESULT(no)
1411 system_wtmp_path=no ]
1412)
1413if test -z "$conf_wtmp_location"; then
1414 if test x"$system_wtmp_path" = x"no" ; then
1415 for f in /usr/adm/wtmp /var/log/wtmp; do
1416 if test -f $f ; then
1417 conf_wtmp_location=$f
1418 fi
1419 done
1420 if test -z "$conf_wtmp_location"; then
1421 AC_DEFINE(DISABLE_WTMP)
1422 fi
1423 fi
1424fi
1425if test -n "$conf_wtmp_location"; then
1426 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1427fi
1428
1429
1430dnl utmpx detection - I don't know any system so perverse as to require
1431dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1432dnl there, though.
1433AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1434AC_TRY_COMPILE([
1435#include <sys/types.h>
1436#include <utmp.h>
1437#ifdef HAVE_UTMPX_H
1438#include <utmpx.h>
1439#endif
Damien Miller2994e082000-06-04 15:51:47 +10001440#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001441# include <paths.h>
1442#endif
1443 ],
1444 [ char *utmpx = UTMPX_FILE; ],
1445 [ AC_MSG_RESULT(yes) ],
1446 [ AC_MSG_RESULT(no)
1447 system_utmpx_path=no ]
1448)
1449if test -z "$conf_utmpx_location"; then
1450 if test x"$system_utmpx_path" = x"no" ; then
1451 AC_DEFINE(DISABLE_UTMPX)
1452 fi
1453else
1454 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1455fi
1456
1457dnl wtmpx detection
1458AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1459AC_TRY_COMPILE([
1460#include <sys/types.h>
1461#include <utmp.h>
1462#ifdef HAVE_UTMPX_H
1463#include <utmpx.h>
1464#endif
Damien Miller2994e082000-06-04 15:51:47 +10001465#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001466# include <paths.h>
1467#endif
1468 ],
1469 [ char *wtmpx = WTMPX_FILE; ],
1470 [ AC_MSG_RESULT(yes) ],
1471 [ AC_MSG_RESULT(no)
1472 system_wtmpx_path=no ]
1473)
1474if test -z "$conf_wtmpx_location"; then
1475 if test x"$system_wtmpx_path" = x"no" ; then
1476 AC_DEFINE(DISABLE_WTMPX)
1477 fi
1478else
1479 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1480fi
1481
Damien Miller4018c192000-04-30 09:30:44 +10001482
1483# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001484entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001485AC_ARG_WITH(entropy-timeout,
1486 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1487 [
1488 if test "x$withval" != "xno" ; then
1489 entropy_timeout=$withval
1490 fi
1491 ]
1492)
1493AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1494
1495
Damien Miller29ea30d2000-03-17 10:54:15 +11001496if test ! -z "$blibpath" ; then
1497 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1498 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1499fi
1500
Damien Millerbac2d8a2000-09-05 16:13:06 +11001501AC_EXEEXT
1502
Damien Miller0437b332000-05-02 09:56:41 +10001503AC_OUTPUT(Makefile ssh_prng_cmds)
1504
Damien Miller7b22d652000-06-18 14:07:04 +10001505# Print summary of options
1506
1507if test x$MANTYPE = x'$(CATMAN)' ; then
1508 MAN_MSG=cat
1509else
1510 MAN_MSG=man
1511fi
1512if test ! -z "$RANDOM_POOL" ; then
1513 RAND_MSG="Device ($RANDOM_POOL)"
1514else
1515 if test ! -z "$EGD_SOCKET" ; then
1516 RAND_MSG="EGD ($EGD_SOCKET)"
1517 else
1518 RAND_MSG="Builtin (timeout $entropy_timeout)"
1519 fi
1520fi
1521
1522# Someone please show me a better way :)
1523A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1524B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1525C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1526D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001527E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001528F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1529G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1530
1531echo ""
1532echo "OpenSSH configured has been configured with the following options."
1533echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001534echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001535echo " System binaries: $C"
1536echo " Configuration files: $D"
1537echo " Askpass program: $E"
1538echo " Manual pages: $F"
1539echo " PID file: $G"
1540echo " Random number collection: $RAND_MSG"
1541echo " Manpage format: $MAN_MSG"
1542echo " PAM support: ${PAM_MSG}"
1543echo " KerberosIV support: $KRB4_MSG"
1544echo " AFS support: $AFS_MSG"
1545echo " S/KEY support: $SKEY_MSG"
1546echo " TCP Wrappers support: $TCPW_MSG"
1547echo " MD5 password support: $MD5_MSG"
1548echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1549echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1550echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1551
1552echo ""
1553
Damien Millere68f92b2000-10-02 21:42:15 +11001554echo " Host: ${host}"
1555echo " Compiler: ${CC}"
1556echo " Compiler flags: ${CFLAGS}"
1557echo " Linker flags: ${LDFLAGS}"
1558echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001559
1560echo ""
1561