3 AC_CONFIG_HEADER(config.h)
5 dnl Checks for programs.
10 AC_CHECK_PROG(AR, ar, ar)
11 if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
13 dnl Check for OpenSSL/SSLeay directories.
14 AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
15 for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
16 if test -f "$ssldir/include/openssl/crypto.h"; then
17 AC_DEFINE(HAVE_OPENSSL)
21 if test -f "$ssldir/include/ssl/crypto.h"; then
27 if test -z "$GOT_SSL" ; then
28 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
31 AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
32 if test "$ssldir" != "/usr"; then
33 CFLAGS="$CFLAGS -I$ssldir/include"
34 LDFLAGS="$LDFLAGS -L$ssldir/lib"
36 LIBS="$LIBS -lssl -lcrypto"
37 AC_MSG_RESULT($ssldir)
39 dnl Check for RSAref library.
40 AC_MSG_CHECKING([for RSAref library])
42 LIBS="$saved_LIBS -lRSAglue -lrsaref"
44 [AC_MSG_RESULT(yes); ],
45 [AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
47 dnl Checks for libraries.
48 AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
49 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
50 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
51 AC_CHECK_LIB(nsl, yp_match, , )
52 AC_CHECK_LIB(socket, main, , )
54 dnl libdl is needed by PAM on Redhat systems
55 AC_CHECK_LIB(dl, dlopen, , )
56 AC_CHECK_LIB(pam, pam_authenticate, , )
58 dnl Checks for header files.
59 AC_CHECK_HEADERS(endian.h lastlog.h login.h maillock.h netgroup.h paths.h poll.h pty.h shadow.h util.h utmp.h utmpx.h sys/poll.h sys/select.h sys/stropts.h sys/time.h)
61 dnl Checks for library functions.
62 AC_CHECK_FUNCS(arc4random mkdtemp openpty _getpty setenv setlogin setproctitle snprintf strlcat strlcpy vsnprintf)
65 [AC_DEFINE(HAVE_LOGIN)],
66 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
70 [AC_DEFINE(HAVE_DAEMON)],
71 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
74 dnl Checks for data types
75 AC_CHECK_SIZEOF(short int, 2)
76 AC_CHECK_SIZEOF(int, 4)
77 AC_CHECK_SIZEOF(long int, 4)
78 AC_CHECK_SIZEOF(long long int, 8)
80 dnl More checks for data types
81 AC_MSG_CHECKING([for quad_t])
83 [#include <sys/types.h>],
84 [quad_t a; a = 1235;],
86 AC_DEFINE(HAVE_QUAD_T)
92 AC_MSG_CHECKING([for intXX_t types])
94 [#include <sys/types.h>],
95 [int16_t a; int32_t b; a = 1235; b = 1235;],
97 AC_DEFINE(HAVE_INTXX_T)
103 AC_MSG_CHECKING([for u_intXX_t types])
105 [#include <sys/types.h>],
106 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
108 AC_DEFINE(HAVE_U_INTXX_T)
114 AC_MSG_CHECKING([For uintXX_t types])
116 [#include <sys/types.h>],
117 [uint16_t c; uint32_t d; c = 1235; d = 1235;],
119 AC_DEFINE(HAVE_UINTXX_T)
125 dnl Check PAM strerror arguments
126 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
130 #include <security/pam_appl.h>
132 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
135 AC_DEFINE(HAVE_OLD_PAM)
140 AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
141 dnl Check whether user wants GNOME ssh-askpass
142 AC_ARG_WITH(gnome-askpass,
143 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
145 if test x$withval = xno ; then
148 GNOME_ASKPASS="gnome-ssh-askpass";
151 AC_SUBST(GNOME_ASKPASS)
153 if test -z "$GNOME_ASKPASS" ; then
159 dnl Check for user-specified random device
161 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
163 RANDOM_POOL="$withval";
164 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
167 dnl Check for random device
168 AC_CHECK_FILE("/dev/urandom",
170 RANDOM_POOL="/dev/urandom";
171 AC_SUBST(RANDOM_POOL)
172 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
178 dnl Check for EGD pool file
179 AC_ARG_WITH(egd-pool,
180 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
182 RANDOM_POOL="$withval";
184 AC_SUBST(RANDOM_POOL)
185 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
189 dnl Make sure we have random number support
190 if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
191 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
194 dnl Check for ut_host field in utmp
195 AC_MSG_CHECKING([whether utmp.h has ut_host field])
196 AC_EGREP_HEADER(ut_host, utmp.h,
197 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
201 dnl Check for ut_host field in utmpx
202 AC_MSG_CHECKING([whether utmpx.h has ut_host field])
203 AC_EGREP_HEADER(ut_host, utmpx.h,
204 [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ],
208 dnl Look for lastlog location
209 AC_MSG_CHECKING([location of lastlog file])
210 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
211 if test -f $lastlog ; then
215 if test -d $lastlog ; then
220 if test -z "$gotlastlog" ; then
221 AC_MSG_ERROR([*** Cannot find lastlog ***])
223 if test "x$gotlastlog" = "xdir" ; then
224 AC_DEFINE(LASTLOG_IS_DIR)
225 AC_MSG_ERROR([*** Directory-based lastlogs are not yet supported ***])
227 AC_MSG_RESULT($lastlog)
228 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
231 AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
232 AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
234 AC_MSG_CHECKING([whether libc defines __progname])
236 [extern char *__progname; printf("%s", __progname);],
238 AC_DEFINE(HAVE___PROGNAME)
246 dnl Check whether user wants Kerberos support
247 AC_ARG_WITH(kerberos4,
248 [ --with-kerberos4 Enable Kerberos 4 support],
252 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
256 dnl Check whether user wants AFS support
258 [ --with-afs Enable AFS support],
265 dnl Check whether user wants S/Key support
267 [ --with-skey Enable S/Key support],
274 dnl Check whether user wants TCP wrappers support
275 AC_ARG_WITH(tcp-wrappers,
276 [ --with-tcp-wrappers Enable tcpwrappers support],
284 dnl Check whether to enable MD5 passwords
285 AC_ARG_WITH(md5-passwords,
286 [ --with-md5-passwords Enable use of MD5 passwords],
287 [AC_DEFINE(HAVE_MD5_PASSWORDS)]
290 dnl Check for the path to xauth
291 AC_PATH_PROG(xauth_path, xauth)
292 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")