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