3 AC_CONFIG_HEADER(config.h)
5 dnl Checks for programs.
10 AC_CHECK_PROG(AR, ar, ar)
12 dnl Checks for compiler characteristics
13 if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
16 dnl Check for OpenSSL/SSLeay directories.
17 AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
18 for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
19 if test -f "$ssldir/include/openssl/crypto.h"; then
20 AC_DEFINE(HAVE_OPENSSL)
24 if test -f "$ssldir/include/ssl/crypto.h"; then
30 if test -z "$GOT_SSL" ; then
31 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
34 AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
35 if test "$ssldir" != "/usr"; then
36 CFLAGS="$CFLAGS -I$ssldir/include"
37 LDFLAGS="$LDFLAGS -L$ssldir/lib"
39 LIBS="$LIBS -lssl -lcrypto"
40 AC_MSG_RESULT($ssldir)
42 dnl Check for RSAref library.
43 AC_MSG_CHECKING([for RSAref library])
45 LIBS="$saved_LIBS -lRSAglue -lrsaref"
47 [AC_MSG_RESULT(yes); ],
48 [AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
50 dnl Checks for libraries.
51 AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
52 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
53 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
54 AC_CHECK_LIB(nsl, yp_match, , )
55 AC_CHECK_LIB(socket, main, , )
57 dnl libdl is needed by PAM on Redhat systems
58 AC_CHECK_LIB(dl, dlopen, , )
59 AC_CHECK_LIB(pam, pam_authenticate, , )
61 dnl Checks for header files.
62 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)
64 dnl Checks for library functions.
65 AC_CHECK_FUNCS(arc4random mkdtemp openpty _getpty setenv setlogin setproctitle snprintf strlcat strlcpy vsnprintf)
68 [AC_DEFINE(HAVE_LOGIN)],
69 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
73 [AC_DEFINE(HAVE_DAEMON)],
74 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
77 dnl Checks for data types
78 AC_CHECK_SIZEOF(short int, 2)
79 AC_CHECK_SIZEOF(int, 4)
80 AC_CHECK_SIZEOF(long int, 4)
81 AC_CHECK_SIZEOF(long long int, 8)
83 dnl More checks for data types
84 AC_MSG_CHECKING([for quad_t])
86 [#include <sys/types.h>],
87 [quad_t a; a = 1235;],
89 AC_DEFINE(HAVE_QUAD_T)
95 AC_MSG_CHECKING([for intXX_t types])
97 [#include <sys/types.h>],
98 [int16_t a; int32_t b; a = 1235; b = 1235;],
100 AC_DEFINE(HAVE_INTXX_T)
106 AC_MSG_CHECKING([for u_intXX_t types])
108 [#include <sys/types.h>],
109 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
111 AC_DEFINE(HAVE_U_INTXX_T)
117 AC_MSG_CHECKING([For uintXX_t types])
119 [#include <sys/types.h>],
120 [uint16_t c; uint32_t d; c = 1235; d = 1235;],
122 AC_DEFINE(HAVE_UINTXX_T)
128 dnl Check PAM strerror arguments
129 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
133 #include <security/pam_appl.h>
135 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
138 AC_DEFINE(HAVE_OLD_PAM)
143 AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
144 dnl Check whether user wants GNOME ssh-askpass
145 AC_ARG_WITH(gnome-askpass,
146 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
148 if test x$withval = xno ; then
151 GNOME_ASKPASS="gnome-ssh-askpass";
154 AC_SUBST(GNOME_ASKPASS)
156 if test -z "$GNOME_ASKPASS" ; then
162 dnl Check for user-specified random device
164 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
166 RANDOM_POOL="$withval";
167 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
170 dnl Check for random device
171 AC_CHECK_FILE("/dev/urandom",
173 RANDOM_POOL="/dev/urandom";
174 AC_SUBST(RANDOM_POOL)
175 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
181 dnl Check for EGD pool file
182 AC_ARG_WITH(egd-pool,
183 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
185 RANDOM_POOL="$withval";
187 AC_SUBST(RANDOM_POOL)
188 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
192 dnl Make sure we have random number support
193 if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
194 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
197 dnl Check for ut_host field in utmp
198 AC_MSG_CHECKING([whether utmp.h has ut_host field])
199 AC_EGREP_HEADER(ut_host, utmp.h,
200 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
204 dnl Check for ut_host field in utmpx
205 AC_MSG_CHECKING([whether utmpx.h has ut_host field])
206 AC_EGREP_HEADER(ut_host, utmpx.h,
207 [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ],
211 dnl Look for lastlog location
212 AC_MSG_CHECKING([location of lastlog file])
213 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
214 if test -f $lastlog ; then
218 if test -d $lastlog ; then
223 if test -z "$gotlastlog" ; then
224 AC_MSG_ERROR([*** Cannot find lastlog ***])
226 if test "x$gotlastlog" = "xdir" ; then
227 AC_DEFINE(LASTLOG_IS_DIR)
228 AC_MSG_ERROR([*** Directory-based lastlogs are not yet supported ***])
230 AC_MSG_RESULT($lastlog)
231 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
234 AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
235 AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
237 AC_MSG_CHECKING([whether libc defines __progname])
239 [extern char *__progname; printf("%s", __progname);],
241 AC_DEFINE(HAVE___PROGNAME)
249 dnl Check whether user wants Kerberos support
250 AC_ARG_WITH(kerberos4,
251 [ --with-kerberos4 Enable Kerberos 4 support],
255 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
259 dnl Check whether user wants AFS support
261 [ --with-afs Enable AFS support],
268 dnl Check whether user wants S/Key support
270 [ --with-skey Enable S/Key support],
277 dnl Check whether user wants TCP wrappers support
278 AC_ARG_WITH(tcp-wrappers,
279 [ --with-tcp-wrappers Enable tcpwrappers support],
287 dnl Check whether to enable MD5 passwords
288 AC_ARG_WITH(md5-passwords,
289 [ --with-md5-passwords Enable use of MD5 passwords],
290 [AC_DEFINE(HAVE_MD5_PASSWORDS)]
293 dnl Check whether to enable utmpx support
295 [ --with-utmpx Enable utmpx support],
296 [AC_DEFINE(USE_UTMPX)]
299 dnl Check for the path to xauth
300 AC_PATH_PROG(xauth_path, xauth)
301 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")