summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac153
1 files changed, 142 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 510b803b4..d7d1a988d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.451 2010/08/16 03:15:23 dtucker Exp $ 1# $Id: configure.ac,v 1.469 2011/01/21 22:37:05 dtucker Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,9 +15,21 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) 17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
18AC_REVISION($Revision: 1.451 $) 18AC_REVISION($Revision: 1.469 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20 20
21# local macros
22AC_DEFUN([OPENSSH_CHECK_CFLAG_COMPILE], [{
23 AC_MSG_CHECKING([if $CC supports $1])
24 saved_CFLAGS="$CFLAGS"
25 CFLAGS="$CFLAGS $1"
26 AC_COMPILE_IFELSE([void main(void) { return 0; }],
27 [ AC_MSG_RESULT(yes) ],
28 [ AC_MSG_RESULT(no)
29 CFLAGS="$saved_CFLAGS" ]
30 )
31}])
32
21AC_CONFIG_HEADER(config.h) 33AC_CONFIG_HEADER(config.h)
22AC_PROG_CC 34AC_PROG_CC
23AC_CANONICAL_HOST 35AC_CANONICAL_HOST
@@ -41,8 +53,24 @@ AC_PATH_PROG(TEST_MINUS_S_SH, bash)
41AC_PATH_PROG(TEST_MINUS_S_SH, ksh) 53AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
42AC_PATH_PROG(TEST_MINUS_S_SH, sh) 54AC_PATH_PROG(TEST_MINUS_S_SH, sh)
43AC_PATH_PROG(SH, sh) 55AC_PATH_PROG(SH, sh)
56AC_PATH_PROG(GROFF, groff)
57AC_PATH_PROG(NROFF, nroff)
58AC_PATH_PROG(MANDOC, mandoc)
44AC_SUBST(TEST_SHELL,sh) 59AC_SUBST(TEST_SHELL,sh)
45 60
61dnl select manpage formatter
62if test "x$MANDOC" != "x" ; then
63 MANFMT="$MANDOC"
64elif test "x$NROFF" != "x" ; then
65 MANFMT="$NROFF -mandoc"
66elif test "x$GROFF" != "x" ; then
67 MANFMT="$GROFF -mandoc -Tascii"
68else
69 AC_MSG_WARN([no manpage formatted found])
70 MANFMT="false"
71fi
72AC_SUBST(MANFMT)
73
46dnl for buildpkg.sh 74dnl for buildpkg.sh
47AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd, 75AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd,
48 [/usr/sbin${PATH_SEPARATOR}/etc]) 76 [/usr/sbin${PATH_SEPARATOR}/etc])
@@ -97,20 +125,27 @@ AC_ARG_WITH(stackprotect,
97 use_stack_protector=0 125 use_stack_protector=0
98 fi ]) 126 fi ])
99 127
128
100if test "$GCC" = "yes" || test "$GCC" = "egcs"; then 129if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
101 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized" 130 OPENSSH_CHECK_CFLAG_COMPILE([-Wall])
131 OPENSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith])
132 OPENSSH_CHECK_CFLAG_COMPILE([-Wuninitialized])
133 OPENSSH_CHECK_CFLAG_COMPILE([-Wsign-compare])
134 OPENSSH_CHECK_CFLAG_COMPILE([-Wformat-security])
135 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-pointer-sign])
136 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-unused-result])
137 OPENSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing])
138 AC_MSG_CHECKING(gcc version)
102 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` 139 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
103 case $GCC_VER in 140 case $GCC_VER in
104 1.*) no_attrib_nonnull=1 ;; 141 1.*) no_attrib_nonnull=1 ;;
105 2.8* | 2.9*) 142 2.8* | 2.9*)
106 CFLAGS="$CFLAGS -Wsign-compare"
107 no_attrib_nonnull=1 143 no_attrib_nonnull=1
108 ;; 144 ;;
109 2.*) no_attrib_nonnull=1 ;; 145 2.*) no_attrib_nonnull=1 ;;
110 3.*) CFLAGS="$CFLAGS -Wsign-compare -Wformat-security" ;;
111 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign -Wformat-security -fno-strict-aliasing" ;;
112 *) ;; 146 *) ;;
113 esac 147 esac
148 AC_MSG_RESULT($GCC_VER)
114 149
115 AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset) 150 AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset)
116 saved_CFLAGS="$CFLAGS" 151 saved_CFLAGS="$CFLAGS"
@@ -333,6 +368,7 @@ AC_CHECK_HEADERS(sys/mount.h, [], [], [
333# Messages for features tested for in target-specific section 368# Messages for features tested for in target-specific section
334SIA_MSG="no" 369SIA_MSG="no"
335SPC_MSG="no" 370SPC_MSG="no"
371SP_MSG="no"
336 372
337# Check for some target-specific stuff 373# Check for some target-specific stuff
338case "$host" in 374case "$host" in
@@ -447,6 +483,7 @@ int main(void) { exit(0); }
447 [Define if your platform needs to skip post auth 483 [Define if your platform needs to skip post auth
448 file descriptor passing]) 484 file descriptor passing])
449 AC_DEFINE(SSH_IOBUFSZ, 65535, [Windows is sensitive to read buffer size]) 485 AC_DEFINE(SSH_IOBUFSZ, 65535, [Windows is sensitive to read buffer size])
486 AC_DEFINE(FILESYSTEM_NO_BACKSLASH, 1, [File names may not contain backslash characters])
450 ;; 487 ;;
451*-*-dgux*) 488*-*-dgux*)
452 AC_DEFINE(IP_TOS_IS_BROKEN, 1, 489 AC_DEFINE(IP_TOS_IS_BROKEN, 1,
@@ -728,6 +765,17 @@ mips-sony-bsd|mips-sony-newsos4)
728 SPC_MSG="yes" ], ) 765 SPC_MSG="yes" ], )
729 ], 766 ],
730 ) 767 )
768 AC_ARG_WITH(solaris-projects,
769 [ --with-solaris-projects Enable Solaris projects (experimental)],
770 [
771 AC_CHECK_LIB(project, setproject,
772 [ AC_DEFINE(USE_SOLARIS_PROJECTS, 1,
773 [Define if you have Solaris projects])
774 SSHDLIBS="$SSHDLIBS -lproject"
775 AC_SUBST(SSHDLIBS)
776 SP_MSG="yes" ], )
777 ],
778 )
731 ;; 779 ;;
732*-*-sunos4*) 780*-*-sunos4*)
733 CPPFLAGS="$CPPFLAGS -DSUNOS4" 781 CPPFLAGS="$CPPFLAGS -DSUNOS4"
@@ -1142,6 +1190,28 @@ AC_TRY_COMPILE(
1142 ] 1190 ]
1143) 1191)
1144 1192
1193# Check for g.gl_statv glob() extension
1194AC_MSG_CHECKING(for gl_statv and GLOB_KEEPSTAT extensions for glob)
1195AC_TRY_COMPILE(
1196 [ #include <glob.h> ],
1197 [
1198#ifndef GLOB_KEEPSTAT
1199#error "glob does not support GLOB_KEEPSTAT extension"
1200#endif
1201glob_t g;
1202g.gl_statv = NULL;
1203],
1204 [
1205 AC_DEFINE(GLOB_HAS_GL_STATV, 1,
1206 [Define if your system glob() function has
1207 gl_statv options in glob_t])
1208 AC_MSG_RESULT(yes)
1209 ],
1210 [
1211 AC_MSG_RESULT(no)
1212 ]
1213)
1214
1145AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include <glob.h>]) 1215AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include <glob.h>])
1146 1216
1147AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) 1217AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
@@ -1297,7 +1367,7 @@ AC_ARG_WITH(libedit,
1297 LDFLAGS="-L${withval}/lib ${LDFLAGS}" 1367 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1298 fi 1368 fi
1299 fi 1369 fi
1300 if test "x$use_pkgconfig_for_libedit" == "xyes"; then 1370 if test "x$use_pkgconfig_for_libedit" = "xyes"; then
1301 LIBEDIT=`$PKGCONFIG --libs-only-l libedit` 1371 LIBEDIT=`$PKGCONFIG --libs-only-l libedit`
1302 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" 1372 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`"
1303 else 1373 else
@@ -1332,7 +1402,7 @@ int main(void)
1332 1402
1333AUDIT_MODULE=none 1403AUDIT_MODULE=none
1334AC_ARG_WITH(audit, 1404AC_ARG_WITH(audit,
1335 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)], 1405 [ --with-audit=module Enable audit support (modules=debug,bsm,linux)],
1336 [ 1406 [
1337 AC_MSG_CHECKING(for supported audit module) 1407 AC_MSG_CHECKING(for supported audit module)
1338 case "$withval" in 1408 case "$withval" in
@@ -1356,10 +1426,18 @@ AC_ARG_WITH(audit,
1356 AC_CHECK_FUNCS(getaudit_addr aug_get_machine) 1426 AC_CHECK_FUNCS(getaudit_addr aug_get_machine)
1357 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module]) 1427 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module])
1358 ;; 1428 ;;
1429 linux)
1430 AC_MSG_RESULT(linux)
1431 AUDIT_MODULE=linux
1432 dnl Checks for headers, libs and functions
1433 AC_CHECK_HEADERS(libaudit.h)
1434 SSHDLIBS="$SSHDLIBS -laudit"
1435 AC_DEFINE(USE_LINUX_AUDIT, 1, [Use Linux audit module])
1436 ;;
1359 debug) 1437 debug)
1360 AUDIT_MODULE=debug 1438 AUDIT_MODULE=debug
1361 AC_MSG_RESULT(debug) 1439 AC_MSG_RESULT(debug)
1362 AC_DEFINE(SSH_AUDIT_EVENTS, 1, Use audit debugging module) 1440 AC_DEFINE(SSH_AUDIT_EVENTS, 1, [Use audit debugging module])
1363 ;; 1441 ;;
1364 no) 1442 no)
1365 AC_MSG_RESULT(no) 1443 AC_MSG_RESULT(no)
@@ -1458,6 +1536,7 @@ AC_CHECK_FUNCS( \
1458 swap32 \ 1536 swap32 \
1459 sysconf \ 1537 sysconf \
1460 tcgetpgrp \ 1538 tcgetpgrp \
1539 timingsafe_bcmp \
1461 truncate \ 1540 truncate \
1462 unsetenv \ 1541 unsetenv \
1463 updwtmpx \ 1542 updwtmpx \
@@ -1468,6 +1547,17 @@ AC_CHECK_FUNCS( \
1468 waitpid \ 1547 waitpid \
1469) 1548)
1470 1549
1550AC_LINK_IFELSE(
1551[
1552#include <ctype.h>
1553int main(void)
1554{
1555 return (isblank('a'));
1556}
1557],
1558 [AC_DEFINE(HAVE_ISBLANK, 1, [Define if you have isblank(3C).])
1559])
1560
1471# PKCS#11 support requires dlopen() and co 1561# PKCS#11 support requires dlopen() and co
1472AC_SEARCH_LIBS(dlopen, dl, 1562AC_SEARCH_LIBS(dlopen, dl,
1473 AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]) 1563 AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])
@@ -2114,6 +2204,8 @@ int main(void) { SSLeay_add_all_algorithms(); }
2114 ] 2204 ]
2115) 2205)
2116 2206
2207AC_CHECK_FUNCS(RSA_generate_key_ex DSA_generate_parameters_ex BN_is_prime_ex RSA_get_default_method)
2208
2117AC_ARG_WITH(ssl-engine, 2209AC_ARG_WITH(ssl-engine,
2118 [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], 2210 [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ],
2119 [ if test "x$withval" != "xno" ; then 2211 [ if test "x$withval" != "xno" ; then
@@ -2180,7 +2272,43 @@ if test "x$check_for_libcrypt_later" = "x1"; then
2180fi 2272fi
2181 2273
2182# Search for SHA256 support in libc and/or OpenSSL 2274# Search for SHA256 support in libc and/or OpenSSL
2183AC_CHECK_FUNCS(SHA256_Update EVP_sha256) 2275AC_CHECK_FUNCS(SHA256_Update EVP_sha256, [TEST_SSH_SHA256=yes],
2276 [TEST_SSH_SHA256=no])
2277AC_SUBST(TEST_SSH_SHA256)
2278
2279# Check complete ECC support in OpenSSL
2280AC_MSG_CHECKING([whether OpenSSL has complete ECC support])
2281AC_LINK_IFELSE(
2282 [AC_LANG_SOURCE([[
2283#include <openssl/ec.h>
2284#include <openssl/ecdh.h>
2285#include <openssl/ecdsa.h>
2286#include <openssl/evp.h>
2287#include <openssl/objects.h>
2288#include <openssl/opensslv.h>
2289#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
2290# error "OpenSSL < 0.9.8g has unreliable ECC code"
2291#endif
2292int main(void) {
2293 EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1);
2294 const EVP_MD *m = EVP_sha512(); /* We need this too */
2295}
2296 ]])],
2297 [
2298 AC_MSG_RESULT(yes)
2299 AC_DEFINE(OPENSSL_HAS_ECC, 1,
2300 [libcrypto includes complete ECC support])
2301 TEST_SSH_ECC=yes
2302 COMMENT_OUT_ECC=""
2303 ],
2304 [
2305 AC_MSG_RESULT(no)
2306 TEST_SSH_ECC=no
2307 COMMENT_OUT_ECC="#no ecc#"
2308 ]
2309)
2310AC_SUBST(TEST_SSH_ECC)
2311AC_SUBST(COMMENT_OUT_ECC)
2184 2312
2185saved_LIBS="$LIBS" 2313saved_LIBS="$LIBS"
2186AC_CHECK_LIB(iaf, ia_openinfo, [ 2314AC_CHECK_LIB(iaf, ia_openinfo, [
@@ -3467,10 +3595,12 @@ AC_ARG_WITH(kerberos5,
3467 [ char *tmp = heimdal_version; ], 3595 [ char *tmp = heimdal_version; ],
3468 [ AC_MSG_RESULT(yes) 3596 [ AC_MSG_RESULT(yes)
3469 AC_DEFINE(HEIMDAL) 3597 AC_DEFINE(HEIMDAL)
3470 K5LIBS="-lkrb5 -ldes" 3598 K5LIBS="-lkrb5"
3471 K5LIBS="$K5LIBS -lcom_err -lasn1" 3599 K5LIBS="$K5LIBS -lcom_err -lasn1"
3472 AC_CHECK_LIB(roken, net_write, 3600 AC_CHECK_LIB(roken, net_write,
3473 [K5LIBS="$K5LIBS -lroken"]) 3601 [K5LIBS="$K5LIBS -lroken"])
3602 AC_CHECK_LIB(des, des_cbc_encrypt,
3603 [K5LIBS="$K5LIBS -ldes"])
3474 ], 3604 ],
3475 [ AC_MSG_RESULT(no) 3605 [ AC_MSG_RESULT(no)
3476 K5LIBS="-lkrb5 -lk5crypto -lcom_err" 3606 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
@@ -4215,6 +4345,7 @@ echo " TCP Wrappers support: $TCPW_MSG"
4215echo " MD5 password support: $MD5_MSG" 4345echo " MD5 password support: $MD5_MSG"
4216echo " libedit support: $LIBEDIT_MSG" 4346echo " libedit support: $LIBEDIT_MSG"
4217echo " Solaris process contract support: $SPC_MSG" 4347echo " Solaris process contract support: $SPC_MSG"
4348echo " Solaris project support: $SP_MSG"
4218echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" 4349echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
4219echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 4350echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
4220echo " BSD Auth support: $BSD_AUTH_MSG" 4351echo " BSD Auth support: $BSD_AUTH_MSG"