blob: 888cd91cedd901f05d53845f23dde57f90677dac [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)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000141 AC_DEFINE(USE_PIPES)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000142 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000143 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100144*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100145 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100146 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100147 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000148 # hardwire lastlog location (can't detect it on some versions)
149 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000150 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
151 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
152 if test "$sol2ver" -ge 8; then
153 AC_MSG_RESULT(yes)
154 AC_DEFINE(DISABLE_UTMP)
155 AC_DEFINE(DISABLE_WTMP)
156 else
157 AC_MSG_RESULT(no)
158 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100159 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000160*-*-sunos4*)
161 CFLAGS="$CFLAGS -DSUNOS4"
162 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000163 conf_utmp_location=/etc/utmp
164 conf_wtmp_location=/var/adm/wtmp
165 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000166 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000167 MANTYPE='$(CATMAN)'
168 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000169 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000170*-sni-sysv*)
171 CFLAGS="$CFLAGS -I/usr/local/include"
172 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
173 MANTYPE='$(CATMAN)'
174 AC_DEFINE(IP_TOS_IS_BROKEN)
175 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000176 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000177 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100178*-*-sysv4.2*)
179 CFLAGS="$CFLAGS -I/usr/local/include"
180 LDFLAGS="$LDFLAGS -L/usr/local/lib"
181 MANTYPE='$(CATMAN)'
182 mansubdir=cat
183 LIBS="$LIBS -lgen -lsocket -lnsl -lresolv"
184 enable_suid_ssh=no
185 ;;
186*-*-sysv5*)
187 CFLAGS="$CFLAGS -I/usr/local/include"
188 LDFLAGS="$LDFLAGS -L/usr/local/lib"
189 MANTYPE='$(CATMAN)'
190 mansubdir=cat
191 LIBS="$LIBS -lgen -lsocket"
192 enable_suid_ssh=no
193 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100194*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100195 CFLAGS="$CFLAGS -I/usr/local/include"
196 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100197 MANTYPE='$(CATMAN)'
198 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100199 LIBS="$LIBS -lgen -lsocket"
200 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100201*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100202 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100203 CFLAGS="$CFLAGS -Dftruncate=chsize -I/usr/local/include"
204 LDFLAGS="$LDFLAGS -L/usr/local/lib"
205 MANTYPE='$(CATMAN)'
206 mansubdir=cat
207 LIBS="$LIBS -lgen -lsocket -los -lprot -lx"
208 no_dev_ptmx=1
209 RANLIB=true
210 AC_DEFINE(BROKEN_SYS_TERMIO_H)
211 rsh_path="/usr/bin/rcmd"
212 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
213 ;;
214*-*-sco3.2v5*)
Damien Millera66626b2000-06-13 18:57:53 +1000215 CFLAGS="$CFLAGS -I/usr/local/include"
216 LDFLAGS="$LDFLAGS -L/usr/local/lib"
217 MANTYPE='$(CATMAN)'
218 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100219 LIBS="$LIBS -lgen -lsocket -lprot -lx"
Damien Millera66626b2000-06-13 18:57:53 +1000220 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100221 rsh_path="/usr/bin/rcmd"
222 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Damien Millera66626b2000-06-13 18:57:53 +1000223 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000224*-dec-osf*)
225# This is untested
226 if test ! -z "USE_SIA" ; then
227 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
228 if test -f /etc/sia/matrix.conf; then
229 AC_MSG_RESULT(yes)
230 AC_DEFINE(HAVE_OSF_SIA)
231 AC_DEFINE(DISABLE_LOGIN)
232 LIBS="$LIBS -lsecurity -ldb -lm -laud"
233 else
234 AC_MSG_RESULT(no)
235 fi
236 fi
237 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100238esac
239
Damien Millere37bfc12000-06-05 09:37:43 +1000240# Allow user to specify flags
241AC_ARG_WITH(cflags,
242 [ --with-cflags Specify additional flags to pass to compiler],
243 [
244 if test "x$withval" != "xno" ; then
245 CFLAGS="$CFLAGS $withval"
246 fi
247 ]
248)
249AC_ARG_WITH(ldflags,
250 [ --with-ldlags Specify additional flags to pass to linker],
251 [
252 if test "x$withval" != "xno" ; then
253 LDFLAGS="$LDFLAGS $withval"
254 fi
255 ]
256)
257AC_ARG_WITH(libs,
258 [ --with-libs Specify additional libraries to link with],
259 [
260 if test "x$withval" != "xno" ; then
261 LIBS="$LIBS $withval"
262 fi
263 ]
264)
265
266
Damien Millera22ba012000-03-02 23:09:20 +1100267# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100268AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
269AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100270
271AC_CHECK_FUNC(regcomp,
272 [],
273 [
274 AC_CHECK_LIB(pcre, pcre_info,
275 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
276 ]
277)
Damien Millerab18c411999-11-11 10:40:23 +1100278
Damien Millerbeb4ba51999-12-28 15:09:35 +1100279if test -z "$no_libsocket" ; then
280 AC_CHECK_LIB(nsl, yp_match, , )
281fi
282if test -z "$no_libnsl" ; then
283 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100284fi
Damien Millerab18c411999-11-11 10:40:23 +1100285
Damien Millera22ba012000-03-02 23:09:20 +1100286# Checks for header files.
Damien Miller874d77b2000-10-14 16:23:11 +1100287AC_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 +1100288
Damien Millerad833b32000-08-23 10:46:23 +1000289dnl Checks for library functions.
Ben Lindstrom67e21e12000-11-05 09:08:45 +0000290AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000291dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000292AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000293dnl Checks for libutil functions
andre2ff7b5d2000-06-03 14:57:40 +0000294AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000295dnl Checks for utmp functions
andre2ff7b5d2000-06-03 14:57:40 +0000296AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
297AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000298dnl Checks for utmpx functions
andre2ff7b5d2000-06-03 14:57:40 +0000299AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
300AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100301
Damien Miller5fc85652000-07-09 23:53:07 +1000302AC_CHECK_FUNC(getuserattr,
303 [AC_DEFINE(HAVE_GETUSERATTR)],
304 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
305)
306
Damien Miller04f80141999-11-19 15:32:34 +1100307AC_CHECK_FUNC(login,
308 [AC_DEFINE(HAVE_LOGIN)],
309 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
310)
311
312AC_CHECK_FUNC(daemon,
313 [AC_DEFINE(HAVE_DAEMON)],
314 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
315)
316
Damien Miller9fb07e42000-03-05 16:22:59 +1100317AC_CHECK_FUNC(getpagesize,
318 [AC_DEFINE(HAVE_GETPAGESIZE)],
319 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
320)
321
Damien Millercb170cb2000-07-01 16:52:55 +1000322# Check for broken snprintf
323if test "x$ac_cv_func_snprintf" = "xyes" ; then
324 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
325 AC_TRY_RUN(
326 [
327#include <stdio.h>
328int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
329 ],
330 [AC_MSG_RESULT(yes)],
331 [
332 AC_MSG_RESULT(no)
333 AC_DEFINE(BROKEN_SNPRINTF)
334 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
335 ]
336 )
337fi
338
Damien Miller606f8802000-09-16 15:39:56 +1100339AC_FUNC_GETPGRP
340
Damien Miller7b22d652000-06-18 14:07:04 +1000341PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100342AC_ARG_WITH(pam,
343 [ --without-pam Disable PAM support ],
344 [
345 if test "x$withval" = "xno" ; then
346 no_pam=1
347 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000348 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100349 fi
350 ]
351)
Damien Milleredb82922000-06-20 13:25:52 +1000352if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100353 AC_CHECK_LIB(dl, dlopen, , )
354 LIBS="$LIBS -lpam"
355
Damien Miller0e65eed2000-05-17 22:16:05 +1000356 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000357
Damien Miller1f335fb2000-06-26 11:31:33 +1000358 disable_shadow=yes
359
Damien Miller7b22d652000-06-18 14:07:04 +1000360 PAM_MSG="yes"
361
Damien Millera22ba012000-03-02 23:09:20 +1100362 # Check PAM strerror arguments (old PAM)
363 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
364 AC_TRY_COMPILE(
365 [
Damien Miller81171112000-04-23 11:14:01 +1000366#include <stdlib.h>
367#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100368 ],
369 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
370 [AC_MSG_RESULT(no)],
371 [
372 AC_DEFINE(HAVE_OLD_PAM)
373 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000374 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100375 ]
376 )
377fi
378
379# The big search for OpenSSL
380AC_ARG_WITH(ssl-dir,
381 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
382 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000383 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100384 tryssldir=$withval
385 fi
386 ]
387)
388
389saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100390saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100391saved_CFLAGS="$CFLAGS"
392if test "x$prefix" != "xNONE" ; then
393 tryssldir="$tryssldir $prefix"
394fi
Damien Miller61e50f12000-05-08 20:49:37 +1000395AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100396
Damien Millera1b61e12000-09-16 17:02:16 +1100397 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 +1000398 if test ! -z "$ssldir" ; then
399 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
400 CFLAGS="$saved_CFLAGS -I$ssldir/include"
401 if test ! -z "$need_dash_r" ; then
402 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
403 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100404 else
Damien Miller61e50f12000-05-08 20:49:37 +1000405 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100406 fi
407
Damien Miller3b512e12000-05-17 23:29:18 +1000408 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000409
Damien Miller3b512e12000-05-17 23:29:18 +1000410 # Basic test to check for compatible version and correct linking
411 # *does not* test for RSA - that comes later.
412 AC_TRY_RUN(
413 [
Damien Millere59ce622000-05-01 20:54:17 +1000414#include <string.h>
415#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000416int main(void)
417{
Damien Miller3b512e12000-05-17 23:29:18 +1000418 char a[2048];
419 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000420 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000421 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000422}
Damien Miller3b512e12000-05-17 23:29:18 +1000423 ],
424 [
425 found_crypto=1
426 break;
427 ], []
428 )
Damien Miller61e50f12000-05-08 20:49:37 +1000429
430 if test ! -z "$found_crypto" ; then
431 break;
432 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100433 done
434
Damien Miller61e50f12000-05-08 20:49:37 +1000435 if test -z "$found_crypto" ; then
436 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100437 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000438 if test -z "$ssldir" ; then
439 ssldir="(system)"
440 fi
Damien Millera22ba012000-03-02 23:09:20 +1100441
Damien Miller61e50f12000-05-08 20:49:37 +1000442 ac_cv_openssldir=$ssldir
443])
444
Damien Milleredb82922000-06-20 13:25:52 +1000445if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000446 AC_DEFINE(HAVE_OPENSSL)
447 dnl Need to recover ssldir - test above runs in subshell
448 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100449 CFLAGS="$saved_CFLAGS -I$ssldir/include"
450 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
451 if test ! -z "$need_dash_r" ; then
452 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100453 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100454 if test ! -z "$blibpath" ; then
455 blibpath="$blibpath:$ssldir:$ssldir/lib"
456 fi
Damien Millera22ba012000-03-02 23:09:20 +1100457fi
Damien Miller3b512e12000-05-17 23:29:18 +1000458LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000459
Damien Miller3b512e12000-05-17 23:29:18 +1000460# Now test RSA support
461saved_LIBS="$LIBS"
462AC_MSG_CHECKING([for RSA support])
463for WANTS_RSAREF in "" 1 ; do
464 if test -z "$WANTS_RSAREF" ; then
465 LIBS="$saved_LIBS"
466 else
467 LIBS="$saved_LIBS -lRSAglue -lrsaref"
468 fi
469 AC_TRY_RUN([
470#include <string.h>
471#include <openssl/rand.h>
472#include <openssl/rsa.h>
473#include <openssl/bn.h>
474#include <openssl/sha.h>
475int main(void)
476{
477 int num; RSA *key; static unsigned char p_in[] = "blahblah";
478 unsigned char c[256], p[256];
479 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
480 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
481 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
482 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
483}
484 ],
485 [
486 rsa_works=1
487 break;
488 ], [])
489done
490
491if test ! -z "$no_rsa" ; then
492 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000493 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000494else
495 if test -z "$rsa_works" ; then
496 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000497 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000498 else
499 if test -z "$WANTS_RSAREF" ; then
500 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000501 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000502 else
Damien Miller7b22d652000-06-18 14:07:04 +1000503 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000504 AC_MSG_RESULT(using RSAref)
505 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
506 fi
507 fi
508fi
Damien Millera22ba012000-03-02 23:09:20 +1100509
Ben Lindstromb5628642000-10-18 00:02:25 +0000510# Cheap hack to ensure NEWS-OS libraries are arranged right.
511if test ! -z "$SONY" ; then
512 LIBS="$LIBS -liberty";
513fi
514
Damien Millera22ba012000-03-02 23:09:20 +1100515# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100516AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100517AC_CHECK_SIZEOF(short int, 2)
518AC_CHECK_SIZEOF(int, 4)
519AC_CHECK_SIZEOF(long int, 4)
520AC_CHECK_SIZEOF(long long int, 8)
521
Damien Millera22ba012000-03-02 23:09:20 +1100522# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100523AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
524 AC_TRY_COMPILE(
525 [ #include <sys/types.h> ],
526 [ u_int a; a = 1;],
527 [ ac_cv_have_u_int="yes" ],
528 [ ac_cv_have_u_int="no" ]
529 )
530])
531if test "x$ac_cv_have_u_int" = "xyes" ; then
532 AC_DEFINE(HAVE_U_INT)
533 have_u_int=1
534fi
535
Damien Miller61e50f12000-05-08 20:49:37 +1000536AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
537 AC_TRY_COMPILE(
538 [ #include <sys/types.h> ],
539 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
540 [ ac_cv_have_intxx_t="yes" ],
541 [ ac_cv_have_intxx_t="no" ]
542 )
543])
544if test "x$ac_cv_have_intxx_t" = "xyes" ; then
545 AC_DEFINE(HAVE_INTXX_T)
546 have_intxx_t=1
547fi
548
Damien Miller578783e2000-09-23 14:12:24 +1100549AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
550 AC_TRY_COMPILE(
551 [ #include <sys/types.h> ],
552 [ int64_t a; a = 1;],
553 [ ac_cv_have_int64_t="yes" ],
554 [ ac_cv_have_int64_t="no" ]
555 )
556])
557if test "x$ac_cv_have_int64_t" = "xyes" ; then
558 AC_DEFINE(HAVE_INT64_T)
559 have_int64_t=1
560fi
561
Damien Miller61e50f12000-05-08 20:49:37 +1000562AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
563 AC_TRY_COMPILE(
564 [ #include <sys/types.h> ],
565 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
566 [ ac_cv_have_u_intxx_t="yes" ],
567 [ ac_cv_have_u_intxx_t="no" ]
568 )
569])
570if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
571 AC_DEFINE(HAVE_U_INTXX_T)
572 have_u_intxx_t=1
573fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100574
Damien Miller578783e2000-09-23 14:12:24 +1100575AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
576 AC_TRY_COMPILE(
577 [ #include <sys/types.h> ],
578 [ u_int64_t a; a = 1;],
579 [ ac_cv_have_u_int64_t="yes" ],
580 [ ac_cv_have_u_int64_t="no" ]
581 )
582])
583if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
584 AC_DEFINE(HAVE_U_INT64_T)
585 have_u_int64_t=1
586fi
587
Damien Milleredb82922000-06-20 13:25:52 +1000588if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
589 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100590then
591 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
592 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000593 [
594#include <sys/bitypes.h>
595 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100596 [
Damien Miller70494d12000-04-03 15:57:06 +1000597 int8_t a; int16_t b; int32_t c;
598 u_int8_t e; u_int16_t f; u_int32_t g;
599 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100600 ],
601 [
602 AC_DEFINE(HAVE_U_INTXX_T)
603 AC_DEFINE(HAVE_INTXX_T)
604 AC_MSG_RESULT(yes)
605 ],
606 [AC_MSG_RESULT(no)]
607 )
608fi
609
Damien Millerd6121d22000-03-17 23:26:46 +1100610if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000611 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
612 AC_TRY_COMPILE(
613 [
614#include <sys/types.h>
615 ],
616 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
617 [ ac_cv_have_uintxx_t="yes" ],
618 [ ac_cv_have_uintxx_t="no" ]
619 )
620 ])
621 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
622 AC_DEFINE(HAVE_UINTXX_T)
623 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100624fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100625
Damien Miller61e50f12000-05-08 20:49:37 +1000626AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
627 AC_TRY_COMPILE(
628 [
Damien Miller81171112000-04-23 11:14:01 +1000629#include <sys/types.h>
630#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000631 ],
632 [socklen_t foo; foo = 1235;],
633 [ ac_cv_have_socklen_t="yes" ],
634 [ ac_cv_have_socklen_t="no" ]
635 )
636])
637if test "x$ac_cv_have_socklen_t" = "xyes" ; then
638 AC_DEFINE(HAVE_SOCKLEN_T)
639fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100640
Damien Miller61e50f12000-05-08 20:49:37 +1000641AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
642 AC_TRY_COMPILE(
643 [
644#include <sys/types.h>
645 ],
646 [ size_t foo; foo = 1235; ],
647 [ ac_cv_have_size_t="yes" ],
648 [ ac_cv_have_size_t="no" ]
649 )
650])
651if test "x$ac_cv_have_size_t" = "xyes" ; then
652 AC_DEFINE(HAVE_SIZE_T)
653fi
Damien Miller95058511999-12-29 10:36:45 +1100654
Damien Miller615f9392000-05-17 22:53:33 +1000655AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
656 AC_TRY_COMPILE(
657 [
658#include <sys/types.h>
659 ],
660 [ ssize_t foo; foo = 1235; ],
661 [ ac_cv_have_ssize_t="yes" ],
662 [ ac_cv_have_ssize_t="no" ]
663 )
664])
665if test "x$ac_cv_have_ssize_t" = "xyes" ; then
666 AC_DEFINE(HAVE_SSIZE_T)
667fi
668
Damien Millerb54b40e2000-06-23 08:23:34 +1000669AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
670 AC_TRY_COMPILE(
671 [
672#include <sys/types.h>
673#include <sys/socket.h>
674 ],
675 [ sa_family_t foo; foo = 1235; ],
676 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100677 [ AC_TRY_COMPILE(
678 [
679#include <sys/types.h>
680#include <sys/socket.h>
681#include <netinet/in.h>
682 ],
683 [ sa_family_t foo; foo = 1235; ],
684 [ ac_cv_have_sa_family_t="yes" ],
685
Damien Millerb54b40e2000-06-23 08:23:34 +1000686 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100687 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000688 )
689])
690if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
691 AC_DEFINE(HAVE_SA_FAMILY_T)
692fi
693
Damien Miller0f91b4e2000-06-18 15:43:25 +1000694AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
695 AC_TRY_COMPILE(
696 [
697#include <sys/types.h>
698 ],
699 [ pid_t foo; foo = 1235; ],
700 [ ac_cv_have_pid_t="yes" ],
701 [ ac_cv_have_pid_t="no" ]
702 )
703])
704if test "x$ac_cv_have_pid_t" = "xyes" ; then
705 AC_DEFINE(HAVE_PID_T)
706fi
707
708AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
709 AC_TRY_COMPILE(
710 [
711#include <sys/types.h>
712 ],
713 [ mode_t foo; foo = 1235; ],
714 [ ac_cv_have_mode_t="yes" ],
715 [ ac_cv_have_mode_t="no" ]
716 )
717])
718if test "x$ac_cv_have_mode_t" = "xyes" ; then
719 AC_DEFINE(HAVE_MODE_T)
720fi
721
Damien Miller61e50f12000-05-08 20:49:37 +1000722
723AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
724 AC_TRY_COMPILE(
725 [
Damien Miller81171112000-04-23 11:14:01 +1000726#include <sys/types.h>
727#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000728 ],
729 [ struct sockaddr_storage s; ],
730 [ ac_cv_have_struct_sockaddr_storage="yes" ],
731 [ ac_cv_have_struct_sockaddr_storage="no" ]
732 )
733])
734if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
735 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
736fi
Damien Miller34132e52000-01-14 15:45:46 +1100737
Damien Miller61e50f12000-05-08 20:49:37 +1000738AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
739 AC_TRY_COMPILE(
740 [
Damien Miller7b22d652000-06-18 14:07:04 +1000741#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000742#include <netinet/in.h>
743 ],
744 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
745 [ ac_cv_have_struct_sockaddr_in6="yes" ],
746 [ ac_cv_have_struct_sockaddr_in6="no" ]
747 )
748])
749if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
750 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
751fi
Damien Miller34132e52000-01-14 15:45:46 +1100752
Damien Miller61e50f12000-05-08 20:49:37 +1000753AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
754 AC_TRY_COMPILE(
755 [
Damien Miller7b22d652000-06-18 14:07:04 +1000756#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000757#include <netinet/in.h>
758 ],
759 [ struct in6_addr s; s.s6_addr[0] = 0; ],
760 [ ac_cv_have_struct_in6_addr="yes" ],
761 [ ac_cv_have_struct_in6_addr="no" ]
762 )
763])
764if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
765 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
766fi
Damien Miller34132e52000-01-14 15:45:46 +1100767
Damien Miller61e50f12000-05-08 20:49:37 +1000768AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
769 AC_TRY_COMPILE(
770 [
Damien Miller81171112000-04-23 11:14:01 +1000771#include <sys/types.h>
772#include <sys/socket.h>
773#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000774 ],
775 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
776 [ ac_cv_have_struct_addrinfo="yes" ],
777 [ ac_cv_have_struct_addrinfo="no" ]
778 )
779])
780if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
781 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
782fi
783
Damien Miller78315eb2000-09-29 23:01:36 +1100784dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000785OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
786OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
787OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
788OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
789OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000790OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000791OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
792OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000793OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000794OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
795OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
796OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
797OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000798OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
799OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
800OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
801OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100802AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000803
Damien Miller942da032000-08-18 13:59:06 +1000804AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
805 ac_cv_have_sun_len_in_struct_sockaddr_un, [
806 AC_TRY_COMPILE(
807 [
808#include <sys/types.h>
809#include <sys/socket.h>
810 ],
811 [ struct sockaddr_un s; s.sun_len = 1; ],
812 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
813 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
814 )
815])
816if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
817 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
818fi
819
Damien Miller61e50f12000-05-08 20:49:37 +1000820AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
821 ac_cv_have_ss_family_in_struct_ss, [
822 AC_TRY_COMPILE(
823 [
Damien Miller81171112000-04-23 11:14:01 +1000824#include <sys/types.h>
825#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000826 ],
827 [ struct sockaddr_storage s; s.ss_family = 1; ],
828 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
829 [ ac_cv_have_ss_family_in_struct_ss="no" ],
830 )
831])
832if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
833 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
834fi
835
Damien Miller61e50f12000-05-08 20:49:37 +1000836AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
837 ac_cv_have___ss_family_in_struct_ss, [
838 AC_TRY_COMPILE(
839 [
Damien Miller81171112000-04-23 11:14:01 +1000840#include <sys/types.h>
841#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000842 ],
843 [ struct sockaddr_storage s; s.__ss_family = 1; ],
844 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
845 [ ac_cv_have___ss_family_in_struct_ss="no" ]
846 )
847])
848if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
849 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
850fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100851
Damien Millerad833b32000-08-23 10:46:23 +1000852AC_CACHE_CHECK([for pw_class field in struct passwd],
853 ac_cv_have_pw_class_in_struct_passwd, [
854 AC_TRY_COMPILE(
855 [
Damien Millerad833b32000-08-23 10:46:23 +1000856#include <pwd.h>
857 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000858 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000859 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
860 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
861 )
862])
863if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
864 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
865fi
866
Damien Miller61e50f12000-05-08 20:49:37 +1000867
868AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
869 AC_TRY_LINK([],
870 [ extern char *__progname; printf("%s", __progname); ],
871 [ ac_cv_libc_defines___progname="yes" ],
872 [ ac_cv_libc_defines___progname="no" ]
873 )
874])
875if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
876 AC_DEFINE(HAVE___PROGNAME)
877fi
878
Damien Millera22ba012000-03-02 23:09:20 +1100879
Damien Millerecbb26d2000-07-15 14:59:14 +1000880AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
881 AC_TRY_LINK([],
882 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
883 [ ac_cv_libc_defines_sys_errlist="yes" ],
884 [ ac_cv_libc_defines_sys_errlist="no" ]
885 )
886])
887if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
888 AC_DEFINE(HAVE_SYS_ERRLIST)
889fi
890
891
Damien Miller11fa2cc2000-08-16 10:35:58 +1000892AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
893 AC_TRY_LINK([],
894 [ extern int sys_nerr; printf("%i", sys_nerr);],
895 [ ac_cv_libc_defines_sys_nerr="yes" ],
896 [ ac_cv_libc_defines_sys_nerr="no" ]
897 )
898])
899if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
900 AC_DEFINE(HAVE_SYS_NERR)
901fi
902
903
Damien Millera22ba012000-03-02 23:09:20 +1100904# Looking for programs, paths and files
905AC_ARG_WITH(rsh,
906 [ --with-rsh=PATH Specify path to remote shell program ],
907 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100908 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000909 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100910 fi
911 ],
912 [
913 AC_PATH_PROG(rsh_path, rsh)
914 ]
915)
916
917AC_ARG_WITH(xauth,
918 [ --with-xauth=PATH Specify path to xauth program ],
919 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000920 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000921 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100922 fi
923 ],
924 [
Damien Miller78315eb2000-09-29 23:01:36 +1100925 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 +1000926 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100927 xauth_path="/usr/openwin/bin/xauth"
928 fi
929 ]
930)
931
932if test ! -z "$xauth_path" ; then
933 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
934fi
935if test ! -z "$rsh_path" ; then
936 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
937fi
938
939# Check for mail directory (last resort if we cannot get it from headers)
940if test ! -z "$MAIL" ; then
941 maildir=`dirname $MAIL`
942 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
943fi
944
Damien Millera22ba012000-03-02 23:09:20 +1100945if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100946 AC_CHECK_FILE("/dev/ptmx",
947 [
948 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
949 have_dev_ptmx=1
950 ]
951 )
Damien Millera22ba012000-03-02 23:09:20 +1100952fi
Damien Miller204ad072000-03-02 23:56:12 +1100953AC_CHECK_FILE("/dev/ptc",
954 [
955 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
956 have_dev_ptc=1
957 ]
958)
959
Damien Millera22ba012000-03-02 23:09:20 +1100960# Options from here on. Some of these are preset by platform above
961
Damien Millera22ba012000-03-02 23:09:20 +1100962# Check for user-specified random device, otherwise check /dev/urandom
963AC_ARG_WITH(random,
964 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
965 [
Damien Miller040f3832000-04-03 14:50:43 +1000966 if test "x$withval" != "xno" ; then
967 RANDOM_POOL="$withval";
968 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
969 fi
Damien Millera22ba012000-03-02 23:09:20 +1100970 ],
971 [
972 # Check for random device
973 AC_CHECK_FILE("/dev/urandom",
974 [
975 RANDOM_POOL="/dev/urandom";
976 AC_SUBST(RANDOM_POOL)
977 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
978 ]
979 )
980 ]
981)
982
983# Check for EGD pool file
984AC_ARG_WITH(egd-pool,
985 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
986 [
Damien Miller040f3832000-04-03 14:50:43 +1000987 if test "x$withval" != "xno" ; then
988 EGD_SOCKET="$withval";
989 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
990 fi
Damien Millera22ba012000-03-02 23:09:20 +1100991 ]
992)
993
Damien Miller0437b332000-05-02 09:56:41 +1000994# detect pathnames for entropy gathering commands, if we need them
995INSTALL_SSH_PRNG_CMDS=""
996rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000997if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000998 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000999 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1000 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1001 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1002 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1003 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1004 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1005 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1006 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1007 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1008 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1009 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1010 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1011 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1012 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1013 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +10001014
1015 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001016fi
Damien Miller0437b332000-05-02 09:56:41 +10001017AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1018
Damien Miller11e37f62000-04-08 18:23:30 +10001019
Damien Miller670a4b82000-01-22 13:53:11 +11001020AC_ARG_WITH(catman,
1021 [ --with-catman=man|cat Install preformatted manpages[no]],
1022 [
1023 MANTYPE='$(CATMAN)'
1024 if test x"$withval" != x"yes" ; then
1025 mansubdir=$withval
1026 else
1027 mansubdir=cat
1028 fi
1029 ], [
1030 if test -z "$MANTYPE" ; then
1031 MANTYPE='$(TROFFMAN)'
1032 mansubdir=man
1033 fi
1034 ]
1035)
1036AC_SUBST(MANTYPE)
1037AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001038
Damien Millera22ba012000-03-02 23:09:20 +11001039# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001040KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001041AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001042 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001043 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001044 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001045
Ben Lindstrom23e13712000-10-29 22:49:19 +00001046 if test "x$withval" != "xyes" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001047 CFLAGS="$CFLAGS -I${withval}/include"
1048 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001049 if test ! -z "$need_dash_r" ; then
1050 LDFLAGS="$LDFLAGS -R${withval}/lib"
1051 fi
1052 if test ! -z "$blibpath" ; then
1053 blibpath="$blibpath:${withval}/lib"
1054 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001055 else
1056 if test -d /usr/include/kerberosIV ; then
1057 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
1058 fi
1059 fi
1060
1061 AC_CHECK_HEADERS(krb.h)
1062 AC_CHECK_LIB(krb, main)
1063 if test "$ac_cv_header_krb_h" != yes; then
1064 AC_MSG_WARN([Cannot find krb.h, build may fail])
1065 fi
1066 if test "$ac_cv_lib_krb_main" != yes; then
1067 AC_MSG_WARN([Cannot find libkrb, build may fail])
1068 fi
1069
Damien Millerc85f9b42000-01-29 10:20:21 +11001070 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001071 AC_CHECK_LIB(resolv, dn_expand, , )
1072 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001073 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001074 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001075 fi
Damien Miller80297751999-11-19 13:03:25 +11001076 ]
1077)
1078
Damien Millera22ba012000-03-02 23:09:20 +11001079# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001080AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001081AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001082 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001083 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001084 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001085
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001086 if test "x$withval" != "xyes" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001087 CFLAGS="$CFLAGS -I${withval}/include"
1088 LFLAGS="$LFLAGS -L${withval}/lib"
1089 fi
1090
1091 if test -z "$KRB4" ; then
1092 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1093 fi
1094
Damien Miller8bdeee21999-12-30 15:50:54 +11001095 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001096 if test ! -z "$AFS_LIBS" ; then
1097 LIBS="$LIBS $AFS_LIBS"
1098 fi
1099 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001100 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001101 fi
Damien Miller80297751999-11-19 13:03:25 +11001102 ]
1103)
Damien Millerc85f9b42000-01-29 10:20:21 +11001104LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001105
Damien Millera22ba012000-03-02 23:09:20 +11001106# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001107SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001108AC_ARG_WITH(skey,
1109 [ --with-skey Enable S/Key support],
1110 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001111 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001112 AC_DEFINE(SKEY)
1113 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001114 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001115 fi
Damien Miller80297751999-11-19 13:03:25 +11001116 ]
1117)
1118
Damien Millera22ba012000-03-02 23:09:20 +11001119# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001120TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001121AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001122 [ --with-tcp-wrappers Enable tcpwrappers support],
1123 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001124 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001125 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001126 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001127 AC_MSG_CHECKING(for libwrap)
1128 AC_TRY_LINK(
1129 [
Damien Miller81171112000-04-23 11:14:01 +10001130#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001131 int deny_severity = 0, allow_severity = 0;
1132 ],
1133 [hosts_access(0);],
1134 [
1135 AC_MSG_RESULT(yes)
1136 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001137 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001138 ],
1139 [
Damien Miller7b22d652000-06-18 14:07:04 +10001140 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001141 ]
1142 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001143 fi
Damien Miller80297751999-11-19 13:03:25 +11001144 ]
1145)
1146
Damien Millera22ba012000-03-02 23:09:20 +11001147# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001148MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001149AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001150 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001151 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001152 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001153 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001154 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001155 fi
1156 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001157)
1158
Damien Millera22ba012000-03-02 23:09:20 +11001159# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001160AC_ARG_WITH(shadow,
1161 [ --without-shadow Disable shadow password support],
1162 [
1163 if test "x$withval" = "xno" ; then
1164 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001165 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001166 fi
1167 ]
1168)
1169
Damien Miller1f335fb2000-06-26 11:31:33 +10001170if test -z "$disable_shadow" ; then
1171 AC_MSG_CHECKING([if the systems has expire shadow information])
1172 AC_TRY_COMPILE(
1173 [
1174#include <sys/types.h>
1175#include <shadow.h>
1176 struct spwd sp;
1177 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1178 [ sp_expire_available=yes ], []
1179 )
1180
1181 if test "x$sp_expire_available" = "xyes" ; then
1182 AC_MSG_RESULT(yes)
1183 AC_DEFINE(HAS_SHADOW_EXPIRE)
1184 else
1185 AC_MSG_RESULT(no)
1186 fi
1187fi
1188
Damien Millera22ba012000-03-02 23:09:20 +11001189# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001190if test ! -z "$IPADDR_IN_DISPLAY" ; then
1191 DISPLAY_HACK_MSG="yes"
1192 AC_DEFINE(IPADDR_IN_DISPLAY)
1193else
1194 DISPLAY_HACK_MSG="no"
1195 AC_ARG_WITH(ipaddr-display,
1196 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1197 [
1198 if test "x$withval" != "xno" ; then
1199 AC_DEFINE(IPADDR_IN_DISPLAY)
1200 DISPLAY_HACK_MSG="yes"
1201 fi
1202 ]
1203 )
1204fi
Damien Miller76112de1999-12-21 11:18:08 +11001205
Damien Millera22ba012000-03-02 23:09:20 +11001206# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001207SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001208AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001209 [ --with-default-path=PATH Specify default \$PATH environment for server],
1210 [
1211 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001212 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001213 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001214 fi
1215 ]
1216)
1217
Damien Millera22ba012000-03-02 23:09:20 +11001218# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001219IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001220AC_ARG_WITH(ipv4-default,
1221 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1222 [
1223 if test "x$withval" != "xno" ; then
1224 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001225 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001226 fi
1227 ]
1228)
1229
Damien Miller61e50f12000-05-08 20:49:37 +10001230AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001231IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001232AC_ARG_WITH(4in6,
1233 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1234 [
1235 if test "x$withval" != "xno" ; then
1236 AC_MSG_RESULT(yes)
1237 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001238 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001239 else
1240 AC_MSG_RESULT(no)
1241 fi
1242 ],[
1243 if test "x$inet6_default_4in6" = "xyes"; then
1244 AC_MSG_RESULT([yes (default)])
1245 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001246 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001247 else
1248 AC_MSG_RESULT([no (default)])
1249 fi
1250 ]
1251)
1252
Damien Miller78315eb2000-09-29 23:01:36 +11001253AC_MSG_CHECKING(whether to install ssh as suid root)
1254AC_ARG_ENABLE(suid-ssh,
1255[ --enable-suid-ssh Install ssh as suid root (default)
1256 --disable-suid-ssh Install ssh without suid bit],
1257[ case "$enableval" in
1258 no)
1259 AC_MSG_RESULT(no)
1260 SSHMODE=0711
1261 ;;
1262 *) AC_MSG_RESULT(yes)
1263 SSHMODE=04711
1264 ;;
1265 esac ],
1266 AC_MSG_RESULT(yes)
1267 SSHMODE=04711
1268)
1269AC_SUBST(SSHMODE)
1270
1271
Damien Millera22ba012000-03-02 23:09:20 +11001272# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001273piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001274AC_ARG_WITH(pid-dir,
1275 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1276 [
1277 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001278 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001279 fi
1280 ]
1281)
Damien Miller4018c192000-04-30 09:30:44 +10001282
Damien Miller78315eb2000-09-29 23:01:36 +11001283# make sure the directory exists
1284if test ! -d $piddir ; then
1285 piddir=`eval echo ${sysconfdir}`
1286 case $piddir in
1287 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1288 esac
1289fi
1290
Damien Millerdbd250f2000-01-18 08:57:14 +11001291AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001292AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001293
andre2ff7b5d2000-06-03 14:57:40 +00001294dnl allow user to disable some login recording features
1295AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001296 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001297 [ AC_DEFINE(DISABLE_LASTLOG) ]
1298)
1299AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001300 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001301 [ AC_DEFINE(DISABLE_UTMP) ]
1302)
1303AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001304 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001305 [ AC_DEFINE(DISABLE_UTMPX) ]
1306)
1307AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001308 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001309 [ AC_DEFINE(DISABLE_WTMP) ]
1310)
1311AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001312 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001313 [ AC_DEFINE(DISABLE_WTMPX) ]
1314)
1315AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001316 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001317 [ AC_DEFINE(DISABLE_LOGIN) ]
1318)
1319AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001320 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001321 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1322)
1323AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001324 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001325 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1326)
1327AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001328 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001329 [ conf_lastlog_location="$withval"; ],)
1330
1331dnl lastlog, [uw]tmpx? detection
1332dnl NOTE: set the paths in the platform section to avoid the
1333dnl need for command-line parameters
1334dnl lastlog and [uw]tmp are subject to a file search if all else fails
1335
1336dnl lastlog detection
1337dnl NOTE: the code itself will detect if lastlog is a directory
1338AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1339AC_TRY_COMPILE([
1340#include <sys/types.h>
1341#include <utmp.h>
1342#ifdef HAVE_LASTLOG_H
1343# include <lastlog.h>
1344#endif
Damien Miller2994e082000-06-04 15:51:47 +10001345#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001346# include <paths.h>
1347#endif
1348 ],
1349 [ char *lastlog = LASTLOG_FILE; ],
1350 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001351 [
1352 AC_MSG_RESULT(no)
1353 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1354 AC_TRY_COMPILE([
1355#include <sys/types.h>
1356#include <utmp.h>
1357#ifdef HAVE_LASTLOG_H
1358# include <lastlog.h>
1359#endif
1360#ifdef HAVE_PATHS_H
1361# include <paths.h>
1362#endif
1363 ],
1364 [ char *lastlog = _PATH_LASTLOG; ],
1365 [ AC_MSG_RESULT(yes) ],
1366 [
andree441aa32000-06-12 22:34:38 +00001367 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001368 system_lastlog_path=no
1369 ])
1370 ]
andre2ff7b5d2000-06-03 14:57:40 +00001371)
Damien Miller2994e082000-06-04 15:51:47 +10001372
andre2ff7b5d2000-06-03 14:57:40 +00001373if test -z "$conf_lastlog_location"; then
1374 if test x"$system_lastlog_path" = x"no" ; then
1375 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001376 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001377 conf_lastlog_location=$f
1378 fi
1379 done
1380 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001381 AC_MSG_WARN([** Cannot find lastlog **])
1382 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001383 fi
1384 fi
1385fi
1386
1387if test -n "$conf_lastlog_location"; then
1388 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1389fi
1390
1391dnl utmp detection
1392AC_MSG_CHECKING([if your system defines UTMP_FILE])
1393AC_TRY_COMPILE([
1394#include <sys/types.h>
1395#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001396#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001397# include <paths.h>
1398#endif
1399 ],
1400 [ char *utmp = UTMP_FILE; ],
1401 [ AC_MSG_RESULT(yes) ],
1402 [ AC_MSG_RESULT(no)
1403 system_utmp_path=no ]
1404)
1405if test -z "$conf_utmp_location"; then
1406 if test x"$system_utmp_path" = x"no" ; then
1407 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1408 if test -f $f ; then
1409 conf_utmp_location=$f
1410 fi
1411 done
1412 if test -z "$conf_utmp_location"; then
1413 AC_DEFINE(DISABLE_UTMP)
1414 fi
1415 fi
1416fi
1417if test -n "$conf_utmp_location"; then
1418 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1419fi
1420
1421dnl wtmp detection
1422AC_MSG_CHECKING([if your system defines WTMP_FILE])
1423AC_TRY_COMPILE([
1424#include <sys/types.h>
1425#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001426#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001427# include <paths.h>
1428#endif
1429 ],
1430 [ char *wtmp = WTMP_FILE; ],
1431 [ AC_MSG_RESULT(yes) ],
1432 [ AC_MSG_RESULT(no)
1433 system_wtmp_path=no ]
1434)
1435if test -z "$conf_wtmp_location"; then
1436 if test x"$system_wtmp_path" = x"no" ; then
1437 for f in /usr/adm/wtmp /var/log/wtmp; do
1438 if test -f $f ; then
1439 conf_wtmp_location=$f
1440 fi
1441 done
1442 if test -z "$conf_wtmp_location"; then
1443 AC_DEFINE(DISABLE_WTMP)
1444 fi
1445 fi
1446fi
1447if test -n "$conf_wtmp_location"; then
1448 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1449fi
1450
1451
1452dnl utmpx detection - I don't know any system so perverse as to require
1453dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1454dnl there, though.
1455AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1456AC_TRY_COMPILE([
1457#include <sys/types.h>
1458#include <utmp.h>
1459#ifdef HAVE_UTMPX_H
1460#include <utmpx.h>
1461#endif
Damien Miller2994e082000-06-04 15:51:47 +10001462#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001463# include <paths.h>
1464#endif
1465 ],
1466 [ char *utmpx = UTMPX_FILE; ],
1467 [ AC_MSG_RESULT(yes) ],
1468 [ AC_MSG_RESULT(no)
1469 system_utmpx_path=no ]
1470)
1471if test -z "$conf_utmpx_location"; then
1472 if test x"$system_utmpx_path" = x"no" ; then
1473 AC_DEFINE(DISABLE_UTMPX)
1474 fi
1475else
1476 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1477fi
1478
1479dnl wtmpx detection
1480AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1481AC_TRY_COMPILE([
1482#include <sys/types.h>
1483#include <utmp.h>
1484#ifdef HAVE_UTMPX_H
1485#include <utmpx.h>
1486#endif
Damien Miller2994e082000-06-04 15:51:47 +10001487#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001488# include <paths.h>
1489#endif
1490 ],
1491 [ char *wtmpx = WTMPX_FILE; ],
1492 [ AC_MSG_RESULT(yes) ],
1493 [ AC_MSG_RESULT(no)
1494 system_wtmpx_path=no ]
1495)
1496if test -z "$conf_wtmpx_location"; then
1497 if test x"$system_wtmpx_path" = x"no" ; then
1498 AC_DEFINE(DISABLE_WTMPX)
1499 fi
1500else
1501 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1502fi
1503
Damien Miller4018c192000-04-30 09:30:44 +10001504
1505# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001506entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001507AC_ARG_WITH(entropy-timeout,
1508 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1509 [
1510 if test "x$withval" != "xno" ; then
1511 entropy_timeout=$withval
1512 fi
1513 ]
1514)
1515AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1516
1517
Damien Miller29ea30d2000-03-17 10:54:15 +11001518if test ! -z "$blibpath" ; then
1519 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1520 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1521fi
1522
Damien Millerbac2d8a2000-09-05 16:13:06 +11001523AC_EXEEXT
1524
Damien Miller0437b332000-05-02 09:56:41 +10001525AC_OUTPUT(Makefile ssh_prng_cmds)
1526
Damien Miller7b22d652000-06-18 14:07:04 +10001527# Print summary of options
1528
1529if test x$MANTYPE = x'$(CATMAN)' ; then
1530 MAN_MSG=cat
1531else
1532 MAN_MSG=man
1533fi
1534if test ! -z "$RANDOM_POOL" ; then
1535 RAND_MSG="Device ($RANDOM_POOL)"
1536else
1537 if test ! -z "$EGD_SOCKET" ; then
1538 RAND_MSG="EGD ($EGD_SOCKET)"
1539 else
1540 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001541 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001542 fi
1543fi
1544
1545# Someone please show me a better way :)
1546A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1547B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1548C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1549D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001550E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001551F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1552G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1553
1554echo ""
1555echo "OpenSSH configured has been configured with the following options."
1556echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001557echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001558echo " System binaries: $C"
1559echo " Configuration files: $D"
1560echo " Askpass program: $E"
1561echo " Manual pages: $F"
1562echo " PID file: $G"
1563echo " Random number collection: $RAND_MSG"
1564echo " Manpage format: $MAN_MSG"
1565echo " PAM support: ${PAM_MSG}"
1566echo " KerberosIV support: $KRB4_MSG"
1567echo " AFS support: $AFS_MSG"
1568echo " S/KEY support: $SKEY_MSG"
1569echo " TCP Wrappers support: $TCPW_MSG"
1570echo " MD5 password support: $MD5_MSG"
1571echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1572echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1573echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1574
1575echo ""
1576
Damien Millere68f92b2000-10-02 21:42:15 +11001577echo " Host: ${host}"
1578echo " Compiler: ${CC}"
1579echo " Compiler flags: ${CFLAGS}"
1580echo " Linker flags: ${LDFLAGS}"
1581echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001582
1583echo ""
1584
Damien Miller6f9c3372000-10-25 10:06:04 +11001585if test ! -z "$BUILTIN_RNG" ; then
1586 echo "WARNING: you are using the builtin random number collection service."
1587 echo "Please read WARNING.RNG and request that your OS vendor includes"
1588 echo "/dev/random in future versions of their OS."
1589 echo ""
1590fi