blob: ad05a6e7c70726e155e58584939e36266be2a18c [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 Lindstrom28bfc0d2000-12-18 19:58:57 +0000224 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000225 LDFLAGS="$LDFLAGS -L/usr/local/lib"
226 MANTYPE='$(CATMAN)'
227 mansubdir=cat
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000228 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000229 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100230 rsh_path="/usr/bin/rcmd"
231 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000232 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000233 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millera66626b2000-06-13 18:57:53 +1000234 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000235*-dec-osf*)
236# This is untested
237 if test ! -z "USE_SIA" ; then
238 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
239 if test -f /etc/sia/matrix.conf; then
240 AC_MSG_RESULT(yes)
241 AC_DEFINE(HAVE_OSF_SIA)
242 AC_DEFINE(DISABLE_LOGIN)
243 LIBS="$LIBS -lsecurity -ldb -lm -laud"
244 else
245 AC_MSG_RESULT(no)
246 fi
247 fi
248 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100249esac
250
Damien Millere37bfc12000-06-05 09:37:43 +1000251# Allow user to specify flags
252AC_ARG_WITH(cflags,
253 [ --with-cflags Specify additional flags to pass to compiler],
254 [
255 if test "x$withval" != "xno" ; then
256 CFLAGS="$CFLAGS $withval"
257 fi
258 ]
259)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000260AC_ARG_WITH(cppflags,
261 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
262 [
263 if test "x$withval" != "xno"; then
264 CPPFLAGS="$CPPFLAGS $withval"
265 fi
266 ]
267)
Damien Millere37bfc12000-06-05 09:37:43 +1000268AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000269 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000270 [
271 if test "x$withval" != "xno" ; then
272 LDFLAGS="$LDFLAGS $withval"
273 fi
274 ]
275)
276AC_ARG_WITH(libs,
277 [ --with-libs Specify additional libraries to link with],
278 [
279 if test "x$withval" != "xno" ; then
280 LIBS="$LIBS $withval"
281 fi
282 ]
283)
284
285
Damien Millera22ba012000-03-02 23:09:20 +1100286# Checks for libraries.
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000287if test -z "$no_libsocket" ; then
288 AC_CHECK_LIB(nsl, yp_match, , )
289fi
290if test -z "$no_libnsl" ; then
291 AC_CHECK_LIB(socket, main, , )
292fi
293
294AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Millerab18c411999-11-11 10:40:23 +1100295AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
296AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100297
298AC_CHECK_FUNC(regcomp,
299 [],
300 [
301 AC_CHECK_LIB(pcre, pcre_info,
302 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
303 ]
304)
Damien Millerab18c411999-11-11 10:40:23 +1100305
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000306dnl UnixWare 2.x
307AC_CHECK_FUNC(strcasecmp,
308 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
309)
310AC_CHECK_FUNC(utimes,
311 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
312)
Damien Millerab18c411999-11-11 10:40:23 +1100313
Damien Millera22ba012000-03-02 23:09:20 +1100314# Checks for header files.
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000315AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/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 +1100316
Damien Millerad833b32000-08-23 10:46:23 +1000317dnl Checks for library functions.
Ben Lindstrombf555ba2001-01-18 02:04:35 +0000318AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af 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 +1000319dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000320AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000321dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000322AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000323AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000324dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000325AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000326AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000327dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000328AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000329AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100330
Damien Miller5fc85652000-07-09 23:53:07 +1000331AC_CHECK_FUNC(getuserattr,
332 [AC_DEFINE(HAVE_GETUSERATTR)],
333 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
334)
335
Damien Miller04f80141999-11-19 15:32:34 +1100336AC_CHECK_FUNC(login,
337 [AC_DEFINE(HAVE_LOGIN)],
338 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
339)
340
341AC_CHECK_FUNC(daemon,
342 [AC_DEFINE(HAVE_DAEMON)],
343 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
344)
345
Damien Miller9fb07e42000-03-05 16:22:59 +1100346AC_CHECK_FUNC(getpagesize,
347 [AC_DEFINE(HAVE_GETPAGESIZE)],
348 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
349)
350
Damien Millercb170cb2000-07-01 16:52:55 +1000351# Check for broken snprintf
352if test "x$ac_cv_func_snprintf" = "xyes" ; then
353 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
354 AC_TRY_RUN(
355 [
356#include <stdio.h>
357int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
358 ],
359 [AC_MSG_RESULT(yes)],
360 [
361 AC_MSG_RESULT(no)
362 AC_DEFINE(BROKEN_SNPRINTF)
363 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
364 ]
365 )
366fi
367
Damien Miller606f8802000-09-16 15:39:56 +1100368AC_FUNC_GETPGRP
369
Damien Millera64b57a2001-01-17 10:44:13 +1100370# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000371PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100372AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100373 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100374 [
Damien Millera64b57a2001-01-17 10:44:13 +1100375 if test "x$withval" != "xno" ; then
376 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
377 AC_MSG_ERROR([PAM headers not found])
378 fi
379
380 AC_CHECK_LIB(dl, dlopen, , )
381 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
382 AC_CHECK_FUNCS(pam_getenvlist)
383
384 disable_shadow=yes
385 PAM_MSG="yes"
386
387 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100388 fi
389 ]
390)
Damien Millera22ba012000-03-02 23:09:20 +1100391
Damien Millera64b57a2001-01-17 10:44:13 +1100392# Check for older PAM
393if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100394 # Check PAM strerror arguments (old PAM)
395 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
396 AC_TRY_COMPILE(
397 [
Damien Miller81171112000-04-23 11:14:01 +1000398#include <stdlib.h>
399#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100400 ],
401 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
402 [AC_MSG_RESULT(no)],
403 [
404 AC_DEFINE(HAVE_OLD_PAM)
405 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000406 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100407 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100408 )
Damien Millera22ba012000-03-02 23:09:20 +1100409fi
410
411# The big search for OpenSSL
412AC_ARG_WITH(ssl-dir,
413 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
414 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000415 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100416 tryssldir=$withval
417 fi
418 ]
419)
420
421saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100422saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000423saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100424if test "x$prefix" != "xNONE" ; then
425 tryssldir="$tryssldir $prefix"
426fi
Damien Miller61e50f12000-05-08 20:49:37 +1000427AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100428
Damien Millera1b61e12000-09-16 17:02:16 +1100429 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 +1100430 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Miller61e50f12000-05-08 20:49:37 +1000431 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000432 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
Damien Miller61e50f12000-05-08 20:49:37 +1000433 if test ! -z "$need_dash_r" ; then
434 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
435 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100436 else
Damien Miller61e50f12000-05-08 20:49:37 +1000437 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100438 fi
439
Damien Miller3b512e12000-05-17 23:29:18 +1000440 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000441
Damien Miller3b512e12000-05-17 23:29:18 +1000442 # Basic test to check for compatible version and correct linking
443 # *does not* test for RSA - that comes later.
444 AC_TRY_RUN(
445 [
Damien Millere59ce622000-05-01 20:54:17 +1000446#include <string.h>
447#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000448int main(void)
449{
Damien Miller3b512e12000-05-17 23:29:18 +1000450 char a[2048];
451 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000452 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000453 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000454}
Damien Miller3b512e12000-05-17 23:29:18 +1000455 ],
456 [
457 found_crypto=1
458 break;
459 ], []
460 )
Damien Miller61e50f12000-05-08 20:49:37 +1000461
462 if test ! -z "$found_crypto" ; then
463 break;
464 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100465 done
466
Damien Miller61e50f12000-05-08 20:49:37 +1000467 if test -z "$found_crypto" ; then
468 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100469 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000470 if test -z "$ssldir" ; then
471 ssldir="(system)"
472 fi
Damien Millera22ba012000-03-02 23:09:20 +1100473
Damien Miller61e50f12000-05-08 20:49:37 +1000474 ac_cv_openssldir=$ssldir
475])
476
Damien Milleredb82922000-06-20 13:25:52 +1000477if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000478 AC_DEFINE(HAVE_OPENSSL)
479 dnl Need to recover ssldir - test above runs in subshell
480 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100481
482 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
483 CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
484 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
485 if test ! -z "$need_dash_r" ; then
486 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
487 fi
488 if test ! -z "$blibpath" ; then
489 blibpath="$blibpath:$ssldir:$ssldir/lib"
490 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100491 fi
Damien Millera22ba012000-03-02 23:09:20 +1100492fi
Damien Miller3b512e12000-05-17 23:29:18 +1000493LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000494
Damien Miller3b512e12000-05-17 23:29:18 +1000495# Now test RSA support
496saved_LIBS="$LIBS"
497AC_MSG_CHECKING([for RSA support])
498for WANTS_RSAREF in "" 1 ; do
499 if test -z "$WANTS_RSAREF" ; then
500 LIBS="$saved_LIBS"
501 else
502 LIBS="$saved_LIBS -lRSAglue -lrsaref"
503 fi
504 AC_TRY_RUN([
505#include <string.h>
506#include <openssl/rand.h>
507#include <openssl/rsa.h>
508#include <openssl/bn.h>
509#include <openssl/sha.h>
510int main(void)
511{
512 int num; RSA *key; static unsigned char p_in[] = "blahblah";
513 unsigned char c[256], p[256];
514 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
515 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
516 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
517 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
518}
519 ],
520 [
521 rsa_works=1
522 break;
523 ], [])
524done
525
526if test ! -z "$no_rsa" ; then
527 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000528 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000529else
530 if test -z "$rsa_works" ; then
531 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000532 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000533 else
534 if test -z "$WANTS_RSAREF" ; then
535 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000536 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000537 else
Damien Miller7b22d652000-06-18 14:07:04 +1000538 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000539 AC_MSG_RESULT(using RSAref)
540 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
541 fi
542 fi
543fi
Damien Millera22ba012000-03-02 23:09:20 +1100544
Damien Millera64b57a2001-01-17 10:44:13 +1100545# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
546# version in OpenSSL. Skip this for PAM
547if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
548 AC_CHECK_LIB(crypt, crypt, , )
549fi
550
Ben Lindstromb5628642000-10-18 00:02:25 +0000551# Cheap hack to ensure NEWS-OS libraries are arranged right.
552if test ! -z "$SONY" ; then
553 LIBS="$LIBS -liberty";
554fi
555
Damien Millera22ba012000-03-02 23:09:20 +1100556# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100557AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100558AC_CHECK_SIZEOF(short int, 2)
559AC_CHECK_SIZEOF(int, 4)
560AC_CHECK_SIZEOF(long int, 4)
561AC_CHECK_SIZEOF(long long int, 8)
562
Damien Millera22ba012000-03-02 23:09:20 +1100563# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100564AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
565 AC_TRY_COMPILE(
566 [ #include <sys/types.h> ],
567 [ u_int a; a = 1;],
568 [ ac_cv_have_u_int="yes" ],
569 [ ac_cv_have_u_int="no" ]
570 )
571])
572if test "x$ac_cv_have_u_int" = "xyes" ; then
573 AC_DEFINE(HAVE_U_INT)
574 have_u_int=1
575fi
576
Damien Miller61e50f12000-05-08 20:49:37 +1000577AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
578 AC_TRY_COMPILE(
579 [ #include <sys/types.h> ],
580 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
581 [ ac_cv_have_intxx_t="yes" ],
582 [ ac_cv_have_intxx_t="no" ]
583 )
584])
585if test "x$ac_cv_have_intxx_t" = "xyes" ; then
586 AC_DEFINE(HAVE_INTXX_T)
587 have_intxx_t=1
588fi
589
Damien Miller578783e2000-09-23 14:12:24 +1100590AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
591 AC_TRY_COMPILE(
592 [ #include <sys/types.h> ],
593 [ int64_t a; a = 1;],
594 [ ac_cv_have_int64_t="yes" ],
595 [ ac_cv_have_int64_t="no" ]
596 )
597])
598if test "x$ac_cv_have_int64_t" = "xyes" ; then
599 AC_DEFINE(HAVE_INT64_T)
600 have_int64_t=1
601fi
602
Damien Miller61e50f12000-05-08 20:49:37 +1000603AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
604 AC_TRY_COMPILE(
605 [ #include <sys/types.h> ],
606 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
607 [ ac_cv_have_u_intxx_t="yes" ],
608 [ ac_cv_have_u_intxx_t="no" ]
609 )
610])
611if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
612 AC_DEFINE(HAVE_U_INTXX_T)
613 have_u_intxx_t=1
614fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100615
Damien Miller578783e2000-09-23 14:12:24 +1100616AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
617 AC_TRY_COMPILE(
618 [ #include <sys/types.h> ],
619 [ u_int64_t a; a = 1;],
620 [ ac_cv_have_u_int64_t="yes" ],
621 [ ac_cv_have_u_int64_t="no" ]
622 )
623])
624if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
625 AC_DEFINE(HAVE_U_INT64_T)
626 have_u_int64_t=1
627fi
628
Damien Milleredb82922000-06-20 13:25:52 +1000629if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
630 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100631then
632 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
633 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000634 [
635#include <sys/bitypes.h>
636 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100637 [
Damien Miller70494d12000-04-03 15:57:06 +1000638 int8_t a; int16_t b; int32_t c;
639 u_int8_t e; u_int16_t f; u_int32_t g;
640 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100641 ],
642 [
643 AC_DEFINE(HAVE_U_INTXX_T)
644 AC_DEFINE(HAVE_INTXX_T)
645 AC_MSG_RESULT(yes)
646 ],
647 [AC_MSG_RESULT(no)]
648 )
649fi
650
Damien Millerd6121d22000-03-17 23:26:46 +1100651if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000652 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
653 AC_TRY_COMPILE(
654 [
655#include <sys/types.h>
656 ],
657 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
658 [ ac_cv_have_uintxx_t="yes" ],
659 [ ac_cv_have_uintxx_t="no" ]
660 )
661 ])
662 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
663 AC_DEFINE(HAVE_UINTXX_T)
664 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100665fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100666
Damien Miller61e50f12000-05-08 20:49:37 +1000667AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
668 AC_TRY_COMPILE(
669 [
Damien Miller81171112000-04-23 11:14:01 +1000670#include <sys/types.h>
671#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000672 ],
673 [socklen_t foo; foo = 1235;],
674 [ ac_cv_have_socklen_t="yes" ],
675 [ ac_cv_have_socklen_t="no" ]
676 )
677])
678if test "x$ac_cv_have_socklen_t" = "xyes" ; then
679 AC_DEFINE(HAVE_SOCKLEN_T)
680fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100681
Damien Miller61e50f12000-05-08 20:49:37 +1000682AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
683 AC_TRY_COMPILE(
684 [
685#include <sys/types.h>
686 ],
687 [ size_t foo; foo = 1235; ],
688 [ ac_cv_have_size_t="yes" ],
689 [ ac_cv_have_size_t="no" ]
690 )
691])
692if test "x$ac_cv_have_size_t" = "xyes" ; then
693 AC_DEFINE(HAVE_SIZE_T)
694fi
Damien Miller95058511999-12-29 10:36:45 +1100695
Damien Miller615f9392000-05-17 22:53:33 +1000696AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
697 AC_TRY_COMPILE(
698 [
699#include <sys/types.h>
700 ],
701 [ ssize_t foo; foo = 1235; ],
702 [ ac_cv_have_ssize_t="yes" ],
703 [ ac_cv_have_ssize_t="no" ]
704 )
705])
706if test "x$ac_cv_have_ssize_t" = "xyes" ; then
707 AC_DEFINE(HAVE_SSIZE_T)
708fi
709
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000710AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
711 AC_TRY_COMPILE(
712 [
713#include <time.h>
714 ],
715 [ clock_t foo; foo = 1235; ],
716 [ ac_cv_have_clock_t="yes" ],
717 [ ac_cv_have_clock_t="no" ]
718 )
719])
720if test "x$ac_cv_have_clock_t" = "xyes" ; then
721 AC_DEFINE(HAVE_CLOCK_T)
722fi
723
Damien Millerb54b40e2000-06-23 08:23:34 +1000724AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
725 AC_TRY_COMPILE(
726 [
727#include <sys/types.h>
728#include <sys/socket.h>
729 ],
730 [ sa_family_t foo; foo = 1235; ],
731 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100732 [ AC_TRY_COMPILE(
733 [
734#include <sys/types.h>
735#include <sys/socket.h>
736#include <netinet/in.h>
737 ],
738 [ sa_family_t foo; foo = 1235; ],
739 [ ac_cv_have_sa_family_t="yes" ],
740
Damien Millerb54b40e2000-06-23 08:23:34 +1000741 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100742 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000743 )
744])
745if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
746 AC_DEFINE(HAVE_SA_FAMILY_T)
747fi
748
Damien Miller0f91b4e2000-06-18 15:43:25 +1000749AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
750 AC_TRY_COMPILE(
751 [
752#include <sys/types.h>
753 ],
754 [ pid_t foo; foo = 1235; ],
755 [ ac_cv_have_pid_t="yes" ],
756 [ ac_cv_have_pid_t="no" ]
757 )
758])
759if test "x$ac_cv_have_pid_t" = "xyes" ; then
760 AC_DEFINE(HAVE_PID_T)
761fi
762
763AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
764 AC_TRY_COMPILE(
765 [
766#include <sys/types.h>
767 ],
768 [ mode_t foo; foo = 1235; ],
769 [ ac_cv_have_mode_t="yes" ],
770 [ ac_cv_have_mode_t="no" ]
771 )
772])
773if test "x$ac_cv_have_mode_t" = "xyes" ; then
774 AC_DEFINE(HAVE_MODE_T)
775fi
776
Damien Miller61e50f12000-05-08 20:49:37 +1000777
778AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
779 AC_TRY_COMPILE(
780 [
Damien Miller81171112000-04-23 11:14:01 +1000781#include <sys/types.h>
782#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000783 ],
784 [ struct sockaddr_storage s; ],
785 [ ac_cv_have_struct_sockaddr_storage="yes" ],
786 [ ac_cv_have_struct_sockaddr_storage="no" ]
787 )
788])
789if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
790 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
791fi
Damien Miller34132e52000-01-14 15:45:46 +1100792
Damien Miller61e50f12000-05-08 20:49:37 +1000793AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
794 AC_TRY_COMPILE(
795 [
Damien Miller7b22d652000-06-18 14:07:04 +1000796#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000797#include <netinet/in.h>
798 ],
799 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
800 [ ac_cv_have_struct_sockaddr_in6="yes" ],
801 [ ac_cv_have_struct_sockaddr_in6="no" ]
802 )
803])
804if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
805 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
806fi
Damien Miller34132e52000-01-14 15:45:46 +1100807
Damien Miller61e50f12000-05-08 20:49:37 +1000808AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
809 AC_TRY_COMPILE(
810 [
Damien Miller7b22d652000-06-18 14:07:04 +1000811#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000812#include <netinet/in.h>
813 ],
814 [ struct in6_addr s; s.s6_addr[0] = 0; ],
815 [ ac_cv_have_struct_in6_addr="yes" ],
816 [ ac_cv_have_struct_in6_addr="no" ]
817 )
818])
819if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
820 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
821fi
Damien Miller34132e52000-01-14 15:45:46 +1100822
Damien Miller61e50f12000-05-08 20:49:37 +1000823AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
824 AC_TRY_COMPILE(
825 [
Damien Miller81171112000-04-23 11:14:01 +1000826#include <sys/types.h>
827#include <sys/socket.h>
828#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000829 ],
830 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
831 [ ac_cv_have_struct_addrinfo="yes" ],
832 [ ac_cv_have_struct_addrinfo="no" ]
833 )
834])
835if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
836 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
837fi
838
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000839AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
840 AC_TRY_COMPILE(
841 [ #include <sys/time.h> ],
842 [ struct timeval tv; tv.tv_sec = 1;],
843 [ ac_cv_have_struct_timeval="yes" ],
844 [ ac_cv_have_struct_timeval="no" ]
845 )
846])
847if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
848 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
849 have_struct_timeval=1
850fi
851
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000852# If we don't have int64_t then we can't compile sftp-server. So don't
853# even attempt to do it.
854if test "x$ac_cv_have_int64_t" = "xno" -a \
855 "x$ac_cv_sizeof_long_int" != "x8" -a \
856 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
857 NO_SFTP='#'
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000858fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +0000859AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000860
Damien Miller78315eb2000-09-29 23:01:36 +1100861dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +1000862OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
863OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
864OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
865OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
866OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000867OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000868OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
869OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000870OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000871OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
872OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
873OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
874OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000875OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
876OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
877OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
878OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +1100879AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +0000880
Damien Miller942da032000-08-18 13:59:06 +1000881AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
882 ac_cv_have_sun_len_in_struct_sockaddr_un, [
883 AC_TRY_COMPILE(
884 [
885#include <sys/types.h>
886#include <sys/socket.h>
887 ],
888 [ struct sockaddr_un s; s.sun_len = 1; ],
889 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
890 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
891 )
892])
893if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
894 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
895fi
896
Damien Miller61e50f12000-05-08 20:49:37 +1000897AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
898 ac_cv_have_ss_family_in_struct_ss, [
899 AC_TRY_COMPILE(
900 [
Damien Miller81171112000-04-23 11:14:01 +1000901#include <sys/types.h>
902#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000903 ],
904 [ struct sockaddr_storage s; s.ss_family = 1; ],
905 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
906 [ ac_cv_have_ss_family_in_struct_ss="no" ],
907 )
908])
909if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
910 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
911fi
912
Damien Miller61e50f12000-05-08 20:49:37 +1000913AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
914 ac_cv_have___ss_family_in_struct_ss, [
915 AC_TRY_COMPILE(
916 [
Damien Miller81171112000-04-23 11:14:01 +1000917#include <sys/types.h>
918#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000919 ],
920 [ struct sockaddr_storage s; s.__ss_family = 1; ],
921 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
922 [ ac_cv_have___ss_family_in_struct_ss="no" ]
923 )
924])
925if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
926 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
927fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100928
Damien Millerad833b32000-08-23 10:46:23 +1000929AC_CACHE_CHECK([for pw_class field in struct passwd],
930 ac_cv_have_pw_class_in_struct_passwd, [
931 AC_TRY_COMPILE(
932 [
Damien Millerad833b32000-08-23 10:46:23 +1000933#include <pwd.h>
934 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +0000935 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +1000936 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
937 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
938 )
939])
940if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
941 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
942fi
943
Damien Miller61e50f12000-05-08 20:49:37 +1000944
945AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
946 AC_TRY_LINK([],
947 [ extern char *__progname; printf("%s", __progname); ],
948 [ ac_cv_libc_defines___progname="yes" ],
949 [ ac_cv_libc_defines___progname="no" ]
950 )
951])
952if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
953 AC_DEFINE(HAVE___PROGNAME)
954fi
955
Damien Millera22ba012000-03-02 23:09:20 +1100956
Damien Millerecbb26d2000-07-15 14:59:14 +1000957AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
958 AC_TRY_LINK([],
959 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
960 [ ac_cv_libc_defines_sys_errlist="yes" ],
961 [ ac_cv_libc_defines_sys_errlist="no" ]
962 )
963])
964if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
965 AC_DEFINE(HAVE_SYS_ERRLIST)
966fi
967
968
Damien Miller11fa2cc2000-08-16 10:35:58 +1000969AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
970 AC_TRY_LINK([],
971 [ extern int sys_nerr; printf("%i", sys_nerr);],
972 [ ac_cv_libc_defines_sys_nerr="yes" ],
973 [ ac_cv_libc_defines_sys_nerr="no" ]
974 )
975])
976if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
977 AC_DEFINE(HAVE_SYS_NERR)
978fi
979
980
Damien Millera22ba012000-03-02 23:09:20 +1100981# Looking for programs, paths and files
982AC_ARG_WITH(rsh,
983 [ --with-rsh=PATH Specify path to remote shell program ],
984 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100985 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000986 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100987 fi
988 ],
989 [
990 AC_PATH_PROG(rsh_path, rsh)
991 ]
992)
993
994AC_ARG_WITH(xauth,
995 [ --with-xauth=PATH Specify path to xauth program ],
996 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000997 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000998 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100999 fi
1000 ],
1001 [
Damien Miller78315eb2000-09-29 23:01:36 +11001002 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 +10001003 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001004 xauth_path="/usr/openwin/bin/xauth"
1005 fi
1006 ]
1007)
1008
Damien Millera19cf472000-11-29 13:28:50 +11001009if test -z "$xauth_path" ; then
1010 XAUTH_PATH="undefined"
1011 AC_SUBST(XAUTH_PATH)
1012else
Damien Millera22ba012000-03-02 23:09:20 +11001013 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001014 XAUTH_PATH=$xauth_path
1015 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001016fi
1017if test ! -z "$rsh_path" ; then
1018 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1019fi
1020
1021# Check for mail directory (last resort if we cannot get it from headers)
1022if test ! -z "$MAIL" ; then
1023 maildir=`dirname $MAIL`
1024 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1025fi
1026
Damien Millera22ba012000-03-02 23:09:20 +11001027if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001028 AC_CHECK_FILE("/dev/ptmx",
1029 [
1030 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1031 have_dev_ptmx=1
1032 ]
1033 )
Damien Millera22ba012000-03-02 23:09:20 +11001034fi
Damien Miller204ad072000-03-02 23:56:12 +11001035AC_CHECK_FILE("/dev/ptc",
1036 [
1037 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1038 have_dev_ptc=1
1039 ]
1040)
1041
Damien Millera22ba012000-03-02 23:09:20 +11001042# Options from here on. Some of these are preset by platform above
1043
Damien Millera22ba012000-03-02 23:09:20 +11001044# Check for user-specified random device, otherwise check /dev/urandom
1045AC_ARG_WITH(random,
1046 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
1047 [
Damien Miller040f3832000-04-03 14:50:43 +10001048 if test "x$withval" != "xno" ; then
1049 RANDOM_POOL="$withval";
1050 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1051 fi
Damien Millera22ba012000-03-02 23:09:20 +11001052 ],
1053 [
1054 # Check for random device
1055 AC_CHECK_FILE("/dev/urandom",
1056 [
1057 RANDOM_POOL="/dev/urandom";
1058 AC_SUBST(RANDOM_POOL)
1059 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1060 ]
1061 )
1062 ]
1063)
1064
1065# Check for EGD pool file
1066AC_ARG_WITH(egd-pool,
1067 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
1068 [
Damien Miller040f3832000-04-03 14:50:43 +10001069 if test "x$withval" != "xno" ; then
1070 EGD_SOCKET="$withval";
1071 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
1072 fi
Damien Millera22ba012000-03-02 23:09:20 +11001073 ]
1074)
1075
Damien Miller0437b332000-05-02 09:56:41 +10001076# detect pathnames for entropy gathering commands, if we need them
1077INSTALL_SSH_PRNG_CMDS=""
1078rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +10001079if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001080 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001081 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1082 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1083 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1084 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1085 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1086 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1087 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1088 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1089 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1090 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1091 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1092 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1093 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1094 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1095 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +10001096
1097 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001098fi
Damien Miller0437b332000-05-02 09:56:41 +10001099AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1100
Damien Miller11e37f62000-04-08 18:23:30 +10001101
Damien Miller670a4b82000-01-22 13:53:11 +11001102AC_ARG_WITH(catman,
1103 [ --with-catman=man|cat Install preformatted manpages[no]],
1104 [
1105 MANTYPE='$(CATMAN)'
1106 if test x"$withval" != x"yes" ; then
1107 mansubdir=$withval
1108 else
1109 mansubdir=cat
1110 fi
1111 ], [
1112 if test -z "$MANTYPE" ; then
1113 MANTYPE='$(TROFFMAN)'
1114 mansubdir=man
1115 fi
1116 ]
1117)
1118AC_SUBST(MANTYPE)
1119AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001120
Damien Millera22ba012000-03-02 23:09:20 +11001121# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +10001122KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001123AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +11001124 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +11001125 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001126 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001127
Ben Lindstrom23e13712000-10-29 22:49:19 +00001128 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001129 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Damien Miller105b7f02000-01-07 08:45:55 +11001130 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +11001131 if test ! -z "$need_dash_r" ; then
1132 LDFLAGS="$LDFLAGS -R${withval}/lib"
1133 fi
1134 if test ! -z "$blibpath" ; then
1135 blibpath="$blibpath:${withval}/lib"
1136 fi
Damien Miller105b7f02000-01-07 08:45:55 +11001137 else
1138 if test -d /usr/include/kerberosIV ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001139 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
Damien Miller105b7f02000-01-07 08:45:55 +11001140 fi
1141 fi
1142
1143 AC_CHECK_HEADERS(krb.h)
1144 AC_CHECK_LIB(krb, main)
1145 if test "$ac_cv_header_krb_h" != yes; then
1146 AC_MSG_WARN([Cannot find krb.h, build may fail])
1147 fi
1148 if test "$ac_cv_lib_krb_main" != yes; then
1149 AC_MSG_WARN([Cannot find libkrb, build may fail])
1150 fi
1151
Damien Millerc85f9b42000-01-29 10:20:21 +11001152 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +11001153 AC_CHECK_LIB(resolv, dn_expand, , )
1154 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +10001155 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001156 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +11001157 fi
Damien Miller80297751999-11-19 13:03:25 +11001158 ]
1159)
1160
Damien Millera22ba012000-03-02 23:09:20 +11001161# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +10001162AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +11001163AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +11001164 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +11001165 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001166 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +11001167
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001168 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001169 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001170 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller105b7f02000-01-07 08:45:55 +11001171 fi
1172
1173 if test -z "$KRB4" ; then
1174 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1175 fi
1176
Damien Miller8bdeee21999-12-30 15:50:54 +11001177 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +11001178 if test ! -z "$AFS_LIBS" ; then
1179 LIBS="$LIBS $AFS_LIBS"
1180 fi
1181 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +10001182 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001183 fi
Damien Miller80297751999-11-19 13:03:25 +11001184 ]
1185)
Damien Millerc85f9b42000-01-29 10:20:21 +11001186LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +11001187
Damien Millera22ba012000-03-02 23:09:20 +11001188# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +10001189SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +11001190AC_ARG_WITH(skey,
Ben Lindstrom305fb002000-11-10 02:41:30 +00001191 [ --with-skey=PATH Enable S/Key support],
Damien Miller80297751999-11-19 13:03:25 +11001192 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001193 if test "x$withval" != "xno" ; then
Ben Lindstrom305fb002000-11-10 02:41:30 +00001194
1195 if test "x$withval" != "xyes" ; then
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001196 CPPFLAGS="$CPPFLAGS -I${withval}/include"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001197 LDFLAGS="$LDFLAGS -L${withval}/lib"
1198 fi
1199
Damien Miller8bdeee21999-12-30 15:50:54 +11001200 AC_DEFINE(SKEY)
1201 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +10001202 SKEY_MSG="yes"
Ben Lindstrom305fb002000-11-10 02:41:30 +00001203
1204 AC_CHECK_FUNC(skey_keyinfo,
1205 [],
1206 [
1207 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1208 ])
Damien Miller8bdeee21999-12-30 15:50:54 +11001209 fi
Damien Miller80297751999-11-19 13:03:25 +11001210 ]
1211)
1212
Damien Millera22ba012000-03-02 23:09:20 +11001213# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +10001214TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001215AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +11001216 [ --with-tcp-wrappers Enable tcpwrappers support],
1217 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001218 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +11001219 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +11001220 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +11001221 AC_MSG_CHECKING(for libwrap)
1222 AC_TRY_LINK(
1223 [
Damien Miller81171112000-04-23 11:14:01 +10001224#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001225 int deny_severity = 0, allow_severity = 0;
1226 ],
1227 [hosts_access(0);],
1228 [
1229 AC_MSG_RESULT(yes)
1230 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001231 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001232 ],
1233 [
Damien Miller7b22d652000-06-18 14:07:04 +10001234 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001235 ]
1236 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001237 fi
Damien Miller80297751999-11-19 13:03:25 +11001238 ]
1239)
1240
Damien Millera22ba012000-03-02 23:09:20 +11001241# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001242MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001243AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001244 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001245 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001246 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001247 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001248 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001249 fi
1250 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001251)
1252
Damien Millera22ba012000-03-02 23:09:20 +11001253# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001254AC_ARG_WITH(shadow,
1255 [ --without-shadow Disable shadow password support],
1256 [
1257 if test "x$withval" = "xno" ; then
1258 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001259 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001260 fi
1261 ]
1262)
1263
Damien Miller1f335fb2000-06-26 11:31:33 +10001264if test -z "$disable_shadow" ; then
1265 AC_MSG_CHECKING([if the systems has expire shadow information])
1266 AC_TRY_COMPILE(
1267 [
1268#include <sys/types.h>
1269#include <shadow.h>
1270 struct spwd sp;
1271 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1272 [ sp_expire_available=yes ], []
1273 )
1274
1275 if test "x$sp_expire_available" = "xyes" ; then
1276 AC_MSG_RESULT(yes)
1277 AC_DEFINE(HAS_SHADOW_EXPIRE)
1278 else
1279 AC_MSG_RESULT(no)
1280 fi
1281fi
1282
Damien Millera22ba012000-03-02 23:09:20 +11001283# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001284if test ! -z "$IPADDR_IN_DISPLAY" ; then
1285 DISPLAY_HACK_MSG="yes"
1286 AC_DEFINE(IPADDR_IN_DISPLAY)
1287else
1288 DISPLAY_HACK_MSG="no"
1289 AC_ARG_WITH(ipaddr-display,
1290 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1291 [
1292 if test "x$withval" != "xno" ; then
1293 AC_DEFINE(IPADDR_IN_DISPLAY)
1294 DISPLAY_HACK_MSG="yes"
1295 fi
1296 ]
1297 )
1298fi
Damien Miller76112de1999-12-21 11:18:08 +11001299
Damien Millera22ba012000-03-02 23:09:20 +11001300# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001301SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001302AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001303 [ --with-default-path=PATH Specify default \$PATH environment for server],
1304 [
1305 if test "x$withval" != "xno" ; then
Damien Millere68f92b2000-10-02 21:42:15 +11001306 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001307 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001308 fi
1309 ]
1310)
1311
Damien Millera22ba012000-03-02 23:09:20 +11001312# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001313IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001314AC_ARG_WITH(ipv4-default,
1315 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1316 [
1317 if test "x$withval" != "xno" ; then
1318 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001319 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001320 fi
1321 ]
1322)
1323
Damien Miller61e50f12000-05-08 20:49:37 +10001324AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001325IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001326AC_ARG_WITH(4in6,
1327 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1328 [
1329 if test "x$withval" != "xno" ; then
1330 AC_MSG_RESULT(yes)
1331 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001332 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001333 else
1334 AC_MSG_RESULT(no)
1335 fi
1336 ],[
1337 if test "x$inet6_default_4in6" = "xyes"; then
1338 AC_MSG_RESULT([yes (default)])
1339 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001340 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001341 else
1342 AC_MSG_RESULT([no (default)])
1343 fi
1344 ]
1345)
1346
Damien Miller78315eb2000-09-29 23:01:36 +11001347AC_MSG_CHECKING(whether to install ssh as suid root)
1348AC_ARG_ENABLE(suid-ssh,
1349[ --enable-suid-ssh Install ssh as suid root (default)
1350 --disable-suid-ssh Install ssh without suid bit],
1351[ case "$enableval" in
1352 no)
1353 AC_MSG_RESULT(no)
1354 SSHMODE=0711
1355 ;;
1356 *) AC_MSG_RESULT(yes)
1357 SSHMODE=04711
1358 ;;
1359 esac ],
1360 AC_MSG_RESULT(yes)
1361 SSHMODE=04711
1362)
1363AC_SUBST(SSHMODE)
1364
1365
Damien Millera22ba012000-03-02 23:09:20 +11001366# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001367piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001368AC_ARG_WITH(pid-dir,
1369 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1370 [
1371 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001372 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001373 fi
1374 ]
1375)
Damien Miller4018c192000-04-30 09:30:44 +10001376
Damien Miller78315eb2000-09-29 23:01:36 +11001377# make sure the directory exists
1378if test ! -d $piddir ; then
1379 piddir=`eval echo ${sysconfdir}`
1380 case $piddir in
1381 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1382 esac
1383fi
1384
Damien Millerdbd250f2000-01-18 08:57:14 +11001385AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001386AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001387
andre2ff7b5d2000-06-03 14:57:40 +00001388dnl allow user to disable some login recording features
1389AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001390 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001391 [ AC_DEFINE(DISABLE_LASTLOG) ]
1392)
1393AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001394 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001395 [ AC_DEFINE(DISABLE_UTMP) ]
1396)
1397AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001398 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001399 [ AC_DEFINE(DISABLE_UTMPX) ]
1400)
1401AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001402 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001403 [ AC_DEFINE(DISABLE_WTMP) ]
1404)
1405AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001406 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001407 [ AC_DEFINE(DISABLE_WTMPX) ]
1408)
1409AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001410 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001411 [ AC_DEFINE(DISABLE_LOGIN) ]
1412)
1413AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001414 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001415 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1416)
1417AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001418 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001419 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1420)
1421AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001422 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001423 [ conf_lastlog_location="$withval"; ],)
1424
1425dnl lastlog, [uw]tmpx? detection
1426dnl NOTE: set the paths in the platform section to avoid the
1427dnl need for command-line parameters
1428dnl lastlog and [uw]tmp are subject to a file search if all else fails
1429
1430dnl lastlog detection
1431dnl NOTE: the code itself will detect if lastlog is a directory
1432AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1433AC_TRY_COMPILE([
1434#include <sys/types.h>
1435#include <utmp.h>
1436#ifdef HAVE_LASTLOG_H
1437# include <lastlog.h>
1438#endif
Damien Miller2994e082000-06-04 15:51:47 +10001439#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001440# include <paths.h>
1441#endif
1442 ],
1443 [ char *lastlog = LASTLOG_FILE; ],
1444 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001445 [
1446 AC_MSG_RESULT(no)
1447 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1448 AC_TRY_COMPILE([
1449#include <sys/types.h>
1450#include <utmp.h>
1451#ifdef HAVE_LASTLOG_H
1452# include <lastlog.h>
1453#endif
1454#ifdef HAVE_PATHS_H
1455# include <paths.h>
1456#endif
1457 ],
1458 [ char *lastlog = _PATH_LASTLOG; ],
1459 [ AC_MSG_RESULT(yes) ],
1460 [
andree441aa32000-06-12 22:34:38 +00001461 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001462 system_lastlog_path=no
1463 ])
1464 ]
andre2ff7b5d2000-06-03 14:57:40 +00001465)
Damien Miller2994e082000-06-04 15:51:47 +10001466
andre2ff7b5d2000-06-03 14:57:40 +00001467if test -z "$conf_lastlog_location"; then
1468 if test x"$system_lastlog_path" = x"no" ; then
1469 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001470 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001471 conf_lastlog_location=$f
1472 fi
1473 done
1474 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001475 AC_MSG_WARN([** Cannot find lastlog **])
1476 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001477 fi
1478 fi
1479fi
1480
1481if test -n "$conf_lastlog_location"; then
1482 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1483fi
1484
1485dnl utmp detection
1486AC_MSG_CHECKING([if your system defines UTMP_FILE])
1487AC_TRY_COMPILE([
1488#include <sys/types.h>
1489#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001490#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001491# include <paths.h>
1492#endif
1493 ],
1494 [ char *utmp = UTMP_FILE; ],
1495 [ AC_MSG_RESULT(yes) ],
1496 [ AC_MSG_RESULT(no)
1497 system_utmp_path=no ]
1498)
1499if test -z "$conf_utmp_location"; then
1500 if test x"$system_utmp_path" = x"no" ; then
1501 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1502 if test -f $f ; then
1503 conf_utmp_location=$f
1504 fi
1505 done
1506 if test -z "$conf_utmp_location"; then
1507 AC_DEFINE(DISABLE_UTMP)
1508 fi
1509 fi
1510fi
1511if test -n "$conf_utmp_location"; then
1512 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1513fi
1514
1515dnl wtmp detection
1516AC_MSG_CHECKING([if your system defines WTMP_FILE])
1517AC_TRY_COMPILE([
1518#include <sys/types.h>
1519#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001520#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001521# include <paths.h>
1522#endif
1523 ],
1524 [ char *wtmp = WTMP_FILE; ],
1525 [ AC_MSG_RESULT(yes) ],
1526 [ AC_MSG_RESULT(no)
1527 system_wtmp_path=no ]
1528)
1529if test -z "$conf_wtmp_location"; then
1530 if test x"$system_wtmp_path" = x"no" ; then
1531 for f in /usr/adm/wtmp /var/log/wtmp; do
1532 if test -f $f ; then
1533 conf_wtmp_location=$f
1534 fi
1535 done
1536 if test -z "$conf_wtmp_location"; then
1537 AC_DEFINE(DISABLE_WTMP)
1538 fi
1539 fi
1540fi
1541if test -n "$conf_wtmp_location"; then
1542 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1543fi
1544
1545
1546dnl utmpx detection - I don't know any system so perverse as to require
1547dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1548dnl there, though.
1549AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1550AC_TRY_COMPILE([
1551#include <sys/types.h>
1552#include <utmp.h>
1553#ifdef HAVE_UTMPX_H
1554#include <utmpx.h>
1555#endif
Damien Miller2994e082000-06-04 15:51:47 +10001556#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001557# include <paths.h>
1558#endif
1559 ],
1560 [ char *utmpx = UTMPX_FILE; ],
1561 [ AC_MSG_RESULT(yes) ],
1562 [ AC_MSG_RESULT(no)
1563 system_utmpx_path=no ]
1564)
1565if test -z "$conf_utmpx_location"; then
1566 if test x"$system_utmpx_path" = x"no" ; then
1567 AC_DEFINE(DISABLE_UTMPX)
1568 fi
1569else
1570 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1571fi
1572
1573dnl wtmpx detection
1574AC_MSG_CHECKING([if your system defines WTMPX_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 *wtmpx = WTMPX_FILE; ],
1586 [ AC_MSG_RESULT(yes) ],
1587 [ AC_MSG_RESULT(no)
1588 system_wtmpx_path=no ]
1589)
1590if test -z "$conf_wtmpx_location"; then
1591 if test x"$system_wtmpx_path" = x"no" ; then
1592 AC_DEFINE(DISABLE_WTMPX)
1593 fi
1594else
1595 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1596fi
1597
Damien Miller4018c192000-04-30 09:30:44 +10001598
1599# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001600entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001601AC_ARG_WITH(entropy-timeout,
1602 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1603 [
1604 if test "x$withval" != "xno" ; then
1605 entropy_timeout=$withval
1606 fi
1607 ]
1608)
1609AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1610
1611
Damien Miller29ea30d2000-03-17 10:54:15 +11001612if test ! -z "$blibpath" ; then
1613 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1614 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1615fi
1616
Damien Millerbac2d8a2000-09-05 16:13:06 +11001617AC_EXEEXT
1618
Damien Miller0437b332000-05-02 09:56:41 +10001619AC_OUTPUT(Makefile ssh_prng_cmds)
1620
Damien Miller7b22d652000-06-18 14:07:04 +10001621# Print summary of options
1622
1623if test x$MANTYPE = x'$(CATMAN)' ; then
1624 MAN_MSG=cat
1625else
1626 MAN_MSG=man
1627fi
1628if test ! -z "$RANDOM_POOL" ; then
1629 RAND_MSG="Device ($RANDOM_POOL)"
1630else
1631 if test ! -z "$EGD_SOCKET" ; then
1632 RAND_MSG="EGD ($EGD_SOCKET)"
1633 else
1634 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001635 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001636 fi
1637fi
1638
1639# Someone please show me a better way :)
1640A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1641B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1642C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1643D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001644E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Damien Miller7b22d652000-06-18 14:07:04 +10001645F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1646G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1647
1648echo ""
1649echo "OpenSSH configured has been configured with the following options."
1650echo " User binaries: $B"
Damien Millere68f92b2000-10-02 21:42:15 +11001651echo " User binaries: $B"
Damien Miller7b22d652000-06-18 14:07:04 +10001652echo " System binaries: $C"
1653echo " Configuration files: $D"
1654echo " Askpass program: $E"
1655echo " Manual pages: $F"
1656echo " PID file: $G"
1657echo " Random number collection: $RAND_MSG"
1658echo " Manpage format: $MAN_MSG"
1659echo " PAM support: ${PAM_MSG}"
1660echo " KerberosIV support: $KRB4_MSG"
1661echo " AFS support: $AFS_MSG"
1662echo " S/KEY support: $SKEY_MSG"
1663echo " TCP Wrappers support: $TCPW_MSG"
1664echo " MD5 password support: $MD5_MSG"
1665echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1666echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1667echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1668
1669echo ""
1670
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001671echo " Host: ${host}"
1672echo " Compiler: ${CC}"
1673echo " Compiler flags: ${CFLAGS}"
1674echo "Preprocessor flags: ${CPPFLAGS}"
1675echo " Linker flags: ${LDFLAGS}"
1676echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001677
1678echo ""
1679
Damien Miller82cf0ce2000-12-20 13:34:48 +11001680if test "x$PAM_MSG" = "xyes" ; then
1681 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1682 echo "otherwise password authentication may fail. Example PAM control files"
1683 echo "can be found in the contrib/ subdirectory"
1684 echo ""
1685fi
1686
Damien Miller6f9c3372000-10-25 10:06:04 +11001687if test ! -z "$BUILTIN_RNG" ; then
1688 echo "WARNING: you are using the builtin random number collection service."
1689 echo "Please read WARNING.RNG and request that your OS vendor includes"
1690 echo "/dev/random in future versions of their OS."
1691 echo ""
1692fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001693
1694if test ! -z "$NO_SFTP"; then
1695 echo "sftp-server will be disabled. Your compiler does not support"
1696 echo "64bit integers."
1697 echo ""
1698fi