blob: 042c1e97a0ff219fc7943d02d6a458d0cef57dcb [file] [log] [blame]
Damien Millerab18c411999-11-11 10:40:23 +11001AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10002
3AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11004AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11005AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10006
Damien Millera22ba012000-03-02 23:09:20 +11007# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +11008AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +10009AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110010AC_PROG_INSTALL
Damien Millerc7b38ce1999-11-09 10:28:04 +110011AC_CHECK_PROG(AR, ar, ar)
Damien Millere79334a1999-12-29 10:03:37 +110012AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100014AC_PATH_PROG(ENT, ent)
15AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110016AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller2e1b0821999-12-25 10:11:29 +110017
Damien Miller3f62aba2000-11-29 11:56:35 +110018if test -z "$AR" ; then
19 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
20fi
21
Damien Millerad833b32000-08-23 10:46:23 +100022# Use LOGIN_PROGRAM from environment if possible
23if test ! -z "$LOGIN_PROGRAM" ; then
24 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
25else
26 # Search for login
27 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
28 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
29 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
30 fi
31fi
32
Damien Miller166bd442000-03-16 10:48:25 +110033if test -z "$LD" ; then
34 LD=$CC
35fi
36AC_SUBST(LD)
37
38# C Compiler features
39AC_C_INLINE
40if test "$GCC" = "yes"; then
41 CFLAGS="$CFLAGS -Wall"
42fi
43
Damien 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.
Damien Miller2a5c1ce2001-01-25 10:32:00 +1100319AC_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 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)
1114 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +10001115
1116 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001117fi
Damien Miller0437b332000-05-02 09:56:41 +10001118AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1119
Damien Miller11e37f62000-04-08 18:23:30 +10001120
Damien Miller670a4b82000-01-22 13:53:11 +11001121AC_ARG_WITH(catman,
1122 [ --with-catman=man|cat Install preformatted manpages[no]],
1123 [
1124 MANTYPE='$(CATMAN)'
1125 if test x"$withval" != x"yes" ; then
1126 mansubdir=$withval
1127 else
1128 mansubdir=cat
1129 fi
1130 ], [
1131 if test -z "$MANTYPE" ; then
1132 MANTYPE='$(TROFFMAN)'
1133 mansubdir=man
1134 fi
1135 ]
1136)
1137AC_SUBST(MANTYPE)
1138AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001139
Damien Millera22ba012000-03-02 23:09:20 +11001140# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001141KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001142AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001143 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001144 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001145 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001146
Ben Lindstrom23e13712000-10-29 22:49:19 +00001147 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001148 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Damien Miller105b7f02000-01-07 08:45:55 +11001149 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001150 if test ! -z "$need_dash_r" ; then
1151 LDFLAGS="$LDFLAGS -R${withval}/lib"
1152 fi
1153 if test ! -z "$blibpath" ; then
1154 blibpath="$blibpath:${withval}/lib"
1155 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001156 else
1157 if test -d /usr/include/kerberosIV ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001158 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
Damien Miller105b7f02000-01-07 08:45:55 +11001159 fi
1160 fi
1161
1162 AC_CHECK_HEADERS(krb.h)
1163 AC_CHECK_LIB(krb, main)
1164 if test "$ac_cv_header_krb_h" != yes; then
1165 AC_MSG_WARN([Cannot find krb.h, build may fail])
1166 fi
1167 if test "$ac_cv_lib_krb_main" != yes; then
1168 AC_MSG_WARN([Cannot find libkrb, build may fail])
1169 fi
1170
Damien Millerc85f9b42000-01-29 10:20:21 +11001171 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001172 AC_CHECK_LIB(resolv, dn_expand, , )
1173 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001174 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001175 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001176 fi
Damien Miller80297751999-11-19 13:03:25 +11001177 ]
1178)
1179
Damien Millera22ba012000-03-02 23:09:20 +11001180# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001181AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001182AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001183 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001184 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001185 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001186
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001187 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001188 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001189 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller105b7f02000-01-07 08:45:55 +11001190 fi
1191
1192 if test -z "$KRB4" ; then
1193 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1194 fi
1195
Damien Miller8bdeee21999-12-30 15:50:54 +11001196 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001197 if test ! -z "$AFS_LIBS" ; then
1198 LIBS="$LIBS $AFS_LIBS"
1199 fi
1200 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001201 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001202 fi
Damien Miller80297751999-11-19 13:03:25 +11001203 ]
1204)
Damien Millerc85f9b42000-01-29 10:20:21 +11001205LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001206
Damien Millera22ba012000-03-02 23:09:20 +11001207# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001208SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001209AC_ARG_WITH(skey,
Ben Lindstrom305fb002000-11-10 02:41:30 +00001210 [ --with-skey=PATH Enable S/Key support],
Damien Miller80297751999-11-19 13:03:25 +11001211 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001212 if test "x$withval" != "xno" ; then
Ben Lindstrom305fb002000-11-10 02:41:30 +00001213
1214 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001215 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001216 LDFLAGS="$LDFLAGS -L${withval}/lib"
1217 fi
1218
Damien Miller8bdeee21999-12-30 15:50:54 +11001219 AC_DEFINE(SKEY)
1220 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001221 SKEY_MSG="yes"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001222
1223 AC_CHECK_FUNC(skey_keyinfo,
1224 [],
1225 [
1226 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1227 ])
Damien Miller8bdeee21999-12-30 15:50:54 +11001228 fi
Damien Miller80297751999-11-19 13:03:25 +11001229 ]
1230)
1231
Damien Millera22ba012000-03-02 23:09:20 +11001232# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001233TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001234AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001235 [ --with-tcp-wrappers Enable tcpwrappers support],
1236 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001237 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001238 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001239 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001240 AC_MSG_CHECKING(for libwrap)
1241 AC_TRY_LINK(
1242 [
Damien Miller81171112000-04-23 11:14:01 +10001243#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001244 int deny_severity = 0, allow_severity = 0;
1245 ],
1246 [hosts_access(0);],
1247 [
1248 AC_MSG_RESULT(yes)
1249 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001250 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001251 ],
1252 [
Damien Miller7b22d652000-06-18 14:07:04 +10001253 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001254 ]
1255 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001256 fi
Damien Miller80297751999-11-19 13:03:25 +11001257 ]
1258)
1259
Damien Millera22ba012000-03-02 23:09:20 +11001260# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001261MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001262AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001263 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001264 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001265 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001266 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001267 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001268 fi
1269 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001270)
1271
Damien Millera22ba012000-03-02 23:09:20 +11001272# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001273AC_ARG_WITH(shadow,
1274 [ --without-shadow Disable shadow password support],
1275 [
1276 if test "x$withval" = "xno" ; then
1277 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001278 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001279 fi
1280 ]
1281)
1282
Damien Miller1f335fb2000-06-26 11:31:33 +10001283if test -z "$disable_shadow" ; then
1284 AC_MSG_CHECKING([if the systems has expire shadow information])
1285 AC_TRY_COMPILE(
1286 [
1287#include <sys/types.h>
1288#include <shadow.h>
1289 struct spwd sp;
1290 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1291 [ sp_expire_available=yes ], []
1292 )
1293
1294 if test "x$sp_expire_available" = "xyes" ; then
1295 AC_MSG_RESULT(yes)
1296 AC_DEFINE(HAS_SHADOW_EXPIRE)
1297 else
1298 AC_MSG_RESULT(no)
1299 fi
1300fi
1301
Damien Millera22ba012000-03-02 23:09:20 +11001302# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001303if test ! -z "$IPADDR_IN_DISPLAY" ; then
1304 DISPLAY_HACK_MSG="yes"
1305 AC_DEFINE(IPADDR_IN_DISPLAY)
1306else
1307 DISPLAY_HACK_MSG="no"
1308 AC_ARG_WITH(ipaddr-display,
1309 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1310 [
1311 if test "x$withval" != "xno" ; then
1312 AC_DEFINE(IPADDR_IN_DISPLAY)
1313 DISPLAY_HACK_MSG="yes"
1314 fi
1315 ]
1316 )
1317fi
Damien Miller76112de1999-12-21 11:18:08 +11001318
Damien Millera22ba012000-03-02 23:09:20 +11001319# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001320SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001321AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001322 [ --with-default-path=PATH Specify default \$PATH environment for server],
1323 [
1324 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001325 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001326 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001327 fi
1328 ]
1329)
1330
Damien Millera22ba012000-03-02 23:09:20 +11001331# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001332IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001333AC_ARG_WITH(ipv4-default,
1334 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1335 [
1336 if test "x$withval" != "xno" ; then
1337 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001338 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001339 fi
1340 ]
1341)
1342
Damien Miller61e50f12000-05-08 20:49:37 +10001343AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001344IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001345AC_ARG_WITH(4in6,
1346 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1347 [
1348 if test "x$withval" != "xno" ; then
1349 AC_MSG_RESULT(yes)
1350 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001351 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001352 else
1353 AC_MSG_RESULT(no)
1354 fi
1355 ],[
1356 if test "x$inet6_default_4in6" = "xyes"; then
1357 AC_MSG_RESULT([yes (default)])
1358 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001359 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001360 else
1361 AC_MSG_RESULT([no (default)])
1362 fi
1363 ]
1364)
1365
Damien Miller78315eb2000-09-29 23:01:36 +11001366AC_MSG_CHECKING(whether to install ssh as suid root)
1367AC_ARG_ENABLE(suid-ssh,
1368[ --enable-suid-ssh Install ssh as suid root (default)
1369 --disable-suid-ssh Install ssh without suid bit],
1370[ case "$enableval" in
1371 no)
1372 AC_MSG_RESULT(no)
1373 SSHMODE=0711
1374 ;;
1375 *) AC_MSG_RESULT(yes)
1376 SSHMODE=04711
1377 ;;
1378 esac ],
1379 AC_MSG_RESULT(yes)
1380 SSHMODE=04711
1381)
1382AC_SUBST(SSHMODE)
1383
1384
Damien Millera22ba012000-03-02 23:09:20 +11001385# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001386piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001387AC_ARG_WITH(pid-dir,
1388 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1389 [
1390 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001391 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001392 fi
1393 ]
1394)
Damien Miller4018c192000-04-30 09:30:44 +10001395
Damien Miller78315eb2000-09-29 23:01:36 +11001396# make sure the directory exists
1397if test ! -d $piddir ; then
1398 piddir=`eval echo ${sysconfdir}`
1399 case $piddir in
1400 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1401 esac
1402fi
1403
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001404AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001405AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001406
andre2ff7b5d2000-06-03 14:57:40 +00001407dnl allow user to disable some login recording features
1408AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001409 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001410 [ AC_DEFINE(DISABLE_LASTLOG) ]
1411)
1412AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001413 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001414 [ AC_DEFINE(DISABLE_UTMP) ]
1415)
1416AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001417 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001418 [ AC_DEFINE(DISABLE_UTMPX) ]
1419)
1420AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001421 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001422 [ AC_DEFINE(DISABLE_WTMP) ]
1423)
1424AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001425 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001426 [ AC_DEFINE(DISABLE_WTMPX) ]
1427)
1428AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001429 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001430 [ AC_DEFINE(DISABLE_LOGIN) ]
1431)
1432AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001433 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001434 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1435)
1436AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001437 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001438 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1439)
1440AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001441 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001442 [ conf_lastlog_location="$withval"; ],)
1443
1444dnl lastlog, [uw]tmpx? detection
1445dnl NOTE: set the paths in the platform section to avoid the
1446dnl need for command-line parameters
1447dnl lastlog and [uw]tmp are subject to a file search if all else fails
1448
1449dnl lastlog detection
1450dnl NOTE: the code itself will detect if lastlog is a directory
1451AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1452AC_TRY_COMPILE([
1453#include <sys/types.h>
1454#include <utmp.h>
1455#ifdef HAVE_LASTLOG_H
1456# include <lastlog.h>
1457#endif
Damien Miller2994e082000-06-04 15:51:47 +10001458#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001459# include <paths.h>
1460#endif
1461 ],
1462 [ char *lastlog = LASTLOG_FILE; ],
1463 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001464 [
1465 AC_MSG_RESULT(no)
1466 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1467 AC_TRY_COMPILE([
1468#include <sys/types.h>
1469#include <utmp.h>
1470#ifdef HAVE_LASTLOG_H
1471# include <lastlog.h>
1472#endif
1473#ifdef HAVE_PATHS_H
1474# include <paths.h>
1475#endif
1476 ],
1477 [ char *lastlog = _PATH_LASTLOG; ],
1478 [ AC_MSG_RESULT(yes) ],
1479 [
andree441aa32000-06-12 22:34:38 +00001480 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001481 system_lastlog_path=no
1482 ])
1483 ]
andre2ff7b5d2000-06-03 14:57:40 +00001484)
Damien Miller2994e082000-06-04 15:51:47 +10001485
andre2ff7b5d2000-06-03 14:57:40 +00001486if test -z "$conf_lastlog_location"; then
1487 if test x"$system_lastlog_path" = x"no" ; then
1488 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001489 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001490 conf_lastlog_location=$f
1491 fi
1492 done
1493 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001494 AC_MSG_WARN([** Cannot find lastlog **])
1495 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001496 fi
1497 fi
1498fi
1499
1500if test -n "$conf_lastlog_location"; then
1501 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1502fi
1503
1504dnl utmp detection
1505AC_MSG_CHECKING([if your system defines UTMP_FILE])
1506AC_TRY_COMPILE([
1507#include <sys/types.h>
1508#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001509#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001510# include <paths.h>
1511#endif
1512 ],
1513 [ char *utmp = UTMP_FILE; ],
1514 [ AC_MSG_RESULT(yes) ],
1515 [ AC_MSG_RESULT(no)
1516 system_utmp_path=no ]
1517)
1518if test -z "$conf_utmp_location"; then
1519 if test x"$system_utmp_path" = x"no" ; then
1520 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1521 if test -f $f ; then
1522 conf_utmp_location=$f
1523 fi
1524 done
1525 if test -z "$conf_utmp_location"; then
1526 AC_DEFINE(DISABLE_UTMP)
1527 fi
1528 fi
1529fi
1530if test -n "$conf_utmp_location"; then
1531 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1532fi
1533
1534dnl wtmp detection
1535AC_MSG_CHECKING([if your system defines WTMP_FILE])
1536AC_TRY_COMPILE([
1537#include <sys/types.h>
1538#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001539#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001540# include <paths.h>
1541#endif
1542 ],
1543 [ char *wtmp = WTMP_FILE; ],
1544 [ AC_MSG_RESULT(yes) ],
1545 [ AC_MSG_RESULT(no)
1546 system_wtmp_path=no ]
1547)
1548if test -z "$conf_wtmp_location"; then
1549 if test x"$system_wtmp_path" = x"no" ; then
1550 for f in /usr/adm/wtmp /var/log/wtmp; do
1551 if test -f $f ; then
1552 conf_wtmp_location=$f
1553 fi
1554 done
1555 if test -z "$conf_wtmp_location"; then
1556 AC_DEFINE(DISABLE_WTMP)
1557 fi
1558 fi
1559fi
1560if test -n "$conf_wtmp_location"; then
1561 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1562fi
1563
1564
1565dnl utmpx detection - I don't know any system so perverse as to require
1566dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1567dnl there, though.
1568AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1569AC_TRY_COMPILE([
1570#include <sys/types.h>
1571#include <utmp.h>
1572#ifdef HAVE_UTMPX_H
1573#include <utmpx.h>
1574#endif
Damien Miller2994e082000-06-04 15:51:47 +10001575#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001576# include <paths.h>
1577#endif
1578 ],
1579 [ char *utmpx = UTMPX_FILE; ],
1580 [ AC_MSG_RESULT(yes) ],
1581 [ AC_MSG_RESULT(no)
1582 system_utmpx_path=no ]
1583)
1584if test -z "$conf_utmpx_location"; then
1585 if test x"$system_utmpx_path" = x"no" ; then
1586 AC_DEFINE(DISABLE_UTMPX)
1587 fi
1588else
1589 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1590fi
1591
1592dnl wtmpx detection
1593AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1594AC_TRY_COMPILE([
1595#include <sys/types.h>
1596#include <utmp.h>
1597#ifdef HAVE_UTMPX_H
1598#include <utmpx.h>
1599#endif
Damien Miller2994e082000-06-04 15:51:47 +10001600#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001601# include <paths.h>
1602#endif
1603 ],
1604 [ char *wtmpx = WTMPX_FILE; ],
1605 [ AC_MSG_RESULT(yes) ],
1606 [ AC_MSG_RESULT(no)
1607 system_wtmpx_path=no ]
1608)
1609if test -z "$conf_wtmpx_location"; then
1610 if test x"$system_wtmpx_path" = x"no" ; then
1611 AC_DEFINE(DISABLE_WTMPX)
1612 fi
1613else
1614 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1615fi
1616
Damien Miller4018c192000-04-30 09:30:44 +10001617
1618# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001619entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001620AC_ARG_WITH(entropy-timeout,
1621 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1622 [
1623 if test "x$withval" != "xno" ; then
1624 entropy_timeout=$withval
1625 fi
1626 ]
1627)
1628AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1629
1630
Damien Miller29ea30d2000-03-17 10:54:15 +11001631if test ! -z "$blibpath" ; then
1632 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1633 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1634fi
1635
Damien Millerbac2d8a2000-09-05 16:13:06 +11001636AC_EXEEXT
1637
Damien Miller0437b332000-05-02 09:56:41 +10001638AC_OUTPUT(Makefile ssh_prng_cmds)
1639
Damien Miller7b22d652000-06-18 14:07:04 +10001640# Print summary of options
1641
1642if test x$MANTYPE = x'$(CATMAN)' ; then
1643 MAN_MSG=cat
1644else
1645 MAN_MSG=man
1646fi
1647if test ! -z "$RANDOM_POOL" ; then
1648 RAND_MSG="Device ($RANDOM_POOL)"
1649else
1650 if test ! -z "$EGD_SOCKET" ; then
Damien Miller0736c4d2001-01-25 10:51:46 +11001651 RAND_MSG="EGD/PRNGD ($EGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001652 else
1653 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001654 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001655 fi
1656fi
1657
1658# Someone please show me a better way :)
1659A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1660B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1661C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1662D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001663E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001664F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1665G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1666
1667echo ""
1668echo "OpenSSH configured has been configured with the following options."
1669echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001670echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001671echo " System binaries: $C"
1672echo " Configuration files: $D"
1673echo " Askpass program: $E"
1674echo " Manual pages: $F"
1675echo " PID file: $G"
1676echo " Random number collection: $RAND_MSG"
1677echo " Manpage format: $MAN_MSG"
1678echo " PAM support: ${PAM_MSG}"
1679echo " KerberosIV support: $KRB4_MSG"
1680echo " AFS support: $AFS_MSG"
1681echo " S/KEY support: $SKEY_MSG"
1682echo " TCP Wrappers support: $TCPW_MSG"
1683echo " MD5 password support: $MD5_MSG"
1684echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1685echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1686echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1687
1688echo ""
1689
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001690echo " Host: ${host}"
1691echo " Compiler: ${CC}"
1692echo " Compiler flags: ${CFLAGS}"
1693echo "Preprocessor flags: ${CPPFLAGS}"
1694echo " Linker flags: ${LDFLAGS}"
1695echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001696
1697echo ""
1698
Damien Miller82cf0ce2000-12-20 13:34:48 +11001699if test "x$PAM_MSG" = "xyes" ; then
1700 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1701 echo "otherwise password authentication may fail. Example PAM control files"
1702 echo "can be found in the contrib/ subdirectory"
1703 echo ""
1704fi
1705
Damien Miller6f9c3372000-10-25 10:06:04 +11001706if test ! -z "$BUILTIN_RNG" ; then
1707 echo "WARNING: you are using the builtin random number collection service."
1708 echo "Please read WARNING.RNG and request that your OS vendor includes"
1709 echo "/dev/random in future versions of their OS."
1710 echo ""
1711fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001712
1713if test ! -z "$NO_SFTP"; then
1714 echo "sftp-server will be disabled. Your compiler does not support"
1715 echo "64bit integers."
1716 echo ""
1717fi