]> andersk Git - openssh.git/blame_incremental - configure.in
- Calls to pam_setcred, patch from Nalin Dahyabhai
[openssh.git] / configure.in
... / ...
CommitLineData
1AC_INIT(ssh.c)
2
3AC_CONFIG_HEADER(config.h)
4AC_CANONICAL_HOST
5
6dnl Checks for programs.
7AC_PROG_CC
8AC_PROG_CPP
9AC_PROG_RANLIB
10AC_PROG_INSTALL
11AC_CHECK_PROG(AR, ar, ar)
12AC_PATH_PROG(PERL, perl)
13AC_SUBST(PERL)
14AC_PATH_PROG(xauth_path, xauth)
15
16dnl Use ip address instead of hostname in $DISPLAY
17AC_ARG_WITH(rsh,
18 [ --with-rsh=PATH Specify path to remote shell program ],
19 [
20 AC_DEFINE_UNQUOTED(RSH_PATH, "$withval")
21 ],
22 [
23 AC_PATH_PROG(rsh_path, rsh)
24 ]
25)
26
27if test ! -z "$xauth_path" ; then
28 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
29fi
30if test ! -z "$rsh_path" ; then
31 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
32fi
33
34dnl Checks for compiler characteristics
35if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
36
37AC_C_INLINE
38
39dnl Check for some target-specific stuff
40case "$host" in
41*-*-hpux10*)
42 if test -z "$GCC"; then
43 CFLAGS="$CFLAGS -Aa"
44 fi
45 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
46 AC_DEFINE(IPADDR_IN_DISPLAY)
47 AC_DEFINE(USE_UTMPX)
48 AC_MSG_CHECKING(for HPUX trusted system password database)
49 if test -f /tcb/files/auth/system/default; then
50 AC_MSG_RESULT(yes)
51 AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW)
52 LIBS="$LIBS -lsec"
53 else
54 AC_MSG_RESULT(no)
55 AC_DEFINE(DISABLE_SHADOW)
56 fi
57 ;;
58*-*-solaris*)
59 AC_DEFINE(USE_UTMPX)
60 ;;
61*-*-irix5*)
62 AC_DEFINE(CRYPT_H_BREAKS_BUILD)
63# CFLAGS="$CFLAGS -shared"
64 no_libsocket=1
65 no_libnsl=1
66 ;;
67esac
68
69dnl Check for OpenSSL/SSLeay directories.
70AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
71for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
72 if test -f "$ssldir/include/openssl/crypto.h"; then
73 AC_DEFINE(HAVE_OPENSSL)
74 GOT_SSL="yes"
75 break
76 fi
77 if test -f "$ssldir/include/ssl/crypto.h"; then
78 AC_DEFINE(HAVE_SSL)
79 GOT_SSL="yes"
80 break
81 fi
82done
83if test -z "$GOT_SSL" ; then
84 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
85fi
86AC_SUBST(ssldir)
87AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
88if test "$ssldir" != "/usr"; then
89 CFLAGS="$CFLAGS -I$ssldir/include"
90 LDFLAGS="$LDFLAGS -L$ssldir/lib"
91fi
92AC_MSG_RESULT($ssldir)
93
94dnl Check for RSAref library.
95AC_MSG_CHECKING([for RSAref library])
96saved_LIBS="$LIBS"
97LIBS="$saved_LIBS -lRSAglue -lrsaref"
98AC_TRY_LINK([], [],
99[AC_MSG_RESULT(yes);
100 AC_DEFINE(RSAREF)],
101[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
102
103dnl Checks for libraries.
104AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
105AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
106AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
107AC_CHECK_LIB(crypt, crypt, , )
108
109if test -z "$no_libsocket" ; then
110 AC_CHECK_LIB(nsl, yp_match, , )
111fi
112if test -z "$no_libnsl" ; then
113 AC_CHECK_LIB(socket, main, , )
114fi
115
116dnl Checks for header files.
117AC_CHECK_HEADERS(bstring.h crypt.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/time.h sys/ttcompat.h util.h utmp.h utmpx.h)
118
119dnl Checks for library functions.
120AC_CHECK_FUNCS(arc4random getpagesize _getpty innetgr md5_crypt mkdtemp openpty setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf)
121
122AC_CHECK_FUNC(login,
123 [AC_DEFINE(HAVE_LOGIN)],
124 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
125)
126
127AC_CHECK_FUNC(daemon,
128 [AC_DEFINE(HAVE_DAEMON)],
129 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
130)
131
132dnl Checks for data types
133AC_CHECK_SIZEOF(short int, 2)
134AC_CHECK_SIZEOF(int, 4)
135AC_CHECK_SIZEOF(long int, 4)
136AC_CHECK_SIZEOF(long long int, 8)
137
138dnl More checks for data types
139AC_MSG_CHECKING([for quad_t])
140AC_TRY_COMPILE(
141 [#include <sys/types.h>],
142 [quad_t a; a = 1235;],
143 [
144 AC_DEFINE(HAVE_QUAD_T)
145 AC_MSG_RESULT(yes)
146 ],
147 [AC_MSG_RESULT(no)]
148)
149
150AC_MSG_CHECKING([for intXX_t types])
151AC_TRY_COMPILE(
152 [#include <sys/types.h>],
153 [int16_t a; int32_t b; a = 1235; b = 1235;],
154 [
155 AC_DEFINE(HAVE_INTXX_T)
156 AC_MSG_RESULT(yes)
157 ],
158 [AC_MSG_RESULT(no)]
159)
160
161AC_MSG_CHECKING([for u_intXX_t types])
162AC_TRY_COMPILE(
163 [#include <sys/types.h>],
164 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
165 [
166 AC_DEFINE(HAVE_U_INTXX_T)
167 AC_MSG_RESULT(yes)
168 ],
169 [AC_MSG_RESULT(no)]
170)
171
172AC_MSG_CHECKING([For uintXX_t types])
173AC_TRY_COMPILE(
174 [#include <sys/types.h>],
175 [uint16_t c; uint32_t d; c = 1235; d = 1235;],
176 [
177 AC_DEFINE(HAVE_UINTXX_T)
178 AC_MSG_RESULT(yes)
179 ],
180 [AC_MSG_RESULT(no)]
181)
182
183AC_MSG_CHECKING([For socklen_t])
184AC_TRY_COMPILE(
185 [#include <sys/types.h>],
186 [#include <sys/socket.h>],
187 [socklen_t foo; foo = 1235;],
188 [
189 AC_DEFINE(HAVE_SOCKLEN_T)
190 AC_MSG_RESULT(yes)
191 ],
192 [AC_MSG_RESULT(no)]
193)
194
195AC_ARG_WITH(pam,
196 [ --without-pam Disable PAM support ],
197 [
198 if test "x$withval" = "xno" ; then
199 no_pam=1
200 AC_DEFINE(DISABLE_PAM)
201 fi
202 ]
203)
204
205if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
206 AC_CHECK_LIB(dl, dlopen, , )
207 LIBS="$LIBS -lpam"
208 dnl Check PAM strerror arguments
209 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
210 AC_TRY_COMPILE(
211 [
212 #include <stdlib.h>
213 #include <security/pam_appl.h>
214 ],
215 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
216 [AC_MSG_RESULT(no)],
217 [
218 AC_DEFINE(HAVE_OLD_PAM)
219 AC_MSG_RESULT(yes)
220 ]
221 )
222fi
223
224AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
225dnl Check whether user wants GNOME ssh-askpass
226AC_ARG_WITH(gnome-askpass,
227 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
228 [
229 if test x$withval = xno ; then
230 GNOME_ASKPASS="";
231 else
232 GNOME_ASKPASS="gnome-ssh-askpass";
233 fi
234 ])
235AC_SUBST(GNOME_ASKPASS)
236
237if test -z "$GNOME_ASKPASS" ; then
238 AC_MSG_RESULT(no)
239else
240 AC_MSG_RESULT(yes)
241fi
242
243dnl Check for user-specified random device
244AC_ARG_WITH(random,
245 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
246 [
247 RANDOM_POOL="$withval";
248 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
249 ],
250 [
251 dnl Check for random device
252 AC_CHECK_FILE("/dev/urandom",
253 [
254 RANDOM_POOL="/dev/urandom";
255 AC_SUBST(RANDOM_POOL)
256 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
257 ]
258 )
259 ]
260)
261
262dnl Check for EGD pool file
263AC_ARG_WITH(egd-pool,
264 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
265 [
266 RANDOM_POOL="$withval";
267 AC_DEFINE(HAVE_EGD)
268 AC_SUBST(RANDOM_POOL)
269 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
270 ]
271)
272
273dnl Make sure we have random number support
274if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
275 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
276fi
277
278AC_MSG_CHECKING([whether utmp.h has ut_host field])
279AC_EGREP_HEADER(ut_host, utmp.h,
280 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
281 [AC_MSG_RESULT(no)]
282)
283AC_MSG_CHECKING([whether utmpx.h has ut_host field])
284AC_EGREP_HEADER(ut_host, utmpx.h,
285 [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ],
286 [AC_MSG_RESULT(no)]
287)
288AC_MSG_CHECKING([whether utmpx.h has syslen field])
289AC_EGREP_HEADER(syslen, utmpx.h,
290 [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ],
291 [AC_MSG_RESULT(no)]
292)
293AC_MSG_CHECKING([whether utmp.h has ut_pid field])
294AC_EGREP_HEADER(ut_pid, utmp.h,
295 [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ],
296 [AC_MSG_RESULT(no)]
297)
298AC_MSG_CHECKING([whether utmp.h has ut_type field])
299AC_EGREP_HEADER(ut_type, utmp.h,
300 [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ],
301 [AC_MSG_RESULT(no)]
302)
303AC_MSG_CHECKING([whether utmp.h has ut_tv field])
304AC_EGREP_HEADER(ut_tv, utmp.h,
305 [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ],
306 [AC_MSG_RESULT(no)]
307)
308AC_MSG_CHECKING([whether utmp.h has ut_id field])
309AC_EGREP_HEADER(ut_id, utmp.h,
310 [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ],
311 [AC_MSG_RESULT(no)]
312)
313
314dnl Look for lastlog location
315AC_ARG_WITH(lastlog,
316 [ --with-lastlog=FILE Location of lastlog file],
317 [
318 if test "x$withval" = "xno" ; then
319 AC_DEFINE(DISABLE_LASTLOG)
320 else
321 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval")
322 fi
323 ],
324 [
325 AC_MSG_CHECKING([location of lastlog file])
326 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
327 if test -f $lastlog ; then
328 gotlastlog="file"
329 break
330 fi
331 if test -d $lastlog ; then
332 gotlastlog="dir"
333 break
334 fi
335 done
336 if test -z "$gotlastlog" ; then
337 AC_MSG_RESULT(not found)
338 nolastlog=1
339 else
340 if test "x$gotlastlog" = "xdir" ; then
341 AC_MSG_RESULT(${lastlog}/)
342 AC_DEFINE(LASTLOG_IS_DIR)
343 AC_MSG_WARN([*** Directory-based lastlogs are not yet supported ***])
344 nolastlog=1
345 else
346 AC_MSG_RESULT($lastlog)
347 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
348 fi
349 fi
350 ]
351)
352
353if test ! -z "$nolastlog" ; then
354 AC_MSG_WARN([*** Disabling lastlog support *** ])
355 AC_DEFINE(DISABLE_LASTLOG)
356fi
357
358AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
359AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
360
361AC_MSG_CHECKING([whether libc defines __progname])
362AC_TRY_LINK([],
363 [extern char *__progname; printf("%s", __progname);],
364 [
365 AC_DEFINE(HAVE___PROGNAME)
366 AC_MSG_RESULT(yes)
367 ],
368 [
369 AC_MSG_RESULT(no)
370 ]
371)
372
373dnl Check whether user wants Kerberos support
374AC_ARG_WITH(kerberos4,
375 [ --with-kerberos4 Enable Kerberos 4 support],
376 [
377 AC_DEFINE(KRB4)
378 LIBS="$LIBS -lkrb"
379 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
380 ]
381)
382
383dnl Check whether user wants AFS support
384AC_ARG_WITH(afs,
385 [ --with-afs Enable AFS support],
386 [
387 AC_DEFINE(AFS)
388 LIBS="$LIBS -lkafs"
389 ]
390)
391
392dnl Check whether user wants S/Key support
393AC_ARG_WITH(skey,
394 [ --with-skey Enable S/Key support],
395 [
396 AC_DEFINE(SKEY)
397 LIBS="$LIBS -lskey"
398 ]
399)
400
401dnl Check whether user wants TCP wrappers support
402AC_ARG_WITH(tcp-wrappers,
403 [ --with-tcp-wrappers Enable tcpwrappers support],
404 [
405 AC_DEFINE(LIBWRAP)
406 LIBWRAP="-lwrap"
407 ]
408)
409AC_SUBST(LIBWRAP)
410
411dnl Check whether to enable MD5 passwords
412AC_ARG_WITH(md5-passwords,
413 [ --with-md5-passwords Enable use of MD5 passwords],
414 [AC_DEFINE(HAVE_MD5_PASSWORDS)]
415)
416
417dnl Check whether to enable utmpx support
418AC_ARG_WITH(utmpx,
419 [ --with-utmpx Enable utmpx support],
420 [
421 if test "x$withval" != "xno" ; then
422 AC_DEFINE(USE_UTMPX)
423 fi
424 ]
425)
426
427dnl Whether to disable shadow password support
428AC_ARG_WITH(shadow,
429 [ --without-shadow Disable shadow password support],
430 [
431 if test "x$withval" = "xno" ; then
432 AC_DEFINE(DISABLE_SHADOW)
433 fi
434 ]
435)
436
437dnl Use ip address instead of hostname in $DISPLAY
438AC_ARG_WITH(ipaddr-display,
439 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
440 [
441 if test "x$withval" = "xno" ; then
442 AC_DEFINE(IPADDR_IN_DISPLAY)
443 fi
444 ]
445)
446
447AC_ARG_WITH(path,
448 [ --with-default-path=PATH Specify default \$PATH environment for server],
449 [
450 if test "x$withval" != "xno" ; then
451 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
452 fi
453 ]
454)
455
456dnl Check for mail directory (last resort if we cannot get it from headers)
457if test ! -z "$MAIL" ; then
458 maildir=`dirname $MAIL`
459 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
460fi
461
462AC_OUTPUT(Makefile)
This page took 0.456694 seconds and 5 git commands to generate.