]> andersk Git - openssh.git/blob - configure.in
- Added OpenBSD bsd-strlcat.c, created bsd-strlcat.h
[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 shadow.h netgroup.h maillock.h sys/select.h sys/time.h)
59
60 dnl Checks for library functions.
61 AC_CHECK_FUNCS(openpty strlcpy strlcat mkdtemp arc4random setproctitle setlogin)
62
63 AC_CHECK_FUNC(login, 
64         [AC_DEFINE(HAVE_LOGIN)],
65         [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
66 )
67
68 AC_CHECK_FUNC(daemon, 
69         [AC_DEFINE(HAVE_DAEMON)],
70         [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
71 )
72
73 dnl Checks for data types
74 AC_CHECK_SIZEOF(short int, 2)
75 AC_CHECK_SIZEOF(int, 4)
76 AC_CHECK_SIZEOF(long int, 4)
77 AC_CHECK_SIZEOF(long long int, 8)
78
79 dnl More checks for data types
80 AC_MSG_CHECKING([For quad_t])
81 AC_TRY_COMPILE(
82         [#include <sys/types.h>], 
83         [quad_t a; a = 1235;], 
84         [
85                 AC_DEFINE(HAVE_QUAD_T)
86                 AC_MSG_RESULT(yes)
87         ],
88         [AC_MSG_RESULT(no)]
89
90
91 AC_MSG_CHECKING([For intXX_t types])
92 AC_TRY_COMPILE(
93         [#include <sys/types.h>], 
94         [int16_t a; int32_t b; a = 1235; b = 1235;], 
95         [
96                 AC_DEFINE(HAVE_INTXX_T)
97                 AC_MSG_RESULT(yes)
98         ],
99         [AC_MSG_RESULT(no)]
100
101
102 AC_MSG_CHECKING([For u_intXX_t types])
103 AC_TRY_COMPILE(
104         [#include <sys/types.h>], 
105         [u_int16_t c; u_int32_t d; c = 1235; d = 1235;], 
106         [
107                 AC_DEFINE(HAVE_U_INTXX_T)
108                 AC_MSG_RESULT(yes)
109         ],
110         [AC_MSG_RESULT(no)]
111
112
113 AC_MSG_CHECKING([For uintXX_t types])
114 AC_TRY_COMPILE(
115         [#include <sys/types.h>], 
116         [uint16_t c; uint32_t d; c = 1235; d = 1235;], 
117         [
118                 AC_DEFINE(HAVE_UINTXX_T)
119                 AC_MSG_RESULT(yes)
120         ],
121         [AC_MSG_RESULT(no)]
122
123
124 dnl Check whether use wants to disable the external ssh-askpass
125 INSTALL_ASKPASS="yes"
126 AC_MSG_CHECKING([whether to enable external ssh-askpass support])
127 AC_ARG_WITH(askpass,
128         [  --with-askpass=yes/no   Enable external ssh-askpass support (default=yes)],
129         [
130                 if test x$withval = xno ; then
131                         INSTALL_ASKPASS="no"
132                 else
133                         INSTALL_ASKPASS="yes"
134                 fi
135         ]
136 )
137 if test "x$INSTALL_ASKPASS" = "xyes" ; then
138         AC_DEFINE(USE_EXTERNAL_ASKPASS)
139         AC_SUBST(INSTALL_ASKPASS)
140         AC_MSG_RESULT(yes)
141 else
142         AC_MSG_RESULT(no)
143 fi
144
145 if test "x$INSTALL_ASKPASS" = "xyes" ; then
146         AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
147         dnl Check whether user wants GNOME ssh-askpass
148         AC_ARG_WITH(gnome-askpass,
149                 [  --with-gnome-askpass    Build the GNOME passphrase requester (default=no)],
150                 [
151                         if test x$withval = xno ; then
152                                 GNOME_ASKPASS="";
153                         else
154                                 GNOME_ASKPASS="gnome-ssh-askpass";
155                         fi
156                 ])
157         AC_SUBST(GNOME_ASKPASS)
158
159         if test -z "$GNOME_ASKPASS" ; then
160                 AC_MSG_RESULT(no)
161         else
162                 AC_MSG_RESULT(yes)
163         fi
164 fi
165
166 dnl Check for user-specified random device
167 AC_ARG_WITH(random,
168         [  --with-random=FILE      read randomness from FILE (default=/dev/urandom)],
169         [
170                 RANDOM_POOL="$withval";
171                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
172         ],
173         [
174                 dnl Check for random device
175                 AC_CHECK_FILE("/dev/urandom",
176                         [
177                                 RANDOM_POOL="/dev/urandom"; 
178                                 AC_SUBST(RANDOM_POOL)
179                                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
180                         ]
181                 )
182         ]
183 )
184
185 dnl Check for EGD pool file
186 AC_ARG_WITH(egd-pool,
187         [  --with-egd-pool=FILE    read randomness from EGD pool FILE (default none)],
188         [
189                 RANDOM_POOL="$withval";
190                 AC_DEFINE(HAVE_EGD)
191                 AC_SUBST(RANDOM_POOL)
192                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
193         ]
194 )
195
196 dnl Make sure we have random number support
197 if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
198         AC_MSG_ERROR([No random device found, and no EGD random pool specified])
199 fi
200
201 dnl Check for ut_host field in utmp
202 AC_MSG_CHECKING([whether utmp.h has ut_host field])
203 AC_EGREP_HEADER(ut_host, utmp.h, 
204         [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], 
205         [AC_MSG_RESULT(no)]
206 )
207
208 dnl Look for lastlog location
209 AC_MSG_CHECKING([location of lastlog file])
210 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
211         if test -f $lastlog ; then
212                 gotlastlog="file"
213                 break
214         fi
215         if test -d $lastlog ; then
216                 gotlastlog="dir"
217                 break
218         fi
219 done
220 if test -z "$gotlastlog" ; then
221         AC_MSG_ERROR([*** Cannot find lastlog ***])
222 else
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")
229 fi      
230
231 AC_MSG_CHECKING([whether libc defines __progname])
232 AC_TRY_LINK([], 
233         [extern char *__progname; printf("%s", __progname);], 
234         [
235                 AC_DEFINE(HAVE___PROGNAME)
236                 AC_MSG_RESULT(yes)
237         ], 
238         [
239                 AC_MSG_RESULT(no)
240         ]
241 )
242
243 dnl Check whether user wants Kerberos support
244 AC_ARG_WITH(kerberos4,
245         [  --with-kerberos4        Enable Kerberos 4 support],
246         [
247                 AC_DEFINE(KRB4)
248                 LIBS="$LIBS -lkrb"
249                 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
250         ]
251 )
252
253 dnl Check whether user wants AFS support
254 AC_ARG_WITH(afs,
255         [  --with-afs              Enable AFS support],
256         [
257                 AC_DEFINE(AFS)
258                 LIBS="$LIBS -lkafs"
259         ]
260 )
261
262 dnl Check whether user wants S/Key support
263 AC_ARG_WITH(skey,
264         [  --with-skey             Enable S/Key support],
265         [
266                 AC_DEFINE(SKEY)
267                 LIBS="$LIBS -lskey"
268         ]
269 )
270
271 dnl Check whether user wants TCP wrappers support
272 AC_ARG_WITH(skey,
273         [  --with-tcp-wrappers     Enable tcpwrappers support],
274         [
275                 AC_DEFINE(LIBWRAP)
276                 LIBS="$LIBS -lwrap"
277         ]
278 )
279
280 dnl Check whether to enable MD5 passwords
281 AC_ARG_WITH(md5passwords,
282         [  --with-md5-passwords    Enable use of MD5 passwords],
283         [AC_DEFINE(HAVE_MD5_PASSWORDS)]
284 )
285
286 AC_OUTPUT(Makefile)
This page took 0.061038 seconds and 5 git commands to generate.