blob: eb00a93a6a28826ec73810043430da5b5a8f5489 [file] [log] [blame]
Ben Lindstrom72af2ef2001-05-08 20:42:28 +00001# $Id: configure.in,v 1.285 2001/05/08 20:42:28 mouring Exp $
Damien Millere9cf3572001-02-09 12:55:35 +11002
Damien Millerab18c411999-11-11 10:40:23 +11003AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10004
5AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11006AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11007AC_CANONICAL_HOST
Damien Miller4df5c762001-02-28 08:14:22 +11008AC_C_BIGENDIAN
Damien Miller7f6ea021999-10-28 13:25:17 +10009
Damien Millera22ba012000-03-02 23:09:20 +110010# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +110011AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +100012AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110013AC_PROG_INSTALL
Ben Lindstrom582d3982001-02-06 22:54:30 +000014AC_PATH_PROG(AR, ar)
Tim Riceb8fbb8e2001-04-21 14:31:52 -070015AC_PATH_PROGS(PERL, perl5 perl)
Damien Millere79334a1999-12-29 10:03:37 +110016AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100017AC_PATH_PROG(ENT, ent)
18AC_SUBST(ENT)
Damien Miller78315eb2000-09-29 23:01:36 +110019AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin)
Damien Miller4864e8f2001-02-08 10:07:08 +110020AC_PATH_PROG(TEST_MINUS_S_SH, bash)
21AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
22AC_PATH_PROG(TEST_MINUS_S_SH, sh)
Damien Miller2e1b0821999-12-25 10:11:29 +110023
Damien Miller3f62aba2000-11-29 11:56:35 +110024if test -z "$AR" ; then
25 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
26fi
27
Damien Millerad833b32000-08-23 10:46:23 +100028# Use LOGIN_PROGRAM from environment if possible
29if test ! -z "$LOGIN_PROGRAM" ; then
30 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
31else
32 # Search for login
33 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
34 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
35 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
36 fi
37fi
38
Damien Miller166bd442000-03-16 10:48:25 +110039if test -z "$LD" ; then
40 LD=$CC
41fi
42AC_SUBST(LD)
43
44# C Compiler features
45AC_C_INLINE
46if test "$GCC" = "yes"; then
47 CFLAGS="$CFLAGS -Wall"
48fi
49
Damien Millera22ba012000-03-02 23:09:20 +110050# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110051case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110052*-*-aix*)
53 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000054 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110055 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100056 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110057 blibpath="/usr/lib:/lib:/usr/local/lib"
58 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100059 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110060 AC_DEFINE(BROKEN_GETADDRINFO)
andre60f3c982000-06-03 16:18:19 +000061 dnl AIX handles lastlog as part of its login message
62 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110063 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110064*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110065 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110066 AC_DEFINE(HAVE_CYGWIN)
Damien Millerbac2d8a2000-09-05 16:13:06 +110067 AC_DEFINE(DISABLE_SHADOW)
68 AC_DEFINE(IPV4_DEFAULT)
69 AC_DEFINE(IP_TOS_IS_BROKEN)
Ben Lindstrom38e60932001-02-24 00:55:04 +000070 AC_DEFINE(NO_X11_UNIX_SOCKETS)
Damien Millerbac2d8a2000-09-05 16:13:06 +110071 no_libsocket=1
72 no_libnsl=1
73 ;;
Ben Lindstrom58055132001-02-15 18:34:29 +000074*-*-dgux*)
75 AC_DEFINE(IP_TOS_IS_BROKEN)
76 ;;
Damien Miller76112de1999-12-21 11:18:08 +110077*-*-hpux10*)
78 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100079 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110080 fi
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000081 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110082 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100083 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110084 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110085 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000086 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110087 LIBS="$LIBS -lsec"
Damien Miller76112de1999-12-21 11:18:08 +110088 ;;
Damien Miller1bead332000-04-30 00:47:29 +100089*-*-hpux11*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000090 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
Damien Miller9a947342000-08-30 10:03:33 +110091 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110092 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110093 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110094 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110095 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000096 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Damien Miller8a1e6a62000-09-16 15:55:52 +110097 LIBS="$LIBS -lsec"
Damien Miller1bead332000-04-30 00:47:29 +100098 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110099*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000100 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000101 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100102 PATH="$PATH:/usr/etc"
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 Miller91606b12000-06-28 08:22:29 +1000111 AC_DEFINE(WITH_IRIX_ARRAY)
112 AC_DEFINE(WITH_IRIX_PROJECT)
113 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000114 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100115 no_libsocket=1
116 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000117 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100118 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100119*-*-linux*)
120 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100121 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100122 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000123 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100124 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100125 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000126mips-sony-bsd|mips-sony-newsos4)
127 AC_DEFINE(HAVE_NEWS4)
128 SONY=1
129 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100130 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000131 )
132 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100133*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100134 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100135 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100136*-*-freebsd*)
137 check_for_libcrypt_later=1
138 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000139*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000140 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100141 conf_utmp_location=/etc/utmp
142 conf_wtmp_location=/usr/adm/wtmp
143 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000144 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000145 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000146 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100147 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000148 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000149 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000150 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100151*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000152 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000153 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100154 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100155 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000156 AC_DEFINE(LOGIN_NEEDS_UTMPX)
157 AC_DEFINE(LOGIN_NEEDS_TERM)
andre2ff7b5d2000-06-03 14:57:40 +0000158 # hardwire lastlog location (can't detect it on some versions)
159 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000160 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
161 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
162 if test "$sol2ver" -ge 8; then
163 AC_MSG_RESULT(yes)
164 AC_DEFINE(DISABLE_UTMP)
165 AC_DEFINE(DISABLE_WTMP)
166 else
167 AC_MSG_RESULT(no)
168 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100169 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000170*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000171 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000172 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100173 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100174 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000175 conf_utmp_location=/etc/utmp
176 conf_wtmp_location=/var/adm/wtmp
177 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000178 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000179 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000180*-ncr-sysv*)
181 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
182 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000183 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
Ben Lindstrom34328342001-04-23 22:39:42 +0000184 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000185 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000186*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000187 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000188 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100189 IPADDR_IN_DISPLAY=yes
190 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000191 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000192 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerb2dc28e2000-07-12 09:18:33 +1000193 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000194 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100195*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000196 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100197 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller78315eb2000-09-29 23:01:36 +1100198 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100199 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100200 ;;
201*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000202 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100203 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller78315eb2000-09-29 23:01:36 +1100204 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100205 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100206 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100207*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000208 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100209 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100210 LIBS="$LIBS -lgen -lsocket"
211 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100212*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000213 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100214 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Ben Lindstrom980754c2000-11-12 00:04:24 +0000215 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100216 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100217 RANLIB=true
218 no_dev_ptmx=1
219 AC_DEFINE(BROKEN_SYS_TERMIO_H)
220 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100221 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000222 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000223 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100224 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100225 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700226 MANTYPE=man
Damien Miller78315eb2000-09-29 23:01:36 +1100227 ;;
228*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000229 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000230 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100231 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000232 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100233 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100234 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100235 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000236 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000237 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100238 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700239 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000240 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000241*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000242 AC_MSG_CHECKING(for Digital Unix SIA)
243 no_osfsia=""
244 AC_ARG_WITH(osfsia,
245 [ --with-osfsia Enable Digital Unix SIA],
246 [
247 if test "x$withval" = "xno" ; then
248 AC_MSG_RESULT(disabled)
249 no_osfsia=1
250 fi
251 ],
252 )
253 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000254 if test -f /etc/sia/matrix.conf; then
255 AC_MSG_RESULT(yes)
256 AC_DEFINE(HAVE_OSF_SIA)
257 AC_DEFINE(DISABLE_LOGIN)
258 LIBS="$LIBS -lsecurity -ldb -lm -laud"
259 else
260 AC_MSG_RESULT(no)
261 fi
262 fi
263 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100264esac
265
Damien Millere37bfc12000-06-05 09:37:43 +1000266# Allow user to specify flags
267AC_ARG_WITH(cflags,
268 [ --with-cflags Specify additional flags to pass to compiler],
269 [
270 if test "x$withval" != "xno" ; then
271 CFLAGS="$CFLAGS $withval"
272 fi
273 ]
274)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000275AC_ARG_WITH(cppflags,
276 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
277 [
278 if test "x$withval" != "xno"; then
279 CPPFLAGS="$CPPFLAGS $withval"
280 fi
281 ]
282)
Damien Millere37bfc12000-06-05 09:37:43 +1000283AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000284 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000285 [
286 if test "x$withval" != "xno" ; then
287 LDFLAGS="$LDFLAGS $withval"
288 fi
289 ]
290)
291AC_ARG_WITH(libs,
292 [ --with-libs Specify additional libraries to link with],
293 [
294 if test "x$withval" != "xno" ; then
295 LIBS="$LIBS $withval"
296 fi
297 ]
298)
299
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000300AC_ARG_WITH(pcre,
301 [ --with-pcre Override built in regex library with pcre],
302 [
303
304 AC_CHECK_LIB(pcre, pcre_info,
305 [
306 AC_DEFINE(HAVE_LIBPCRE)
307 LIBS="$LIBS -lpcreposix -lpcre"
308 no_comp_check="yes"
309 ],
310 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
311 )
312 ]
313)
Damien Millere37bfc12000-06-05 09:37:43 +1000314
Damien Millera22ba012000-03-02 23:09:20 +1100315# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100316if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000317 AC_CHECK_LIB(nsl, yp_match, , )
318fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100319if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000320 AC_CHECK_LIB(socket, main, , )
321fi
322
Damien Millerdf288022001-02-18 13:07:07 +1100323dnl SCO OS3 needs this for libwrap
324AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
325
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000326AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100327AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100328AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100329
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000330# We don't want to check if we did an pcre override.
331if test -z "$no_comp_check" ; then
332 AC_CHECK_FUNC(regcomp,
333 [ AC_DEFINE(HAVE_REGCOMP)],
334 [
335 AC_CHECK_LIB(pcre, pcre_info,
336 [
337 AC_DEFINE(HAVE_LIBPCRE)
338 LIBS="$LIBS -lpcreposix -lpcre"
339 ],
340 [
341 AC_MSG_ERROR([*** No regex library found.])
342 ])
343 ]
344 )
345fi
Damien Millerab18c411999-11-11 10:40:23 +1100346
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000347dnl UnixWare 2.x
348AC_CHECK_FUNC(strcasecmp,
349 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
350)
351AC_CHECK_FUNC(utimes,
352 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
353)
Damien Millerab18c411999-11-11 10:40:23 +1100354
Ben Lindstrom8697e082001-02-24 21:41:10 +0000355AC_FUNC_STRFTIME
356
Damien Millera22ba012000-03-02 23:09:20 +1100357# Checks for header files.
Damien Millerda2ed562001-04-25 22:50:18 +1000358AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h getopt.h glob.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 Miller3c027682001-03-14 11:39:45 +1100359
360# Check for ALTDIRFUNC glob() extension
361AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
362AC_EGREP_CPP(FOUNDIT,
363 [
364 #include <glob.h>
365 #ifdef GLOB_ALTDIRFUNC
366 FOUNDIT
367 #endif
368 ],
369 [
370 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
371 AC_MSG_RESULT(yes)
372 ],
373 [
374 AC_MSG_RESULT(no)
375 ]
376)
Damien Millerab18c411999-11-11 10:40:23 +1100377
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000378# Check for g.gl_matchc glob() extension
379AC_MSG_CHECKING(for gl_matchc field in glob_t)
380AC_EGREP_CPP(FOUNDIT,
381 [
382 #include <glob.h>
383 int main(void){glob_t g; g.gl_matchc = 1;}
384 ],
385 [
386 AC_DEFINE(GLOB_HAS_GL_MATCHC)
387 AC_MSG_RESULT(yes)
388 ],
389 [
390 AC_MSG_RESULT(no)
391 ]
392)
393
Damien Miller18bb4732001-03-28 14:35:30 +1000394AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
395AC_TRY_RUN(
396 [
397#include <sys/types.h>
398#include <dirent.h>
399int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
400 ],
401 [AC_MSG_RESULT(yes)],
402 [
403 AC_MSG_RESULT(no)
404 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
405 ]
406)
407
Damien Millerc547bf12001-02-16 10:18:12 +1100408# Check whether user wants S/Key support
409SKEY_MSG="no"
410AC_ARG_WITH(skey,
411 [ --with-skey=PATH Enable S/Key support],
412 [
413 if test "x$withval" != "xno" ; then
414
415 if test "x$withval" != "xyes" ; then
416 CPPFLAGS="$CPPFLAGS -I${withval}/include"
417 LDFLAGS="$LDFLAGS -L${withval}/lib"
418 fi
419
420 AC_DEFINE(SKEY)
421 LIBS="-lskey $LIBS"
422 SKEY_MSG="yes"
423
424 AC_CHECK_FUNC(skey_keyinfo,
425 [],
426 [
427 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
428 ])
429 fi
430 ]
431)
432
433# Check whether user wants TCP wrappers support
434TCPW_MSG="no"
435AC_ARG_WITH(tcp-wrappers,
436 [ --with-tcp-wrappers Enable tcpwrappers support],
437 [
438 if test "x$withval" != "xno" ; then
439 saved_LIBS="$LIBS"
440 LIBS="-lwrap $LIBS"
441 AC_MSG_CHECKING(for libwrap)
442 AC_TRY_LINK(
443 [
444#include <tcpd.h>
445 int deny_severity = 0, allow_severity = 0;
446 ],
447 [hosts_access(0);],
448 [
449 AC_MSG_RESULT(yes)
450 AC_DEFINE(LIBWRAP)
451 TCPW_MSG="yes"
452 ],
453 [
454 AC_MSG_ERROR([*** libwrap missing])
455 ]
456 )
457 fi
458 ]
459)
460
Damien Millerad833b32000-08-23 10:46:23 +1000461dnl Checks for library functions.
Ben Lindstrom09988722001-04-12 21:35:52 +0000462AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent getusershell glob inet_aton inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000463dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000464AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000465dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000466AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000467AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000468dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000469AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000470AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000471dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000472AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000473AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100474
Damien Miller5fc85652000-07-09 23:53:07 +1000475AC_CHECK_FUNC(getuserattr,
476 [AC_DEFINE(HAVE_GETUSERATTR)],
477 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
478)
479
Damien Miller04f80141999-11-19 15:32:34 +1100480AC_CHECK_FUNC(login,
481 [AC_DEFINE(HAVE_LOGIN)],
482 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
483)
484
485AC_CHECK_FUNC(daemon,
486 [AC_DEFINE(HAVE_DAEMON)],
487 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
488)
489
Damien Miller9fb07e42000-03-05 16:22:59 +1100490AC_CHECK_FUNC(getpagesize,
491 [AC_DEFINE(HAVE_GETPAGESIZE)],
492 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
493)
494
Damien Millercb170cb2000-07-01 16:52:55 +1000495# Check for broken snprintf
496if test "x$ac_cv_func_snprintf" = "xyes" ; then
497 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
498 AC_TRY_RUN(
499 [
500#include <stdio.h>
501int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
502 ],
503 [AC_MSG_RESULT(yes)],
504 [
505 AC_MSG_RESULT(no)
506 AC_DEFINE(BROKEN_SNPRINTF)
507 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
508 ]
509 )
510fi
511
Damien Miller606f8802000-09-16 15:39:56 +1100512AC_FUNC_GETPGRP
513
Damien Millera64b57a2001-01-17 10:44:13 +1100514# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000515PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100516AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100517 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100518 [
Damien Millera64b57a2001-01-17 10:44:13 +1100519 if test "x$withval" != "xno" ; then
520 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
521 AC_MSG_ERROR([PAM headers not found])
522 fi
523
524 AC_CHECK_LIB(dl, dlopen, , )
525 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
526 AC_CHECK_FUNCS(pam_getenvlist)
527
528 disable_shadow=yes
529 PAM_MSG="yes"
530
531 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100532 fi
533 ]
534)
Damien Millera22ba012000-03-02 23:09:20 +1100535
Damien Millera64b57a2001-01-17 10:44:13 +1100536# Check for older PAM
537if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100538 # Check PAM strerror arguments (old PAM)
539 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
540 AC_TRY_COMPILE(
541 [
Damien Miller81171112000-04-23 11:14:01 +1000542#include <stdlib.h>
543#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100544 ],
545 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
546 [AC_MSG_RESULT(no)],
547 [
548 AC_DEFINE(HAVE_OLD_PAM)
549 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000550 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100551 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100552 )
Damien Millera22ba012000-03-02 23:09:20 +1100553fi
554
555# The big search for OpenSSL
556AC_ARG_WITH(ssl-dir,
557 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
558 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000559 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100560 tryssldir=$withval
561 fi
562 ]
563)
564
565saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100566saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000567saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100568if test "x$prefix" != "xNONE" ; then
569 tryssldir="$tryssldir $prefix"
570fi
Damien Miller61e50f12000-05-08 20:49:37 +1000571AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100572 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 Millerccdefb62001-02-19 12:56:39 +1100573 CPPFLAGS="$saved_CPPFLAGS"
574 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000575 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100576
577 # Skip directories if they don't exist
578 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
579 continue;
580 fi
581 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
582 # Try to use $ssldir/lib if it exists, otherwise
583 # $ssldir
584 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000585 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100586 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000587 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100588 fi
589 else
Damien Millerb68af622001-03-28 21:05:26 +1000590 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100591 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000592 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100593 fi
594 fi
595 # Try to use $ssldir/include if it exists, otherwise
596 # $ssldir
597 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000598 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100599 else
Damien Millerb68af622001-03-28 21:05:26 +1000600 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100601 fi
602 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000603
Damien Miller3b512e12000-05-17 23:29:18 +1000604 # Basic test to check for compatible version and correct linking
605 # *does not* test for RSA - that comes later.
606 AC_TRY_RUN(
607 [
Damien Millere59ce622000-05-01 20:54:17 +1000608#include <string.h>
609#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000610int main(void)
611{
Damien Miller3b512e12000-05-17 23:29:18 +1000612 char a[2048];
613 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000614 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000615 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000616}
Damien Miller3b512e12000-05-17 23:29:18 +1000617 ],
618 [
619 found_crypto=1
620 break;
621 ], []
622 )
Damien Miller61e50f12000-05-08 20:49:37 +1000623
624 if test ! -z "$found_crypto" ; then
625 break;
626 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100627 done
628
Damien Miller61e50f12000-05-08 20:49:37 +1000629 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100630 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100631 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000632 if test -z "$ssldir" ; then
633 ssldir="(system)"
634 fi
Damien Millera22ba012000-03-02 23:09:20 +1100635
Damien Miller61e50f12000-05-08 20:49:37 +1000636 ac_cv_openssldir=$ssldir
637])
638
Damien Milleredb82922000-06-20 13:25:52 +1000639if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000640 AC_DEFINE(HAVE_OPENSSL)
641 dnl Need to recover ssldir - test above runs in subshell
642 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100643 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100644 # Try to use $ssldir/lib if it exists, otherwise
645 # $ssldir
646 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000647 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100648 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000649 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100650 fi
651 else
Damien Millerb68af622001-03-28 21:05:26 +1000652 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100653 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000654 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100655 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100656 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100657 # Try to use $ssldir/include if it exists, otherwise
658 # $ssldir
659 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000660 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100661 else
Damien Millerb68af622001-03-28 21:05:26 +1000662 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100663 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100664 fi
Damien Millera22ba012000-03-02 23:09:20 +1100665fi
Damien Miller3b512e12000-05-17 23:29:18 +1000666LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000667
Damien Miller3b512e12000-05-17 23:29:18 +1000668# Now test RSA support
669saved_LIBS="$LIBS"
670AC_MSG_CHECKING([for RSA support])
671for WANTS_RSAREF in "" 1 ; do
672 if test -z "$WANTS_RSAREF" ; then
673 LIBS="$saved_LIBS"
674 else
675 LIBS="$saved_LIBS -lRSAglue -lrsaref"
676 fi
677 AC_TRY_RUN([
678#include <string.h>
679#include <openssl/rand.h>
680#include <openssl/rsa.h>
681#include <openssl/bn.h>
682#include <openssl/sha.h>
683int main(void)
684{
685 int num; RSA *key; static unsigned char p_in[] = "blahblah";
686 unsigned char c[256], p[256];
687 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
688 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
689 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
690 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
691}
692 ],
693 [
694 rsa_works=1
695 break;
696 ], [])
697done
698
699if test ! -z "$no_rsa" ; then
700 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000701 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000702else
703 if test -z "$rsa_works" ; then
704 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000705 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000706 else
707 if test -z "$WANTS_RSAREF" ; then
708 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000709 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000710 else
Damien Miller7b22d652000-06-18 14:07:04 +1000711 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000712 AC_MSG_RESULT(using RSAref)
713 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
714 fi
715 fi
716fi
Damien Millera22ba012000-03-02 23:09:20 +1100717
Damien Millera64b57a2001-01-17 10:44:13 +1100718# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
719# version in OpenSSL. Skip this for PAM
720if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100721 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100722fi
723
Ben Lindstromb5628642000-10-18 00:02:25 +0000724# Cheap hack to ensure NEWS-OS libraries are arranged right.
725if test ! -z "$SONY" ; then
726 LIBS="$LIBS -liberty";
727fi
728
Damien Millera22ba012000-03-02 23:09:20 +1100729# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100730AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100731AC_CHECK_SIZEOF(short int, 2)
732AC_CHECK_SIZEOF(int, 4)
733AC_CHECK_SIZEOF(long int, 4)
734AC_CHECK_SIZEOF(long long int, 8)
735
Damien Millera22ba012000-03-02 23:09:20 +1100736# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100737AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
738 AC_TRY_COMPILE(
739 [ #include <sys/types.h> ],
740 [ u_int a; a = 1;],
741 [ ac_cv_have_u_int="yes" ],
742 [ ac_cv_have_u_int="no" ]
743 )
744])
745if test "x$ac_cv_have_u_int" = "xyes" ; then
746 AC_DEFINE(HAVE_U_INT)
747 have_u_int=1
748fi
749
Damien Miller61e50f12000-05-08 20:49:37 +1000750AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
751 AC_TRY_COMPILE(
752 [ #include <sys/types.h> ],
753 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
754 [ ac_cv_have_intxx_t="yes" ],
755 [ ac_cv_have_intxx_t="no" ]
756 )
757])
758if test "x$ac_cv_have_intxx_t" = "xyes" ; then
759 AC_DEFINE(HAVE_INTXX_T)
760 have_intxx_t=1
761fi
762
Damien Miller578783e2000-09-23 14:12:24 +1100763AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
764 AC_TRY_COMPILE(
765 [ #include <sys/types.h> ],
766 [ int64_t a; a = 1;],
767 [ ac_cv_have_int64_t="yes" ],
768 [ ac_cv_have_int64_t="no" ]
769 )
770])
771if test "x$ac_cv_have_int64_t" = "xyes" ; then
772 AC_DEFINE(HAVE_INT64_T)
773 have_int64_t=1
774fi
775
Damien Miller61e50f12000-05-08 20:49:37 +1000776AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
777 AC_TRY_COMPILE(
778 [ #include <sys/types.h> ],
779 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
780 [ ac_cv_have_u_intxx_t="yes" ],
781 [ ac_cv_have_u_intxx_t="no" ]
782 )
783])
784if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
785 AC_DEFINE(HAVE_U_INTXX_T)
786 have_u_intxx_t=1
787fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100788
Damien Miller578783e2000-09-23 14:12:24 +1100789AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
790 AC_TRY_COMPILE(
791 [ #include <sys/types.h> ],
792 [ u_int64_t a; a = 1;],
793 [ ac_cv_have_u_int64_t="yes" ],
794 [ ac_cv_have_u_int64_t="no" ]
795 )
796])
797if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
798 AC_DEFINE(HAVE_U_INT64_T)
799 have_u_int64_t=1
800fi
801
Damien Milleredb82922000-06-20 13:25:52 +1000802if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
803 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100804then
805 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
806 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000807 [
808#include <sys/bitypes.h>
809 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100810 [
Damien Miller70494d12000-04-03 15:57:06 +1000811 int8_t a; int16_t b; int32_t c;
812 u_int8_t e; u_int16_t f; u_int32_t g;
813 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100814 ],
815 [
816 AC_DEFINE(HAVE_U_INTXX_T)
817 AC_DEFINE(HAVE_INTXX_T)
818 AC_MSG_RESULT(yes)
819 ],
820 [AC_MSG_RESULT(no)]
821 )
822fi
823
Damien Millerd6121d22000-03-17 23:26:46 +1100824if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000825 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
826 AC_TRY_COMPILE(
827 [
828#include <sys/types.h>
829 ],
830 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
831 [ ac_cv_have_uintxx_t="yes" ],
832 [ ac_cv_have_uintxx_t="no" ]
833 )
834 ])
835 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
836 AC_DEFINE(HAVE_UINTXX_T)
837 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100838fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100839
Damien Miller61e50f12000-05-08 20:49:37 +1000840AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
841 AC_TRY_COMPILE(
842 [
Damien Miller81171112000-04-23 11:14:01 +1000843#include <sys/types.h>
844#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000845 ],
846 [socklen_t foo; foo = 1235;],
847 [ ac_cv_have_socklen_t="yes" ],
848 [ ac_cv_have_socklen_t="no" ]
849 )
850])
851if test "x$ac_cv_have_socklen_t" = "xyes" ; then
852 AC_DEFINE(HAVE_SOCKLEN_T)
853fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100854
Damien Miller61e50f12000-05-08 20:49:37 +1000855AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
856 AC_TRY_COMPILE(
857 [
858#include <sys/types.h>
859 ],
860 [ size_t foo; foo = 1235; ],
861 [ ac_cv_have_size_t="yes" ],
862 [ ac_cv_have_size_t="no" ]
863 )
864])
865if test "x$ac_cv_have_size_t" = "xyes" ; then
866 AC_DEFINE(HAVE_SIZE_T)
867fi
Damien Miller95058511999-12-29 10:36:45 +1100868
Damien Miller615f9392000-05-17 22:53:33 +1000869AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
870 AC_TRY_COMPILE(
871 [
872#include <sys/types.h>
873 ],
874 [ ssize_t foo; foo = 1235; ],
875 [ ac_cv_have_ssize_t="yes" ],
876 [ ac_cv_have_ssize_t="no" ]
877 )
878])
879if test "x$ac_cv_have_ssize_t" = "xyes" ; then
880 AC_DEFINE(HAVE_SSIZE_T)
881fi
882
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000883AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
884 AC_TRY_COMPILE(
885 [
886#include <time.h>
887 ],
888 [ clock_t foo; foo = 1235; ],
889 [ ac_cv_have_clock_t="yes" ],
890 [ ac_cv_have_clock_t="no" ]
891 )
892])
893if test "x$ac_cv_have_clock_t" = "xyes" ; then
894 AC_DEFINE(HAVE_CLOCK_T)
895fi
896
Damien Millerb54b40e2000-06-23 08:23:34 +1000897AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
898 AC_TRY_COMPILE(
899 [
900#include <sys/types.h>
901#include <sys/socket.h>
902 ],
903 [ sa_family_t foo; foo = 1235; ],
904 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100905 [ AC_TRY_COMPILE(
906 [
907#include <sys/types.h>
908#include <sys/socket.h>
909#include <netinet/in.h>
910 ],
911 [ sa_family_t foo; foo = 1235; ],
912 [ ac_cv_have_sa_family_t="yes" ],
913
Damien Millerb54b40e2000-06-23 08:23:34 +1000914 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100915 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000916 )
917])
918if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
919 AC_DEFINE(HAVE_SA_FAMILY_T)
920fi
921
Damien Miller0f91b4e2000-06-18 15:43:25 +1000922AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
923 AC_TRY_COMPILE(
924 [
925#include <sys/types.h>
926 ],
927 [ pid_t foo; foo = 1235; ],
928 [ ac_cv_have_pid_t="yes" ],
929 [ ac_cv_have_pid_t="no" ]
930 )
931])
932if test "x$ac_cv_have_pid_t" = "xyes" ; then
933 AC_DEFINE(HAVE_PID_T)
934fi
935
936AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
937 AC_TRY_COMPILE(
938 [
939#include <sys/types.h>
940 ],
941 [ mode_t foo; foo = 1235; ],
942 [ ac_cv_have_mode_t="yes" ],
943 [ ac_cv_have_mode_t="no" ]
944 )
945])
946if test "x$ac_cv_have_mode_t" = "xyes" ; then
947 AC_DEFINE(HAVE_MODE_T)
948fi
949
Damien Miller61e50f12000-05-08 20:49:37 +1000950
951AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
952 AC_TRY_COMPILE(
953 [
Damien Miller81171112000-04-23 11:14:01 +1000954#include <sys/types.h>
955#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000956 ],
957 [ struct sockaddr_storage s; ],
958 [ ac_cv_have_struct_sockaddr_storage="yes" ],
959 [ ac_cv_have_struct_sockaddr_storage="no" ]
960 )
961])
962if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
963 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
964fi
Damien Miller34132e52000-01-14 15:45:46 +1100965
Damien Miller61e50f12000-05-08 20:49:37 +1000966AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
967 AC_TRY_COMPILE(
968 [
Damien Miller7b22d652000-06-18 14:07:04 +1000969#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000970#include <netinet/in.h>
971 ],
972 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
973 [ ac_cv_have_struct_sockaddr_in6="yes" ],
974 [ ac_cv_have_struct_sockaddr_in6="no" ]
975 )
976])
977if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
978 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
979fi
Damien Miller34132e52000-01-14 15:45:46 +1100980
Damien Miller61e50f12000-05-08 20:49:37 +1000981AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
982 AC_TRY_COMPILE(
983 [
Damien Miller7b22d652000-06-18 14:07:04 +1000984#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000985#include <netinet/in.h>
986 ],
987 [ struct in6_addr s; s.s6_addr[0] = 0; ],
988 [ ac_cv_have_struct_in6_addr="yes" ],
989 [ ac_cv_have_struct_in6_addr="no" ]
990 )
991])
992if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
993 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
994fi
Damien Miller34132e52000-01-14 15:45:46 +1100995
Damien Miller61e50f12000-05-08 20:49:37 +1000996AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
997 AC_TRY_COMPILE(
998 [
Damien Miller81171112000-04-23 11:14:01 +1000999#include <sys/types.h>
1000#include <sys/socket.h>
1001#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001002 ],
1003 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1004 [ ac_cv_have_struct_addrinfo="yes" ],
1005 [ ac_cv_have_struct_addrinfo="no" ]
1006 )
1007])
1008if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1009 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1010fi
1011
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001012AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1013 AC_TRY_COMPILE(
1014 [ #include <sys/time.h> ],
1015 [ struct timeval tv; tv.tv_sec = 1;],
1016 [ ac_cv_have_struct_timeval="yes" ],
1017 [ ac_cv_have_struct_timeval="no" ]
1018 )
1019])
1020if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1021 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1022 have_struct_timeval=1
1023fi
1024
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001025# If we don't have int64_t then we can't compile sftp-server. So don't
1026# even attempt to do it.
1027if test "x$ac_cv_have_int64_t" = "xno" -a \
1028 "x$ac_cv_sizeof_long_int" != "x8" -a \
1029 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1030 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001031else
1032dnl test snprintf (broken on SCO w/gcc)
1033 AC_TRY_RUN(
1034 [
1035#include <stdio.h>
1036#include <string.h>
1037#ifdef HAVE_SNPRINTF
1038main()
1039{
1040 char buf[50];
1041 char expected_out[50];
1042 int mazsize = 50 ;
1043#if (SIZEOF_LONG_INT == 8)
1044 long int num = 0x7fffffffffffffff;
1045#else
1046 long long num = 0x7fffffffffffffff;
1047#endif
1048 strcpy(expected_out, "9223372036854775807");
1049 snprintf(buf, mazsize, "%lld", num);
1050 if(strcmp(buf, expected_out) != 0)
1051 exit(1);
1052 exit(0);
1053}
1054#else
1055main() { exit(0); }
1056#endif
1057 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1058 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001059fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001060AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001061
Damien Miller78315eb2000-09-29 23:01:36 +11001062dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001063OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1064OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1065OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1066OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1067OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001068OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001069OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1070OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001071OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001072OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1073OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1074OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1075OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001076OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1077OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1078OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1079OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001080AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001081
Damien Miller942da032000-08-18 13:59:06 +10001082AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1083 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1084 AC_TRY_COMPILE(
1085 [
1086#include <sys/types.h>
1087#include <sys/socket.h>
1088 ],
1089 [ struct sockaddr_un s; s.sun_len = 1; ],
1090 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1091 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1092 )
1093])
1094if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1095 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1096fi
1097
Damien Miller61e50f12000-05-08 20:49:37 +10001098AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1099 ac_cv_have_ss_family_in_struct_ss, [
1100 AC_TRY_COMPILE(
1101 [
Damien Miller81171112000-04-23 11:14:01 +10001102#include <sys/types.h>
1103#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001104 ],
1105 [ struct sockaddr_storage s; s.ss_family = 1; ],
1106 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1107 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1108 )
1109])
1110if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1111 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1112fi
1113
Damien Miller61e50f12000-05-08 20:49:37 +10001114AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1115 ac_cv_have___ss_family_in_struct_ss, [
1116 AC_TRY_COMPILE(
1117 [
Damien Miller81171112000-04-23 11:14:01 +10001118#include <sys/types.h>
1119#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001120 ],
1121 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1122 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1123 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1124 )
1125])
1126if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1127 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1128fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001129
Damien Millerad833b32000-08-23 10:46:23 +10001130AC_CACHE_CHECK([for pw_class field in struct passwd],
1131 ac_cv_have_pw_class_in_struct_passwd, [
1132 AC_TRY_COMPILE(
1133 [
Damien Millerad833b32000-08-23 10:46:23 +10001134#include <pwd.h>
1135 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001136 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001137 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1138 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1139 )
1140])
1141if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1142 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1143fi
1144
Damien Miller61e50f12000-05-08 20:49:37 +10001145
1146AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1147 AC_TRY_LINK([],
1148 [ extern char *__progname; printf("%s", __progname); ],
1149 [ ac_cv_libc_defines___progname="yes" ],
1150 [ ac_cv_libc_defines___progname="no" ]
1151 )
1152])
1153if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1154 AC_DEFINE(HAVE___PROGNAME)
1155fi
1156
Damien Millera22ba012000-03-02 23:09:20 +11001157
Damien Millerecbb26d2000-07-15 14:59:14 +10001158AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1159 AC_TRY_LINK([],
1160 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1161 [ ac_cv_libc_defines_sys_errlist="yes" ],
1162 [ ac_cv_libc_defines_sys_errlist="no" ]
1163 )
1164])
1165if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1166 AC_DEFINE(HAVE_SYS_ERRLIST)
1167fi
1168
1169
Damien Miller11fa2cc2000-08-16 10:35:58 +10001170AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1171 AC_TRY_LINK([],
1172 [ extern int sys_nerr; printf("%i", sys_nerr);],
1173 [ ac_cv_libc_defines_sys_nerr="yes" ],
1174 [ ac_cv_libc_defines_sys_nerr="no" ]
1175 )
1176])
1177if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1178 AC_DEFINE(HAVE_SYS_NERR)
1179fi
1180
1181
Damien Millerc79bc0d2001-03-28 13:03:42 +10001182# Check whether user wants Kerberos support
1183KRB4_MSG="no"
1184AC_ARG_WITH(kerberos4,
1185 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1186 [
1187 if test "x$withval" != "xno" ; then
1188
1189 if test "x$withval" != "xyes" ; then
1190 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1191 LDFLAGS="$LDFLAGS -L${withval}/lib"
1192 if test ! -z "$need_dash_r" ; then
1193 LDFLAGS="$LDFLAGS -R${withval}/lib"
1194 fi
1195 if test ! -z "$blibpath" ; then
1196 blibpath="$blibpath:${withval}/lib"
1197 fi
1198 else
1199 if test -d /usr/include/kerberosIV ; then
1200 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1201 fi
1202 fi
1203
1204 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001205 if test "$ac_cv_header_krb_h" != yes; then
1206 AC_MSG_WARN([Cannot find krb.h, build may fail])
1207 fi
Damien Miller98344742001-03-28 14:37:06 +10001208 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001209 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001210 AC_CHECK_LIB(krb4, main)
1211 if test "$ac_cv_lib_krb4_main" != yes; then
1212 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1213 else
1214 KLIBS="-lkrb4"
1215 fi
1216 else
1217 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001218 fi
Damien Miller98344742001-03-28 14:37:06 +10001219 AC_CHECK_LIB(des, des_cbc_encrypt)
1220 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1221 AC_CHECK_LIB(des425, des_cbc_encrypt)
1222 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1223 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1224 else
1225 KLIBS="-ldes425"
1226 fi
1227 else
1228 KLIBS="-ldes"
1229 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001230 AC_CHECK_LIB(resolv, dn_expand, , )
1231 KRB4=yes
1232 KRB4_MSG="yes"
1233 AC_DEFINE(KRB4)
1234 fi
1235 ]
1236)
1237
1238# Check whether user wants AFS support
1239AFS_MSG="no"
1240AC_ARG_WITH(afs,
1241 [ --with-afs=PATH Enable AFS support],
1242 [
1243 if test "x$withval" != "xno" ; then
1244
1245 if test "x$withval" != "xyes" ; then
1246 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1247 LDFLAGS="$LDFLAGS -L${withval}/lib"
1248 fi
1249
1250 if test -z "$KRB4" ; then
1251 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1252 fi
1253
1254 LIBS="-lkafs $LIBS"
1255 if test ! -z "$AFS_LIBS" ; then
1256 LIBS="$LIBS $AFS_LIBS"
1257 fi
1258 AC_DEFINE(AFS)
1259 AFS_MSG="yes"
1260 fi
1261 ]
1262)
1263LIBS="$LIBS $KLIBS"
1264
Damien Millera22ba012000-03-02 23:09:20 +11001265# Looking for programs, paths and files
1266AC_ARG_WITH(rsh,
1267 [ --with-rsh=PATH Specify path to remote shell program ],
1268 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001269 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001270 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001271 fi
1272 ],
1273 [
1274 AC_PATH_PROG(rsh_path, rsh)
1275 ]
1276)
1277
1278AC_ARG_WITH(xauth,
1279 [ --with-xauth=PATH Specify path to xauth program ],
1280 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001281 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001282 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001283 fi
1284 ],
1285 [
Damien Miller78315eb2000-09-29 23:01:36 +11001286 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 +10001287 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001288 xauth_path="/usr/openwin/bin/xauth"
1289 fi
1290 ]
1291)
1292
Damien Millera19cf472000-11-29 13:28:50 +11001293if test -z "$xauth_path" ; then
1294 XAUTH_PATH="undefined"
1295 AC_SUBST(XAUTH_PATH)
1296else
Damien Millera22ba012000-03-02 23:09:20 +11001297 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001298 XAUTH_PATH=$xauth_path
1299 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001300fi
1301if test ! -z "$rsh_path" ; then
1302 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1303fi
1304
1305# Check for mail directory (last resort if we cannot get it from headers)
1306if test ! -z "$MAIL" ; then
1307 maildir=`dirname $MAIL`
1308 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1309fi
1310
Damien Millera22ba012000-03-02 23:09:20 +11001311if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001312 AC_CHECK_FILE("/dev/ptmx",
1313 [
1314 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1315 have_dev_ptmx=1
1316 ]
1317 )
Damien Millera22ba012000-03-02 23:09:20 +11001318fi
Damien Miller204ad072000-03-02 23:56:12 +11001319AC_CHECK_FILE("/dev/ptc",
1320 [
1321 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1322 have_dev_ptc=1
1323 ]
1324)
1325
Damien Millera22ba012000-03-02 23:09:20 +11001326# Options from here on. Some of these are preset by platform above
1327
Damien Millera22ba012000-03-02 23:09:20 +11001328# Check for user-specified random device, otherwise check /dev/urandom
1329AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001330 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001331 [
Damien Miller040f3832000-04-03 14:50:43 +10001332 if test "x$withval" != "xno" ; then
1333 RANDOM_POOL="$withval";
1334 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1335 fi
Damien Millera22ba012000-03-02 23:09:20 +11001336 ],
1337 [
1338 # Check for random device
1339 AC_CHECK_FILE("/dev/urandom",
1340 [
1341 RANDOM_POOL="/dev/urandom";
1342 AC_SUBST(RANDOM_POOL)
1343 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1344 ]
1345 )
1346 ]
1347)
1348
Damien Millerd0ccb982001-03-04 00:29:20 +11001349# Check for PRNGD/EGD pool file
1350AC_ARG_WITH(prngd-port,
1351 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1352 [
1353 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1354 PRNGD_PORT="$withval"
1355 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1356 fi
1357 ]
1358)
1359
1360# Check for PRNGD/EGD pool file
1361AC_ARG_WITH(prngd-socket,
1362 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001363 [
Damien Miller040f3832000-04-03 14:50:43 +10001364 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001365 PRNGD_SOCKET="$withval"
1366 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001367 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001368 ],
1369 [
1370 # Check for existing socket only if we don't have a random device already
1371 if test -z "$RANDOM_POOL" ; then
1372 AC_MSG_CHECKING(for PRNGD/EGD socket)
1373 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001374 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001375 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1376 PRNGD_SOCKET="$sock"
1377 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001378 break;
1379 fi
1380 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001381 if test ! -z "$PRNGD_SOCKET" ; then
1382 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001383 else
1384 AC_MSG_RESULT(not found)
1385 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001386 fi
Damien Millera22ba012000-03-02 23:09:20 +11001387 ]
1388)
1389
Damien Miller0736c4d2001-01-25 10:51:46 +11001390
Damien Miller0437b332000-05-02 09:56:41 +10001391# detect pathnames for entropy gathering commands, if we need them
1392INSTALL_SSH_PRNG_CMDS=""
1393rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001394if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001395 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001396 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1397 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1398 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1399 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1400 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1401 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1402 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1403 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1404 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1405 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1406 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1407 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1408 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1409 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001410
1411 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001412fi
Damien Miller0437b332000-05-02 09:56:41 +10001413AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1414
Damien Miller11e37f62000-04-08 18:23:30 +10001415
Damien Miller670a4b82000-01-22 13:53:11 +11001416AC_ARG_WITH(catman,
Damien Miller897741e2001-04-16 10:41:46 +10001417 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001418 [
Damien Miller897741e2001-04-16 10:41:46 +10001419 case "$withval" in
1420 man|cat|doc)
1421 MANTYPE=$withval
1422 ;;
1423 *)
1424 AC_MSG_ERROR(invalid man type: $withval)
1425 ;;
1426 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001427 ]
1428)
Ben Lindstrombc709922001-04-18 18:04:21 +00001429if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001430 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001431 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1432 MANTYPE=doc
1433 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1434 MANTYPE=man
1435 else
1436 MANTYPE=cat
1437 fi
1438fi
Damien Miller670a4b82000-01-22 13:53:11 +11001439AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001440if test "$MANTYPE" = "doc"; then
1441 mansubdir=man;
1442else
1443 mansubdir=$MANTYPE;
1444fi
1445AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001446
Damien Millera22ba012000-03-02 23:09:20 +11001447# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001448MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001449AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001450 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001451 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001452 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001453 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001454 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001455 fi
1456 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001457)
1458
Damien Millera22ba012000-03-02 23:09:20 +11001459# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001460AC_ARG_WITH(shadow,
1461 [ --without-shadow Disable shadow password support],
1462 [
1463 if test "x$withval" = "xno" ; then
1464 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001465 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001466 fi
1467 ]
1468)
1469
Damien Miller1f335fb2000-06-26 11:31:33 +10001470if test -z "$disable_shadow" ; then
1471 AC_MSG_CHECKING([if the systems has expire shadow information])
1472 AC_TRY_COMPILE(
1473 [
1474#include <sys/types.h>
1475#include <shadow.h>
1476 struct spwd sp;
1477 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1478 [ sp_expire_available=yes ], []
1479 )
1480
1481 if test "x$sp_expire_available" = "xyes" ; then
1482 AC_MSG_RESULT(yes)
1483 AC_DEFINE(HAS_SHADOW_EXPIRE)
1484 else
1485 AC_MSG_RESULT(no)
1486 fi
1487fi
1488
Damien Millera22ba012000-03-02 23:09:20 +11001489# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001490if test ! -z "$IPADDR_IN_DISPLAY" ; then
1491 DISPLAY_HACK_MSG="yes"
1492 AC_DEFINE(IPADDR_IN_DISPLAY)
1493else
1494 DISPLAY_HACK_MSG="no"
1495 AC_ARG_WITH(ipaddr-display,
1496 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1497 [
1498 if test "x$withval" != "xno" ; then
1499 AC_DEFINE(IPADDR_IN_DISPLAY)
1500 DISPLAY_HACK_MSG="yes"
1501 fi
1502 ]
1503 )
1504fi
Damien Miller76112de1999-12-21 11:18:08 +11001505
Damien Millera22ba012000-03-02 23:09:20 +11001506# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001507SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001508AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001509 [ --with-default-path=PATH Specify default \$PATH environment for server],
1510 [
1511 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001512 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001513 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001514 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001515 ],
1516 [
1517 AC_TRY_RUN(
1518 [
1519/* find out what STDPATH is */
1520#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001521#ifdef HAVE_PATHS_H
1522# include <paths.h>
1523#endif
1524#ifndef _PATH_STDPATH
1525# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1526#endif
1527#include <sys/types.h>
1528#include <sys/stat.h>
1529#include <fcntl.h>
1530#define DATA "conftest.stdpath"
1531
1532main()
1533{
1534 FILE *fd;
1535 int rc;
1536
1537 fd = fopen(DATA,"w");
1538 if(fd == NULL)
1539 exit(1);
1540
1541 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1542 exit(1);
1543
1544 exit(0);
1545}
1546 ], [ user_path=`cat conftest.stdpath` ],
1547 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1548 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1549 )
1550# make sure $bindir is in USER_PATH so scp will work
1551 t_bindir=`eval echo ${bindir}`
1552 case $t_bindir in
1553 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1554 esac
1555 case $t_bindir in
1556 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1557 esac
1558 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1559 if test $? -ne 0 ; then
1560 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1561 if test $? -ne 0 ; then
1562 user_path=$user_path:$t_bindir
1563 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1564 fi
1565 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001566 ]
1567)
Tim Rice59ea0a02001-03-10 13:50:45 -08001568AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1569AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001570
Damien Millera22ba012000-03-02 23:09:20 +11001571# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001572IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001573AC_ARG_WITH(ipv4-default,
1574 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1575 [
1576 if test "x$withval" != "xno" ; then
1577 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001578 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001579 fi
1580 ]
1581)
1582
Damien Miller61e50f12000-05-08 20:49:37 +10001583AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001584IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001585AC_ARG_WITH(4in6,
1586 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1587 [
1588 if test "x$withval" != "xno" ; then
1589 AC_MSG_RESULT(yes)
1590 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001591 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001592 else
1593 AC_MSG_RESULT(no)
1594 fi
1595 ],[
1596 if test "x$inet6_default_4in6" = "xyes"; then
1597 AC_MSG_RESULT([yes (default)])
1598 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001599 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001600 else
1601 AC_MSG_RESULT([no (default)])
1602 fi
1603 ]
1604)
1605
Damien Miller60396b02001-02-18 17:01:00 +11001606# Whether to enable BSD auth support
1607AC_ARG_WITH(bsd-auth,
1608 [ --with-bsd-auth Enable BSD auth support],
1609 [
1610 if test "x$withval" != "xno" ; then
1611 AC_DEFINE(BSD_AUTH)
1612 bsd_auth=yes
1613 fi
1614 ]
1615)
1616
Damien Miller78315eb2000-09-29 23:01:36 +11001617AC_MSG_CHECKING(whether to install ssh as suid root)
1618AC_ARG_ENABLE(suid-ssh,
1619[ --enable-suid-ssh Install ssh as suid root (default)
1620 --disable-suid-ssh Install ssh without suid bit],
1621[ case "$enableval" in
1622 no)
1623 AC_MSG_RESULT(no)
1624 SSHMODE=0711
1625 ;;
1626 *) AC_MSG_RESULT(yes)
1627 SSHMODE=04711
1628 ;;
1629 esac ],
1630 AC_MSG_RESULT(yes)
1631 SSHMODE=04711
1632)
1633AC_SUBST(SSHMODE)
1634
1635
Damien Millera22ba012000-03-02 23:09:20 +11001636# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001637piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001638AC_ARG_WITH(pid-dir,
1639 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1640 [
1641 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001642 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001643 fi
1644 ]
1645)
Damien Miller4018c192000-04-30 09:30:44 +10001646
Damien Miller78315eb2000-09-29 23:01:36 +11001647# make sure the directory exists
1648if test ! -d $piddir ; then
1649 piddir=`eval echo ${sysconfdir}`
1650 case $piddir in
1651 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1652 esac
1653fi
1654
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001655AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001656AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001657
andre2ff7b5d2000-06-03 14:57:40 +00001658dnl allow user to disable some login recording features
1659AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001660 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001661 [ AC_DEFINE(DISABLE_LASTLOG) ]
1662)
1663AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001664 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001665 [ AC_DEFINE(DISABLE_UTMP) ]
1666)
1667AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001668 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001669 [ AC_DEFINE(DISABLE_UTMPX) ]
1670)
1671AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001672 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001673 [ AC_DEFINE(DISABLE_WTMP) ]
1674)
1675AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001676 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001677 [ AC_DEFINE(DISABLE_WTMPX) ]
1678)
1679AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001680 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001681 [ AC_DEFINE(DISABLE_LOGIN) ]
1682)
1683AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001684 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001685 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1686)
1687AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001688 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001689 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1690)
1691AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001692 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001693 [
1694 if test "x$withval" = "xno" ; then
1695 AC_DEFINE(DISABLE_LASTLOG)
1696 else
1697 conf_lastlog_location=$withval
1698 fi
1699 ]
1700)
andre2ff7b5d2000-06-03 14:57:40 +00001701
1702dnl lastlog, [uw]tmpx? detection
1703dnl NOTE: set the paths in the platform section to avoid the
1704dnl need for command-line parameters
1705dnl lastlog and [uw]tmp are subject to a file search if all else fails
1706
1707dnl lastlog detection
1708dnl NOTE: the code itself will detect if lastlog is a directory
1709AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1710AC_TRY_COMPILE([
1711#include <sys/types.h>
1712#include <utmp.h>
1713#ifdef HAVE_LASTLOG_H
1714# include <lastlog.h>
1715#endif
Damien Miller2994e082000-06-04 15:51:47 +10001716#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001717# include <paths.h>
1718#endif
1719 ],
1720 [ char *lastlog = LASTLOG_FILE; ],
1721 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001722 [
1723 AC_MSG_RESULT(no)
1724 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1725 AC_TRY_COMPILE([
1726#include <sys/types.h>
1727#include <utmp.h>
1728#ifdef HAVE_LASTLOG_H
1729# include <lastlog.h>
1730#endif
1731#ifdef HAVE_PATHS_H
1732# include <paths.h>
1733#endif
1734 ],
1735 [ char *lastlog = _PATH_LASTLOG; ],
1736 [ AC_MSG_RESULT(yes) ],
1737 [
andree441aa32000-06-12 22:34:38 +00001738 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001739 system_lastlog_path=no
1740 ])
1741 ]
andre2ff7b5d2000-06-03 14:57:40 +00001742)
Damien Miller2994e082000-06-04 15:51:47 +10001743
andre2ff7b5d2000-06-03 14:57:40 +00001744if test -z "$conf_lastlog_location"; then
1745 if test x"$system_lastlog_path" = x"no" ; then
1746 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001747 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001748 conf_lastlog_location=$f
1749 fi
1750 done
1751 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001752 AC_MSG_WARN([** Cannot find lastlog **])
1753 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001754 fi
1755 fi
1756fi
1757
1758if test -n "$conf_lastlog_location"; then
1759 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1760fi
1761
1762dnl utmp detection
1763AC_MSG_CHECKING([if your system defines UTMP_FILE])
1764AC_TRY_COMPILE([
1765#include <sys/types.h>
1766#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001767#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001768# include <paths.h>
1769#endif
1770 ],
1771 [ char *utmp = UTMP_FILE; ],
1772 [ AC_MSG_RESULT(yes) ],
1773 [ AC_MSG_RESULT(no)
1774 system_utmp_path=no ]
1775)
1776if test -z "$conf_utmp_location"; then
1777 if test x"$system_utmp_path" = x"no" ; then
1778 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1779 if test -f $f ; then
1780 conf_utmp_location=$f
1781 fi
1782 done
1783 if test -z "$conf_utmp_location"; then
1784 AC_DEFINE(DISABLE_UTMP)
1785 fi
1786 fi
1787fi
1788if test -n "$conf_utmp_location"; then
1789 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1790fi
1791
1792dnl wtmp detection
1793AC_MSG_CHECKING([if your system defines WTMP_FILE])
1794AC_TRY_COMPILE([
1795#include <sys/types.h>
1796#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001797#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001798# include <paths.h>
1799#endif
1800 ],
1801 [ char *wtmp = WTMP_FILE; ],
1802 [ AC_MSG_RESULT(yes) ],
1803 [ AC_MSG_RESULT(no)
1804 system_wtmp_path=no ]
1805)
1806if test -z "$conf_wtmp_location"; then
1807 if test x"$system_wtmp_path" = x"no" ; then
1808 for f in /usr/adm/wtmp /var/log/wtmp; do
1809 if test -f $f ; then
1810 conf_wtmp_location=$f
1811 fi
1812 done
1813 if test -z "$conf_wtmp_location"; then
1814 AC_DEFINE(DISABLE_WTMP)
1815 fi
1816 fi
1817fi
1818if test -n "$conf_wtmp_location"; then
1819 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1820fi
1821
1822
1823dnl utmpx detection - I don't know any system so perverse as to require
1824dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1825dnl there, though.
1826AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1827AC_TRY_COMPILE([
1828#include <sys/types.h>
1829#include <utmp.h>
1830#ifdef HAVE_UTMPX_H
1831#include <utmpx.h>
1832#endif
Damien Miller2994e082000-06-04 15:51:47 +10001833#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001834# include <paths.h>
1835#endif
1836 ],
1837 [ char *utmpx = UTMPX_FILE; ],
1838 [ AC_MSG_RESULT(yes) ],
1839 [ AC_MSG_RESULT(no)
1840 system_utmpx_path=no ]
1841)
1842if test -z "$conf_utmpx_location"; then
1843 if test x"$system_utmpx_path" = x"no" ; then
1844 AC_DEFINE(DISABLE_UTMPX)
1845 fi
1846else
1847 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1848fi
1849
1850dnl wtmpx detection
1851AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1852AC_TRY_COMPILE([
1853#include <sys/types.h>
1854#include <utmp.h>
1855#ifdef HAVE_UTMPX_H
1856#include <utmpx.h>
1857#endif
Damien Miller2994e082000-06-04 15:51:47 +10001858#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001859# include <paths.h>
1860#endif
1861 ],
1862 [ char *wtmpx = WTMPX_FILE; ],
1863 [ AC_MSG_RESULT(yes) ],
1864 [ AC_MSG_RESULT(no)
1865 system_wtmpx_path=no ]
1866)
1867if test -z "$conf_wtmpx_location"; then
1868 if test x"$system_wtmpx_path" = x"no" ; then
1869 AC_DEFINE(DISABLE_WTMPX)
1870 fi
1871else
1872 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1873fi
1874
Damien Miller4018c192000-04-30 09:30:44 +10001875
1876# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001877entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001878AC_ARG_WITH(entropy-timeout,
1879 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1880 [
1881 if test "x$withval" != "xno" ; then
1882 entropy_timeout=$withval
1883 fi
1884 ]
1885)
1886AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1887
1888
Damien Miller29ea30d2000-03-17 10:54:15 +11001889if test ! -z "$blibpath" ; then
1890 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1891 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1892fi
1893
Damien Millerbac2d8a2000-09-05 16:13:06 +11001894AC_EXEEXT
1895
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001896AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001897
Damien Miller7b22d652000-06-18 14:07:04 +10001898# Print summary of options
1899
Damien Miller7b22d652000-06-18 14:07:04 +10001900if test ! -z "$RANDOM_POOL" ; then
1901 RAND_MSG="Device ($RANDOM_POOL)"
1902else
Damien Millerd0ccb982001-03-04 00:29:20 +11001903 if test ! -z "$PRNGD_PORT" ; then
1904 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1905 elif test ! -z "$PRNGD_SOCKET" ; then
1906 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001907 else
1908 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001909 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001910 fi
1911fi
1912
1913# Someone please show me a better way :)
1914A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1915B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1916C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1917D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001918E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00001919F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10001920G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08001921H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10001922
1923echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00001924echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10001925echo " User binaries: $B"
1926echo " System binaries: $C"
1927echo " Configuration files: $D"
1928echo " Askpass program: $E"
1929echo " Manual pages: $F"
1930echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08001931echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10001932echo " Random number collection: $RAND_MSG"
Damien Miller897741e2001-04-16 10:41:46 +10001933echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10001934echo " PAM support: ${PAM_MSG}"
1935echo " KerberosIV support: $KRB4_MSG"
1936echo " AFS support: $AFS_MSG"
1937echo " S/KEY support: $SKEY_MSG"
1938echo " TCP Wrappers support: $TCPW_MSG"
1939echo " MD5 password support: $MD5_MSG"
1940echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1941echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1942echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1943
Damien Miller60396b02001-02-18 17:01:00 +11001944if test ! -z "$bsd_auth"; then
1945 echo " BSD Auth support: yes"
1946fi
1947
Damien Miller7b22d652000-06-18 14:07:04 +10001948echo ""
1949
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001950echo " Host: ${host}"
1951echo " Compiler: ${CC}"
1952echo " Compiler flags: ${CFLAGS}"
1953echo "Preprocessor flags: ${CPPFLAGS}"
1954echo " Linker flags: ${LDFLAGS}"
1955echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10001956
1957echo ""
1958
Damien Miller82cf0ce2000-12-20 13:34:48 +11001959if test "x$PAM_MSG" = "xyes" ; then
1960 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
1961 echo "otherwise password authentication may fail. Example PAM control files"
1962 echo "can be found in the contrib/ subdirectory"
1963 echo ""
1964fi
1965
Damien Miller6f9c3372000-10-25 10:06:04 +11001966if test ! -z "$BUILTIN_RNG" ; then
1967 echo "WARNING: you are using the builtin random number collection service."
1968 echo "Please read WARNING.RNG and request that your OS vendor includes"
1969 echo "/dev/random in future versions of their OS."
1970 echo ""
1971fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001972
1973if test ! -z "$NO_SFTP"; then
1974 echo "sftp-server will be disabled. Your compiler does not support"
1975 echo "64bit integers."
1976 echo ""
1977fi
Damien Miller60396b02001-02-18 17:01:00 +11001978