]> andersk Git - openssh.git/blame - configure.in
Made utmpx optional
[openssh.git] / configure.in
CommitLineData
4cca272e 1AC_INIT(ssh.c)
5881cd60 2
3AC_CONFIG_HEADER(config.h)
4
5dnl Checks for programs.
6AC_PROG_CC
4cca272e 7AC_PROG_CPP
5881cd60 8AC_PROG_RANLIB
cf8dd513 9AC_PROG_INSTALL
d4f11b59 10AC_CHECK_PROG(AR, ar, ar)
906a2515 11
12dnl Checks for compiler characteristics
d4f11b59 13if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
906a2515 14AC_C_INLINE
5881cd60 15
d4f11b59 16dnl Check for OpenSSL/SSLeay directories.
17AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
4cca272e 18for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
6614282f 19 if test -f "$ssldir/include/openssl/crypto.h"; then
20 AC_DEFINE(HAVE_OPENSSL)
21 GOT_SSL="yes"
22 break
23 fi
24 if test -f "$ssldir/include/ssl/crypto.h"; then
25 AC_DEFINE(HAVE_SSL)
26 GOT_SSL="yes"
27 break
28 fi
d4f11b59 29done
6614282f 30if test -z "$GOT_SSL" ; then
31 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
32fi
d4f11b59 33AC_SUBST(ssldir)
34AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
35if test "$ssldir" != "/usr"; then
36 CFLAGS="$CFLAGS -I$ssldir/include"
7dc6fc6d 37 LDFLAGS="$LDFLAGS -L$ssldir/lib"
d4f11b59 38fi
39LIBS="$LIBS -lssl -lcrypto"
6614282f 40AC_MSG_RESULT($ssldir)
5881cd60 41
d4f11b59 42dnl Check for RSAref library.
43AC_MSG_CHECKING([for RSAref library])
44saved_LIBS="$LIBS"
45LIBS="$saved_LIBS -lRSAglue -lrsaref"
46AC_TRY_LINK([], [],
47[AC_MSG_RESULT(yes); ],
48[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
5881cd60 49
4cca272e 50dnl Checks for libraries.
51AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
52AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
53AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
54AC_CHECK_LIB(nsl, yp_match, , )
55AC_CHECK_LIB(socket, main, , )
56
57dnl libdl is needed by PAM on Redhat systems
58AC_CHECK_LIB(dl, dlopen, , )
59AC_CHECK_LIB(pam, pam_authenticate, , )
60
5881cd60 61dnl Checks for header files.
7303768f 62AC_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)
4cca272e 63
76cd7316 64dnl Checks for library functions.
a408af76 65AC_CHECK_FUNCS(arc4random mkdtemp openpty _getpty setenv setlogin setproctitle snprintf strlcat strlcpy vsnprintf)
76cd7316 66
beb43d31 67AC_CHECK_FUNC(login,
68 [AC_DEFINE(HAVE_LOGIN)],
69 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
70)
71
72AC_CHECK_FUNC(daemon,
73 [AC_DEFINE(HAVE_DAEMON)],
74 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
75)
76
2b942fe0 77dnl Checks for data types
78AC_CHECK_SIZEOF(short int, 2)
79AC_CHECK_SIZEOF(int, 4)
80AC_CHECK_SIZEOF(long int, 4)
81AC_CHECK_SIZEOF(long long int, 8)
82
83dnl More checks for data types
96ad4350 84AC_MSG_CHECKING([for quad_t])
2b942fe0 85AC_TRY_COMPILE(
86 [#include <sys/types.h>],
87 [quad_t a; a = 1235;],
88 [
89 AC_DEFINE(HAVE_QUAD_T)
90 AC_MSG_RESULT(yes)
91 ],
92 [AC_MSG_RESULT(no)]
93)
94
96ad4350 95AC_MSG_CHECKING([for intXX_t types])
2b942fe0 96AC_TRY_COMPILE(
97 [#include <sys/types.h>],
98 [int16_t a; int32_t b; a = 1235; b = 1235;],
99 [
100 AC_DEFINE(HAVE_INTXX_T)
101 AC_MSG_RESULT(yes)
102 ],
103 [AC_MSG_RESULT(no)]
104)
105
96ad4350 106AC_MSG_CHECKING([for u_intXX_t types])
2b942fe0 107AC_TRY_COMPILE(
108 [#include <sys/types.h>],
109 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
110 [
111 AC_DEFINE(HAVE_U_INTXX_T)
112 AC_MSG_RESULT(yes)
113 ],
114 [AC_MSG_RESULT(no)]
115)
116
117AC_MSG_CHECKING([For uintXX_t types])
118AC_TRY_COMPILE(
119 [#include <sys/types.h>],
120 [uint16_t c; uint32_t d; c = 1235; d = 1235;],
121 [
122 AC_DEFINE(HAVE_UINTXX_T)
123 AC_MSG_RESULT(yes)
124 ],
125 [AC_MSG_RESULT(no)]
126)
127
96ad4350 128dnl Check PAM strerror arguments
129AC_MSG_CHECKING([whether pam_strerror takes only one argument])
130AC_TRY_COMPILE(
131 [
132 #include <stdlib.h>
133 #include <security/pam_appl.h>
134 ],
135 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
136 [AC_MSG_RESULT(no)],
137 [
138 AC_DEFINE(HAVE_OLD_PAM)
139 AC_MSG_RESULT(yes)
140 ]
141)
142
8015023d 143AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
144dnl Check whether user wants GNOME ssh-askpass
145AC_ARG_WITH(gnome-askpass,
146 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
76cd7316 147 [
148 if test x$withval = xno ; then
8015023d 149 GNOME_ASKPASS="";
76cd7316 150 else
8015023d 151 GNOME_ASKPASS="gnome-ssh-askpass";
76cd7316 152 fi
8015023d 153 ])
154AC_SUBST(GNOME_ASKPASS)
76cd7316 155
8015023d 156if test -z "$GNOME_ASKPASS" ; then
157 AC_MSG_RESULT(no)
158else
159 AC_MSG_RESULT(yes)
76cd7316 160fi
6a0aeebc 161
4cca272e 162dnl Check for user-specified random device
163AC_ARG_WITH(random,
76cd7316 164 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
4cca272e 165 [
166 RANDOM_POOL="$withval";
92da7197 167 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 168 ],
169 [
170 dnl Check for random device
171 AC_CHECK_FILE("/dev/urandom",
172 [
173 RANDOM_POOL="/dev/urandom";
6614282f 174 AC_SUBST(RANDOM_POOL)
175 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 176 ]
177 )
178 ]
179)
180
181dnl Check for EGD pool file
182AC_ARG_WITH(egd-pool,
76cd7316 183 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
4cca272e 184 [
185 RANDOM_POOL="$withval";
186 AC_DEFINE(HAVE_EGD)
6614282f 187 AC_SUBST(RANDOM_POOL)
188 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 189 ]
190)
191
76cd7316 192dnl Make sure we have random number support
4cca272e 193if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
194 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
195fi
196
f601d847 197dnl Check for ut_host field in utmp
198AC_MSG_CHECKING([whether utmp.h has ut_host field])
199AC_EGREP_HEADER(ut_host, utmp.h,
200 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
201 [AC_MSG_RESULT(no)]
202)
203
8946db53 204dnl Check for ut_host field in utmpx
205AC_MSG_CHECKING([whether utmpx.h has ut_host field])
206AC_EGREP_HEADER(ut_host, utmpx.h,
207 [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ],
208 [AC_MSG_RESULT(no)]
209)
210
f601d847 211dnl Look for lastlog location
212AC_MSG_CHECKING([location of lastlog file])
213for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
214 if test -f $lastlog ; then
2b942fe0 215 gotlastlog="file"
216 break
217 fi
218 if test -d $lastlog ; then
219 gotlastlog="dir"
f601d847 220 break
221 fi
222done
cfe30346 223if test -z "$gotlastlog" ; then
224 AC_MSG_ERROR([*** Cannot find lastlog ***])
2b942fe0 225else
226 if test "x$gotlastlog" = "xdir" ; then
227 AC_DEFINE(LASTLOG_IS_DIR)
228 AC_MSG_ERROR([*** Directory-based lastlogs are not yet supported ***])
229 fi
230 AC_MSG_RESULT($lastlog)
231 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
cfe30346 232fi
f601d847 233
a408af76 234AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
235AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
236
f601d847 237AC_MSG_CHECKING([whether libc defines __progname])
238AC_TRY_LINK([],
beb43d31 239 [extern char *__progname; printf("%s", __progname);],
f601d847 240 [
241 AC_DEFINE(HAVE___PROGNAME)
242 AC_MSG_RESULT(yes)
243 ],
244 [
245 AC_MSG_RESULT(no)
246 ]
247)
248
91b8065d 249dnl Check whether user wants Kerberos support
250AC_ARG_WITH(kerberos4,
251 [ --with-kerberos4 Enable Kerberos 4 support],
252 [
253 AC_DEFINE(KRB4)
254 LIBS="$LIBS -lkrb"
255 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
256 ]
257)
258
259dnl Check whether user wants AFS support
2b942fe0 260AC_ARG_WITH(afs,
91b8065d 261 [ --with-afs Enable AFS support],
262 [
263 AC_DEFINE(AFS)
264 LIBS="$LIBS -lkafs"
265 ]
266)
267
268dnl Check whether user wants S/Key support
269AC_ARG_WITH(skey,
270 [ --with-skey Enable S/Key support],
271 [
272 AC_DEFINE(SKEY)
273 LIBS="$LIBS -lskey"
274 ]
275)
276
277dnl Check whether user wants TCP wrappers support
2ddcfdf3 278AC_ARG_WITH(tcp-wrappers,
91b8065d 279 [ --with-tcp-wrappers Enable tcpwrappers support],
280 [
281 AC_DEFINE(LIBWRAP)
87e91331 282 LIBWRAP="-lwrap"
91b8065d 283 ]
284)
87e91331 285AC_SUBST(LIBWRAP)
91b8065d 286
caf3bc51 287dnl Check whether to enable MD5 passwords
2ddcfdf3 288AC_ARG_WITH(md5-passwords,
caf3bc51 289 [ --with-md5-passwords Enable use of MD5 passwords],
290 [AC_DEFINE(HAVE_MD5_PASSWORDS)]
291)
292
92f90c57 293dnl Check whether to enable utmpx support
294AC_ARG_WITH(utmpx,
295 [ --with-utmpx Enable utmpx support],
296 [AC_DEFINE(USE_UTMPX)]
297)
298
847e8865 299dnl Check for the path to xauth
300AC_PATH_PROG(xauth_path, xauth)
301AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
302
5881cd60 303AC_OUTPUT(Makefile)
This page took 2.443774 seconds and 5 git commands to generate.