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