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