]> andersk Git - openssh.git/blame - configure.in
- Applied another NetBSD portability patch from David Rankin
[openssh.git] / configure.in
CommitLineData
4cca272e 1AC_INIT(ssh.c)
5881cd60 2
3AC_CONFIG_HEADER(config.h)
a7effaac 4AC_CANONICAL_HOST
5881cd60 5
6dnl Checks for programs.
7AC_PROG_CC
4cca272e 8AC_PROG_CPP
5881cd60 9AC_PROG_RANLIB
cf8dd513 10AC_PROG_INSTALL
d4f11b59 11AC_CHECK_PROG(AR, ar, ar)
a7effaac 12AC_PATH_PROG(xauth_path, xauth)
f498ed15 13
14dnl Use ip address instead of hostname in $DISPLAY
15AC_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
25if test ! -z "$xauth_path" ; then
26 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
27fi
28if test ! -z "$rsh_path" ; then
29 AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path")
30fi
a7effaac 31
906a2515 32dnl Checks for compiler characteristics
d4f11b59 33if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi
a7effaac 34
906a2515 35AC_C_INLINE
5881cd60 36
a7effaac 37dnl Check for some target-specific stuff
38case "$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)
f498ed15 45 AC_DEFINE(USE_UTMPX)
a7effaac 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 ;;
f74efc8d 56*-*-solaris*)
57 AC_DEFINE(USE_UTMPX)
58 ;;
d94aa2ae 59*-*-irix5*)
60 AC_DEFINE(CRYPT_H_BREAKS_BUILD)
61# CFLAGS="$CFLAGS -shared"
62 no_libsocket=1
63 no_libnsl=1
64 ;;
a7effaac 65esac
66
d4f11b59 67dnl Check for OpenSSL/SSLeay directories.
68AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
4cca272e 69for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
6614282f 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
d4f11b59 80done
6614282f 81if test -z "$GOT_SSL" ; then
82 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
83fi
d4f11b59 84AC_SUBST(ssldir)
85AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
86if test "$ssldir" != "/usr"; then
87 CFLAGS="$CFLAGS -I$ssldir/include"
7dc6fc6d 88 LDFLAGS="$LDFLAGS -L$ssldir/lib"
d4f11b59 89fi
6614282f 90AC_MSG_RESULT($ssldir)
5881cd60 91
d4f11b59 92dnl Check for RSAref library.
93AC_MSG_CHECKING([for RSAref library])
94saved_LIBS="$LIBS"
95LIBS="$saved_LIBS -lRSAglue -lrsaref"
96AC_TRY_LINK([], [],
97[AC_MSG_RESULT(yes); ],
98[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
5881cd60 99
4cca272e 100dnl Checks for libraries.
101AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
102AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
103AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
d94aa2ae 104AC_CHECK_LIB(crypt, crypt, , )
4cca272e 105
d94aa2ae 106if test -z "$no_libsocket" ; then
107 AC_CHECK_LIB(nsl, yp_match, , )
108fi
109if test -z "$no_libnsl" ; then
110 AC_CHECK_LIB(socket, main, , )
f74efc8d 111fi
4cca272e 112
5881cd60 113dnl Checks for header files.
d94aa2ae 114AC_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)
4cca272e 115
76cd7316 116dnl Checks for library functions.
d94aa2ae 117AC_CHECK_FUNCS(arc4random getpagesize _getpty innetgr md5_crypt mkdtemp openpty setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf)
76cd7316 118
beb43d31 119AC_CHECK_FUNC(login,
120 [AC_DEFINE(HAVE_LOGIN)],
121 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
122)
123
124AC_CHECK_FUNC(daemon,
125 [AC_DEFINE(HAVE_DAEMON)],
126 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
127)
128
2b942fe0 129dnl Checks for data types
130AC_CHECK_SIZEOF(short int, 2)
131AC_CHECK_SIZEOF(int, 4)
132AC_CHECK_SIZEOF(long int, 4)
133AC_CHECK_SIZEOF(long long int, 8)
134
135dnl More checks for data types
96ad4350 136AC_MSG_CHECKING([for quad_t])
2b942fe0 137AC_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
96ad4350 147AC_MSG_CHECKING([for intXX_t types])
2b942fe0 148AC_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
96ad4350 158AC_MSG_CHECKING([for u_intXX_t types])
2b942fe0 159AC_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
169AC_MSG_CHECKING([For uintXX_t types])
170AC_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
ea1970a3 180AC_MSG_CHECKING([For socklen_t])
181AC_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
d94aa2ae 192AC_ARG_WITH(pam,
193 [ --without-pam Disable PAM support ],
96ad4350 194 [
d94aa2ae 195 if test "x$withval" = "xno" ; then
196 no_pam=1
197 AC_DEFINE(DISABLE_PAM)
198 fi
96ad4350 199 ]
d94aa2ae 200)
201
202if 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 )
219fi
96ad4350 220
8015023d 221AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
222dnl Check whether user wants GNOME ssh-askpass
223AC_ARG_WITH(gnome-askpass,
224 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
76cd7316 225 [
226 if test x$withval = xno ; then
8015023d 227 GNOME_ASKPASS="";
76cd7316 228 else
8015023d 229 GNOME_ASKPASS="gnome-ssh-askpass";
76cd7316 230 fi
8015023d 231 ])
232AC_SUBST(GNOME_ASKPASS)
76cd7316 233
8015023d 234if test -z "$GNOME_ASKPASS" ; then
235 AC_MSG_RESULT(no)
236else
237 AC_MSG_RESULT(yes)
76cd7316 238fi
6a0aeebc 239
4cca272e 240dnl Check for user-specified random device
241AC_ARG_WITH(random,
76cd7316 242 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
4cca272e 243 [
244 RANDOM_POOL="$withval";
92da7197 245 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 246 ],
247 [
248 dnl Check for random device
249 AC_CHECK_FILE("/dev/urandom",
250 [
251 RANDOM_POOL="/dev/urandom";
6614282f 252 AC_SUBST(RANDOM_POOL)
253 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 254 ]
255 )
256 ]
257)
258
259dnl Check for EGD pool file
260AC_ARG_WITH(egd-pool,
76cd7316 261 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
4cca272e 262 [
263 RANDOM_POOL="$withval";
264 AC_DEFINE(HAVE_EGD)
6614282f 265 AC_SUBST(RANDOM_POOL)
266 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 267 ]
268)
269
76cd7316 270dnl Make sure we have random number support
4cca272e 271if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
272 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
273fi
274
f601d847 275AC_MSG_CHECKING([whether utmp.h has ut_host field])
276AC_EGREP_HEADER(ut_host, utmp.h,
277 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
278 [AC_MSG_RESULT(no)]
279)
8946db53 280AC_MSG_CHECKING([whether utmpx.h has ut_host field])
281AC_EGREP_HEADER(ut_host, utmpx.h,
282 [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ],
283 [AC_MSG_RESULT(no)]
284)
f498ed15 285AC_MSG_CHECKING([whether utmpx.h has syslen field])
286AC_EGREP_HEADER(syslen, utmpx.h,
287 [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ],
288 [AC_MSG_RESULT(no)]
289)
70e0115b 290AC_MSG_CHECKING([whether utmp.h has ut_pid field])
291AC_EGREP_HEADER(ut_pid, utmp.h,
292 [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ],
293 [AC_MSG_RESULT(no)]
294)
295AC_MSG_CHECKING([whether utmp.h has ut_type field])
296AC_EGREP_HEADER(ut_type, utmp.h,
297 [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ],
298 [AC_MSG_RESULT(no)]
299)
300AC_MSG_CHECKING([whether utmp.h has ut_tv field])
301AC_EGREP_HEADER(ut_tv, utmp.h,
302 [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ],
303 [AC_MSG_RESULT(no)]
304)
c73a0cb5 305AC_MSG_CHECKING([whether utmp.h has ut_id field])
306AC_EGREP_HEADER(ut_id, utmp.h,
307 [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ],
308 [AC_MSG_RESULT(no)]
309)
8946db53 310
f601d847 311dnl Look for lastlog location
a7effaac 312AC_ARG_WITH(lastlog,
cb807f40 313 [ --with-lastlog=FILE Location of lastlog file],
a7effaac 314 [
315 if test "x$withval" = "xno" ; then
316 AC_DEFINE(DISABLE_LASTLOG)
317 else
318 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval")
319 fi
320 ],
321 [
322 AC_MSG_CHECKING([location of lastlog file])
323 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
324 if test -f $lastlog ; then
325 gotlastlog="file"
326 break
327 fi
328 if test -d $lastlog ; then
329 gotlastlog="dir"
330 break
331 fi
332 done
333 if test -z "$gotlastlog" ; then
d94aa2ae 334 AC_MSG_RESULT(not found)
a7effaac 335 nolastlog=1
336 else
337 if test "x$gotlastlog" = "xdir" ; then
d94aa2ae 338 AC_MSG_RESULT(${lastlog}/)
a7effaac 339 AC_DEFINE(LASTLOG_IS_DIR)
340 AC_MSG_WARN([*** Directory-based lastlogs are not yet supported ***])
341 nolastlog=1
d94aa2ae 342 else
343 AC_MSG_RESULT($lastlog)
344 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
a7effaac 345 fi
a7effaac 346 fi
347 ]
348)
349
350if test ! -z "$nolastlog" ; then
351 AC_MSG_WARN([*** Disabling lastlog support *** ])
352 AC_DEFINE(DISABLE_LASTLOG)
353fi
f601d847 354
a408af76 355AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
356AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
357
f601d847 358AC_MSG_CHECKING([whether libc defines __progname])
359AC_TRY_LINK([],
beb43d31 360 [extern char *__progname; printf("%s", __progname);],
f601d847 361 [
362 AC_DEFINE(HAVE___PROGNAME)
363 AC_MSG_RESULT(yes)
364 ],
365 [
366 AC_MSG_RESULT(no)
367 ]
368)
369
91b8065d 370dnl Check whether user wants Kerberos support
371AC_ARG_WITH(kerberos4,
372 [ --with-kerberos4 Enable Kerberos 4 support],
373 [
374 AC_DEFINE(KRB4)
375 LIBS="$LIBS -lkrb"
376 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
377 ]
378)
379
380dnl Check whether user wants AFS support
2b942fe0 381AC_ARG_WITH(afs,
91b8065d 382 [ --with-afs Enable AFS support],
383 [
384 AC_DEFINE(AFS)
385 LIBS="$LIBS -lkafs"
386 ]
387)
388
389dnl Check whether user wants S/Key support
390AC_ARG_WITH(skey,
391 [ --with-skey Enable S/Key support],
392 [
393 AC_DEFINE(SKEY)
394 LIBS="$LIBS -lskey"
395 ]
396)
397
398dnl Check whether user wants TCP wrappers support
2ddcfdf3 399AC_ARG_WITH(tcp-wrappers,
91b8065d 400 [ --with-tcp-wrappers Enable tcpwrappers support],
401 [
402 AC_DEFINE(LIBWRAP)
87e91331 403 LIBWRAP="-lwrap"
91b8065d 404 ]
405)
87e91331 406AC_SUBST(LIBWRAP)
91b8065d 407
caf3bc51 408dnl Check whether to enable MD5 passwords
2ddcfdf3 409AC_ARG_WITH(md5-passwords,
caf3bc51 410 [ --with-md5-passwords Enable use of MD5 passwords],
411 [AC_DEFINE(HAVE_MD5_PASSWORDS)]
412)
413
92f90c57 414dnl Check whether to enable utmpx support
415AC_ARG_WITH(utmpx,
416 [ --with-utmpx Enable utmpx support],
a7effaac 417 [
418 if test "x$withval" != "xno" ; then
419 AC_DEFINE(USE_UTMPX)
420 fi
421 ]
92f90c57 422)
423
a7effaac 424dnl Whether to disable shadow password support
425AC_ARG_WITH(shadow,
426 [ --without-shadow Disable shadow password support],
427 [
428 if test "x$withval" = "xno" ; then
429 AC_DEFINE(DISABLE_SHADOW)
430 fi
431 ]
432)
433
434dnl Use ip address instead of hostname in $DISPLAY
435AC_ARG_WITH(ipaddr-display,
436 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
437 [
438 if test "x$withval" = "xno" ; then
439 AC_DEFINE(IPADDR_IN_DISPLAY)
440 fi
441 ]
442)
443
cb807f40 444AC_ARG_WITH(path,
445 [ --with-default-path=PATH Specify default \$PATH environment for server],
446 [
447 if test "x$withval" != "xno" ; then
c73a0cb5 448 AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
cb807f40 449 fi
450 ]
451)
452
a7effaac 453dnl Check for mail directory (last resort if we cannot get it from headers)
454if test ! -z "$MAIL" ; then
455 maildir=`dirname $MAIL`
456 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
457fi
847e8865 458
5881cd60 459AC_OUTPUT(Makefile)
This page took 0.323275 seconds and 5 git commands to generate.