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