]> andersk Git - openssh.git/blob - configure.in
d80ac7c7f490da310bbb372d525bed90f8be0039
[openssh.git] / configure.in
1 AC_INIT(ssh.c)
2
3 AC_CONFIG_HEADER(config.h)
4
5 dnl Checks for programs.
6 AC_PROG_CC
7 AC_PROG_CPP
8 AC_PROG_RANLIB
9 AC_CHECK_PROG(AR, ar, ar)
10 if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
11
12 dnl Check for OpenSSL/SSLeay directories.
13 AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
14 for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
15         if test -f "$ssldir/include/openssl/crypto.h"; then
16                 AC_DEFINE(HAVE_OPENSSL)
17                 GOT_SSL="yes"
18                 break
19         fi
20         if test -f "$ssldir/include/ssl/crypto.h"; then
21                 AC_DEFINE(HAVE_SSL)
22                 GOT_SSL="yes"
23                 break
24         fi
25 done
26 if test -z "$GOT_SSL" ; then
27         AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])       
28 fi
29 AC_SUBST(ssldir)
30 AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
31 if test "$ssldir" != "/usr"; then
32         CFLAGS="$CFLAGS -I$ssldir/include"
33         LIBS="$LIBS -L$ssldir/lib"
34 fi
35 LIBS="$LIBS -lssl -lcrypto"
36 AC_MSG_RESULT($ssldir)
37
38 dnl Check for RSAref library.
39 AC_MSG_CHECKING([for RSAref library])
40 saved_LIBS="$LIBS"
41 LIBS="$saved_LIBS -lRSAglue -lrsaref"
42 AC_TRY_LINK([], [],
43 [AC_MSG_RESULT(yes); ],
44 [AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
45
46 dnl Checks for libraries.
47 AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
48 AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
49 AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
50 AC_CHECK_LIB(nsl, yp_match, , )
51 AC_CHECK_LIB(socket, main, , )
52
53 dnl libdl is needed by PAM on Redhat systems
54 AC_CHECK_LIB(dl, dlopen, , )
55 AC_CHECK_LIB(pam, pam_authenticate, , )
56
57 dnl Checks for header files.
58 AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h)
59
60 dnl Checks for library functions.
61 AC_PROG_GCC_TRADITIONAL
62 AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle setlogin)
63
64 dnl Check for ut_host field in utmp
65 AC_MSG_CHECKING([whether utmp.h has ut_host field])
66 AC_EGREP_HEADER(ut_host, utmp.h, 
67         [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], 
68         [AC_MSG_RESULT(no)]
69 )
70
71 dnl Check whether user wants GNOME ssh-askpass
72 AC_ARG_WITH(gnome-askpass,
73         [  --with-gnome-askpass    Build and use the GNOME passphrase requester],
74         [GNOME_ASKPASS="gnome-ssh-askpass"])
75 AC_SUBST(GNOME_ASKPASS)
76
77 dnl Check for user-specified random device
78 AC_ARG_WITH(random,
79         [  --with-random=FILE      read randomness from FILE (default /dev/urandom)],
80         [
81                 RANDOM_POOL="$withval";
82                 AC_DEFINE(RANDOM_POOL, "$RANDOM_POOL")
83         ],
84         [
85                 dnl Check for random device
86                 AC_CHECK_FILE("/dev/urandom",
87                         [
88                                 RANDOM_POOL="/dev/urandom"; 
89                                 AC_SUBST(RANDOM_POOL)
90                                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
91                         ]
92                 )
93         ]
94 )
95
96 dnl Check for EGD pool file
97 AC_ARG_WITH(egd-pool,
98         [  --with-egd-pool=FILE    read randomness from EGD pool FILE],
99         [
100                 RANDOM_POOL="$withval";
101                 AC_DEFINE(HAVE_EGD)
102                 AC_SUBST(RANDOM_POOL)
103                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
104         ]
105 )
106
107 if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
108         AC_MSG_ERROR([No random device found, and no EGD random pool specified])
109 fi
110
111 dnl Check whether use wants to disable the external ssh-askpass
112 AC_ARG_WITH(askpass,
113         [  --without-askpass       Disable external ssh-askpass support],
114         [AC_DEFINE(DISABLE_EXTERNAL_ASKPASS)],
115         [INSTALL_ASKPASS="yes"]
116 )
117 AC_SUBST(INSTALL_ASKPASS)
118
119 AC_OUTPUT(Makefile)
This page took 0.10428 seconds and 3 git commands to generate.