blob: f048b000d8dc4c764d3d3f22703cedbef73f8359 [file] [log] [blame]
Damien Millerab18c411999-11-11 10:40:23 +11001AC_INIT(ssh.c)
Damien Miller7f6ea021999-10-28 13:25:17 +10002
3AC_CONFIG_HEADER(config.h)
Damien Miller856799b2000-03-15 21:18:10 +11004AC_PROG_CC
Damien Miller76112de1999-12-21 11:18:08 +11005AC_CANONICAL_HOST
Damien Miller7f6ea021999-10-28 13:25:17 +10006
Damien Millera22ba012000-03-02 23:09:20 +11007# Checks for programs.
Damien Millerab18c411999-11-11 10:40:23 +11008AC_PROG_CPP
Damien Miller7f6ea021999-10-28 13:25:17 +10009AC_PROG_RANLIB
Damien Millerd8087f61999-11-25 12:31:26 +110010AC_PROG_INSTALL
Damien Millerc7b38ce1999-11-09 10:28:04 +110011AC_CHECK_PROG(AR, ar, ar)
Damien Millere79334a1999-12-29 10:03:37 +110012AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
Damien Miller8d1fd572000-05-17 21:34:07 +100014AC_PATH_PROG(ENT, ent)
15AC_SUBST(ENT)
Damien Miller2e1b0821999-12-25 10:11:29 +110016
Damien Miller166bd442000-03-16 10:48:25 +110017if test -z "$LD" ; then
18 LD=$CC
19fi
20AC_SUBST(LD)
21
22# C Compiler features
23AC_C_INLINE
24if test "$GCC" = "yes"; then
25 CFLAGS="$CFLAGS -Wall"
26fi
27
Damien Millera22ba012000-03-02 23:09:20 +110028# Check for some target-specific stuff
Damien Miller76112de1999-12-21 11:18:08 +110029case "$host" in
Damien Miller75b1d102000-01-07 14:01:41 +110030*-*-aix*)
31 AFS_LIBS="-lld"
Damien Millerdb819592000-03-14 13:44:01 +110032 CFLAGS="$CFLAGS -I/usr/local/include"
33 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Milleredb82922000-06-20 13:25:52 +100034 if (test "$LD" != "gcc" && test -z "$blibpath"); then
Damien Miller29ea30d2000-03-17 10:54:15 +110035 blibpath="/usr/lib:/lib:/usr/local/lib"
36 fi
Damien Millerd2c208a2000-05-17 22:00:02 +100037 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)])
Damien Millereca71f82000-01-20 22:38:27 +110038 AC_DEFINE(BROKEN_GETADDRINFO)
andree441aa32000-06-12 22:34:38 +000039 MANTYPE='$(CATMAN)'
40 mansubdir=cat
andre60f3c982000-06-03 16:18:19 +000041 dnl AIX handles lastlog as part of its login message
42 AC_DEFINE(DISABLE_LASTLOG)
Damien Miller5fc85652000-07-09 23:53:07 +100043 MANTYPE='$(CATMAN)'
44 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +110045 ;;
Damien Miller76112de1999-12-21 11:18:08 +110046*-*-hpux10*)
47 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100048 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110049 fi
50 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
51 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Millerb0785672000-08-23 09:10:39 +100052 AC_DEFINE(USE_PIPES)
Damien Miller76112de1999-12-21 11:18:08 +110053 AC_MSG_CHECKING(for HPUX trusted system password database)
54 if test -f /tcb/files/auth/system/default; then
55 AC_MSG_RESULT(yes)
56 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
57 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110058 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110059 else
60 AC_MSG_RESULT(no)
61 AC_DEFINE(DISABLE_SHADOW)
62 fi
Damien Miller670a4b82000-01-22 13:53:11 +110063 MANTYPE='$(CATMAN)'
64 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110065 ;;
Damien Miller1bead332000-04-30 00:47:29 +100066*-*-hpux11*)
67 if test -z "$GCC"; then
68 CFLAGS="$CFLAGS -Ae"
69 fi
70 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100071 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100072 AC_MSG_CHECKING(for HPUX trusted system password database)
73 if test -f /tcb/files/auth/system/default; then
74 AC_MSG_RESULT(yes)
75 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
76 LIBS="$LIBS -lsec"
77 AC_MSG_WARN([This configuration is untested])
78 else
79 AC_MSG_RESULT(no)
80 AC_DEFINE(DISABLE_SHADOW)
81 fi
82 MANTYPE='$(CATMAN)'
83 mansubdir=cat
84 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110085*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110086 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100087 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110088 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110089 no_libsocket=1
90 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +100091 AC_DEFINE(BROKEN_INET_NTOA)
Damien Miller1808f382000-01-06 12:03:12 +110092 ;;
93*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110094 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100095 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110096 MANTYPE='$(CATMAN)'
Damien Miller91606b12000-06-28 08:22:29 +100097 AC_DEFINE(WITH_IRIX_ARRAY)
98 AC_DEFINE(WITH_IRIX_PROJECT)
99 AC_DEFINE(WITH_IRIX_AUDIT)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100100 no_libsocket=1
101 no_libnsl=1
Damien Miller11fa2cc2000-08-16 10:35:58 +1000102 AC_DEFINE(BROKEN_INET_NTOA)
Damien Millerbeb4ba51999-12-28 15:09:35 +1100103 ;;
Damien Millerb29ea912000-01-15 14:12:03 +1100104*-*-linux*)
105 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +1100106 AC_DEFINE(DONT_TRY_OTHER_AF)
Damien Miller4e997202000-07-09 21:21:52 +1000107 AC_DEFINE(PAM_TTY_KLUDGE)
Damien Miller7bcb0892000-03-11 20:45:40 +1100108 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100109 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100110*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100111 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100112 ;;
Damien Miller0f91b4e2000-06-18 15:43:25 +1000113*-next-*)
114 # hardwire lastlog location (can't detect it on some versions)
115 conf_lastlog_location="/usr/adm/lastlog"
Damien Miller31abc9a2000-07-09 23:26:27 +1000116 conf_utmp_location=/etc/utmp
Damien Miller0f91b4e2000-06-18 15:43:25 +1000117 AC_DEFINE(HAVE_NEXT)
118 CFLAGS="$CFLAGS -I/usr/local/include"
119 MAIL=/usr/spool/mail
Damien Miller0f91b4e2000-06-18 15:43:25 +1000120 AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel])
121 AC_MSG_WARN([*** Expect 'scp' to fail!])
122 AC_MSG_WARN([*** Please report any problems, thanks])
123 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100124*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100125 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100126 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100127 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000128 # hardwire lastlog location (can't detect it on some versions)
129 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000130 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
131 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
132 if test "$sol2ver" -ge 8; then
133 AC_MSG_RESULT(yes)
134 AC_DEFINE(DISABLE_UTMP)
135 AC_DEFINE(DISABLE_WTMP)
136 else
137 AC_MSG_RESULT(no)
138 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100139 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000140*-*-sunos4*)
141 CFLAGS="$CFLAGS -DSUNOS4"
142 AC_CHECK_FUNCS(getpwanam)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000143 conf_utmp_location=/etc/utmp
144 conf_wtmp_location=/var/adm/wtmp
145 conf_lastlog_location=/var/adm/lastlog
Damien Millerb0785672000-08-23 09:10:39 +1000146 AC_DEFINE(USE_PIPES)
Damien Miller36ccb5c2000-08-09 16:34:27 +1000147 MANTYPE='$(CATMAN)'
148 mansubdir=cat
Damien Millerdfc83f42000-05-20 15:02:59 +1000149 ;;
Damien Miller2ae714f2000-07-11 09:29:50 +1000150*-sni-sysv*)
151 CFLAGS="$CFLAGS -I/usr/local/include"
152 LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib"
153 MANTYPE='$(CATMAN)'
154 AC_DEFINE(IP_TOS_IS_BROKEN)
155 mansubdir=cat
Damien Millerb2dc28e2000-07-12 09:18:33 +1000156 LIBS="$LIBS -lgen -lnsl -lucb"
Damien Miller2ae714f2000-07-11 09:29:50 +1000157 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100158*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100159 CFLAGS="$CFLAGS -I/usr/local/include"
160 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100161 MANTYPE='$(CATMAN)'
162 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100163 LIBS="$LIBS -lgen -lsocket"
164 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000165*-*-sco3*)
166 CFLAGS="$CFLAGS -I/usr/local/include"
167 LDFLAGS="$LDFLAGS -L/usr/local/lib"
168 MANTYPE='$(CATMAN)'
169 mansubdir=cat
170 LIBS="$LIBS -lgen -lsocket"
171 no_dev_ptmx=1
172 ;;
Damien Millerb8c656e2000-06-28 15:22:41 +1000173*-dec-osf*)
174# This is untested
175 if test ! -z "USE_SIA" ; then
176 AC_MSG_CHECKING(for Digital Unix Security Integration Architecture)
177 if test -f /etc/sia/matrix.conf; then
178 AC_MSG_RESULT(yes)
179 AC_DEFINE(HAVE_OSF_SIA)
180 AC_DEFINE(DISABLE_LOGIN)
181 LIBS="$LIBS -lsecurity -ldb -lm -laud"
182 else
183 AC_MSG_RESULT(no)
184 fi
185 fi
186 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100187esac
188
Damien Millere37bfc12000-06-05 09:37:43 +1000189# Allow user to specify flags
190AC_ARG_WITH(cflags,
191 [ --with-cflags Specify additional flags to pass to compiler],
192 [
193 if test "x$withval" != "xno" ; then
194 CFLAGS="$CFLAGS $withval"
195 fi
196 ]
197)
198AC_ARG_WITH(ldflags,
199 [ --with-ldlags Specify additional flags to pass to linker],
200 [
201 if test "x$withval" != "xno" ; then
202 LDFLAGS="$LDFLAGS $withval"
203 fi
204 ]
205)
206AC_ARG_WITH(libs,
207 [ --with-libs Specify additional libraries to link with],
208 [
209 if test "x$withval" != "xno" ; then
210 LIBS="$LIBS $withval"
211 fi
212 ]
213)
214
215
Damien Millera22ba012000-03-02 23:09:20 +1100216# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100217AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
218AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100219
Damien Millerbeb4ba51999-12-28 15:09:35 +1100220if test -z "$no_libsocket" ; then
221 AC_CHECK_LIB(nsl, yp_match, , )
222fi
223if test -z "$no_libnsl" ; then
224 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100225fi
Damien Millerab18c411999-11-11 10:40:23 +1100226
Damien Millera22ba012000-03-02 23:09:20 +1100227# Checks for header files.
Damien Miller348c9b72000-08-15 10:01:22 +1000228AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100229
Damien Millera22ba012000-03-02 23:09:20 +1100230# Checks for library functions.
Damien Miller11fa2cc2000-08-16 10:35:58 +1000231AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop)
andre2ff7b5d2000-06-03 14:57:40 +0000232dnl checks for time functions
233AC_CHECK_FUNCS(gettimeofday time)
234dnl checks for libutil functions
235AC_CHECK_FUNCS(login logout updwtmp logwtmp)
236dnl checks for utmp functions
237AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
238AC_CHECK_FUNCS(utmpname)
239dnl checks for utmpx functions
240AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
241AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100242
Damien Miller5fc85652000-07-09 23:53:07 +1000243AC_CHECK_FUNC(getuserattr,
244 [AC_DEFINE(HAVE_GETUSERATTR)],
245 [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])]
246)
247
Damien Miller04f80141999-11-19 15:32:34 +1100248AC_CHECK_FUNC(login,
249 [AC_DEFINE(HAVE_LOGIN)],
250 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
251)
252
253AC_CHECK_FUNC(daemon,
254 [AC_DEFINE(HAVE_DAEMON)],
255 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
256)
257
Damien Miller9fb07e42000-03-05 16:22:59 +1100258AC_CHECK_FUNC(getpagesize,
259 [AC_DEFINE(HAVE_GETPAGESIZE)],
260 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
261)
262
Damien Millercb170cb2000-07-01 16:52:55 +1000263# Check for broken snprintf
264if test "x$ac_cv_func_snprintf" = "xyes" ; then
265 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
266 AC_TRY_RUN(
267 [
268#include <stdio.h>
269int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
270 ],
271 [AC_MSG_RESULT(yes)],
272 [
273 AC_MSG_RESULT(no)
274 AC_DEFINE(BROKEN_SNPRINTF)
275 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
276 ]
277 )
278fi
279
Damien Miller7b22d652000-06-18 14:07:04 +1000280PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100281AC_ARG_WITH(pam,
282 [ --without-pam Disable PAM support ],
283 [
284 if test "x$withval" = "xno" ; then
285 no_pam=1
286 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000287 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100288 fi
289 ]
290)
Damien Milleredb82922000-06-20 13:25:52 +1000291if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100292 AC_CHECK_LIB(dl, dlopen, , )
293 LIBS="$LIBS -lpam"
294
Damien Miller0e65eed2000-05-17 22:16:05 +1000295 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000296
Damien Miller1f335fb2000-06-26 11:31:33 +1000297 disable_shadow=yes
298
Damien Miller7b22d652000-06-18 14:07:04 +1000299 PAM_MSG="yes"
300
Damien Millera22ba012000-03-02 23:09:20 +1100301 # Check PAM strerror arguments (old PAM)
302 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
303 AC_TRY_COMPILE(
304 [
Damien Miller81171112000-04-23 11:14:01 +1000305#include <stdlib.h>
306#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100307 ],
308 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
309 [AC_MSG_RESULT(no)],
310 [
311 AC_DEFINE(HAVE_OLD_PAM)
312 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000313 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100314 ]
315 )
316fi
317
318# The big search for OpenSSL
319AC_ARG_WITH(ssl-dir,
320 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
321 [
322 if test "x$withval" != "$xno" ; then
323 tryssldir=$withval
324 fi
325 ]
326)
327
328saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100329saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100330saved_CFLAGS="$CFLAGS"
331if test "x$prefix" != "xNONE" ; then
332 tryssldir="$tryssldir $prefix"
333fi
Damien Miller61e50f12000-05-08 20:49:37 +1000334AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100335
Damien Miller61e50f12000-05-08 20:49:37 +1000336 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
337 if test ! -z "$ssldir" ; then
338 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
339 CFLAGS="$saved_CFLAGS -I$ssldir/include"
340 if test ! -z "$need_dash_r" ; then
341 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
342 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100343 else
Damien Miller61e50f12000-05-08 20:49:37 +1000344 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100345 fi
346
Damien Miller3b512e12000-05-17 23:29:18 +1000347 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000348
Damien Miller3b512e12000-05-17 23:29:18 +1000349 # Basic test to check for compatible version and correct linking
350 # *does not* test for RSA - that comes later.
351 AC_TRY_RUN(
352 [
Damien Millere59ce622000-05-01 20:54:17 +1000353#include <string.h>
354#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000355int main(void)
356{
Damien Miller3b512e12000-05-17 23:29:18 +1000357 char a[2048];
358 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000359 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000360 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000361}
Damien Miller3b512e12000-05-17 23:29:18 +1000362 ],
363 [
364 found_crypto=1
365 break;
366 ], []
367 )
Damien Miller61e50f12000-05-08 20:49:37 +1000368
369 if test ! -z "$found_crypto" ; then
370 break;
371 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100372 done
373
Damien Miller61e50f12000-05-08 20:49:37 +1000374 if test -z "$found_crypto" ; then
375 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100376 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000377 if test -z "$ssldir" ; then
378 ssldir="(system)"
379 fi
Damien Millera22ba012000-03-02 23:09:20 +1100380
Damien Miller61e50f12000-05-08 20:49:37 +1000381 ac_cv_openssldir=$ssldir
382])
383
Damien Milleredb82922000-06-20 13:25:52 +1000384if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000385 AC_DEFINE(HAVE_OPENSSL)
386 dnl Need to recover ssldir - test above runs in subshell
387 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100388 CFLAGS="$saved_CFLAGS -I$ssldir/include"
389 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
390 if test ! -z "$need_dash_r" ; then
391 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100392 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100393 if test ! -z "$blibpath" ; then
394 blibpath="$blibpath:$ssldir:$ssldir/lib"
395 fi
Damien Millera22ba012000-03-02 23:09:20 +1100396fi
Damien Miller3b512e12000-05-17 23:29:18 +1000397LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000398
Damien Miller3b512e12000-05-17 23:29:18 +1000399# Now test RSA support
400saved_LIBS="$LIBS"
401AC_MSG_CHECKING([for RSA support])
402for WANTS_RSAREF in "" 1 ; do
403 if test -z "$WANTS_RSAREF" ; then
404 LIBS="$saved_LIBS"
405 else
406 LIBS="$saved_LIBS -lRSAglue -lrsaref"
407 fi
408 AC_TRY_RUN([
409#include <string.h>
410#include <openssl/rand.h>
411#include <openssl/rsa.h>
412#include <openssl/bn.h>
413#include <openssl/sha.h>
414int main(void)
415{
416 int num; RSA *key; static unsigned char p_in[] = "blahblah";
417 unsigned char c[256], p[256];
418 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
419 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
420 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
421 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
422}
423 ],
424 [
425 rsa_works=1
426 break;
427 ], [])
428done
429
430if test ! -z "$no_rsa" ; then
431 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000432 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000433else
434 if test -z "$rsa_works" ; then
435 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000436 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000437 else
438 if test -z "$WANTS_RSAREF" ; then
439 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000440 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000441 else
Damien Miller7b22d652000-06-18 14:07:04 +1000442 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000443 AC_MSG_RESULT(using RSAref)
444 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
445 fi
446 fi
447fi
Damien Millera22ba012000-03-02 23:09:20 +1100448
449# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100450AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100451AC_CHECK_SIZEOF(short int, 2)
452AC_CHECK_SIZEOF(int, 4)
453AC_CHECK_SIZEOF(long int, 4)
454AC_CHECK_SIZEOF(long long int, 8)
455
Damien Millera22ba012000-03-02 23:09:20 +1100456# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000457AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
458 AC_TRY_COMPILE(
459 [ #include <sys/types.h> ],
460 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
461 [ ac_cv_have_intxx_t="yes" ],
462 [ ac_cv_have_intxx_t="no" ]
463 )
464])
465if test "x$ac_cv_have_intxx_t" = "xyes" ; then
466 AC_DEFINE(HAVE_INTXX_T)
467 have_intxx_t=1
468fi
469
470AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
471 AC_TRY_COMPILE(
472 [ #include <sys/types.h> ],
473 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
474 [ ac_cv_have_u_intxx_t="yes" ],
475 [ ac_cv_have_u_intxx_t="no" ]
476 )
477])
478if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
479 AC_DEFINE(HAVE_U_INTXX_T)
480 have_u_intxx_t=1
481fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100482
Damien Millerc6398ef1999-11-20 12:18:40 +1100483
Damien Milleredb82922000-06-20 13:25:52 +1000484if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
485 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
Damien Millerb29ea912000-01-15 14:12:03 +1100486then
487 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
488 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000489 [
490#include <sys/bitypes.h>
491 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100492 [
Damien Miller70494d12000-04-03 15:57:06 +1000493 int8_t a; int16_t b; int32_t c;
494 u_int8_t e; u_int16_t f; u_int32_t g;
495 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100496 ],
497 [
498 AC_DEFINE(HAVE_U_INTXX_T)
499 AC_DEFINE(HAVE_INTXX_T)
500 AC_MSG_RESULT(yes)
501 ],
502 [AC_MSG_RESULT(no)]
503 )
504fi
505
Damien Millerd6121d22000-03-17 23:26:46 +1100506if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000507 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
508 AC_TRY_COMPILE(
509 [
510#include <sys/types.h>
511 ],
512 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
513 [ ac_cv_have_uintxx_t="yes" ],
514 [ ac_cv_have_uintxx_t="no" ]
515 )
516 ])
517 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
518 AC_DEFINE(HAVE_UINTXX_T)
519 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100520fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100521
Damien Miller61e50f12000-05-08 20:49:37 +1000522AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
523 AC_TRY_COMPILE(
524 [
Damien Miller81171112000-04-23 11:14:01 +1000525#include <sys/types.h>
526#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000527 ],
528 [socklen_t foo; foo = 1235;],
529 [ ac_cv_have_socklen_t="yes" ],
530 [ ac_cv_have_socklen_t="no" ]
531 )
532])
533if test "x$ac_cv_have_socklen_t" = "xyes" ; then
534 AC_DEFINE(HAVE_SOCKLEN_T)
535fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100536
Damien Miller61e50f12000-05-08 20:49:37 +1000537AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
538 AC_TRY_COMPILE(
539 [
540#include <sys/types.h>
541 ],
542 [ size_t foo; foo = 1235; ],
543 [ ac_cv_have_size_t="yes" ],
544 [ ac_cv_have_size_t="no" ]
545 )
546])
547if test "x$ac_cv_have_size_t" = "xyes" ; then
548 AC_DEFINE(HAVE_SIZE_T)
549fi
Damien Miller95058511999-12-29 10:36:45 +1100550
Damien Miller615f9392000-05-17 22:53:33 +1000551AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
552 AC_TRY_COMPILE(
553 [
554#include <sys/types.h>
555 ],
556 [ ssize_t foo; foo = 1235; ],
557 [ ac_cv_have_ssize_t="yes" ],
558 [ ac_cv_have_ssize_t="no" ]
559 )
560])
561if test "x$ac_cv_have_ssize_t" = "xyes" ; then
562 AC_DEFINE(HAVE_SSIZE_T)
563fi
564
Damien Millerb54b40e2000-06-23 08:23:34 +1000565AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
566 AC_TRY_COMPILE(
567 [
568#include <sys/types.h>
569#include <sys/socket.h>
570 ],
571 [ sa_family_t foo; foo = 1235; ],
572 [ ac_cv_have_sa_family_t="yes" ],
573 [ ac_cv_have_sa_family_t="no" ]
574 )
575])
576if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
577 AC_DEFINE(HAVE_SA_FAMILY_T)
578fi
579
Damien Miller0f91b4e2000-06-18 15:43:25 +1000580AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
581 AC_TRY_COMPILE(
582 [
583#include <sys/types.h>
584 ],
585 [ pid_t foo; foo = 1235; ],
586 [ ac_cv_have_pid_t="yes" ],
587 [ ac_cv_have_pid_t="no" ]
588 )
589])
590if test "x$ac_cv_have_pid_t" = "xyes" ; then
591 AC_DEFINE(HAVE_PID_T)
592fi
593
594AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
595 AC_TRY_COMPILE(
596 [
597#include <sys/types.h>
598 ],
599 [ mode_t foo; foo = 1235; ],
600 [ ac_cv_have_mode_t="yes" ],
601 [ ac_cv_have_mode_t="no" ]
602 )
603])
604if test "x$ac_cv_have_mode_t" = "xyes" ; then
605 AC_DEFINE(HAVE_MODE_T)
606fi
607
Damien Miller61e50f12000-05-08 20:49:37 +1000608
609AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
610 AC_TRY_COMPILE(
611 [
Damien Miller81171112000-04-23 11:14:01 +1000612#include <sys/types.h>
613#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000614 ],
615 [ struct sockaddr_storage s; ],
616 [ ac_cv_have_struct_sockaddr_storage="yes" ],
617 [ ac_cv_have_struct_sockaddr_storage="no" ]
618 )
619])
620if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
621 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
622fi
Damien Miller34132e52000-01-14 15:45:46 +1100623
Damien Miller61e50f12000-05-08 20:49:37 +1000624AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
625 AC_TRY_COMPILE(
626 [
Damien Miller7b22d652000-06-18 14:07:04 +1000627#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000628#include <netinet/in.h>
629 ],
630 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
631 [ ac_cv_have_struct_sockaddr_in6="yes" ],
632 [ ac_cv_have_struct_sockaddr_in6="no" ]
633 )
634])
635if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
636 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
637fi
Damien Miller34132e52000-01-14 15:45:46 +1100638
Damien Miller61e50f12000-05-08 20:49:37 +1000639AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
640 AC_TRY_COMPILE(
641 [
Damien Miller7b22d652000-06-18 14:07:04 +1000642#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000643#include <netinet/in.h>
644 ],
645 [ struct in6_addr s; s.s6_addr[0] = 0; ],
646 [ ac_cv_have_struct_in6_addr="yes" ],
647 [ ac_cv_have_struct_in6_addr="no" ]
648 )
649])
650if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
651 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
652fi
Damien Miller34132e52000-01-14 15:45:46 +1100653
Damien Miller61e50f12000-05-08 20:49:37 +1000654AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
655 AC_TRY_COMPILE(
656 [
Damien Miller81171112000-04-23 11:14:01 +1000657#include <sys/types.h>
658#include <sys/socket.h>
659#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000660 ],
661 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
662 [ ac_cv_have_struct_addrinfo="yes" ],
663 [ ac_cv_have_struct_addrinfo="no" ]
664 )
665])
666if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
667 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
668fi
669
Damien Miller34132e52000-01-14 15:45:46 +1100670
Damien Millera22ba012000-03-02 23:09:20 +1100671# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100672
Damien Miller61e50f12000-05-08 20:49:37 +1000673OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
674OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
675OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
676OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
677OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000678OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000679OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
680OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
Damien Miller8e81ed32000-07-01 13:17:42 +1000681OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000682OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
683OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
684OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
685OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000686OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
687OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
688OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
689OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
690
Damien Miller942da032000-08-18 13:59:06 +1000691AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
692 ac_cv_have_sun_len_in_struct_sockaddr_un, [
693 AC_TRY_COMPILE(
694 [
695#include <sys/types.h>
696#include <sys/socket.h>
697 ],
698 [ struct sockaddr_un s; s.sun_len = 1; ],
699 [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ],
700 [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ],
701 )
702])
703if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
704 AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN)
705fi
706
Damien Miller61e50f12000-05-08 20:49:37 +1000707AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
708 ac_cv_have_ss_family_in_struct_ss, [
709 AC_TRY_COMPILE(
710 [
Damien Miller81171112000-04-23 11:14:01 +1000711#include <sys/types.h>
712#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000713 ],
714 [ struct sockaddr_storage s; s.ss_family = 1; ],
715 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
716 [ ac_cv_have_ss_family_in_struct_ss="no" ],
717 )
718])
719if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
720 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
721fi
722
Damien Miller61e50f12000-05-08 20:49:37 +1000723AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
724 ac_cv_have___ss_family_in_struct_ss, [
725 AC_TRY_COMPILE(
726 [
Damien Miller81171112000-04-23 11:14:01 +1000727#include <sys/types.h>
728#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000729 ],
730 [ struct sockaddr_storage s; s.__ss_family = 1; ],
731 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
732 [ ac_cv_have___ss_family_in_struct_ss="no" ]
733 )
734])
735if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
736 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
737fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100738
Damien Miller61e50f12000-05-08 20:49:37 +1000739
740AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
741 AC_TRY_LINK([],
742 [ extern char *__progname; printf("%s", __progname); ],
743 [ ac_cv_libc_defines___progname="yes" ],
744 [ ac_cv_libc_defines___progname="no" ]
745 )
746])
747if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
748 AC_DEFINE(HAVE___PROGNAME)
749fi
750
Damien Millera22ba012000-03-02 23:09:20 +1100751
Damien Millerecbb26d2000-07-15 14:59:14 +1000752AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
753 AC_TRY_LINK([],
754 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
755 [ ac_cv_libc_defines_sys_errlist="yes" ],
756 [ ac_cv_libc_defines_sys_errlist="no" ]
757 )
758])
759if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
760 AC_DEFINE(HAVE_SYS_ERRLIST)
761fi
762
763
Damien Miller11fa2cc2000-08-16 10:35:58 +1000764AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
765 AC_TRY_LINK([],
766 [ extern int sys_nerr; printf("%i", sys_nerr);],
767 [ ac_cv_libc_defines_sys_nerr="yes" ],
768 [ ac_cv_libc_defines_sys_nerr="no" ]
769 )
770])
771if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
772 AC_DEFINE(HAVE_SYS_NERR)
773fi
774
775
Damien Millera22ba012000-03-02 23:09:20 +1100776# Looking for programs, paths and files
777AC_ARG_WITH(rsh,
778 [ --with-rsh=PATH Specify path to remote shell program ],
779 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100780 if test "x$withval" != "$no" ; then
Damien Miller90dcc052000-07-08 10:17:40 +1000781 rsh_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100782 fi
783 ],
784 [
785 AC_PATH_PROG(rsh_path, rsh)
786 ]
787)
788
789AC_ARG_WITH(xauth,
790 [ --with-xauth=PATH Specify path to xauth program ],
791 [
792 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000793 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100794 fi
795 ],
796 [
797 AC_PATH_PROG(xauth_path, xauth)
Damien Milleredb82922000-06-20 13:25:52 +1000798 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
Damien Millera22ba012000-03-02 23:09:20 +1100799 xauth_path="/usr/openwin/bin/xauth"
800 fi
801 ]
802)
803
804if test ! -z "$xauth_path" ; then
805 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
806fi
807if test ! -z "$rsh_path" ; then
808 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
809fi
810
811# Check for mail directory (last resort if we cannot get it from headers)
812if test ! -z "$MAIL" ; then
813 maildir=`dirname $MAIL`
814 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
815fi
816
Damien Millera22ba012000-03-02 23:09:20 +1100817if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100818 AC_CHECK_FILE("/dev/ptmx",
819 [
820 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
821 have_dev_ptmx=1
822 ]
823 )
Damien Millera22ba012000-03-02 23:09:20 +1100824fi
Damien Miller204ad072000-03-02 23:56:12 +1100825AC_CHECK_FILE("/dev/ptc",
826 [
827 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
828 have_dev_ptc=1
829 ]
830)
831
Damien Millera22ba012000-03-02 23:09:20 +1100832# Options from here on. Some of these are preset by platform above
833
Damien Millera22ba012000-03-02 23:09:20 +1100834# Check for user-specified random device, otherwise check /dev/urandom
835AC_ARG_WITH(random,
836 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
837 [
Damien Miller040f3832000-04-03 14:50:43 +1000838 if test "x$withval" != "xno" ; then
839 RANDOM_POOL="$withval";
840 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
841 fi
Damien Millera22ba012000-03-02 23:09:20 +1100842 ],
843 [
844 # Check for random device
845 AC_CHECK_FILE("/dev/urandom",
846 [
847 RANDOM_POOL="/dev/urandom";
848 AC_SUBST(RANDOM_POOL)
849 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
850 ]
851 )
852 ]
853)
854
855# Check for EGD pool file
856AC_ARG_WITH(egd-pool,
857 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
858 [
Damien Miller040f3832000-04-03 14:50:43 +1000859 if test "x$withval" != "xno" ; then
860 EGD_SOCKET="$withval";
861 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
862 fi
Damien Millera22ba012000-03-02 23:09:20 +1100863 ]
864)
865
Damien Miller0437b332000-05-02 09:56:41 +1000866# detect pathnames for entropy gathering commands, if we need them
867INSTALL_SSH_PRNG_CMDS=""
868rm -f prng_commands
Damien Milleredb82922000-06-20 13:25:52 +1000869if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then
Damien Miller11e37f62000-04-08 18:23:30 +1000870 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000871 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
872 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
873 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
874 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
875 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
876 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
877 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
878 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
879 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
880 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
881 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
882 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
883 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
884 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
885 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000886
887 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000888fi
Damien Miller0437b332000-05-02 09:56:41 +1000889AC_SUBST(INSTALL_SSH_PRNG_CMDS)
890
Damien Miller11e37f62000-04-08 18:23:30 +1000891
Damien Miller670a4b82000-01-22 13:53:11 +1100892AC_ARG_WITH(catman,
893 [ --with-catman=man|cat Install preformatted manpages[no]],
894 [
895 MANTYPE='$(CATMAN)'
896 if test x"$withval" != x"yes" ; then
897 mansubdir=$withval
898 else
899 mansubdir=cat
900 fi
901 ], [
902 if test -z "$MANTYPE" ; then
903 MANTYPE='$(TROFFMAN)'
904 mansubdir=man
905 fi
906 ]
907)
908AC_SUBST(MANTYPE)
909AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100910
Damien Millera22ba012000-03-02 23:09:20 +1100911# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000912KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100913AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100914 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100915 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100916 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100917
918 if test "x$withval" != "$xyes" ; then
919 CFLAGS="$CFLAGS -I${withval}/include"
920 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100921 if test ! -z "$need_dash_r" ; then
922 LDFLAGS="$LDFLAGS -R${withval}/lib"
923 fi
924 if test ! -z "$blibpath" ; then
925 blibpath="$blibpath:${withval}/lib"
926 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100927 else
928 if test -d /usr/include/kerberosIV ; then
929 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
930 fi
931 fi
932
933 AC_CHECK_HEADERS(krb.h)
934 AC_CHECK_LIB(krb, main)
935 if test "$ac_cv_header_krb_h" != yes; then
936 AC_MSG_WARN([Cannot find krb.h, build may fail])
937 fi
938 if test "$ac_cv_lib_krb_main" != yes; then
939 AC_MSG_WARN([Cannot find libkrb, build may fail])
940 fi
941
Damien Millerc85f9b42000-01-29 10:20:21 +1100942 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100943 AC_CHECK_LIB(resolv, dn_expand, , )
944 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000945 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100946 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100947 fi
Damien Miller80297751999-11-19 13:03:25 +1100948 ]
949)
950
Damien Millera22ba012000-03-02 23:09:20 +1100951# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000952AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100953AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100954 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100955 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100956 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100957
958 if test "x$withval" != "$xyes" ; then
959 CFLAGS="$CFLAGS -I${withval}/include"
960 LFLAGS="$LFLAGS -L${withval}/lib"
961 fi
962
963 if test -z "$KRB4" ; then
964 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
965 fi
966
Damien Miller8bdeee21999-12-30 15:50:54 +1100967 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100968 if test ! -z "$AFS_LIBS" ; then
969 LIBS="$LIBS $AFS_LIBS"
970 fi
971 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000972 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100973 fi
Damien Miller80297751999-11-19 13:03:25 +1100974 ]
975)
Damien Millerc85f9b42000-01-29 10:20:21 +1100976LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100977
Damien Millera22ba012000-03-02 23:09:20 +1100978# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000979SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100980AC_ARG_WITH(skey,
981 [ --with-skey Enable S/Key support],
982 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100983 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100984 AC_DEFINE(SKEY)
985 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000986 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100987 fi
Damien Miller80297751999-11-19 13:03:25 +1100988 ]
989)
990
Damien Millera22ba012000-03-02 23:09:20 +1100991# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000992TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100993AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100994 [ --with-tcp-wrappers Enable tcpwrappers support],
995 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100996 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100997 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100998 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100999 AC_MSG_CHECKING(for libwrap)
1000 AC_TRY_LINK(
1001 [
Damien Miller81171112000-04-23 11:14:01 +10001002#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +11001003 int deny_severity = 0, allow_severity = 0;
1004 ],
1005 [hosts_access(0);],
1006 [
1007 AC_MSG_RESULT(yes)
1008 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +10001009 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +11001010 ],
1011 [
Damien Miller7b22d652000-06-18 14:07:04 +10001012 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +11001013 ]
1014 )
Damien Miller8bdeee21999-12-30 15:50:54 +11001015 fi
Damien Miller80297751999-11-19 13:03:25 +11001016 ]
1017)
1018
Damien Millera22ba012000-03-02 23:09:20 +11001019# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +10001020MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +11001021AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001022 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +11001023 [
Damien Millerb85dcad2000-03-11 11:37:00 +11001024 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +11001025 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +10001026 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +11001027 fi
1028 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +11001029)
1030
Damien Millera22ba012000-03-02 23:09:20 +11001031# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +11001032AC_ARG_WITH(shadow,
1033 [ --without-shadow Disable shadow password support],
1034 [
1035 if test "x$withval" = "xno" ; then
1036 AC_DEFINE(DISABLE_SHADOW)
Damien Miller1f335fb2000-06-26 11:31:33 +10001037 disable_shadow=yes
Damien Miller76112de1999-12-21 11:18:08 +11001038 fi
1039 ]
1040)
1041
Damien Miller1f335fb2000-06-26 11:31:33 +10001042if test -z "$disable_shadow" ; then
1043 AC_MSG_CHECKING([if the systems has expire shadow information])
1044 AC_TRY_COMPILE(
1045 [
1046#include <sys/types.h>
1047#include <shadow.h>
1048 struct spwd sp;
1049 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1050 [ sp_expire_available=yes ], []
1051 )
1052
1053 if test "x$sp_expire_available" = "xyes" ; then
1054 AC_MSG_RESULT(yes)
1055 AC_DEFINE(HAS_SHADOW_EXPIRE)
1056 else
1057 AC_MSG_RESULT(no)
1058 fi
1059fi
1060
Damien Millera22ba012000-03-02 23:09:20 +11001061# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +10001062DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +11001063AC_ARG_WITH(ipaddr-display,
1064 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1065 [
Damien Millere477ef62000-08-15 10:21:17 +10001066 if test "x$withval" != "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +11001067 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +10001068 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +11001069 fi
1070 ]
1071)
1072
Damien Millera22ba012000-03-02 23:09:20 +11001073# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +10001074SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +11001075AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +11001076 [ --with-default-path=PATH Specify default \$PATH environment for server],
1077 [
1078 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +11001079 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +10001080 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +11001081 fi
1082 ]
1083)
1084
Damien Millera22ba012000-03-02 23:09:20 +11001085# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +10001086IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +11001087AC_ARG_WITH(ipv4-default,
1088 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
1089 [
1090 if test "x$withval" != "xno" ; then
1091 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +10001092 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +11001093 fi
1094 ]
1095)
1096
Damien Miller61e50f12000-05-08 20:49:37 +10001097AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +10001098IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +11001099AC_ARG_WITH(4in6,
1100 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1101 [
1102 if test "x$withval" != "xno" ; then
1103 AC_MSG_RESULT(yes)
1104 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001105 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001106 else
1107 AC_MSG_RESULT(no)
1108 fi
1109 ],[
1110 if test "x$inet6_default_4in6" = "xyes"; then
1111 AC_MSG_RESULT([yes (default)])
1112 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +10001113 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +11001114 else
1115 AC_MSG_RESULT([no (default)])
1116 fi
1117 ]
1118)
1119
Damien Millera22ba012000-03-02 23:09:20 +11001120# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +11001121piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +11001122AC_ARG_WITH(pid-dir,
1123 [ --with-pid-dir=PATH Specify location of ssh.pid file],
1124 [
1125 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +11001126 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +11001127 fi
1128 ]
1129)
Damien Miller4018c192000-04-30 09:30:44 +10001130
Damien Millerdbd250f2000-01-18 08:57:14 +11001131AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +11001132AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +11001133
andre2ff7b5d2000-06-03 14:57:40 +00001134dnl allow user to disable some login recording features
1135AC_ARG_ENABLE(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001136 [ --disable-lastlog disable use of lastlog even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001137 [ AC_DEFINE(DISABLE_LASTLOG) ]
1138)
1139AC_ARG_ENABLE(utmp,
andre43ca7e22000-06-19 08:23:46 +00001140 [ --disable-utmp disable use of utmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001141 [ AC_DEFINE(DISABLE_UTMP) ]
1142)
1143AC_ARG_ENABLE(utmpx,
andre43ca7e22000-06-19 08:23:46 +00001144 [ --disable-utmpx disable use of utmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001145 [ AC_DEFINE(DISABLE_UTMPX) ]
1146)
1147AC_ARG_ENABLE(wtmp,
andre43ca7e22000-06-19 08:23:46 +00001148 [ --disable-wtmp disable use of wtmp even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001149 [ AC_DEFINE(DISABLE_WTMP) ]
1150)
1151AC_ARG_ENABLE(wtmpx,
andre43ca7e22000-06-19 08:23:46 +00001152 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001153 [ AC_DEFINE(DISABLE_WTMPX) ]
1154)
1155AC_ARG_ENABLE(libutil,
andre43ca7e22000-06-19 08:23:46 +00001156 [ --disable-libutil disable use of libutil (login() etc.) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001157 [ AC_DEFINE(DISABLE_LOGIN) ]
1158)
1159AC_ARG_ENABLE(pututline,
andre43ca7e22000-06-19 08:23:46 +00001160 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001161 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
1162)
1163AC_ARG_ENABLE(pututxline,
andre43ca7e22000-06-19 08:23:46 +00001164 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
andre2ff7b5d2000-06-03 14:57:40 +00001165 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
1166)
1167AC_ARG_WITH(lastlog,
andre43ca7e22000-06-19 08:23:46 +00001168 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
andre2ff7b5d2000-06-03 14:57:40 +00001169 [ conf_lastlog_location="$withval"; ],)
1170
1171dnl lastlog, [uw]tmpx? detection
1172dnl NOTE: set the paths in the platform section to avoid the
1173dnl need for command-line parameters
1174dnl lastlog and [uw]tmp are subject to a file search if all else fails
1175
1176dnl lastlog detection
1177dnl NOTE: the code itself will detect if lastlog is a directory
1178AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1179AC_TRY_COMPILE([
1180#include <sys/types.h>
1181#include <utmp.h>
1182#ifdef HAVE_LASTLOG_H
1183# include <lastlog.h>
1184#endif
Damien Miller2994e082000-06-04 15:51:47 +10001185#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001186# include <paths.h>
1187#endif
1188 ],
1189 [ char *lastlog = LASTLOG_FILE; ],
1190 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001191 [
1192 AC_MSG_RESULT(no)
1193 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1194 AC_TRY_COMPILE([
1195#include <sys/types.h>
1196#include <utmp.h>
1197#ifdef HAVE_LASTLOG_H
1198# include <lastlog.h>
1199#endif
1200#ifdef HAVE_PATHS_H
1201# include <paths.h>
1202#endif
1203 ],
1204 [ char *lastlog = _PATH_LASTLOG; ],
1205 [ AC_MSG_RESULT(yes) ],
1206 [
andree441aa32000-06-12 22:34:38 +00001207 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001208 system_lastlog_path=no
1209 ])
1210 ]
andre2ff7b5d2000-06-03 14:57:40 +00001211)
Damien Miller2994e082000-06-04 15:51:47 +10001212
andre2ff7b5d2000-06-03 14:57:40 +00001213if test -z "$conf_lastlog_location"; then
1214 if test x"$system_lastlog_path" = x"no" ; then
1215 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Milleredb82922000-06-20 13:25:52 +10001216 if (test -d "$f" || test -f "$f") ; then
andre2ff7b5d2000-06-03 14:57:40 +00001217 conf_lastlog_location=$f
1218 fi
1219 done
1220 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001221 AC_MSG_WARN([** Cannot find lastlog **])
1222 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001223 fi
1224 fi
1225fi
1226
1227if test -n "$conf_lastlog_location"; then
1228 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1229fi
1230
1231dnl utmp detection
1232AC_MSG_CHECKING([if your system defines UTMP_FILE])
1233AC_TRY_COMPILE([
1234#include <sys/types.h>
1235#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001236#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001237# include <paths.h>
1238#endif
1239 ],
1240 [ char *utmp = UTMP_FILE; ],
1241 [ AC_MSG_RESULT(yes) ],
1242 [ AC_MSG_RESULT(no)
1243 system_utmp_path=no ]
1244)
1245if test -z "$conf_utmp_location"; then
1246 if test x"$system_utmp_path" = x"no" ; then
1247 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1248 if test -f $f ; then
1249 conf_utmp_location=$f
1250 fi
1251 done
1252 if test -z "$conf_utmp_location"; then
1253 AC_DEFINE(DISABLE_UTMP)
1254 fi
1255 fi
1256fi
1257if test -n "$conf_utmp_location"; then
1258 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1259fi
1260
1261dnl wtmp detection
1262AC_MSG_CHECKING([if your system defines WTMP_FILE])
1263AC_TRY_COMPILE([
1264#include <sys/types.h>
1265#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001266#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001267# include <paths.h>
1268#endif
1269 ],
1270 [ char *wtmp = WTMP_FILE; ],
1271 [ AC_MSG_RESULT(yes) ],
1272 [ AC_MSG_RESULT(no)
1273 system_wtmp_path=no ]
1274)
1275if test -z "$conf_wtmp_location"; then
1276 if test x"$system_wtmp_path" = x"no" ; then
1277 for f in /usr/adm/wtmp /var/log/wtmp; do
1278 if test -f $f ; then
1279 conf_wtmp_location=$f
1280 fi
1281 done
1282 if test -z "$conf_wtmp_location"; then
1283 AC_DEFINE(DISABLE_WTMP)
1284 fi
1285 fi
1286fi
1287if test -n "$conf_wtmp_location"; then
1288 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1289fi
1290
1291
1292dnl utmpx detection - I don't know any system so perverse as to require
1293dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1294dnl there, though.
1295AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1296AC_TRY_COMPILE([
1297#include <sys/types.h>
1298#include <utmp.h>
1299#ifdef HAVE_UTMPX_H
1300#include <utmpx.h>
1301#endif
Damien Miller2994e082000-06-04 15:51:47 +10001302#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001303# include <paths.h>
1304#endif
1305 ],
1306 [ char *utmpx = UTMPX_FILE; ],
1307 [ AC_MSG_RESULT(yes) ],
1308 [ AC_MSG_RESULT(no)
1309 system_utmpx_path=no ]
1310)
1311if test -z "$conf_utmpx_location"; then
1312 if test x"$system_utmpx_path" = x"no" ; then
1313 AC_DEFINE(DISABLE_UTMPX)
1314 fi
1315else
1316 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1317fi
1318
1319dnl wtmpx detection
1320AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1321AC_TRY_COMPILE([
1322#include <sys/types.h>
1323#include <utmp.h>
1324#ifdef HAVE_UTMPX_H
1325#include <utmpx.h>
1326#endif
Damien Miller2994e082000-06-04 15:51:47 +10001327#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001328# include <paths.h>
1329#endif
1330 ],
1331 [ char *wtmpx = WTMPX_FILE; ],
1332 [ AC_MSG_RESULT(yes) ],
1333 [ AC_MSG_RESULT(no)
1334 system_wtmpx_path=no ]
1335)
1336if test -z "$conf_wtmpx_location"; then
1337 if test x"$system_wtmpx_path" = x"no" ; then
1338 AC_DEFINE(DISABLE_WTMPX)
1339 fi
1340else
1341 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1342fi
1343
Damien Miller4018c192000-04-30 09:30:44 +10001344
1345# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001346entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001347AC_ARG_WITH(entropy-timeout,
1348 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1349 [
1350 if test "x$withval" != "xno" ; then
1351 entropy_timeout=$withval
1352 fi
1353 ]
1354)
1355AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1356
1357
Damien Miller29ea30d2000-03-17 10:54:15 +11001358if test ! -z "$blibpath" ; then
1359 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1360 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1361fi
1362
Damien Miller0437b332000-05-02 09:56:41 +10001363AC_OUTPUT(Makefile ssh_prng_cmds)
1364
Damien Miller7b22d652000-06-18 14:07:04 +10001365# Print summary of options
1366
1367if test x$MANTYPE = x'$(CATMAN)' ; then
1368 MAN_MSG=cat
1369else
1370 MAN_MSG=man
1371fi
1372if test ! -z "$RANDOM_POOL" ; then
1373 RAND_MSG="Device ($RANDOM_POOL)"
1374else
1375 if test ! -z "$EGD_SOCKET" ; then
1376 RAND_MSG="EGD ($EGD_SOCKET)"
1377 else
1378 RAND_MSG="Builtin (timeout $entropy_timeout)"
1379 fi
1380fi
1381
1382# Someone please show me a better way :)
1383A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1384B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1385C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1386D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1387E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1388F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1389G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1390
1391echo ""
1392echo "OpenSSH configured has been configured with the following options."
1393echo " User binaries: $B"
1394echo " System binaries: $C"
1395echo " Configuration files: $D"
1396echo " Askpass program: $E"
1397echo " Manual pages: $F"
1398echo " PID file: $G"
1399echo " Random number collection: $RAND_MSG"
1400echo " Manpage format: $MAN_MSG"
1401echo " PAM support: ${PAM_MSG}"
1402echo " KerberosIV support: $KRB4_MSG"
1403echo " AFS support: $AFS_MSG"
1404echo " S/KEY support: $SKEY_MSG"
1405echo " TCP Wrappers support: $TCPW_MSG"
1406echo " MD5 password support: $MD5_MSG"
1407echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1408echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1409echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1410
1411echo ""
1412
1413echo "Compiler flags: ${CFLAGS}"
1414echo "Linker flags: ${LDFLAGS}"
1415echo "Libraries: ${LIBS}"
1416
1417echo ""
1418