blob: 01c5410135e46ae9c60758d4641680deb0b3c20c [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 Miller3f62aba2000-11-29 11:56:35 +110018if test -z "$AR" ; then
19 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
20fi
21
Damien Millerad833b32000-08-23 10:46:23 +100022# Use LOGIN_PROGRAM from environment if possible
23if test ! -z "$LOGIN_PROGRAM" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
25else
26 # Search for login
27 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
28 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
30 fi
31fi
32
Damien Miller166bd442000-03-16 10:48:25 +110033if test -z "$LD" ; then
34 LD=$CC
35fi
36AC_SUBST(LD)
37
38# C Compiler features
39AC_C_INLINE
40if test "$GCC" = "yes"; then
41 CFLAGS="$CFLAGS -Wall"
42fi
43
Damien Miller78315eb2000-09-29 23:01:36 +110044CFLAGS="$CFLAGS -I. -I${srcdir-.}"
45
Damien Millera22ba012000-03-02 23:09:20 +110046# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110047case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110048*-*-aix*)
49 AFS_LIBS="-lld"
Damien Millerdb819592000-03-14 13:44:01 +110050 CFLAGS="$CFLAGS -I/usr/local/include"
51 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100052 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110053 blibpath="/usr/lib:/lib:/usr/local/lib"
54 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100055 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110056 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000057 MANTYPE='$(CATMAN)'
58 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000059 dnl AIX handles lastlog as part of its login message
60 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100061 MANTYPE='$(CATMAN)'
62 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110063 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110064*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110065 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110066 AC_DEFINE(HAVE_CYGWIN)
67 AC_DEFINE(DISABLE_PAM)
68 AC_DEFINE(DISABLE_SHADOW)
69 AC_DEFINE(IPV4_DEFAULT)
70 AC_DEFINE(IP_TOS_IS_BROKEN)
71 AC_DEFINE(BROKEN_VHANGUP)
72 no_pam=1
73 no_libsocket=1
74 no_libnsl=1
75 ;;
Damien Miller76112de1999-12-21 11:18:08 +110076*-*-hpux10*)
77 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100078 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110079 fi
80 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110081 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100082 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110083 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110084 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000085 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110086 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110087 MANTYPE='$(CATMAN)'
88 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110089 ;;
Damien Miller1bead332000-04-30 00:47:29 +100090*-*-hpux11*)
Damien Miller1bead332000-04-30 00:47:29 +100091 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110092 IPADDR_IN_DISPLAY=yes
Damien Miller5552d7a2000-08-30 09:53:24 +110093 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110094 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110095 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000096 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110097 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +100098 MANTYPE='$(CATMAN)'
99 mansubdir=cat
100 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100101*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +1100102 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000103 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100104 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100105 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100106 no_libsocket=1
107 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000108 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100109 ;;
110*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +1100111 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000112 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100113 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100114 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000115 AC_DEFINE(WITH_IRIX_ARRAY)
116 AC_DEFINE(WITH_IRIX_PROJECT)
117 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000118 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100119 no_libsocket=1
120 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000121 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100122 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100123*-*-linux*)
124 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100125 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000126 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100127 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100128 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000129mips-sony-bsd|mips-sony-newsos4)
130 AC_DEFINE(HAVE_NEWS4)
131 SONY=1
132 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
133 AC_MSG_ERROR([*** libiberty missing - please install first ***])
134 )
135 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100136*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100137 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100138 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000139*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000140 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100141 conf_utmp_location=/etc/utmp
142 conf_wtmp_location=/usr/adm/wtmp
143 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000144 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000145 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000146 AC_DEFINE(USE_PIPES)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000147 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000148 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100149*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100150 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100151 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100152 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000153 # hardwire lastlog location (can't detect it on some versions)
154 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000155 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
156 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
157 if test "$sol2ver" -ge 8; then
158 AC_MSG_RESULT(yes)
159 AC_DEFINE(DISABLE_UTMP)
160 AC_DEFINE(DISABLE_WTMP)
161 else
162 AC_MSG_RESULT(no)
163 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100164 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000165*-*-sunos4*)
166 CFLAGS="$CFLAGS -DSUNOS4"
167 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000168 conf_utmp_location=/etc/utmp
169 conf_wtmp_location=/var/adm/wtmp
170 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000171 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000172 MANTYPE='$(CATMAN)'
173 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000174 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000175*-sni-sysv*)
176 CFLAGS="$CFLAGS -I/usr/local/include"
177 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
178 MANTYPE='$(CATMAN)'
179 AC_DEFINE(IP_TOS_IS_BROKEN)
180 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000181 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000182 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100183*-*-sysv4.2*)
184 CFLAGS="$CFLAGS -I/usr/local/include"
185 LDFLAGS="$LDFLAGS -L/usr/local/lib"
186 MANTYPE='$(CATMAN)'
187 mansubdir=cat
188 LIBS="$LIBS -lgen -lsocket -lnsl -lresolv"
189 enable_suid_ssh=no
190 ;;
191*-*-sysv5*)
192 CFLAGS="$CFLAGS -I/usr/local/include"
193 LDFLAGS="$LDFLAGS -L/usr/local/lib"
194 MANTYPE='$(CATMAN)'
195 mansubdir=cat
196 LIBS="$LIBS -lgen -lsocket"
197 enable_suid_ssh=no
198 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100199*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100200 CFLAGS="$CFLAGS -I/usr/local/include"
201 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100202 MANTYPE='$(CATMAN)'
203 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100204 LIBS="$LIBS -lgen -lsocket"
205 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100206*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100207 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100208 CFLAGS="$CFLAGS -Dftruncate=chsize -I/usr/local/include"
209 LDFLAGS="$LDFLAGS -L/usr/local/lib"
210 MANTYPE='$(CATMAN)'
211 mansubdir=cat
Ben Lindstrom980754c2000-11-12 00:04:24 +0000212 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100213 no_dev_ptmx=1
214 RANLIB=true
215 AC_DEFINE(BROKEN_SYS_TERMIO_H)
216 rsh_path="/usr/bin/rcmd"
217 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000218 AC_DEFINE(DISABLE_SHADOW)
Damien Miller78315eb2000-09-29 23:01:36 +1100219 ;;
220*-*-sco3.2v5*)
Damien Millera66626b2000-06-13 18:57:53 +1000221 CFLAGS="$CFLAGS -I/usr/local/include"
222 LDFLAGS="$LDFLAGS -L/usr/local/lib"
223 MANTYPE='$(CATMAN)'
224 mansubdir=cat
Ben Lindstrom980754c2000-11-12 00:04:24 +0000225 LIBS="$LIBS -lgen -lsocket -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000226 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100227 rsh_path="/usr/bin/rcmd"
228 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000229 AC_DEFINE(DISABLE_SHADOW)
Damien Millera66626b2000-06-13 18:57:53 +1000230 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000231*-dec-osf*)
232# This is untested
233 if test ! -z "USE_SIA" ; then
234 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
235 if test -f /etc/sia/matrix.conf; then
236 AC_MSG_RESULT(yes)
237 AC_DEFINE(HAVE_OSF_SIA)
238 AC_DEFINE(DISABLE_LOGIN)
239 LIBS="$LIBS -lsecurity -ldb -lm -laud"
240 else
241 AC_MSG_RESULT(no)
242 fi
243 fi
244 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100245esac
246
Damien Millere37bfc12000-06-05 09:37:43 +1000247# Allow user to specify flags
248AC_ARG_WITH(cflags,
249 [ --with-cflags Specify additional flags to pass to compiler],
250 [
251 if test "x$withval" != "xno" ; then
252 CFLAGS="$CFLAGS $withval"
253 fi
254 ]
255)
256AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000257 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000258 [
259 if test "x$withval" != "xno" ; then
260 LDFLAGS="$LDFLAGS $withval"
261 fi
262 ]
263)
264AC_ARG_WITH(libs,
265 [ --with-libs Specify additional libraries to link with],
266 [
267 if test "x$withval" != "xno" ; then
268 LIBS="$LIBS $withval"
269 fi
270 ]
271)
272
273
Damien Millera22ba012000-03-02 23:09:20 +1100274# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100275AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
276AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100277
278AC_CHECK_FUNC(regcomp,
279 [],
280 [
281 AC_CHECK_LIB(pcre, pcre_info,
282 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
283 ]
284)
Damien Millerab18c411999-11-11 10:40:23 +1100285
Damien Millerbeb4ba51999-12-28 15:09:35 +1100286if test -z "$no_libsocket" ; then
287 AC_CHECK_LIB(nsl, yp_match, , )
288fi
289if test -z "$no_libnsl" ; then
290 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100291fi
Damien Millerab18c411999-11-11 10:40:23 +1100292
Damien Millera22ba012000-03-02 23:09:20 +1100293# Checks for header files.
Damien Miller874d77b2000-10-14 16:23:11 +1100294AC_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 +1100295
Damien Millerad833b32000-08-23 10:46:23 +1000296dnl Checks for library functions.
Ben Lindstrom67e21e12000-11-05 09:08:45 +0000297AC_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 setsid sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000298dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000299AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000300dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000301AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000302dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000303AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
304AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000305dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000306AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
307AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100308
Damien Miller5fc85652000-07-09 23:53:07 +1000309AC_CHECK_FUNC(getuserattr,
310 [AC_DEFINE(HAVE_GETUSERATTR)],
311 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
312)
313
Damien Miller04f80141999-11-19 15:32:34 +1100314AC_CHECK_FUNC(login,
315 [AC_DEFINE(HAVE_LOGIN)],
316 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
317)
318
319AC_CHECK_FUNC(daemon,
320 [AC_DEFINE(HAVE_DAEMON)],
321 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
322)
323
Damien Miller9fb07e42000-03-05 16:22:59 +1100324AC_CHECK_FUNC(getpagesize,
325 [AC_DEFINE(HAVE_GETPAGESIZE)],
326 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
327)
328
Damien Millercb170cb2000-07-01 16:52:55 +1000329# Check for broken snprintf
330if test "x$ac_cv_func_snprintf" = "xyes" ; then
331 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
332 AC_TRY_RUN(
333 [
334#include <stdio.h>
335int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
336 ],
337 [AC_MSG_RESULT(yes)],
338 [
339 AC_MSG_RESULT(no)
340 AC_DEFINE(BROKEN_SNPRINTF)
341 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
342 ]
343 )
344fi
345
Damien Miller606f8802000-09-16 15:39:56 +1100346AC_FUNC_GETPGRP
347
Damien Miller7b22d652000-06-18 14:07:04 +1000348PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100349AC_ARG_WITH(pam,
350 [ --without-pam Disable PAM support ],
351 [
352 if test "x$withval" = "xno" ; then
353 no_pam=1
354 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000355 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100356 fi
357 ]
358)
Damien Milleredb82922000-06-20 13:25:52 +1000359if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100360 AC_CHECK_LIB(dl, dlopen, , )
361 LIBS="$LIBS -lpam"
362
Damien Miller0e65eed2000-05-17 22:16:05 +1000363 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000364
Damien Miller1f335fb2000-06-26 11:31:33 +1000365 disable_shadow=yes
366
Damien Miller7b22d652000-06-18 14:07:04 +1000367 PAM_MSG="yes"
368
Damien Millera22ba012000-03-02 23:09:20 +1100369 # Check PAM strerror arguments (old PAM)
370 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
371 AC_TRY_COMPILE(
372 [
Damien Miller81171112000-04-23 11:14:01 +1000373#include <stdlib.h>
374#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100375 ],
376 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
377 [AC_MSG_RESULT(no)],
378 [
379 AC_DEFINE(HAVE_OLD_PAM)
380 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000381 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100382 ]
383 )
384fi
385
386# The big search for OpenSSL
387AC_ARG_WITH(ssl-dir,
388 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
389 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000390 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100391 tryssldir=$withval
392 fi
393 ]
394)
395
396saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100397saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100398saved_CFLAGS="$CFLAGS"
399if test "x$prefix" != "xNONE" ; then
400 tryssldir="$tryssldir $prefix"
401fi
Damien Miller61e50f12000-05-08 20:49:37 +1000402AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100403
Damien Millera1b61e12000-09-16 17:02:16 +1100404 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 +1000405 if test ! -z "$ssldir" ; then
406 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
407 CFLAGS="$saved_CFLAGS -I$ssldir/include"
408 if test ! -z "$need_dash_r" ; then
409 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
410 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100411 else
Damien Miller61e50f12000-05-08 20:49:37 +1000412 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100413 fi
414
Damien Miller3b512e12000-05-17 23:29:18 +1000415 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000416
Damien Miller3b512e12000-05-17 23:29:18 +1000417 # Basic test to check for compatible version and correct linking
418 # *does not* test for RSA - that comes later.
419 AC_TRY_RUN(
420 [
Damien Millere59ce622000-05-01 20:54:17 +1000421#include <string.h>
422#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000423int main(void)
424{
Damien Miller3b512e12000-05-17 23:29:18 +1000425 char a[2048];
426 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000427 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000428 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000429}
Damien Miller3b512e12000-05-17 23:29:18 +1000430 ],
431 [
432 found_crypto=1
433 break;
434 ], []
435 )
Damien Miller61e50f12000-05-08 20:49:37 +1000436
437 if test ! -z "$found_crypto" ; then
438 break;
439 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100440 done
441
Damien Miller61e50f12000-05-08 20:49:37 +1000442 if test -z "$found_crypto" ; then
443 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100444 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000445 if test -z "$ssldir" ; then
446 ssldir="(system)"
447 fi
Damien Millera22ba012000-03-02 23:09:20 +1100448
Damien Miller61e50f12000-05-08 20:49:37 +1000449 ac_cv_openssldir=$ssldir
450])
451
Damien Milleredb82922000-06-20 13:25:52 +1000452if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000453 AC_DEFINE(HAVE_OPENSSL)
454 dnl Need to recover ssldir - test above runs in subshell
455 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100456 CFLAGS="$saved_CFLAGS -I$ssldir/include"
457 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
458 if test ! -z "$need_dash_r" ; then
459 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100460 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100461 if test ! -z "$blibpath" ; then
462 blibpath="$blibpath:$ssldir:$ssldir/lib"
463 fi
Damien Millera22ba012000-03-02 23:09:20 +1100464fi
Damien Miller3b512e12000-05-17 23:29:18 +1000465LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000466
Damien Miller3b512e12000-05-17 23:29:18 +1000467# Now test RSA support
468saved_LIBS="$LIBS"
469AC_MSG_CHECKING([for RSA support])
470for WANTS_RSAREF in "" 1 ; do
471 if test -z "$WANTS_RSAREF" ; then
472 LIBS="$saved_LIBS"
473 else
474 LIBS="$saved_LIBS -lRSAglue -lrsaref"
475 fi
476 AC_TRY_RUN([
477#include <string.h>
478#include <openssl/rand.h>
479#include <openssl/rsa.h>
480#include <openssl/bn.h>
481#include <openssl/sha.h>
482int main(void)
483{
484 int num; RSA *key; static unsigned char p_in[] = "blahblah";
485 unsigned char c[256], p[256];
486 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
487 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
488 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
489 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
490}
491 ],
492 [
493 rsa_works=1
494 break;
495 ], [])
496done
497
498if test ! -z "$no_rsa" ; then
499 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000500 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000501else
502 if test -z "$rsa_works" ; then
503 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000504 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000505 else
506 if test -z "$WANTS_RSAREF" ; then
507 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000508 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000509 else
Damien Miller7b22d652000-06-18 14:07:04 +1000510 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000511 AC_MSG_RESULT(using RSAref)
512 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
513 fi
514 fi
515fi
Damien Millera22ba012000-03-02 23:09:20 +1100516
Ben Lindstromb5628642000-10-18 00:02:25 +0000517# Cheap hack to ensure NEWS-OS libraries are arranged right.
518if test ! -z "$SONY" ; then
519 LIBS="$LIBS -liberty";
520fi
521
Damien Millera22ba012000-03-02 23:09:20 +1100522# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100523AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100524AC_CHECK_SIZEOF(short int, 2)
525AC_CHECK_SIZEOF(int, 4)
526AC_CHECK_SIZEOF(long int, 4)
527AC_CHECK_SIZEOF(long long int, 8)
528
Damien Millera22ba012000-03-02 23:09:20 +1100529# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100530AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
531 AC_TRY_COMPILE(
532 [ #include <sys/types.h> ],
533 [ u_int a; a = 1;],
534 [ ac_cv_have_u_int="yes" ],
535 [ ac_cv_have_u_int="no" ]
536 )
537])
538if test "x$ac_cv_have_u_int" = "xyes" ; then
539 AC_DEFINE(HAVE_U_INT)
540 have_u_int=1
541fi
542
Damien Miller61e50f12000-05-08 20:49:37 +1000543AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
544 AC_TRY_COMPILE(
545 [ #include <sys/types.h> ],
546 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
547 [ ac_cv_have_intxx_t="yes" ],
548 [ ac_cv_have_intxx_t="no" ]
549 )
550])
551if test "x$ac_cv_have_intxx_t" = "xyes" ; then
552 AC_DEFINE(HAVE_INTXX_T)
553 have_intxx_t=1
554fi
555
Damien Miller578783e2000-09-23 14:12:24 +1100556AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
557 AC_TRY_COMPILE(
558 [ #include <sys/types.h> ],
559 [ int64_t a; a = 1;],
560 [ ac_cv_have_int64_t="yes" ],
561 [ ac_cv_have_int64_t="no" ]
562 )
563])
564if test "x$ac_cv_have_int64_t" = "xyes" ; then
565 AC_DEFINE(HAVE_INT64_T)
566 have_int64_t=1
567fi
568
Damien Miller61e50f12000-05-08 20:49:37 +1000569AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
570 AC_TRY_COMPILE(
571 [ #include <sys/types.h> ],
572 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
573 [ ac_cv_have_u_intxx_t="yes" ],
574 [ ac_cv_have_u_intxx_t="no" ]
575 )
576])
577if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
578 AC_DEFINE(HAVE_U_INTXX_T)
579 have_u_intxx_t=1
580fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100581
Damien Miller578783e2000-09-23 14:12:24 +1100582AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
583 AC_TRY_COMPILE(
584 [ #include <sys/types.h> ],
585 [ u_int64_t a; a = 1;],
586 [ ac_cv_have_u_int64_t="yes" ],
587 [ ac_cv_have_u_int64_t="no" ]
588 )
589])
590if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
591 AC_DEFINE(HAVE_U_INT64_T)
592 have_u_int64_t=1
593fi
594
Damien Milleredb82922000-06-20 13:25:52 +1000595if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
596 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100597then
598 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
599 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000600 [
601#include <sys/bitypes.h>
602 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100603 [
Damien Miller70494d12000-04-03 15:57:06 +1000604 int8_t a; int16_t b; int32_t c;
605 u_int8_t e; u_int16_t f; u_int32_t g;
606 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100607 ],
608 [
609 AC_DEFINE(HAVE_U_INTXX_T)
610 AC_DEFINE(HAVE_INTXX_T)
611 AC_MSG_RESULT(yes)
612 ],
613 [AC_MSG_RESULT(no)]
614 )
615fi
616
Damien Millerd6121d22000-03-17 23:26:46 +1100617if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000618 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
619 AC_TRY_COMPILE(
620 [
621#include <sys/types.h>
622 ],
623 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
624 [ ac_cv_have_uintxx_t="yes" ],
625 [ ac_cv_have_uintxx_t="no" ]
626 )
627 ])
628 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
629 AC_DEFINE(HAVE_UINTXX_T)
630 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100631fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100632
Damien Miller61e50f12000-05-08 20:49:37 +1000633AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
634 AC_TRY_COMPILE(
635 [
Damien Miller81171112000-04-23 11:14:01 +1000636#include <sys/types.h>
637#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000638 ],
639 [socklen_t foo; foo = 1235;],
640 [ ac_cv_have_socklen_t="yes" ],
641 [ ac_cv_have_socklen_t="no" ]
642 )
643])
644if test "x$ac_cv_have_socklen_t" = "xyes" ; then
645 AC_DEFINE(HAVE_SOCKLEN_T)
646fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100647
Damien Miller61e50f12000-05-08 20:49:37 +1000648AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
649 AC_TRY_COMPILE(
650 [
651#include <sys/types.h>
652 ],
653 [ size_t foo; foo = 1235; ],
654 [ ac_cv_have_size_t="yes" ],
655 [ ac_cv_have_size_t="no" ]
656 )
657])
658if test "x$ac_cv_have_size_t" = "xyes" ; then
659 AC_DEFINE(HAVE_SIZE_T)
660fi
Damien Miller95058511999-12-29 10:36:45 +1100661
Damien Miller615f9392000-05-17 22:53:33 +1000662AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
663 AC_TRY_COMPILE(
664 [
665#include <sys/types.h>
666 ],
667 [ ssize_t foo; foo = 1235; ],
668 [ ac_cv_have_ssize_t="yes" ],
669 [ ac_cv_have_ssize_t="no" ]
670 )
671])
672if test "x$ac_cv_have_ssize_t" = "xyes" ; then
673 AC_DEFINE(HAVE_SSIZE_T)
674fi
675
Damien Millerb54b40e2000-06-23 08:23:34 +1000676AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
677 AC_TRY_COMPILE(
678 [
679#include <sys/types.h>
680#include <sys/socket.h>
681 ],
682 [ sa_family_t foo; foo = 1235; ],
683 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100684 [ AC_TRY_COMPILE(
685 [
686#include <sys/types.h>
687#include <sys/socket.h>
688#include <netinet/in.h>
689 ],
690 [ sa_family_t foo; foo = 1235; ],
691 [ ac_cv_have_sa_family_t="yes" ],
692
Damien Millerb54b40e2000-06-23 08:23:34 +1000693 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100694 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000695 )
696])
697if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
698 AC_DEFINE(HAVE_SA_FAMILY_T)
699fi
700
Damien Miller0f91b4e2000-06-18 15:43:25 +1000701AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
702 AC_TRY_COMPILE(
703 [
704#include <sys/types.h>
705 ],
706 [ pid_t foo; foo = 1235; ],
707 [ ac_cv_have_pid_t="yes" ],
708 [ ac_cv_have_pid_t="no" ]
709 )
710])
711if test "x$ac_cv_have_pid_t" = "xyes" ; then
712 AC_DEFINE(HAVE_PID_T)
713fi
714
715AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
716 AC_TRY_COMPILE(
717 [
718#include <sys/types.h>
719 ],
720 [ mode_t foo; foo = 1235; ],
721 [ ac_cv_have_mode_t="yes" ],
722 [ ac_cv_have_mode_t="no" ]
723 )
724])
725if test "x$ac_cv_have_mode_t" = "xyes" ; then
726 AC_DEFINE(HAVE_MODE_T)
727fi
728
Damien Miller61e50f12000-05-08 20:49:37 +1000729
730AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
731 AC_TRY_COMPILE(
732 [
Damien Miller81171112000-04-23 11:14:01 +1000733#include <sys/types.h>
734#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000735 ],
736 [ struct sockaddr_storage s; ],
737 [ ac_cv_have_struct_sockaddr_storage="yes" ],
738 [ ac_cv_have_struct_sockaddr_storage="no" ]
739 )
740])
741if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
742 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
743fi
Damien Miller34132e52000-01-14 15:45:46 +1100744
Damien Miller61e50f12000-05-08 20:49:37 +1000745AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
746 AC_TRY_COMPILE(
747 [
Damien Miller7b22d652000-06-18 14:07:04 +1000748#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000749#include <netinet/in.h>
750 ],
751 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
752 [ ac_cv_have_struct_sockaddr_in6="yes" ],
753 [ ac_cv_have_struct_sockaddr_in6="no" ]
754 )
755])
756if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
757 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
758fi
Damien Miller34132e52000-01-14 15:45:46 +1100759
Damien Miller61e50f12000-05-08 20:49:37 +1000760AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
761 AC_TRY_COMPILE(
762 [
Damien Miller7b22d652000-06-18 14:07:04 +1000763#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000764#include <netinet/in.h>
765 ],
766 [ struct in6_addr s; s.s6_addr[0] = 0; ],
767 [ ac_cv_have_struct_in6_addr="yes" ],
768 [ ac_cv_have_struct_in6_addr="no" ]
769 )
770])
771if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
772 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
773fi
Damien Miller34132e52000-01-14 15:45:46 +1100774
Damien Miller61e50f12000-05-08 20:49:37 +1000775AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
776 AC_TRY_COMPILE(
777 [
Damien Miller81171112000-04-23 11:14:01 +1000778#include <sys/types.h>
779#include <sys/socket.h>
780#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000781 ],
782 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
783 [ ac_cv_have_struct_addrinfo="yes" ],
784 [ ac_cv_have_struct_addrinfo="no" ]
785 )
786])
787if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
788 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
789fi
790
Damien Miller78315eb2000-09-29 23:01:36 +1100791dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000792OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
793OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
794OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
795OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
796OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000797OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000798OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
799OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000800OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000801OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
802OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
803OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
804OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000805OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
806OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
807OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
808OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100809AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000810
Damien Miller942da032000-08-18 13:59:06 +1000811AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
812 ac_cv_have_sun_len_in_struct_sockaddr_un, [
813 AC_TRY_COMPILE(
814 [
815#include <sys/types.h>
816#include <sys/socket.h>
817 ],
818 [ struct sockaddr_un s; s.sun_len = 1; ],
819 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
820 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
821 )
822])
823if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
824 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
825fi
826
Damien Miller61e50f12000-05-08 20:49:37 +1000827AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
828 ac_cv_have_ss_family_in_struct_ss, [
829 AC_TRY_COMPILE(
830 [
Damien Miller81171112000-04-23 11:14:01 +1000831#include <sys/types.h>
832#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000833 ],
834 [ struct sockaddr_storage s; s.ss_family = 1; ],
835 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
836 [ ac_cv_have_ss_family_in_struct_ss="no" ],
837 )
838])
839if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
840 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
841fi
842
Damien Miller61e50f12000-05-08 20:49:37 +1000843AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
844 ac_cv_have___ss_family_in_struct_ss, [
845 AC_TRY_COMPILE(
846 [
Damien Miller81171112000-04-23 11:14:01 +1000847#include <sys/types.h>
848#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000849 ],
850 [ struct sockaddr_storage s; s.__ss_family = 1; ],
851 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
852 [ ac_cv_have___ss_family_in_struct_ss="no" ]
853 )
854])
855if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
856 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
857fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100858
Damien Millerad833b32000-08-23 10:46:23 +1000859AC_CACHE_CHECK([for pw_class field in struct passwd],
860 ac_cv_have_pw_class_in_struct_passwd, [
861 AC_TRY_COMPILE(
862 [
Damien Millerad833b32000-08-23 10:46:23 +1000863#include <pwd.h>
864 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000865 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000866 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
867 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
868 )
869])
870if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
871 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
872fi
873
Damien Miller61e50f12000-05-08 20:49:37 +1000874
875AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
876 AC_TRY_LINK([],
877 [ extern char *__progname; printf("%s", __progname); ],
878 [ ac_cv_libc_defines___progname="yes" ],
879 [ ac_cv_libc_defines___progname="no" ]
880 )
881])
882if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
883 AC_DEFINE(HAVE___PROGNAME)
884fi
885
Damien Millera22ba012000-03-02 23:09:20 +1100886
Damien Millerecbb26d2000-07-15 14:59:14 +1000887AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
888 AC_TRY_LINK([],
889 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
890 [ ac_cv_libc_defines_sys_errlist="yes" ],
891 [ ac_cv_libc_defines_sys_errlist="no" ]
892 )
893])
894if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
895 AC_DEFINE(HAVE_SYS_ERRLIST)
896fi
897
898
Damien Miller11fa2cc2000-08-16 10:35:58 +1000899AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
900 AC_TRY_LINK([],
901 [ extern int sys_nerr; printf("%i", sys_nerr);],
902 [ ac_cv_libc_defines_sys_nerr="yes" ],
903 [ ac_cv_libc_defines_sys_nerr="no" ]
904 )
905])
906if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
907 AC_DEFINE(HAVE_SYS_NERR)
908fi
909
910
Damien Millera22ba012000-03-02 23:09:20 +1100911# Looking for programs, paths and files
912AC_ARG_WITH(rsh,
913 [ --with-rsh=PATH Specify path to remote shell program ],
914 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100915 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000916 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100917 fi
918 ],
919 [
920 AC_PATH_PROG(rsh_path, rsh)
921 ]
922)
923
924AC_ARG_WITH(xauth,
925 [ --with-xauth=PATH Specify path to xauth program ],
926 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000927 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000928 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100929 fi
930 ],
931 [
Damien Miller78315eb2000-09-29 23:01:36 +1100932 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 +1000933 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100934 xauth_path="/usr/openwin/bin/xauth"
935 fi
936 ]
937)
938
939if test ! -z "$xauth_path" ; then
940 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
941fi
942if test ! -z "$rsh_path" ; then
943 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
944fi
945
946# Check for mail directory (last resort if we cannot get it from headers)
947if test ! -z "$MAIL" ; then
948 maildir=`dirname $MAIL`
949 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
950fi
951
Damien Millera22ba012000-03-02 23:09:20 +1100952if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100953 AC_CHECK_FILE("/dev/ptmx",
954 [
955 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
956 have_dev_ptmx=1
957 ]
958 )
Damien Millera22ba012000-03-02 23:09:20 +1100959fi
Damien Miller204ad072000-03-02 23:56:12 +1100960AC_CHECK_FILE("/dev/ptc",
961 [
962 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
963 have_dev_ptc=1
964 ]
965)
966
Damien Millera22ba012000-03-02 23:09:20 +1100967# Options from here on. Some of these are preset by platform above
968
Damien Millera22ba012000-03-02 23:09:20 +1100969# Check for user-specified random device, otherwise check /dev/urandom
970AC_ARG_WITH(random,
971 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
972 [
Damien Miller040f3832000-04-03 14:50:43 +1000973 if test "x$withval" != "xno" ; then
974 RANDOM_POOL="$withval";
975 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
976 fi
Damien Millera22ba012000-03-02 23:09:20 +1100977 ],
978 [
979 # Check for random device
980 AC_CHECK_FILE("/dev/urandom",
981 [
982 RANDOM_POOL="/dev/urandom";
983 AC_SUBST(RANDOM_POOL)
984 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
985 ]
986 )
987 ]
988)
989
990# Check for EGD pool file
991AC_ARG_WITH(egd-pool,
992 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
993 [
Damien Miller040f3832000-04-03 14:50:43 +1000994 if test "x$withval" != "xno" ; then
995 EGD_SOCKET="$withval";
996 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
997 fi
Damien Millera22ba012000-03-02 23:09:20 +1100998 ]
999)
1000
Damien Miller0437b332000-05-02 09:56:41 +10001001# detect pathnames for entropy gathering commands, if we need them
1002INSTALL_SSH_PRNG_CMDS=""
1003rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001004if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001005 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001006 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1007 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1008 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1009 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1010 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1011 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1012 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1013 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1014 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1015 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1016 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1017 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1018 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1019 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1020 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +10001021
1022 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001023fi
Damien Miller0437b332000-05-02 09:56:41 +10001024AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1025
Damien Miller11e37f62000-04-08 18:23:30 +10001026
Damien Miller670a4b82000-01-22 13:53:11 +11001027AC_ARG_WITH(catman,
1028 [ --with-catman=man|cat Install preformatted manpages[no]],
1029 [
1030 MANTYPE='$(CATMAN)'
1031 if test x"$withval" != x"yes" ; then
1032 mansubdir=$withval
1033 else
1034 mansubdir=cat
1035 fi
1036 ], [
1037 if test -z "$MANTYPE" ; then
1038 MANTYPE='$(TROFFMAN)'
1039 mansubdir=man
1040 fi
1041 ]
1042)
1043AC_SUBST(MANTYPE)
1044AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001045
Damien Millera22ba012000-03-02 23:09:20 +11001046# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001047KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001048AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001049 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001050 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001051 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001052
Ben Lindstrom23e13712000-10-29 22:49:19 +00001053 if test "x$withval" != "xyes" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001054 CFLAGS="$CFLAGS -I${withval}/include"
1055 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001056 if test ! -z "$need_dash_r" ; then
1057 LDFLAGS="$LDFLAGS -R${withval}/lib"
1058 fi
1059 if test ! -z "$blibpath" ; then
1060 blibpath="$blibpath:${withval}/lib"
1061 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001062 else
1063 if test -d /usr/include/kerberosIV ; then
1064 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
1065 fi
1066 fi
1067
1068 AC_CHECK_HEADERS(krb.h)
1069 AC_CHECK_LIB(krb, main)
1070 if test "$ac_cv_header_krb_h" != yes; then
1071 AC_MSG_WARN([Cannot find krb.h, build may fail])
1072 fi
1073 if test "$ac_cv_lib_krb_main" != yes; then
1074 AC_MSG_WARN([Cannot find libkrb, build may fail])
1075 fi
1076
Damien Millerc85f9b42000-01-29 10:20:21 +11001077 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001078 AC_CHECK_LIB(resolv, dn_expand, , )
1079 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001080 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001081 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001082 fi
Damien Miller80297751999-11-19 13:03:25 +11001083 ]
1084)
1085
Damien Millera22ba012000-03-02 23:09:20 +11001086# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001087AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001088AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001089 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001090 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001091 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001092
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001093 if test "x$withval" != "xyes" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001094 CFLAGS="$CFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001095 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller105b7f02000-01-07 08:45:55 +11001096 fi
1097
1098 if test -z "$KRB4" ; then
1099 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1100 fi
1101
Damien Miller8bdeee21999-12-30 15:50:54 +11001102 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001103 if test ! -z "$AFS_LIBS" ; then
1104 LIBS="$LIBS $AFS_LIBS"
1105 fi
1106 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001107 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001108 fi
Damien Miller80297751999-11-19 13:03:25 +11001109 ]
1110)
Damien Millerc85f9b42000-01-29 10:20:21 +11001111LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001112
Damien Millera22ba012000-03-02 23:09:20 +11001113# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001114SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001115AC_ARG_WITH(skey,
Ben Lindstrom305fb002000-11-10 02:41:30 +00001116 [ --with-skey=PATH Enable S/Key support],
Damien Miller80297751999-11-19 13:03:25 +11001117 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001118 if test "x$withval" != "xno" ; then
Ben Lindstrom305fb002000-11-10 02:41:30 +00001119
1120 if test "x$withval" != "xyes" ; then
1121 CFLAGS="$CFLAGS -I${withval}/include"
1122 LDFLAGS="$LDFLAGS -L${withval}/lib"
1123 fi
1124
Damien Miller8bdeee21999-12-30 15:50:54 +11001125 AC_DEFINE(SKEY)
1126 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001127 SKEY_MSG="yes"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001128
1129 AC_CHECK_FUNC(skey_keyinfo,
1130 [],
1131 [
1132 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1133 ])
Damien Miller8bdeee21999-12-30 15:50:54 +11001134 fi
Damien Miller80297751999-11-19 13:03:25 +11001135 ]
1136)
1137
Damien Millera22ba012000-03-02 23:09:20 +11001138# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001139TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001140AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001141 [ --with-tcp-wrappers Enable tcpwrappers support],
1142 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001143 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001144 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001145 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001146 AC_MSG_CHECKING(for libwrap)
1147 AC_TRY_LINK(
1148 [
Damien Miller81171112000-04-23 11:14:01 +10001149#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001150 int deny_severity = 0, allow_severity = 0;
1151 ],
1152 [hosts_access(0);],
1153 [
1154 AC_MSG_RESULT(yes)
1155 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001156 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001157 ],
1158 [
Damien Miller7b22d652000-06-18 14:07:04 +10001159 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001160 ]
1161 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001162 fi
Damien Miller80297751999-11-19 13:03:25 +11001163 ]
1164)
1165
Damien Millera22ba012000-03-02 23:09:20 +11001166# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001167MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001168AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001169 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001170 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001171 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001172 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001173 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001174 fi
1175 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001176)
1177
Damien Millera22ba012000-03-02 23:09:20 +11001178# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001179AC_ARG_WITH(shadow,
1180 [ --without-shadow Disable shadow password support],
1181 [
1182 if test "x$withval" = "xno" ; then
1183 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001184 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001185 fi
1186 ]
1187)
1188
Damien Miller1f335fb2000-06-26 11:31:33 +10001189if test -z "$disable_shadow" ; then
1190 AC_MSG_CHECKING([if the systems has expire shadow information])
1191 AC_TRY_COMPILE(
1192 [
1193#include <sys/types.h>
1194#include <shadow.h>
1195 struct spwd sp;
1196 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1197 [ sp_expire_available=yes ], []
1198 )
1199
1200 if test "x$sp_expire_available" = "xyes" ; then
1201 AC_MSG_RESULT(yes)
1202 AC_DEFINE(HAS_SHADOW_EXPIRE)
1203 else
1204 AC_MSG_RESULT(no)
1205 fi
1206fi
1207
Damien Millera22ba012000-03-02 23:09:20 +11001208# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001209if test ! -z "$IPADDR_IN_DISPLAY" ; then
1210 DISPLAY_HACK_MSG="yes"
1211 AC_DEFINE(IPADDR_IN_DISPLAY)
1212else
1213 DISPLAY_HACK_MSG="no"
1214 AC_ARG_WITH(ipaddr-display,
1215 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1216 [
1217 if test "x$withval" != "xno" ; then
1218 AC_DEFINE(IPADDR_IN_DISPLAY)
1219 DISPLAY_HACK_MSG="yes"
1220 fi
1221 ]
1222 )
1223fi
Damien Miller76112de1999-12-21 11:18:08 +11001224
Damien Millera22ba012000-03-02 23:09:20 +11001225# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001226SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001227AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001228 [ --with-default-path=PATH Specify default \$PATH environment for server],
1229 [
1230 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001231 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001232 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001233 fi
1234 ]
1235)
1236
Damien Millera22ba012000-03-02 23:09:20 +11001237# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001238IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001239AC_ARG_WITH(ipv4-default,
1240 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1241 [
1242 if test "x$withval" != "xno" ; then
1243 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001244 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001245 fi
1246 ]
1247)
1248
Damien Miller61e50f12000-05-08 20:49:37 +10001249AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001250IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001251AC_ARG_WITH(4in6,
1252 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1253 [
1254 if test "x$withval" != "xno" ; then
1255 AC_MSG_RESULT(yes)
1256 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001257 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001258 else
1259 AC_MSG_RESULT(no)
1260 fi
1261 ],[
1262 if test "x$inet6_default_4in6" = "xyes"; then
1263 AC_MSG_RESULT([yes (default)])
1264 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001265 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001266 else
1267 AC_MSG_RESULT([no (default)])
1268 fi
1269 ]
1270)
1271
Damien Miller78315eb2000-09-29 23:01:36 +11001272AC_MSG_CHECKING(whether to install ssh as suid root)
1273AC_ARG_ENABLE(suid-ssh,
1274[ --enable-suid-ssh Install ssh as suid root (default)
1275 --disable-suid-ssh Install ssh without suid bit],
1276[ case "$enableval" in
1277 no)
1278 AC_MSG_RESULT(no)
1279 SSHMODE=0711
1280 ;;
1281 *) AC_MSG_RESULT(yes)
1282 SSHMODE=04711
1283 ;;
1284 esac ],
1285 AC_MSG_RESULT(yes)
1286 SSHMODE=04711
1287)
1288AC_SUBST(SSHMODE)
1289
1290
Damien Millera22ba012000-03-02 23:09:20 +11001291# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001292piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001293AC_ARG_WITH(pid-dir,
1294 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1295 [
1296 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001297 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001298 fi
1299 ]
1300)
Damien Miller4018c192000-04-30 09:30:44 +10001301
Damien Miller78315eb2000-09-29 23:01:36 +11001302# make sure the directory exists
1303if test ! -d $piddir ; then
1304 piddir=`eval echo ${sysconfdir}`
1305 case $piddir in
1306 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1307 esac
1308fi
1309
Damien Millerdbd250f2000-01-18 08:57:14 +11001310AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001311AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001312
andre2ff7b5d2000-06-03 14:57:40 +00001313dnl allow user to disable some login recording features
1314AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001315 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001316 [ AC_DEFINE(DISABLE_LASTLOG) ]
1317)
1318AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001319 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001320 [ AC_DEFINE(DISABLE_UTMP) ]
1321)
1322AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001323 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001324 [ AC_DEFINE(DISABLE_UTMPX) ]
1325)
1326AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001327 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001328 [ AC_DEFINE(DISABLE_WTMP) ]
1329)
1330AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001331 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001332 [ AC_DEFINE(DISABLE_WTMPX) ]
1333)
1334AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001335 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001336 [ AC_DEFINE(DISABLE_LOGIN) ]
1337)
1338AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001339 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001340 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1341)
1342AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001343 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001344 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1345)
1346AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001347 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001348 [ conf_lastlog_location="$withval"; ],)
1349
1350dnl lastlog, [uw]tmpx? detection
1351dnl NOTE: set the paths in the platform section to avoid the
1352dnl need for command-line parameters
1353dnl lastlog and [uw]tmp are subject to a file search if all else fails
1354
1355dnl lastlog detection
1356dnl NOTE: the code itself will detect if lastlog is a directory
1357AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1358AC_TRY_COMPILE([
1359#include <sys/types.h>
1360#include <utmp.h>
1361#ifdef HAVE_LASTLOG_H
1362# include <lastlog.h>
1363#endif
Damien Miller2994e082000-06-04 15:51:47 +10001364#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001365# include <paths.h>
1366#endif
1367 ],
1368 [ char *lastlog = LASTLOG_FILE; ],
1369 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001370 [
1371 AC_MSG_RESULT(no)
1372 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1373 AC_TRY_COMPILE([
1374#include <sys/types.h>
1375#include <utmp.h>
1376#ifdef HAVE_LASTLOG_H
1377# include <lastlog.h>
1378#endif
1379#ifdef HAVE_PATHS_H
1380# include <paths.h>
1381#endif
1382 ],
1383 [ char *lastlog = _PATH_LASTLOG; ],
1384 [ AC_MSG_RESULT(yes) ],
1385 [
andree441aa32000-06-12 22:34:38 +00001386 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001387 system_lastlog_path=no
1388 ])
1389 ]
andre2ff7b5d2000-06-03 14:57:40 +00001390)
Damien Miller2994e082000-06-04 15:51:47 +10001391
andre2ff7b5d2000-06-03 14:57:40 +00001392if test -z "$conf_lastlog_location"; then
1393 if test x"$system_lastlog_path" = x"no" ; then
1394 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001395 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001396 conf_lastlog_location=$f
1397 fi
1398 done
1399 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001400 AC_MSG_WARN([** Cannot find lastlog **])
1401 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001402 fi
1403 fi
1404fi
1405
1406if test -n "$conf_lastlog_location"; then
1407 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1408fi
1409
1410dnl utmp detection
1411AC_MSG_CHECKING([if your system defines UTMP_FILE])
1412AC_TRY_COMPILE([
1413#include <sys/types.h>
1414#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001415#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001416# include <paths.h>
1417#endif
1418 ],
1419 [ char *utmp = UTMP_FILE; ],
1420 [ AC_MSG_RESULT(yes) ],
1421 [ AC_MSG_RESULT(no)
1422 system_utmp_path=no ]
1423)
1424if test -z "$conf_utmp_location"; then
1425 if test x"$system_utmp_path" = x"no" ; then
1426 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1427 if test -f $f ; then
1428 conf_utmp_location=$f
1429 fi
1430 done
1431 if test -z "$conf_utmp_location"; then
1432 AC_DEFINE(DISABLE_UTMP)
1433 fi
1434 fi
1435fi
1436if test -n "$conf_utmp_location"; then
1437 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1438fi
1439
1440dnl wtmp detection
1441AC_MSG_CHECKING([if your system defines WTMP_FILE])
1442AC_TRY_COMPILE([
1443#include <sys/types.h>
1444#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001445#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001446# include <paths.h>
1447#endif
1448 ],
1449 [ char *wtmp = WTMP_FILE; ],
1450 [ AC_MSG_RESULT(yes) ],
1451 [ AC_MSG_RESULT(no)
1452 system_wtmp_path=no ]
1453)
1454if test -z "$conf_wtmp_location"; then
1455 if test x"$system_wtmp_path" = x"no" ; then
1456 for f in /usr/adm/wtmp /var/log/wtmp; do
1457 if test -f $f ; then
1458 conf_wtmp_location=$f
1459 fi
1460 done
1461 if test -z "$conf_wtmp_location"; then
1462 AC_DEFINE(DISABLE_WTMP)
1463 fi
1464 fi
1465fi
1466if test -n "$conf_wtmp_location"; then
1467 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1468fi
1469
1470
1471dnl utmpx detection - I don't know any system so perverse as to require
1472dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1473dnl there, though.
1474AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1475AC_TRY_COMPILE([
1476#include <sys/types.h>
1477#include <utmp.h>
1478#ifdef HAVE_UTMPX_H
1479#include <utmpx.h>
1480#endif
Damien Miller2994e082000-06-04 15:51:47 +10001481#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001482# include <paths.h>
1483#endif
1484 ],
1485 [ char *utmpx = UTMPX_FILE; ],
1486 [ AC_MSG_RESULT(yes) ],
1487 [ AC_MSG_RESULT(no)
1488 system_utmpx_path=no ]
1489)
1490if test -z "$conf_utmpx_location"; then
1491 if test x"$system_utmpx_path" = x"no" ; then
1492 AC_DEFINE(DISABLE_UTMPX)
1493 fi
1494else
1495 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1496fi
1497
1498dnl wtmpx detection
1499AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1500AC_TRY_COMPILE([
1501#include <sys/types.h>
1502#include <utmp.h>
1503#ifdef HAVE_UTMPX_H
1504#include <utmpx.h>
1505#endif
Damien Miller2994e082000-06-04 15:51:47 +10001506#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001507# include <paths.h>
1508#endif
1509 ],
1510 [ char *wtmpx = WTMPX_FILE; ],
1511 [ AC_MSG_RESULT(yes) ],
1512 [ AC_MSG_RESULT(no)
1513 system_wtmpx_path=no ]
1514)
1515if test -z "$conf_wtmpx_location"; then
1516 if test x"$system_wtmpx_path" = x"no" ; then
1517 AC_DEFINE(DISABLE_WTMPX)
1518 fi
1519else
1520 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1521fi
1522
Damien Miller4018c192000-04-30 09:30:44 +10001523
1524# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001525entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001526AC_ARG_WITH(entropy-timeout,
1527 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1528 [
1529 if test "x$withval" != "xno" ; then
1530 entropy_timeout=$withval
1531 fi
1532 ]
1533)
1534AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1535
1536
Damien Miller29ea30d2000-03-17 10:54:15 +11001537if test ! -z "$blibpath" ; then
1538 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1539 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1540fi
1541
Damien Millerbac2d8a2000-09-05 16:13:06 +11001542AC_EXEEXT
1543
Damien Miller0437b332000-05-02 09:56:41 +10001544AC_OUTPUT(Makefile ssh_prng_cmds)
1545
Damien Miller7b22d652000-06-18 14:07:04 +10001546# Print summary of options
1547
1548if test x$MANTYPE = x'$(CATMAN)' ; then
1549 MAN_MSG=cat
1550else
1551 MAN_MSG=man
1552fi
1553if test ! -z "$RANDOM_POOL" ; then
1554 RAND_MSG="Device ($RANDOM_POOL)"
1555else
1556 if test ! -z "$EGD_SOCKET" ; then
1557 RAND_MSG="EGD ($EGD_SOCKET)"
1558 else
1559 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001560 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001561 fi
1562fi
1563
1564# Someone please show me a better way :)
1565A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1566B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1567C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1568D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001569E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001570F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1571G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1572
1573echo ""
1574echo "OpenSSH configured has been configured with the following options."
1575echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001576echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001577echo " System binaries: $C"
1578echo " Configuration files: $D"
1579echo " Askpass program: $E"
1580echo " Manual pages: $F"
1581echo " PID file: $G"
1582echo " Random number collection: $RAND_MSG"
1583echo " Manpage format: $MAN_MSG"
1584echo " PAM support: ${PAM_MSG}"
1585echo " KerberosIV support: $KRB4_MSG"
1586echo " AFS support: $AFS_MSG"
1587echo " S/KEY support: $SKEY_MSG"
1588echo " TCP Wrappers support: $TCPW_MSG"
1589echo " MD5 password support: $MD5_MSG"
1590echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1591echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1592echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1593
1594echo ""
1595
Damien Millere68f92b2000-10-02 21:42:15 +11001596echo " Host: ${host}"
1597echo " Compiler: ${CC}"
1598echo " Compiler flags: ${CFLAGS}"
1599echo " Linker flags: ${LDFLAGS}"
1600echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001601
1602echo ""
1603
Damien Miller6f9c3372000-10-25 10:06:04 +11001604if test ! -z "$BUILTIN_RNG" ; then
1605 echo "WARNING: you are using the builtin random number collection service."
1606 echo "Please read WARNING.RNG and request that your OS vendor includes"
1607 echo "/dev/random in future versions of their OS."
1608 echo ""
1609fi