blob: 8f7f5d2b70918b96c9f307b3f95bb5a0f0963c22 [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
Ben Lindstrom582d3982001-02-06 22:54:30 +000011AC_PATH_PROG(AR, ar)
Damien Millere79334a1999-12-29 10:03:37 +110012AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100014AC_PATH_PROG(ENT, ent)
15AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110016AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller2e1b0821999-12-25 10:11:29 +110017
Damien Miller3f62aba2000-11-29 11:56:35 +110018if test -z "$AR" ; then
19 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
20fi
21
Damien Millerad833b32000-08-23 10:46:23 +100022# Use LOGIN_PROGRAM from environment if possible
23if test ! -z "$LOGIN_PROGRAM" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
25else
26 # Search for login
27 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
28 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
30 fi
31fi
32
Damien Miller166bd442000-03-16 10:48:25 +110033if test -z "$LD" ; then
34 LD=$CC
35fi
36AC_SUBST(LD)
37
38# C Compiler features
39AC_C_INLINE
40if test "$GCC" = "yes"; then
41 CFLAGS="$CFLAGS -Wall"
42fi
43
Damien Millera22ba012000-03-02 23:09:20 +110044# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110045case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110046*-*-aix*)
47 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000048 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110049 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100050 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110051 blibpath="/usr/lib:/lib:/usr/local/lib"
52 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100053 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110054 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000055 MANTYPE='$(CATMAN)'
56 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000057 dnl AIX handles lastlog as part of its login message
58 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100059 MANTYPE='$(CATMAN)'
60 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110061 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110062*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110063 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110064 AC_DEFINE(HAVE_CYGWIN)
Damien Millerbac2d8a2000-09-05 16:13:06 +110065 AC_DEFINE(DISABLE_SHADOW)
66 AC_DEFINE(IPV4_DEFAULT)
67 AC_DEFINE(IP_TOS_IS_BROKEN)
68 AC_DEFINE(BROKEN_VHANGUP)
Damien Millerbac2d8a2000-09-05 16:13:06 +110069 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
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000076 CPPFLAGS="$CPPFLAGS -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*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000087 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110088 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110089 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110090 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110091 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110092 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000093 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110094 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +100095 MANTYPE='$(CATMAN)'
96 mansubdir=cat
97 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110098*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000099 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000100 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100101 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100102 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +1100103 no_libsocket=1
104 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000105 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100106 ;;
107*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000108 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000109 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100110 PATH="$PATH:/usr/etc"
Damien Miller07278932000-01-22 14:05:37 +1100111 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +1000112 AC_DEFINE(WITH_IRIX_ARRAY)
113 AC_DEFINE(WITH_IRIX_PROJECT)
114 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000115 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100116 no_libsocket=1
117 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000118 AC_DEFINE(BROKEN_INET_NTOA)
Ben Lindstrom75214f92000-12-01 21:19:51 +0000119 mansubdir=man
Damien Millerbeb4ba51999-12-28 15:09:35 +1100120 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100121*-*-linux*)
122 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100123 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100124 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000125 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100126 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100127 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000128mips-sony-bsd|mips-sony-newsos4)
129 AC_DEFINE(HAVE_NEWS4)
130 SONY=1
131 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
132 AC_MSG_ERROR([*** libiberty missing - please install first ***])
133 )
134 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100135*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100136 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100137 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000138*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000139 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100140 conf_utmp_location=/etc/utmp
141 conf_wtmp_location=/usr/adm/wtmp
142 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000143 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000144 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000145 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000146 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000147 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000148 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100149*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000150 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100151 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100152 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100153 AC_DEFINE(PAM_SUN_CODEBASE)
andre2ff7b5d2000-06-03 14:57:40 +0000154 # hardwire lastlog location (can't detect it on some versions)
155 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000156 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
157 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
158 if test "$sol2ver" -ge 8; then
159 AC_MSG_RESULT(yes)
160 AC_DEFINE(DISABLE_UTMP)
161 AC_DEFINE(DISABLE_WTMP)
162 else
163 AC_MSG_RESULT(no)
164 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100165 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000166*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000167 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000168 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100169 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000170 conf_utmp_location=/etc/utmp
171 conf_wtmp_location=/var/adm/wtmp
172 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000173 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000174 MANTYPE='$(CATMAN)'
175 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000176 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000177*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000178 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000179 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
180 MANTYPE='$(CATMAN)'
Damien Millerfd9885e2001-01-10 08:16:53 +1100181 IPADDR_IN_DISPLAY=yes
182 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000183 AC_DEFINE(IP_TOS_IS_BROKEN)
184 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000185 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000186 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100187*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000188 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100189 LDFLAGS="$LDFLAGS -L/usr/local/lib"
190 MANTYPE='$(CATMAN)'
191 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100192 enable_suid_ssh=no
193 ;;
194*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000195 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100196 LDFLAGS="$LDFLAGS -L/usr/local/lib"
197 MANTYPE='$(CATMAN)'
198 mansubdir=cat
Damien Miller78315eb2000-09-29 23:01:36 +1100199 enable_suid_ssh=no
200 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100201*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100204 MANTYPE='$(CATMAN)'
205 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100206 LIBS="$LIBS -lgen -lsocket"
207 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100208*-*-sco3.2v4*)
Damien Miller238a9fa2000-08-31 09:20:05 +1100209 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000210 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100211 LDFLAGS="$LDFLAGS -L/usr/local/lib"
212 MANTYPE='$(CATMAN)'
213 mansubdir=cat
Ben Lindstrom980754c2000-11-12 00:04:24 +0000214 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100215 no_dev_ptmx=1
216 RANLIB=true
217 AC_DEFINE(BROKEN_SYS_TERMIO_H)
218 rsh_path="/usr/bin/rcmd"
219 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000220 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000221 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller78315eb2000-09-29 23:01:36 +1100222 ;;
223*-*-sco3.2v5*)
Ben Lindstrom49af82b2001-01-27 20:43:57 +0000224 AC_DEFINE(USE_PIPES)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000225 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000226 LDFLAGS="$LDFLAGS -L/usr/local/lib"
227 MANTYPE='$(CATMAN)'
228 mansubdir=cat
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000229 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000230 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100231 rsh_path="/usr/bin/rcmd"
232 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000233 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000234 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millera66626b2000-06-13 18:57:53 +1000235 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000236*-dec-osf*)
237# This is untested
238 if test ! -z "USE_SIA" ; then
239 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
240 if test -f /etc/sia/matrix.conf; then
241 AC_MSG_RESULT(yes)
242 AC_DEFINE(HAVE_OSF_SIA)
243 AC_DEFINE(DISABLE_LOGIN)
244 LIBS="$LIBS -lsecurity -ldb -lm -laud"
245 else
246 AC_MSG_RESULT(no)
247 fi
248 fi
249 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100250esac
251
Damien Millere37bfc12000-06-05 09:37:43 +1000252# Allow user to specify flags
253AC_ARG_WITH(cflags,
254 [ --with-cflags Specify additional flags to pass to compiler],
255 [
256 if test "x$withval" != "xno" ; then
257 CFLAGS="$CFLAGS $withval"
258 fi
259 ]
260)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000261AC_ARG_WITH(cppflags,
262 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
263 [
264 if test "x$withval" != "xno"; then
265 CPPFLAGS="$CPPFLAGS $withval"
266 fi
267 ]
268)
Damien Millere37bfc12000-06-05 09:37:43 +1000269AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000270 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000271 [
272 if test "x$withval" != "xno" ; then
273 LDFLAGS="$LDFLAGS $withval"
274 fi
275 ]
276)
277AC_ARG_WITH(libs,
278 [ --with-libs Specify additional libraries to link with],
279 [
280 if test "x$withval" != "xno" ; then
281 LIBS="$LIBS $withval"
282 fi
283 ]
284)
285
286
Damien Millera22ba012000-03-02 23:09:20 +1100287# Checks for libraries.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000288if test -z "$no_libsocket" ; then
289 AC_CHECK_LIB(nsl, yp_match, , )
290fi
291if test -z "$no_libnsl" ; then
292 AC_CHECK_LIB(socket, main, , )
293fi
294
295AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Millerab18c411999-11-11 10:40:23 +1100296AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
297AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100298
299AC_CHECK_FUNC(regcomp,
Ben Lindstrom401d58f2001-01-19 17:11:43 +0000300 [ AC_DEFINE(HAVE_REGCOMP)],
Damien Miller6f9c3372000-10-25 10:06:04 +1100301 [
302 AC_CHECK_LIB(pcre, pcre_info,
303 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
304 ]
305)
Damien Millerab18c411999-11-11 10:40:23 +1100306
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000307dnl UnixWare 2.x
308AC_CHECK_FUNC(strcasecmp,
309 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
310)
311AC_CHECK_FUNC(utimes,
312 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
313)
Damien Millerab18c411999-11-11 10:40:23 +1100314
Damien Millera22ba012000-03-02 23:09:20 +1100315# Checks for header files.
Ben Lindstromcb577332001-01-22 21:06:19 +0000316AC_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 regex.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.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 utime.h utmp.h utmpx.h vis.h)
Damien Millerab18c411999-11-11 10:40:23 +1100317
Damien Millerad833b32000-08-23 10:46:23 +1000318dnl Checks for library functions.
Ben Lindstromdd5c5a32001-02-02 18:58:33 +0000319AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000320dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000321AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000322dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000323AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000324AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000325dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000326AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000327AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000328dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000329AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000330AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100331
Damien Miller5fc85652000-07-09 23:53:07 +1000332AC_CHECK_FUNC(getuserattr,
333 [AC_DEFINE(HAVE_GETUSERATTR)],
334 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
335)
336
Damien Miller04f80141999-11-19 15:32:34 +1100337AC_CHECK_FUNC(login,
338 [AC_DEFINE(HAVE_LOGIN)],
339 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
340)
341
342AC_CHECK_FUNC(daemon,
343 [AC_DEFINE(HAVE_DAEMON)],
344 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
345)
346
Damien Miller9fb07e42000-03-05 16:22:59 +1100347AC_CHECK_FUNC(getpagesize,
348 [AC_DEFINE(HAVE_GETPAGESIZE)],
349 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
350)
351
Damien Millercb170cb2000-07-01 16:52:55 +1000352# Check for broken snprintf
353if test "x$ac_cv_func_snprintf" = "xyes" ; then
354 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
355 AC_TRY_RUN(
356 [
357#include <stdio.h>
358int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
359 ],
360 [AC_MSG_RESULT(yes)],
361 [
362 AC_MSG_RESULT(no)
363 AC_DEFINE(BROKEN_SNPRINTF)
364 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
365 ]
366 )
367fi
368
Damien Miller606f8802000-09-16 15:39:56 +1100369AC_FUNC_GETPGRP
370
Ben Lindstromec3830a2001-01-25 00:07:33 +0000371AC_FUNC_STRFTIME
372
Damien Millera64b57a2001-01-17 10:44:13 +1100373# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000374PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100375AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100376 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100377 [
Damien Millera64b57a2001-01-17 10:44:13 +1100378 if test "x$withval" != "xno" ; then
379 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
380 AC_MSG_ERROR([PAM headers not found])
381 fi
382
383 AC_CHECK_LIB(dl, dlopen, , )
384 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
385 AC_CHECK_FUNCS(pam_getenvlist)
386
387 disable_shadow=yes
388 PAM_MSG="yes"
389
390 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100391 fi
392 ]
393)
Damien Millera22ba012000-03-02 23:09:20 +1100394
Damien Millera64b57a2001-01-17 10:44:13 +1100395# Check for older PAM
396if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100397 # Check PAM strerror arguments (old PAM)
398 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
399 AC_TRY_COMPILE(
400 [
Damien Miller81171112000-04-23 11:14:01 +1000401#include <stdlib.h>
402#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100403 ],
404 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
405 [AC_MSG_RESULT(no)],
406 [
407 AC_DEFINE(HAVE_OLD_PAM)
408 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000409 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100410 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100411 )
Damien Millera22ba012000-03-02 23:09:20 +1100412fi
413
414# The big search for OpenSSL
415AC_ARG_WITH(ssl-dir,
416 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
417 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000418 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100419 tryssldir=$withval
420 fi
421 ]
422)
423
424saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100425saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000426saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100427if test "x$prefix" != "xNONE" ; then
428 tryssldir="$tryssldir $prefix"
429fi
Damien Miller61e50f12000-05-08 20:49:37 +1000430AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100431
Damien Millera1b61e12000-09-16 17:02:16 +1100432 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 Millera64b57a2001-01-17 10:44:13 +1100433 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Miller61e50f12000-05-08 20:49:37 +1000434 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000435 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Miller61e50f12000-05-08 20:49:37 +1000436 if test ! -z "$need_dash_r" ; then
437 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
438 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100439 else
Damien Miller61e50f12000-05-08 20:49:37 +1000440 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100441 fi
442
Damien Miller3b512e12000-05-17 23:29:18 +1000443 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000444
Damien Miller3b512e12000-05-17 23:29:18 +1000445 # Basic test to check for compatible version and correct linking
446 # *does not* test for RSA - that comes later.
447 AC_TRY_RUN(
448 [
Damien Millere59ce622000-05-01 20:54:17 +1000449#include <string.h>
450#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000451int main(void)
452{
Damien Miller3b512e12000-05-17 23:29:18 +1000453 char a[2048];
454 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000455 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000456 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000457}
Damien Miller3b512e12000-05-17 23:29:18 +1000458 ],
459 [
460 found_crypto=1
461 break;
462 ], []
463 )
Damien Miller61e50f12000-05-08 20:49:37 +1000464
465 if test ! -z "$found_crypto" ; then
466 break;
467 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100468 done
469
Damien Miller61e50f12000-05-08 20:49:37 +1000470 if test -z "$found_crypto" ; then
471 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100472 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000473 if test -z "$ssldir" ; then
474 ssldir="(system)"
475 fi
Damien Millera22ba012000-03-02 23:09:20 +1100476
Damien Miller61e50f12000-05-08 20:49:37 +1000477 ac_cv_openssldir=$ssldir
478])
479
Damien Milleredb82922000-06-20 13:25:52 +1000480if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000481 AC_DEFINE(HAVE_OPENSSL)
482 dnl Need to recover ssldir - test above runs in subshell
483 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100484
485 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
486 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
487 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
488 if test ! -z "$need_dash_r" ; then
489 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
490 fi
491 if test ! -z "$blibpath" ; then
492 blibpath="$blibpath:$ssldir:$ssldir/lib"
493 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100494 fi
Damien Millera22ba012000-03-02 23:09:20 +1100495fi
Damien Miller3b512e12000-05-17 23:29:18 +1000496LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000497
Damien Miller3b512e12000-05-17 23:29:18 +1000498# Now test RSA support
499saved_LIBS="$LIBS"
500AC_MSG_CHECKING([for RSA support])
501for WANTS_RSAREF in "" 1 ; do
502 if test -z "$WANTS_RSAREF" ; then
503 LIBS="$saved_LIBS"
504 else
505 LIBS="$saved_LIBS -lRSAglue -lrsaref"
506 fi
507 AC_TRY_RUN([
508#include <string.h>
509#include <openssl/rand.h>
510#include <openssl/rsa.h>
511#include <openssl/bn.h>
512#include <openssl/sha.h>
513int main(void)
514{
515 int num; RSA *key; static unsigned char p_in[] = "blahblah";
516 unsigned char c[256], p[256];
517 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
518 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
519 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
520 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
521}
522 ],
523 [
524 rsa_works=1
525 break;
526 ], [])
527done
528
529if test ! -z "$no_rsa" ; then
530 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000531 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000532else
533 if test -z "$rsa_works" ; then
534 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000535 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000536 else
537 if test -z "$WANTS_RSAREF" ; then
538 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000539 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000540 else
Damien Miller7b22d652000-06-18 14:07:04 +1000541 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000542 AC_MSG_RESULT(using RSAref)
543 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
544 fi
545 fi
546fi
Damien Millera22ba012000-03-02 23:09:20 +1100547
Damien Millera64b57a2001-01-17 10:44:13 +1100548# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
549# version in OpenSSL. Skip this for PAM
550if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
551 AC_CHECK_LIB(crypt, crypt, , )
552fi
553
Ben Lindstromb5628642000-10-18 00:02:25 +0000554# Cheap hack to ensure NEWS-OS libraries are arranged right.
555if test ! -z "$SONY" ; then
556 LIBS="$LIBS -liberty";
557fi
558
Damien Millera22ba012000-03-02 23:09:20 +1100559# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100560AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100561AC_CHECK_SIZEOF(short int, 2)
562AC_CHECK_SIZEOF(int, 4)
563AC_CHECK_SIZEOF(long int, 4)
564AC_CHECK_SIZEOF(long long int, 8)
565
Damien Millera22ba012000-03-02 23:09:20 +1100566# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100567AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
568 AC_TRY_COMPILE(
569 [ #include <sys/types.h> ],
570 [ u_int a; a = 1;],
571 [ ac_cv_have_u_int="yes" ],
572 [ ac_cv_have_u_int="no" ]
573 )
574])
575if test "x$ac_cv_have_u_int" = "xyes" ; then
576 AC_DEFINE(HAVE_U_INT)
577 have_u_int=1
578fi
579
Damien Miller61e50f12000-05-08 20:49:37 +1000580AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
581 AC_TRY_COMPILE(
582 [ #include <sys/types.h> ],
583 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
584 [ ac_cv_have_intxx_t="yes" ],
585 [ ac_cv_have_intxx_t="no" ]
586 )
587])
588if test "x$ac_cv_have_intxx_t" = "xyes" ; then
589 AC_DEFINE(HAVE_INTXX_T)
590 have_intxx_t=1
591fi
592
Damien Miller578783e2000-09-23 14:12:24 +1100593AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
594 AC_TRY_COMPILE(
595 [ #include <sys/types.h> ],
596 [ int64_t a; a = 1;],
597 [ ac_cv_have_int64_t="yes" ],
598 [ ac_cv_have_int64_t="no" ]
599 )
600])
601if test "x$ac_cv_have_int64_t" = "xyes" ; then
602 AC_DEFINE(HAVE_INT64_T)
603 have_int64_t=1
604fi
605
Damien Miller61e50f12000-05-08 20:49:37 +1000606AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
607 AC_TRY_COMPILE(
608 [ #include <sys/types.h> ],
609 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
610 [ ac_cv_have_u_intxx_t="yes" ],
611 [ ac_cv_have_u_intxx_t="no" ]
612 )
613])
614if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
615 AC_DEFINE(HAVE_U_INTXX_T)
616 have_u_intxx_t=1
617fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100618
Damien Miller578783e2000-09-23 14:12:24 +1100619AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
620 AC_TRY_COMPILE(
621 [ #include <sys/types.h> ],
622 [ u_int64_t a; a = 1;],
623 [ ac_cv_have_u_int64_t="yes" ],
624 [ ac_cv_have_u_int64_t="no" ]
625 )
626])
627if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
628 AC_DEFINE(HAVE_U_INT64_T)
629 have_u_int64_t=1
630fi
631
Damien Milleredb82922000-06-20 13:25:52 +1000632if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
633 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100634then
635 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
636 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000637 [
638#include <sys/bitypes.h>
639 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100640 [
Damien Miller70494d12000-04-03 15:57:06 +1000641 int8_t a; int16_t b; int32_t c;
642 u_int8_t e; u_int16_t f; u_int32_t g;
643 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100644 ],
645 [
646 AC_DEFINE(HAVE_U_INTXX_T)
647 AC_DEFINE(HAVE_INTXX_T)
648 AC_MSG_RESULT(yes)
649 ],
650 [AC_MSG_RESULT(no)]
651 )
652fi
653
Damien Millerd6121d22000-03-17 23:26:46 +1100654if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000655 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
656 AC_TRY_COMPILE(
657 [
658#include <sys/types.h>
659 ],
660 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
661 [ ac_cv_have_uintxx_t="yes" ],
662 [ ac_cv_have_uintxx_t="no" ]
663 )
664 ])
665 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
666 AC_DEFINE(HAVE_UINTXX_T)
667 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100668fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100669
Damien Miller61e50f12000-05-08 20:49:37 +1000670AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
671 AC_TRY_COMPILE(
672 [
Damien Miller81171112000-04-23 11:14:01 +1000673#include <sys/types.h>
674#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000675 ],
676 [socklen_t foo; foo = 1235;],
677 [ ac_cv_have_socklen_t="yes" ],
678 [ ac_cv_have_socklen_t="no" ]
679 )
680])
681if test "x$ac_cv_have_socklen_t" = "xyes" ; then
682 AC_DEFINE(HAVE_SOCKLEN_T)
683fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100684
Damien Miller61e50f12000-05-08 20:49:37 +1000685AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
686 AC_TRY_COMPILE(
687 [
688#include <sys/types.h>
689 ],
690 [ size_t foo; foo = 1235; ],
691 [ ac_cv_have_size_t="yes" ],
692 [ ac_cv_have_size_t="no" ]
693 )
694])
695if test "x$ac_cv_have_size_t" = "xyes" ; then
696 AC_DEFINE(HAVE_SIZE_T)
697fi
Damien Miller95058511999-12-29 10:36:45 +1100698
Damien Miller615f9392000-05-17 22:53:33 +1000699AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
700 AC_TRY_COMPILE(
701 [
702#include <sys/types.h>
703 ],
704 [ ssize_t foo; foo = 1235; ],
705 [ ac_cv_have_ssize_t="yes" ],
706 [ ac_cv_have_ssize_t="no" ]
707 )
708])
709if test "x$ac_cv_have_ssize_t" = "xyes" ; then
710 AC_DEFINE(HAVE_SSIZE_T)
711fi
712
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000713AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
714 AC_TRY_COMPILE(
715 [
716#include <time.h>
717 ],
718 [ clock_t foo; foo = 1235; ],
719 [ ac_cv_have_clock_t="yes" ],
720 [ ac_cv_have_clock_t="no" ]
721 )
722])
723if test "x$ac_cv_have_clock_t" = "xyes" ; then
724 AC_DEFINE(HAVE_CLOCK_T)
725fi
726
Damien Millerb54b40e2000-06-23 08:23:34 +1000727AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
728 AC_TRY_COMPILE(
729 [
730#include <sys/types.h>
731#include <sys/socket.h>
732 ],
733 [ sa_family_t foo; foo = 1235; ],
734 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100735 [ AC_TRY_COMPILE(
736 [
737#include <sys/types.h>
738#include <sys/socket.h>
739#include <netinet/in.h>
740 ],
741 [ sa_family_t foo; foo = 1235; ],
742 [ ac_cv_have_sa_family_t="yes" ],
743
Damien Millerb54b40e2000-06-23 08:23:34 +1000744 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100745 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000746 )
747])
748if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
749 AC_DEFINE(HAVE_SA_FAMILY_T)
750fi
751
Damien Miller0f91b4e2000-06-18 15:43:25 +1000752AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
753 AC_TRY_COMPILE(
754 [
755#include <sys/types.h>
756 ],
757 [ pid_t foo; foo = 1235; ],
758 [ ac_cv_have_pid_t="yes" ],
759 [ ac_cv_have_pid_t="no" ]
760 )
761])
762if test "x$ac_cv_have_pid_t" = "xyes" ; then
763 AC_DEFINE(HAVE_PID_T)
764fi
765
766AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
767 AC_TRY_COMPILE(
768 [
769#include <sys/types.h>
770 ],
771 [ mode_t foo; foo = 1235; ],
772 [ ac_cv_have_mode_t="yes" ],
773 [ ac_cv_have_mode_t="no" ]
774 )
775])
776if test "x$ac_cv_have_mode_t" = "xyes" ; then
777 AC_DEFINE(HAVE_MODE_T)
778fi
779
Damien Miller61e50f12000-05-08 20:49:37 +1000780
781AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
782 AC_TRY_COMPILE(
783 [
Damien Miller81171112000-04-23 11:14:01 +1000784#include <sys/types.h>
785#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000786 ],
787 [ struct sockaddr_storage s; ],
788 [ ac_cv_have_struct_sockaddr_storage="yes" ],
789 [ ac_cv_have_struct_sockaddr_storage="no" ]
790 )
791])
792if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
793 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
794fi
Damien Miller34132e52000-01-14 15:45:46 +1100795
Damien Miller61e50f12000-05-08 20:49:37 +1000796AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
797 AC_TRY_COMPILE(
798 [
Damien Miller7b22d652000-06-18 14:07:04 +1000799#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000800#include <netinet/in.h>
801 ],
802 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
803 [ ac_cv_have_struct_sockaddr_in6="yes" ],
804 [ ac_cv_have_struct_sockaddr_in6="no" ]
805 )
806])
807if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
808 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
809fi
Damien Miller34132e52000-01-14 15:45:46 +1100810
Damien Miller61e50f12000-05-08 20:49:37 +1000811AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
812 AC_TRY_COMPILE(
813 [
Damien Miller7b22d652000-06-18 14:07:04 +1000814#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000815#include <netinet/in.h>
816 ],
817 [ struct in6_addr s; s.s6_addr[0] = 0; ],
818 [ ac_cv_have_struct_in6_addr="yes" ],
819 [ ac_cv_have_struct_in6_addr="no" ]
820 )
821])
822if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
823 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
824fi
Damien Miller34132e52000-01-14 15:45:46 +1100825
Damien Miller61e50f12000-05-08 20:49:37 +1000826AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
827 AC_TRY_COMPILE(
828 [
Damien Miller81171112000-04-23 11:14:01 +1000829#include <sys/types.h>
830#include <sys/socket.h>
831#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000832 ],
833 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
834 [ ac_cv_have_struct_addrinfo="yes" ],
835 [ ac_cv_have_struct_addrinfo="no" ]
836 )
837])
838if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
839 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
840fi
841
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000842AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
843 AC_TRY_COMPILE(
844 [ #include <sys/time.h> ],
845 [ struct timeval tv; tv.tv_sec = 1;],
846 [ ac_cv_have_struct_timeval="yes" ],
847 [ ac_cv_have_struct_timeval="no" ]
848 )
849])
850if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
851 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
852 have_struct_timeval=1
853fi
854
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000855# If we don't have int64_t then we can't compile sftp-server. So don't
856# even attempt to do it.
857if test "x$ac_cv_have_int64_t" = "xno" -a \
858 "x$ac_cv_sizeof_long_int" != "x8" -a \
859 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
860 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000861fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000862AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000863
Damien Miller78315eb2000-09-29 23:01:36 +1100864dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000865OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
866OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
867OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
868OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
869OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000870OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000871OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
872OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000873OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000874OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
875OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
876OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
877OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000878OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
879OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
880OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
881OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100882AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000883
Damien Miller942da032000-08-18 13:59:06 +1000884AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
885 ac_cv_have_sun_len_in_struct_sockaddr_un, [
886 AC_TRY_COMPILE(
887 [
888#include <sys/types.h>
889#include <sys/socket.h>
890 ],
891 [ struct sockaddr_un s; s.sun_len = 1; ],
892 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
893 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
894 )
895])
896if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
897 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
898fi
899
Damien Miller61e50f12000-05-08 20:49:37 +1000900AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
901 ac_cv_have_ss_family_in_struct_ss, [
902 AC_TRY_COMPILE(
903 [
Damien Miller81171112000-04-23 11:14:01 +1000904#include <sys/types.h>
905#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000906 ],
907 [ struct sockaddr_storage s; s.ss_family = 1; ],
908 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
909 [ ac_cv_have_ss_family_in_struct_ss="no" ],
910 )
911])
912if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
913 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
914fi
915
Damien Miller61e50f12000-05-08 20:49:37 +1000916AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
917 ac_cv_have___ss_family_in_struct_ss, [
918 AC_TRY_COMPILE(
919 [
Damien Miller81171112000-04-23 11:14:01 +1000920#include <sys/types.h>
921#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000922 ],
923 [ struct sockaddr_storage s; s.__ss_family = 1; ],
924 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
925 [ ac_cv_have___ss_family_in_struct_ss="no" ]
926 )
927])
928if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
929 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
930fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100931
Damien Millerad833b32000-08-23 10:46:23 +1000932AC_CACHE_CHECK([for pw_class field in struct passwd],
933 ac_cv_have_pw_class_in_struct_passwd, [
934 AC_TRY_COMPILE(
935 [
Damien Millerad833b32000-08-23 10:46:23 +1000936#include <pwd.h>
937 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000938 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000939 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
940 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
941 )
942])
943if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
944 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
945fi
946
Damien Miller61e50f12000-05-08 20:49:37 +1000947
948AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
949 AC_TRY_LINK([],
950 [ extern char *__progname; printf("%s", __progname); ],
951 [ ac_cv_libc_defines___progname="yes" ],
952 [ ac_cv_libc_defines___progname="no" ]
953 )
954])
955if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
956 AC_DEFINE(HAVE___PROGNAME)
957fi
958
Damien Millera22ba012000-03-02 23:09:20 +1100959
Damien Millerecbb26d2000-07-15 14:59:14 +1000960AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
961 AC_TRY_LINK([],
962 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
963 [ ac_cv_libc_defines_sys_errlist="yes" ],
964 [ ac_cv_libc_defines_sys_errlist="no" ]
965 )
966])
967if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
968 AC_DEFINE(HAVE_SYS_ERRLIST)
969fi
970
971
Damien Miller11fa2cc2000-08-16 10:35:58 +1000972AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
973 AC_TRY_LINK([],
974 [ extern int sys_nerr; printf("%i", sys_nerr);],
975 [ ac_cv_libc_defines_sys_nerr="yes" ],
976 [ ac_cv_libc_defines_sys_nerr="no" ]
977 )
978])
979if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
980 AC_DEFINE(HAVE_SYS_NERR)
981fi
982
983
Damien Millera22ba012000-03-02 23:09:20 +1100984# Looking for programs, paths and files
985AC_ARG_WITH(rsh,
986 [ --with-rsh=PATH Specify path to remote shell program ],
987 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100988 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000989 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100990 fi
991 ],
992 [
993 AC_PATH_PROG(rsh_path, rsh)
994 ]
995)
996
997AC_ARG_WITH(xauth,
998 [ --with-xauth=PATH Specify path to xauth program ],
999 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001000 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001001 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001002 fi
1003 ],
1004 [
Damien Miller78315eb2000-09-29 23:01:36 +11001005 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 +10001006 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001007 xauth_path="/usr/openwin/bin/xauth"
1008 fi
1009 ]
1010)
1011
Damien Millera19cf472000-11-29 13:28:50 +11001012if test -z "$xauth_path" ; then
1013 XAUTH_PATH="undefined"
1014 AC_SUBST(XAUTH_PATH)
1015else
Damien Millera22ba012000-03-02 23:09:20 +11001016 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001017 XAUTH_PATH=$xauth_path
1018 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001019fi
1020if test ! -z "$rsh_path" ; then
1021 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1022fi
1023
1024# Check for mail directory (last resort if we cannot get it from headers)
1025if test ! -z "$MAIL" ; then
1026 maildir=`dirname $MAIL`
1027 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1028fi
1029
Damien Millera22ba012000-03-02 23:09:20 +11001030if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001031 AC_CHECK_FILE("/dev/ptmx",
1032 [
1033 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1034 have_dev_ptmx=1
1035 ]
1036 )
Damien Millera22ba012000-03-02 23:09:20 +11001037fi
Damien Miller204ad072000-03-02 23:56:12 +11001038AC_CHECK_FILE("/dev/ptc",
1039 [
1040 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1041 have_dev_ptc=1
1042 ]
1043)
1044
Damien Millera22ba012000-03-02 23:09:20 +11001045# Options from here on. Some of these are preset by platform above
1046
Damien Millera22ba012000-03-02 23:09:20 +11001047# Check for user-specified random device, otherwise check /dev/urandom
1048AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001049 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001050 [
Damien Miller040f3832000-04-03 14:50:43 +10001051 if test "x$withval" != "xno" ; then
1052 RANDOM_POOL="$withval";
1053 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1054 fi
Damien Millera22ba012000-03-02 23:09:20 +11001055 ],
1056 [
1057 # Check for random device
1058 AC_CHECK_FILE("/dev/urandom",
1059 [
1060 RANDOM_POOL="/dev/urandom";
1061 AC_SUBST(RANDOM_POOL)
1062 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1063 ]
1064 )
1065 ]
1066)
1067
1068# Check for EGD pool file
1069AC_ARG_WITH(egd-pool,
Damien Miller0736c4d2001-01-25 10:51:46 +11001070 [ --with-egd-pool=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001071 [
Damien Miller040f3832000-04-03 14:50:43 +10001072 if test "x$withval" != "xno" ; then
1073 EGD_SOCKET="$withval";
1074 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1075 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001076 ],
1077 [
1078 # Check for existing socket only if we don't have a random device already
1079 if test -z "$RANDOM_POOL" ; then
1080 AC_MSG_CHECKING(for PRNGD/EGD socket)
1081 # Insert other locations here
1082 for egdsock in /var/run/egd-pool /etc/entropy ; do
1083 if test -S $egdsock ; then
1084 EGD_SOCKET="$egdsock"
1085 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1086 AC_MSG_RESULT($egdsock)
1087 break;
1088 fi
1089 done
1090 fi
Damien Millera22ba012000-03-02 23:09:20 +11001091 ]
1092)
1093
Damien Miller0736c4d2001-01-25 10:51:46 +11001094
Damien Miller0437b332000-05-02 09:56:41 +10001095# detect pathnames for entropy gathering commands, if we need them
1096INSTALL_SSH_PRNG_CMDS=""
1097rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001098if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001099 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001100 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1101 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1102 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1103 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1104 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1105 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1106 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1107 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1108 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1109 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1110 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1111 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1112 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1113 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001114
1115 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001116fi
Damien Miller0437b332000-05-02 09:56:41 +10001117AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1118
Damien Miller11e37f62000-04-08 18:23:30 +10001119
Damien Miller670a4b82000-01-22 13:53:11 +11001120AC_ARG_WITH(catman,
1121 [ --with-catman=man|cat Install preformatted manpages[no]],
1122 [
1123 MANTYPE='$(CATMAN)'
1124 if test x"$withval" != x"yes" ; then
1125 mansubdir=$withval
1126 else
1127 mansubdir=cat
1128 fi
1129 ], [
1130 if test -z "$MANTYPE" ; then
1131 MANTYPE='$(TROFFMAN)'
1132 mansubdir=man
1133 fi
1134 ]
1135)
1136AC_SUBST(MANTYPE)
1137AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001138
Damien Millera22ba012000-03-02 23:09:20 +11001139# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001140KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001141AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001142 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001143 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001144 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001145
Ben Lindstrom23e13712000-10-29 22:49:19 +00001146 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001147 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Damien Miller105b7f02000-01-07 08:45:55 +11001148 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001149 if test ! -z "$need_dash_r" ; then
1150 LDFLAGS="$LDFLAGS -R${withval}/lib"
1151 fi
1152 if test ! -z "$blibpath" ; then
1153 blibpath="$blibpath:${withval}/lib"
1154 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001155 else
1156 if test -d /usr/include/kerberosIV ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001157 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
Damien Miller105b7f02000-01-07 08:45:55 +11001158 fi
1159 fi
1160
1161 AC_CHECK_HEADERS(krb.h)
1162 AC_CHECK_LIB(krb, main)
1163 if test "$ac_cv_header_krb_h" != yes; then
1164 AC_MSG_WARN([Cannot find krb.h, build may fail])
1165 fi
1166 if test "$ac_cv_lib_krb_main" != yes; then
1167 AC_MSG_WARN([Cannot find libkrb, build may fail])
1168 fi
1169
Damien Millerc85f9b42000-01-29 10:20:21 +11001170 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001171 AC_CHECK_LIB(resolv, dn_expand, , )
1172 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001173 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001174 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001175 fi
Damien Miller80297751999-11-19 13:03:25 +11001176 ]
1177)
1178
Damien Millera22ba012000-03-02 23:09:20 +11001179# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001180AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001181AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001182 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001183 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001184 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001185
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001186 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001187 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001188 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller105b7f02000-01-07 08:45:55 +11001189 fi
1190
1191 if test -z "$KRB4" ; then
1192 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1193 fi
1194
Damien Miller8bdeee21999-12-30 15:50:54 +11001195 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001196 if test ! -z "$AFS_LIBS" ; then
1197 LIBS="$LIBS $AFS_LIBS"
1198 fi
1199 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001200 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001201 fi
Damien Miller80297751999-11-19 13:03:25 +11001202 ]
1203)
Damien Millerc85f9b42000-01-29 10:20:21 +11001204LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001205
Damien Millera22ba012000-03-02 23:09:20 +11001206# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001207SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001208AC_ARG_WITH(skey,
Ben Lindstrom305fb002000-11-10 02:41:30 +00001209 [ --with-skey=PATH Enable S/Key support],
Damien Miller80297751999-11-19 13:03:25 +11001210 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001211 if test "x$withval" != "xno" ; then
Ben Lindstrom305fb002000-11-10 02:41:30 +00001212
1213 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001214 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001215 LDFLAGS="$LDFLAGS -L${withval}/lib"
1216 fi
1217
Damien Miller8bdeee21999-12-30 15:50:54 +11001218 AC_DEFINE(SKEY)
Ben Lindstromb0c2eeb2001-02-03 22:15:00 +00001219 LIBS="-lskey $LIBS"
Damien Miller7b22d652000-06-18 14:07:04 +10001220 SKEY_MSG="yes"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001221
1222 AC_CHECK_FUNC(skey_keyinfo,
1223 [],
1224 [
1225 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1226 ])
Damien Miller8bdeee21999-12-30 15:50:54 +11001227 fi
Damien Miller80297751999-11-19 13:03:25 +11001228 ]
1229)
1230
Damien Millera22ba012000-03-02 23:09:20 +11001231# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001232TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001233AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001234 [ --with-tcp-wrappers Enable tcpwrappers support],
1235 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001236 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001237 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001238 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001239 AC_MSG_CHECKING(for libwrap)
1240 AC_TRY_LINK(
1241 [
Damien Miller81171112000-04-23 11:14:01 +10001242#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001243 int deny_severity = 0, allow_severity = 0;
1244 ],
1245 [hosts_access(0);],
1246 [
1247 AC_MSG_RESULT(yes)
1248 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001249 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001250 ],
1251 [
Damien Miller7b22d652000-06-18 14:07:04 +10001252 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001253 ]
1254 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001255 fi
Damien Miller80297751999-11-19 13:03:25 +11001256 ]
1257)
1258
Damien Millera22ba012000-03-02 23:09:20 +11001259# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001260MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001261AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001262 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001263 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001264 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001265 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001266 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001267 fi
1268 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001269)
1270
Damien Millera22ba012000-03-02 23:09:20 +11001271# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001272AC_ARG_WITH(shadow,
1273 [ --without-shadow Disable shadow password support],
1274 [
1275 if test "x$withval" = "xno" ; then
1276 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001277 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001278 fi
1279 ]
1280)
1281
Damien Miller1f335fb2000-06-26 11:31:33 +10001282if test -z "$disable_shadow" ; then
1283 AC_MSG_CHECKING([if the systems has expire shadow information])
1284 AC_TRY_COMPILE(
1285 [
1286#include <sys/types.h>
1287#include <shadow.h>
1288 struct spwd sp;
1289 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1290 [ sp_expire_available=yes ], []
1291 )
1292
1293 if test "x$sp_expire_available" = "xyes" ; then
1294 AC_MSG_RESULT(yes)
1295 AC_DEFINE(HAS_SHADOW_EXPIRE)
1296 else
1297 AC_MSG_RESULT(no)
1298 fi
1299fi
1300
Damien Millera22ba012000-03-02 23:09:20 +11001301# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001302if test ! -z "$IPADDR_IN_DISPLAY" ; then
1303 DISPLAY_HACK_MSG="yes"
1304 AC_DEFINE(IPADDR_IN_DISPLAY)
1305else
1306 DISPLAY_HACK_MSG="no"
1307 AC_ARG_WITH(ipaddr-display,
1308 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1309 [
1310 if test "x$withval" != "xno" ; then
1311 AC_DEFINE(IPADDR_IN_DISPLAY)
1312 DISPLAY_HACK_MSG="yes"
1313 fi
1314 ]
1315 )
1316fi
Damien Miller76112de1999-12-21 11:18:08 +11001317
Damien Millera22ba012000-03-02 23:09:20 +11001318# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001319SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001320AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001321 [ --with-default-path=PATH Specify default \$PATH environment for server],
1322 [
1323 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001324 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001325 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001326 fi
1327 ]
1328)
1329
Damien Millera22ba012000-03-02 23:09:20 +11001330# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001331IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001332AC_ARG_WITH(ipv4-default,
1333 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1334 [
1335 if test "x$withval" != "xno" ; then
1336 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001337 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001338 fi
1339 ]
1340)
1341
Damien Miller61e50f12000-05-08 20:49:37 +10001342AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001343IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001344AC_ARG_WITH(4in6,
1345 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1346 [
1347 if test "x$withval" != "xno" ; then
1348 AC_MSG_RESULT(yes)
1349 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001350 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001351 else
1352 AC_MSG_RESULT(no)
1353 fi
1354 ],[
1355 if test "x$inet6_default_4in6" = "xyes"; then
1356 AC_MSG_RESULT([yes (default)])
1357 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001358 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001359 else
1360 AC_MSG_RESULT([no (default)])
1361 fi
1362 ]
1363)
1364
Damien Miller78315eb2000-09-29 23:01:36 +11001365AC_MSG_CHECKING(whether to install ssh as suid root)
1366AC_ARG_ENABLE(suid-ssh,
1367[ --enable-suid-ssh Install ssh as suid root (default)
1368 --disable-suid-ssh Install ssh without suid bit],
1369[ case "$enableval" in
1370 no)
1371 AC_MSG_RESULT(no)
1372 SSHMODE=0711
1373 ;;
1374 *) AC_MSG_RESULT(yes)
1375 SSHMODE=04711
1376 ;;
1377 esac ],
1378 AC_MSG_RESULT(yes)
1379 SSHMODE=04711
1380)
1381AC_SUBST(SSHMODE)
1382
1383
Damien Millera22ba012000-03-02 23:09:20 +11001384# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001385piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001386AC_ARG_WITH(pid-dir,
1387 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1388 [
1389 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001390 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001391 fi
1392 ]
1393)
Damien Miller4018c192000-04-30 09:30:44 +10001394
Damien Miller78315eb2000-09-29 23:01:36 +11001395# make sure the directory exists
1396if test ! -d $piddir ; then
1397 piddir=`eval echo ${sysconfdir}`
1398 case $piddir in
1399 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1400 esac
1401fi
1402
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001403AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001404AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001405
andre2ff7b5d2000-06-03 14:57:40 +00001406dnl allow user to disable some login recording features
1407AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001408 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001409 [ AC_DEFINE(DISABLE_LASTLOG) ]
1410)
1411AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001412 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001413 [ AC_DEFINE(DISABLE_UTMP) ]
1414)
1415AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001416 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001417 [ AC_DEFINE(DISABLE_UTMPX) ]
1418)
1419AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001420 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001421 [ AC_DEFINE(DISABLE_WTMP) ]
1422)
1423AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001424 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001425 [ AC_DEFINE(DISABLE_WTMPX) ]
1426)
1427AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001428 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001429 [ AC_DEFINE(DISABLE_LOGIN) ]
1430)
1431AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001432 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001433 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1434)
1435AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001436 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001437 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1438)
1439AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001440 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001441 [
1442 if test "x$withval" = "xno" ; then
1443 AC_DEFINE(DISABLE_LASTLOG)
1444 else
1445 conf_lastlog_location=$withval
1446 fi
1447 ]
1448)
andre2ff7b5d2000-06-03 14:57:40 +00001449
1450dnl lastlog, [uw]tmpx? detection
1451dnl NOTE: set the paths in the platform section to avoid the
1452dnl need for command-line parameters
1453dnl lastlog and [uw]tmp are subject to a file search if all else fails
1454
1455dnl lastlog detection
1456dnl NOTE: the code itself will detect if lastlog is a directory
1457AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1458AC_TRY_COMPILE([
1459#include <sys/types.h>
1460#include <utmp.h>
1461#ifdef HAVE_LASTLOG_H
1462# include <lastlog.h>
1463#endif
Damien Miller2994e082000-06-04 15:51:47 +10001464#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001465# include <paths.h>
1466#endif
1467 ],
1468 [ char *lastlog = LASTLOG_FILE; ],
1469 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001470 [
1471 AC_MSG_RESULT(no)
1472 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1473 AC_TRY_COMPILE([
1474#include <sys/types.h>
1475#include <utmp.h>
1476#ifdef HAVE_LASTLOG_H
1477# include <lastlog.h>
1478#endif
1479#ifdef HAVE_PATHS_H
1480# include <paths.h>
1481#endif
1482 ],
1483 [ char *lastlog = _PATH_LASTLOG; ],
1484 [ AC_MSG_RESULT(yes) ],
1485 [
andree441aa32000-06-12 22:34:38 +00001486 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001487 system_lastlog_path=no
1488 ])
1489 ]
andre2ff7b5d2000-06-03 14:57:40 +00001490)
Damien Miller2994e082000-06-04 15:51:47 +10001491
andre2ff7b5d2000-06-03 14:57:40 +00001492if test -z "$conf_lastlog_location"; then
1493 if test x"$system_lastlog_path" = x"no" ; then
1494 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001495 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001496 conf_lastlog_location=$f
1497 fi
1498 done
1499 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001500 AC_MSG_WARN([** Cannot find lastlog **])
1501 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001502 fi
1503 fi
1504fi
1505
1506if test -n "$conf_lastlog_location"; then
1507 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1508fi
1509
1510dnl utmp detection
1511AC_MSG_CHECKING([if your system defines UTMP_FILE])
1512AC_TRY_COMPILE([
1513#include <sys/types.h>
1514#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001515#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001516# include <paths.h>
1517#endif
1518 ],
1519 [ char *utmp = UTMP_FILE; ],
1520 [ AC_MSG_RESULT(yes) ],
1521 [ AC_MSG_RESULT(no)
1522 system_utmp_path=no ]
1523)
1524if test -z "$conf_utmp_location"; then
1525 if test x"$system_utmp_path" = x"no" ; then
1526 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1527 if test -f $f ; then
1528 conf_utmp_location=$f
1529 fi
1530 done
1531 if test -z "$conf_utmp_location"; then
1532 AC_DEFINE(DISABLE_UTMP)
1533 fi
1534 fi
1535fi
1536if test -n "$conf_utmp_location"; then
1537 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1538fi
1539
1540dnl wtmp detection
1541AC_MSG_CHECKING([if your system defines WTMP_FILE])
1542AC_TRY_COMPILE([
1543#include <sys/types.h>
1544#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001545#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001546# include <paths.h>
1547#endif
1548 ],
1549 [ char *wtmp = WTMP_FILE; ],
1550 [ AC_MSG_RESULT(yes) ],
1551 [ AC_MSG_RESULT(no)
1552 system_wtmp_path=no ]
1553)
1554if test -z "$conf_wtmp_location"; then
1555 if test x"$system_wtmp_path" = x"no" ; then
1556 for f in /usr/adm/wtmp /var/log/wtmp; do
1557 if test -f $f ; then
1558 conf_wtmp_location=$f
1559 fi
1560 done
1561 if test -z "$conf_wtmp_location"; then
1562 AC_DEFINE(DISABLE_WTMP)
1563 fi
1564 fi
1565fi
1566if test -n "$conf_wtmp_location"; then
1567 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1568fi
1569
1570
1571dnl utmpx detection - I don't know any system so perverse as to require
1572dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1573dnl there, though.
1574AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1575AC_TRY_COMPILE([
1576#include <sys/types.h>
1577#include <utmp.h>
1578#ifdef HAVE_UTMPX_H
1579#include <utmpx.h>
1580#endif
Damien Miller2994e082000-06-04 15:51:47 +10001581#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001582# include <paths.h>
1583#endif
1584 ],
1585 [ char *utmpx = UTMPX_FILE; ],
1586 [ AC_MSG_RESULT(yes) ],
1587 [ AC_MSG_RESULT(no)
1588 system_utmpx_path=no ]
1589)
1590if test -z "$conf_utmpx_location"; then
1591 if test x"$system_utmpx_path" = x"no" ; then
1592 AC_DEFINE(DISABLE_UTMPX)
1593 fi
1594else
1595 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1596fi
1597
1598dnl wtmpx detection
1599AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1600AC_TRY_COMPILE([
1601#include <sys/types.h>
1602#include <utmp.h>
1603#ifdef HAVE_UTMPX_H
1604#include <utmpx.h>
1605#endif
Damien Miller2994e082000-06-04 15:51:47 +10001606#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001607# include <paths.h>
1608#endif
1609 ],
1610 [ char *wtmpx = WTMPX_FILE; ],
1611 [ AC_MSG_RESULT(yes) ],
1612 [ AC_MSG_RESULT(no)
1613 system_wtmpx_path=no ]
1614)
1615if test -z "$conf_wtmpx_location"; then
1616 if test x"$system_wtmpx_path" = x"no" ; then
1617 AC_DEFINE(DISABLE_WTMPX)
1618 fi
1619else
1620 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1621fi
1622
Damien Miller4018c192000-04-30 09:30:44 +10001623
1624# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001625entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001626AC_ARG_WITH(entropy-timeout,
1627 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1628 [
1629 if test "x$withval" != "xno" ; then
1630 entropy_timeout=$withval
1631 fi
1632 ]
1633)
1634AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1635
1636
Damien Miller29ea30d2000-03-17 10:54:15 +11001637if test ! -z "$blibpath" ; then
1638 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1639 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1640fi
1641
Damien Millerbac2d8a2000-09-05 16:13:06 +11001642AC_EXEEXT
1643
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001644AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001645
Damien Miller7b22d652000-06-18 14:07:04 +10001646# Print summary of options
1647
1648if test x$MANTYPE = x'$(CATMAN)' ; then
1649 MAN_MSG=cat
1650else
1651 MAN_MSG=man
1652fi
1653if test ! -z "$RANDOM_POOL" ; then
1654 RAND_MSG="Device ($RANDOM_POOL)"
1655else
1656 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001657 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001658 else
1659 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001660 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001661 fi
1662fi
1663
1664# Someone please show me a better way :)
1665A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1666B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1667C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1668D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001669E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001670F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1671G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1672
1673echo ""
1674echo "OpenSSH configured has been configured with the following options."
1675echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001676echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001677echo " System binaries: $C"
1678echo " Configuration files: $D"
1679echo " Askpass program: $E"
1680echo " Manual pages: $F"
1681echo " PID file: $G"
1682echo " Random number collection: $RAND_MSG"
1683echo " Manpage format: $MAN_MSG"
1684echo " PAM support: ${PAM_MSG}"
1685echo " KerberosIV support: $KRB4_MSG"
1686echo " AFS support: $AFS_MSG"
1687echo " S/KEY support: $SKEY_MSG"
1688echo " TCP Wrappers support: $TCPW_MSG"
1689echo " MD5 password support: $MD5_MSG"
1690echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1691echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1692echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1693
1694echo ""
1695
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001696echo " Host: ${host}"
1697echo " Compiler: ${CC}"
1698echo " Compiler flags: ${CFLAGS}"
1699echo "Preprocessor flags: ${CPPFLAGS}"
1700echo " Linker flags: ${LDFLAGS}"
1701echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001702
1703echo ""
1704
Damien Miller82cf0ce2000-12-20 13:34:48 +11001705if test "x$PAM_MSG" = "xyes" ; then
1706 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1707 echo "otherwise password authentication may fail. Example PAM control files"
1708 echo "can be found in the contrib/ subdirectory"
1709 echo ""
1710fi
1711
Damien Miller6f9c3372000-10-25 10:06:04 +11001712if test ! -z "$BUILTIN_RNG" ; then
1713 echo "WARNING: you are using the builtin random number collection service."
1714 echo "Please read WARNING.RNG and request that your OS vendor includes"
1715 echo "/dev/random in future versions of their OS."
1716 echo ""
1717fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001718
1719if test ! -z "$NO_SFTP"; then
1720 echo "sftp-server will be disabled. Your compiler does not support"
1721 echo "64bit integers."
1722 echo ""
1723fi