]> andersk Git - openssh.git/blob - configure.in
a232a746b68e45a35e9740d301f1272394d9bcae
[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_MSG_CHECKING([For socklen_t])
181 AC_TRY_COMPILE(
182         [#include <sys/types.h>],
183         [#include <sys/socket.h>],
184         [socklen_t foo; foo = 1235;],
185         [
186                 AC_DEFINE(HAVE_SOCKLEN_T)
187                 AC_MSG_RESULT(yes)
188         ],
189         [AC_MSG_RESULT(no)]
190 )
191
192 AC_ARG_WITH(pam,
193         [  --without-pam           Disable PAM support ],
194         [
195                 if test "x$withval" = "xno" ; then
196                         no_pam=1
197                         AC_DEFINE(DISABLE_PAM)
198                 fi
199         ]
200 )
201
202 if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
203         AC_CHECK_LIB(dl, dlopen, , )
204         LIBS="$LIBS -lpam"
205         dnl Check PAM strerror arguments
206         AC_MSG_CHECKING([whether pam_strerror takes only one argument])
207         AC_TRY_COMPILE(
208                 [
209                         #include <stdlib.h>
210                         #include <security/pam_appl.h>
211                 ], 
212                 [(void)pam_strerror((pam_handle_t *)NULL, -1);], 
213                 [AC_MSG_RESULT(no)],
214                 [
215                         AC_DEFINE(HAVE_OLD_PAM)
216                         AC_MSG_RESULT(yes)
217                 ]
218         ) 
219 fi
220
221 AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
222 dnl Check whether user wants GNOME ssh-askpass
223 AC_ARG_WITH(gnome-askpass,
224         [  --with-gnome-askpass    Build the GNOME passphrase requester (default=no)],
225         [
226                 if test x$withval = xno ; then
227                         GNOME_ASKPASS="";
228                 else
229                         GNOME_ASKPASS="gnome-ssh-askpass";
230                 fi
231         ])
232 AC_SUBST(GNOME_ASKPASS)
233
234 if test -z "$GNOME_ASKPASS" ; then
235         AC_MSG_RESULT(no)
236 else
237         AC_MSG_RESULT(yes)
238 fi
239
240 dnl Check for user-specified random device
241 AC_ARG_WITH(random,
242         [  --with-random=FILE      read randomness from FILE (default=/dev/urandom)],
243         [
244                 RANDOM_POOL="$withval";
245                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
246         ],
247         [
248                 dnl Check for random device
249                 AC_CHECK_FILE("/dev/urandom",
250                         [
251                                 RANDOM_POOL="/dev/urandom"; 
252                                 AC_SUBST(RANDOM_POOL)
253                                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
254                         ]
255                 )
256         ]
257 )
258
259 dnl Check for EGD pool file
260 AC_ARG_WITH(egd-pool,
261         [  --with-egd-pool=FILE    read randomness from EGD pool FILE (default none)],
262         [
263                 RANDOM_POOL="$withval";
264                 AC_DEFINE(HAVE_EGD)
265                 AC_SUBST(RANDOM_POOL)
266                 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
267         ]
268 )
269
270 dnl Make sure we have random number support
271 if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
272         AC_MSG_ERROR([No random device found, and no EGD random pool specified])
273 fi
274
275 AC_MSG_CHECKING([whether utmp.h has ut_host field])
276 AC_EGREP_HEADER(ut_host, utmp.h, 
277         [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], 
278         [AC_MSG_RESULT(no)]
279 )
280 AC_MSG_CHECKING([whether utmpx.h has ut_host field])
281 AC_EGREP_HEADER(ut_host, utmpx.h, 
282         [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ], 
283         [AC_MSG_RESULT(no)]
284 )
285 AC_MSG_CHECKING([whether utmpx.h has syslen field])
286 AC_EGREP_HEADER(syslen, utmpx.h, 
287         [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ], 
288         [AC_MSG_RESULT(no)]
289 )
290 AC_MSG_CHECKING([whether utmp.h has ut_pid field])
291 AC_EGREP_HEADER(ut_pid, utmp.h, 
292         [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ], 
293         [AC_MSG_RESULT(no)]
294 )
295 AC_MSG_CHECKING([whether utmp.h has ut_type field])
296 AC_EGREP_HEADER(ut_type, utmp.h, 
297         [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ], 
298         [AC_MSG_RESULT(no)]
299 )
300 AC_MSG_CHECKING([whether utmp.h has ut_tv field])
301 AC_EGREP_HEADER(ut_tv, utmp.h, 
302         [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], 
303         [AC_MSG_RESULT(no)]
304 )
305
306 dnl Look for lastlog location
307 AC_ARG_WITH(lastlog,
308         [  --with-lastlog=FILE     Location of lastlog file],
309         [
310                 if test "x$withval" = "xno" ; then
311                         AC_DEFINE(DISABLE_LASTLOG)
312                 else
313                         AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval")
314                 fi
315         ],
316         [
317                 AC_MSG_CHECKING([location of lastlog file])
318                 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
319                         if test -f $lastlog ; then
320                                 gotlastlog="file"
321                                 break
322                         fi
323                         if test -d $lastlog ; then
324                                 gotlastlog="dir"
325                                 break
326                         fi
327                 done
328                 if test -z "$gotlastlog" ; then
329                         AC_MSG_RESULT(not found)
330                         nolastlog=1
331                 else
332                         if test "x$gotlastlog" = "xdir" ; then
333                                 AC_MSG_RESULT(${lastlog}/)
334                                 AC_DEFINE(LASTLOG_IS_DIR)
335                                 AC_MSG_WARN([*** Directory-based lastlogs are not yet supported ***])
336                                 nolastlog=1
337                         else
338                                 AC_MSG_RESULT($lastlog)
339                                 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
340                         fi
341                 fi      
342         ]
343 )
344
345 if test ! -z "$nolastlog" ; then
346         AC_MSG_WARN([*** Disabling lastlog support *** ])
347         AC_DEFINE(DISABLE_LASTLOG)
348 fi
349
350 AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
351 AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
352
353 AC_MSG_CHECKING([whether libc defines __progname])
354 AC_TRY_LINK([], 
355         [extern char *__progname; printf("%s", __progname);], 
356         [
357                 AC_DEFINE(HAVE___PROGNAME)
358                 AC_MSG_RESULT(yes)
359         ], 
360         [
361                 AC_MSG_RESULT(no)
362         ]
363 )
364
365 dnl Check whether user wants Kerberos support
366 AC_ARG_WITH(kerberos4,
367         [  --with-kerberos4        Enable Kerberos 4 support],
368         [
369                 AC_DEFINE(KRB4)
370                 LIBS="$LIBS -lkrb"
371                 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
372         ]
373 )
374
375 dnl Check whether user wants AFS support
376 AC_ARG_WITH(afs,
377         [  --with-afs              Enable AFS support],
378         [
379                 AC_DEFINE(AFS)
380                 LIBS="$LIBS -lkafs"
381         ]
382 )
383
384 dnl Check whether user wants S/Key support
385 AC_ARG_WITH(skey,
386         [  --with-skey             Enable S/Key support],
387         [
388                 AC_DEFINE(SKEY)
389                 LIBS="$LIBS -lskey"
390         ]
391 )
392
393 dnl Check whether user wants TCP wrappers support
394 AC_ARG_WITH(tcp-wrappers,
395         [  --with-tcp-wrappers     Enable tcpwrappers support],
396         [
397                 AC_DEFINE(LIBWRAP)
398                 LIBWRAP="-lwrap"
399         ]
400 )
401 AC_SUBST(LIBWRAP)
402
403 dnl Check whether to enable MD5 passwords
404 AC_ARG_WITH(md5-passwords,
405         [  --with-md5-passwords    Enable use of MD5 passwords],
406         [AC_DEFINE(HAVE_MD5_PASSWORDS)]
407 )
408
409 dnl Check whether to enable utmpx support
410 AC_ARG_WITH(utmpx,
411         [  --with-utmpx            Enable utmpx support],
412         [
413                 if test "x$withval" != "xno" ; then
414                         AC_DEFINE(USE_UTMPX)
415                 fi
416         ]
417 )
418
419 dnl Whether to disable shadow password support
420 AC_ARG_WITH(shadow,
421         [  --without-shadow        Disable shadow password support],
422         [
423                 if test "x$withval" = "xno" ; then      
424                         AC_DEFINE(DISABLE_SHADOW)
425                 fi
426         ]
427 )
428
429 dnl Use ip address instead of hostname in $DISPLAY
430 AC_ARG_WITH(ipaddr-display,
431         [  --with-ipaddr-display   Use ip address instead of hostname in \$DISPLAY],
432         [
433                 if test "x$withval" = "xno" ; then      
434                         AC_DEFINE(IPADDR_IN_DISPLAY)
435                 fi
436         ]
437 )
438
439 AC_ARG_WITH(path,
440         [  --with-default-path=PATH Specify default \$PATH environment for server],
441         [
442                 if test "x$withval" != "xno" ; then     
443                         AC_DEFINE_UNQUOTED(USER_PATH, $withval")
444                 fi
445         ]
446 )
447
448 dnl Check for mail directory (last resort if we cannot get it from headers)
449 if test ! -z "$MAIL" ; then
450         maildir=`dirname $MAIL`
451         AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
452 fi
453
454 AC_OUTPUT(Makefile)
This page took 0.062967 seconds and 3 git commands to generate.