blob: f0edebacc46996bb1f43af8f5cac9fd29df5b569 [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 Miller29ea30d2000-03-17 10:54:15 +110034 if test "$LD" != "gcc" -a -z "$blibpath"; then
35 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 Miller75b1d102000-01-07 14:01:41 +110043 ;;
Damien Miller76112de1999-12-21 11:18:08 +110044*-*-hpux10*)
45 if test -z "$GCC"; then
Damien Millerfda78d92000-05-20 15:33:44 +100046 CFLAGS="$CFLAGS -Ae"
Damien Miller76112de1999-12-21 11:18:08 +110047 fi
48 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
49 AC_DEFINE(IPADDR_IN_DISPLAY)
50 AC_MSG_CHECKING(for HPUX trusted system password database)
51 if test -f /tcb/files/auth/system/default; then
52 AC_MSG_RESULT(yes)
53 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
54 LIBS="$LIBS -lsec"
Damien Miller105b7f02000-01-07 08:45:55 +110055 AC_MSG_WARN([This configuration is untested])
Damien Miller76112de1999-12-21 11:18:08 +110056 else
57 AC_MSG_RESULT(no)
58 AC_DEFINE(DISABLE_SHADOW)
59 fi
Damien Miller670a4b82000-01-22 13:53:11 +110060 MANTYPE='$(CATMAN)'
61 mansubdir=cat
Damien Miller76112de1999-12-21 11:18:08 +110062 ;;
Damien Miller1bead332000-04-30 00:47:29 +100063*-*-hpux11*)
64 if test -z "$GCC"; then
65 CFLAGS="$CFLAGS -Ae"
66 fi
67 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
Damien Miller1bead332000-04-30 00:47:29 +100068 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller1bead332000-04-30 00:47:29 +100069 AC_MSG_CHECKING(for HPUX trusted system password database)
70 if test -f /tcb/files/auth/system/default; then
71 AC_MSG_RESULT(yes)
72 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
73 LIBS="$LIBS -lsec"
74 AC_MSG_WARN([This configuration is untested])
75 else
76 AC_MSG_RESULT(no)
77 AC_DEFINE(DISABLE_SHADOW)
78 fi
79 MANTYPE='$(CATMAN)'
80 mansubdir=cat
81 ;;
Damien Millerbeb4ba51999-12-28 15:09:35 +110082*-*-irix5*)
Damien Millerdb819592000-03-14 13:44:01 +110083 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100084 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110085 MANTYPE='$(CATMAN)'
Damien Miller1808f382000-01-06 12:03:12 +110086 no_libsocket=1
87 no_libnsl=1
88 ;;
89*-*-irix6*)
Damien Millerdb819592000-03-14 13:44:01 +110090 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller9e110892000-06-07 21:05:46 +100091 LDFLAGS="$LDFLAGS"
Damien Miller07278932000-01-22 14:05:37 +110092 MANTYPE='$(CATMAN)'
93 AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ])
Damien Millerbeb4ba51999-12-28 15:09:35 +110094 no_libsocket=1
95 no_libnsl=1
96 ;;
Damien Millerb29ea912000-01-15 14:12:03 +110097*-*-linux*)
98 no_dev_ptmx=1
Damien Miller7bcb0892000-03-11 20:45:40 +110099 AC_DEFINE(DONT_TRY_OTHER_AF)
100 inet6_default_4in6=yes
Damien Millerb29ea912000-01-15 14:12:03 +1100101 ;;
Damien Milleree1c0b32000-01-21 00:18:15 +1100102*-*-netbsd*)
Damien Millera22ba012000-03-02 23:09:20 +1100103 need_dash_r=1
Damien Milleree1c0b32000-01-21 00:18:15 +1100104 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100105*-*-solaris*)
Damien Millerdb819592000-03-14 13:44:01 +1100106 CFLAGS="$CFLAGS -I/usr/local/include"
Damien Miller08c788a2000-03-16 07:52:29 +1100107 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
Damien Millera22ba012000-03-02 23:09:20 +1100108 need_dash_r=1
andre2ff7b5d2000-06-03 14:57:40 +0000109 # hardwire lastlog location (can't detect it on some versions)
110 conf_lastlog_location="/var/adm/lastlog"
Damien Millera1cb6442000-06-09 11:58:35 +1000111 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
112 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
113 if test "$sol2ver" -ge 8; then
114 AC_MSG_RESULT(yes)
115 AC_DEFINE(DISABLE_UTMP)
116 AC_DEFINE(DISABLE_WTMP)
117 else
118 AC_MSG_RESULT(no)
119 fi
Damien Miller75b1d102000-01-07 14:01:41 +1100120 ;;
Damien Millerdfc83f42000-05-20 15:02:59 +1000121*-*-sunos4*)
122 CFLAGS="$CFLAGS -DSUNOS4"
123 AC_CHECK_FUNCS(getpwanam)
124 ;;
Damien Miller75b1d102000-01-07 14:01:41 +1100125*-*-sysv*)
Damien Millerdb819592000-03-14 13:44:01 +1100126 CFLAGS="$CFLAGS -I/usr/local/include"
127 LDFLAGS="$LDFLAGS -L/usr/local/lib"
Damien Miller0e1cf7c2000-01-26 12:15:30 +1100128 MANTYPE='$(CATMAN)'
129 mansubdir=cat
Damien Miller75b1d102000-01-07 14:01:41 +1100130 LIBS="$LIBS -lgen -lsocket"
131 ;;
Damien Millera66626b2000-06-13 18:57:53 +1000132*-*-sco3*)
133 CFLAGS="$CFLAGS -I/usr/local/include"
134 LDFLAGS="$LDFLAGS -L/usr/local/lib"
135 MANTYPE='$(CATMAN)'
136 mansubdir=cat
137 LIBS="$LIBS -lgen -lsocket"
138 no_dev_ptmx=1
139 ;;
Damien Miller76112de1999-12-21 11:18:08 +1100140esac
141
Damien Millere37bfc12000-06-05 09:37:43 +1000142# Allow user to specify flags
143AC_ARG_WITH(cflags,
144 [ --with-cflags Specify additional flags to pass to compiler],
145 [
146 if test "x$withval" != "xno" ; then
147 CFLAGS="$CFLAGS $withval"
148 fi
149 ]
150)
151AC_ARG_WITH(ldflags,
152 [ --with-ldlags Specify additional flags to pass to linker],
153 [
154 if test "x$withval" != "xno" ; then
155 LDFLAGS="$LDFLAGS $withval"
156 fi
157 ]
158)
159AC_ARG_WITH(libs,
160 [ --with-libs Specify additional libraries to link with],
161 [
162 if test "x$withval" != "xno" ; then
163 LIBS="$LIBS $withval"
164 fi
165 ]
166)
167
168
Damien Millera22ba012000-03-02 23:09:20 +1100169# Checks for libraries.
Damien Millerab18c411999-11-11 10:40:23 +1100170AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
171AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
Damien Millerab18c411999-11-11 10:40:23 +1100172
Damien Millerbeb4ba51999-12-28 15:09:35 +1100173if test -z "$no_libsocket" ; then
174 AC_CHECK_LIB(nsl, yp_match, , )
175fi
176if test -z "$no_libnsl" ; then
177 AC_CHECK_LIB(socket, main, , )
Damien Miller32b3cf21999-12-26 10:21:48 +1100178fi
Damien Millerab18c411999-11-11 10:40:23 +1100179
Damien Millera22ba012000-03-02 23:09:20 +1100180# Checks for header files.
Damien Millera66626b2000-06-13 18:57:53 +1000181AC_CHECK_HEADERS(bstring.h endian.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/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h util.h utmp.h utmpx.h)
Damien Millerab18c411999-11-11 10:40:23 +1100182
Damien Millera22ba012000-03-02 23:09:20 +1100183# Checks for library functions.
andre2ff7b5d2000-06-03 14:57:40 +0000184AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop)
185dnl checks for time functions
186AC_CHECK_FUNCS(gettimeofday time)
187dnl checks for libutil functions
188AC_CHECK_FUNCS(login logout updwtmp logwtmp)
189dnl checks for utmp functions
190AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
191AC_CHECK_FUNCS(utmpname)
192dnl checks for utmpx functions
193AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
194AC_CHECK_FUNCS(setutxent utmpxname)
Damien Millercedfecc1999-11-15 14:36:53 +1100195
Damien Miller04f80141999-11-19 15:32:34 +1100196AC_CHECK_FUNC(login,
197 [AC_DEFINE(HAVE_LOGIN)],
198 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
199)
200
201AC_CHECK_FUNC(daemon,
202 [AC_DEFINE(HAVE_DAEMON)],
203 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
204)
205
Damien Miller9fb07e42000-03-05 16:22:59 +1100206AC_CHECK_FUNC(getpagesize,
207 [AC_DEFINE(HAVE_GETPAGESIZE)],
208 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
209)
210
Damien Miller7b22d652000-06-18 14:07:04 +1000211PAM_MSG="no"
Damien Millera22ba012000-03-02 23:09:20 +1100212AC_ARG_WITH(pam,
213 [ --without-pam Disable PAM support ],
214 [
215 if test "x$withval" = "xno" ; then
216 no_pam=1
217 AC_DEFINE(DISABLE_PAM)
Damien Miller7b22d652000-06-18 14:07:04 +1000218 PAM_MSG="disabled"
Damien Millera22ba012000-03-02 23:09:20 +1100219 fi
220 ]
221)
222if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
223 AC_CHECK_LIB(dl, dlopen, , )
224 LIBS="$LIBS -lpam"
225
Damien Miller0e65eed2000-05-17 22:16:05 +1000226 AC_CHECK_FUNCS(pam_getenvlist)
Damien Miller1bead332000-04-30 00:47:29 +1000227
Damien Miller7b22d652000-06-18 14:07:04 +1000228 PAM_MSG="yes"
229
Damien Millera22ba012000-03-02 23:09:20 +1100230 # Check PAM strerror arguments (old PAM)
231 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
232 AC_TRY_COMPILE(
233 [
Damien Miller81171112000-04-23 11:14:01 +1000234#include <stdlib.h>
235#include <security/pam_appl.h>
Damien Millera22ba012000-03-02 23:09:20 +1100236 ],
237 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
238 [AC_MSG_RESULT(no)],
239 [
240 AC_DEFINE(HAVE_OLD_PAM)
241 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000242 PAM_MSG="yes (old library)"
Damien Millera22ba012000-03-02 23:09:20 +1100243 ]
244 )
245fi
246
247# The big search for OpenSSL
248AC_ARG_WITH(ssl-dir,
249 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
250 [
251 if test "x$withval" != "$xno" ; then
252 tryssldir=$withval
253 fi
254 ]
255)
256
257saved_LIBS="$LIBS"
Damien Millera1ad4802000-03-15 10:04:54 +1100258saved_LDFLAGS="$LDFLAGS"
Damien Millera22ba012000-03-02 23:09:20 +1100259saved_CFLAGS="$CFLAGS"
260if test "x$prefix" != "xNONE" ; then
261 tryssldir="$tryssldir $prefix"
262fi
Damien Miller61e50f12000-05-08 20:49:37 +1000263AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
Damien Millera22ba012000-03-02 23:09:20 +1100264
Damien Miller61e50f12000-05-08 20:49:37 +1000265 for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
266 if test ! -z "$ssldir" ; then
267 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
268 CFLAGS="$saved_CFLAGS -I$ssldir/include"
269 if test ! -z "$need_dash_r" ; then
270 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
271 fi
Damien Millera1ad4802000-03-15 10:04:54 +1100272 else
Damien Miller61e50f12000-05-08 20:49:37 +1000273 LDFLAGS="$saved_LDFLAGS"
Damien Millerb85dcad2000-03-11 11:37:00 +1100274 fi
275
Damien Miller3b512e12000-05-17 23:29:18 +1000276 LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000277
Damien Miller3b512e12000-05-17 23:29:18 +1000278 # Basic test to check for compatible version and correct linking
279 # *does not* test for RSA - that comes later.
280 AC_TRY_RUN(
281 [
Damien Millere59ce622000-05-01 20:54:17 +1000282#include <string.h>
283#include <openssl/rand.h>
Damien Miller81171112000-04-23 11:14:01 +1000284int main(void)
285{
Damien Miller3b512e12000-05-17 23:29:18 +1000286 char a[2048];
287 memset(a, 0, sizeof(a));
Damien Miller81171112000-04-23 11:14:01 +1000288 RAND_add(a, sizeof(a), sizeof(a));
Damien Miller3b512e12000-05-17 23:29:18 +1000289 return(RAND_status() <= 0);
Damien Miller81171112000-04-23 11:14:01 +1000290}
Damien Miller3b512e12000-05-17 23:29:18 +1000291 ],
292 [
293 found_crypto=1
294 break;
295 ], []
296 )
Damien Miller61e50f12000-05-08 20:49:37 +1000297
298 if test ! -z "$found_crypto" ; then
299 break;
300 fi
Damien Millerb85dcad2000-03-11 11:37:00 +1100301 done
302
Damien Miller61e50f12000-05-08 20:49:37 +1000303 if test -z "$found_crypto" ; then
304 AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install])
Damien Millerb85dcad2000-03-11 11:37:00 +1100305 fi
Damien Miller61e50f12000-05-08 20:49:37 +1000306 if test -z "$ssldir" ; then
307 ssldir="(system)"
308 fi
Damien Millera22ba012000-03-02 23:09:20 +1100309
Damien Miller61e50f12000-05-08 20:49:37 +1000310 ac_cv_openssldir=$ssldir
311])
312
313if test ! -z "$ac_cv_openssldir" -a ! "x$ac_cv_openssldir" = "x(system)" ; then
314 AC_DEFINE(HAVE_OPENSSL)
315 dnl Need to recover ssldir - test above runs in subshell
316 ssldir=$ac_cv_openssldir
Damien Millera1ad4802000-03-15 10:04:54 +1100317 CFLAGS="$saved_CFLAGS -I$ssldir/include"
318 LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
319 if test ! -z "$need_dash_r" ; then
320 LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
Damien Millera22ba012000-03-02 23:09:20 +1100321 fi
Damien Miller29ea30d2000-03-17 10:54:15 +1100322 if test ! -z "$blibpath" ; then
323 blibpath="$blibpath:$ssldir:$ssldir/lib"
324 fi
Damien Millera22ba012000-03-02 23:09:20 +1100325fi
Damien Miller3b512e12000-05-17 23:29:18 +1000326LIBS="$saved_LIBS -lcrypto"
Damien Miller61e50f12000-05-08 20:49:37 +1000327
Damien Miller3b512e12000-05-17 23:29:18 +1000328# Now test RSA support
329saved_LIBS="$LIBS"
330AC_MSG_CHECKING([for RSA support])
331for WANTS_RSAREF in "" 1 ; do
332 if test -z "$WANTS_RSAREF" ; then
333 LIBS="$saved_LIBS"
334 else
335 LIBS="$saved_LIBS -lRSAglue -lrsaref"
336 fi
337 AC_TRY_RUN([
338#include <string.h>
339#include <openssl/rand.h>
340#include <openssl/rsa.h>
341#include <openssl/bn.h>
342#include <openssl/sha.h>
343int main(void)
344{
345 int num; RSA *key; static unsigned char p_in[] = "blahblah";
346 unsigned char c[256], p[256];
347 memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c));
348 if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1);
349 num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING);
350 return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING));
351}
352 ],
353 [
354 rsa_works=1
355 break;
356 ], [])
357done
358
359if test ! -z "$no_rsa" ; then
360 AC_MSG_RESULT(disabled)
Damien Miller7b22d652000-06-18 14:07:04 +1000361 RSA_MSG="disabled"
Damien Miller3b512e12000-05-17 23:29:18 +1000362else
363 if test -z "$rsa_works" ; then
364 AC_MSG_WARN([*** No RSA support found *** ])
Damien Miller7b22d652000-06-18 14:07:04 +1000365 RSA_MSG="no"
Damien Miller3b512e12000-05-17 23:29:18 +1000366 else
367 if test -z "$WANTS_RSAREF" ; then
368 AC_MSG_RESULT(yes)
Damien Miller7b22d652000-06-18 14:07:04 +1000369 RSA_MSG="yes"
Damien Miller3b512e12000-05-17 23:29:18 +1000370 else
Damien Miller7b22d652000-06-18 14:07:04 +1000371 RSA_MSG="yes (using RSAref)"
Damien Miller3b512e12000-05-17 23:29:18 +1000372 AC_MSG_RESULT(using RSAref)
373 LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref"
374 fi
375 fi
376fi
Damien Millera22ba012000-03-02 23:09:20 +1100377
378# Checks for data types
Damien Millere0f45742000-01-18 09:12:06 +1100379AC_CHECK_SIZEOF(char, 1)
Damien Millerc6398ef1999-11-20 12:18:40 +1100380AC_CHECK_SIZEOF(short int, 2)
381AC_CHECK_SIZEOF(int, 4)
382AC_CHECK_SIZEOF(long int, 4)
383AC_CHECK_SIZEOF(long long int, 8)
384
Damien Millera22ba012000-03-02 23:09:20 +1100385# More checks for data types
Damien Miller61e50f12000-05-08 20:49:37 +1000386AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
387 AC_TRY_COMPILE(
388 [ #include <sys/types.h> ],
389 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
390 [ ac_cv_have_intxx_t="yes" ],
391 [ ac_cv_have_intxx_t="no" ]
392 )
393])
394if test "x$ac_cv_have_intxx_t" = "xyes" ; then
395 AC_DEFINE(HAVE_INTXX_T)
396 have_intxx_t=1
397fi
398
399AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
400 AC_TRY_COMPILE(
401 [ #include <sys/types.h> ],
402 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
403 [ ac_cv_have_u_intxx_t="yes" ],
404 [ ac_cv_have_u_intxx_t="no" ]
405 )
406])
407if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
408 AC_DEFINE(HAVE_U_INTXX_T)
409 have_u_intxx_t=1
410fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100411
Damien Millerc6398ef1999-11-20 12:18:40 +1100412
Damien Millereaf99942000-01-19 13:45:07 +1100413if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \
Damien Millerb29ea912000-01-15 14:12:03 +1100414 "x$ac_cv_header_sys_bitypes_h" = "xyes"
415then
416 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
417 AC_TRY_COMPILE(
Damien Miller61e50f12000-05-08 20:49:37 +1000418 [
419#include <sys/bitypes.h>
420 ],
Damien Millerb29ea912000-01-15 14:12:03 +1100421 [
Damien Miller70494d12000-04-03 15:57:06 +1000422 int8_t a; int16_t b; int32_t c;
423 u_int8_t e; u_int16_t f; u_int32_t g;
424 a = b = c = e = f = g = 1;
Damien Millerb29ea912000-01-15 14:12:03 +1100425 ],
426 [
427 AC_DEFINE(HAVE_U_INTXX_T)
428 AC_DEFINE(HAVE_INTXX_T)
429 AC_MSG_RESULT(yes)
430 ],
431 [AC_MSG_RESULT(no)]
432 )
433fi
434
Damien Millerd6121d22000-03-17 23:26:46 +1100435if test -z "$have_u_intxx_t" ; then
Damien Miller61e50f12000-05-08 20:49:37 +1000436 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
437 AC_TRY_COMPILE(
438 [
439#include <sys/types.h>
440 ],
441 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
442 [ ac_cv_have_uintxx_t="yes" ],
443 [ ac_cv_have_uintxx_t="no" ]
444 )
445 ])
446 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
447 AC_DEFINE(HAVE_UINTXX_T)
448 fi
Damien Millerd6121d22000-03-17 23:26:46 +1100449fi
Damien Millerc6398ef1999-11-20 12:18:40 +1100450
Damien Miller61e50f12000-05-08 20:49:37 +1000451AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [
452 AC_TRY_COMPILE(
453 [
Damien Miller81171112000-04-23 11:14:01 +1000454#include <sys/types.h>
455#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000456 ],
457 [socklen_t foo; foo = 1235;],
458 [ ac_cv_have_socklen_t="yes" ],
459 [ ac_cv_have_socklen_t="no" ]
460 )
461])
462if test "x$ac_cv_have_socklen_t" = "xyes" ; then
463 AC_DEFINE(HAVE_SOCKLEN_T)
464fi
Damien Miller74d0d4a1999-12-29 02:24:35 +1100465
Damien Miller61e50f12000-05-08 20:49:37 +1000466AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
467 AC_TRY_COMPILE(
468 [
469#include <sys/types.h>
470 ],
471 [ size_t foo; foo = 1235; ],
472 [ ac_cv_have_size_t="yes" ],
473 [ ac_cv_have_size_t="no" ]
474 )
475])
476if test "x$ac_cv_have_size_t" = "xyes" ; then
477 AC_DEFINE(HAVE_SIZE_T)
478fi
Damien Miller95058511999-12-29 10:36:45 +1100479
Damien Miller615f9392000-05-17 22:53:33 +1000480AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
481 AC_TRY_COMPILE(
482 [
483#include <sys/types.h>
484 ],
485 [ ssize_t foo; foo = 1235; ],
486 [ ac_cv_have_ssize_t="yes" ],
487 [ ac_cv_have_ssize_t="no" ]
488 )
489])
490if test "x$ac_cv_have_ssize_t" = "xyes" ; then
491 AC_DEFINE(HAVE_SSIZE_T)
492fi
493
Damien Miller61e50f12000-05-08 20:49:37 +1000494
495AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
496 AC_TRY_COMPILE(
497 [
Damien Miller81171112000-04-23 11:14:01 +1000498#include <sys/types.h>
499#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000500 ],
501 [ struct sockaddr_storage s; ],
502 [ ac_cv_have_struct_sockaddr_storage="yes" ],
503 [ ac_cv_have_struct_sockaddr_storage="no" ]
504 )
505])
506if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
507 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
508fi
Damien Miller34132e52000-01-14 15:45:46 +1100509
Damien Miller61e50f12000-05-08 20:49:37 +1000510AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
511 AC_TRY_COMPILE(
512 [
Damien Miller7b22d652000-06-18 14:07:04 +1000513#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000514#include <netinet/in.h>
515 ],
516 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
517 [ ac_cv_have_struct_sockaddr_in6="yes" ],
518 [ ac_cv_have_struct_sockaddr_in6="no" ]
519 )
520])
521if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
522 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
523fi
Damien Miller34132e52000-01-14 15:45:46 +1100524
Damien Miller61e50f12000-05-08 20:49:37 +1000525AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
526 AC_TRY_COMPILE(
527 [
Damien Miller7b22d652000-06-18 14:07:04 +1000528#include <sys/types.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000529#include <netinet/in.h>
530 ],
531 [ struct in6_addr s; s.s6_addr[0] = 0; ],
532 [ ac_cv_have_struct_in6_addr="yes" ],
533 [ ac_cv_have_struct_in6_addr="no" ]
534 )
535])
536if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
537 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
538fi
Damien Miller34132e52000-01-14 15:45:46 +1100539
Damien Miller61e50f12000-05-08 20:49:37 +1000540AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
541 AC_TRY_COMPILE(
542 [
Damien Miller81171112000-04-23 11:14:01 +1000543#include <sys/types.h>
544#include <sys/socket.h>
545#include <netdb.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000546 ],
547 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
548 [ ac_cv_have_struct_addrinfo="yes" ],
549 [ ac_cv_have_struct_addrinfo="no" ]
550 )
551])
552if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
553 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
554fi
555
Damien Miller34132e52000-01-14 15:45:46 +1100556
Damien Millera22ba012000-03-02 23:09:20 +1100557# Checks for structure members
Damien Miller34132e52000-01-14 15:45:46 +1100558
Damien Miller61e50f12000-05-08 20:49:37 +1000559OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
560OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
561OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
562OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
563OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
Damien Millerad1bc5f2000-05-20 14:53:09 +1000564OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
Damien Miller61e50f12000-05-08 20:49:37 +1000565OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
566OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
567OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
568OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
569OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
570OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
andre2ff7b5d2000-06-03 14:57:40 +0000571OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
572OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
573OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
574OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
575
Damien Miller61e50f12000-05-08 20:49:37 +1000576AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
577 ac_cv_have_ss_family_in_struct_ss, [
578 AC_TRY_COMPILE(
579 [
Damien Miller81171112000-04-23 11:14:01 +1000580#include <sys/types.h>
581#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000582 ],
583 [ struct sockaddr_storage s; s.ss_family = 1; ],
584 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
585 [ ac_cv_have_ss_family_in_struct_ss="no" ],
586 )
587])
588if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
589 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
590fi
591
Damien Miller61e50f12000-05-08 20:49:37 +1000592AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
593 ac_cv_have___ss_family_in_struct_ss, [
594 AC_TRY_COMPILE(
595 [
Damien Miller81171112000-04-23 11:14:01 +1000596#include <sys/types.h>
597#include <sys/socket.h>
Damien Miller61e50f12000-05-08 20:49:37 +1000598 ],
599 [ struct sockaddr_storage s; s.__ss_family = 1; ],
600 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
601 [ ac_cv_have___ss_family_in_struct_ss="no" ]
602 )
603])
604if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
605 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
606fi
Damien Millerbf1c9b21999-12-09 10:16:54 +1100607
Damien Miller61e50f12000-05-08 20:49:37 +1000608
609AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
610 AC_TRY_LINK([],
611 [ extern char *__progname; printf("%s", __progname); ],
612 [ ac_cv_libc_defines___progname="yes" ],
613 [ ac_cv_libc_defines___progname="no" ]
614 )
615])
616if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
617 AC_DEFINE(HAVE___PROGNAME)
618fi
619
Damien Millera22ba012000-03-02 23:09:20 +1100620
621# Looking for programs, paths and files
622AC_ARG_WITH(rsh,
623 [ --with-rsh=PATH Specify path to remote shell program ],
624 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100625 if test "x$withval" != "$no" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000626 rsa_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100627 fi
628 ],
629 [
630 AC_PATH_PROG(rsh_path, rsh)
631 ]
632)
633
634AC_ARG_WITH(xauth,
635 [ --with-xauth=PATH Specify path to xauth program ],
636 [
637 if test "x$withval" != "$xno" ; then
Damien Miller7b22d652000-06-18 14:07:04 +1000638 xauth_path=$withval
Damien Millera22ba012000-03-02 23:09:20 +1100639 fi
640 ],
641 [
642 AC_PATH_PROG(xauth_path, xauth)
643 if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then
644 xauth_path="/usr/openwin/bin/xauth"
645 fi
646 ]
647)
648
649if test ! -z "$xauth_path" ; then
650 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
651fi
652if test ! -z "$rsh_path" ; then
653 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
654fi
655
656# Check for mail directory (last resort if we cannot get it from headers)
657if test ! -z "$MAIL" ; then
658 maildir=`dirname $MAIL`
659 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
660fi
661
Damien Millera22ba012000-03-02 23:09:20 +1100662if test -z "$no_dev_ptmx" ; then
Damien Miller204ad072000-03-02 23:56:12 +1100663 AC_CHECK_FILE("/dev/ptmx",
664 [
665 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
666 have_dev_ptmx=1
667 ]
668 )
Damien Millera22ba012000-03-02 23:09:20 +1100669fi
Damien Miller204ad072000-03-02 23:56:12 +1100670AC_CHECK_FILE("/dev/ptc",
671 [
672 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
673 have_dev_ptc=1
674 ]
675)
676
Damien Millera22ba012000-03-02 23:09:20 +1100677# Options from here on. Some of these are preset by platform above
678
Damien Millera22ba012000-03-02 23:09:20 +1100679# Check for user-specified random device, otherwise check /dev/urandom
680AC_ARG_WITH(random,
681 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
682 [
Damien Miller040f3832000-04-03 14:50:43 +1000683 if test "x$withval" != "xno" ; then
684 RANDOM_POOL="$withval";
685 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
686 fi
Damien Millera22ba012000-03-02 23:09:20 +1100687 ],
688 [
689 # Check for random device
690 AC_CHECK_FILE("/dev/urandom",
691 [
692 RANDOM_POOL="/dev/urandom";
693 AC_SUBST(RANDOM_POOL)
694 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
695 ]
696 )
697 ]
698)
699
700# Check for EGD pool file
701AC_ARG_WITH(egd-pool,
702 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
703 [
Damien Miller040f3832000-04-03 14:50:43 +1000704 if test "x$withval" != "xno" ; then
705 EGD_SOCKET="$withval";
706 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
707 fi
Damien Millera22ba012000-03-02 23:09:20 +1100708 ]
709)
710
Damien Miller0437b332000-05-02 09:56:41 +1000711# detect pathnames for entropy gathering commands, if we need them
712INSTALL_SSH_PRNG_CMDS=""
713rm -f prng_commands
Damien Miller11e37f62000-04-08 18:23:30 +1000714if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then
715 # Use these commands to collect entropy
Damien Miller61e50f12000-05-08 20:49:37 +1000716 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
717 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
718 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
719 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
720 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
721 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
722 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
723 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
724 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
725 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
726 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
727 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
728 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
729 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
730 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
Damien Miller0437b332000-05-02 09:56:41 +1000731
732 INSTALL_SSH_PRNG_CMDS="yes"
Damien Miller11e37f62000-04-08 18:23:30 +1000733fi
Damien Miller0437b332000-05-02 09:56:41 +1000734AC_SUBST(INSTALL_SSH_PRNG_CMDS)
735
Damien Miller11e37f62000-04-08 18:23:30 +1000736
Damien Miller670a4b82000-01-22 13:53:11 +1100737AC_ARG_WITH(catman,
738 [ --with-catman=man|cat Install preformatted manpages[no]],
739 [
740 MANTYPE='$(CATMAN)'
741 if test x"$withval" != x"yes" ; then
742 mansubdir=$withval
743 else
744 mansubdir=cat
745 fi
746 ], [
747 if test -z "$MANTYPE" ; then
748 MANTYPE='$(TROFFMAN)'
749 mansubdir=man
750 fi
751 ]
752)
753AC_SUBST(MANTYPE)
754AC_SUBST(mansubdir)
Damien Miller8bdeee21999-12-30 15:50:54 +1100755
Damien Millera22ba012000-03-02 23:09:20 +1100756# Check whether user wants Kerberos support
Damien Miller7b22d652000-06-18 14:07:04 +1000757KRB4_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100758AC_ARG_WITH(kerberos4,
Damien Miller105b7f02000-01-07 08:45:55 +1100759 [ --with-kerberos4=PATH Enable Kerberos 4 support],
Damien Miller80297751999-11-19 13:03:25 +1100760 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100761 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100762
763 if test "x$withval" != "$xyes" ; then
764 CFLAGS="$CFLAGS -I${withval}/include"
765 LDFLAGS="$LDFLAGS -L${withval}/lib"
Damien Miller29ea30d2000-03-17 10:54:15 +1100766 if test ! -z "$need_dash_r" ; then
767 LDFLAGS="$LDFLAGS -R${withval}/lib"
768 fi
769 if test ! -z "$blibpath" ; then
770 blibpath="$blibpath:${withval}/lib"
771 fi
Damien Miller105b7f02000-01-07 08:45:55 +1100772 else
773 if test -d /usr/include/kerberosIV ; then
774 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
775 fi
776 fi
777
778 AC_CHECK_HEADERS(krb.h)
779 AC_CHECK_LIB(krb, main)
780 if test "$ac_cv_header_krb_h" != yes; then
781 AC_MSG_WARN([Cannot find krb.h, build may fail])
782 fi
783 if test "$ac_cv_lib_krb_main" != yes; then
784 AC_MSG_WARN([Cannot find libkrb, build may fail])
785 fi
786
Damien Millerc85f9b42000-01-29 10:20:21 +1100787 KLIBS="-lkrb -ldes"
Damien Miller105b7f02000-01-07 08:45:55 +1100788 AC_CHECK_LIB(resolv, dn_expand, , )
789 KRB4=yes
Damien Miller7b22d652000-06-18 14:07:04 +1000790 KRB4_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100791 AC_DEFINE(KRB4)
Damien Miller8bdeee21999-12-30 15:50:54 +1100792 fi
Damien Miller80297751999-11-19 13:03:25 +1100793 ]
794)
795
Damien Millera22ba012000-03-02 23:09:20 +1100796# Check whether user wants AFS support
Damien Miller7b22d652000-06-18 14:07:04 +1000797AFS_MSG="no"
Damien Millerc6398ef1999-11-20 12:18:40 +1100798AC_ARG_WITH(afs,
Damien Miller105b7f02000-01-07 08:45:55 +1100799 [ --with-afs=PATH Enable AFS support],
Damien Miller80297751999-11-19 13:03:25 +1100800 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100801 if test "x$withval" != "xno" ; then
Damien Miller105b7f02000-01-07 08:45:55 +1100802
803 if test "x$withval" != "$xyes" ; then
804 CFLAGS="$CFLAGS -I${withval}/include"
805 LFLAGS="$LFLAGS -L${withval}/lib"
806 fi
807
808 if test -z "$KRB4" ; then
809 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
810 fi
811
Damien Miller8bdeee21999-12-30 15:50:54 +1100812 LIBS="$LIBS -lkafs"
Damien Miller105b7f02000-01-07 08:45:55 +1100813 if test ! -z "$AFS_LIBS" ; then
814 LIBS="$LIBS $AFS_LIBS"
815 fi
816 AC_DEFINE(AFS)
Damien Miller7b22d652000-06-18 14:07:04 +1000817 AFS_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100818 fi
Damien Miller80297751999-11-19 13:03:25 +1100819 ]
820)
Damien Millerc85f9b42000-01-29 10:20:21 +1100821LIBS="$LIBS $KLIBS"
Damien Miller80297751999-11-19 13:03:25 +1100822
Damien Millera22ba012000-03-02 23:09:20 +1100823# Check whether user wants S/Key support
Damien Miller7b22d652000-06-18 14:07:04 +1000824SKEY_MSG="no"
Damien Miller80297751999-11-19 13:03:25 +1100825AC_ARG_WITH(skey,
826 [ --with-skey Enable S/Key support],
827 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100828 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100829 AC_DEFINE(SKEY)
830 LIBS="$LIBS -lskey"
Damien Miller7b22d652000-06-18 14:07:04 +1000831 SKEY_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100832 fi
Damien Miller80297751999-11-19 13:03:25 +1100833 ]
834)
835
Damien Millera22ba012000-03-02 23:09:20 +1100836# Check whether user wants TCP wrappers support
Damien Miller7b22d652000-06-18 14:07:04 +1000837TCPW_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100838AC_ARG_WITH(tcp-wrappers,
Damien Miller80297751999-11-19 13:03:25 +1100839 [ --with-tcp-wrappers Enable tcpwrappers support],
840 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100841 if test "x$withval" != "xno" ; then
Damien Miller65165f82000-03-05 17:02:45 +1100842 saved_LIBS="$LIBS"
Damien Miller105b7f02000-01-07 08:45:55 +1100843 LIBS="$LIBS -lwrap"
Damien Miller65165f82000-03-05 17:02:45 +1100844 AC_MSG_CHECKING(for libwrap)
845 AC_TRY_LINK(
846 [
Damien Miller81171112000-04-23 11:14:01 +1000847#include <tcpd.h>
Damien Miller65165f82000-03-05 17:02:45 +1100848 int deny_severity = 0, allow_severity = 0;
849 ],
850 [hosts_access(0);],
851 [
852 AC_MSG_RESULT(yes)
853 AC_DEFINE(LIBWRAP)
Damien Miller7b22d652000-06-18 14:07:04 +1000854 TCPW_MSG="yes"
Damien Miller65165f82000-03-05 17:02:45 +1100855 ],
856 [
Damien Miller7b22d652000-06-18 14:07:04 +1000857 AC_MSG_ERROR([*** libwrap missing])
Damien Miller65165f82000-03-05 17:02:45 +1100858 ]
859 )
Damien Miller8bdeee21999-12-30 15:50:54 +1100860 fi
Damien Miller80297751999-11-19 13:03:25 +1100861 ]
862)
863
Damien Millera22ba012000-03-02 23:09:20 +1100864# Check whether to enable MD5 passwords
Damien Miller7b22d652000-06-18 14:07:04 +1000865MD5_MSG="no"
Damien Millerf7c0f821999-11-22 22:31:49 +1100866AC_ARG_WITH(md5-passwords,
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100867 [ --with-md5-passwords Enable use of MD5 passwords],
Damien Miller8bdeee21999-12-30 15:50:54 +1100868 [
Damien Millerb85dcad2000-03-11 11:37:00 +1100869 if test "x$withval" != "xno" ; then
Damien Miller8bdeee21999-12-30 15:50:54 +1100870 AC_DEFINE(HAVE_MD5_PASSWORDS)
Damien Miller7b22d652000-06-18 14:07:04 +1000871 MD5_MSG="yes"
Damien Miller8bdeee21999-12-30 15:50:54 +1100872 fi
873 ]
Damien Millerdd1c7ba1999-11-19 15:53:20 +1100874)
875
Damien Millera22ba012000-03-02 23:09:20 +1100876# Whether to disable shadow password support
Damien Miller76112de1999-12-21 11:18:08 +1100877AC_ARG_WITH(shadow,
878 [ --without-shadow Disable shadow password support],
879 [
880 if test "x$withval" = "xno" ; then
881 AC_DEFINE(DISABLE_SHADOW)
882 fi
883 ]
884)
885
Damien Millera22ba012000-03-02 23:09:20 +1100886# Use ip address instead of hostname in $DISPLAY
Damien Miller7b22d652000-06-18 14:07:04 +1000887DISPLAY_HACK_MSG="no"
Damien Miller76112de1999-12-21 11:18:08 +1100888AC_ARG_WITH(ipaddr-display,
889 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
890 [
Damien Miller66409952000-01-17 21:40:06 +1100891 if test "x$withval" = "xno" ; then
Damien Miller76112de1999-12-21 11:18:08 +1100892 AC_DEFINE(IPADDR_IN_DISPLAY)
Damien Miller7b22d652000-06-18 14:07:04 +1000893 DISPLAY_HACK_MSG="yes"
Damien Miller76112de1999-12-21 11:18:08 +1100894 fi
895 ]
896)
897
Damien Millera22ba012000-03-02 23:09:20 +1100898# Whether to mess with the default path
Damien Miller7b22d652000-06-18 14:07:04 +1000899SERVER_PATH_MSG="(default)"
Damien Millere7f626c1999-12-31 09:49:44 +1100900AC_ARG_WITH(default-path,
Damien Miller5a3e6831999-12-27 09:48:56 +1100901 [ --with-default-path=PATH Specify default \$PATH environment for server],
902 [
903 if test "x$withval" != "xno" ; then
Damien Miller9550a761999-12-29 02:32:22 +1100904 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
Damien Miller7b22d652000-06-18 14:07:04 +1000905 SERVER_PATH_MSG="$withval"
Damien Miller5a3e6831999-12-27 09:48:56 +1100906 fi
907 ]
908)
909
Damien Millera22ba012000-03-02 23:09:20 +1100910# Whether to force IPv4 by default (needed on broken glibc Linux)
Damien Miller7b22d652000-06-18 14:07:04 +1000911IPV4_HACK_MSG="no"
Damien Miller7d80e342000-01-19 14:36:49 +1100912AC_ARG_WITH(ipv4-default,
913 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
914 [
915 if test "x$withval" != "xno" ; then
916 AC_DEFINE(IPV4_DEFAULT)
Damien Miller7b22d652000-06-18 14:07:04 +1000917 IPV4_HACK_MSG="yes"
Damien Miller7d80e342000-01-19 14:36:49 +1100918 fi
919 ]
920)
921
Damien Miller61e50f12000-05-08 20:49:37 +1000922AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
Damien Miller7b22d652000-06-18 14:07:04 +1000923IPV4_IN6_HACK_MSG="no"
Damien Miller7bcb0892000-03-11 20:45:40 +1100924AC_ARG_WITH(4in6,
925 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
926 [
927 if test "x$withval" != "xno" ; then
928 AC_MSG_RESULT(yes)
929 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +1000930 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +1100931 else
932 AC_MSG_RESULT(no)
933 fi
934 ],[
935 if test "x$inet6_default_4in6" = "xyes"; then
936 AC_MSG_RESULT([yes (default)])
937 AC_DEFINE(IPV4_IN_IPV6)
Damien Miller7b22d652000-06-18 14:07:04 +1000938 IPV4_IN6_HACK_MSG="yes"
Damien Miller7bcb0892000-03-11 20:45:40 +1100939 else
940 AC_MSG_RESULT([no (default)])
941 fi
942 ]
943)
944
Damien Millera22ba012000-03-02 23:09:20 +1100945# Where to place sshd.pid
Damien Millerb13c73e2000-01-17 22:02:17 +1100946piddir=/var/run
Damien Miller5eed6a22000-01-16 12:05:18 +1100947AC_ARG_WITH(pid-dir,
948 [ --with-pid-dir=PATH Specify location of ssh.pid file],
949 [
950 if test "x$withval" != "xno" ; then
Damien Millerb13c73e2000-01-17 22:02:17 +1100951 piddir=$withval
Damien Miller5eed6a22000-01-16 12:05:18 +1100952 fi
953 ]
954)
Damien Miller4018c192000-04-30 09:30:44 +1000955
Damien Millerdbd250f2000-01-18 08:57:14 +1100956AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
Damien Millerb13c73e2000-01-17 22:02:17 +1100957AC_SUBST(piddir)
Damien Miller5eed6a22000-01-16 12:05:18 +1100958
andre2ff7b5d2000-06-03 14:57:40 +0000959dnl allow user to disable some login recording features
960AC_ARG_ENABLE(lastlog,
961 [ --disable-lastlog disable use of lastlog even if detected [no]],
962 [ AC_DEFINE(DISABLE_LASTLOG) ]
963)
964AC_ARG_ENABLE(utmp,
965 [ --disable-utmp disable use of utmp even if detected [no]],
966 [ AC_DEFINE(DISABLE_UTMP) ]
967)
968AC_ARG_ENABLE(utmpx,
969 [ --disable-utmpx disable use of utmpx even if detected [no]],
970 [ AC_DEFINE(DISABLE_UTMPX) ]
971)
972AC_ARG_ENABLE(wtmp,
973 [ --disable-wtmp disable use of wtmp even if detected [no]],
974 [ AC_DEFINE(DISABLE_WTMP) ]
975)
976AC_ARG_ENABLE(wtmpx,
977 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
978 [ AC_DEFINE(DISABLE_WTMPX) ]
979)
980AC_ARG_ENABLE(libutil,
981 [ --disable-libutil disable use of libutil (login() etc.) [no]],
982 [ AC_DEFINE(DISABLE_LOGIN) ]
983)
984AC_ARG_ENABLE(pututline,
985 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
986 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
987)
988AC_ARG_ENABLE(pututxline,
989 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
990 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
991)
992AC_ARG_WITH(lastlog,
993 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
994 [ conf_lastlog_location="$withval"; ],)
995
996dnl lastlog, [uw]tmpx? detection
997dnl NOTE: set the paths in the platform section to avoid the
998dnl need for command-line parameters
999dnl lastlog and [uw]tmp are subject to a file search if all else fails
1000
1001dnl lastlog detection
1002dnl NOTE: the code itself will detect if lastlog is a directory
1003AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1004AC_TRY_COMPILE([
1005#include <sys/types.h>
1006#include <utmp.h>
1007#ifdef HAVE_LASTLOG_H
1008# include <lastlog.h>
1009#endif
Damien Miller2994e082000-06-04 15:51:47 +10001010#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001011# include <paths.h>
1012#endif
1013 ],
1014 [ char *lastlog = LASTLOG_FILE; ],
1015 [ AC_MSG_RESULT(yes) ],
Damien Miller2994e082000-06-04 15:51:47 +10001016 [
1017 AC_MSG_RESULT(no)
1018 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1019 AC_TRY_COMPILE([
1020#include <sys/types.h>
1021#include <utmp.h>
1022#ifdef HAVE_LASTLOG_H
1023# include <lastlog.h>
1024#endif
1025#ifdef HAVE_PATHS_H
1026# include <paths.h>
1027#endif
1028 ],
1029 [ char *lastlog = _PATH_LASTLOG; ],
1030 [ AC_MSG_RESULT(yes) ],
1031 [
andree441aa32000-06-12 22:34:38 +00001032 AC_MSG_RESULT(no)
Damien Miller2994e082000-06-04 15:51:47 +10001033 system_lastlog_path=no
1034 ])
1035 ]
andre2ff7b5d2000-06-03 14:57:40 +00001036)
Damien Miller2994e082000-06-04 15:51:47 +10001037
andre2ff7b5d2000-06-03 14:57:40 +00001038if test -z "$conf_lastlog_location"; then
1039 if test x"$system_lastlog_path" = x"no" ; then
1040 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
Damien Millerc29de952000-06-12 23:04:18 +10001041 if test -d "$f" -o -f "$f" ; then
andre2ff7b5d2000-06-03 14:57:40 +00001042 conf_lastlog_location=$f
1043 fi
1044 done
1045 if test -z "$conf_lastlog_location"; then
andre45cad512000-06-12 23:27:31 +00001046 AC_MSG_WARN([** Cannot find lastlog **])
1047 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
andre2ff7b5d2000-06-03 14:57:40 +00001048 fi
1049 fi
1050fi
1051
1052if test -n "$conf_lastlog_location"; then
1053 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
1054fi
1055
1056dnl utmp detection
1057AC_MSG_CHECKING([if your system defines UTMP_FILE])
1058AC_TRY_COMPILE([
1059#include <sys/types.h>
1060#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001061#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001062# include <paths.h>
1063#endif
1064 ],
1065 [ char *utmp = UTMP_FILE; ],
1066 [ AC_MSG_RESULT(yes) ],
1067 [ AC_MSG_RESULT(no)
1068 system_utmp_path=no ]
1069)
1070if test -z "$conf_utmp_location"; then
1071 if test x"$system_utmp_path" = x"no" ; then
1072 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1073 if test -f $f ; then
1074 conf_utmp_location=$f
1075 fi
1076 done
1077 if test -z "$conf_utmp_location"; then
1078 AC_DEFINE(DISABLE_UTMP)
1079 fi
1080 fi
1081fi
1082if test -n "$conf_utmp_location"; then
1083 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
1084fi
1085
1086dnl wtmp detection
1087AC_MSG_CHECKING([if your system defines WTMP_FILE])
1088AC_TRY_COMPILE([
1089#include <sys/types.h>
1090#include <utmp.h>
Damien Miller2994e082000-06-04 15:51:47 +10001091#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001092# include <paths.h>
1093#endif
1094 ],
1095 [ char *wtmp = WTMP_FILE; ],
1096 [ AC_MSG_RESULT(yes) ],
1097 [ AC_MSG_RESULT(no)
1098 system_wtmp_path=no ]
1099)
1100if test -z "$conf_wtmp_location"; then
1101 if test x"$system_wtmp_path" = x"no" ; then
1102 for f in /usr/adm/wtmp /var/log/wtmp; do
1103 if test -f $f ; then
1104 conf_wtmp_location=$f
1105 fi
1106 done
1107 if test -z "$conf_wtmp_location"; then
1108 AC_DEFINE(DISABLE_WTMP)
1109 fi
1110 fi
1111fi
1112if test -n "$conf_wtmp_location"; then
1113 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1114fi
1115
1116
1117dnl utmpx detection - I don't know any system so perverse as to require
1118dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1119dnl there, though.
1120AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1121AC_TRY_COMPILE([
1122#include <sys/types.h>
1123#include <utmp.h>
1124#ifdef HAVE_UTMPX_H
1125#include <utmpx.h>
1126#endif
Damien Miller2994e082000-06-04 15:51:47 +10001127#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001128# include <paths.h>
1129#endif
1130 ],
1131 [ char *utmpx = UTMPX_FILE; ],
1132 [ AC_MSG_RESULT(yes) ],
1133 [ AC_MSG_RESULT(no)
1134 system_utmpx_path=no ]
1135)
1136if test -z "$conf_utmpx_location"; then
1137 if test x"$system_utmpx_path" = x"no" ; then
1138 AC_DEFINE(DISABLE_UTMPX)
1139 fi
1140else
1141 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1142fi
1143
1144dnl wtmpx detection
1145AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1146AC_TRY_COMPILE([
1147#include <sys/types.h>
1148#include <utmp.h>
1149#ifdef HAVE_UTMPX_H
1150#include <utmpx.h>
1151#endif
Damien Miller2994e082000-06-04 15:51:47 +10001152#ifdef HAVE_PATHS_H
andre2ff7b5d2000-06-03 14:57:40 +00001153# include <paths.h>
1154#endif
1155 ],
1156 [ char *wtmpx = WTMPX_FILE; ],
1157 [ AC_MSG_RESULT(yes) ],
1158 [ AC_MSG_RESULT(no)
1159 system_wtmpx_path=no ]
1160)
1161if test -z "$conf_wtmpx_location"; then
1162 if test x"$system_wtmpx_path" = x"no" ; then
1163 AC_DEFINE(DISABLE_WTMPX)
1164 fi
1165else
1166 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1167fi
1168
Damien Miller4018c192000-04-30 09:30:44 +10001169
1170# Change default command timeout for builtin PRNG
Damien Miller14c12cb2000-06-07 22:20:23 +10001171entropy_timeout=200
Damien Miller4018c192000-04-30 09:30:44 +10001172AC_ARG_WITH(entropy-timeout,
1173 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1174 [
1175 if test "x$withval" != "xno" ; then
1176 entropy_timeout=$withval
1177 fi
1178 ]
1179)
1180AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1181
1182
Damien Miller29ea30d2000-03-17 10:54:15 +11001183if test ! -z "$blibpath" ; then
1184 LDFLAGS="$LDFLAGS -blibpath:$blibpath"
1185 AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
1186fi
1187
Damien Miller0437b332000-05-02 09:56:41 +10001188AC_OUTPUT(Makefile ssh_prng_cmds)
1189
Damien Miller7b22d652000-06-18 14:07:04 +10001190# Print summary of options
1191
1192if test x$MANTYPE = x'$(CATMAN)' ; then
1193 MAN_MSG=cat
1194else
1195 MAN_MSG=man
1196fi
1197if test ! -z "$RANDOM_POOL" ; then
1198 RAND_MSG="Device ($RANDOM_POOL)"
1199else
1200 if test ! -z "$EGD_SOCKET" ; then
1201 RAND_MSG="EGD ($EGD_SOCKET)"
1202 else
1203 RAND_MSG="Builtin (timeout $entropy_timeout)"
1204 fi
1205fi
1206
1207# Someone please show me a better way :)
1208A=`eval echo ${prefix}` ; A=`eval echo ${A}`
1209B=`eval echo ${bindir}` ; B=`eval echo ${B}`
1210C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
1211D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
1212E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}`
1213F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
1214G=`eval echo ${piddir}` ; G=`eval echo ${G}`
1215
1216echo ""
1217echo "OpenSSH configured has been configured with the following options."
1218echo " User binaries: $B"
1219echo " System binaries: $C"
1220echo " Configuration files: $D"
1221echo " Askpass program: $E"
1222echo " Manual pages: $F"
1223echo " PID file: $G"
1224echo " Random number collection: $RAND_MSG"
1225echo " Manpage format: $MAN_MSG"
1226echo " PAM support: ${PAM_MSG}"
1227echo " KerberosIV support: $KRB4_MSG"
1228echo " AFS support: $AFS_MSG"
1229echo " S/KEY support: $SKEY_MSG"
1230echo " TCP Wrappers support: $TCPW_MSG"
1231echo " MD5 password support: $MD5_MSG"
1232echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
1233echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
1234echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
1235
1236echo ""
1237
1238echo "Compiler flags: ${CFLAGS}"
1239echo "Linker flags: ${LDFLAGS}"
1240echo "Libraries: ${LIBS}"
1241
1242echo ""
1243