summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac135
1 files changed, 120 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index a9eb8e76d..ba9d9a37a 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])
@@ -436,7 +497,12 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
436 fi], 497 fi],
437 [AC_MSG_RESULT(no)] 498 [AC_MSG_RESULT(no)]
438 ) 499 )
439 ;; 500 m4_pattern_allow(AU_IPv)
501 AC_CHECK_DECL(AU_IPv4, [],
502 AC_DEFINE(AU_IPv4, 0, [System only supports IPv4 audit records])
503 [#include <bsm/audit.h>]
504 )
505 ;;
440*-*-dragonfly*) 506*-*-dragonfly*)
441 SSHDLIBS="$SSHDLIBS -lcrypt" 507 SSHDLIBS="$SSHDLIBS -lcrypt"
442 ;; 508 ;;
@@ -523,7 +589,6 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
523 no_dev_ptmx=1 589 no_dev_ptmx=1
524 check_for_libcrypt_later=1 590 check_for_libcrypt_later=1
525 check_for_openpty_ctty_bug=1 591 check_for_openpty_ctty_bug=1
526 AC_DEFINE(DONT_TRY_OTHER_AF, 1, [Workaround more Linux IPv6 quirks])
527 AC_DEFINE(PAM_TTY_KLUDGE, 1, 592 AC_DEFINE(PAM_TTY_KLUDGE, 1,
528 [Work around problematic Linux PAM modules handling of PAM_TTY]) 593 [Work around problematic Linux PAM modules handling of PAM_TTY])
529 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!", 594 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!",
@@ -573,6 +638,7 @@ mips-sony-bsd|mips-sony-newsos4)
573 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) 638 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
574 AC_CHECK_HEADER([net/if_tap.h], , 639 AC_CHECK_HEADER([net/if_tap.h], ,
575 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support])) 640 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
641 AC_DEFINE(BROKEN_GLOB, 1, [FreeBSD glob does not do what we need])
576 ;; 642 ;;
577*-*-bsdi*) 643*-*-bsdi*)
578 AC_DEFINE(SETEUID_BREAKS_SETUID) 644 AC_DEFINE(SETEUID_BREAKS_SETUID)
@@ -799,6 +865,7 @@ mips-sony-bsd|mips-sony-newsos4)
799 AC_DEFINE(SETEUID_BREAKS_SETUID) 865 AC_DEFINE(SETEUID_BREAKS_SETUID)
800 AC_DEFINE(BROKEN_SETREUID) 866 AC_DEFINE(BROKEN_SETREUID)
801 AC_DEFINE(BROKEN_SETREGID) 867 AC_DEFINE(BROKEN_SETREGID)
868 AC_DEFINE(BROKEN_READV_COMPARISON, 1, [Can't do comparisons on readv])
802 ;; 869 ;;
803 870
804*-*-nto-qnx*) 871*-*-nto-qnx*)
@@ -809,6 +876,7 @@ mips-sony-bsd|mips-sony-newsos4)
809 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems]) 876 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
810 AC_DEFINE(DISABLE_LASTLOG) 877 AC_DEFINE(DISABLE_LASTLOG)
811 AC_DEFINE(SSHD_ACQUIRES_CTTY) 878 AC_DEFINE(SSHD_ACQUIRES_CTTY)
879 AC_DEFINE(BROKEN_SHADOW_EXPIRE, 1, [QNX shadow support is broken])
812 enable_etc_default_login=no # has incompatible /etc/default/login 880 enable_etc_default_login=no # has incompatible /etc/default/login
813 case "$host" in 881 case "$host" in
814 *-*-nto-qnx6*) 882 *-*-nto-qnx6*)
@@ -1004,7 +1072,7 @@ dnl Checks for libutil functions
1004AC_CHECK_HEADERS(libutil.h) 1072AC_CHECK_HEADERS(libutil.h)
1005AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1, 1073AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1,
1006 [Define if your libraries define login()])]) 1074 [Define if your libraries define login()])])
1007AC_CHECK_FUNCS(logout updwtmp logwtmp) 1075AC_CHECK_FUNCS(fmt_scaled logout updwtmp logwtmp)
1008 1076
1009AC_FUNC_STRFTIME 1077AC_FUNC_STRFTIME
1010 1078
@@ -1238,7 +1306,7 @@ AC_ARG_WITH(audit,
1238 AC_CHECK_FUNCS(getaudit, [], 1306 AC_CHECK_FUNCS(getaudit, [],
1239 [AC_MSG_ERROR(BSM enabled and required function not found)]) 1307 [AC_MSG_ERROR(BSM enabled and required function not found)])
1240 # These are optional 1308 # These are optional
1241 AC_CHECK_FUNCS(getaudit_addr) 1309 AC_CHECK_FUNCS(getaudit_addr aug_get_machine)
1242 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module]) 1310 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module])
1243 ;; 1311 ;;
1244 debug) 1312 debug)
@@ -1258,6 +1326,8 @@ AC_ARG_WITH(audit,
1258dnl Checks for library functions. Please keep in alphabetical order 1326dnl Checks for library functions. Please keep in alphabetical order
1259AC_CHECK_FUNCS( \ 1327AC_CHECK_FUNCS( \
1260 arc4random \ 1328 arc4random \
1329 arc4random_buf \
1330 arc4random_uniform \
1261 asprintf \ 1331 asprintf \
1262 b64_ntop \ 1332 b64_ntop \
1263 __b64_ntop \ 1333 __b64_ntop \
@@ -1271,6 +1341,7 @@ AC_CHECK_FUNCS( \
1271 fchmod \ 1341 fchmod \
1272 fchown \ 1342 fchown \
1273 freeaddrinfo \ 1343 freeaddrinfo \
1344 fstatvfs \
1274 futimes \ 1345 futimes \
1275 getaddrinfo \ 1346 getaddrinfo \
1276 getcwd \ 1347 getcwd \
@@ -1322,6 +1393,8 @@ AC_CHECK_FUNCS( \
1322 sigvec \ 1393 sigvec \
1323 snprintf \ 1394 snprintf \
1324 socketpair \ 1395 socketpair \
1396 statfs \
1397 statvfs \
1325 strdup \ 1398 strdup \
1326 strerror \ 1399 strerror \
1327 strlcat \ 1400 strlcat \
@@ -2028,7 +2101,10 @@ AC_CHECK_FUNCS(SHA256_Update EVP_sha256)
2028saved_LIBS="$LIBS" 2101saved_LIBS="$LIBS"
2029AC_CHECK_LIB(iaf, ia_openinfo, [ 2102AC_CHECK_LIB(iaf, ia_openinfo, [
2030 LIBS="$LIBS -liaf" 2103 LIBS="$LIBS -liaf"
2031 AC_CHECK_FUNCS(set_id, [SSHDLIBS="$SSHDLIBS -liaf"]) 2104 AC_CHECK_FUNCS(set_id, [SSHDLIBS="$SSHDLIBS -liaf"
2105 AC_DEFINE(HAVE_LIBIAF, 1,
2106 [Define if system has libiaf that supports set_id])
2107 ])
2032]) 2108])
2033LIBS="$saved_LIBS" 2109LIBS="$saved_LIBS"
2034 2110
@@ -2612,6 +2688,18 @@ fi
2612TYPE_SOCKLEN_T 2688TYPE_SOCKLEN_T
2613 2689
2614AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) 2690AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
2691AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t],,,[
2692#include <sys/types.h>
2693#ifdef HAVE_SYS_BITYPES_H
2694#include <sys/bitypes.h>
2695#endif
2696#ifdef HAVE_SYS_STATFS_H
2697#include <sys/statfs.h>
2698#endif
2699#ifdef HAVE_SYS_STATVFS_H
2700#include <sys/statvfs.h>
2701#endif
2702])
2615 2703
2616AC_CHECK_TYPES(in_addr_t,,, 2704AC_CHECK_TYPES(in_addr_t,,,
2617[#include <sys/types.h> 2705[#include <sys/types.h>
@@ -2974,6 +3062,16 @@ if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2974 file descriptor passing]) 3062 file descriptor passing])
2975fi 3063fi
2976 3064
3065AC_MSG_CHECKING(if f_fsid has val members)
3066AC_TRY_COMPILE([
3067#include <sys/types.h>
3068#include <sys/statvfs.h>],
3069[struct fsid_t t; t.val[0] = 0;],
3070 [ AC_MSG_RESULT(yes)
3071 AC_DEFINE(FSID_HAS_VAL, 1, f_fsid has members) ],
3072 [ AC_MSG_RESULT(no) ]
3073)
3074
2977AC_CACHE_CHECK([for msg_control field in struct msghdr], 3075AC_CACHE_CHECK([for msg_control field in struct msghdr],
2978 ac_cv_have_control_in_msghdr, [ 3076 ac_cv_have_control_in_msghdr, [
2979 AC_COMPILE_IFELSE( 3077 AC_COMPILE_IFELSE(
@@ -3225,7 +3323,7 @@ int main() { return 0; }
3225SELINUX_MSG="no" 3323SELINUX_MSG="no"
3226LIBSELINUX="" 3324LIBSELINUX=""
3227AC_ARG_WITH(selinux, 3325AC_ARG_WITH(selinux,
3228 [ --with-selinux Enable SELinux support], 3326 [ --with-selinux Enable SELinux support],
3229 [ if test "x$withval" != "xno" ; then 3327 [ if test "x$withval" != "xno" ; then
3230 save_LIBS="$LIBS" 3328 save_LIBS="$LIBS"
3231 AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.]) 3329 AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.])
@@ -3302,12 +3400,12 @@ AC_ARG_WITH(kerberos5,
3302 ) 3400 )
3303 AC_SEARCH_LIBS(dn_expand, resolv) 3401 AC_SEARCH_LIBS(dn_expand, resolv)
3304 3402
3305 AC_CHECK_LIB(gssapi,gss_init_sec_context, 3403 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,
3306 [ AC_DEFINE(GSSAPI) 3404 [ AC_DEFINE(GSSAPI)
3307 K5LIBS="-lgssapi $K5LIBS" ], 3405 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
3308 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context, 3406 [ AC_CHECK_LIB(gssapi, gss_init_sec_context,
3309 [ AC_DEFINE(GSSAPI) 3407 [ AC_DEFINE(GSSAPI)
3310 K5LIBS="-lgssapi_krb5 $K5LIBS" ], 3408 K5LIBS="-lgssapi $K5LIBS" ],
3311 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]), 3409 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
3312 $K5LIBS) 3410 $K5LIBS)
3313 ], 3411 ],
@@ -4006,6 +4104,13 @@ dnl Adding -Werror to CFLAGS early prevents configure tests from running.
4006dnl Add now. 4104dnl Add now.
4007CFLAGS="$CFLAGS $werror_flags" 4105CFLAGS="$CFLAGS $werror_flags"
4008 4106
4107if grep "#define BROKEN_GETADDRINFO 1" confdefs.h >/dev/null || \
4108 test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
4109 AC_SUBST(TEST_SSH_IPV6, no)
4110else
4111 AC_SUBST(TEST_SSH_IPV6, yes)
4112fi
4113
4009AC_EXEEXT 4114AC_EXEEXT
4010AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ 4115AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
4011 openbsd-compat/Makefile openbsd-compat/regress/Makefile \ 4116 openbsd-compat/Makefile openbsd-compat/regress/Makefile \