blob: 1a57583fa1eb42c197171fda69475797a4df96f4 [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*)
Damien Milleref767ac2000-10-17 23:14:08 +110061 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110062 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 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000122mips-sony-bsd|mips-sony-newsos4)
123 AC_DEFINE(HAVE_NEWS4)
124 SONY=1
125 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
126 AC_MSG_ERROR([*** libiberty missing - please install first ***])
127 )
128 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100129*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100130 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100131 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000132*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000133 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100134 conf_utmp_location=/etc/utmp
135 conf_wtmp_location=/usr/adm/wtmp
136 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000137 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000138 AC_DEFINE(BROKEN_REALPATH)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000139 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000140 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100141*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100142 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100143 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100144 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000145 # hardwire lastlog location (can't detect it on some versions)
146 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000147 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
148 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
149 if test "$sol2ver" -ge 8; then
150 AC_MSG_RESULT(yes)
151 AC_DEFINE(DISABLE_UTMP)
152 AC_DEFINE(DISABLE_WTMP)
153 else
154 AC_MSG_RESULT(no)
155 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100156 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000157*-*-sunos4*)
158 CFLAGS="$CFLAGS -DSUNOS4"
159 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000160 conf_utmp_location=/etc/utmp
161 conf_wtmp_location=/var/adm/wtmp
162 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000163 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000164 MANTYPE='$(CATMAN)'
165 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000166 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000167*-sni-sysv*)
168 CFLAGS="$CFLAGS -I/usr/local/include"
169 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
170 MANTYPE='$(CATMAN)'
171 AC_DEFINE(IP_TOS_IS_BROKEN)
172 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000173 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000174 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100175*-*-sysv4.2*)
176 CFLAGS="$CFLAGS -I/usr/local/include"
177 LDFLAGS="$LDFLAGS -L/usr/local/lib"
178 MANTYPE='$(CATMAN)'
179 mansubdir=cat
180 LIBS="$LIBS -lgen -lsocket -lnsl -lresolv"
181 enable_suid_ssh=no
182 ;;
183*-*-sysv5*)
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"
189 enable_suid_ssh=no
190 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100191*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100192 CFLAGS="$CFLAGS -I/usr/local/include"
193 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100194 MANTYPE='$(CATMAN)'
195 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100196 LIBS="$LIBS -lgen -lsocket"
197 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100198*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100199 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100200 CFLAGS="$CFLAGS -Dftruncate=chsize -I/usr/local/include"
201 LDFLAGS="$LDFLAGS -L/usr/local/lib"
202 MANTYPE='$(CATMAN)'
203 mansubdir=cat
204 LIBS="$LIBS -lgen -lsocket -los -lprot -lx"
205 no_dev_ptmx=1
206 RANLIB=true
207 AC_DEFINE(BROKEN_SYS_TERMIO_H)
208 rsh_path="/usr/bin/rcmd"
209 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
210 ;;
211*-*-sco3.2v5*)
Damien Millera66626b2000-06-13 18:57:53 +1000212 CFLAGS="$CFLAGS -I/usr/local/include"
213 LDFLAGS="$LDFLAGS -L/usr/local/lib"
214 MANTYPE='$(CATMAN)'
215 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100216 LIBS="$LIBS -lgen -lsocket -lprot -lx"
Damien Millera66626b2000-06-13 18:57:53 +1000217 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100218 rsh_path="/usr/bin/rcmd"
219 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Damien Millera66626b2000-06-13 18:57:53 +1000220 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000221*-dec-osf*)
222# This is untested
223 if test ! -z "USE_SIA" ; then
224 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
225 if test -f /etc/sia/matrix.conf; then
226 AC_MSG_RESULT(yes)
227 AC_DEFINE(HAVE_OSF_SIA)
228 AC_DEFINE(DISABLE_LOGIN)
229 LIBS="$LIBS -lsecurity -ldb -lm -laud"
230 else
231 AC_MSG_RESULT(no)
232 fi
233 fi
234 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100235esac
236
Damien Millere37bfc12000-06-05 09:37:43 +1000237# Allow user to specify flags
238AC_ARG_WITH(cflags,
239 [ --with-cflags Specify additional flags to pass to compiler],
240 [
241 if test "x$withval" != "xno" ; then
242 CFLAGS="$CFLAGS $withval"
243 fi
244 ]
245)
246AC_ARG_WITH(ldflags,
247 [ --with-ldlags Specify additional flags to pass to linker],
248 [
249 if test "x$withval" != "xno" ; then
250 LDFLAGS="$LDFLAGS $withval"
251 fi
252 ]
253)
254AC_ARG_WITH(libs,
255 [ --with-libs Specify additional libraries to link with],
256 [
257 if test "x$withval" != "xno" ; then
258 LIBS="$LIBS $withval"
259 fi
260 ]
261)
262
263
Damien Millera22ba012000-03-02 23:09:20 +1100264# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100265AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
266AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Ben Lindstromb5628642000-10-18 00:02:25 +0000267AC_CHECK_LIB(pcre, pcre_info,
268 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
Damien Millerab18c411999-11-11 10:40:23 +1100269
Damien Millerbeb4ba51999-12-28 15:09:35 +1100270if test -z "$no_libsocket" ; then
271 AC_CHECK_LIB(nsl, yp_match, , )
272fi
273if test -z "$no_libnsl" ; then
274 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100275fi
Damien Millerab18c411999-11-11 10:40:23 +1100276
Damien Millera22ba012000-03-02 23:09:20 +1100277# Checks for header files.
Damien Miller874d77b2000-10-14 16:23:11 +1100278AC_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 +1100279
Damien Millerad833b32000-08-23 10:46:23 +1000280dnl Checks for library functions.
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000281AC_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 +1000282dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000283AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000284dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000285AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000286dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000287AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
288AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000289dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000290AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
291AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100292
Damien Miller5fc85652000-07-09 23:53:07 +1000293AC_CHECK_FUNC(getuserattr,
294 [AC_DEFINE(HAVE_GETUSERATTR)],
295 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
296)
297
Damien Miller04f80141999-11-19 15:32:34 +1100298AC_CHECK_FUNC(login,
299 [AC_DEFINE(HAVE_LOGIN)],
300 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
301)
302
303AC_CHECK_FUNC(daemon,
304 [AC_DEFINE(HAVE_DAEMON)],
305 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
306)
307
Damien Miller9fb07e42000-03-05 16:22:59 +1100308AC_CHECK_FUNC(getpagesize,
309 [AC_DEFINE(HAVE_GETPAGESIZE)],
310 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
311)
312
Damien Millercb170cb2000-07-01 16:52:55 +1000313# Check for broken snprintf
314if test "x$ac_cv_func_snprintf" = "xyes" ; then
315 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
316 AC_TRY_RUN(
317 [
318#include <stdio.h>
319int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
320 ],
321 [AC_MSG_RESULT(yes)],
322 [
323 AC_MSG_RESULT(no)
324 AC_DEFINE(BROKEN_SNPRINTF)
325 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
326 ]
327 )
328fi
329
Damien Miller606f8802000-09-16 15:39:56 +1100330AC_FUNC_GETPGRP
331
Damien Miller7b22d652000-06-18 14:07:04 +1000332PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100333AC_ARG_WITH(pam,
334 [ --without-pam Disable PAM support ],
335 [
336 if test "x$withval" = "xno" ; then
337 no_pam=1
338 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000339 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100340 fi
341 ]
342)
Damien Milleredb82922000-06-20 13:25:52 +1000343if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100344 AC_CHECK_LIB(dl, dlopen, , )
345 LIBS="$LIBS -lpam"
346
Damien Miller0e65eed2000-05-17 22:16:05 +1000347 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000348
Damien Miller1f335fb2000-06-26 11:31:33 +1000349 disable_shadow=yes
350
Damien Miller7b22d652000-06-18 14:07:04 +1000351 PAM_MSG="yes"
352
Damien Millera22ba012000-03-02 23:09:20 +1100353 # Check PAM strerror arguments (old PAM)
354 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
355 AC_TRY_COMPILE(
356 [
Damien Miller81171112000-04-23 11:14:01 +1000357#include <stdlib.h>
358#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100359 ],
360 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
361 [AC_MSG_RESULT(no)],
362 [
363 AC_DEFINE(HAVE_OLD_PAM)
364 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000365 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100366 ]
367 )
368fi
369
370# The big search for OpenSSL
371AC_ARG_WITH(ssl-dir,
372 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
373 [
374 if test "x$withval" != "$xno" ; then
375 tryssldir=$withval
376 fi
377 ]
378)
379
380saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100381saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100382saved_CFLAGS="$CFLAGS"
383if test "x$prefix" != "xNONE" ; then
384 tryssldir="$tryssldir $prefix"
385fi
Damien Miller61e50f12000-05-08 20:49:37 +1000386AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100387
Damien Millera1b61e12000-09-16 17:02:16 +1100388 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 +1000389 if test ! -z "$ssldir" ; then
390 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
391 CFLAGS="$saved_CFLAGS -I$ssldir/include"
392 if test ! -z "$need_dash_r" ; then
393 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
394 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100395 else
Damien Miller61e50f12000-05-08 20:49:37 +1000396 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100397 fi
398
Damien Miller3b512e12000-05-17 23:29:18 +1000399 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000400
Damien Miller3b512e12000-05-17 23:29:18 +1000401 # Basic test to check for compatible version and correct linking
402 # *does not* test for RSA - that comes later.
403 AC_TRY_RUN(
404 [
Damien Millere59ce622000-05-01 20:54:17 +1000405#include <string.h>
406#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000407int main(void)
408{
Damien Miller3b512e12000-05-17 23:29:18 +1000409 char a[2048];
410 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000411 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000412 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000413}
Damien Miller3b512e12000-05-17 23:29:18 +1000414 ],
415 [
416 found_crypto=1
417 break;
418 ], []
419 )
Damien Miller61e50f12000-05-08 20:49:37 +1000420
421 if test ! -z "$found_crypto" ; then
422 break;
423 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100424 done
425
Damien Miller61e50f12000-05-08 20:49:37 +1000426 if test -z "$found_crypto" ; then
427 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100428 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000429 if test -z "$ssldir" ; then
430 ssldir="(system)"
431 fi
Damien Millera22ba012000-03-02 23:09:20 +1100432
Damien Miller61e50f12000-05-08 20:49:37 +1000433 ac_cv_openssldir=$ssldir
434])
435
Damien Milleredb82922000-06-20 13:25:52 +1000436if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000437 AC_DEFINE(HAVE_OPENSSL)
438 dnl Need to recover ssldir - test above runs in subshell
439 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100440 CFLAGS="$saved_CFLAGS -I$ssldir/include"
441 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
442 if test ! -z "$need_dash_r" ; then
443 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100444 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100445 if test ! -z "$blibpath" ; then
446 blibpath="$blibpath:$ssldir:$ssldir/lib"
447 fi
Damien Millera22ba012000-03-02 23:09:20 +1100448fi
Damien Miller3b512e12000-05-17 23:29:18 +1000449LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000450
Damien Miller3b512e12000-05-17 23:29:18 +1000451# Now test RSA support
452saved_LIBS="$LIBS"
453AC_MSG_CHECKING([for RSA support])
454for WANTS_RSAREF in "" 1 ; do
455 if test -z "$WANTS_RSAREF" ; then
456 LIBS="$saved_LIBS"
457 else
458 LIBS="$saved_LIBS -lRSAglue -lrsaref"
459 fi
460 AC_TRY_RUN([
461#include <string.h>
462#include <openssl/rand.h>
463#include <openssl/rsa.h>
464#include <openssl/bn.h>
465#include <openssl/sha.h>
466int main(void)
467{
468 int num; RSA *key; static unsigned char p_in[] = "blahblah";
469 unsigned char c[256], p[256];
470 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
471 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
472 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
473 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
474}
475 ],
476 [
477 rsa_works=1
478 break;
479 ], [])
480done
481
482if test ! -z "$no_rsa" ; then
483 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000484 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000485else
486 if test -z "$rsa_works" ; then
487 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000488 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000489 else
490 if test -z "$WANTS_RSAREF" ; then
491 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000492 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000493 else
Damien Miller7b22d652000-06-18 14:07:04 +1000494 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000495 AC_MSG_RESULT(using RSAref)
496 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
497 fi
498 fi
499fi
Damien Millera22ba012000-03-02 23:09:20 +1100500
Ben Lindstromb5628642000-10-18 00:02:25 +0000501# Cheap hack to ensure NEWS-OS libraries are arranged right.
502if test ! -z "$SONY" ; then
503 LIBS="$LIBS -liberty";
504fi
505
Damien Millera22ba012000-03-02 23:09:20 +1100506# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100507AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100508AC_CHECK_SIZEOF(short int, 2)
509AC_CHECK_SIZEOF(int, 4)
510AC_CHECK_SIZEOF(long int, 4)
511AC_CHECK_SIZEOF(long long int, 8)
512
Damien Millera22ba012000-03-02 23:09:20 +1100513# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100514AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
515 AC_TRY_COMPILE(
516 [ #include <sys/types.h> ],
517 [ u_int a; a = 1;],
518 [ ac_cv_have_u_int="yes" ],
519 [ ac_cv_have_u_int="no" ]
520 )
521])
522if test "x$ac_cv_have_u_int" = "xyes" ; then
523 AC_DEFINE(HAVE_U_INT)
524 have_u_int=1
525fi
526
Damien Miller61e50f12000-05-08 20:49:37 +1000527AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
528 AC_TRY_COMPILE(
529 [ #include <sys/types.h> ],
530 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
531 [ ac_cv_have_intxx_t="yes" ],
532 [ ac_cv_have_intxx_t="no" ]
533 )
534])
535if test "x$ac_cv_have_intxx_t" = "xyes" ; then
536 AC_DEFINE(HAVE_INTXX_T)
537 have_intxx_t=1
538fi
539
Damien Miller578783e2000-09-23 14:12:24 +1100540AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
541 AC_TRY_COMPILE(
542 [ #include <sys/types.h> ],
543 [ int64_t a; a = 1;],
544 [ ac_cv_have_int64_t="yes" ],
545 [ ac_cv_have_int64_t="no" ]
546 )
547])
548if test "x$ac_cv_have_int64_t" = "xyes" ; then
549 AC_DEFINE(HAVE_INT64_T)
550 have_int64_t=1
551fi
552
Damien Miller61e50f12000-05-08 20:49:37 +1000553AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
554 AC_TRY_COMPILE(
555 [ #include <sys/types.h> ],
556 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
557 [ ac_cv_have_u_intxx_t="yes" ],
558 [ ac_cv_have_u_intxx_t="no" ]
559 )
560])
561if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
562 AC_DEFINE(HAVE_U_INTXX_T)
563 have_u_intxx_t=1
564fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100565
Damien Miller578783e2000-09-23 14:12:24 +1100566AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
567 AC_TRY_COMPILE(
568 [ #include <sys/types.h> ],
569 [ u_int64_t a; a = 1;],
570 [ ac_cv_have_u_int64_t="yes" ],
571 [ ac_cv_have_u_int64_t="no" ]
572 )
573])
574if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
575 AC_DEFINE(HAVE_U_INT64_T)
576 have_u_int64_t=1
577fi
578
Damien Milleredb82922000-06-20 13:25:52 +1000579if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
580 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100581then
582 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
583 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000584 [
585#include <sys/bitypes.h>
586 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100587 [
Damien Miller70494d12000-04-03 15:57:06 +1000588 int8_t a; int16_t b; int32_t c;
589 u_int8_t e; u_int16_t f; u_int32_t g;
590 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100591 ],
592 [
593 AC_DEFINE(HAVE_U_INTXX_T)
594 AC_DEFINE(HAVE_INTXX_T)
595 AC_MSG_RESULT(yes)
596 ],
597 [AC_MSG_RESULT(no)]
598 )
599fi
600
Damien Millerd6121d22000-03-17 23:26:46 +1100601if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000602 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
603 AC_TRY_COMPILE(
604 [
605#include <sys/types.h>
606 ],
607 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
608 [ ac_cv_have_uintxx_t="yes" ],
609 [ ac_cv_have_uintxx_t="no" ]
610 )
611 ])
612 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
613 AC_DEFINE(HAVE_UINTXX_T)
614 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100615fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100616
Damien Miller61e50f12000-05-08 20:49:37 +1000617AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
618 AC_TRY_COMPILE(
619 [
Damien Miller81171112000-04-23 11:14:01 +1000620#include <sys/types.h>
621#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000622 ],
623 [socklen_t foo; foo = 1235;],
624 [ ac_cv_have_socklen_t="yes" ],
625 [ ac_cv_have_socklen_t="no" ]
626 )
627])
628if test "x$ac_cv_have_socklen_t" = "xyes" ; then
629 AC_DEFINE(HAVE_SOCKLEN_T)
630fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100631
Damien Miller61e50f12000-05-08 20:49:37 +1000632AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
633 AC_TRY_COMPILE(
634 [
635#include <sys/types.h>
636 ],
637 [ size_t foo; foo = 1235; ],
638 [ ac_cv_have_size_t="yes" ],
639 [ ac_cv_have_size_t="no" ]
640 )
641])
642if test "x$ac_cv_have_size_t" = "xyes" ; then
643 AC_DEFINE(HAVE_SIZE_T)
644fi
Damien Miller95058511999-12-29 10:36:45 +1100645
Damien Miller615f9392000-05-17 22:53:33 +1000646AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
647 AC_TRY_COMPILE(
648 [
649#include <sys/types.h>
650 ],
651 [ ssize_t foo; foo = 1235; ],
652 [ ac_cv_have_ssize_t="yes" ],
653 [ ac_cv_have_ssize_t="no" ]
654 )
655])
656if test "x$ac_cv_have_ssize_t" = "xyes" ; then
657 AC_DEFINE(HAVE_SSIZE_T)
658fi
659
Damien Millerb54b40e2000-06-23 08:23:34 +1000660AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
661 AC_TRY_COMPILE(
662 [
663#include <sys/types.h>
664#include <sys/socket.h>
665 ],
666 [ sa_family_t foo; foo = 1235; ],
667 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100668 [ AC_TRY_COMPILE(
669 [
670#include <sys/types.h>
671#include <sys/socket.h>
672#include <netinet/in.h>
673 ],
674 [ sa_family_t foo; foo = 1235; ],
675 [ ac_cv_have_sa_family_t="yes" ],
676
Damien Millerb54b40e2000-06-23 08:23:34 +1000677 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100678 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000679 )
680])
681if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
682 AC_DEFINE(HAVE_SA_FAMILY_T)
683fi
684
Damien Miller0f91b4e2000-06-18 15:43:25 +1000685AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
686 AC_TRY_COMPILE(
687 [
688#include <sys/types.h>
689 ],
690 [ pid_t foo; foo = 1235; ],
691 [ ac_cv_have_pid_t="yes" ],
692 [ ac_cv_have_pid_t="no" ]
693 )
694])
695if test "x$ac_cv_have_pid_t" = "xyes" ; then
696 AC_DEFINE(HAVE_PID_T)
697fi
698
699AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
700 AC_TRY_COMPILE(
701 [
702#include <sys/types.h>
703 ],
704 [ mode_t foo; foo = 1235; ],
705 [ ac_cv_have_mode_t="yes" ],
706 [ ac_cv_have_mode_t="no" ]
707 )
708])
709if test "x$ac_cv_have_mode_t" = "xyes" ; then
710 AC_DEFINE(HAVE_MODE_T)
711fi
712
Damien Miller61e50f12000-05-08 20:49:37 +1000713
714AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
715 AC_TRY_COMPILE(
716 [
Damien Miller81171112000-04-23 11:14:01 +1000717#include <sys/types.h>
718#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000719 ],
720 [ struct sockaddr_storage s; ],
721 [ ac_cv_have_struct_sockaddr_storage="yes" ],
722 [ ac_cv_have_struct_sockaddr_storage="no" ]
723 )
724])
725if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
726 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
727fi
Damien Miller34132e52000-01-14 15:45:46 +1100728
Damien Miller61e50f12000-05-08 20:49:37 +1000729AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
730 AC_TRY_COMPILE(
731 [
Damien Miller7b22d652000-06-18 14:07:04 +1000732#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000733#include <netinet/in.h>
734 ],
735 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
736 [ ac_cv_have_struct_sockaddr_in6="yes" ],
737 [ ac_cv_have_struct_sockaddr_in6="no" ]
738 )
739])
740if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
741 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
742fi
Damien Miller34132e52000-01-14 15:45:46 +1100743
Damien Miller61e50f12000-05-08 20:49:37 +1000744AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
745 AC_TRY_COMPILE(
746 [
Damien Miller7b22d652000-06-18 14:07:04 +1000747#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000748#include <netinet/in.h>
749 ],
750 [ struct in6_addr s; s.s6_addr[0] = 0; ],
751 [ ac_cv_have_struct_in6_addr="yes" ],
752 [ ac_cv_have_struct_in6_addr="no" ]
753 )
754])
755if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
756 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
757fi
Damien Miller34132e52000-01-14 15:45:46 +1100758
Damien Miller61e50f12000-05-08 20:49:37 +1000759AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
760 AC_TRY_COMPILE(
761 [
Damien Miller81171112000-04-23 11:14:01 +1000762#include <sys/types.h>
763#include <sys/socket.h>
764#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000765 ],
766 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
767 [ ac_cv_have_struct_addrinfo="yes" ],
768 [ ac_cv_have_struct_addrinfo="no" ]
769 )
770])
771if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
772 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
773fi
774
Damien Miller78315eb2000-09-29 23:01:36 +1100775dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000776OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
777OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
778OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
779OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
780OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000781OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000782OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
783OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000784OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000785OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
786OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
787OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
788OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000789OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
790OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
791OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
792OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100793AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000794
Damien Miller942da032000-08-18 13:59:06 +1000795AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
796 ac_cv_have_sun_len_in_struct_sockaddr_un, [
797 AC_TRY_COMPILE(
798 [
799#include <sys/types.h>
800#include <sys/socket.h>
801 ],
802 [ struct sockaddr_un s; s.sun_len = 1; ],
803 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
804 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
805 )
806])
807if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
808 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
809fi
810
Damien Miller61e50f12000-05-08 20:49:37 +1000811AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
812 ac_cv_have_ss_family_in_struct_ss, [
813 AC_TRY_COMPILE(
814 [
Damien Miller81171112000-04-23 11:14:01 +1000815#include <sys/types.h>
816#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000817 ],
818 [ struct sockaddr_storage s; s.ss_family = 1; ],
819 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
820 [ ac_cv_have_ss_family_in_struct_ss="no" ],
821 )
822])
823if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
824 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
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
Damien Millerbf1c9b21999-12-09 10:16:54 +1100842
Damien Millerad833b32000-08-23 10:46:23 +1000843AC_CACHE_CHECK([for pw_class field in struct passwd],
844 ac_cv_have_pw_class_in_struct_passwd, [
845 AC_TRY_COMPILE(
846 [
Damien Millerad833b32000-08-23 10:46:23 +1000847#include <pwd.h>
848 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000849 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000850 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
851 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
852 )
853])
854if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
855 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
856fi
857
Damien Miller61e50f12000-05-08 20:49:37 +1000858
859AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
860 AC_TRY_LINK([],
861 [ extern char *__progname; printf("%s", __progname); ],
862 [ ac_cv_libc_defines___progname="yes" ],
863 [ ac_cv_libc_defines___progname="no" ]
864 )
865])
866if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
867 AC_DEFINE(HAVE___PROGNAME)
868fi
869
Damien Millera22ba012000-03-02 23:09:20 +1100870
Damien Millerecbb26d2000-07-15 14:59:14 +1000871AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
872 AC_TRY_LINK([],
873 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
874 [ ac_cv_libc_defines_sys_errlist="yes" ],
875 [ ac_cv_libc_defines_sys_errlist="no" ]
876 )
877])
878if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
879 AC_DEFINE(HAVE_SYS_ERRLIST)
880fi
881
882
Damien Miller11fa2cc2000-08-16 10:35:58 +1000883AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
884 AC_TRY_LINK([],
885 [ extern int sys_nerr; printf("%i", sys_nerr);],
886 [ ac_cv_libc_defines_sys_nerr="yes" ],
887 [ ac_cv_libc_defines_sys_nerr="no" ]
888 )
889])
890if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
891 AC_DEFINE(HAVE_SYS_NERR)
892fi
893
894
Damien Millera22ba012000-03-02 23:09:20 +1100895# Looking for programs, paths and files
896AC_ARG_WITH(rsh,
897 [ --with-rsh=PATH Specify path to remote shell program ],
898 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100899 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000900 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100901 fi
902 ],
903 [
904 AC_PATH_PROG(rsh_path, rsh)
905 ]
906)
907
908AC_ARG_WITH(xauth,
909 [ --with-xauth=PATH Specify path to xauth program ],
910 [
911 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000912 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100913 fi
914 ],
915 [
Damien Miller78315eb2000-09-29 23:01:36 +1100916 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 +1000917 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100918 xauth_path="/usr/openwin/bin/xauth"
919 fi
920 ]
921)
922
923if test ! -z "$xauth_path" ; then
924 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
925fi
926if test ! -z "$rsh_path" ; then
927 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
928fi
929
930# Check for mail directory (last resort if we cannot get it from headers)
931if test ! -z "$MAIL" ; then
932 maildir=`dirname $MAIL`
933 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
934fi
935
Damien Millera22ba012000-03-02 23:09:20 +1100936if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100937 AC_CHECK_FILE("/dev/ptmx",
938 [
939 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
940 have_dev_ptmx=1
941 ]
942 )
Damien Millera22ba012000-03-02 23:09:20 +1100943fi
Damien Miller204ad072000-03-02 23:56:12 +1100944AC_CHECK_FILE("/dev/ptc",
945 [
946 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
947 have_dev_ptc=1
948 ]
949)
950
Damien Millera22ba012000-03-02 23:09:20 +1100951# Options from here on. Some of these are preset by platform above
952
Damien Millera22ba012000-03-02 23:09:20 +1100953# Check for user-specified random device, otherwise check /dev/urandom
954AC_ARG_WITH(random,
955 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
956 [
Damien Miller040f3832000-04-03 14:50:43 +1000957 if test "x$withval" != "xno" ; then
958 RANDOM_POOL="$withval";
959 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
960 fi
Damien Millera22ba012000-03-02 23:09:20 +1100961 ],
962 [
963 # Check for random device
964 AC_CHECK_FILE("/dev/urandom",
965 [
966 RANDOM_POOL="/dev/urandom";
967 AC_SUBST(RANDOM_POOL)
968 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
969 ]
970 )
971 ]
972)
973
974# Check for EGD pool file
975AC_ARG_WITH(egd-pool,
976 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
977 [
Damien Miller040f3832000-04-03 14:50:43 +1000978 if test "x$withval" != "xno" ; then
979 EGD_SOCKET="$withval";
980 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
981 fi
Damien Millera22ba012000-03-02 23:09:20 +1100982 ]
983)
984
Damien Miller0437b332000-05-02 09:56:41 +1000985# detect pathnames for entropy gathering commands, if we need them
986INSTALL_SSH_PRNG_CMDS=""
987rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000988if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000989 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000990 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
991 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
992 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
993 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
994 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
995 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
996 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
997 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
998 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
999 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1000 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1001 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1002 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1003 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1004 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +10001005
1006 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001007fi
Damien Miller0437b332000-05-02 09:56:41 +10001008AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1009
Damien Miller11e37f62000-04-08 18:23:30 +10001010
Damien Miller670a4b82000-01-22 13:53:11 +11001011AC_ARG_WITH(catman,
1012 [ --with-catman=man|cat Install preformatted manpages[no]],
1013 [
1014 MANTYPE='$(CATMAN)'
1015 if test x"$withval" != x"yes" ; then
1016 mansubdir=$withval
1017 else
1018 mansubdir=cat
1019 fi
1020 ], [
1021 if test -z "$MANTYPE" ; then
1022 MANTYPE='$(TROFFMAN)'
1023 mansubdir=man
1024 fi
1025 ]
1026)
1027AC_SUBST(MANTYPE)
1028AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001029
Damien Millera22ba012000-03-02 23:09:20 +11001030# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001031KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001032AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001033 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001034 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001035 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001036
1037 if test "x$withval" != "$xyes" ; then
1038 CFLAGS="$CFLAGS -I${withval}/include"
1039 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001040 if test ! -z "$need_dash_r" ; then
1041 LDFLAGS="$LDFLAGS -R${withval}/lib"
1042 fi
1043 if test ! -z "$blibpath" ; then
1044 blibpath="$blibpath:${withval}/lib"
1045 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001046 else
1047 if test -d /usr/include/kerberosIV ; then
1048 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
1049 fi
1050 fi
1051
1052 AC_CHECK_HEADERS(krb.h)
1053 AC_CHECK_LIB(krb, main)
1054 if test "$ac_cv_header_krb_h" != yes; then
1055 AC_MSG_WARN([Cannot find krb.h, build may fail])
1056 fi
1057 if test "$ac_cv_lib_krb_main" != yes; then
1058 AC_MSG_WARN([Cannot find libkrb, build may fail])
1059 fi
1060
Damien Millerc85f9b42000-01-29 10:20:21 +11001061 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001062 AC_CHECK_LIB(resolv, dn_expand, , )
1063 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001064 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001065 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001066 fi
Damien Miller80297751999-11-19 13:03:25 +11001067 ]
1068)
1069
Damien Millera22ba012000-03-02 23:09:20 +11001070# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001071AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001072AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001073 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001074 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001075 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001076
1077 if test "x$withval" != "$xyes" ; then
1078 CFLAGS="$CFLAGS -I${withval}/include"
1079 LFLAGS="$LFLAGS -L${withval}/lib"
1080 fi
1081
1082 if test -z "$KRB4" ; then
1083 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1084 fi
1085
Damien Miller8bdeee21999-12-30 15:50:54 +11001086 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001087 if test ! -z "$AFS_LIBS" ; then
1088 LIBS="$LIBS $AFS_LIBS"
1089 fi
1090 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001091 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001092 fi
Damien Miller80297751999-11-19 13:03:25 +11001093 ]
1094)
Damien Millerc85f9b42000-01-29 10:20:21 +11001095LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001096
Damien Millera22ba012000-03-02 23:09:20 +11001097# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001098SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001099AC_ARG_WITH(skey,
1100 [ --with-skey Enable S/Key support],
1101 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001102 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001103 AC_DEFINE(SKEY)
1104 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001105 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001106 fi
Damien Miller80297751999-11-19 13:03:25 +11001107 ]
1108)
1109
Damien Millera22ba012000-03-02 23:09:20 +11001110# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001111TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001112AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001113 [ --with-tcp-wrappers Enable tcpwrappers support],
1114 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001115 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001116 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001117 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001118 AC_MSG_CHECKING(for libwrap)
1119 AC_TRY_LINK(
1120 [
Damien Miller81171112000-04-23 11:14:01 +10001121#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001122 int deny_severity = 0, allow_severity = 0;
1123 ],
1124 [hosts_access(0);],
1125 [
1126 AC_MSG_RESULT(yes)
1127 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001128 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001129 ],
1130 [
Damien Miller7b22d652000-06-18 14:07:04 +10001131 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001132 ]
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 to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001139MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001140AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001141 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001142 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001143 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001144 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001145 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001146 fi
1147 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001148)
1149
Damien Millera22ba012000-03-02 23:09:20 +11001150# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001151AC_ARG_WITH(shadow,
1152 [ --without-shadow Disable shadow password support],
1153 [
1154 if test "x$withval" = "xno" ; then
1155 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001156 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001157 fi
1158 ]
1159)
1160
Damien Miller1f335fb2000-06-26 11:31:33 +10001161if test -z "$disable_shadow" ; then
1162 AC_MSG_CHECKING([if the systems has expire shadow information])
1163 AC_TRY_COMPILE(
1164 [
1165#include <sys/types.h>
1166#include <shadow.h>
1167 struct spwd sp;
1168 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1169 [ sp_expire_available=yes ], []
1170 )
1171
1172 if test "x$sp_expire_available" = "xyes" ; then
1173 AC_MSG_RESULT(yes)
1174 AC_DEFINE(HAS_SHADOW_EXPIRE)
1175 else
1176 AC_MSG_RESULT(no)
1177 fi
1178fi
1179
Damien Millera22ba012000-03-02 23:09:20 +11001180# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001181if test ! -z "$IPADDR_IN_DISPLAY" ; then
1182 DISPLAY_HACK_MSG="yes"
1183 AC_DEFINE(IPADDR_IN_DISPLAY)
1184else
1185 DISPLAY_HACK_MSG="no"
1186 AC_ARG_WITH(ipaddr-display,
1187 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1188 [
1189 if test "x$withval" != "xno" ; then
1190 AC_DEFINE(IPADDR_IN_DISPLAY)
1191 DISPLAY_HACK_MSG="yes"
1192 fi
1193 ]
1194 )
1195fi
Damien Miller76112de1999-12-21 11:18:08 +11001196
Damien Millera22ba012000-03-02 23:09:20 +11001197# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001198SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001199AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001200 [ --with-default-path=PATH Specify default \$PATH environment for server],
1201 [
1202 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001203 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001204 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001205 fi
1206 ]
1207)
1208
Damien Millera22ba012000-03-02 23:09:20 +11001209# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001210IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001211AC_ARG_WITH(ipv4-default,
1212 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1213 [
1214 if test "x$withval" != "xno" ; then
1215 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001216 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001217 fi
1218 ]
1219)
1220
Damien Miller61e50f12000-05-08 20:49:37 +10001221AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001222IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001223AC_ARG_WITH(4in6,
1224 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1225 [
1226 if test "x$withval" != "xno" ; then
1227 AC_MSG_RESULT(yes)
1228 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001229 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001230 else
1231 AC_MSG_RESULT(no)
1232 fi
1233 ],[
1234 if test "x$inet6_default_4in6" = "xyes"; then
1235 AC_MSG_RESULT([yes (default)])
1236 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001237 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001238 else
1239 AC_MSG_RESULT([no (default)])
1240 fi
1241 ]
1242)
1243
Damien Miller78315eb2000-09-29 23:01:36 +11001244AC_MSG_CHECKING(whether to install ssh as suid root)
1245AC_ARG_ENABLE(suid-ssh,
1246[ --enable-suid-ssh Install ssh as suid root (default)
1247 --disable-suid-ssh Install ssh without suid bit],
1248[ case "$enableval" in
1249 no)
1250 AC_MSG_RESULT(no)
1251 SSHMODE=0711
1252 ;;
1253 *) AC_MSG_RESULT(yes)
1254 SSHMODE=04711
1255 ;;
1256 esac ],
1257 AC_MSG_RESULT(yes)
1258 SSHMODE=04711
1259)
1260AC_SUBST(SSHMODE)
1261
1262
Damien Millera22ba012000-03-02 23:09:20 +11001263# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001264piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001265AC_ARG_WITH(pid-dir,
1266 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1267 [
1268 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001269 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001270 fi
1271 ]
1272)
Damien Miller4018c192000-04-30 09:30:44 +10001273
Damien Miller78315eb2000-09-29 23:01:36 +11001274# make sure the directory exists
1275if test ! -d $piddir ; then
1276 piddir=`eval echo ${sysconfdir}`
1277 case $piddir in
1278 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1279 esac
1280fi
1281
Damien Millerdbd250f2000-01-18 08:57:14 +11001282AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001283AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001284
andre2ff7b5d2000-06-03 14:57:40 +00001285dnl allow user to disable some login recording features
1286AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001287 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001288 [ AC_DEFINE(DISABLE_LASTLOG) ]
1289)
1290AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001291 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001292 [ AC_DEFINE(DISABLE_UTMP) ]
1293)
1294AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001295 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001296 [ AC_DEFINE(DISABLE_UTMPX) ]
1297)
1298AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001299 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001300 [ AC_DEFINE(DISABLE_WTMP) ]
1301)
1302AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001303 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001304 [ AC_DEFINE(DISABLE_WTMPX) ]
1305)
1306AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001307 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001308 [ AC_DEFINE(DISABLE_LOGIN) ]
1309)
1310AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001311 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001312 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1313)
1314AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001315 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001316 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1317)
1318AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001319 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001320 [ conf_lastlog_location="$withval"; ],)
1321
1322dnl lastlog, [uw]tmpx? detection
1323dnl NOTE: set the paths in the platform section to avoid the
1324dnl need for command-line parameters
1325dnl lastlog and [uw]tmp are subject to a file search if all else fails
1326
1327dnl lastlog detection
1328dnl NOTE: the code itself will detect if lastlog is a directory
1329AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1330AC_TRY_COMPILE([
1331#include <sys/types.h>
1332#include <utmp.h>
1333#ifdef HAVE_LASTLOG_H
1334# include <lastlog.h>
1335#endif
Damien Miller2994e082000-06-04 15:51:47 +10001336#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001337# include <paths.h>
1338#endif
1339 ],
1340 [ char *lastlog = LASTLOG_FILE; ],
1341 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001342 [
1343 AC_MSG_RESULT(no)
1344 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1345 AC_TRY_COMPILE([
1346#include <sys/types.h>
1347#include <utmp.h>
1348#ifdef HAVE_LASTLOG_H
1349# include <lastlog.h>
1350#endif
1351#ifdef HAVE_PATHS_H
1352# include <paths.h>
1353#endif
1354 ],
1355 [ char *lastlog = _PATH_LASTLOG; ],
1356 [ AC_MSG_RESULT(yes) ],
1357 [
andree441aa32000-06-12 22:34:38 +00001358 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001359 system_lastlog_path=no
1360 ])
1361 ]
andre2ff7b5d2000-06-03 14:57:40 +00001362)
Damien Miller2994e082000-06-04 15:51:47 +10001363
andre2ff7b5d2000-06-03 14:57:40 +00001364if test -z "$conf_lastlog_location"; then
1365 if test x"$system_lastlog_path" = x"no" ; then
1366 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001367 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001368 conf_lastlog_location=$f
1369 fi
1370 done
1371 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001372 AC_MSG_WARN([** Cannot find lastlog **])
1373 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001374 fi
1375 fi
1376fi
1377
1378if test -n "$conf_lastlog_location"; then
1379 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1380fi
1381
1382dnl utmp detection
1383AC_MSG_CHECKING([if your system defines UTMP_FILE])
1384AC_TRY_COMPILE([
1385#include <sys/types.h>
1386#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001387#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001388# include <paths.h>
1389#endif
1390 ],
1391 [ char *utmp = UTMP_FILE; ],
1392 [ AC_MSG_RESULT(yes) ],
1393 [ AC_MSG_RESULT(no)
1394 system_utmp_path=no ]
1395)
1396if test -z "$conf_utmp_location"; then
1397 if test x"$system_utmp_path" = x"no" ; then
1398 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1399 if test -f $f ; then
1400 conf_utmp_location=$f
1401 fi
1402 done
1403 if test -z "$conf_utmp_location"; then
1404 AC_DEFINE(DISABLE_UTMP)
1405 fi
1406 fi
1407fi
1408if test -n "$conf_utmp_location"; then
1409 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1410fi
1411
1412dnl wtmp detection
1413AC_MSG_CHECKING([if your system defines WTMP_FILE])
1414AC_TRY_COMPILE([
1415#include <sys/types.h>
1416#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001417#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001418# include <paths.h>
1419#endif
1420 ],
1421 [ char *wtmp = WTMP_FILE; ],
1422 [ AC_MSG_RESULT(yes) ],
1423 [ AC_MSG_RESULT(no)
1424 system_wtmp_path=no ]
1425)
1426if test -z "$conf_wtmp_location"; then
1427 if test x"$system_wtmp_path" = x"no" ; then
1428 for f in /usr/adm/wtmp /var/log/wtmp; do
1429 if test -f $f ; then
1430 conf_wtmp_location=$f
1431 fi
1432 done
1433 if test -z "$conf_wtmp_location"; then
1434 AC_DEFINE(DISABLE_WTMP)
1435 fi
1436 fi
1437fi
1438if test -n "$conf_wtmp_location"; then
1439 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1440fi
1441
1442
1443dnl utmpx detection - I don't know any system so perverse as to require
1444dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1445dnl there, though.
1446AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1447AC_TRY_COMPILE([
1448#include <sys/types.h>
1449#include <utmp.h>
1450#ifdef HAVE_UTMPX_H
1451#include <utmpx.h>
1452#endif
Damien Miller2994e082000-06-04 15:51:47 +10001453#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001454# include <paths.h>
1455#endif
1456 ],
1457 [ char *utmpx = UTMPX_FILE; ],
1458 [ AC_MSG_RESULT(yes) ],
1459 [ AC_MSG_RESULT(no)
1460 system_utmpx_path=no ]
1461)
1462if test -z "$conf_utmpx_location"; then
1463 if test x"$system_utmpx_path" = x"no" ; then
1464 AC_DEFINE(DISABLE_UTMPX)
1465 fi
1466else
1467 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1468fi
1469
1470dnl wtmpx detection
1471AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1472AC_TRY_COMPILE([
1473#include <sys/types.h>
1474#include <utmp.h>
1475#ifdef HAVE_UTMPX_H
1476#include <utmpx.h>
1477#endif
Damien Miller2994e082000-06-04 15:51:47 +10001478#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001479# include <paths.h>
1480#endif
1481 ],
1482 [ char *wtmpx = WTMPX_FILE; ],
1483 [ AC_MSG_RESULT(yes) ],
1484 [ AC_MSG_RESULT(no)
1485 system_wtmpx_path=no ]
1486)
1487if test -z "$conf_wtmpx_location"; then
1488 if test x"$system_wtmpx_path" = x"no" ; then
1489 AC_DEFINE(DISABLE_WTMPX)
1490 fi
1491else
1492 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1493fi
1494
Damien Miller4018c192000-04-30 09:30:44 +10001495
1496# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001497entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001498AC_ARG_WITH(entropy-timeout,
1499 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1500 [
1501 if test "x$withval" != "xno" ; then
1502 entropy_timeout=$withval
1503 fi
1504 ]
1505)
1506AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1507
1508
Damien Miller29ea30d2000-03-17 10:54:15 +11001509if test ! -z "$blibpath" ; then
1510 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1511 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1512fi
1513
Damien Millerbac2d8a2000-09-05 16:13:06 +11001514AC_EXEEXT
1515
Damien Miller0437b332000-05-02 09:56:41 +10001516AC_OUTPUT(Makefile ssh_prng_cmds)
1517
Damien Miller7b22d652000-06-18 14:07:04 +10001518# Print summary of options
1519
1520if test x$MANTYPE = x'$(CATMAN)' ; then
1521 MAN_MSG=cat
1522else
1523 MAN_MSG=man
1524fi
1525if test ! -z "$RANDOM_POOL" ; then
1526 RAND_MSG="Device ($RANDOM_POOL)"
1527else
1528 if test ! -z "$EGD_SOCKET" ; then
1529 RAND_MSG="EGD ($EGD_SOCKET)"
1530 else
1531 RAND_MSG="Builtin (timeout $entropy_timeout)"
1532 fi
1533fi
1534
1535# Someone please show me a better way :)
1536A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1537B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1538C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1539D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001540E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001541F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1542G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1543
1544echo ""
1545echo "OpenSSH configured has been configured with the following options."
1546echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001547echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001548echo " System binaries: $C"
1549echo " Configuration files: $D"
1550echo " Askpass program: $E"
1551echo " Manual pages: $F"
1552echo " PID file: $G"
1553echo " Random number collection: $RAND_MSG"
1554echo " Manpage format: $MAN_MSG"
1555echo " PAM support: ${PAM_MSG}"
1556echo " KerberosIV support: $KRB4_MSG"
1557echo " AFS support: $AFS_MSG"
1558echo " S/KEY support: $SKEY_MSG"
1559echo " TCP Wrappers support: $TCPW_MSG"
1560echo " MD5 password support: $MD5_MSG"
1561echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1562echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1563echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1564
1565echo ""
1566
Damien Millere68f92b2000-10-02 21:42:15 +11001567echo " Host: ${host}"
1568echo " Compiler: ${CC}"
1569echo " Compiler flags: ${CFLAGS}"
1570echo " Linker flags: ${LDFLAGS}"
1571echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001572
1573echo ""
1574