]> andersk Git - openssh.git/blame - configure.in
Die if lastlog not found
[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
d4f11b59 9AC_CHECK_PROG(AR, ar, ar)
10if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
5881cd60 11
d4f11b59 12dnl Check for OpenSSL/SSLeay directories.
13AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
4cca272e 14for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
6614282f 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
d4f11b59 25done
6614282f 26if test -z "$GOT_SSL" ; then
27 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
28fi
d4f11b59 29AC_SUBST(ssldir)
30AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
31if test "$ssldir" != "/usr"; then
32 CFLAGS="$CFLAGS -I$ssldir/include"
33 LIBS="$LIBS -L$ssldir/lib"
34fi
35LIBS="$LIBS -lssl -lcrypto"
6614282f 36AC_MSG_RESULT($ssldir)
5881cd60 37
d4f11b59 38dnl Check for RSAref library.
39AC_MSG_CHECKING([for RSAref library])
40saved_LIBS="$LIBS"
41LIBS="$saved_LIBS -lRSAglue -lrsaref"
42AC_TRY_LINK([], [],
43[AC_MSG_RESULT(yes); ],
44[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
5881cd60 45
4cca272e 46dnl Checks for libraries.
47AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
48AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
49AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
50AC_CHECK_LIB(nsl, yp_match, , )
51AC_CHECK_LIB(socket, main, , )
52
53dnl libdl is needed by PAM on Redhat systems
54AC_CHECK_LIB(dl, dlopen, , )
55AC_CHECK_LIB(pam, pam_authenticate, , )
56
5881cd60 57dnl Checks for header files.
793edc37 58AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h shadow.h netgroup.h maillock.h sys/select.h)
4cca272e 59
76cd7316 60dnl Checks for library functions.
61AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle setlogin)
62
beb43d31 63AC_CHECK_FUNC(login,
64 [AC_DEFINE(HAVE_LOGIN)],
65 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
66)
67
68AC_CHECK_FUNC(daemon,
69 [AC_DEFINE(HAVE_DAEMON)],
70 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
71)
72
76cd7316 73dnl Check whether use wants to disable the external ssh-askpass
74INSTALL_ASKPASS="yes"
75AC_MSG_CHECKING([whether to enable external ssh-askpass support])
76AC_ARG_WITH(askpass,
caf3bc51 77 [ --with-askpass=yes/no Enable external ssh-askpass support (default=yes)],
76cd7316 78 [
79 if test x$withval = xno ; then
80 INSTALL_ASKPASS="no"
81 else
82 INSTALL_ASKPASS="yes"
83 fi
84 ]
85)
86if test "x$INSTALL_ASKPASS" = "xyes" ; then
87 AC_DEFINE(USE_EXTERNAL_ASKPASS)
88 AC_SUBST(INSTALL_ASKPASS)
89 AC_MSG_RESULT(yes)
90else
91 AC_MSG_RESULT(no)
92fi
93
94if test "x$INSTALL_ASKPASS" = "xyes" ; then
95 AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
96 dnl Check whether user wants GNOME ssh-askpass
97 AC_ARG_WITH(gnome-askpass,
98 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
99 [
100 if test x$withval = xno ; then
101 GNOME_ASKPASS="";
102 else
103 GNOME_ASKPASS="gnome-ssh-askpass";
104 fi
105 ])
106 AC_SUBST(GNOME_ASKPASS)
107
108 if test -z "$GNOME_ASKPASS" ; then
109 AC_MSG_RESULT(no)
110 else
111 AC_MSG_RESULT(yes)
112 fi
113fi
6a0aeebc 114
4cca272e 115dnl Check for user-specified random device
116AC_ARG_WITH(random,
76cd7316 117 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
4cca272e 118 [
119 RANDOM_POOL="$withval";
92da7197 120 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 121 ],
122 [
123 dnl Check for random device
124 AC_CHECK_FILE("/dev/urandom",
125 [
126 RANDOM_POOL="/dev/urandom";
6614282f 127 AC_SUBST(RANDOM_POOL)
128 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 129 ]
130 )
131 ]
132)
133
134dnl Check for EGD pool file
135AC_ARG_WITH(egd-pool,
76cd7316 136 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
4cca272e 137 [
138 RANDOM_POOL="$withval";
139 AC_DEFINE(HAVE_EGD)
6614282f 140 AC_SUBST(RANDOM_POOL)
141 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 142 ]
143)
144
76cd7316 145dnl Make sure we have random number support
4cca272e 146if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
147 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
148fi
149
f601d847 150dnl Check for ut_host field in utmp
151AC_MSG_CHECKING([whether utmp.h has ut_host field])
152AC_EGREP_HEADER(ut_host, utmp.h,
153 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
154 [AC_MSG_RESULT(no)]
155)
156
157dnl Look for lastlog location
158AC_MSG_CHECKING([location of lastlog file])
159for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
160 if test -f $lastlog ; then
cfe30346 161 gotlastlog="yes"
f601d847 162 AC_MSG_RESULT($lastlog)
163 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
164 break
165 fi
166done
cfe30346 167if test -z "$gotlastlog" ; then
168 AC_MSG_ERROR([*** Cannot find lastlog ***])
169fi
f601d847 170
171AC_MSG_CHECKING([whether libc defines __progname])
172AC_TRY_LINK([],
beb43d31 173 [extern char *__progname; printf("%s", __progname);],
f601d847 174 [
175 AC_DEFINE(HAVE___PROGNAME)
176 AC_MSG_RESULT(yes)
177 ],
178 [
179 AC_MSG_RESULT(no)
180 ]
181)
182
91b8065d 183dnl Check whether user wants Kerberos support
184AC_ARG_WITH(kerberos4,
185 [ --with-kerberos4 Enable Kerberos 4 support],
186 [
187 AC_DEFINE(KRB4)
188 LIBS="$LIBS -lkrb"
189 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
190 ]
191)
192
193dnl Check whether user wants AFS support
194AC_ARG_WITH(kerberos4,
195 [ --with-afs Enable AFS support],
196 [
197 AC_DEFINE(AFS)
198 LIBS="$LIBS -lkafs"
199 ]
200)
201
202dnl Check whether user wants S/Key support
203AC_ARG_WITH(skey,
204 [ --with-skey Enable S/Key support],
205 [
206 AC_DEFINE(SKEY)
207 LIBS="$LIBS -lskey"
208 ]
209)
210
211dnl Check whether user wants TCP wrappers support
212AC_ARG_WITH(skey,
213 [ --with-tcp-wrappers Enable tcpwrappers support],
214 [
215 AC_DEFINE(LIBWRAP)
216 LIBS="$LIBS -lwrap"
217 ]
218)
219
caf3bc51 220dnl Check whether to enable MD5 passwords
221AC_ARG_WITH(md5passwords,
222 [ --with-md5-passwords Enable use of MD5 passwords],
223 [AC_DEFINE(HAVE_MD5_PASSWORDS)]
224)
225
5881cd60 226AC_OUTPUT(Makefile)
This page took 0.12001 seconds and 5 git commands to generate.