]> andersk Git - openssh.git/blame - configure.in
- Added --with-default-path to specify custom path for server
[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 ;;
a7effaac 59esac
60
d4f11b59 61dnl Check for OpenSSL/SSLeay directories.
62AC_MSG_CHECKING([for OpenSSL/SSLeay directory])
4cca272e 63for ssldir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do
6614282f 64 if test -f "$ssldir/include/openssl/crypto.h"; then
65 AC_DEFINE(HAVE_OPENSSL)
66 GOT_SSL="yes"
67 break
68 fi
69 if test -f "$ssldir/include/ssl/crypto.h"; then
70 AC_DEFINE(HAVE_SSL)
71 GOT_SSL="yes"
72 break
73 fi
d4f11b59 74done
6614282f 75if test -z "$GOT_SSL" ; then
76 AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install])
77fi
d4f11b59 78AC_SUBST(ssldir)
79AC_DEFINE_UNQUOTED(ssldir, "$ssldir")
80if test "$ssldir" != "/usr"; then
81 CFLAGS="$CFLAGS -I$ssldir/include"
7dc6fc6d 82 LDFLAGS="$LDFLAGS -L$ssldir/lib"
d4f11b59 83fi
84LIBS="$LIBS -lssl -lcrypto"
6614282f 85AC_MSG_RESULT($ssldir)
5881cd60 86
d4f11b59 87dnl Check for RSAref library.
88AC_MSG_CHECKING([for RSAref library])
89saved_LIBS="$LIBS"
90LIBS="$saved_LIBS -lRSAglue -lrsaref"
91AC_TRY_LINK([], [],
92[AC_MSG_RESULT(yes); ],
93[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
5881cd60 94
4cca272e 95dnl Checks for libraries.
96AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
97AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
98AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
99AC_CHECK_LIB(nsl, yp_match, , )
100AC_CHECK_LIB(socket, main, , )
101
f498ed15 102dnl Use ip address instead of hostname in $DISPLAY
103AC_ARG_WITH(pam,
104 [ --without-pam Disable PAM support ],
105 [
106 if test "x$withval" != "xno" ; then
f74efc8d 107 no_pam=1
f498ed15 108 fi
109 ]
110)
f74efc8d 111if test -z "$no_pam" ; then
112 AC_CHECK_LIB(dl, dlopen, , )
113 AC_CHECK_LIB(pam, pam_authenticate, , )
114fi
4cca272e 115
5881cd60 116dnl Checks for header files.
f498ed15 117AC_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 sys/ttcompat.h)
4cca272e 118
76cd7316 119dnl Checks for library functions.
f498ed15 120AC_CHECK_FUNCS(arc4random updwtmpx mkdtemp openpty _getpty innetgr setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf)
76cd7316 121
beb43d31 122AC_CHECK_FUNC(login,
123 [AC_DEFINE(HAVE_LOGIN)],
124 [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])]
125)
126
127AC_CHECK_FUNC(daemon,
128 [AC_DEFINE(HAVE_DAEMON)],
129 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
130)
131
2b942fe0 132dnl Checks for data types
133AC_CHECK_SIZEOF(short int, 2)
134AC_CHECK_SIZEOF(int, 4)
135AC_CHECK_SIZEOF(long int, 4)
136AC_CHECK_SIZEOF(long long int, 8)
137
138dnl More checks for data types
96ad4350 139AC_MSG_CHECKING([for quad_t])
2b942fe0 140AC_TRY_COMPILE(
141 [#include <sys/types.h>],
142 [quad_t a; a = 1235;],
143 [
144 AC_DEFINE(HAVE_QUAD_T)
145 AC_MSG_RESULT(yes)
146 ],
147 [AC_MSG_RESULT(no)]
148)
149
96ad4350 150AC_MSG_CHECKING([for intXX_t types])
2b942fe0 151AC_TRY_COMPILE(
152 [#include <sys/types.h>],
153 [int16_t a; int32_t b; a = 1235; b = 1235;],
154 [
155 AC_DEFINE(HAVE_INTXX_T)
156 AC_MSG_RESULT(yes)
157 ],
158 [AC_MSG_RESULT(no)]
159)
160
96ad4350 161AC_MSG_CHECKING([for u_intXX_t types])
2b942fe0 162AC_TRY_COMPILE(
163 [#include <sys/types.h>],
164 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
165 [
166 AC_DEFINE(HAVE_U_INTXX_T)
167 AC_MSG_RESULT(yes)
168 ],
169 [AC_MSG_RESULT(no)]
170)
171
172AC_MSG_CHECKING([For uintXX_t types])
173AC_TRY_COMPILE(
174 [#include <sys/types.h>],
175 [uint16_t c; uint32_t d; c = 1235; d = 1235;],
176 [
177 AC_DEFINE(HAVE_UINTXX_T)
178 AC_MSG_RESULT(yes)
179 ],
180 [AC_MSG_RESULT(no)]
181)
182
96ad4350 183dnl Check PAM strerror arguments
184AC_MSG_CHECKING([whether pam_strerror takes only one argument])
185AC_TRY_COMPILE(
186 [
187 #include <stdlib.h>
188 #include <security/pam_appl.h>
189 ],
190 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
191 [AC_MSG_RESULT(no)],
192 [
193 AC_DEFINE(HAVE_OLD_PAM)
194 AC_MSG_RESULT(yes)
195 ]
196)
197
8015023d 198AC_MSG_CHECKING([whether to build GNOME ssh-askpass])
199dnl Check whether user wants GNOME ssh-askpass
200AC_ARG_WITH(gnome-askpass,
201 [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)],
76cd7316 202 [
203 if test x$withval = xno ; then
8015023d 204 GNOME_ASKPASS="";
76cd7316 205 else
8015023d 206 GNOME_ASKPASS="gnome-ssh-askpass";
76cd7316 207 fi
8015023d 208 ])
209AC_SUBST(GNOME_ASKPASS)
76cd7316 210
8015023d 211if test -z "$GNOME_ASKPASS" ; then
212 AC_MSG_RESULT(no)
213else
214 AC_MSG_RESULT(yes)
76cd7316 215fi
6a0aeebc 216
4cca272e 217dnl Check for user-specified random device
218AC_ARG_WITH(random,
76cd7316 219 [ --with-random=FILE read randomness from FILE (default=/dev/urandom)],
4cca272e 220 [
221 RANDOM_POOL="$withval";
92da7197 222 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 223 ],
224 [
225 dnl Check for random device
226 AC_CHECK_FILE("/dev/urandom",
227 [
228 RANDOM_POOL="/dev/urandom";
6614282f 229 AC_SUBST(RANDOM_POOL)
230 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 231 ]
232 )
233 ]
234)
235
236dnl Check for EGD pool file
237AC_ARG_WITH(egd-pool,
76cd7316 238 [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)],
4cca272e 239 [
240 RANDOM_POOL="$withval";
241 AC_DEFINE(HAVE_EGD)
6614282f 242 AC_SUBST(RANDOM_POOL)
243 AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL")
4cca272e 244 ]
245)
246
76cd7316 247dnl Make sure we have random number support
4cca272e 248if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then
249 AC_MSG_ERROR([No random device found, and no EGD random pool specified])
250fi
251
f601d847 252AC_MSG_CHECKING([whether utmp.h has ut_host field])
253AC_EGREP_HEADER(ut_host, utmp.h,
254 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
255 [AC_MSG_RESULT(no)]
256)
8946db53 257AC_MSG_CHECKING([whether utmpx.h has ut_host field])
258AC_EGREP_HEADER(ut_host, utmpx.h,
259 [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ],
260 [AC_MSG_RESULT(no)]
261)
f498ed15 262AC_MSG_CHECKING([whether utmpx.h has syslen field])
263AC_EGREP_HEADER(syslen, utmpx.h,
264 [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ],
265 [AC_MSG_RESULT(no)]
266)
8946db53 267
f601d847 268dnl Look for lastlog location
a7effaac 269AC_ARG_WITH(lastlog,
cb807f40 270 [ --with-lastlog=FILE Location of lastlog file],
a7effaac 271 [
272 if test "x$withval" = "xno" ; then
273 AC_DEFINE(DISABLE_LASTLOG)
274 else
275 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval")
276 fi
277 ],
278 [
279 AC_MSG_CHECKING([location of lastlog file])
280 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
281 if test -f $lastlog ; then
282 gotlastlog="file"
283 break
284 fi
285 if test -d $lastlog ; then
286 gotlastlog="dir"
287 break
288 fi
289 done
290 if test -z "$gotlastlog" ; then
291 AC_MSG_WARN([*** Cannot find lastlog ***])
292 nolastlog=1
293 else
294 if test "x$gotlastlog" = "xdir" ; then
295 AC_DEFINE(LASTLOG_IS_DIR)
296 AC_MSG_WARN([*** Directory-based lastlogs are not yet supported ***])
297 nolastlog=1
298 fi
299 AC_MSG_RESULT($lastlog)
300 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
301 fi
302 ]
303)
304
305if test ! -z "$nolastlog" ; then
306 AC_MSG_WARN([*** Disabling lastlog support *** ])
307 AC_DEFINE(DISABLE_LASTLOG)
308fi
f601d847 309
a408af76 310AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
311AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
312
f601d847 313AC_MSG_CHECKING([whether libc defines __progname])
314AC_TRY_LINK([],
beb43d31 315 [extern char *__progname; printf("%s", __progname);],
f601d847 316 [
317 AC_DEFINE(HAVE___PROGNAME)
318 AC_MSG_RESULT(yes)
319 ],
320 [
321 AC_MSG_RESULT(no)
322 ]
323)
324
91b8065d 325dnl Check whether user wants Kerberos support
326AC_ARG_WITH(kerberos4,
327 [ --with-kerberos4 Enable Kerberos 4 support],
328 [
329 AC_DEFINE(KRB4)
330 LIBS="$LIBS -lkrb"
331 CFLAGS="$CFLAGS -I/usr/include/kerberosIV"
332 ]
333)
334
335dnl Check whether user wants AFS support
2b942fe0 336AC_ARG_WITH(afs,
91b8065d 337 [ --with-afs Enable AFS support],
338 [
339 AC_DEFINE(AFS)
340 LIBS="$LIBS -lkafs"
341 ]
342)
343
344dnl Check whether user wants S/Key support
345AC_ARG_WITH(skey,
346 [ --with-skey Enable S/Key support],
347 [
348 AC_DEFINE(SKEY)
349 LIBS="$LIBS -lskey"
350 ]
351)
352
353dnl Check whether user wants TCP wrappers support
2ddcfdf3 354AC_ARG_WITH(tcp-wrappers,
91b8065d 355 [ --with-tcp-wrappers Enable tcpwrappers support],
356 [
357 AC_DEFINE(LIBWRAP)
87e91331 358 LIBWRAP="-lwrap"
91b8065d 359 ]
360)
87e91331 361AC_SUBST(LIBWRAP)
91b8065d 362
caf3bc51 363dnl Check whether to enable MD5 passwords
2ddcfdf3 364AC_ARG_WITH(md5-passwords,
caf3bc51 365 [ --with-md5-passwords Enable use of MD5 passwords],
366 [AC_DEFINE(HAVE_MD5_PASSWORDS)]
367)
368
92f90c57 369dnl Check whether to enable utmpx support
370AC_ARG_WITH(utmpx,
371 [ --with-utmpx Enable utmpx support],
a7effaac 372 [
373 if test "x$withval" != "xno" ; then
374 AC_DEFINE(USE_UTMPX)
375 fi
376 ]
92f90c57 377)
378
a7effaac 379dnl Whether to disable shadow password support
380AC_ARG_WITH(shadow,
381 [ --without-shadow Disable shadow password support],
382 [
383 if test "x$withval" = "xno" ; then
384 AC_DEFINE(DISABLE_SHADOW)
385 fi
386 ]
387)
388
389dnl Use ip address instead of hostname in $DISPLAY
390AC_ARG_WITH(ipaddr-display,
391 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
392 [
393 if test "x$withval" = "xno" ; then
394 AC_DEFINE(IPADDR_IN_DISPLAY)
395 fi
396 ]
397)
398
cb807f40 399AC_ARG_WITH(path,
400 [ --with-default-path=PATH Specify default \$PATH environment for server],
401 [
402 if test "x$withval" != "xno" ; then
403 AC_DEFINE_UNQUOTED(USER_PATH, $withval")
404 fi
405 ]
406)
407
a7effaac 408dnl Check for mail directory (last resort if we cannot get it from headers)
409if test ! -z "$MAIL" ; then
410 maildir=`dirname $MAIL`
411 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
412fi
847e8865 413
5881cd60 414AC_OUTPUT(Makefile)
This page took 0.920989 seconds and 5 git commands to generate.