blob: 90e75bef4482e06a80e60f620b81b8020d129d6f [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)
Kevin Steves8848b242000-10-18 13:11:44 +000081 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110082 LIBS="$LIBS -lsec"
Damien Miller670a4b82000-01-22 13:53:11 +110083 MANTYPE='$(CATMAN)'
84 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110085 ;;
Damien Miller1bead332000-04-30 00:47:29 +100086*-*-hpux11*)
Damien Miller1bead332000-04-30 00:47:29 +100087 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110088 IPADDR_IN_DISPLAY=yes
Damien Miller5552d7a2000-08-30 09:53:24 +110089 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110090 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110091 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000092 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110093 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +100094 MANTYPE='$(CATMAN)'
95 mansubdir=cat
96 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110097*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110098 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100099 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100100 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100101 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100102 no_libsocket=1
103 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000104 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100105 ;;
106*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +1100107 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000108 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100109 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100110 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000111 AC_DEFINE(WITH_IRIX_ARRAY)
112 AC_DEFINE(WITH_IRIX_PROJECT)
113 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100114 no_libsocket=1
115 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000116 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100117 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100118*-*-linux*)
119 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100120 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000121 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100122 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100123 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000124mips-sony-bsd|mips-sony-newsos4)
125 AC_DEFINE(HAVE_NEWS4)
126 SONY=1
127 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
128 AC_MSG_ERROR([*** libiberty missing - please install first ***])
129 )
130 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100131*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100132 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100133 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000134*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000135 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100136 conf_utmp_location=/etc/utmp
137 conf_wtmp_location=/usr/adm/wtmp
138 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000139 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000140 AC_DEFINE(BROKEN_REALPATH)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000141 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000142 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100143*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100144 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100145 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100146 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000147 # hardwire lastlog location (can't detect it on some versions)
148 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000149 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
150 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
151 if test "$sol2ver" -ge 8; then
152 AC_MSG_RESULT(yes)
153 AC_DEFINE(DISABLE_UTMP)
154 AC_DEFINE(DISABLE_WTMP)
155 else
156 AC_MSG_RESULT(no)
157 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100158 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000159*-*-sunos4*)
160 CFLAGS="$CFLAGS -DSUNOS4"
161 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000162 conf_utmp_location=/etc/utmp
163 conf_wtmp_location=/var/adm/wtmp
164 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000165 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000166 MANTYPE='$(CATMAN)'
167 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000168 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000169*-sni-sysv*)
170 CFLAGS="$CFLAGS -I/usr/local/include"
171 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
172 MANTYPE='$(CATMAN)'
173 AC_DEFINE(IP_TOS_IS_BROKEN)
174 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000175 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000176 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100177*-*-sysv4.2*)
178 CFLAGS="$CFLAGS -I/usr/local/include"
179 LDFLAGS="$LDFLAGS -L/usr/local/lib"
180 MANTYPE='$(CATMAN)'
181 mansubdir=cat
182 LIBS="$LIBS -lgen -lsocket -lnsl -lresolv"
183 enable_suid_ssh=no
184 ;;
185*-*-sysv5*)
186 CFLAGS="$CFLAGS -I/usr/local/include"
187 LDFLAGS="$LDFLAGS -L/usr/local/lib"
188 MANTYPE='$(CATMAN)'
189 mansubdir=cat
190 LIBS="$LIBS -lgen -lsocket"
191 enable_suid_ssh=no
192 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100193*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100194 CFLAGS="$CFLAGS -I/usr/local/include"
195 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100196 MANTYPE='$(CATMAN)'
197 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100198 LIBS="$LIBS -lgen -lsocket"
199 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100200*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100201 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100202 CFLAGS="$CFLAGS -Dftruncate=chsize -I/usr/local/include"
203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
204 MANTYPE='$(CATMAN)'
205 mansubdir=cat
206 LIBS="$LIBS -lgen -lsocket -los -lprot -lx"
207 no_dev_ptmx=1
208 RANLIB=true
209 AC_DEFINE(BROKEN_SYS_TERMIO_H)
210 rsh_path="/usr/bin/rcmd"
211 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
212 ;;
213*-*-sco3.2v5*)
Damien Millera66626b2000-06-13 18:57:53 +1000214 CFLAGS="$CFLAGS -I/usr/local/include"
215 LDFLAGS="$LDFLAGS -L/usr/local/lib"
216 MANTYPE='$(CATMAN)'
217 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100218 LIBS="$LIBS -lgen -lsocket -lprot -lx"
Damien Millera66626b2000-06-13 18:57:53 +1000219 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100220 rsh_path="/usr/bin/rcmd"
221 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Damien Millera66626b2000-06-13 18:57:53 +1000222 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000223*-dec-osf*)
224# This is untested
225 if test ! -z "USE_SIA" ; then
226 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
227 if test -f /etc/sia/matrix.conf; then
228 AC_MSG_RESULT(yes)
229 AC_DEFINE(HAVE_OSF_SIA)
230 AC_DEFINE(DISABLE_LOGIN)
231 LIBS="$LIBS -lsecurity -ldb -lm -laud"
232 else
233 AC_MSG_RESULT(no)
234 fi
235 fi
236 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100237esac
238
Damien Millere37bfc12000-06-05 09:37:43 +1000239# Allow user to specify flags
240AC_ARG_WITH(cflags,
241 [ --with-cflags Specify additional flags to pass to compiler],
242 [
243 if test "x$withval" != "xno" ; then
244 CFLAGS="$CFLAGS $withval"
245 fi
246 ]
247)
248AC_ARG_WITH(ldflags,
249 [ --with-ldlags Specify additional flags to pass to linker],
250 [
251 if test "x$withval" != "xno" ; then
252 LDFLAGS="$LDFLAGS $withval"
253 fi
254 ]
255)
256AC_ARG_WITH(libs,
257 [ --with-libs Specify additional libraries to link with],
258 [
259 if test "x$withval" != "xno" ; then
260 LIBS="$LIBS $withval"
261 fi
262 ]
263)
264
265
Damien Millera22ba012000-03-02 23:09:20 +1100266# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100267AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
268AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100269
270AC_CHECK_FUNC(regcomp,
271 [],
272 [
273 AC_CHECK_LIB(pcre, pcre_info,
274 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
275 ]
276)
Damien Millerab18c411999-11-11 10:40:23 +1100277
Damien Millerbeb4ba51999-12-28 15:09:35 +1100278if test -z "$no_libsocket" ; then
279 AC_CHECK_LIB(nsl, yp_match, , )
280fi
281if test -z "$no_libnsl" ; then
282 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100283fi
Damien Millerab18c411999-11-11 10:40:23 +1100284
Damien Millera22ba012000-03-02 23:09:20 +1100285# Checks for header files.
Damien Miller874d77b2000-10-14 16:23:11 +1100286AC_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 +1100287
Damien Millerad833b32000-08-23 10:46:23 +1000288dnl Checks for library functions.
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000289AC_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 +1000290dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000291AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000292dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000293AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000294dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000295AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
296AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000297dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000298AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
299AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100300
Damien Miller5fc85652000-07-09 23:53:07 +1000301AC_CHECK_FUNC(getuserattr,
302 [AC_DEFINE(HAVE_GETUSERATTR)],
303 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
304)
305
Damien Miller04f80141999-11-19 15:32:34 +1100306AC_CHECK_FUNC(login,
307 [AC_DEFINE(HAVE_LOGIN)],
308 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
309)
310
311AC_CHECK_FUNC(daemon,
312 [AC_DEFINE(HAVE_DAEMON)],
313 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
314)
315
Damien Miller9fb07e42000-03-05 16:22:59 +1100316AC_CHECK_FUNC(getpagesize,
317 [AC_DEFINE(HAVE_GETPAGESIZE)],
318 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
319)
320
Damien Millercb170cb2000-07-01 16:52:55 +1000321# Check for broken snprintf
322if test "x$ac_cv_func_snprintf" = "xyes" ; then
323 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
324 AC_TRY_RUN(
325 [
326#include <stdio.h>
327int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
328 ],
329 [AC_MSG_RESULT(yes)],
330 [
331 AC_MSG_RESULT(no)
332 AC_DEFINE(BROKEN_SNPRINTF)
333 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
334 ]
335 )
336fi
337
Damien Miller606f8802000-09-16 15:39:56 +1100338AC_FUNC_GETPGRP
339
Damien Miller7b22d652000-06-18 14:07:04 +1000340PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100341AC_ARG_WITH(pam,
342 [ --without-pam Disable PAM support ],
343 [
344 if test "x$withval" = "xno" ; then
345 no_pam=1
346 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000347 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100348 fi
349 ]
350)
Damien Milleredb82922000-06-20 13:25:52 +1000351if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100352 AC_CHECK_LIB(dl, dlopen, , )
353 LIBS="$LIBS -lpam"
354
Damien Miller0e65eed2000-05-17 22:16:05 +1000355 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000356
Damien Miller1f335fb2000-06-26 11:31:33 +1000357 disable_shadow=yes
358
Damien Miller7b22d652000-06-18 14:07:04 +1000359 PAM_MSG="yes"
360
Damien Millera22ba012000-03-02 23:09:20 +1100361 # Check PAM strerror arguments (old PAM)
362 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
363 AC_TRY_COMPILE(
364 [
Damien Miller81171112000-04-23 11:14:01 +1000365#include <stdlib.h>
366#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100367 ],
368 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
369 [AC_MSG_RESULT(no)],
370 [
371 AC_DEFINE(HAVE_OLD_PAM)
372 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000373 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100374 ]
375 )
376fi
377
378# The big search for OpenSSL
379AC_ARG_WITH(ssl-dir,
380 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
381 [
382 if test "x$withval" != "$xno" ; then
383 tryssldir=$withval
384 fi
385 ]
386)
387
388saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100389saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100390saved_CFLAGS="$CFLAGS"
391if test "x$prefix" != "xNONE" ; then
392 tryssldir="$tryssldir $prefix"
393fi
Damien Miller61e50f12000-05-08 20:49:37 +1000394AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100395
Damien Millera1b61e12000-09-16 17:02:16 +1100396 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 +1000397 if test ! -z "$ssldir" ; then
398 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
399 CFLAGS="$saved_CFLAGS -I$ssldir/include"
400 if test ! -z "$need_dash_r" ; then
401 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
402 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100403 else
Damien Miller61e50f12000-05-08 20:49:37 +1000404 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100405 fi
406
Damien Miller3b512e12000-05-17 23:29:18 +1000407 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000408
Damien Miller3b512e12000-05-17 23:29:18 +1000409 # Basic test to check for compatible version and correct linking
410 # *does not* test for RSA - that comes later.
411 AC_TRY_RUN(
412 [
Damien Millere59ce622000-05-01 20:54:17 +1000413#include <string.h>
414#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000415int main(void)
416{
Damien Miller3b512e12000-05-17 23:29:18 +1000417 char a[2048];
418 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000419 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000420 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000421}
Damien Miller3b512e12000-05-17 23:29:18 +1000422 ],
423 [
424 found_crypto=1
425 break;
426 ], []
427 )
Damien Miller61e50f12000-05-08 20:49:37 +1000428
429 if test ! -z "$found_crypto" ; then
430 break;
431 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100432 done
433
Damien Miller61e50f12000-05-08 20:49:37 +1000434 if test -z "$found_crypto" ; then
435 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100436 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000437 if test -z "$ssldir" ; then
438 ssldir="(system)"
439 fi
Damien Millera22ba012000-03-02 23:09:20 +1100440
Damien Miller61e50f12000-05-08 20:49:37 +1000441 ac_cv_openssldir=$ssldir
442])
443
Damien Milleredb82922000-06-20 13:25:52 +1000444if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000445 AC_DEFINE(HAVE_OPENSSL)
446 dnl Need to recover ssldir - test above runs in subshell
447 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100448 CFLAGS="$saved_CFLAGS -I$ssldir/include"
449 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
450 if test ! -z "$need_dash_r" ; then
451 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100452 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100453 if test ! -z "$blibpath" ; then
454 blibpath="$blibpath:$ssldir:$ssldir/lib"
455 fi
Damien Millera22ba012000-03-02 23:09:20 +1100456fi
Damien Miller3b512e12000-05-17 23:29:18 +1000457LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000458
Damien Miller3b512e12000-05-17 23:29:18 +1000459# Now test RSA support
460saved_LIBS="$LIBS"
461AC_MSG_CHECKING([for RSA support])
462for WANTS_RSAREF in "" 1 ; do
463 if test -z "$WANTS_RSAREF" ; then
464 LIBS="$saved_LIBS"
465 else
466 LIBS="$saved_LIBS -lRSAglue -lrsaref"
467 fi
468 AC_TRY_RUN([
469#include <string.h>
470#include <openssl/rand.h>
471#include <openssl/rsa.h>
472#include <openssl/bn.h>
473#include <openssl/sha.h>
474int main(void)
475{
476 int num; RSA *key; static unsigned char p_in[] = "blahblah";
477 unsigned char c[256], p[256];
478 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
479 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
480 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
481 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
482}
483 ],
484 [
485 rsa_works=1
486 break;
487 ], [])
488done
489
490if test ! -z "$no_rsa" ; then
491 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000492 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000493else
494 if test -z "$rsa_works" ; then
495 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000496 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000497 else
498 if test -z "$WANTS_RSAREF" ; then
499 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000500 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000501 else
Damien Miller7b22d652000-06-18 14:07:04 +1000502 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000503 AC_MSG_RESULT(using RSAref)
504 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
505 fi
506 fi
507fi
Damien Millera22ba012000-03-02 23:09:20 +1100508
Ben Lindstromb5628642000-10-18 00:02:25 +0000509# Cheap hack to ensure NEWS-OS libraries are arranged right.
510if test ! -z "$SONY" ; then
511 LIBS="$LIBS -liberty";
512fi
513
Damien Millera22ba012000-03-02 23:09:20 +1100514# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100515AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100516AC_CHECK_SIZEOF(short int, 2)
517AC_CHECK_SIZEOF(int, 4)
518AC_CHECK_SIZEOF(long int, 4)
519AC_CHECK_SIZEOF(long long int, 8)
520
Damien Millera22ba012000-03-02 23:09:20 +1100521# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100522AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
523 AC_TRY_COMPILE(
524 [ #include <sys/types.h> ],
525 [ u_int a; a = 1;],
526 [ ac_cv_have_u_int="yes" ],
527 [ ac_cv_have_u_int="no" ]
528 )
529])
530if test "x$ac_cv_have_u_int" = "xyes" ; then
531 AC_DEFINE(HAVE_U_INT)
532 have_u_int=1
533fi
534
Damien Miller61e50f12000-05-08 20:49:37 +1000535AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
536 AC_TRY_COMPILE(
537 [ #include <sys/types.h> ],
538 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
539 [ ac_cv_have_intxx_t="yes" ],
540 [ ac_cv_have_intxx_t="no" ]
541 )
542])
543if test "x$ac_cv_have_intxx_t" = "xyes" ; then
544 AC_DEFINE(HAVE_INTXX_T)
545 have_intxx_t=1
546fi
547
Damien Miller578783e2000-09-23 14:12:24 +1100548AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
549 AC_TRY_COMPILE(
550 [ #include <sys/types.h> ],
551 [ int64_t a; a = 1;],
552 [ ac_cv_have_int64_t="yes" ],
553 [ ac_cv_have_int64_t="no" ]
554 )
555])
556if test "x$ac_cv_have_int64_t" = "xyes" ; then
557 AC_DEFINE(HAVE_INT64_T)
558 have_int64_t=1
559fi
560
Damien Miller61e50f12000-05-08 20:49:37 +1000561AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
562 AC_TRY_COMPILE(
563 [ #include <sys/types.h> ],
564 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
565 [ ac_cv_have_u_intxx_t="yes" ],
566 [ ac_cv_have_u_intxx_t="no" ]
567 )
568])
569if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
570 AC_DEFINE(HAVE_U_INTXX_T)
571 have_u_intxx_t=1
572fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100573
Damien Miller578783e2000-09-23 14:12:24 +1100574AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
575 AC_TRY_COMPILE(
576 [ #include <sys/types.h> ],
577 [ u_int64_t a; a = 1;],
578 [ ac_cv_have_u_int64_t="yes" ],
579 [ ac_cv_have_u_int64_t="no" ]
580 )
581])
582if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
583 AC_DEFINE(HAVE_U_INT64_T)
584 have_u_int64_t=1
585fi
586
Damien Milleredb82922000-06-20 13:25:52 +1000587if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
588 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100589then
590 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
591 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000592 [
593#include <sys/bitypes.h>
594 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100595 [
Damien Miller70494d12000-04-03 15:57:06 +1000596 int8_t a; int16_t b; int32_t c;
597 u_int8_t e; u_int16_t f; u_int32_t g;
598 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100599 ],
600 [
601 AC_DEFINE(HAVE_U_INTXX_T)
602 AC_DEFINE(HAVE_INTXX_T)
603 AC_MSG_RESULT(yes)
604 ],
605 [AC_MSG_RESULT(no)]
606 )
607fi
608
Damien Millerd6121d22000-03-17 23:26:46 +1100609if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000610 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
611 AC_TRY_COMPILE(
612 [
613#include <sys/types.h>
614 ],
615 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
616 [ ac_cv_have_uintxx_t="yes" ],
617 [ ac_cv_have_uintxx_t="no" ]
618 )
619 ])
620 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
621 AC_DEFINE(HAVE_UINTXX_T)
622 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100623fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100624
Damien Miller61e50f12000-05-08 20:49:37 +1000625AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
626 AC_TRY_COMPILE(
627 [
Damien Miller81171112000-04-23 11:14:01 +1000628#include <sys/types.h>
629#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000630 ],
631 [socklen_t foo; foo = 1235;],
632 [ ac_cv_have_socklen_t="yes" ],
633 [ ac_cv_have_socklen_t="no" ]
634 )
635])
636if test "x$ac_cv_have_socklen_t" = "xyes" ; then
637 AC_DEFINE(HAVE_SOCKLEN_T)
638fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100639
Damien Miller61e50f12000-05-08 20:49:37 +1000640AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
641 AC_TRY_COMPILE(
642 [
643#include <sys/types.h>
644 ],
645 [ size_t foo; foo = 1235; ],
646 [ ac_cv_have_size_t="yes" ],
647 [ ac_cv_have_size_t="no" ]
648 )
649])
650if test "x$ac_cv_have_size_t" = "xyes" ; then
651 AC_DEFINE(HAVE_SIZE_T)
652fi
Damien Miller95058511999-12-29 10:36:45 +1100653
Damien Miller615f9392000-05-17 22:53:33 +1000654AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
655 AC_TRY_COMPILE(
656 [
657#include <sys/types.h>
658 ],
659 [ ssize_t foo; foo = 1235; ],
660 [ ac_cv_have_ssize_t="yes" ],
661 [ ac_cv_have_ssize_t="no" ]
662 )
663])
664if test "x$ac_cv_have_ssize_t" = "xyes" ; then
665 AC_DEFINE(HAVE_SSIZE_T)
666fi
667
Damien Millerb54b40e2000-06-23 08:23:34 +1000668AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
669 AC_TRY_COMPILE(
670 [
671#include <sys/types.h>
672#include <sys/socket.h>
673 ],
674 [ sa_family_t foo; foo = 1235; ],
675 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100676 [ AC_TRY_COMPILE(
677 [
678#include <sys/types.h>
679#include <sys/socket.h>
680#include <netinet/in.h>
681 ],
682 [ sa_family_t foo; foo = 1235; ],
683 [ ac_cv_have_sa_family_t="yes" ],
684
Damien Millerb54b40e2000-06-23 08:23:34 +1000685 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100686 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000687 )
688])
689if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
690 AC_DEFINE(HAVE_SA_FAMILY_T)
691fi
692
Damien Miller0f91b4e2000-06-18 15:43:25 +1000693AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
694 AC_TRY_COMPILE(
695 [
696#include <sys/types.h>
697 ],
698 [ pid_t foo; foo = 1235; ],
699 [ ac_cv_have_pid_t="yes" ],
700 [ ac_cv_have_pid_t="no" ]
701 )
702])
703if test "x$ac_cv_have_pid_t" = "xyes" ; then
704 AC_DEFINE(HAVE_PID_T)
705fi
706
707AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
708 AC_TRY_COMPILE(
709 [
710#include <sys/types.h>
711 ],
712 [ mode_t foo; foo = 1235; ],
713 [ ac_cv_have_mode_t="yes" ],
714 [ ac_cv_have_mode_t="no" ]
715 )
716])
717if test "x$ac_cv_have_mode_t" = "xyes" ; then
718 AC_DEFINE(HAVE_MODE_T)
719fi
720
Damien Miller61e50f12000-05-08 20:49:37 +1000721
722AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
723 AC_TRY_COMPILE(
724 [
Damien Miller81171112000-04-23 11:14:01 +1000725#include <sys/types.h>
726#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000727 ],
728 [ struct sockaddr_storage s; ],
729 [ ac_cv_have_struct_sockaddr_storage="yes" ],
730 [ ac_cv_have_struct_sockaddr_storage="no" ]
731 )
732])
733if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
734 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
735fi
Damien Miller34132e52000-01-14 15:45:46 +1100736
Damien Miller61e50f12000-05-08 20:49:37 +1000737AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
738 AC_TRY_COMPILE(
739 [
Damien Miller7b22d652000-06-18 14:07:04 +1000740#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000741#include <netinet/in.h>
742 ],
743 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
744 [ ac_cv_have_struct_sockaddr_in6="yes" ],
745 [ ac_cv_have_struct_sockaddr_in6="no" ]
746 )
747])
748if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
749 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
750fi
Damien Miller34132e52000-01-14 15:45:46 +1100751
Damien Miller61e50f12000-05-08 20:49:37 +1000752AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
753 AC_TRY_COMPILE(
754 [
Damien Miller7b22d652000-06-18 14:07:04 +1000755#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000756#include <netinet/in.h>
757 ],
758 [ struct in6_addr s; s.s6_addr[0] = 0; ],
759 [ ac_cv_have_struct_in6_addr="yes" ],
760 [ ac_cv_have_struct_in6_addr="no" ]
761 )
762])
763if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
764 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
765fi
Damien Miller34132e52000-01-14 15:45:46 +1100766
Damien Miller61e50f12000-05-08 20:49:37 +1000767AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
768 AC_TRY_COMPILE(
769 [
Damien Miller81171112000-04-23 11:14:01 +1000770#include <sys/types.h>
771#include <sys/socket.h>
772#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000773 ],
774 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
775 [ ac_cv_have_struct_addrinfo="yes" ],
776 [ ac_cv_have_struct_addrinfo="no" ]
777 )
778])
779if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
780 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
781fi
782
Damien Miller78315eb2000-09-29 23:01:36 +1100783dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000784OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
785OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
786OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
787OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
788OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000789OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000790OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
791OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000792OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000793OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
794OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
795OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
796OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000797OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
798OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
799OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
800OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100801AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000802
Damien Miller942da032000-08-18 13:59:06 +1000803AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
804 ac_cv_have_sun_len_in_struct_sockaddr_un, [
805 AC_TRY_COMPILE(
806 [
807#include <sys/types.h>
808#include <sys/socket.h>
809 ],
810 [ struct sockaddr_un s; s.sun_len = 1; ],
811 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
812 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
813 )
814])
815if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
816 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
817fi
818
Damien Miller61e50f12000-05-08 20:49:37 +1000819AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
820 ac_cv_have_ss_family_in_struct_ss, [
821 AC_TRY_COMPILE(
822 [
Damien Miller81171112000-04-23 11:14:01 +1000823#include <sys/types.h>
824#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000825 ],
826 [ struct sockaddr_storage s; s.ss_family = 1; ],
827 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
828 [ ac_cv_have_ss_family_in_struct_ss="no" ],
829 )
830])
831if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
832 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
833fi
834
Damien Miller61e50f12000-05-08 20:49:37 +1000835AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
836 ac_cv_have___ss_family_in_struct_ss, [
837 AC_TRY_COMPILE(
838 [
Damien Miller81171112000-04-23 11:14:01 +1000839#include <sys/types.h>
840#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000841 ],
842 [ struct sockaddr_storage s; s.__ss_family = 1; ],
843 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
844 [ ac_cv_have___ss_family_in_struct_ss="no" ]
845 )
846])
847if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
848 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
849fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100850
Damien Millerad833b32000-08-23 10:46:23 +1000851AC_CACHE_CHECK([for pw_class field in struct passwd],
852 ac_cv_have_pw_class_in_struct_passwd, [
853 AC_TRY_COMPILE(
854 [
Damien Millerad833b32000-08-23 10:46:23 +1000855#include <pwd.h>
856 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000857 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000858 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
859 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
860 )
861])
862if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
863 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
864fi
865
Damien Miller61e50f12000-05-08 20:49:37 +1000866
867AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
868 AC_TRY_LINK([],
869 [ extern char *__progname; printf("%s", __progname); ],
870 [ ac_cv_libc_defines___progname="yes" ],
871 [ ac_cv_libc_defines___progname="no" ]
872 )
873])
874if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
875 AC_DEFINE(HAVE___PROGNAME)
876fi
877
Damien Millera22ba012000-03-02 23:09:20 +1100878
Damien Millerecbb26d2000-07-15 14:59:14 +1000879AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
880 AC_TRY_LINK([],
881 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
882 [ ac_cv_libc_defines_sys_errlist="yes" ],
883 [ ac_cv_libc_defines_sys_errlist="no" ]
884 )
885])
886if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
887 AC_DEFINE(HAVE_SYS_ERRLIST)
888fi
889
890
Damien Miller11fa2cc2000-08-16 10:35:58 +1000891AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
892 AC_TRY_LINK([],
893 [ extern int sys_nerr; printf("%i", sys_nerr);],
894 [ ac_cv_libc_defines_sys_nerr="yes" ],
895 [ ac_cv_libc_defines_sys_nerr="no" ]
896 )
897])
898if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
899 AC_DEFINE(HAVE_SYS_NERR)
900fi
901
902
Damien Millera22ba012000-03-02 23:09:20 +1100903# Looking for programs, paths and files
904AC_ARG_WITH(rsh,
905 [ --with-rsh=PATH Specify path to remote shell program ],
906 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100907 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000908 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100909 fi
910 ],
911 [
912 AC_PATH_PROG(rsh_path, rsh)
913 ]
914)
915
916AC_ARG_WITH(xauth,
917 [ --with-xauth=PATH Specify path to xauth program ],
918 [
919 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000920 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100921 fi
922 ],
923 [
Damien Miller78315eb2000-09-29 23:01:36 +1100924 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 +1000925 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100926 xauth_path="/usr/openwin/bin/xauth"
927 fi
928 ]
929)
930
931if test ! -z "$xauth_path" ; then
932 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
933fi
934if test ! -z "$rsh_path" ; then
935 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
936fi
937
938# Check for mail directory (last resort if we cannot get it from headers)
939if test ! -z "$MAIL" ; then
940 maildir=`dirname $MAIL`
941 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
942fi
943
Damien Millera22ba012000-03-02 23:09:20 +1100944if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100945 AC_CHECK_FILE("/dev/ptmx",
946 [
947 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
948 have_dev_ptmx=1
949 ]
950 )
Damien Millera22ba012000-03-02 23:09:20 +1100951fi
Damien Miller204ad072000-03-02 23:56:12 +1100952AC_CHECK_FILE("/dev/ptc",
953 [
954 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
955 have_dev_ptc=1
956 ]
957)
958
Damien Millera22ba012000-03-02 23:09:20 +1100959# Options from here on. Some of these are preset by platform above
960
Damien Millera22ba012000-03-02 23:09:20 +1100961# Check for user-specified random device, otherwise check /dev/urandom
962AC_ARG_WITH(random,
963 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
964 [
Damien Miller040f3832000-04-03 14:50:43 +1000965 if test "x$withval" != "xno" ; then
966 RANDOM_POOL="$withval";
967 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
968 fi
Damien Millera22ba012000-03-02 23:09:20 +1100969 ],
970 [
971 # Check for random device
972 AC_CHECK_FILE("/dev/urandom",
973 [
974 RANDOM_POOL="/dev/urandom";
975 AC_SUBST(RANDOM_POOL)
976 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
977 ]
978 )
979 ]
980)
981
982# Check for EGD pool file
983AC_ARG_WITH(egd-pool,
984 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
985 [
Damien Miller040f3832000-04-03 14:50:43 +1000986 if test "x$withval" != "xno" ; then
987 EGD_SOCKET="$withval";
988 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
989 fi
Damien Millera22ba012000-03-02 23:09:20 +1100990 ]
991)
992
Damien Miller0437b332000-05-02 09:56:41 +1000993# detect pathnames for entropy gathering commands, if we need them
994INSTALL_SSH_PRNG_CMDS=""
995rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000996if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000997 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000998 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
999 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1000 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1001 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1002 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1003 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1004 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1005 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1006 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1007 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1008 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1009 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1010 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1011 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1012 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +10001013
1014 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001015fi
Damien Miller0437b332000-05-02 09:56:41 +10001016AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1017
Damien Miller11e37f62000-04-08 18:23:30 +10001018
Damien Miller670a4b82000-01-22 13:53:11 +11001019AC_ARG_WITH(catman,
1020 [ --with-catman=man|cat Install preformatted manpages[no]],
1021 [
1022 MANTYPE='$(CATMAN)'
1023 if test x"$withval" != x"yes" ; then
1024 mansubdir=$withval
1025 else
1026 mansubdir=cat
1027 fi
1028 ], [
1029 if test -z "$MANTYPE" ; then
1030 MANTYPE='$(TROFFMAN)'
1031 mansubdir=man
1032 fi
1033 ]
1034)
1035AC_SUBST(MANTYPE)
1036AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001037
Damien Millera22ba012000-03-02 23:09:20 +11001038# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001039KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001040AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001041 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001042 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001043 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001044
1045 if test "x$withval" != "$xyes" ; then
1046 CFLAGS="$CFLAGS -I${withval}/include"
1047 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001048 if test ! -z "$need_dash_r" ; then
1049 LDFLAGS="$LDFLAGS -R${withval}/lib"
1050 fi
1051 if test ! -z "$blibpath" ; then
1052 blibpath="$blibpath:${withval}/lib"
1053 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001054 else
1055 if test -d /usr/include/kerberosIV ; then
1056 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
1057 fi
1058 fi
1059
1060 AC_CHECK_HEADERS(krb.h)
1061 AC_CHECK_LIB(krb, main)
1062 if test "$ac_cv_header_krb_h" != yes; then
1063 AC_MSG_WARN([Cannot find krb.h, build may fail])
1064 fi
1065 if test "$ac_cv_lib_krb_main" != yes; then
1066 AC_MSG_WARN([Cannot find libkrb, build may fail])
1067 fi
1068
Damien Millerc85f9b42000-01-29 10:20:21 +11001069 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001070 AC_CHECK_LIB(resolv, dn_expand, , )
1071 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001072 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001073 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001074 fi
Damien Miller80297751999-11-19 13:03:25 +11001075 ]
1076)
1077
Damien Millera22ba012000-03-02 23:09:20 +11001078# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001079AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001080AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001081 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001082 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001083 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001084
1085 if test "x$withval" != "$xyes" ; then
1086 CFLAGS="$CFLAGS -I${withval}/include"
1087 LFLAGS="$LFLAGS -L${withval}/lib"
1088 fi
1089
1090 if test -z "$KRB4" ; then
1091 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1092 fi
1093
Damien Miller8bdeee21999-12-30 15:50:54 +11001094 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001095 if test ! -z "$AFS_LIBS" ; then
1096 LIBS="$LIBS $AFS_LIBS"
1097 fi
1098 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001099 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001100 fi
Damien Miller80297751999-11-19 13:03:25 +11001101 ]
1102)
Damien Millerc85f9b42000-01-29 10:20:21 +11001103LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001104
Damien Millera22ba012000-03-02 23:09:20 +11001105# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001106SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001107AC_ARG_WITH(skey,
1108 [ --with-skey Enable S/Key support],
1109 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001110 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001111 AC_DEFINE(SKEY)
1112 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001113 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001114 fi
Damien Miller80297751999-11-19 13:03:25 +11001115 ]
1116)
1117
Damien Millera22ba012000-03-02 23:09:20 +11001118# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001119TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001120AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001121 [ --with-tcp-wrappers Enable tcpwrappers support],
1122 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001123 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001124 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001125 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001126 AC_MSG_CHECKING(for libwrap)
1127 AC_TRY_LINK(
1128 [
Damien Miller81171112000-04-23 11:14:01 +10001129#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001130 int deny_severity = 0, allow_severity = 0;
1131 ],
1132 [hosts_access(0);],
1133 [
1134 AC_MSG_RESULT(yes)
1135 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001136 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001137 ],
1138 [
Damien Miller7b22d652000-06-18 14:07:04 +10001139 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001140 ]
1141 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001142 fi
Damien Miller80297751999-11-19 13:03:25 +11001143 ]
1144)
1145
Damien Millera22ba012000-03-02 23:09:20 +11001146# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001147MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001148AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001149 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001150 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001151 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001152 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001153 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001154 fi
1155 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001156)
1157
Damien Millera22ba012000-03-02 23:09:20 +11001158# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001159AC_ARG_WITH(shadow,
1160 [ --without-shadow Disable shadow password support],
1161 [
1162 if test "x$withval" = "xno" ; then
1163 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001164 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001165 fi
1166 ]
1167)
1168
Damien Miller1f335fb2000-06-26 11:31:33 +10001169if test -z "$disable_shadow" ; then
1170 AC_MSG_CHECKING([if the systems has expire shadow information])
1171 AC_TRY_COMPILE(
1172 [
1173#include <sys/types.h>
1174#include <shadow.h>
1175 struct spwd sp;
1176 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1177 [ sp_expire_available=yes ], []
1178 )
1179
1180 if test "x$sp_expire_available" = "xyes" ; then
1181 AC_MSG_RESULT(yes)
1182 AC_DEFINE(HAS_SHADOW_EXPIRE)
1183 else
1184 AC_MSG_RESULT(no)
1185 fi
1186fi
1187
Damien Millera22ba012000-03-02 23:09:20 +11001188# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001189if test ! -z "$IPADDR_IN_DISPLAY" ; then
1190 DISPLAY_HACK_MSG="yes"
1191 AC_DEFINE(IPADDR_IN_DISPLAY)
1192else
1193 DISPLAY_HACK_MSG="no"
1194 AC_ARG_WITH(ipaddr-display,
1195 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1196 [
1197 if test "x$withval" != "xno" ; then
1198 AC_DEFINE(IPADDR_IN_DISPLAY)
1199 DISPLAY_HACK_MSG="yes"
1200 fi
1201 ]
1202 )
1203fi
Damien Miller76112de1999-12-21 11:18:08 +11001204
Damien Millera22ba012000-03-02 23:09:20 +11001205# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001206SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001207AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001208 [ --with-default-path=PATH Specify default \$PATH environment for server],
1209 [
1210 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001211 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001212 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001213 fi
1214 ]
1215)
1216
Damien Millera22ba012000-03-02 23:09:20 +11001217# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001218IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001219AC_ARG_WITH(ipv4-default,
1220 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1221 [
1222 if test "x$withval" != "xno" ; then
1223 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001224 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001225 fi
1226 ]
1227)
1228
Damien Miller61e50f12000-05-08 20:49:37 +10001229AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001230IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001231AC_ARG_WITH(4in6,
1232 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1233 [
1234 if test "x$withval" != "xno" ; then
1235 AC_MSG_RESULT(yes)
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)
1240 fi
1241 ],[
1242 if test "x$inet6_default_4in6" = "xyes"; then
1243 AC_MSG_RESULT([yes (default)])
1244 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001245 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001246 else
1247 AC_MSG_RESULT([no (default)])
1248 fi
1249 ]
1250)
1251
Damien Miller78315eb2000-09-29 23:01:36 +11001252AC_MSG_CHECKING(whether to install ssh as suid root)
1253AC_ARG_ENABLE(suid-ssh,
1254[ --enable-suid-ssh Install ssh as suid root (default)
1255 --disable-suid-ssh Install ssh without suid bit],
1256[ case "$enableval" in
1257 no)
1258 AC_MSG_RESULT(no)
1259 SSHMODE=0711
1260 ;;
1261 *) AC_MSG_RESULT(yes)
1262 SSHMODE=04711
1263 ;;
1264 esac ],
1265 AC_MSG_RESULT(yes)
1266 SSHMODE=04711
1267)
1268AC_SUBST(SSHMODE)
1269
1270
Damien Millera22ba012000-03-02 23:09:20 +11001271# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001272piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001273AC_ARG_WITH(pid-dir,
1274 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1275 [
1276 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001277 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001278 fi
1279 ]
1280)
Damien Miller4018c192000-04-30 09:30:44 +10001281
Damien Miller78315eb2000-09-29 23:01:36 +11001282# make sure the directory exists
1283if test ! -d $piddir ; then
1284 piddir=`eval echo ${sysconfdir}`
1285 case $piddir in
1286 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1287 esac
1288fi
1289
Damien Millerdbd250f2000-01-18 08:57:14 +11001290AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001291AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001292
andre2ff7b5d2000-06-03 14:57:40 +00001293dnl allow user to disable some login recording features
1294AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001295 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001296 [ AC_DEFINE(DISABLE_LASTLOG) ]
1297)
1298AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001299 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001300 [ AC_DEFINE(DISABLE_UTMP) ]
1301)
1302AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001303 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001304 [ AC_DEFINE(DISABLE_UTMPX) ]
1305)
1306AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001307 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001308 [ AC_DEFINE(DISABLE_WTMP) ]
1309)
1310AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001311 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001312 [ AC_DEFINE(DISABLE_WTMPX) ]
1313)
1314AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001315 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001316 [ AC_DEFINE(DISABLE_LOGIN) ]
1317)
1318AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001319 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001320 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1321)
1322AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001323 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001324 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1325)
1326AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001327 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001328 [ conf_lastlog_location="$withval"; ],)
1329
1330dnl lastlog, [uw]tmpx? detection
1331dnl NOTE: set the paths in the platform section to avoid the
1332dnl need for command-line parameters
1333dnl lastlog and [uw]tmp are subject to a file search if all else fails
1334
1335dnl lastlog detection
1336dnl NOTE: the code itself will detect if lastlog is a directory
1337AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1338AC_TRY_COMPILE([
1339#include <sys/types.h>
1340#include <utmp.h>
1341#ifdef HAVE_LASTLOG_H
1342# include <lastlog.h>
1343#endif
Damien Miller2994e082000-06-04 15:51:47 +10001344#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001345# include <paths.h>
1346#endif
1347 ],
1348 [ char *lastlog = LASTLOG_FILE; ],
1349 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001350 [
1351 AC_MSG_RESULT(no)
1352 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1353 AC_TRY_COMPILE([
1354#include <sys/types.h>
1355#include <utmp.h>
1356#ifdef HAVE_LASTLOG_H
1357# include <lastlog.h>
1358#endif
1359#ifdef HAVE_PATHS_H
1360# include <paths.h>
1361#endif
1362 ],
1363 [ char *lastlog = _PATH_LASTLOG; ],
1364 [ AC_MSG_RESULT(yes) ],
1365 [
andree441aa32000-06-12 22:34:38 +00001366 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001367 system_lastlog_path=no
1368 ])
1369 ]
andre2ff7b5d2000-06-03 14:57:40 +00001370)
Damien Miller2994e082000-06-04 15:51:47 +10001371
andre2ff7b5d2000-06-03 14:57:40 +00001372if test -z "$conf_lastlog_location"; then
1373 if test x"$system_lastlog_path" = x"no" ; then
1374 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001375 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001376 conf_lastlog_location=$f
1377 fi
1378 done
1379 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001380 AC_MSG_WARN([** Cannot find lastlog **])
1381 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001382 fi
1383 fi
1384fi
1385
1386if test -n "$conf_lastlog_location"; then
1387 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1388fi
1389
1390dnl utmp detection
1391AC_MSG_CHECKING([if your system defines UTMP_FILE])
1392AC_TRY_COMPILE([
1393#include <sys/types.h>
1394#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001395#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001396# include <paths.h>
1397#endif
1398 ],
1399 [ char *utmp = UTMP_FILE; ],
1400 [ AC_MSG_RESULT(yes) ],
1401 [ AC_MSG_RESULT(no)
1402 system_utmp_path=no ]
1403)
1404if test -z "$conf_utmp_location"; then
1405 if test x"$system_utmp_path" = x"no" ; then
1406 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1407 if test -f $f ; then
1408 conf_utmp_location=$f
1409 fi
1410 done
1411 if test -z "$conf_utmp_location"; then
1412 AC_DEFINE(DISABLE_UTMP)
1413 fi
1414 fi
1415fi
1416if test -n "$conf_utmp_location"; then
1417 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1418fi
1419
1420dnl wtmp detection
1421AC_MSG_CHECKING([if your system defines WTMP_FILE])
1422AC_TRY_COMPILE([
1423#include <sys/types.h>
1424#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001425#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001426# include <paths.h>
1427#endif
1428 ],
1429 [ char *wtmp = WTMP_FILE; ],
1430 [ AC_MSG_RESULT(yes) ],
1431 [ AC_MSG_RESULT(no)
1432 system_wtmp_path=no ]
1433)
1434if test -z "$conf_wtmp_location"; then
1435 if test x"$system_wtmp_path" = x"no" ; then
1436 for f in /usr/adm/wtmp /var/log/wtmp; do
1437 if test -f $f ; then
1438 conf_wtmp_location=$f
1439 fi
1440 done
1441 if test -z "$conf_wtmp_location"; then
1442 AC_DEFINE(DISABLE_WTMP)
1443 fi
1444 fi
1445fi
1446if test -n "$conf_wtmp_location"; then
1447 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1448fi
1449
1450
1451dnl utmpx detection - I don't know any system so perverse as to require
1452dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1453dnl there, though.
1454AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1455AC_TRY_COMPILE([
1456#include <sys/types.h>
1457#include <utmp.h>
1458#ifdef HAVE_UTMPX_H
1459#include <utmpx.h>
1460#endif
Damien Miller2994e082000-06-04 15:51:47 +10001461#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001462# include <paths.h>
1463#endif
1464 ],
1465 [ char *utmpx = UTMPX_FILE; ],
1466 [ AC_MSG_RESULT(yes) ],
1467 [ AC_MSG_RESULT(no)
1468 system_utmpx_path=no ]
1469)
1470if test -z "$conf_utmpx_location"; then
1471 if test x"$system_utmpx_path" = x"no" ; then
1472 AC_DEFINE(DISABLE_UTMPX)
1473 fi
1474else
1475 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1476fi
1477
1478dnl wtmpx detection
1479AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1480AC_TRY_COMPILE([
1481#include <sys/types.h>
1482#include <utmp.h>
1483#ifdef HAVE_UTMPX_H
1484#include <utmpx.h>
1485#endif
Damien Miller2994e082000-06-04 15:51:47 +10001486#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001487# include <paths.h>
1488#endif
1489 ],
1490 [ char *wtmpx = WTMPX_FILE; ],
1491 [ AC_MSG_RESULT(yes) ],
1492 [ AC_MSG_RESULT(no)
1493 system_wtmpx_path=no ]
1494)
1495if test -z "$conf_wtmpx_location"; then
1496 if test x"$system_wtmpx_path" = x"no" ; then
1497 AC_DEFINE(DISABLE_WTMPX)
1498 fi
1499else
1500 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1501fi
1502
Damien Miller4018c192000-04-30 09:30:44 +10001503
1504# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001505entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001506AC_ARG_WITH(entropy-timeout,
1507 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1508 [
1509 if test "x$withval" != "xno" ; then
1510 entropy_timeout=$withval
1511 fi
1512 ]
1513)
1514AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1515
1516
Damien Miller29ea30d2000-03-17 10:54:15 +11001517if test ! -z "$blibpath" ; then
1518 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1519 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1520fi
1521
Damien Millerbac2d8a2000-09-05 16:13:06 +11001522AC_EXEEXT
1523
Damien Miller0437b332000-05-02 09:56:41 +10001524AC_OUTPUT(Makefile ssh_prng_cmds)
1525
Damien Miller7b22d652000-06-18 14:07:04 +10001526# Print summary of options
1527
1528if test x$MANTYPE = x'$(CATMAN)' ; then
1529 MAN_MSG=cat
1530else
1531 MAN_MSG=man
1532fi
1533if test ! -z "$RANDOM_POOL" ; then
1534 RAND_MSG="Device ($RANDOM_POOL)"
1535else
1536 if test ! -z "$EGD_SOCKET" ; then
1537 RAND_MSG="EGD ($EGD_SOCKET)"
1538 else
1539 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001540 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001541 fi
1542fi
1543
1544# Someone please show me a better way :)
1545A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1546B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1547C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1548D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001549E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001550F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1551G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1552
1553echo ""
1554echo "OpenSSH configured has been configured with the following options."
1555echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001556echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001557echo " System binaries: $C"
1558echo " Configuration files: $D"
1559echo " Askpass program: $E"
1560echo " Manual pages: $F"
1561echo " PID file: $G"
1562echo " Random number collection: $RAND_MSG"
1563echo " Manpage format: $MAN_MSG"
1564echo " PAM support: ${PAM_MSG}"
1565echo " KerberosIV support: $KRB4_MSG"
1566echo " AFS support: $AFS_MSG"
1567echo " S/KEY support: $SKEY_MSG"
1568echo " TCP Wrappers support: $TCPW_MSG"
1569echo " MD5 password support: $MD5_MSG"
1570echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1571echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1572echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1573
1574echo ""
1575
Damien Millere68f92b2000-10-02 21:42:15 +11001576echo " Host: ${host}"
1577echo " Compiler: ${CC}"
1578echo " Compiler flags: ${CFLAGS}"
1579echo " Linker flags: ${LDFLAGS}"
1580echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001581
1582echo ""
1583
Damien Miller6f9c3372000-10-25 10:06:04 +11001584if test ! -z "$BUILTIN_RNG" ; then
1585 echo "WARNING: you are using the builtin random number collection service."
1586 echo "Please read WARNING.RNG and request that your OS vendor includes"
1587 echo "/dev/random in future versions of their OS."
1588 echo ""
1589fi