blob: 982ad5e2040dc27cfe3f067fd41e3a80120d3957 [file] [log] [blame]
Ben Lindstromfed7bb42001-07-15 18:30:42 +00001# $Id: configure.in,v 1.301 2001/07/15 18:30:44 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
Damien Miller166bd442000-03-16 10:48:25 +110044AC_C_INLINE
Damien Miller649d9992001-06-27 23:35:51 +100045if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
46 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
Damien Miller166bd442000-03-16 10:48:25 +110047fi
48
Damien Millera22ba012000-03-02 23:09:20 +110049# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110050case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110051*-*-aix*)
52 AFS_LIBS="-lld"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000053 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +110054 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100055 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110056 blibpath="/usr/lib:/lib:/usr/local/lib"
57 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100058 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110059 AC_DEFINE(BROKEN_GETADDRINFO)
andre60f3c982000-06-03 16:18:19 +000060 dnl AIX handles lastlog as part of its login message
61 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller75b1d102000-01-07 14:01:41 +110062 ;;
Damien Millerbac2d8a2000-09-05 16:13:06 +110063*-*-cygwin*)
Damien Milleref767ac2000-10-17 23:14:08 +110064 LIBS="$LIBS -lregex /usr/lib/textmode.o"
Damien Millerbac2d8a2000-09-05 16:13:06 +110065 AC_DEFINE(HAVE_CYGWIN)
Ben Lindstromca60a9b2001-05-17 03:32:50 +000066 AC_DEFINE(USE_PIPES)
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 ;;
Ben Lindstromfed7bb42001-07-15 18:30:42 +000077*-*-darwin*)
78 AC_DEFINE(BROKEN_GETADDRINFO)
79 ;;
Damien Miller76112de1999-12-21 11:18:08 +110080*-*-hpux10*)
81 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100082 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110083 fi
Kevin Steves315f8b72001-06-28 00:24:41 +000084 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110085 IPADDR_IN_DISPLAY=yes
Damien Millerb0785672000-08-23 09:10:39 +100086 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110087 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110088 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000089 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves315f8b72001-06-28 00:24:41 +000090 LIBS="$LIBS -lxnet -lsec"
Damien Miller76112de1999-12-21 11:18:08 +110091 ;;
Damien Miller1bead332000-04-30 00:47:29 +100092*-*-hpux11*)
Kevin Steves6a7b0de2001-06-27 16:32:24 +000093 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
Damien Miller9a947342000-08-30 10:03:33 +110094 IPADDR_IN_DISPLAY=yes
Damien Miller82cf0ce2000-12-20 13:34:48 +110095 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller5552d7a2000-08-30 09:53:24 +110096 AC_DEFINE(USE_PIPES)
Damien Miller8a1e6a62000-09-16 15:55:52 +110097 AC_DEFINE(DISABLE_SHADOW)
Damien Millerd6f204d2000-09-23 13:57:27 +110098 AC_DEFINE(DISABLE_UTMP)
Kevin Steves8848b242000-10-18 13:11:44 +000099 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
Kevin Steves6a7b0de2001-06-27 16:32:24 +0000100 LIBS="$LIBS -lxnet -lsec"
Damien Miller1bead332000-04-30 00:47:29 +1000101 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +1100102*-*-irix5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000103 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000104 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100105 PATH="$PATH:/usr/etc"
Damien Miller1808f382000-01-06 12:03:12 +1100106 no_libsocket=1
107 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000108 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +1100109 ;;
110*-*-irix6*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000111 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +1000112 LDFLAGS="$LDFLAGS"
Damien Miller190d5a82000-09-30 09:43:19 +1100113 PATH="$PATH:/usr/etc"
Damien Miller91606b12000-06-28 08:22:29 +1000114 AC_DEFINE(WITH_IRIX_ARRAY)
115 AC_DEFINE(WITH_IRIX_PROJECT)
116 AC_DEFINE(WITH_IRIX_AUDIT)
Ben Lindstrom4a1d9162000-11-21 10:45:31 +0000117 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
Damien Millerbeb4ba51999-12-28 15:09:35 +1100118 no_libsocket=1
119 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000120 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100121 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100122*-*-linux*)
123 no_dev_ptmx=1
Damien Millera64b57a2001-01-17 10:44:13 +1100124 check_for_libcrypt_later=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100125 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000126 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100127 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100128 ;;
Ben Lindstromb5628642000-10-18 00:02:25 +0000129mips-sony-bsd|mips-sony-newsos4)
130 AC_DEFINE(HAVE_NEWS4)
131 SONY=1
132 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
Damien Miller5dfe9762001-02-16 12:05:39 +1100133 AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***])
Ben Lindstromb5628642000-10-18 00:02:25 +0000134 )
135 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100136*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100137 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100138 ;;
Damien Millerfbd884a2001-02-27 08:39:07 +1100139*-*-freebsd*)
140 check_for_libcrypt_later=1
141 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000142*-next-*)
Damien Miller0f91b4e2000-06-18 15:43:25 +1000143 conf_lastlog_location="/usr/adm/lastlog"
Damien Millere5192fa2000-08-29 14:30:37 +1100144 conf_utmp_location=/etc/utmp
145 conf_wtmp_location=/usr/adm/wtmp
146 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000147 AC_DEFINE(HAVE_NEXT)
Ben Lindstromb4df15d2000-10-15 00:17:36 +0000148 AC_DEFINE(BROKEN_REALPATH)
Ben Lindstrom76020ba2000-10-25 16:55:00 +0000149 AC_DEFINE(USE_PIPES)
Damien Millerfbd884a2001-02-27 08:39:07 +1100150 AC_DEFINE(BROKEN_SAVED_UIDS)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000151 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom321ae732000-12-31 15:00:23 +0000152 CFLAGS="$CFLAGS"
Damien Miller0f91b4e2000-06-18 15:43:25 +1000153 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100154*-*-solaris*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000155 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Ben Lindstrom866488b2001-02-20 18:22:38 +0000156 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
Damien Millera22ba012000-03-02 23:09:20 +1100157 need_dash_r=1
Damien Miller82cf0ce2000-12-20 13:34:48 +1100158 AC_DEFINE(PAM_SUN_CODEBASE)
Ben Lindstrom97c677d2001-05-08 20:33:05 +0000159 AC_DEFINE(LOGIN_NEEDS_UTMPX)
160 AC_DEFINE(LOGIN_NEEDS_TERM)
andre2ff7b5d2000-06-03 14:57:40 +0000161 # hardwire lastlog location (can't detect it on some versions)
162 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000163 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
164 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
165 if test "$sol2ver" -ge 8; then
166 AC_MSG_RESULT(yes)
167 AC_DEFINE(DISABLE_UTMP)
168 AC_DEFINE(DISABLE_WTMP)
169 else
170 AC_MSG_RESULT(no)
171 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100172 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000173*-*-sunos4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000174 CPPFLAGS="$CPPFLAGS -DSUNOS4"
Damien Millerdfc83f42000-05-20 15:02:59 +1000175 AC_CHECK_FUNCS(getpwanam)
Damien Miller82cf0ce2000-12-20 13:34:48 +1100176 AC_DEFINE(PAM_SUN_CODEBASE)
Damien Miller877d8ea2001-02-18 15:29:28 +1100177 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000178 conf_utmp_location=/etc/utmp
179 conf_wtmp_location=/var/adm/wtmp
180 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000181 AC_DEFINE(USE_PIPES)
Damien Millerdfc83f42000-05-20 15:02:59 +1000182 ;;
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000183*-ncr-sysv*)
184 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
185 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000186 LIBS="$LIBS -lc89 -lnsl -lgen -lsocket"
Ben Lindstrom34328342001-04-23 22:39:42 +0000187 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Ben Lindstrom603bdfd2001-02-12 07:29:45 +0000188 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000189*-sni-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000190 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller2ae714f2000-07-11 09:29:50 +1000191 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
Damien Millerfd9885e2001-01-10 08:16:53 +1100192 IPADDR_IN_DISPLAY=yes
193 AC_DEFINE(USE_PIPES)
Damien Miller2ae714f2000-07-11 09:29:50 +1000194 AC_DEFINE(IP_TOS_IS_BROKEN)
Kevin Steves52dd4682001-03-08 18:26:57 +0000195 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerb2dc28e2000-07-12 09:18:33 +1000196 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000197 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100198*-*-sysv4.2*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000199 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100200 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller78315eb2000-09-29 23:01:36 +1100201 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100202 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100203 ;;
204*-*-sysv5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000205 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100206 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller78315eb2000-09-29 23:01:36 +1100207 enable_suid_ssh=no
Damien Miller5dfe9762001-02-16 12:05:39 +1100208 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100209 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100210*-*-sysv*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000211 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millerdb819592000-03-14 13:44:01 +1100212 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller75b1d102000-01-07 14:01:41 +1100213 LIBS="$LIBS -lgen -lsocket"
214 ;;
Damien Miller78315eb2000-09-29 23:01:36 +1100215*-*-sco3.2v4*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000216 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include"
Damien Miller78315eb2000-09-29 23:01:36 +1100217 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Ben Lindstrom980754c2000-11-12 00:04:24 +0000218 LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm"
Damien Miller78315eb2000-09-29 23:01:36 +1100219 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100220 RANLIB=true
221 no_dev_ptmx=1
222 AC_DEFINE(BROKEN_SYS_TERMIO_H)
223 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100224 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000225 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000226 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Millerfbd884a2001-02-27 08:39:07 +1100227 AC_DEFINE(BROKEN_SAVED_UIDS)
Damien Miller217f5672001-02-16 12:12:41 +1100228 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700229 MANTYPE=man
Damien Miller78315eb2000-09-29 23:01:36 +1100230 ;;
231*-*-sco3.2v5*)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000232 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
Damien Millera66626b2000-06-13 18:57:53 +1000233 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller5dfe9762001-02-16 12:05:39 +1100234 LIBS="$LIBS -lprot -lx -ltinfo -lm"
Damien Millera66626b2000-06-13 18:57:53 +1000235 no_dev_ptmx=1
Damien Miller78315eb2000-09-29 23:01:36 +1100236 rsh_path="/usr/bin/rcmd"
Damien Miller5dfe9762001-02-16 12:05:39 +1100237 AC_DEFINE(USE_PIPES)
Damien Miller78315eb2000-09-29 23:01:36 +1100238 AC_DEFINE(HAVE_SCO_PROTECTED_PW)
Ben Lindstrom980754c2000-11-12 00:04:24 +0000239 AC_DEFINE(DISABLE_SHADOW)
Ben Lindstrom42717bf2000-12-28 15:46:20 +0000240 AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
Damien Miller217f5672001-02-16 12:12:41 +1100241 AC_CHECK_FUNCS(getluid setluid)
Tim Rice07183b82001-04-25 21:40:28 -0700242 MANTYPE=man
Damien Millera66626b2000-06-13 18:57:53 +1000243 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000244*-dec-osf*)
Ben Lindstrom72af2ef2001-05-08 20:42:28 +0000245 AC_MSG_CHECKING(for Digital Unix SIA)
246 no_osfsia=""
247 AC_ARG_WITH(osfsia,
248 [ --with-osfsia Enable Digital Unix SIA],
249 [
250 if test "x$withval" = "xno" ; then
251 AC_MSG_RESULT(disabled)
252 no_osfsia=1
253 fi
254 ],
255 )
256 if test -z "$no_osfsia" ; then
Damien Millerb8c656e2000-06-28 15:22:41 +1000257 if test -f /etc/sia/matrix.conf; then
258 AC_MSG_RESULT(yes)
259 AC_DEFINE(HAVE_OSF_SIA)
260 AC_DEFINE(DISABLE_LOGIN)
261 LIBS="$LIBS -lsecurity -ldb -lm -laud"
262 else
263 AC_MSG_RESULT(no)
264 fi
265 fi
266 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100267esac
268
Damien Millere37bfc12000-06-05 09:37:43 +1000269# Allow user to specify flags
270AC_ARG_WITH(cflags,
271 [ --with-cflags Specify additional flags to pass to compiler],
272 [
273 if test "x$withval" != "xno" ; then
274 CFLAGS="$CFLAGS $withval"
275 fi
276 ]
277)
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000278AC_ARG_WITH(cppflags,
279 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
280 [
281 if test "x$withval" != "xno"; then
282 CPPFLAGS="$CPPFLAGS $withval"
283 fi
284 ]
285)
Damien Millere37bfc12000-06-05 09:37:43 +1000286AC_ARG_WITH(ldflags,
Ben Lindstrom2ed98182000-11-06 07:15:43 +0000287 [ --with-ldflags Specify additional flags to pass to linker],
Damien Millere37bfc12000-06-05 09:37:43 +1000288 [
289 if test "x$withval" != "xno" ; then
290 LDFLAGS="$LDFLAGS $withval"
291 fi
292 ]
293)
294AC_ARG_WITH(libs,
295 [ --with-libs Specify additional libraries to link with],
296 [
297 if test "x$withval" != "xno" ; then
298 LIBS="$LIBS $withval"
299 fi
300 ]
301)
302
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000303AC_ARG_WITH(pcre,
304 [ --with-pcre Override built in regex library with pcre],
305 [
306
307 AC_CHECK_LIB(pcre, pcre_info,
308 [
309 AC_DEFINE(HAVE_LIBPCRE)
310 LIBS="$LIBS -lpcreposix -lpcre"
311 no_comp_check="yes"
312 ],
313 [ AC_MSG_ERROR([*** Can not locate pcre libraries.]) ]
314 )
315 ]
316)
Damien Millere37bfc12000-06-05 09:37:43 +1000317
Damien Millera22ba012000-03-02 23:09:20 +1100318# Checks for libraries.
Damien Miller22d5aa72001-02-18 12:49:57 +1100319if test -z "$no_libnsl" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000320 AC_CHECK_LIB(nsl, yp_match, , )
321fi
Damien Miller22d5aa72001-02-18 12:49:57 +1100322if test -z "$no_libsocket" ; then
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000323 AC_CHECK_LIB(socket, main, , )
324fi
325
Damien Millerdf288022001-02-18 13:07:07 +1100326dnl SCO OS3 needs this for libwrap
327AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
328
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000329AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")
Damien Miller5dfe9762001-02-16 12:05:39 +1100330AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]))
Damien Millerab18c411999-11-11 10:40:23 +1100331AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Miller6f9c3372000-10-25 10:06:04 +1100332
Ben Lindstrom4e5a0aa2001-02-15 18:16:22 +0000333# We don't want to check if we did an pcre override.
334if test -z "$no_comp_check" ; then
335 AC_CHECK_FUNC(regcomp,
336 [ AC_DEFINE(HAVE_REGCOMP)],
337 [
338 AC_CHECK_LIB(pcre, pcre_info,
339 [
340 AC_DEFINE(HAVE_LIBPCRE)
341 LIBS="$LIBS -lpcreposix -lpcre"
342 ],
343 [
344 AC_MSG_ERROR([*** No regex library found.])
345 ])
346 ]
347 )
348fi
Damien Millerab18c411999-11-11 10:40:23 +1100349
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000350dnl UnixWare 2.x
351AC_CHECK_FUNC(strcasecmp,
352 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
353)
354AC_CHECK_FUNC(utimes,
355 [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ]
356)
Damien Millerab18c411999-11-11 10:40:23 +1100357
Ben Lindstrom8697e082001-02-24 21:41:10 +0000358AC_FUNC_STRFTIME
359
Damien Millera22ba012000-03-02 23:09:20 +1100360# Checks for header files.
Ben Lindstrom68c3ce12001-06-10 17:24:51 +0000361AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h getopt.h glob.h lastlog.h libgen.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 +1100362
363# Check for ALTDIRFUNC glob() extension
364AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
365AC_EGREP_CPP(FOUNDIT,
366 [
367 #include <glob.h>
368 #ifdef GLOB_ALTDIRFUNC
369 FOUNDIT
370 #endif
371 ],
372 [
373 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
374 AC_MSG_RESULT(yes)
375 ],
376 [
377 AC_MSG_RESULT(no)
378 ]
379)
Damien Millerab18c411999-11-11 10:40:23 +1100380
Ben Lindstrom45b14db2001-03-17 01:15:38 +0000381# Check for g.gl_matchc glob() extension
382AC_MSG_CHECKING(for gl_matchc field in glob_t)
383AC_EGREP_CPP(FOUNDIT,
384 [
385 #include <glob.h>
386 int main(void){glob_t g; g.gl_matchc = 1;}
387 ],
388 [
389 AC_DEFINE(GLOB_HAS_GL_MATCHC)
390 AC_MSG_RESULT(yes)
391 ],
392 [
393 AC_MSG_RESULT(no)
394 ]
395)
396
Damien Miller18bb4732001-03-28 14:35:30 +1000397AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
398AC_TRY_RUN(
399 [
400#include <sys/types.h>
401#include <dirent.h>
402int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));}
403 ],
404 [AC_MSG_RESULT(yes)],
405 [
406 AC_MSG_RESULT(no)
407 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
408 ]
409)
410
Damien Millerc547bf12001-02-16 10:18:12 +1100411# Check whether user wants S/Key support
412SKEY_MSG="no"
413AC_ARG_WITH(skey,
414 [ --with-skey=PATH Enable S/Key support],
415 [
416 if test "x$withval" != "xno" ; then
417
418 if test "x$withval" != "xyes" ; then
419 CPPFLAGS="$CPPFLAGS -I${withval}/include"
420 LDFLAGS="$LDFLAGS -L${withval}/lib"
421 fi
422
423 AC_DEFINE(SKEY)
424 LIBS="-lskey $LIBS"
425 SKEY_MSG="yes"
426
427 AC_CHECK_FUNC(skey_keyinfo,
428 [],
429 [
430 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
431 ])
432 fi
433 ]
434)
435
436# Check whether user wants TCP wrappers support
437TCPW_MSG="no"
438AC_ARG_WITH(tcp-wrappers,
439 [ --with-tcp-wrappers Enable tcpwrappers support],
440 [
441 if test "x$withval" != "xno" ; then
442 saved_LIBS="$LIBS"
443 LIBS="-lwrap $LIBS"
444 AC_MSG_CHECKING(for libwrap)
445 AC_TRY_LINK(
446 [
447#include <tcpd.h>
448 int deny_severity = 0, allow_severity = 0;
449 ],
450 [hosts_access(0);],
451 [
452 AC_MSG_RESULT(yes)
453 AC_DEFINE(LIBWRAP)
454 TCPW_MSG="yes"
455 ],
456 [
457 AC_MSG_ERROR([*** libwrap missing])
458 ]
459 )
460 fi
461 ]
462)
463
Damien Millerad833b32000-08-23 10:46:23 +1000464dnl Checks for library functions.
Damien Miller4f8e6692001-07-14 13:22:53 +1000465AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock dirname fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getopt getnameinfo getrlimit getrusage getttyent glob inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty readpassphrase realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid setvbuf sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
Damien Millerad833b32000-08-23 10:46:23 +1000466dnl Checks for time functions
andre2ff7b5d2000-06-03 14:57:40 +0000467AC_CHECK_FUNCS(gettimeofday time)
Damien Millerad833b32000-08-23 10:46:23 +1000468dnl Checks for libutil functions
Ben Lindstrome2fb8d32000-12-28 00:07:07 +0000469AC_CHECK_HEADERS(libutil.h)
andre2ff7b5d2000-06-03 14:57:40 +0000470AC_CHECK_FUNCS(login logout updwtmp logwtmp)
Damien Millerad833b32000-08-23 10:46:23 +1000471dnl Checks for utmp functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000472AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
andre2ff7b5d2000-06-03 14:57:40 +0000473AC_CHECK_FUNCS(utmpname)
Damien Millerad833b32000-08-23 10:46:23 +1000474dnl Checks for utmpx functions
Ben Lindstrom2c467a22000-12-27 04:57:41 +0000475AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
andre2ff7b5d2000-06-03 14:57:40 +0000476AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100477
Damien Miller5fc85652000-07-09 23:53:07 +1000478AC_CHECK_FUNC(getuserattr,
479 [AC_DEFINE(HAVE_GETUSERATTR)],
480 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
481)
482
Damien Miller04f80141999-11-19 15:32:34 +1100483AC_CHECK_FUNC(login,
484 [AC_DEFINE(HAVE_LOGIN)],
485 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
486)
487
488AC_CHECK_FUNC(daemon,
489 [AC_DEFINE(HAVE_DAEMON)],
490 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
491)
492
Damien Miller9fb07e42000-03-05 16:22:59 +1100493AC_CHECK_FUNC(getpagesize,
494 [AC_DEFINE(HAVE_GETPAGESIZE)],
495 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
496)
497
Damien Millercb170cb2000-07-01 16:52:55 +1000498# Check for broken snprintf
499if test "x$ac_cv_func_snprintf" = "xyes" ; then
500 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
501 AC_TRY_RUN(
502 [
503#include <stdio.h>
504int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
505 ],
506 [AC_MSG_RESULT(yes)],
507 [
508 AC_MSG_RESULT(no)
509 AC_DEFINE(BROKEN_SNPRINTF)
510 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
511 ]
512 )
513fi
514
Damien Miller606f8802000-09-16 15:39:56 +1100515AC_FUNC_GETPGRP
516
Damien Millera64b57a2001-01-17 10:44:13 +1100517# Check for PAM libs
Damien Miller7b22d652000-06-18 14:07:04 +1000518PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100519AC_ARG_WITH(pam,
Damien Millera64b57a2001-01-17 10:44:13 +1100520 [ --with-pam Enable PAM support ],
Damien Millera22ba012000-03-02 23:09:20 +1100521 [
Damien Millera64b57a2001-01-17 10:44:13 +1100522 if test "x$withval" != "xno" ; then
523 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
524 AC_MSG_ERROR([PAM headers not found])
525 fi
526
527 AC_CHECK_LIB(dl, dlopen, , )
528 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
529 AC_CHECK_FUNCS(pam_getenvlist)
530
531 disable_shadow=yes
532 PAM_MSG="yes"
533
534 AC_DEFINE(USE_PAM)
Damien Millera22ba012000-03-02 23:09:20 +1100535 fi
536 ]
537)
Damien Millera22ba012000-03-02 23:09:20 +1100538
Damien Millera64b57a2001-01-17 10:44:13 +1100539# Check for older PAM
540if test "x$PAM_MSG" = "xyes" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100541 # Check PAM strerror arguments (old PAM)
542 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
543 AC_TRY_COMPILE(
544 [
Damien Miller81171112000-04-23 11:14:01 +1000545#include <stdlib.h>
546#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100547 ],
548 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
549 [AC_MSG_RESULT(no)],
550 [
551 AC_DEFINE(HAVE_OLD_PAM)
552 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000553 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100554 ]
Damien Millera64b57a2001-01-17 10:44:13 +1100555 )
Damien Millera22ba012000-03-02 23:09:20 +1100556fi
557
558# The big search for OpenSSL
559AC_ARG_WITH(ssl-dir,
560 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
561 [
Ben Lindstrom23e13712000-10-29 22:49:19 +0000562 if test "x$withval" != "xno" ; then
Damien Millera22ba012000-03-02 23:09:20 +1100563 tryssldir=$withval
564 fi
565 ]
566)
567
568saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100569saved_LDFLAGS="$LDFLAGS"
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +0000570saved_CPPFLAGS="$CPPFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100571if test "x$prefix" != "xNONE" ; then
572 tryssldir="$tryssldir $prefix"
573fi
Damien Miller61e50f12000-05-08 20:49:37 +1000574AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera1b61e12000-09-16 17:02:16 +1100575 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 +1100576 CPPFLAGS="$saved_CPPFLAGS"
577 LDFLAGS="$saved_LDFLAGS"
Damien Miller3b512e12000-05-17 23:29:18 +1000578 LIBS="$saved_LIBS -lcrypto"
Damien Millerccdefb62001-02-19 12:56:39 +1100579
580 # Skip directories if they don't exist
581 if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
582 continue;
583 fi
584 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
585 # Try to use $ssldir/lib if it exists, otherwise
586 # $ssldir
587 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000588 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100589 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000590 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100591 fi
592 else
Damien Millerb68af622001-03-28 21:05:26 +1000593 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100594 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000595 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100596 fi
597 fi
598 # Try to use $ssldir/include if it exists, otherwise
599 # $ssldir
600 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000601 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100602 else
Damien Millerb68af622001-03-28 21:05:26 +1000603 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100604 fi
605 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000606
Damien Miller3b512e12000-05-17 23:29:18 +1000607 # Basic test to check for compatible version and correct linking
608 # *does not* test for RSA - that comes later.
609 AC_TRY_RUN(
610 [
Damien Millere59ce622000-05-01 20:54:17 +1000611#include <string.h>
612#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000613int main(void)
614{
Damien Miller3b512e12000-05-17 23:29:18 +1000615 char a[2048];
616 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000617 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000618 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000619}
Damien Miller3b512e12000-05-17 23:29:18 +1000620 ],
621 [
622 found_crypto=1
623 break;
624 ], []
625 )
Damien Miller61e50f12000-05-08 20:49:37 +1000626
627 if test ! -z "$found_crypto" ; then
628 break;
629 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100630 done
631
Damien Miller61e50f12000-05-08 20:49:37 +1000632 if test -z "$found_crypto" ; then
Damien Miller5dfe9762001-02-16 12:05:39 +1100633 AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
Damien Millerb85dcad2000-03-11 11:37:00 +1100634 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000635 if test -z "$ssldir" ; then
636 ssldir="(system)"
637 fi
Damien Millera22ba012000-03-02 23:09:20 +1100638
Damien Miller61e50f12000-05-08 20:49:37 +1000639 ac_cv_openssldir=$ssldir
640])
641
Damien Milleredb82922000-06-20 13:25:52 +1000642if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000643 AC_DEFINE(HAVE_OPENSSL)
644 dnl Need to recover ssldir - test above runs in subshell
645 ssldir=$ac_cv_openssldir
Damien Millera64b57a2001-01-17 10:44:13 +1100646 if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
Damien Millerccdefb62001-02-19 12:56:39 +1100647 # Try to use $ssldir/lib if it exists, otherwise
648 # $ssldir
649 if test -d "$ssldir/lib" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000650 LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100651 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000652 LDFLAGS="-R$ssldir/lib $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100653 fi
654 else
Damien Millerb68af622001-03-28 21:05:26 +1000655 LDFLAGS="-L$ssldir $saved_LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100656 if test ! -z "$need_dash_r" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000657 LDFLAGS="-R$ssldir $LDFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100658 fi
Damien Millera64b57a2001-01-17 10:44:13 +1100659 fi
Damien Millerccdefb62001-02-19 12:56:39 +1100660 # Try to use $ssldir/include if it exists, otherwise
661 # $ssldir
662 if test -d "$ssldir/include" ; then
Damien Millerb68af622001-03-28 21:05:26 +1000663 CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
Damien Millerccdefb62001-02-19 12:56:39 +1100664 else
Damien Millerb68af622001-03-28 21:05:26 +1000665 CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
Damien Millera64b57a2001-01-17 10:44:13 +1100666 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100667 fi
Damien Millera22ba012000-03-02 23:09:20 +1100668fi
Damien Miller3b512e12000-05-17 23:29:18 +1000669LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000670
Damien Miller3b512e12000-05-17 23:29:18 +1000671# Now test RSA support
672saved_LIBS="$LIBS"
673AC_MSG_CHECKING([for RSA support])
674for WANTS_RSAREF in "" 1 ; do
675 if test -z "$WANTS_RSAREF" ; then
676 LIBS="$saved_LIBS"
677 else
678 LIBS="$saved_LIBS -lRSAglue -lrsaref"
679 fi
680 AC_TRY_RUN([
681#include <string.h>
682#include <openssl/rand.h>
683#include <openssl/rsa.h>
684#include <openssl/bn.h>
685#include <openssl/sha.h>
686int main(void)
687{
688 int num; RSA *key; static unsigned char p_in[] = "blahblah";
689 unsigned char c[256], p[256];
690 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
691 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
692 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
693 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
694}
695 ],
696 [
697 rsa_works=1
698 break;
699 ], [])
700done
Ben Lindstrom23fec142001-06-09 02:16:28 +0000701LIBS="$saved_LIBS"
Damien Miller3b512e12000-05-17 23:29:18 +1000702
703if test ! -z "$no_rsa" ; then
704 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000705 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000706else
707 if test -z "$rsa_works" ; then
708 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000709 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000710 else
711 if test -z "$WANTS_RSAREF" ; then
712 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000713 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000714 else
Damien Miller7b22d652000-06-18 14:07:04 +1000715 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000716 AC_MSG_RESULT(using RSAref)
Ben Lindstrom23fec142001-06-09 02:16:28 +0000717 LIBS="$LIBS -lcrypto -lRSAglue -lrsaref"
Damien Miller3b512e12000-05-17 23:29:18 +1000718 fi
719 fi
720fi
Damien Millera22ba012000-03-02 23:09:20 +1100721
Damien Millera64b57a2001-01-17 10:44:13 +1100722# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
723# version in OpenSSL. Skip this for PAM
724if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then
Damien Miller95aa2d62001-03-01 09:16:11 +1100725 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
Damien Millera64b57a2001-01-17 10:44:13 +1100726fi
727
Ben Lindstromb5628642000-10-18 00:02:25 +0000728# Cheap hack to ensure NEWS-OS libraries are arranged right.
729if test ! -z "$SONY" ; then
730 LIBS="$LIBS -liberty";
731fi
732
Damien Millera22ba012000-03-02 23:09:20 +1100733# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100734AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100735AC_CHECK_SIZEOF(short int, 2)
736AC_CHECK_SIZEOF(int, 4)
737AC_CHECK_SIZEOF(long int, 4)
738AC_CHECK_SIZEOF(long long int, 8)
739
Damien Millera22ba012000-03-02 23:09:20 +1100740# More checks for data types
Damien Millercaf6dd62000-08-29 11:33:50 +1100741AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
742 AC_TRY_COMPILE(
743 [ #include <sys/types.h> ],
744 [ u_int a; a = 1;],
745 [ ac_cv_have_u_int="yes" ],
746 [ ac_cv_have_u_int="no" ]
747 )
748])
749if test "x$ac_cv_have_u_int" = "xyes" ; then
750 AC_DEFINE(HAVE_U_INT)
751 have_u_int=1
752fi
753
Damien Miller61e50f12000-05-08 20:49:37 +1000754AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
755 AC_TRY_COMPILE(
756 [ #include <sys/types.h> ],
757 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
758 [ ac_cv_have_intxx_t="yes" ],
759 [ ac_cv_have_intxx_t="no" ]
760 )
761])
762if test "x$ac_cv_have_intxx_t" = "xyes" ; then
763 AC_DEFINE(HAVE_INTXX_T)
764 have_intxx_t=1
765fi
766
Damien Miller578783e2000-09-23 14:12:24 +1100767AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
768 AC_TRY_COMPILE(
769 [ #include <sys/types.h> ],
770 [ int64_t a; a = 1;],
771 [ ac_cv_have_int64_t="yes" ],
772 [ ac_cv_have_int64_t="no" ]
773 )
774])
775if test "x$ac_cv_have_int64_t" = "xyes" ; then
776 AC_DEFINE(HAVE_INT64_T)
777 have_int64_t=1
778fi
779
Damien Miller61e50f12000-05-08 20:49:37 +1000780AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
781 AC_TRY_COMPILE(
782 [ #include <sys/types.h> ],
783 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
784 [ ac_cv_have_u_intxx_t="yes" ],
785 [ ac_cv_have_u_intxx_t="no" ]
786 )
787])
788if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
789 AC_DEFINE(HAVE_U_INTXX_T)
790 have_u_intxx_t=1
791fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100792
Damien Miller578783e2000-09-23 14:12:24 +1100793AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
794 AC_TRY_COMPILE(
795 [ #include <sys/types.h> ],
796 [ u_int64_t a; a = 1;],
797 [ ac_cv_have_u_int64_t="yes" ],
798 [ ac_cv_have_u_int64_t="no" ]
799 )
800])
801if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
802 AC_DEFINE(HAVE_U_INT64_T)
803 have_u_int64_t=1
804fi
805
Damien Milleredb82922000-06-20 13:25:52 +1000806if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
807 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100808then
809 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
810 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000811 [
812#include <sys/bitypes.h>
813 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100814 [
Damien Miller70494d12000-04-03 15:57:06 +1000815 int8_t a; int16_t b; int32_t c;
816 u_int8_t e; u_int16_t f; u_int32_t g;
817 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100818 ],
819 [
820 AC_DEFINE(HAVE_U_INTXX_T)
821 AC_DEFINE(HAVE_INTXX_T)
822 AC_MSG_RESULT(yes)
823 ],
824 [AC_MSG_RESULT(no)]
825 )
826fi
827
Damien Millerd6121d22000-03-17 23:26:46 +1100828if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000829 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
830 AC_TRY_COMPILE(
831 [
832#include <sys/types.h>
833 ],
834 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
835 [ ac_cv_have_uintxx_t="yes" ],
836 [ ac_cv_have_uintxx_t="no" ]
837 )
838 ])
839 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
840 AC_DEFINE(HAVE_UINTXX_T)
841 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100842fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100843
Damien Miller61e50f12000-05-08 20:49:37 +1000844AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
845 AC_TRY_COMPILE(
846 [
Damien Miller81171112000-04-23 11:14:01 +1000847#include <sys/types.h>
848#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000849 ],
850 [socklen_t foo; foo = 1235;],
851 [ ac_cv_have_socklen_t="yes" ],
852 [ ac_cv_have_socklen_t="no" ]
853 )
854])
855if test "x$ac_cv_have_socklen_t" = "xyes" ; then
856 AC_DEFINE(HAVE_SOCKLEN_T)
857fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100858
Damien Miller61e50f12000-05-08 20:49:37 +1000859AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
860 AC_TRY_COMPILE(
861 [
862#include <sys/types.h>
863 ],
864 [ size_t foo; foo = 1235; ],
865 [ ac_cv_have_size_t="yes" ],
866 [ ac_cv_have_size_t="no" ]
867 )
868])
869if test "x$ac_cv_have_size_t" = "xyes" ; then
870 AC_DEFINE(HAVE_SIZE_T)
871fi
Damien Miller95058511999-12-29 10:36:45 +1100872
Damien Miller615f9392000-05-17 22:53:33 +1000873AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
874 AC_TRY_COMPILE(
875 [
876#include <sys/types.h>
877 ],
878 [ ssize_t foo; foo = 1235; ],
879 [ ac_cv_have_ssize_t="yes" ],
880 [ ac_cv_have_ssize_t="no" ]
881 )
882])
883if test "x$ac_cv_have_ssize_t" = "xyes" ; then
884 AC_DEFINE(HAVE_SSIZE_T)
885fi
886
Ben Lindstrom0d5af602001-01-09 00:50:29 +0000887AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
888 AC_TRY_COMPILE(
889 [
890#include <time.h>
891 ],
892 [ clock_t foo; foo = 1235; ],
893 [ ac_cv_have_clock_t="yes" ],
894 [ ac_cv_have_clock_t="no" ]
895 )
896])
897if test "x$ac_cv_have_clock_t" = "xyes" ; then
898 AC_DEFINE(HAVE_CLOCK_T)
899fi
900
Damien Millerb54b40e2000-06-23 08:23:34 +1000901AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
902 AC_TRY_COMPILE(
903 [
904#include <sys/types.h>
905#include <sys/socket.h>
906 ],
907 [ sa_family_t foo; foo = 1235; ],
908 [ ac_cv_have_sa_family_t="yes" ],
Damien Miller78315eb2000-09-29 23:01:36 +1100909 [ AC_TRY_COMPILE(
910 [
911#include <sys/types.h>
912#include <sys/socket.h>
913#include <netinet/in.h>
914 ],
915 [ sa_family_t foo; foo = 1235; ],
916 [ ac_cv_have_sa_family_t="yes" ],
917
Damien Millerb54b40e2000-06-23 08:23:34 +1000918 [ ac_cv_have_sa_family_t="no" ]
Damien Miller78315eb2000-09-29 23:01:36 +1100919 )]
Damien Millerb54b40e2000-06-23 08:23:34 +1000920 )
921])
922if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
923 AC_DEFINE(HAVE_SA_FAMILY_T)
924fi
925
Damien Miller0f91b4e2000-06-18 15:43:25 +1000926AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
927 AC_TRY_COMPILE(
928 [
929#include <sys/types.h>
930 ],
931 [ pid_t foo; foo = 1235; ],
932 [ ac_cv_have_pid_t="yes" ],
933 [ ac_cv_have_pid_t="no" ]
934 )
935])
936if test "x$ac_cv_have_pid_t" = "xyes" ; then
937 AC_DEFINE(HAVE_PID_T)
938fi
939
940AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
941 AC_TRY_COMPILE(
942 [
943#include <sys/types.h>
944 ],
945 [ mode_t foo; foo = 1235; ],
946 [ ac_cv_have_mode_t="yes" ],
947 [ ac_cv_have_mode_t="no" ]
948 )
949])
950if test "x$ac_cv_have_mode_t" = "xyes" ; then
951 AC_DEFINE(HAVE_MODE_T)
952fi
953
Damien Miller61e50f12000-05-08 20:49:37 +1000954
955AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
956 AC_TRY_COMPILE(
957 [
Damien Miller81171112000-04-23 11:14:01 +1000958#include <sys/types.h>
959#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000960 ],
961 [ struct sockaddr_storage s; ],
962 [ ac_cv_have_struct_sockaddr_storage="yes" ],
963 [ ac_cv_have_struct_sockaddr_storage="no" ]
964 )
965])
966if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
967 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
968fi
Damien Miller34132e52000-01-14 15:45:46 +1100969
Damien Miller61e50f12000-05-08 20:49:37 +1000970AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
971 AC_TRY_COMPILE(
972 [
Damien Miller7b22d652000-06-18 14:07:04 +1000973#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000974#include <netinet/in.h>
975 ],
976 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
977 [ ac_cv_have_struct_sockaddr_in6="yes" ],
978 [ ac_cv_have_struct_sockaddr_in6="no" ]
979 )
980])
981if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
982 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
983fi
Damien Miller34132e52000-01-14 15:45:46 +1100984
Damien Miller61e50f12000-05-08 20:49:37 +1000985AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
986 AC_TRY_COMPILE(
987 [
Damien Miller7b22d652000-06-18 14:07:04 +1000988#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000989#include <netinet/in.h>
990 ],
991 [ struct in6_addr s; s.s6_addr[0] = 0; ],
992 [ ac_cv_have_struct_in6_addr="yes" ],
993 [ ac_cv_have_struct_in6_addr="no" ]
994 )
995])
996if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
997 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
998fi
Damien Miller34132e52000-01-14 15:45:46 +1100999
Damien Miller61e50f12000-05-08 20:49:37 +10001000AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1001 AC_TRY_COMPILE(
1002 [
Damien Miller81171112000-04-23 11:14:01 +10001003#include <sys/types.h>
1004#include <sys/socket.h>
1005#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001006 ],
1007 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1008 [ ac_cv_have_struct_addrinfo="yes" ],
1009 [ ac_cv_have_struct_addrinfo="no" ]
1010 )
1011])
1012if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1013 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1014fi
1015
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001016AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1017 AC_TRY_COMPILE(
1018 [ #include <sys/time.h> ],
1019 [ struct timeval tv; tv.tv_sec = 1;],
1020 [ ac_cv_have_struct_timeval="yes" ],
1021 [ ac_cv_have_struct_timeval="no" ]
1022 )
1023])
1024if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1025 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1026 have_struct_timeval=1
1027fi
1028
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001029# If we don't have int64_t then we can't compile sftp-server. So don't
1030# even attempt to do it.
1031if test "x$ac_cv_have_int64_t" = "xno" -a \
1032 "x$ac_cv_sizeof_long_int" != "x8" -a \
1033 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1034 NO_SFTP='#'
Tim Ricebee3f222001-03-11 17:32:12 -08001035else
1036dnl test snprintf (broken on SCO w/gcc)
1037 AC_TRY_RUN(
1038 [
1039#include <stdio.h>
1040#include <string.h>
1041#ifdef HAVE_SNPRINTF
1042main()
1043{
1044 char buf[50];
1045 char expected_out[50];
1046 int mazsize = 50 ;
1047#if (SIZEOF_LONG_INT == 8)
1048 long int num = 0x7fffffffffffffff;
1049#else
Kevin Steves6482ec82001-07-15 02:09:28 +00001050 long long num = 0x7fffffffffffffffll;
Tim Ricebee3f222001-03-11 17:32:12 -08001051#endif
1052 strcpy(expected_out, "9223372036854775807");
1053 snprintf(buf, mazsize, "%lld", num);
1054 if(strcmp(buf, expected_out) != 0)
1055 exit(1);
1056 exit(0);
1057}
1058#else
1059main() { exit(0); }
1060#endif
1061 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1062 )
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001063fi
Ben Lindstrom42202bc2001-01-15 02:34:37 +00001064AC_SUBST(NO_SFTP)
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00001065
Damien Miller78315eb2000-09-29 23:01:36 +11001066dnl Checks for structure members
Damien Miller61e50f12000-05-08 20:49:37 +10001067OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1068OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1069OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1070OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1071OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +10001072OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001073OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1074OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +10001075OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +10001076OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1077OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1078OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1079OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +00001080OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1081OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1082OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1083OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
Damien Miller78315eb2000-09-29 23:01:36 +11001084AC_STRUCT_ST_BLKSIZE
andre2ff7b5d2000-06-03 14:57:40 +00001085
Damien Miller942da032000-08-18 13:59:06 +10001086AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
1087 ac_cv_have_sun_len_in_struct_sockaddr_un, [
1088 AC_TRY_COMPILE(
1089 [
1090#include <sys/types.h>
1091#include <sys/socket.h>
1092 ],
1093 [ struct sockaddr_un s; s.sun_len = 1; ],
1094 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
1095 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
1096 )
1097])
1098if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
1099 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
1100fi
1101
Damien Miller61e50f12000-05-08 20:49:37 +10001102AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1103 ac_cv_have_ss_family_in_struct_ss, [
1104 AC_TRY_COMPILE(
1105 [
Damien Miller81171112000-04-23 11:14:01 +10001106#include <sys/types.h>
1107#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001108 ],
1109 [ struct sockaddr_storage s; s.ss_family = 1; ],
1110 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1111 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1112 )
1113])
1114if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1115 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1116fi
1117
Damien Miller61e50f12000-05-08 20:49:37 +10001118AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1119 ac_cv_have___ss_family_in_struct_ss, [
1120 AC_TRY_COMPILE(
1121 [
Damien Miller81171112000-04-23 11:14:01 +10001122#include <sys/types.h>
1123#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +10001124 ],
1125 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1126 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1127 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1128 )
1129])
1130if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1131 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1132fi
Damien Millerbf1c9b21999-12-09 10:16:54 +11001133
Damien Millerad833b32000-08-23 10:46:23 +10001134AC_CACHE_CHECK([for pw_class field in struct passwd],
1135 ac_cv_have_pw_class_in_struct_passwd, [
1136 AC_TRY_COMPILE(
1137 [
Damien Millerad833b32000-08-23 10:46:23 +10001138#include <pwd.h>
1139 ],
Kevin Steves48b7cc02000-10-07 13:24:00 +00001140 [ struct passwd p; p.pw_class = 0; ],
Damien Millerad833b32000-08-23 10:46:23 +10001141 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1142 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1143 )
1144])
1145if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1146 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1147fi
1148
Kevin Steves82456952001-06-22 21:14:18 +00001149AC_CACHE_CHECK([for pw_expire field in struct passwd],
1150 ac_cv_have_pw_expire_in_struct_passwd, [
1151 AC_TRY_COMPILE(
1152 [
1153#include <pwd.h>
1154 ],
1155 [ struct passwd p; p.pw_expire = 0; ],
1156 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1157 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1158 )
1159])
1160if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1161 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1162fi
1163
1164AC_CACHE_CHECK([for pw_change field in struct passwd],
1165 ac_cv_have_pw_change_in_struct_passwd, [
1166 AC_TRY_COMPILE(
1167 [
1168#include <pwd.h>
1169 ],
1170 [ struct passwd p; p.pw_change = 0; ],
1171 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1172 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1173 )
1174])
1175if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1176 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1177fi
Damien Miller61e50f12000-05-08 20:49:37 +10001178
1179AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1180 AC_TRY_LINK([],
1181 [ extern char *__progname; printf("%s", __progname); ],
1182 [ ac_cv_libc_defines___progname="yes" ],
1183 [ ac_cv_libc_defines___progname="no" ]
1184 )
1185])
1186if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1187 AC_DEFINE(HAVE___PROGNAME)
1188fi
1189
Damien Miller4f8e6692001-07-14 13:22:53 +10001190AC_CACHE_CHECK([whether getopt has optreset support],
1191 ac_cv_have_getopt_optreset, [
1192 AC_TRY_LINK(
1193 [
1194#include <getopt.h>
1195 ],
1196 [ extern int optreset; optreset = 0; ],
1197 [ ac_cv_have_getopt_optreset="yes" ],
1198 [ ac_cv_have_getopt_optreset="no" ]
1199 )
1200])
1201if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1202 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1203fi
Damien Millera22ba012000-03-02 23:09:20 +11001204
Damien Millerecbb26d2000-07-15 14:59:14 +10001205AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1206 AC_TRY_LINK([],
1207 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1208 [ ac_cv_libc_defines_sys_errlist="yes" ],
1209 [ ac_cv_libc_defines_sys_errlist="no" ]
1210 )
1211])
1212if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1213 AC_DEFINE(HAVE_SYS_ERRLIST)
1214fi
1215
1216
Damien Miller11fa2cc2000-08-16 10:35:58 +10001217AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1218 AC_TRY_LINK([],
1219 [ extern int sys_nerr; printf("%i", sys_nerr);],
1220 [ ac_cv_libc_defines_sys_nerr="yes" ],
1221 [ ac_cv_libc_defines_sys_nerr="no" ]
1222 )
1223])
1224if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1225 AC_DEFINE(HAVE_SYS_NERR)
1226fi
1227
1228
Damien Millerc79bc0d2001-03-28 13:03:42 +10001229# Check whether user wants Kerberos support
1230KRB4_MSG="no"
1231AC_ARG_WITH(kerberos4,
1232 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1233 [
1234 if test "x$withval" != "xno" ; then
1235
1236 if test "x$withval" != "xyes" ; then
1237 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1238 LDFLAGS="$LDFLAGS -L${withval}/lib"
1239 if test ! -z "$need_dash_r" ; then
1240 LDFLAGS="$LDFLAGS -R${withval}/lib"
1241 fi
1242 if test ! -z "$blibpath" ; then
1243 blibpath="$blibpath:${withval}/lib"
1244 fi
1245 else
1246 if test -d /usr/include/kerberosIV ; then
1247 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1248 fi
1249 fi
1250
1251 AC_CHECK_HEADERS(krb.h)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001252 if test "$ac_cv_header_krb_h" != yes; then
1253 AC_MSG_WARN([Cannot find krb.h, build may fail])
1254 fi
Damien Miller98344742001-03-28 14:37:06 +10001255 AC_CHECK_LIB(krb, main)
Damien Millerc79bc0d2001-03-28 13:03:42 +10001256 if test "$ac_cv_lib_krb_main" != yes; then
Damien Miller98344742001-03-28 14:37:06 +10001257 AC_CHECK_LIB(krb4, main)
1258 if test "$ac_cv_lib_krb4_main" != yes; then
1259 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1260 else
1261 KLIBS="-lkrb4"
1262 fi
1263 else
1264 KLIBS="-lkrb"
Damien Millerc79bc0d2001-03-28 13:03:42 +10001265 fi
Damien Miller98344742001-03-28 14:37:06 +10001266 AC_CHECK_LIB(des, des_cbc_encrypt)
1267 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1268 AC_CHECK_LIB(des425, des_cbc_encrypt)
1269 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1270 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1271 else
1272 KLIBS="-ldes425"
1273 fi
1274 else
1275 KLIBS="-ldes"
1276 fi
Damien Millerc79bc0d2001-03-28 13:03:42 +10001277 AC_CHECK_LIB(resolv, dn_expand, , )
1278 KRB4=yes
1279 KRB4_MSG="yes"
1280 AC_DEFINE(KRB4)
1281 fi
1282 ]
1283)
1284
1285# Check whether user wants AFS support
1286AFS_MSG="no"
1287AC_ARG_WITH(afs,
1288 [ --with-afs=PATH Enable AFS support],
1289 [
1290 if test "x$withval" != "xno" ; then
1291
1292 if test "x$withval" != "xyes" ; then
1293 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1294 LDFLAGS="$LDFLAGS -L${withval}/lib"
1295 fi
1296
1297 if test -z "$KRB4" ; then
1298 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1299 fi
1300
1301 LIBS="-lkafs $LIBS"
1302 if test ! -z "$AFS_LIBS" ; then
1303 LIBS="$LIBS $AFS_LIBS"
1304 fi
1305 AC_DEFINE(AFS)
1306 AFS_MSG="yes"
1307 fi
1308 ]
1309)
1310LIBS="$LIBS $KLIBS"
1311
Damien Millera22ba012000-03-02 23:09:20 +11001312# Looking for programs, paths and files
1313AC_ARG_WITH(rsh,
1314 [ --with-rsh=PATH Specify path to remote shell program ],
1315 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001316 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +10001317 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001318 fi
1319 ],
1320 [
1321 AC_PATH_PROG(rsh_path, rsh)
1322 ]
1323)
1324
1325AC_ARG_WITH(xauth,
1326 [ --with-xauth=PATH Specify path to xauth program ],
1327 [
Ben Lindstrom76020ba2000-10-25 16:55:00 +00001328 if test "x$withval" != "xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +10001329 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +11001330 fi
1331 ],
1332 [
Damien Miller78315eb2000-09-29 23:01:36 +11001333 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 +10001334 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +11001335 xauth_path="/usr/openwin/bin/xauth"
1336 fi
1337 ]
1338)
1339
Damien Millera19cf472000-11-29 13:28:50 +11001340if test -z "$xauth_path" ; then
1341 XAUTH_PATH="undefined"
1342 AC_SUBST(XAUTH_PATH)
1343else
Damien Millera22ba012000-03-02 23:09:20 +11001344 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
Damien Millera19cf472000-11-29 13:28:50 +11001345 XAUTH_PATH=$xauth_path
1346 AC_SUBST(XAUTH_PATH)
Damien Millera22ba012000-03-02 23:09:20 +11001347fi
1348if test ! -z "$rsh_path" ; then
1349 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
1350fi
1351
1352# Check for mail directory (last resort if we cannot get it from headers)
1353if test ! -z "$MAIL" ; then
1354 maildir=`dirname $MAIL`
1355 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
1356fi
1357
Damien Millera22ba012000-03-02 23:09:20 +11001358if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +11001359 AC_CHECK_FILE("/dev/ptmx",
1360 [
1361 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1362 have_dev_ptmx=1
1363 ]
1364 )
Damien Millera22ba012000-03-02 23:09:20 +11001365fi
Damien Miller204ad072000-03-02 23:56:12 +11001366AC_CHECK_FILE("/dev/ptc",
1367 [
1368 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1369 have_dev_ptc=1
1370 ]
1371)
1372
Damien Millera22ba012000-03-02 23:09:20 +11001373# Options from here on. Some of these are preset by platform above
1374
Damien Millera22ba012000-03-02 23:09:20 +11001375# Check for user-specified random device, otherwise check /dev/urandom
1376AC_ARG_WITH(random,
Damien Miller0736c4d2001-01-25 10:51:46 +11001377 [ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
Damien Millera22ba012000-03-02 23:09:20 +11001378 [
Damien Miller040f3832000-04-03 14:50:43 +10001379 if test "x$withval" != "xno" ; then
1380 RANDOM_POOL="$withval";
1381 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1382 fi
Damien Millera22ba012000-03-02 23:09:20 +11001383 ],
1384 [
1385 # Check for random device
1386 AC_CHECK_FILE("/dev/urandom",
1387 [
1388 RANDOM_POOL="/dev/urandom";
1389 AC_SUBST(RANDOM_POOL)
1390 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
1391 ]
1392 )
1393 ]
1394)
1395
Damien Millerd0ccb982001-03-04 00:29:20 +11001396# Check for PRNGD/EGD pool file
1397AC_ARG_WITH(prngd-port,
1398 [ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
1399 [
1400 if test ! -z "$withval" -a "x$withval" != "xno" ; then
1401 PRNGD_PORT="$withval"
1402 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1403 fi
1404 ]
1405)
1406
1407# Check for PRNGD/EGD pool file
1408AC_ARG_WITH(prngd-socket,
1409 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
Damien Millera22ba012000-03-02 23:09:20 +11001410 [
Damien Miller040f3832000-04-03 14:50:43 +10001411 if test "x$withval" != "xno" ; then
Damien Millerd0ccb982001-03-04 00:29:20 +11001412 PRNGD_SOCKET="$withval"
1413 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller040f3832000-04-03 14:50:43 +10001414 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001415 ],
1416 [
1417 # Check for existing socket only if we don't have a random device already
1418 if test -z "$RANDOM_POOL" ; then
1419 AC_MSG_CHECKING(for PRNGD/EGD socket)
1420 # Insert other locations here
Tim Ricebee3f222001-03-11 17:32:12 -08001421 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
Damien Millerd0ccb982001-03-04 00:29:20 +11001422 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1423 PRNGD_SOCKET="$sock"
1424 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
Damien Miller0736c4d2001-01-25 10:51:46 +11001425 break;
1426 fi
1427 done
Damien Millerd0ccb982001-03-04 00:29:20 +11001428 if test ! -z "$PRNGD_SOCKET" ; then
1429 AC_MSG_RESULT($PRNGD_SOCKET)
Damien Miller4864e8f2001-02-08 10:07:08 +11001430 else
1431 AC_MSG_RESULT(not found)
1432 fi
Damien Miller0736c4d2001-01-25 10:51:46 +11001433 fi
Damien Millera22ba012000-03-02 23:09:20 +11001434 ]
1435)
1436
Damien Miller0736c4d2001-01-25 10:51:46 +11001437
Damien Miller0437b332000-05-02 09:56:41 +10001438# detect pathnames for entropy gathering commands, if we need them
1439INSTALL_SSH_PRNG_CMDS=""
1440rm -f prng_commands
Damien Millerd0ccb982001-03-04 00:29:20 +11001441if (test -z "$RANDOM_POOL" && test -z "$PRNGD") ; then
Damien Miller11e37f62000-04-08 18:23:30 +10001442 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +10001443 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1444 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1445 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1446 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1447 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1448 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1449 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1450 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1451 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1452 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1453 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1454 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1455 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1456 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
Damien Miller0437b332000-05-02 09:56:41 +10001457
1458 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +10001459fi
Damien Miller0437b332000-05-02 09:56:41 +10001460AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1461
Damien Miller11e37f62000-04-08 18:23:30 +10001462
Ben Lindstrom9841b0a2001-06-09 02:26:58 +00001463AC_ARG_WITH(mantype,
Damien Miller897741e2001-04-16 10:41:46 +10001464 [ --with-mantype=man|cat|doc Set man page type],
Damien Miller670a4b82000-01-22 13:53:11 +11001465 [
Damien Miller897741e2001-04-16 10:41:46 +10001466 case "$withval" in
1467 man|cat|doc)
1468 MANTYPE=$withval
1469 ;;
1470 *)
1471 AC_MSG_ERROR(invalid man type: $withval)
1472 ;;
1473 esac
Damien Miller670a4b82000-01-22 13:53:11 +11001474 ]
1475)
Ben Lindstrombc709922001-04-18 18:04:21 +00001476if test -z "$MANTYPE"; then
Tim Rice07183b82001-04-25 21:40:28 -07001477 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb)
Ben Lindstrombc709922001-04-18 18:04:21 +00001478 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
1479 MANTYPE=doc
1480 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
1481 MANTYPE=man
1482 else
1483 MANTYPE=cat
1484 fi
1485fi
Damien Miller670a4b82000-01-22 13:53:11 +11001486AC_SUBST(MANTYPE)
Ben Lindstrombc709922001-04-18 18:04:21 +00001487if test "$MANTYPE" = "doc"; then
1488 mansubdir=man;
1489else
1490 mansubdir=$MANTYPE;
1491fi
1492AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +11001493
Damien Millera22ba012000-03-02 23:09:20 +11001494# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001495MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001496AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001497 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001498 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001499 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001500 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001501 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001502 fi
1503 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001504)
1505
Damien Millera22ba012000-03-02 23:09:20 +11001506# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001507AC_ARG_WITH(shadow,
1508 [ --without-shadow Disable shadow password support],
1509 [
1510 if test "x$withval" = "xno" ; then
1511 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001512 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001513 fi
1514 ]
1515)
1516
Damien Miller1f335fb2000-06-26 11:31:33 +10001517if test -z "$disable_shadow" ; then
1518 AC_MSG_CHECKING([if the systems has expire shadow information])
1519 AC_TRY_COMPILE(
1520 [
1521#include <sys/types.h>
1522#include <shadow.h>
1523 struct spwd sp;
1524 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1525 [ sp_expire_available=yes ], []
1526 )
1527
1528 if test "x$sp_expire_available" = "xyes" ; then
1529 AC_MSG_RESULT(yes)
1530 AC_DEFINE(HAS_SHADOW_EXPIRE)
1531 else
1532 AC_MSG_RESULT(no)
1533 fi
1534fi
1535
Damien Millera22ba012000-03-02 23:09:20 +11001536# Use ip address instead of hostname in $DISPLAY
Damien Miller9a947342000-08-30 10:03:33 +11001537if test ! -z "$IPADDR_IN_DISPLAY" ; then
1538 DISPLAY_HACK_MSG="yes"
1539 AC_DEFINE(IPADDR_IN_DISPLAY)
1540else
1541 DISPLAY_HACK_MSG="no"
1542 AC_ARG_WITH(ipaddr-display,
1543 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1544 [
1545 if test "x$withval" != "xno" ; then
1546 AC_DEFINE(IPADDR_IN_DISPLAY)
1547 DISPLAY_HACK_MSG="yes"
1548 fi
1549 ]
1550 )
1551fi
Damien Miller76112de1999-12-21 11:18:08 +11001552
Damien Millera22ba012000-03-02 23:09:20 +11001553# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001554SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001555AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001556 [ --with-default-path=PATH Specify default \$PATH environment for server],
1557 [
1558 if test "x$withval" != "xno" ; then
Tim Rice59ea0a02001-03-10 13:50:45 -08001559 user_path="$withval"
Damien Miller7b22d652000-06-18 14:07:04 +10001560 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001561 fi
Tim Rice59ea0a02001-03-10 13:50:45 -08001562 ],
1563 [
1564 AC_TRY_RUN(
1565 [
1566/* find out what STDPATH is */
1567#include <stdio.h>
Tim Rice59ea0a02001-03-10 13:50:45 -08001568#ifdef HAVE_PATHS_H
1569# include <paths.h>
1570#endif
1571#ifndef _PATH_STDPATH
1572# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
1573#endif
1574#include <sys/types.h>
1575#include <sys/stat.h>
1576#include <fcntl.h>
1577#define DATA "conftest.stdpath"
1578
1579main()
1580{
1581 FILE *fd;
1582 int rc;
1583
1584 fd = fopen(DATA,"w");
1585 if(fd == NULL)
1586 exit(1);
1587
1588 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
1589 exit(1);
1590
1591 exit(0);
1592}
1593 ], [ user_path=`cat conftest.stdpath` ],
1594 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1595 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1596 )
1597# make sure $bindir is in USER_PATH so scp will work
1598 t_bindir=`eval echo ${bindir}`
1599 case $t_bindir in
1600 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
1601 esac
1602 case $t_bindir in
1603 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
1604 esac
1605 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
1606 if test $? -ne 0 ; then
1607 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
1608 if test $? -ne 0 ; then
1609 user_path=$user_path:$t_bindir
1610 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
1611 fi
1612 fi
Damien Miller5a3e6831999-12-27 09:48:56 +11001613 ]
1614)
Tim Rice59ea0a02001-03-10 13:50:45 -08001615AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
1616AC_SUBST(user_path)
Damien Miller5a3e6831999-12-27 09:48:56 +11001617
Damien Millera22ba012000-03-02 23:09:20 +11001618# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001619IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001620AC_ARG_WITH(ipv4-default,
1621 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1622 [
1623 if test "x$withval" != "xno" ; then
1624 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001625 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001626 fi
1627 ]
1628)
1629
Damien Miller61e50f12000-05-08 20:49:37 +10001630AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001631IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001632AC_ARG_WITH(4in6,
1633 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1634 [
1635 if test "x$withval" != "xno" ; then
1636 AC_MSG_RESULT(yes)
1637 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001638 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001639 else
1640 AC_MSG_RESULT(no)
1641 fi
1642 ],[
1643 if test "x$inet6_default_4in6" = "xyes"; then
1644 AC_MSG_RESULT([yes (default)])
1645 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001646 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001647 else
1648 AC_MSG_RESULT([no (default)])
1649 fi
1650 ]
1651)
1652
Damien Miller60396b02001-02-18 17:01:00 +11001653# Whether to enable BSD auth support
1654AC_ARG_WITH(bsd-auth,
1655 [ --with-bsd-auth Enable BSD auth support],
1656 [
1657 if test "x$withval" != "xno" ; then
1658 AC_DEFINE(BSD_AUTH)
1659 bsd_auth=yes
1660 fi
1661 ]
1662)
1663
Damien Miller78315eb2000-09-29 23:01:36 +11001664AC_MSG_CHECKING(whether to install ssh as suid root)
1665AC_ARG_ENABLE(suid-ssh,
1666[ --enable-suid-ssh Install ssh as suid root (default)
1667 --disable-suid-ssh Install ssh without suid bit],
1668[ case "$enableval" in
1669 no)
1670 AC_MSG_RESULT(no)
1671 SSHMODE=0711
1672 ;;
1673 *) AC_MSG_RESULT(yes)
1674 SSHMODE=04711
1675 ;;
1676 esac ],
1677 AC_MSG_RESULT(yes)
1678 SSHMODE=04711
1679)
1680AC_SUBST(SSHMODE)
1681
1682
Damien Millera22ba012000-03-02 23:09:20 +11001683# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001684piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001685AC_ARG_WITH(pid-dir,
1686 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1687 [
1688 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001689 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001690 fi
1691 ]
1692)
Damien Miller4018c192000-04-30 09:30:44 +10001693
Damien Miller78315eb2000-09-29 23:01:36 +11001694# make sure the directory exists
1695if test ! -d $piddir ; then
1696 piddir=`eval echo ${sysconfdir}`
1697 case $piddir in
1698 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1699 esac
1700fi
1701
Ben Lindstrom226cfa02001-01-22 05:34:40 +00001702AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001703AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001704
andre2ff7b5d2000-06-03 14:57:40 +00001705dnl allow user to disable some login recording features
1706AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001707 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001708 [ AC_DEFINE(DISABLE_LASTLOG) ]
1709)
1710AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001711 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001712 [ AC_DEFINE(DISABLE_UTMP) ]
1713)
1714AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001715 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001716 [ AC_DEFINE(DISABLE_UTMPX) ]
1717)
1718AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001719 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001720 [ AC_DEFINE(DISABLE_WTMP) ]
1721)
1722AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001723 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001724 [ AC_DEFINE(DISABLE_WTMPX) ]
1725)
1726AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001727 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001728 [ AC_DEFINE(DISABLE_LOGIN) ]
1729)
1730AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001731 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001732 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1733)
1734AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001735 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001736 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1737)
1738AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001739 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
Damien Miller709528a2001-01-31 09:57:55 +11001740 [
1741 if test "x$withval" = "xno" ; then
1742 AC_DEFINE(DISABLE_LASTLOG)
1743 else
1744 conf_lastlog_location=$withval
1745 fi
1746 ]
1747)
andre2ff7b5d2000-06-03 14:57:40 +00001748
1749dnl lastlog, [uw]tmpx? detection
1750dnl NOTE: set the paths in the platform section to avoid the
1751dnl need for command-line parameters
1752dnl lastlog and [uw]tmp are subject to a file search if all else fails
1753
1754dnl lastlog detection
1755dnl NOTE: the code itself will detect if lastlog is a directory
1756AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1757AC_TRY_COMPILE([
1758#include <sys/types.h>
1759#include <utmp.h>
1760#ifdef HAVE_LASTLOG_H
1761# include <lastlog.h>
1762#endif
Damien Miller2994e082000-06-04 15:51:47 +10001763#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001764# include <paths.h>
1765#endif
1766 ],
1767 [ char *lastlog = LASTLOG_FILE; ],
1768 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001769 [
1770 AC_MSG_RESULT(no)
1771 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1772 AC_TRY_COMPILE([
1773#include <sys/types.h>
1774#include <utmp.h>
1775#ifdef HAVE_LASTLOG_H
1776# include <lastlog.h>
1777#endif
1778#ifdef HAVE_PATHS_H
1779# include <paths.h>
1780#endif
1781 ],
1782 [ char *lastlog = _PATH_LASTLOG; ],
1783 [ AC_MSG_RESULT(yes) ],
1784 [
andree441aa32000-06-12 22:34:38 +00001785 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001786 system_lastlog_path=no
1787 ])
1788 ]
andre2ff7b5d2000-06-03 14:57:40 +00001789)
Damien Miller2994e082000-06-04 15:51:47 +10001790
andre2ff7b5d2000-06-03 14:57:40 +00001791if test -z "$conf_lastlog_location"; then
1792 if test x"$system_lastlog_path" = x"no" ; then
1793 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001794 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001795 conf_lastlog_location=$f
1796 fi
1797 done
1798 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001799 AC_MSG_WARN([** Cannot find lastlog **])
1800 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001801 fi
1802 fi
1803fi
1804
1805if test -n "$conf_lastlog_location"; then
1806 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1807fi
1808
1809dnl utmp detection
1810AC_MSG_CHECKING([if your system defines UTMP_FILE])
1811AC_TRY_COMPILE([
1812#include <sys/types.h>
1813#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001814#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001815# include <paths.h>
1816#endif
1817 ],
1818 [ char *utmp = UTMP_FILE; ],
1819 [ AC_MSG_RESULT(yes) ],
1820 [ AC_MSG_RESULT(no)
1821 system_utmp_path=no ]
1822)
1823if test -z "$conf_utmp_location"; then
1824 if test x"$system_utmp_path" = x"no" ; then
1825 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1826 if test -f $f ; then
1827 conf_utmp_location=$f
1828 fi
1829 done
1830 if test -z "$conf_utmp_location"; then
1831 AC_DEFINE(DISABLE_UTMP)
1832 fi
1833 fi
1834fi
1835if test -n "$conf_utmp_location"; then
1836 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1837fi
1838
1839dnl wtmp detection
1840AC_MSG_CHECKING([if your system defines WTMP_FILE])
1841AC_TRY_COMPILE([
1842#include <sys/types.h>
1843#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001844#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001845# include <paths.h>
1846#endif
1847 ],
1848 [ char *wtmp = WTMP_FILE; ],
1849 [ AC_MSG_RESULT(yes) ],
1850 [ AC_MSG_RESULT(no)
1851 system_wtmp_path=no ]
1852)
1853if test -z "$conf_wtmp_location"; then
1854 if test x"$system_wtmp_path" = x"no" ; then
1855 for f in /usr/adm/wtmp /var/log/wtmp; do
1856 if test -f $f ; then
1857 conf_wtmp_location=$f
1858 fi
1859 done
1860 if test -z "$conf_wtmp_location"; then
1861 AC_DEFINE(DISABLE_WTMP)
1862 fi
1863 fi
1864fi
1865if test -n "$conf_wtmp_location"; then
1866 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1867fi
1868
1869
1870dnl utmpx detection - I don't know any system so perverse as to require
1871dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1872dnl there, though.
1873AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1874AC_TRY_COMPILE([
1875#include <sys/types.h>
1876#include <utmp.h>
1877#ifdef HAVE_UTMPX_H
1878#include <utmpx.h>
1879#endif
Damien Miller2994e082000-06-04 15:51:47 +10001880#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001881# include <paths.h>
1882#endif
1883 ],
1884 [ char *utmpx = UTMPX_FILE; ],
1885 [ AC_MSG_RESULT(yes) ],
1886 [ AC_MSG_RESULT(no)
1887 system_utmpx_path=no ]
1888)
1889if test -z "$conf_utmpx_location"; then
1890 if test x"$system_utmpx_path" = x"no" ; then
1891 AC_DEFINE(DISABLE_UTMPX)
1892 fi
1893else
1894 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1895fi
1896
1897dnl wtmpx detection
1898AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1899AC_TRY_COMPILE([
1900#include <sys/types.h>
1901#include <utmp.h>
1902#ifdef HAVE_UTMPX_H
1903#include <utmpx.h>
1904#endif
Damien Miller2994e082000-06-04 15:51:47 +10001905#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001906# include <paths.h>
1907#endif
1908 ],
1909 [ char *wtmpx = WTMPX_FILE; ],
1910 [ AC_MSG_RESULT(yes) ],
1911 [ AC_MSG_RESULT(no)
1912 system_wtmpx_path=no ]
1913)
1914if test -z "$conf_wtmpx_location"; then
1915 if test x"$system_wtmpx_path" = x"no" ; then
1916 AC_DEFINE(DISABLE_WTMPX)
1917 fi
1918else
1919 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1920fi
1921
Damien Miller4018c192000-04-30 09:30:44 +10001922
1923# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001924entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001925AC_ARG_WITH(entropy-timeout,
1926 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1927 [
1928 if test "x$withval" != "xno" ; then
1929 entropy_timeout=$withval
1930 fi
1931 ]
1932)
1933AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1934
1935
Damien Miller29ea30d2000-03-17 10:54:15 +11001936if test ! -z "$blibpath" ; then
1937 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1938 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1939fi
1940
Damien Millerbac2d8a2000-09-05 16:13:06 +11001941AC_EXEEXT
1942
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +00001943AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds)
Damien Miller0437b332000-05-02 09:56:41 +10001944
Damien Miller7b22d652000-06-18 14:07:04 +10001945# Print summary of options
1946
Damien Miller7b22d652000-06-18 14:07:04 +10001947if test ! -z "$RANDOM_POOL" ; then
1948 RAND_MSG="Device ($RANDOM_POOL)"
1949else
Damien Millerd0ccb982001-03-04 00:29:20 +11001950 if test ! -z "$PRNGD_PORT" ; then
1951 RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
1952 elif test ! -z "$PRNGD_SOCKET" ; then
1953 RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
Damien Miller7b22d652000-06-18 14:07:04 +10001954 else
1955 RAND_MSG="Builtin (timeout $entropy_timeout)"
Damien Miller6f9c3372000-10-25 10:06:04 +11001956 BUILTIN_RNG=1
Damien Miller7b22d652000-06-18 14:07:04 +10001957 fi
1958fi
1959
1960# Someone please show me a better way :)
1961A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1962B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1963C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1964D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
Kevin Stevese0f49142000-10-14 17:51:48 +00001965E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
Ben Lindstrombc709922001-04-18 18:04:21 +00001966F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
Damien Miller7b22d652000-06-18 14:07:04 +10001967G=`eval echo ${piddir}` ; G=`eval echo ${G}`
Tim Rice59ea0a02001-03-10 13:50:45 -08001968H=`eval echo ${user_path}` ; H=`eval echo ${H}`
Damien Miller7b22d652000-06-18 14:07:04 +10001969
1970echo ""
Kevin Steves393d2f72001-04-08 22:50:43 +00001971echo "OpenSSH has been configured with the following options:"
Damien Miller7b22d652000-06-18 14:07:04 +10001972echo " User binaries: $B"
1973echo " System binaries: $C"
1974echo " Configuration files: $D"
1975echo " Askpass program: $E"
1976echo " Manual pages: $F"
1977echo " PID file: $G"
Tim Rice59ea0a02001-03-10 13:50:45 -08001978echo " sshd default user PATH: $H"
Damien Miller7b22d652000-06-18 14:07:04 +10001979echo " Random number collection: $RAND_MSG"
Damien Miller897741e2001-04-16 10:41:46 +10001980echo " Manpage format: $MANTYPE"
Damien Miller7b22d652000-06-18 14:07:04 +10001981echo " PAM support: ${PAM_MSG}"
1982echo " KerberosIV support: $KRB4_MSG"
1983echo " AFS support: $AFS_MSG"
1984echo " S/KEY support: $SKEY_MSG"
1985echo " TCP Wrappers support: $TCPW_MSG"
1986echo " MD5 password support: $MD5_MSG"
1987echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1988echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1989echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1990
Damien Miller60396b02001-02-18 17:01:00 +11001991if test ! -z "$bsd_auth"; then
1992 echo " BSD Auth support: yes"
1993fi
1994
Damien Miller7b22d652000-06-18 14:07:04 +10001995echo ""
1996
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +00001997echo " Host: ${host}"
1998echo " Compiler: ${CC}"
1999echo " Compiler flags: ${CFLAGS}"
2000echo "Preprocessor flags: ${CPPFLAGS}"
2001echo " Linker flags: ${LDFLAGS}"
2002echo " Libraries: ${LIBS}"
Damien Miller7b22d652000-06-18 14:07:04 +10002003
2004echo ""
2005
Damien Miller82cf0ce2000-12-20 13:34:48 +11002006if test "x$PAM_MSG" = "xyes" ; then
2007 echo "PAM is enabled. You may need to install a PAM control file for sshd,"
2008 echo "otherwise password authentication may fail. Example PAM control files"
2009 echo "can be found in the contrib/ subdirectory"
2010 echo ""
2011fi
2012
Damien Miller6f9c3372000-10-25 10:06:04 +11002013if test ! -z "$BUILTIN_RNG" ; then
2014 echo "WARNING: you are using the builtin random number collection service."
2015 echo "Please read WARNING.RNG and request that your OS vendor includes"
2016 echo "/dev/random in future versions of their OS."
2017 echo ""
2018fi
Ben Lindstrom3ad650a2001-01-03 06:02:51 +00002019
2020if test ! -z "$NO_SFTP"; then
2021 echo "sftp-server will be disabled. Your compiler does not support"
2022 echo "64bit integers."
2023 echo ""
2024fi
Damien Miller60396b02001-02-18 17:01:00 +11002025