summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac133
1 files changed, 119 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index f1052b079..fcf7e416b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.383 2007/08/10 04:36:12 dtucker Exp $ 1# $Id: configure.ac,v 1.409 2008/07/09 11:07:19 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
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.383 $) 18AC_REVISION($Revision: 1.409 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20 20
21AC_CONFIG_HEADER(config.h) 21AC_CONFIG_HEADER(config.h)
@@ -90,6 +90,13 @@ AC_C_INLINE
90 90
91AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>]) 91AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
92 92
93use_stack_protector=1
94AC_ARG_WITH(stackprotect,
95 [ --without-stackprotect Don't use compiler's stack protection], [
96 if test "x$withval" = "xno"; then
97 use_stack_protector=0
98 fi ])
99
93if test "$GCC" = "yes" || test "$GCC" = "egcs"; then 100if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
94 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized" 101 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
95 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` 102 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
@@ -100,11 +107,61 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
100 no_attrib_nonnull=1 107 no_attrib_nonnull=1
101 ;; 108 ;;
102 2.*) no_attrib_nonnull=1 ;; 109 2.*) no_attrib_nonnull=1 ;;
103 3.*) CFLAGS="$CFLAGS -Wsign-compare" ;; 110 3.*) CFLAGS="$CFLAGS -Wsign-compare -Wformat-security" ;;
104 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign" ;; 111 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign -Wformat-security" ;;
105 *) ;; 112 *) ;;
106 esac 113 esac
107 114
115 AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset)
116 saved_CFLAGS="$CFLAGS"
117 CFLAGS="$CFLAGS -fno-builtin-memset"
118 AC_LINK_IFELSE( [AC_LANG_SOURCE([[
119#include <string.h>
120int main(void){char b[10]; memset(b, 0, sizeof(b));}
121 ]])],
122 [ AC_MSG_RESULT(yes) ],
123 [ AC_MSG_RESULT(no)
124 CFLAGS="$saved_CFLAGS" ]
125)
126
127 # -fstack-protector-all doesn't always work for some GCC versions
128 # and/or platforms, so we test if we can. If it's not supported
129 # on a give platform gcc will emit a warning so we use -Werror.
130 if test "x$use_stack_protector" = "x1"; then
131 for t in -fstack-protector-all -fstack-protector; do
132 AC_MSG_CHECKING(if $CC supports $t)
133 saved_CFLAGS="$CFLAGS"
134 saved_LDFLAGS="$LDFLAGS"
135 CFLAGS="$CFLAGS $t -Werror"
136 LDFLAGS="$LDFLAGS $t -Werror"
137 AC_LINK_IFELSE(
138 [AC_LANG_SOURCE([
139#include <stdlib.h>
140int main(void){return 0;}
141 ])],
142 [ AC_MSG_RESULT(yes)
143 CFLAGS="$saved_CFLAGS $t"
144 LDFLAGS="$saved_LDFLAGS $t"
145 AC_MSG_CHECKING(if $t works)
146 AC_RUN_IFELSE(
147 [AC_LANG_SOURCE([
148#include <stdlib.h>
149int main(void){exit(0);}
150 ])],
151 [ AC_MSG_RESULT(yes)
152 break ],
153 [ AC_MSG_RESULT(no) ],
154 [ AC_MSG_WARN([cross compiling: cannot test])
155 break ]
156 )
157 ],
158 [ AC_MSG_RESULT(no) ]
159 )
160 CFLAGS="$saved_CFLAGS"
161 LDFLAGS="$saved_LDFLAGS"
162 done
163 fi
164
108 if test -z "$have_llong_max"; then 165 if test -z "$have_llong_max"; then
109 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes 166 # retry LLONG_MAX with -std=gnu99, needed on some Linuxes
110 unset ac_cv_have_decl_LLONG_MAX 167 unset ac_cv_have_decl_LLONG_MAX
@@ -222,7 +279,9 @@ AC_CHECK_HEADERS( \
222 sys/cdefs.h \ 279 sys/cdefs.h \
223 sys/dir.h \ 280 sys/dir.h \
224 sys/mman.h \ 281 sys/mman.h \
282 sys/mount.h \
225 sys/ndir.h \ 283 sys/ndir.h \
284 sys/poll.h \
226 sys/prctl.h \ 285 sys/prctl.h \
227 sys/pstat.h \ 286 sys/pstat.h \
228 sys/select.h \ 287 sys/select.h \
@@ -230,6 +289,7 @@ AC_CHECK_HEADERS( \
230 sys/stream.h \ 289 sys/stream.h \
231 sys/stropts.h \ 290 sys/stropts.h \
232 sys/strtio.h \ 291 sys/strtio.h \
292 sys/statvfs.h \
233 sys/sysmacros.h \ 293 sys/sysmacros.h \
234 sys/time.h \ 294 sys/time.h \
235 sys/timers.h \ 295 sys/timers.h \
@@ -343,7 +403,7 @@ int main(void) { exit(0); }
343 [], 403 [],
344 [#include <usersec.h>] 404 [#include <usersec.h>]
345 ) 405 )
346 AC_CHECK_FUNCS(setauthdb) 406 AC_CHECK_FUNCS(getgrset setauthdb)
347 AC_CHECK_DECL(F_CLOSEM, 407 AC_CHECK_DECL(F_CLOSEM,
348 AC_DEFINE(HAVE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]), 408 AC_DEFINE(HAVE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]),
349 [], 409 [],
@@ -405,6 +465,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
405 AC_DEFINE(SETEUID_BREAKS_SETUID) 465 AC_DEFINE(SETEUID_BREAKS_SETUID)
406 AC_DEFINE(BROKEN_SETREUID) 466 AC_DEFINE(BROKEN_SETREUID)
407 AC_DEFINE(BROKEN_SETREGID) 467 AC_DEFINE(BROKEN_SETREGID)
468 AC_DEFINE(BROKEN_GLOB, 1, [OS X glob does not do what we expect])
408 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1, 469 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1,
409 [Define if your resolver libs need this for getrrsetbyname]) 470 [Define if your resolver libs need this for getrrsetbyname])
410 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) 471 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
@@ -412,6 +473,11 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
412 [Use tunnel device compatibility to OpenBSD]) 473 [Use tunnel device compatibility to OpenBSD])
413 AC_DEFINE(SSH_TUN_PREPEND_AF, 1, 474 AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
414 [Prepend the address family to IP tunnel traffic]) 475 [Prepend the address family to IP tunnel traffic])
476 m4_pattern_allow(AU_IPv)
477 AC_CHECK_DECL(AU_IPv4, [],
478 AC_DEFINE(AU_IPv4, 0, [System only supports IPv4 audit records])
479 [#include <bsm/audit.h>]
480 )
415 ;; 481 ;;
416*-*-dragonfly*) 482*-*-dragonfly*)
417 SSHDLIBS="$SSHDLIBS -lcrypt" 483 SSHDLIBS="$SSHDLIBS -lcrypt"
@@ -499,7 +565,6 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
499 no_dev_ptmx=1 565 no_dev_ptmx=1
500 check_for_libcrypt_later=1 566 check_for_libcrypt_later=1
501 check_for_openpty_ctty_bug=1 567 check_for_openpty_ctty_bug=1
502 AC_DEFINE(DONT_TRY_OTHER_AF, 1, [Workaround more Linux IPv6 quirks])
503 AC_DEFINE(PAM_TTY_KLUDGE, 1, 568 AC_DEFINE(PAM_TTY_KLUDGE, 1,
504 [Work around problematic Linux PAM modules handling of PAM_TTY]) 569 [Work around problematic Linux PAM modules handling of PAM_TTY])
505 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!", 570 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!",
@@ -549,6 +614,7 @@ mips-sony-bsd|mips-sony-newsos4)
549 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) 614 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
550 AC_CHECK_HEADER([net/if_tap.h], , 615 AC_CHECK_HEADER([net/if_tap.h], ,
551 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support])) 616 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
617 AC_DEFINE(BROKEN_GLOB, 1, [FreeBSD glob does not do what we need])
552 ;; 618 ;;
553*-*-bsdi*) 619*-*-bsdi*)
554 AC_DEFINE(SETEUID_BREAKS_SETUID) 620 AC_DEFINE(SETEUID_BREAKS_SETUID)
@@ -775,6 +841,7 @@ mips-sony-bsd|mips-sony-newsos4)
775 AC_DEFINE(SETEUID_BREAKS_SETUID) 841 AC_DEFINE(SETEUID_BREAKS_SETUID)
776 AC_DEFINE(BROKEN_SETREUID) 842 AC_DEFINE(BROKEN_SETREUID)
777 AC_DEFINE(BROKEN_SETREGID) 843 AC_DEFINE(BROKEN_SETREGID)
844 AC_DEFINE(BROKEN_READV_COMPARISON, 1, [Can't do comparisons on readv])
778 ;; 845 ;;
779 846
780*-*-nto-qnx*) 847*-*-nto-qnx*)
@@ -785,6 +852,7 @@ mips-sony-bsd|mips-sony-newsos4)
785 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems]) 852 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
786 AC_DEFINE(DISABLE_LASTLOG) 853 AC_DEFINE(DISABLE_LASTLOG)
787 AC_DEFINE(SSHD_ACQUIRES_CTTY) 854 AC_DEFINE(SSHD_ACQUIRES_CTTY)
855 AC_DEFINE(BROKEN_SHADOW_EXPIRE, 1, [QNX shadow support is broken])
788 enable_etc_default_login=no # has incompatible /etc/default/login 856 enable_etc_default_login=no # has incompatible /etc/default/login
789 case "$host" in 857 case "$host" in
790 *-*-nto-qnx6*) 858 *-*-nto-qnx6*)
@@ -980,7 +1048,7 @@ dnl Checks for libutil functions
980AC_CHECK_HEADERS(libutil.h) 1048AC_CHECK_HEADERS(libutil.h)
981AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1, 1049AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1,
982 [Define if your libraries define login()])]) 1050 [Define if your libraries define login()])])
983AC_CHECK_FUNCS(logout updwtmp logwtmp) 1051AC_CHECK_FUNCS(fmt_scaled logout updwtmp logwtmp)
984 1052
985AC_FUNC_STRFTIME 1053AC_FUNC_STRFTIME
986 1054
@@ -1214,7 +1282,7 @@ AC_ARG_WITH(audit,
1214 AC_CHECK_FUNCS(getaudit, [], 1282 AC_CHECK_FUNCS(getaudit, [],
1215 [AC_MSG_ERROR(BSM enabled and required function not found)]) 1283 [AC_MSG_ERROR(BSM enabled and required function not found)])
1216 # These are optional 1284 # These are optional
1217 AC_CHECK_FUNCS(getaudit_addr) 1285 AC_CHECK_FUNCS(getaudit_addr aug_get_machine)
1218 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module]) 1286 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module])
1219 ;; 1287 ;;
1220 debug) 1288 debug)
@@ -1234,6 +1302,8 @@ AC_ARG_WITH(audit,
1234dnl Checks for library functions. Please keep in alphabetical order 1302dnl Checks for library functions. Please keep in alphabetical order
1235AC_CHECK_FUNCS( \ 1303AC_CHECK_FUNCS( \
1236 arc4random \ 1304 arc4random \
1305 arc4random_buf \
1306 arc4random_uniform \
1237 asprintf \ 1307 asprintf \
1238 b64_ntop \ 1308 b64_ntop \
1239 __b64_ntop \ 1309 __b64_ntop \
@@ -1247,6 +1317,7 @@ AC_CHECK_FUNCS( \
1247 fchmod \ 1317 fchmod \
1248 fchown \ 1318 fchown \
1249 freeaddrinfo \ 1319 freeaddrinfo \
1320 fstatvfs \
1250 futimes \ 1321 futimes \
1251 getaddrinfo \ 1322 getaddrinfo \
1252 getcwd \ 1323 getcwd \
@@ -1298,6 +1369,8 @@ AC_CHECK_FUNCS( \
1298 sigvec \ 1369 sigvec \
1299 snprintf \ 1370 snprintf \
1300 socketpair \ 1371 socketpair \
1372 statfs \
1373 statvfs \
1301 strdup \ 1374 strdup \
1302 strerror \ 1375 strerror \
1303 strlcat \ 1376 strlcat \
@@ -2004,7 +2077,10 @@ AC_CHECK_FUNCS(SHA256_Update EVP_sha256)
2004saved_LIBS="$LIBS" 2077saved_LIBS="$LIBS"
2005AC_CHECK_LIB(iaf, ia_openinfo, [ 2078AC_CHECK_LIB(iaf, ia_openinfo, [
2006 LIBS="$LIBS -liaf" 2079 LIBS="$LIBS -liaf"
2007 AC_CHECK_FUNCS(set_id, [SSHDLIBS="$SSHDLIBS -liaf"]) 2080 AC_CHECK_FUNCS(set_id, [SSHDLIBS="$SSHDLIBS -liaf"
2081 AC_DEFINE(HAVE_LIBIAF, 1,
2082 [Define if system has libiaf that supports set_id])
2083 ])
2008]) 2084])
2009LIBS="$saved_LIBS" 2085LIBS="$saved_LIBS"
2010 2086
@@ -2588,6 +2664,18 @@ fi
2588TYPE_SOCKLEN_T 2664TYPE_SOCKLEN_T
2589 2665
2590AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) 2666AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
2667AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t],,,[
2668#include <sys/types.h>
2669#ifdef HAVE_SYS_BITYPES_H
2670#include <sys/bitypes.h>
2671#endif
2672#ifdef HAVE_SYS_STATFS_H
2673#include <sys/statfs.h>
2674#endif
2675#ifdef HAVE_SYS_STATVFS_H
2676#include <sys/statvfs.h>
2677#endif
2678])
2591 2679
2592AC_CHECK_TYPES(in_addr_t,,, 2680AC_CHECK_TYPES(in_addr_t,,,
2593[#include <sys/types.h> 2681[#include <sys/types.h>
@@ -2950,6 +3038,16 @@ if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2950 file descriptor passing]) 3038 file descriptor passing])
2951fi 3039fi
2952 3040
3041AC_MSG_CHECKING(if f_fsid has val members)
3042AC_TRY_COMPILE([
3043#include <sys/types.h>
3044#include <sys/statvfs.h>],
3045[struct fsid_t t; t.val[0] = 0;],
3046 [ AC_MSG_RESULT(yes)
3047 AC_DEFINE(FSID_HAS_VAL, 1, f_fsid has members) ],
3048 [ AC_MSG_RESULT(no) ]
3049)
3050
2953AC_CACHE_CHECK([for msg_control field in struct msghdr], 3051AC_CACHE_CHECK([for msg_control field in struct msghdr],
2954 ac_cv_have_control_in_msghdr, [ 3052 ac_cv_have_control_in_msghdr, [
2955 AC_COMPILE_IFELSE( 3053 AC_COMPILE_IFELSE(
@@ -3201,7 +3299,7 @@ int main() { return 0; }
3201SELINUX_MSG="no" 3299SELINUX_MSG="no"
3202LIBSELINUX="" 3300LIBSELINUX=""
3203AC_ARG_WITH(selinux, 3301AC_ARG_WITH(selinux,
3204 [ --with-selinux Enable SELinux support], 3302 [ --with-selinux Enable SELinux support],
3205 [ if test "x$withval" != "xno" ; then 3303 [ if test "x$withval" != "xno" ; then
3206 save_LIBS="$LIBS" 3304 save_LIBS="$LIBS"
3207 AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.]) 3305 AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.])
@@ -3278,12 +3376,12 @@ AC_ARG_WITH(kerberos5,
3278 ) 3376 )
3279 AC_SEARCH_LIBS(dn_expand, resolv) 3377 AC_SEARCH_LIBS(dn_expand, resolv)
3280 3378
3281 AC_CHECK_LIB(gssapi,gss_init_sec_context, 3379 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,
3282 [ AC_DEFINE(GSSAPI) 3380 [ AC_DEFINE(GSSAPI)
3283 K5LIBS="-lgssapi $K5LIBS" ], 3381 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
3284 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context, 3382 [ AC_CHECK_LIB(gssapi, gss_init_sec_context,
3285 [ AC_DEFINE(GSSAPI) 3383 [ AC_DEFINE(GSSAPI)
3286 K5LIBS="-lgssapi_krb5 $K5LIBS" ], 3384 K5LIBS="-lgssapi $K5LIBS" ],
3287 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]), 3385 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
3288 $K5LIBS) 3386 $K5LIBS)
3289 ], 3387 ],
@@ -3982,6 +4080,13 @@ dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3982dnl Add now. 4080dnl Add now.
3983CFLAGS="$CFLAGS $werror_flags" 4081CFLAGS="$CFLAGS $werror_flags"
3984 4082
4083if grep "#define BROKEN_GETADDRINFO 1" confdefs.h >/dev/null || \
4084 test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
4085 AC_SUBST(TEST_SSH_IPV6, no)
4086else
4087 AC_SUBST(TEST_SSH_IPV6, yes)
4088fi
4089
3985AC_EXEEXT 4090AC_EXEEXT
3986AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ 4091AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
3987 openbsd-compat/Makefile openbsd-compat/regress/Makefile \ 4092 openbsd-compat/Makefile openbsd-compat/regress/Makefile \