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