Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.449 2010/04/10 12:58:01 dtucker Exp $ |
Damien Miller | 4fefe24 | 2004-03-11 14:20:10 +1100 | [diff] [blame] | 2 | # |
| 3 | # Copyright (c) 1999-2004 Damien Miller |
| 4 | # |
| 5 | # Permission to use, copy, modify, and distribute this software for any |
| 6 | # purpose with or without fee is hereby granted, provided that the above |
| 7 | # copyright notice and this permission notice appear in all copies. |
| 8 | # |
| 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 16 | |
Darren Tucker | 6a45f3d | 2005-06-03 19:33:10 +1000 | [diff] [blame] | 17 | AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 18 | AC_REVISION($Revision: 1.449 $) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 20 | |
| 21 | AC_CONFIG_HEADER(config.h) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 22 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 23 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 24 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 25 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 26 | # Checks for programs. |
Darren Tucker | 167bd9c | 2003-09-07 12:34:54 +1000 | [diff] [blame] | 27 | AC_PROG_AWK |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 28 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 29 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 30 | AC_PROG_INSTALL |
Tim Rice | fd80ddc | 2006-02-02 19:11:56 -0800 | [diff] [blame] | 31 | AC_PROG_EGREP |
Ben Lindstrom | 582d398 | 2001-02-06 22:54:30 +0000 | [diff] [blame] | 32 | AC_PATH_PROG(AR, ar) |
Tim Rice | 5af9db9 | 2004-06-19 19:31:06 -0700 | [diff] [blame] | 33 | AC_PATH_PROG(CAT, cat) |
| 34 | AC_PATH_PROG(KILL, kill) |
Tim Rice | b8fbb8e | 2001-04-21 14:31:52 -0700 | [diff] [blame] | 35 | AC_PATH_PROGS(PERL, perl5 perl) |
Tim Rice | d0d7a8b | 2003-01-08 17:22:59 -0800 | [diff] [blame] | 36 | AC_PATH_PROG(SED, sed) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 37 | AC_SUBST(PERL) |
Damien Miller | 8d1fd57 | 2000-05-17 21:34:07 +1000 | [diff] [blame] | 38 | AC_PATH_PROG(ENT, ent) |
| 39 | AC_SUBST(ENT) |
Damien Miller | 4864e8f | 2001-02-08 10:07:08 +1100 | [diff] [blame] | 40 | AC_PATH_PROG(TEST_MINUS_S_SH, bash) |
| 41 | AC_PATH_PROG(TEST_MINUS_S_SH, ksh) |
| 42 | AC_PATH_PROG(TEST_MINUS_S_SH, sh) |
Tim Rice | 0502a47 | 2002-05-08 16:04:14 -0700 | [diff] [blame] | 43 | AC_PATH_PROG(SH, sh) |
Tim Rice | f7ba8f6 | 2004-06-20 10:37:32 -0700 | [diff] [blame] | 44 | AC_SUBST(TEST_SHELL,sh) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 45 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 46 | dnl for buildpkg.sh |
| 47 | AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd, |
| 48 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
| 49 | AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd, |
| 50 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
| 51 | AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 52 | if test -x /sbin/sh; then |
| 53 | AC_SUBST(STARTUP_SCRIPT_SHELL,/sbin/sh) |
| 54 | else |
| 55 | AC_SUBST(STARTUP_SCRIPT_SHELL,/bin/sh) |
| 56 | fi |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 57 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 58 | # System features |
| 59 | AC_SYS_LARGEFILE |
| 60 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 61 | if test -z "$AR" ; then |
| 62 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 63 | fi |
| 64 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 65 | # Use LOGIN_PROGRAM from environment if possible |
| 66 | if test ! -z "$LOGIN_PROGRAM" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 67 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM", |
| 68 | [If your header files don't define LOGIN_PROGRAM, |
| 69 | then use this (detected) from environment and PATH]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 70 | else |
| 71 | # Search for login |
| 72 | AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) |
| 73 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
| 74 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") |
| 75 | fi |
| 76 | fi |
| 77 | |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 78 | AC_PATH_PROG(PATH_PASSWD_PROG, passwd) |
| 79 | if test ! -z "$PATH_PASSWD_PROG" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 80 | AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG", |
| 81 | [Full path of your "passwd" program]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 82 | fi |
| 83 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 84 | if test -z "$LD" ; then |
| 85 | LD=$CC |
| 86 | fi |
| 87 | AC_SUBST(LD) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 88 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 89 | AC_C_INLINE |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 90 | |
| 91 | AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>]) |
| 92 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 93 | use_stack_protector=1 |
| 94 | AC_ARG_WITH(stackprotect, |
Damien Miller | da3155e | 2008-03-27 12:30:18 +1100 | [diff] [blame] | 95 | [ --without-stackprotect Don't use compiler's stack protection], [ |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 96 | if test "x$withval" = "xno"; then |
| 97 | use_stack_protector=0 |
| 98 | fi ]) |
| 99 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 100 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Darren Tucker | dd352b6 | 2005-08-02 17:21:29 +1000 | [diff] [blame] | 101 | CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized" |
Darren Tucker | 3f9545e | 2005-11-12 15:20:52 +1100 | [diff] [blame] | 102 | GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 103 | case $GCC_VER in |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 104 | 1.*) no_attrib_nonnull=1 ;; |
| 105 | 2.8* | 2.9*) |
| 106 | CFLAGS="$CFLAGS -Wsign-compare" |
| 107 | no_attrib_nonnull=1 |
| 108 | ;; |
| 109 | 2.*) no_attrib_nonnull=1 ;; |
Damien Miller | 73193b3 | 2008-07-09 21:07:19 +1000 | [diff] [blame] | 110 | 3.*) CFLAGS="$CFLAGS -Wsign-compare -Wformat-security" ;; |
Damien Miller | 9527f22 | 2010-03-05 15:04:35 +1100 | [diff] [blame] | 111 | 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign -Wformat-security -fno-strict-aliasing" ;; |
Darren Tucker | f032435 | 2005-11-10 21:30:36 +1100 | [diff] [blame] | 112 | *) ;; |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 113 | esac |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 114 | |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 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> |
| 120 | int 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 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 127 | # -fstack-protector-all doesn't always work for some GCC versions |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 128 | # and/or platforms, so we test if we can. If it's not supported |
Damien Miller | 7df2e40 | 2008-12-08 09:35:36 +1100 | [diff] [blame] | 129 | # on a given platform gcc will emit a warning so we use -Werror. |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 130 | if test "x$use_stack_protector" = "x1"; then |
| 131 | for t in -fstack-protector-all -fstack-protector; do |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 132 | AC_MSG_CHECKING(if $CC supports $t) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 133 | saved_CFLAGS="$CFLAGS" |
| 134 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 135 | CFLAGS="$CFLAGS $t -Werror" |
| 136 | LDFLAGS="$LDFLAGS $t -Werror" |
| 137 | AC_LINK_IFELSE( |
| 138 | [AC_LANG_SOURCE([ |
Damien Miller | 7df2e40 | 2008-12-08 09:35:36 +1100 | [diff] [blame] | 139 | #include <stdio.h> |
| 140 | int main(void){char x[[256]]; snprintf(x, sizeof(x), "XXX"); return 0;} |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 141 | ])], |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 142 | [ AC_MSG_RESULT(yes) |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 143 | CFLAGS="$saved_CFLAGS $t" |
| 144 | LDFLAGS="$saved_LDFLAGS $t" |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 145 | AC_MSG_CHECKING(if $t works) |
| 146 | AC_RUN_IFELSE( |
| 147 | [AC_LANG_SOURCE([ |
Damien Miller | 7df2e40 | 2008-12-08 09:35:36 +1100 | [diff] [blame] | 148 | #include <stdio.h> |
| 149 | int main(void){char x[[256]]; snprintf(x, sizeof(x), "XXX"); return 0;} |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 150 | ])], |
| 151 | [ AC_MSG_RESULT(yes) |
| 152 | break ], |
| 153 | [ AC_MSG_RESULT(no) ], |
| 154 | [ AC_MSG_WARN([cross compiling: cannot test]) |
| 155 | break ] |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 156 | ) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 157 | ], |
| 158 | [ AC_MSG_RESULT(no) ] |
| 159 | ) |
| 160 | CFLAGS="$saved_CFLAGS" |
| 161 | LDFLAGS="$saved_LDFLAGS" |
| 162 | done |
| 163 | fi |
Darren Tucker | 319b3d9 | 2007-12-02 21:02:22 +1100 | [diff] [blame] | 164 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 165 | if test -z "$have_llong_max"; then |
| 166 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 167 | unset ac_cv_have_decl_LLONG_MAX |
| 168 | saved_CFLAGS="$CFLAGS" |
| 169 | CFLAGS="$CFLAGS -std=gnu99" |
| 170 | AC_CHECK_DECL(LLONG_MAX, |
| 171 | [have_llong_max=1], |
| 172 | [CFLAGS="$saved_CFLAGS"], |
| 173 | [#include <limits.h>] |
| 174 | ) |
| 175 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 176 | fi |
| 177 | |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 178 | if test "x$no_attrib_nonnull" != "x1" ; then |
| 179 | AC_DEFINE(HAVE_ATTRIBUTE__NONNULL__, 1, [Have attribute nonnull]) |
| 180 | fi |
| 181 | |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 182 | AC_ARG_WITH(rpath, |
| 183 | [ --without-rpath Disable auto-added -R linker paths], |
| 184 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 185 | if test "x$withval" = "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 186 | need_dash_r="" |
| 187 | fi |
| 188 | if test "x$withval" = "xyes" ; then |
| 189 | need_dash_r=1 |
| 190 | fi |
| 191 | ] |
| 192 | ) |
| 193 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 194 | # Allow user to specify flags |
| 195 | AC_ARG_WITH(cflags, |
| 196 | [ --with-cflags Specify additional flags to pass to compiler], |
| 197 | [ |
| 198 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 199 | test "x${withval}" != "xyes"; then |
| 200 | CFLAGS="$CFLAGS $withval" |
| 201 | fi |
| 202 | ] |
| 203 | ) |
| 204 | AC_ARG_WITH(cppflags, |
| 205 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 206 | [ |
| 207 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 208 | test "x${withval}" != "xyes"; then |
| 209 | CPPFLAGS="$CPPFLAGS $withval" |
| 210 | fi |
| 211 | ] |
| 212 | ) |
| 213 | AC_ARG_WITH(ldflags, |
| 214 | [ --with-ldflags Specify additional flags to pass to linker], |
| 215 | [ |
| 216 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 217 | test "x${withval}" != "xyes"; then |
| 218 | LDFLAGS="$LDFLAGS $withval" |
| 219 | fi |
| 220 | ] |
| 221 | ) |
| 222 | AC_ARG_WITH(libs, |
| 223 | [ --with-libs Specify additional libraries to link with], |
| 224 | [ |
| 225 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 226 | test "x${withval}" != "xyes"; then |
| 227 | LIBS="$LIBS $withval" |
| 228 | fi |
| 229 | ] |
| 230 | ) |
| 231 | AC_ARG_WITH(Werror, |
| 232 | [ --with-Werror Build main code with -Werror], |
| 233 | [ |
| 234 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 235 | werror_flags="-Werror" |
| 236 | if test "x${withval}" != "xyes"; then |
| 237 | werror_flags="$withval" |
| 238 | fi |
| 239 | fi |
| 240 | ] |
| 241 | ) |
| 242 | |
| 243 | AC_CHECK_HEADERS( \ |
| 244 | bstring.h \ |
| 245 | crypt.h \ |
| 246 | crypto/sha2.h \ |
| 247 | dirent.h \ |
| 248 | endian.h \ |
| 249 | features.h \ |
| 250 | fcntl.h \ |
| 251 | floatingpoint.h \ |
| 252 | getopt.h \ |
| 253 | glob.h \ |
| 254 | ia.h \ |
| 255 | iaf.h \ |
| 256 | limits.h \ |
| 257 | login.h \ |
| 258 | maillock.h \ |
| 259 | ndir.h \ |
| 260 | net/if_tun.h \ |
| 261 | netdb.h \ |
| 262 | netgroup.h \ |
| 263 | pam/pam_appl.h \ |
| 264 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 265 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 266 | pty.h \ |
| 267 | readpassphrase.h \ |
| 268 | rpc/types.h \ |
| 269 | security/pam_appl.h \ |
| 270 | sha2.h \ |
| 271 | shadow.h \ |
| 272 | stddef.h \ |
| 273 | stdint.h \ |
| 274 | string.h \ |
| 275 | strings.h \ |
| 276 | sys/audit.h \ |
| 277 | sys/bitypes.h \ |
| 278 | sys/bsdtty.h \ |
| 279 | sys/cdefs.h \ |
| 280 | sys/dir.h \ |
| 281 | sys/mman.h \ |
| 282 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 283 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 284 | sys/prctl.h \ |
| 285 | sys/pstat.h \ |
| 286 | sys/select.h \ |
| 287 | sys/stat.h \ |
| 288 | sys/stream.h \ |
| 289 | sys/stropts.h \ |
| 290 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 291 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 292 | sys/sysmacros.h \ |
| 293 | sys/time.h \ |
| 294 | sys/timers.h \ |
| 295 | sys/un.h \ |
| 296 | time.h \ |
| 297 | tmpdir.h \ |
| 298 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 299 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 300 | unistd.h \ |
| 301 | usersec.h \ |
| 302 | util.h \ |
| 303 | utime.h \ |
| 304 | utmp.h \ |
| 305 | utmpx.h \ |
| 306 | vis.h \ |
| 307 | ) |
| 308 | |
| 309 | # lastlog.h requires sys/time.h to be included first on Solaris |
| 310 | AC_CHECK_HEADERS(lastlog.h, [], [], [ |
| 311 | #ifdef HAVE_SYS_TIME_H |
| 312 | # include <sys/time.h> |
| 313 | #endif |
| 314 | ]) |
| 315 | |
| 316 | # sys/ptms.h requires sys/stream.h to be included first on Solaris |
| 317 | AC_CHECK_HEADERS(sys/ptms.h, [], [], [ |
| 318 | #ifdef HAVE_SYS_STREAM_H |
| 319 | # include <sys/stream.h> |
| 320 | #endif |
| 321 | ]) |
| 322 | |
| 323 | # login_cap.h requires sys/types.h on NetBSD |
| 324 | AC_CHECK_HEADERS(login_cap.h, [], [], [ |
| 325 | #include <sys/types.h> |
| 326 | ]) |
| 327 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 328 | # older BSDs need sys/param.h before sys/mount.h |
| 329 | AC_CHECK_HEADERS(sys/mount.h, [], [], [ |
| 330 | #include <sys/param.h> |
| 331 | ]) |
| 332 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 333 | # Messages for features tested for in target-specific section |
| 334 | SIA_MSG="no" |
| 335 | SPC_MSG="no" |
| 336 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 337 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 338 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 339 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 340 | # Some versions of VAC won't allow macro redefinitions at |
| 341 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 342 | # particularly with older versions of vac or xlc. |
| 343 | # It also throws errors about null macro argments, but these are |
| 344 | # not fatal. |
| 345 | AC_MSG_CHECKING(if compiler allows macro redefinitions) |
| 346 | AC_COMPILE_IFELSE( |
| 347 | [AC_LANG_SOURCE([[ |
| 348 | #define testmacro foo |
| 349 | #define testmacro bar |
| 350 | int main(void) { exit(0); } |
| 351 | ]])], |
| 352 | [ AC_MSG_RESULT(yes) ], |
| 353 | [ AC_MSG_RESULT(no) |
| 354 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
| 355 | LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" |
| 356 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 357 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 358 | ] |
| 359 | ) |
| 360 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 361 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 362 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 363 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 364 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 365 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 366 | if test "$GCC" = "yes"; then |
| 367 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 368 | else |
| 369 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 370 | fi |
| 371 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 372 | if (test -z "$blibflags"); then |
| 373 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
| 374 | AC_TRY_LINK([], [], [blibflags=$tryflags]) |
| 375 | fi |
| 376 | done |
| 377 | if (test -z "$blibflags"); then |
| 378 | AC_MSG_RESULT(not found) |
| 379 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 380 | else |
| 381 | AC_MSG_RESULT($blibflags) |
| 382 | fi |
| 383 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 384 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 385 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE, 1, |
| 386 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 387 | [AC_CHECK_LIB(s,authenticate, |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 388 | [ AC_DEFINE(WITH_AIXAUTHENTICATE) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 389 | LIBS="$LIBS -ls" |
| 390 | ]) |
| 391 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 392 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 393 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 394 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 395 | dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 396 | AC_CHECK_DECLS(loginfailed, |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 397 | [AC_MSG_CHECKING(if loginfailed takes 4 arguments) |
| 398 | AC_TRY_COMPILE( |
Darren Tucker | a0c0b63 | 2003-07-08 20:52:12 +1000 | [diff] [blame] | 399 | [#include <usersec.h>], |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 400 | [(void)loginfailed("user","host","tty",0);], |
| 401 | [AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 402 | AC_DEFINE(AIX_LOGINFAILED_4ARG, 1, |
| 403 | [Define if your AIX loginfailed() function |
| 404 | takes 4 arguments (AIX >= 5.2)])], |
Darren Tucker | a0c0b63 | 2003-07-08 20:52:12 +1000 | [diff] [blame] | 405 | [AC_MSG_RESULT(no)] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 406 | )], |
| 407 | [], |
| 408 | [#include <usersec.h>] |
| 409 | ) |
Darren Tucker | 0f26b13 | 2008-02-28 23:16:04 +1100 | [diff] [blame] | 410 | AC_CHECK_FUNCS(getgrset setauthdb) |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 411 | AC_CHECK_DECL(F_CLOSEM, |
Darren Tucker | d018b2e | 2006-08-18 18:51:20 +1000 | [diff] [blame] | 412 | AC_DEFINE(HAVE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 413 | [], |
| 414 | [ #include <limits.h> |
| 415 | #include <fcntl.h> ] |
| 416 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 417 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 418 | AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.]) |
| 419 | AC_DEFINE(SETEUID_BREAKS_SETUID, 1, |
| 420 | [Define if your platform breaks doing a seteuid before a setuid]) |
| 421 | AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken]) |
| 422 | AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 423 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 424 | AC_DEFINE(DISABLE_LASTLOG, 1, [Define if you don't want to use lastlog]) |
| 425 | AC_DEFINE(LOGIN_NEEDS_UTMPX, 1, |
| 426 | [Some systems need a utmpx entry for /bin/login to work]) |
| 427 | AC_DEFINE(SPT_TYPE,SPT_REUSEARGV, |
| 428 | [Define to a Set Process Title type if your system is |
| 429 | supported by bsd-setproctitle.c]) |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 430 | AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1, |
| 431 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Darren Tucker | 9afe115 | 2006-06-23 21:24:12 +1000 | [diff] [blame] | 432 | AC_DEFINE(PTY_ZEROREAD, 1, [read(1) can return 0 for a non-closed fd]) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 433 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 434 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 435 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 436 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 437 | AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin]) |
| 438 | AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()]) |
| 439 | AC_DEFINE(DISABLE_SHADOW, 1, |
| 440 | [Define if you want to disable shadow passwords]) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 441 | AC_DEFINE(NO_X11_UNIX_SOCKETS, 1, |
| 442 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
| 443 | AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT, 1, |
| 444 | [Define if the concept of ports only accessible to |
| 445 | superusers isn't known]) |
| 446 | AC_DEFINE(DISABLE_FD_PASSING, 1, |
| 447 | [Define if your platform needs to skip post auth |
| 448 | file descriptor passing]) |
Tim Rice | 6761c74 | 2010-01-22 10:25:15 -0800 | [diff] [blame] | 449 | AC_DEFINE(SSH_IOBUFSZ, 65535, [Windows is sensitive to read buffer size]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 450 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 451 | *-*-dgux*) |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 452 | AC_DEFINE(IP_TOS_IS_BROKEN, 1, |
| 453 | [Define if your system choked on IP TOS setting]) |
Darren Tucker | 454da0b | 2003-12-18 12:52:19 +1100 | [diff] [blame] | 454 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 455 | AC_DEFINE(BROKEN_SETREUID) |
| 456 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 457 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 458 | *-*-darwin*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 459 | AC_MSG_CHECKING(if we have working getaddrinfo) |
| 460 | AC_TRY_RUN([#include <mach-o/dyld.h> |
| 461 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 462 | exit(0); |
| 463 | else |
| 464 | exit(1); |
| 465 | }], [AC_MSG_RESULT(working)], |
| 466 | [AC_MSG_RESULT(buggy) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 467 | AC_DEFINE(BROKEN_GETADDRINFO, 1, [getaddrinfo is broken (if present)])], |
Tim Rice | 480ef8d | 2003-09-21 21:38:11 -0700 | [diff] [blame] | 468 | [AC_MSG_RESULT(assume it is working)]) |
Darren Tucker | 20379a3 | 2003-09-22 11:07:40 +1000 | [diff] [blame] | 469 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 470 | AC_DEFINE(BROKEN_SETREUID) |
| 471 | AC_DEFINE(BROKEN_SETREGID) |
Darren Tucker | 528d6fa | 2007-12-31 21:29:26 +1100 | [diff] [blame] | 472 | AC_DEFINE(BROKEN_GLOB, 1, [OS X glob does not do what we expect]) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 473 | AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1, |
| 474 | [Define if your resolver libs need this for getrrsetbyname]) |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 475 | AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) |
| 476 | AC_DEFINE(SSH_TUN_COMPAT_AF, 1, |
| 477 | [Use tunnel device compatibility to OpenBSD]) |
| 478 | AC_DEFINE(SSH_TUN_PREPEND_AF, 1, |
| 479 | [Prepend the address family to IP tunnel traffic]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 480 | m4_pattern_allow(AU_IPv) |
| 481 | AC_CHECK_DECL(AU_IPv4, [], |
| 482 | AC_DEFINE(AU_IPv4, 0, [System only supports IPv4 audit records]) |
| 483 | [#include <bsm/audit.h>] |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 484 | AC_DEFINE(LASTLOG_WRITE_PUTUTXLINE, 1, |
| 485 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 486 | ) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 487 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 488 | *-*-dragonfly*) |
| 489 | SSHDLIBS="$SSHDLIBS -lcrypt" |
| 490 | ;; |
Darren Tucker | a83d90f | 2010-03-26 10:27:33 +1100 | [diff] [blame] | 491 | *-*-haiku*) |
| 492 | LIBS="$LIBS -lbsd " |
| 493 | AC_CHECK_LIB(network, socket) |
| 494 | AC_DEFINE(HAVE_U_INT64_T) |
| 495 | MANTYPE=man |
| 496 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 497 | *-*-hpux*) |
| 498 | # first we define all of the options common to all HP-UX releases |
Kevin Steves | 315f8b7 | 2001-06-28 00:24:41 +0000 | [diff] [blame] | 499 | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 500 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 501 | AC_DEFINE(USE_PIPES) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 502 | AC_DEFINE(LOGIN_NO_ENDOPT, 1, |
| 503 | [Define if your login program cannot handle end of options ("--")]) |
Kevin Steves | 5feaaef | 2002-04-23 20:45:55 +0000 | [diff] [blame] | 504 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 505 | AC_DEFINE(LOCKED_PASSWD_STRING, "*", |
| 506 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | 3527625 | 2003-06-03 10:14:28 +1000 | [diff] [blame] | 507 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Darren Tucker | 1e6616b | 2005-10-08 12:07:01 +1000 | [diff] [blame] | 508 | MAIL="/var/mail/username" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 509 | LIBS="$LIBS -lsec" |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 510 | AC_CHECK_LIB(xnet, t_error, , |
| 511 | AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) |
| 512 | |
| 513 | # next, we define all of the options specific to major releases |
| 514 | case "$host" in |
| 515 | *-*-hpux10*) |
| 516 | if test -z "$GCC"; then |
| 517 | CFLAGS="$CFLAGS -Ae" |
| 518 | fi |
| 519 | ;; |
| 520 | *-*-hpux11*) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 521 | AC_DEFINE(PAM_SUN_CODEBASE, 1, |
| 522 | [Define if you are using Solaris-derived PAM which |
| 523 | passes pam_messages to the conversation function |
| 524 | with an extra level of indirection]) |
| 525 | AC_DEFINE(DISABLE_UTMP, 1, |
| 526 | [Define if you don't want to use utmp]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 527 | AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) |
| 528 | check_for_hpux_broken_getaddrinfo=1 |
| 529 | check_for_conflicting_getspnam=1 |
| 530 | ;; |
| 531 | esac |
| 532 | |
| 533 | # lastly, we define options specific to minor releases |
| 534 | case "$host" in |
| 535 | *-*-hpux10.26) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 536 | AC_DEFINE(HAVE_SECUREWARE, 1, |
| 537 | [Define if you have SecureWare-based |
| 538 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 539 | disable_ptmx_check=yes |
| 540 | LIBS="$LIBS -lsecpw" |
| 541 | ;; |
| 542 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 543 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 544 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 545 | PATH="$PATH:/usr/etc" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 546 | AC_DEFINE(BROKEN_INET_NTOA, 1, |
| 547 | [Define if you system's inet_ntoa is busted |
| 548 | (e.g. Irix gcc issue)]) |
Darren Tucker | beaf679 | 2003-09-24 20:03:48 +1000 | [diff] [blame] | 549 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 550 | AC_DEFINE(BROKEN_SETREUID) |
| 551 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 552 | AC_DEFINE(WITH_ABBREV_NO_TTY, 1, |
| 553 | [Define if you shouldn't strip 'tty' from your |
| 554 | ttyname in [uw]tmp]) |
Darren Tucker | e41bba5 | 2003-08-25 11:51:19 +1000 | [diff] [blame] | 555 | AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 556 | ;; |
| 557 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 558 | PATH="$PATH:/usr/etc" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 559 | AC_DEFINE(WITH_IRIX_ARRAY, 1, |
| 560 | [Define if you have/want arrays |
| 561 | (cluster-wide session managment, not C arrays)]) |
| 562 | AC_DEFINE(WITH_IRIX_PROJECT, 1, |
| 563 | [Define if you want IRIX project management]) |
| 564 | AC_DEFINE(WITH_IRIX_AUDIT, 1, |
| 565 | [Define if you want IRIX audit trails]) |
| 566 | AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS, 1, |
| 567 | [Define if you want IRIX kernel jobs])]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 568 | AC_DEFINE(BROKEN_INET_NTOA) |
Darren Tucker | be79af1 | 2003-09-22 11:58:21 +1000 | [diff] [blame] | 569 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 570 | AC_DEFINE(BROKEN_SETREUID) |
| 571 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 572 | AC_DEFINE(BROKEN_UPDWTMPX, 1, [updwtmpx is broken (if present)]) |
Damien Miller | f1b9d11 | 2002-04-23 23:09:19 +1000 | [diff] [blame] | 573 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Darren Tucker | e41bba5 | 2003-08-25 11:51:19 +1000 | [diff] [blame] | 574 | AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 575 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 576 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 577 | check_for_libcrypt_later=1 |
| 578 | AC_DEFINE(PAM_TTY_KLUDGE) |
| 579 | AC_DEFINE(LOCKED_PASSWD_PREFIX, "!") |
| 580 | AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) |
| 581 | AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts]) |
| 582 | AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) |
| 583 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 584 | *-*-linux*) |
| 585 | no_dev_ptmx=1 |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 586 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 587 | check_for_openpty_ctty_bug=1 |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 588 | AC_DEFINE(PAM_TTY_KLUDGE, 1, |
| 589 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
| 590 | AC_DEFINE(LOCKED_PASSWD_PREFIX, "!", |
| 591 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | 3527625 | 2003-06-03 10:14:28 +1000 | [diff] [blame] | 592 | AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 593 | AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM, |
| 594 | [Define to whatever link() returns for "not supported" |
| 595 | if it doesn't return EOPNOTSUPP.]) |
Darren Tucker | 2fba993 | 2005-02-02 23:30:24 +1100 | [diff] [blame] | 596 | AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts]) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 597 | AC_DEFINE(USE_BTMP) |
Darren Tucker | c8802aa | 2009-12-08 13:39:48 +1100 | [diff] [blame] | 598 | AC_DEFINE(LINUX_OOM_ADJUST, 1, [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 599 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 600 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 601 | 1.*|2.0.*) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 602 | AC_DEFINE(BROKEN_CMSG_TYPE, 1, |
| 603 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 604 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 605 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 606 | # tun(4) forwarding compat code |
Damien Miller | c4bcc91 | 2005-12-31 17:05:58 +1100 | [diff] [blame] | 607 | AC_CHECK_HEADERS(linux/if_tun.h) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 608 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 609 | AC_DEFINE(SSH_TUN_LINUX, 1, |
| 610 | [Open tunnel devices the Linux tun/tap way]) |
| 611 | AC_DEFINE(SSH_TUN_COMPAT_AF, 1, |
| 612 | [Use tunnel device compatibility to OpenBSD]) |
| 613 | AC_DEFINE(SSH_TUN_PREPEND_AF, 1, |
| 614 | [Prepend the address family to IP tunnel traffic]) |
| 615 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 616 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 617 | mips-sony-bsd|mips-sony-newsos4) |
Darren Tucker | 988b3fd | 2006-02-08 22:11:27 +1100 | [diff] [blame] | 618 | AC_DEFINE(NEED_SETPGRP, 1, [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 619 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 620 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 621 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 622 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 623 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 624 | need_dash_r=1 |
| 625 | fi |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 626 | AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) |
| 627 | AC_CHECK_HEADER([net/if_tap.h], , |
| 628 | AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support])) |
| 629 | AC_DEFINE(SSH_TUN_PREPEND_AF, 1, |
| 630 | [Prepend the address family to IP tunnel traffic]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 631 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 632 | *-*-freebsd*) |
| 633 | check_for_libcrypt_later=1 |
Darren Tucker | ac7e630 | 2005-10-06 01:39:58 +1000 | [diff] [blame] | 634 | AC_DEFINE(LOCKED_PASSWD_PREFIX, "*LOCKED*", [Account locked with pw(1)]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 635 | AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) |
| 636 | AC_CHECK_HEADER([net/if_tap.h], , |
| 637 | AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support])) |
Darren Tucker | 54e859f | 2008-03-02 21:52:27 +1100 | [diff] [blame] | 638 | AC_DEFINE(BROKEN_GLOB, 1, [FreeBSD glob does not do what we need]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 639 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 640 | *-*-bsdi*) |
| 641 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 642 | AC_DEFINE(BROKEN_SETREUID) |
| 643 | AC_DEFINE(BROKEN_SETREGID) |
| 644 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 645 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 646 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 647 | conf_utmp_location=/etc/utmp |
| 648 | conf_wtmp_location=/usr/adm/wtmp |
| 649 | MAIL=/usr/spool/mail |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 650 | AC_DEFINE(HAVE_NEXT, 1, [Define if you are on NeXT]) |
Ben Lindstrom | b4df15d | 2000-10-15 00:17:36 +0000 | [diff] [blame] | 651 | AC_DEFINE(BROKEN_REALPATH) |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 652 | AC_DEFINE(USE_PIPES) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 653 | AC_DEFINE(BROKEN_SAVED_UIDS, 1, [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 654 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 655 | *-*-openbsd*) |
| 656 | AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel]) |
Darren Tucker | 9ac1a65 | 2005-10-09 11:40:03 +1000 | [diff] [blame] | 657 | AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 658 | AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way]) |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 659 | AC_DEFINE(SYSLOG_R_SAFE_IN_SIGHAND, 1, |
| 660 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 661 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 662 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 663 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 664 | need_dash_r=1 |
| 665 | fi |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 666 | AC_DEFINE(PAM_SUN_CODEBASE) |
Ben Lindstrom | 97c677d | 2001-05-08 20:33:05 +0000 | [diff] [blame] | 667 | AC_DEFINE(LOGIN_NEEDS_UTMPX) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 668 | AC_DEFINE(LOGIN_NEEDS_TERM, 1, |
| 669 | [Some versions of /bin/login need the TERM supplied |
| 670 | on the commandline]) |
Ben Lindstrom | 9527671 | 2001-10-23 17:14:00 +0000 | [diff] [blame] | 671 | AC_DEFINE(PAM_TTY_KLUDGE) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 672 | AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1, |
| 673 | [Define if pam_chauthtok wants real uid set |
| 674 | to the unpriv'ed user]) |
Darren Tucker | e41bba5 | 2003-08-25 11:51:19 +1000 | [diff] [blame] | 675 | AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 676 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 677 | AC_DEFINE(SSHD_ACQUIRES_CTTY, 1, |
| 678 | [Define if sshd somehow reacquires a controlling TTY |
| 679 | after setsid()]) |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 680 | AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd |
| 681 | in case the name is longer than 8 chars]) |
Darren Tucker | ac9f1b9 | 2009-08-28 15:01:20 +1000 | [diff] [blame] | 682 | AC_DEFINE(BROKEN_TCGETATTR_ICANON, 1, [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 683 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 684 | # hardwire lastlog location (can't detect it on some versions) |
| 685 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 686 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 687 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 688 | if test "$sol2ver" -ge 8; then |
| 689 | AC_MSG_RESULT(yes) |
| 690 | AC_DEFINE(DISABLE_UTMP) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 691 | AC_DEFINE(DISABLE_WTMP, 1, |
| 692 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 693 | else |
| 694 | AC_MSG_RESULT(no) |
| 695 | fi |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 696 | AC_ARG_WITH(solaris-contracts, |
| 697 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 698 | [ |
| 699 | AC_CHECK_LIB(contract, ct_tmpl_activate, |
| 700 | [ AC_DEFINE(USE_SOLARIS_PROCESS_CONTRACTS, 1, |
| 701 | [Define if you have Solaris process contracts]) |
| 702 | SSHDLIBS="$SSHDLIBS -lcontract" |
| 703 | AC_SUBST(SSHDLIBS) |
| 704 | SPC_MSG="yes" ], ) |
| 705 | ], |
| 706 | ) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 707 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 708 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 709 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 710 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 711 | AC_DEFINE(PAM_SUN_CODEBASE) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 712 | conf_utmp_location=/etc/utmp |
| 713 | conf_wtmp_location=/var/adm/wtmp |
| 714 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 715 | AC_DEFINE(USE_PIPES) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 716 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 717 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 718 | LIBS="$LIBS -lc89" |
Kevin Steves | 0bd4b34 | 2002-01-05 23:24:27 +0000 | [diff] [blame] | 719 | AC_DEFINE(USE_PIPES) |
Darren Tucker | 2972d6c | 2003-05-30 17:43:42 +1000 | [diff] [blame] | 720 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
Darren Tucker | 0013011 | 2003-09-22 11:40:24 +1000 | [diff] [blame] | 721 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 722 | AC_DEFINE(BROKEN_SETREUID) |
| 723 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 724 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 725 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 726 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Darren Tucker | 89df7a3 | 2003-10-07 20:35:57 +1000 | [diff] [blame] | 727 | AC_CHECK_LIB(dl, dlsym, ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 728 | # -lresolv needs to be at the end of LIBS or DNS lookups break |
| 729 | AC_CHECK_LIB(resolv, res_query, [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 730 | IPADDR_IN_DISPLAY=yes |
| 731 | AC_DEFINE(USE_PIPES) |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 732 | AC_DEFINE(IP_TOS_IS_BROKEN) |
Darren Tucker | 3b2a06c | 2003-10-07 18:37:11 +1000 | [diff] [blame] | 733 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 734 | AC_DEFINE(BROKEN_SETREUID) |
| 735 | AC_DEFINE(BROKEN_SETREGID) |
Darren Tucker | 2972d6c | 2003-05-30 17:43:42 +1000 | [diff] [blame] | 736 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 737 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 738 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 739 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 740 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 741 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 742 | # UnixWare 1.x, UnixWare 2.x, and others based on code from Univel. |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 743 | *-*-sysv4.2*) |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 744 | AC_DEFINE(USE_PIPES) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 745 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 746 | AC_DEFINE(BROKEN_SETREUID) |
| 747 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | 2f97b8b | 2005-04-11 19:00:18 -0700 | [diff] [blame] | 748 | AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 749 | AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 750 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 751 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 752 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 753 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | eb45654 | 2005-08-30 07:12:02 -0700 | [diff] [blame] | 754 | AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 755 | AC_DEFINE(USE_PIPES) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 756 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
Tim Rice | 4a7db1c | 2010-01-16 12:23:25 -0800 | [diff] [blame] | 757 | AC_DEFINE(BROKEN_GETADDRINFO) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 758 | AC_DEFINE(BROKEN_SETREUID) |
| 759 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 760 | AC_DEFINE(PASSWD_NEEDS_USERNAME) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 761 | case "$host" in |
| 762 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
| 763 | TEST_SHELL=/u95/bin/sh |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 764 | AC_DEFINE(BROKEN_LIBIAF, 1, |
| 765 | [ia_uinfo routines not supported by OS yet]) |
Tim Rice | b8f0019 | 2006-09-06 18:11:29 -0700 | [diff] [blame] | 766 | AC_DEFINE(BROKEN_UPDWTMPX) |
Tim Rice | 351529c | 2009-01-07 10:04:12 -0800 | [diff] [blame] | 767 | AC_CHECK_LIB(prot, getluid,[ LIBS="$LIBS -lprot" |
| 768 | AC_CHECK_FUNCS(getluid setluid,,,-lprot) |
| 769 | AC_DEFINE(HAVE_SECUREWARE) |
| 770 | AC_DEFINE(DISABLE_SHADOW) |
| 771 | ],,) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 772 | ;; |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 773 | *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") |
Tim Rice | 2676791 | 2009-01-07 20:50:08 -0800 | [diff] [blame] | 774 | check_for_libcrypt_later=1 |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 775 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 776 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 777 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 778 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 779 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 780 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 781 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 782 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 783 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 784 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 785 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 786 | if test -z "$GCC"; then |
| 787 | CFLAGS="$CFLAGS -belf" |
| 788 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 789 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 790 | no_dev_ptmx=1 |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 791 | AC_DEFINE(USE_PIPES) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 792 | AC_DEFINE(HAVE_SECUREWARE) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 793 | AC_DEFINE(DISABLE_SHADOW) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 794 | AC_DEFINE(DISABLE_FD_PASSING) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 795 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
Tim Rice | 7ab7b93 | 2010-01-17 12:48:22 -0800 | [diff] [blame] | 796 | AC_DEFINE(BROKEN_GETADDRINFO) |
Tim Rice | d546a84 | 2003-09-11 22:24:36 -0700 | [diff] [blame] | 797 | AC_DEFINE(BROKEN_SETREUID) |
| 798 | AC_DEFINE(BROKEN_SETREGID) |
Tim Rice | ae477e9 | 2003-09-12 18:15:15 -0700 | [diff] [blame] | 799 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
Tim Rice | 816bd0d | 2004-07-19 10:19:26 -0700 | [diff] [blame] | 800 | AC_DEFINE(BROKEN_UPDWTMPX) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 801 | AC_DEFINE(PASSWD_NEEDS_USERNAME) |
Damien Miller | 217f567 | 2001-02-16 12:12:41 +1100 | [diff] [blame] | 802 | AC_CHECK_FUNCS(getluid setluid) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 803 | MANTYPE=man |
Tim Rice | f7ba8f6 | 2004-06-20 10:37:32 -0700 | [diff] [blame] | 804 | TEST_SHELL=ksh |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 805 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 806 | *-*-unicosmk*) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 807 | AC_DEFINE(NO_SSH_LASTLOG, 1, |
| 808 | [Define if you don't want to use lastlog in session.c]) |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 809 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 810 | AC_DEFINE(BROKEN_SETREUID) |
| 811 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 812 | AC_DEFINE(USE_PIPES) |
| 813 | AC_DEFINE(DISABLE_FD_PASSING) |
| 814 | LDFLAGS="$LDFLAGS" |
| 815 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 816 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 817 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 818 | *-*-unicosmp*) |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 819 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 820 | AC_DEFINE(BROKEN_SETREUID) |
| 821 | AC_DEFINE(BROKEN_SETREGID) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 822 | AC_DEFINE(WITH_ABBREV_NO_TTY) |
| 823 | AC_DEFINE(USE_PIPES) |
| 824 | AC_DEFINE(DISABLE_FD_PASSING) |
| 825 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 826 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 827 | MANTYPE=cat |
| 828 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 829 | *-*-unicos*) |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 830 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
| 831 | AC_DEFINE(BROKEN_SETREUID) |
| 832 | AC_DEFINE(BROKEN_SETREGID) |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 833 | AC_DEFINE(USE_PIPES) |
Tim Rice | 9dd3081 | 2002-07-07 13:43:36 -0700 | [diff] [blame] | 834 | AC_DEFINE(DISABLE_FD_PASSING) |
Tim Rice | 81ed518 | 2002-09-25 17:38:46 -0700 | [diff] [blame] | 835 | AC_DEFINE(NO_SSH_LASTLOG) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 836 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 837 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 838 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 839 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 840 | *-dec-osf*) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 841 | AC_MSG_CHECKING(for Digital Unix SIA) |
| 842 | no_osfsia="" |
| 843 | AC_ARG_WITH(osfsia, |
| 844 | [ --with-osfsia Enable Digital Unix SIA], |
| 845 | [ |
| 846 | if test "x$withval" = "xno" ; then |
| 847 | AC_MSG_RESULT(disabled) |
| 848 | no_osfsia=1 |
| 849 | fi |
| 850 | ], |
| 851 | ) |
| 852 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 853 | if test -f /etc/sia/matrix.conf; then |
| 854 | AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 855 | AC_DEFINE(HAVE_OSF_SIA, 1, |
| 856 | [Define if you have Digital Unix Security |
| 857 | Integration Architecture]) |
| 858 | AC_DEFINE(DISABLE_LOGIN, 1, |
| 859 | [Define if you don't want to use your |
| 860 | system's login() call]) |
Ben Lindstrom | c8c548d | 2003-03-21 01:18:09 +0000 | [diff] [blame] | 861 | AC_DEFINE(DISABLE_FD_PASSING) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 862 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 863 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 864 | else |
| 865 | AC_MSG_RESULT(no) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 866 | AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin", |
| 867 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 868 | fi |
| 869 | fi |
Darren Tucker | 3c8e1e1 | 2003-08-25 13:27:40 +1000 | [diff] [blame] | 870 | AC_DEFINE(BROKEN_GETADDRINFO) |
Tim Rice | 7a74c6b | 2003-09-21 21:00:59 -0700 | [diff] [blame] | 871 | AC_DEFINE(SETEUID_BREAKS_SETUID) |
Darren Tucker | ed92b21 | 2003-09-22 11:26:16 +1000 | [diff] [blame] | 872 | AC_DEFINE(BROKEN_SETREUID) |
| 873 | AC_DEFINE(BROKEN_SETREGID) |
Damien Miller | ff2e492 | 2008-07-05 09:52:03 +1000 | [diff] [blame] | 874 | AC_DEFINE(BROKEN_READV_COMPARISON, 1, [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 875 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 876 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 877 | *-*-nto-qnx*) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 878 | AC_DEFINE(USE_PIPES) |
| 879 | AC_DEFINE(NO_X11_UNIX_SOCKETS) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 880 | AC_DEFINE(MISSING_NFDBITS, 1, [Define on *nto-qnx systems]) |
| 881 | AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems]) |
| 882 | AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems]) |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 883 | AC_DEFINE(DISABLE_LASTLOG) |
Darren Tucker | 54b75fe | 2006-02-26 12:31:48 +1100 | [diff] [blame] | 884 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
Darren Tucker | bc1bd9d | 2007-09-27 07:03:20 +1000 | [diff] [blame] | 885 | AC_DEFINE(BROKEN_SHADOW_EXPIRE, 1, [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 886 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 887 | case "$host" in |
| 888 | *-*-nto-qnx6*) |
| 889 | AC_DEFINE(DISABLE_FD_PASSING) |
| 890 | ;; |
| 891 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 892 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 893 | |
| 894 | *-*-ultrix*) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 895 | AC_DEFINE(BROKEN_GETGROUPS, 1, [getgroups(0,NULL) will return -1]) |
| 896 | AC_DEFINE(BROKEN_MMAP, 1, [Ultrix mmap can't map files]) |
Darren Tucker | 988b3fd | 2006-02-08 22:11:27 +1100 | [diff] [blame] | 897 | AC_DEFINE(NEED_SETPGRP) |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 898 | AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix]) |
| 899 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 900 | |
| 901 | *-*-lynxos) |
| 902 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 903 | AC_DEFINE(MISSING_HOWMANY) |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 904 | AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation]) |
| 905 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 906 | esac |
| 907 | |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 908 | AC_MSG_CHECKING(compiler and flags for sanity) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 909 | AC_RUN_IFELSE( |
| 910 | [AC_LANG_SOURCE([ |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 911 | #include <stdio.h> |
| 912 | int main(){exit(0);} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 913 | ])], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 914 | [ AC_MSG_RESULT(yes) ], |
| 915 | [ |
| 916 | AC_MSG_RESULT(no) |
| 917 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 918 | ], |
| 919 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 920 | ) |
| 921 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 922 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 923 | # Checks for libraries. |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 924 | AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) |
| 925 | AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 926 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 927 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
| 928 | AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ |
| 929 | AC_CHECK_LIB(gen, dirname,[ |
| 930 | AC_CACHE_CHECK([for broken dirname], |
| 931 | ac_cv_have_broken_dirname, [ |
| 932 | save_LIBS="$LIBS" |
| 933 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 934 | AC_RUN_IFELSE( |
| 935 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 936 | #include <libgen.h> |
| 937 | #include <string.h> |
| 938 | |
| 939 | int main(int argc, char **argv) { |
| 940 | char *s, buf[32]; |
| 941 | |
| 942 | strncpy(buf,"/etc", 32); |
| 943 | s = dirname(buf); |
| 944 | if (!s || strncmp(s, "/", 32) != 0) { |
| 945 | exit(1); |
| 946 | } else { |
| 947 | exit(0); |
| 948 | } |
| 949 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 950 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 951 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 952 | [ ac_cv_have_broken_dirname="yes" ], |
| 953 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 954 | ) |
| 955 | LIBS="$save_LIBS" |
| 956 | ]) |
| 957 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 958 | LIBS="$LIBS -lgen" |
| 959 | AC_DEFINE(HAVE_DIRNAME) |
| 960 | AC_CHECK_HEADERS(libgen.h) |
| 961 | fi |
| 962 | ]) |
| 963 | ]) |
| 964 | |
| 965 | AC_CHECK_FUNC(getspnam, , |
| 966 | AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 967 | AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME, 1, |
| 968 | [Define if you have the basename function.])) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 969 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 970 | dnl zlib is required |
| 971 | AC_ARG_WITH(zlib, |
| 972 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 973 | [ if test "x$withval" = "xno" ; then |
| 974 | AC_MSG_ERROR([*** zlib is required ***]) |
| 975 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 976 | if test -d "$withval/lib"; then |
| 977 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 978 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 979 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 980 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 981 | fi |
| 982 | else |
| 983 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 984 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 985 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 986 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 987 | fi |
| 988 | fi |
| 989 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 990 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 991 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 992 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 993 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 994 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 995 | ) |
| 996 | |
Darren Tucker | 83d8f28 | 2009-08-17 09:35:22 +1000 | [diff] [blame] | 997 | AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])) |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 998 | AC_CHECK_LIB(z, deflate, , |
| 999 | [ |
| 1000 | saved_CPPFLAGS="$CPPFLAGS" |
| 1001 | saved_LDFLAGS="$LDFLAGS" |
| 1002 | save_LIBS="$LIBS" |
| 1003 | dnl Check default zlib install dir |
| 1004 | if test -n "${need_dash_r}"; then |
| 1005 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 1006 | else |
| 1007 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1008 | fi |
| 1009 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1010 | LIBS="$LIBS -lz" |
| 1011 | AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ), |
| 1012 | [ |
| 1013 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1014 | ] |
| 1015 | ) |
| 1016 | ] |
| 1017 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1018 | |
| 1019 | AC_ARG_WITH(zlib-version-check, |
| 1020 | [ --without-zlib-version-check Disable zlib version check], |
| 1021 | [ if test "x$withval" = "xno" ; then |
| 1022 | zlib_check_nonfatal=1 |
| 1023 | fi |
| 1024 | ] |
| 1025 | ) |
| 1026 | |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1027 | AC_MSG_CHECKING(for possibly buggy zlib) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1028 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1029 | #include <stdio.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1030 | #include <zlib.h> |
| 1031 | int main() |
| 1032 | { |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1033 | int a=0, b=0, c=0, d=0, n, v; |
| 1034 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1035 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1036 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1037 | v = a*1000000 + b*10000 + c*100 + d; |
| 1038 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1039 | |
| 1040 | /* 1.1.4 is OK */ |
| 1041 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1042 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1043 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1044 | /* 1.2.3 and up are OK */ |
| 1045 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1046 | exit(0); |
| 1047 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1048 | exit(2); |
| 1049 | } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1050 | ]])], |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1051 | AC_MSG_RESULT(no), |
| 1052 | [ AC_MSG_RESULT(yes) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1053 | if test -z "$zlib_check_nonfatal" ; then |
| 1054 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1055 | Your reported zlib version has known security problems. It's possible your |
| 1056 | vendor has fixed these problems without changing the version number. If you |
| 1057 | are sure this is the case, you can disable the check by running |
| 1058 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1059 | If you are in doubt, upgrade zlib to version 1.2.3 or greater. |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1060 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1061 | else |
| 1062 | AC_MSG_WARN([zlib version may have security problems]) |
| 1063 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1064 | ], |
| 1065 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1066 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1067 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1068 | dnl UnixWare 2.x |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1069 | AC_CHECK_FUNC(strcasecmp, |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1070 | [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] |
| 1071 | ) |
Darren Tucker | 5bfe168 | 2005-11-12 18:42:36 +1100 | [diff] [blame] | 1072 | AC_CHECK_FUNCS(utimes, |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1073 | [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES) |
| 1074 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1075 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1076 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1077 | dnl Checks for libutil functions |
| 1078 | AC_CHECK_HEADERS(libutil.h) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1079 | AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1, |
| 1080 | [Define if your libraries define login()])]) |
Damien Miller | a7058ec | 2008-05-20 08:57:06 +1000 | [diff] [blame] | 1081 | AC_CHECK_FUNCS(fmt_scaled logout updwtmp logwtmp) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1082 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1083 | AC_FUNC_STRFTIME |
| 1084 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1085 | # Check for ALTDIRFUNC glob() extension |
| 1086 | AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support) |
| 1087 | AC_EGREP_CPP(FOUNDIT, |
| 1088 | [ |
| 1089 | #include <glob.h> |
| 1090 | #ifdef GLOB_ALTDIRFUNC |
| 1091 | FOUNDIT |
| 1092 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1093 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1094 | [ |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1095 | AC_DEFINE(GLOB_HAS_ALTDIRFUNC, 1, |
| 1096 | [Define if your system glob() function has |
| 1097 | the GLOB_ALTDIRFUNC extension]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1098 | AC_MSG_RESULT(yes) |
| 1099 | ], |
| 1100 | [ |
| 1101 | AC_MSG_RESULT(no) |
| 1102 | ] |
| 1103 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1104 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1105 | # Check for g.gl_matchc glob() extension |
| 1106 | AC_MSG_CHECKING(for gl_matchc field in glob_t) |
Darren Tucker | 486d95e | 2006-03-15 21:31:39 +1100 | [diff] [blame] | 1107 | AC_TRY_COMPILE( |
Damien Miller | af87af1 | 2006-03-15 13:02:28 +1100 | [diff] [blame] | 1108 | [ #include <glob.h> ], |
| 1109 | [glob_t g; g.gl_matchc = 1;], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1110 | [ |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1111 | AC_DEFINE(GLOB_HAS_GL_MATCHC, 1, |
| 1112 | [Define if your system glob() function has |
| 1113 | gl_matchc options in glob_t]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1114 | AC_MSG_RESULT(yes) |
| 1115 | ], |
| 1116 | [ |
| 1117 | AC_MSG_RESULT(no) |
| 1118 | ] |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1119 | ) |
| 1120 | |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1121 | AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include <glob.h>]) |
| 1122 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1123 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1124 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1125 | [AC_LANG_SOURCE([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1126 | #include <sys/types.h> |
| 1127 | #include <dirent.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 1128 | int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1129 | ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1130 | [AC_MSG_RESULT(yes)], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1131 | [ |
| 1132 | AC_MSG_RESULT(no) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1133 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME, 1, |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1134 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1135 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1136 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1137 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1138 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
| 1139 | AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1140 | ] |
| 1141 | ) |
| 1142 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1143 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1144 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1145 | AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1146 | AC_MSG_RESULT(yes) |
| 1147 | else |
| 1148 | AC_MSG_RESULT(no) |
| 1149 | fi |
| 1150 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1151 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1152 | SKEY_MSG="no" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1153 | AC_ARG_WITH(skey, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1154 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1155 | [ |
| 1156 | if test "x$withval" != "xno" ; then |
| 1157 | |
| 1158 | if test "x$withval" != "xyes" ; then |
| 1159 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1160 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1161 | fi |
| 1162 | |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1163 | AC_DEFINE(SKEY, 1, [Define if you want S/Key support]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1164 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1165 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1166 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1167 | AC_MSG_CHECKING([for s/key support]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1168 | AC_LINK_IFELSE( |
| 1169 | [AC_LANG_SOURCE([[ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1170 | #include <stdio.h> |
| 1171 | #include <skey.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 1172 | int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1173 | ]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1174 | [AC_MSG_RESULT(yes)], |
| 1175 | [ |
| 1176 | AC_MSG_RESULT(no) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1177 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1178 | ]) |
Darren Tucker | 3b908f6 | 2004-04-14 15:26:39 +1000 | [diff] [blame] | 1179 | AC_MSG_CHECKING(if skeychallenge takes 4 arguments) |
| 1180 | AC_TRY_COMPILE( |
| 1181 | [#include <stdio.h> |
| 1182 | #include <skey.h>], |
| 1183 | [(void)skeychallenge(NULL,"name","",0);], |
| 1184 | [AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1185 | AC_DEFINE(SKEYCHALLENGE_4ARG, 1, |
| 1186 | [Define if your skeychallenge() |
| 1187 | function takes 4 arguments (NetBSD)])], |
Darren Tucker | 3b908f6 | 2004-04-14 15:26:39 +1000 | [diff] [blame] | 1188 | [AC_MSG_RESULT(no)] |
| 1189 | ) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1190 | fi |
| 1191 | ] |
| 1192 | ) |
| 1193 | |
| 1194 | # Check whether user wants TCP wrappers support |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1195 | TCPW_MSG="no" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1196 | AC_ARG_WITH(tcp-wrappers, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1197 | [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1198 | [ |
| 1199 | if test "x$withval" != "xno" ; then |
| 1200 | saved_LIBS="$LIBS" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1201 | saved_LDFLAGS="$LDFLAGS" |
| 1202 | saved_CPPFLAGS="$CPPFLAGS" |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1203 | if test -n "${withval}" && \ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 1204 | test "x${withval}" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1205 | if test -d "${withval}/lib"; then |
| 1206 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1207 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1208 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1209 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1210 | fi |
| 1211 | else |
| 1212 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1213 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1214 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1215 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1216 | fi |
| 1217 | fi |
| 1218 | if test -d "${withval}/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1219 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1220 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1221 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1222 | fi |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1223 | fi |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 1224 | LIBS="-lwrap $LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1225 | AC_MSG_CHECKING(for libwrap) |
| 1226 | AC_TRY_LINK( |
| 1227 | [ |
Damien Miller | 0ac4500 | 2004-04-14 20:14:26 +1000 | [diff] [blame] | 1228 | #include <sys/types.h> |
| 1229 | #include <sys/socket.h> |
| 1230 | #include <netinet/in.h> |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1231 | #include <tcpd.h> |
| 1232 | int deny_severity = 0, allow_severity = 0; |
| 1233 | ], |
| 1234 | [hosts_access(0);], |
| 1235 | [ |
| 1236 | AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1237 | AC_DEFINE(LIBWRAP, 1, |
| 1238 | [Define if you want |
| 1239 | TCP Wrappers support]) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 1240 | SSHDLIBS="$SSHDLIBS -lwrap" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1241 | TCPW_MSG="yes" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1242 | ], |
| 1243 | [ |
| 1244 | AC_MSG_ERROR([*** libwrap missing]) |
| 1245 | ] |
| 1246 | ) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1247 | LIBS="$saved_LIBS" |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1248 | fi |
| 1249 | ] |
| 1250 | ) |
| 1251 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1252 | # Check whether user wants libedit support |
| 1253 | LIBEDIT_MSG="no" |
| 1254 | AC_ARG_WITH(libedit, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1255 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1256 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1257 | if test "x$withval" = "xyes" ; then |
| 1258 | AC_PATH_PROG(PKGCONFIG, pkg-config, no) |
| 1259 | if test "x$PKGCONFIG" != "xno"; then |
| 1260 | AC_MSG_CHECKING(if $PKGCONFIG knows about libedit) |
| 1261 | if "$PKGCONFIG" libedit; then |
| 1262 | AC_MSG_RESULT(yes) |
| 1263 | use_pkgconfig_for_libedit=yes |
| 1264 | else |
| 1265 | AC_MSG_RESULT(no) |
| 1266 | fi |
| 1267 | fi |
| 1268 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1269 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1270 | if test -n "${need_dash_r}"; then |
| 1271 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1272 | else |
| 1273 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1274 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1275 | fi |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1276 | if test "x$use_pkgconfig_for_libedit" == "xyes"; then |
| 1277 | LIBEDIT=`$PKGCONFIG --libs-only-l libedit` |
| 1278 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1279 | else |
| 1280 | LIBEDIT="-ledit -lcurses" |
| 1281 | fi |
| 1282 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1283 | AC_CHECK_LIB(edit, el_init, |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1284 | [ AC_DEFINE(USE_LIBEDIT, 1, [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1285 | LIBEDIT_MSG="yes" |
| 1286 | AC_SUBST(LIBEDIT) |
| 1287 | ], |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1288 | [ AC_MSG_ERROR(libedit not found) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1289 | [ $OTHERLIBS ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1290 | ) |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1291 | AC_MSG_CHECKING(if libedit version is compatible) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1292 | AC_COMPILE_IFELSE( |
| 1293 | [AC_LANG_SOURCE([[ |
| 1294 | #include <histedit.h> |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1295 | int main(void) |
| 1296 | { |
| 1297 | int i = H_SETSIZE; |
| 1298 | el_init("", NULL, NULL, NULL); |
| 1299 | exit(0); |
| 1300 | } |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1301 | ]])], |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1302 | [ AC_MSG_RESULT(yes) ], |
| 1303 | [ AC_MSG_RESULT(no) |
| 1304 | AC_MSG_ERROR(libedit version is not compatible) ] |
| 1305 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1306 | fi ] |
| 1307 | ) |
| 1308 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1309 | AUDIT_MODULE=none |
| 1310 | AC_ARG_WITH(audit, |
| 1311 | [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)], |
| 1312 | [ |
| 1313 | AC_MSG_CHECKING(for supported audit module) |
| 1314 | case "$withval" in |
| 1315 | bsm) |
| 1316 | AC_MSG_RESULT(bsm) |
| 1317 | AUDIT_MODULE=bsm |
| 1318 | dnl Checks for headers, libs and functions |
| 1319 | AC_CHECK_HEADERS(bsm/audit.h, [], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1320 | [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)], |
| 1321 | [ |
| 1322 | #ifdef HAVE_TIME_H |
| 1323 | # include <time.h> |
| 1324 | #endif |
| 1325 | ] |
| 1326 | ) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1327 | AC_CHECK_LIB(bsm, getaudit, [], |
| 1328 | [AC_MSG_ERROR(BSM enabled and required library not found)]) |
| 1329 | AC_CHECK_FUNCS(getaudit, [], |
| 1330 | [AC_MSG_ERROR(BSM enabled and required function not found)]) |
| 1331 | # These are optional |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 1332 | AC_CHECK_FUNCS(getaudit_addr aug_get_machine) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1333 | AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1334 | ;; |
| 1335 | debug) |
| 1336 | AUDIT_MODULE=debug |
| 1337 | AC_MSG_RESULT(debug) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1338 | AC_DEFINE(SSH_AUDIT_EVENTS, 1, Use audit debugging module) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1339 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1340 | no) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1341 | AC_MSG_RESULT(no) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1342 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1343 | *) |
| 1344 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1345 | ;; |
| 1346 | esac ] |
| 1347 | ) |
| 1348 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1349 | dnl Checks for library functions. Please keep in alphabetical order |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1350 | AC_CHECK_FUNCS( \ |
| 1351 | arc4random \ |
Damien Miller | a4be7c2 | 2008-05-19 14:47:37 +1000 | [diff] [blame] | 1352 | arc4random_buf \ |
| 1353 | arc4random_uniform \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1354 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1355 | b64_ntop \ |
| 1356 | __b64_ntop \ |
| 1357 | b64_pton \ |
| 1358 | __b64_pton \ |
| 1359 | bcopy \ |
| 1360 | bindresvport_sa \ |
| 1361 | clock \ |
| 1362 | closefrom \ |
| 1363 | dirfd \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1364 | fchmod \ |
| 1365 | fchown \ |
| 1366 | freeaddrinfo \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1367 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1368 | futimes \ |
| 1369 | getaddrinfo \ |
| 1370 | getcwd \ |
| 1371 | getgrouplist \ |
| 1372 | getnameinfo \ |
| 1373 | getopt \ |
| 1374 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1375 | getpeerucred \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1376 | _getpty \ |
| 1377 | getrlimit \ |
| 1378 | getttyent \ |
| 1379 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1380 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1381 | inet_aton \ |
| 1382 | inet_ntoa \ |
| 1383 | inet_ntop \ |
| 1384 | innetgr \ |
| 1385 | login_getcapbool \ |
| 1386 | md5_crypt \ |
| 1387 | memmove \ |
| 1388 | mkdtemp \ |
| 1389 | mmap \ |
| 1390 | ngetaddrinfo \ |
| 1391 | nsleep \ |
| 1392 | ogetaddrinfo \ |
| 1393 | openlog_r \ |
| 1394 | openpty \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1395 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1396 | prctl \ |
| 1397 | pstat \ |
| 1398 | readpassphrase \ |
| 1399 | realpath \ |
| 1400 | recvmsg \ |
| 1401 | rresvport_af \ |
| 1402 | sendmsg \ |
| 1403 | setdtablesize \ |
| 1404 | setegid \ |
| 1405 | setenv \ |
| 1406 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1407 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1408 | setgroups \ |
| 1409 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1410 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1411 | setpcred \ |
| 1412 | setproctitle \ |
| 1413 | setregid \ |
| 1414 | setreuid \ |
| 1415 | setrlimit \ |
| 1416 | setsid \ |
| 1417 | setvbuf \ |
| 1418 | sigaction \ |
| 1419 | sigvec \ |
| 1420 | snprintf \ |
| 1421 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1422 | statfs \ |
| 1423 | statvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1424 | strdup \ |
| 1425 | strerror \ |
| 1426 | strlcat \ |
| 1427 | strlcpy \ |
| 1428 | strmode \ |
| 1429 | strnvis \ |
| 1430 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1431 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1432 | strtoul \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1433 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1434 | sysconf \ |
| 1435 | tcgetpgrp \ |
| 1436 | truncate \ |
| 1437 | unsetenv \ |
| 1438 | updwtmpx \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1439 | user_from_uid \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1440 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1441 | vhangup \ |
| 1442 | vsnprintf \ |
| 1443 | waitpid \ |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1444 | ) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1445 | |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1446 | # PKCS#11 support requires dlopen() and co |
| 1447 | AC_SEARCH_LIBS(dlopen, dl, |
| 1448 | AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]) |
| 1449 | ) |
| 1450 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1451 | # IRIX has a const char return value for gai_strerror() |
| 1452 | AC_CHECK_FUNCS(gai_strerror,[ |
| 1453 | AC_DEFINE(HAVE_GAI_STRERROR) |
| 1454 | AC_TRY_COMPILE([ |
| 1455 | #include <sys/types.h> |
| 1456 | #include <sys/socket.h> |
| 1457 | #include <netdb.h> |
| 1458 | |
| 1459 | const char *gai_strerror(int);],[ |
| 1460 | char *str; |
| 1461 | |
| 1462 | str = gai_strerror(0);],[ |
| 1463 | AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1, |
| 1464 | [Define if gai_strerror() returns const char *])])]) |
| 1465 | |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1466 | AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, |
| 1467 | [Some systems put nanosleep outside of libc])) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1468 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1469 | dnl Make sure prototypes are defined for these before using them. |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1470 | AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)]) |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1471 | AC_CHECK_DECL(strsep, |
| 1472 | [AC_CHECK_FUNCS(strsep)], |
| 1473 | [], |
| 1474 | [ |
| 1475 | #ifdef HAVE_STRING_H |
| 1476 | # include <string.h> |
| 1477 | #endif |
| 1478 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1479 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1480 | dnl tcsendbreak might be a macro |
| 1481 | AC_CHECK_DECL(tcsendbreak, |
| 1482 | [AC_DEFINE(HAVE_TCSENDBREAK)], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1483 | [AC_CHECK_FUNCS(tcsendbreak)], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1484 | [#include <termios.h>] |
| 1485 | ) |
| 1486 | |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1487 | AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>]) |
| 1488 | |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1489 | AC_CHECK_DECLS(SHUT_RD, , , |
| 1490 | [ |
| 1491 | #include <sys/types.h> |
| 1492 | #include <sys/socket.h> |
| 1493 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1494 | |
| 1495 | AC_CHECK_DECLS(O_NONBLOCK, , , |
| 1496 | [ |
| 1497 | #include <sys/types.h> |
| 1498 | #ifdef HAVE_SYS_STAT_H |
| 1499 | # include <sys/stat.h> |
| 1500 | #endif |
| 1501 | #ifdef HAVE_FCNTL_H |
| 1502 | # include <fcntl.h> |
| 1503 | #endif |
| 1504 | ]) |
| 1505 | |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1506 | AC_CHECK_DECLS(writev, , , [ |
| 1507 | #include <sys/types.h> |
| 1508 | #include <sys/uio.h> |
| 1509 | #include <unistd.h> |
| 1510 | ]) |
| 1511 | |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1512 | AC_CHECK_DECLS(MAXSYMLINKS, , , [ |
| 1513 | #include <sys/param.h> |
| 1514 | ]) |
| 1515 | |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1516 | AC_CHECK_DECLS(offsetof, , , [ |
| 1517 | #include <stddef.h> |
| 1518 | ]) |
| 1519 | |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1520 | AC_CHECK_FUNCS(setresuid, [ |
| 1521 | dnl Some platorms have setresuid that isn't implemented, test for this |
| 1522 | AC_MSG_CHECKING(if setresuid seems to work) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1523 | AC_RUN_IFELSE( |
| 1524 | [AC_LANG_SOURCE([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1525 | #include <stdlib.h> |
| 1526 | #include <errno.h> |
| 1527 | int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1528 | ]])], |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1529 | [AC_MSG_RESULT(yes)], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1530 | [AC_DEFINE(BROKEN_SETRESUID, 1, |
| 1531 | [Define if your setresuid() is broken]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1532 | AC_MSG_RESULT(not implemented)], |
| 1533 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1534 | ) |
| 1535 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1536 | |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1537 | AC_CHECK_FUNCS(setresgid, [ |
| 1538 | dnl Some platorms have setresgid that isn't implemented, test for this |
| 1539 | AC_MSG_CHECKING(if setresgid seems to work) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1540 | AC_RUN_IFELSE( |
| 1541 | [AC_LANG_SOURCE([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1542 | #include <stdlib.h> |
| 1543 | #include <errno.h> |
| 1544 | int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1545 | ]])], |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1546 | [AC_MSG_RESULT(yes)], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1547 | [AC_DEFINE(BROKEN_SETRESGID, 1, |
| 1548 | [Define if your setresgid() is broken]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1549 | AC_MSG_RESULT(not implemented)], |
| 1550 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1551 | ) |
| 1552 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1553 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1554 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1555 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1556 | dnl Checks for utmp functions |
Ben Lindstrom | 2c467a2 | 2000-12-27 04:57:41 +0000 | [diff] [blame] | 1557 | AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1558 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 1559 | dnl Checks for utmpx functions |
Darren Tucker | 261d93a | 2010-04-09 18:13:27 +1000 | [diff] [blame] | 1560 | AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline getutxuser pututxline) |
| 1561 | AC_CHECK_FUNCS(setutxdb setutxent utmpxname) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 1562 | dnl Checks for lastlog functions |
| 1563 | AC_CHECK_FUNCS(getlastlogxbyname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 1564 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1565 | AC_CHECK_FUNC(daemon, |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1566 | [AC_DEFINE(HAVE_DAEMON, 1, [Define if your libraries define daemon()])], |
| 1567 | [AC_CHECK_LIB(bsd, daemon, |
| 1568 | [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 1569 | ) |
| 1570 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1571 | AC_CHECK_FUNC(getpagesize, |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1572 | [AC_DEFINE(HAVE_GETPAGESIZE, 1, |
| 1573 | [Define if your libraries define getpagesize()])], |
| 1574 | [AC_CHECK_LIB(ucb, getpagesize, |
| 1575 | [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 1576 | ) |
| 1577 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1578 | # Check for broken snprintf |
| 1579 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 1580 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1581 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1582 | [AC_LANG_SOURCE([[ |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1583 | #include <stdio.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 1584 | int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1585 | ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1586 | [AC_MSG_RESULT(yes)], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1587 | [ |
| 1588 | AC_MSG_RESULT(no) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1589 | AC_DEFINE(BROKEN_SNPRINTF, 1, |
| 1590 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1591 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1592 | ], |
| 1593 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 1594 | ) |
| 1595 | fi |
| 1596 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1597 | # If we don't have a working asprintf, then we strongly depend on vsnprintf |
| 1598 | # returning the right thing on overflow: the number of characters it tried to |
| 1599 | # create (as per SUSv3) |
| 1600 | if test "x$ac_cv_func_asprintf" != "xyes" && \ |
| 1601 | test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
| 1602 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 1603 | AC_RUN_IFELSE( |
| 1604 | [AC_LANG_SOURCE([[ |
| 1605 | #include <sys/types.h> |
| 1606 | #include <stdio.h> |
| 1607 | #include <stdarg.h> |
| 1608 | |
| 1609 | int x_snprintf(char *str,size_t count,const char *fmt,...) |
| 1610 | { |
| 1611 | size_t ret; va_list ap; |
| 1612 | va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap); |
| 1613 | return ret; |
| 1614 | } |
| 1615 | int main(void) |
| 1616 | { |
| 1617 | char x[1]; |
| 1618 | exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1); |
| 1619 | } ]])], |
| 1620 | [AC_MSG_RESULT(yes)], |
| 1621 | [ |
| 1622 | AC_MSG_RESULT(no) |
| 1623 | AC_DEFINE(BROKEN_SNPRINTF, 1, |
| 1624 | [Define if your snprintf is busted]) |
| 1625 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 1626 | ], |
| 1627 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 1628 | ) |
| 1629 | fi |
| 1630 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 1631 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 1632 | # check that the fmt argument is const char * or just char *. |
| 1633 | # This is only useful for when BROKEN_SNPRINTF |
| 1634 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
| 1635 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
| 1636 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 1637 | int main(void) { snprintf(0, 0, 0); } |
| 1638 | ]])], |
| 1639 | [AC_MSG_RESULT(yes) |
| 1640 | AC_DEFINE(SNPRINTF_CONST, [const], |
| 1641 | [Define as const if snprintf() can declare const char *fmt])], |
| 1642 | [AC_MSG_RESULT(no) |
| 1643 | AC_DEFINE(SNPRINTF_CONST, [/* not const */])]) |
| 1644 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1645 | # Check for missing getpeereid (or equiv) support |
| 1646 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1647 | if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "xyes"; then |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1648 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
| 1649 | AC_TRY_COMPILE( |
| 1650 | [#include <sys/types.h> |
| 1651 | #include <sys/socket.h>], |
| 1652 | [int i = SO_PEERCRED;], |
Darren Tucker | 9d2562c | 2005-04-05 19:22:45 +1000 | [diff] [blame] | 1653 | [ AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1654 | AC_DEFINE(HAVE_SO_PEERCRED, 1, [Have PEERCRED socket option]) |
Darren Tucker | 9d2562c | 2005-04-05 19:22:45 +1000 | [diff] [blame] | 1655 | ], |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 1656 | [AC_MSG_RESULT(no) |
| 1657 | NO_PEERCHECK=1] |
| 1658 | ) |
| 1659 | fi |
| 1660 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1661 | dnl see whether mkstemp() requires XXXXXX |
| 1662 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 1663 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1664 | AC_RUN_IFELSE( |
| 1665 | [AC_LANG_SOURCE([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1666 | #include <stdlib.h> |
| 1667 | main() { char template[]="conftest.mkstemp-test"; |
| 1668 | if (mkstemp(template) == -1) |
| 1669 | exit(1); |
| 1670 | unlink(template); exit(0); |
| 1671 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1672 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1673 | [ |
| 1674 | AC_MSG_RESULT(no) |
| 1675 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1676 | [ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1677 | AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1678 | AC_DEFINE(HAVE_STRICT_MKSTEMP, 1, [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1679 | ], |
| 1680 | [ |
| 1681 | AC_MSG_RESULT(yes) |
| 1682 | AC_DEFINE(HAVE_STRICT_MKSTEMP) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1683 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 1684 | ) |
| 1685 | fi |
| 1686 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1687 | dnl make sure that openpty does not reacquire controlling terminal |
| 1688 | if test ! -z "$check_for_openpty_ctty_bug"; then |
| 1689 | AC_MSG_CHECKING(if openpty correctly handles controlling tty) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1690 | AC_RUN_IFELSE( |
| 1691 | [AC_LANG_SOURCE([[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1692 | #include <stdio.h> |
| 1693 | #include <sys/fcntl.h> |
| 1694 | #include <sys/types.h> |
| 1695 | #include <sys/wait.h> |
| 1696 | |
| 1697 | int |
| 1698 | main() |
| 1699 | { |
| 1700 | pid_t pid; |
| 1701 | int fd, ptyfd, ttyfd, status; |
| 1702 | |
| 1703 | pid = fork(); |
| 1704 | if (pid < 0) { /* failed */ |
| 1705 | exit(1); |
| 1706 | } else if (pid > 0) { /* parent */ |
| 1707 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1708 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1709 | exit(WEXITSTATUS(status)); |
| 1710 | else |
| 1711 | exit(2); |
| 1712 | } else { /* child */ |
| 1713 | close(0); close(1); close(2); |
| 1714 | setsid(); |
| 1715 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 1716 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 1717 | if (fd >= 0) |
| 1718 | exit(3); /* Acquired ctty: broken */ |
| 1719 | else |
| 1720 | exit(0); /* Did not acquire ctty: OK */ |
| 1721 | } |
| 1722 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1723 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1724 | [ |
| 1725 | AC_MSG_RESULT(yes) |
| 1726 | ], |
| 1727 | [ |
| 1728 | AC_MSG_RESULT(no) |
| 1729 | AC_DEFINE(SSHD_ACQUIRES_CTTY) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1730 | ], |
| 1731 | [ |
| 1732 | AC_MSG_RESULT(cross-compiling, assuming yes) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 1733 | ] |
| 1734 | ) |
| 1735 | fi |
| 1736 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1737 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 1738 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1739 | AC_MSG_CHECKING(if getaddrinfo seems to work) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1740 | AC_RUN_IFELSE( |
| 1741 | [AC_LANG_SOURCE([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1742 | #include <stdio.h> |
| 1743 | #include <sys/socket.h> |
| 1744 | #include <netdb.h> |
| 1745 | #include <errno.h> |
| 1746 | #include <netinet/in.h> |
| 1747 | |
| 1748 | #define TEST_PORT "2222" |
| 1749 | |
| 1750 | int |
| 1751 | main(void) |
| 1752 | { |
| 1753 | int err, sock; |
| 1754 | struct addrinfo *gai_ai, *ai, hints; |
| 1755 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 1756 | |
| 1757 | memset(&hints, 0, sizeof(hints)); |
| 1758 | hints.ai_family = PF_UNSPEC; |
| 1759 | hints.ai_socktype = SOCK_STREAM; |
| 1760 | hints.ai_flags = AI_PASSIVE; |
| 1761 | |
| 1762 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 1763 | if (err != 0) { |
| 1764 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 1765 | exit(1); |
| 1766 | } |
| 1767 | |
| 1768 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 1769 | if (ai->ai_family != AF_INET6) |
| 1770 | continue; |
| 1771 | |
| 1772 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 1773 | sizeof(ntop), strport, sizeof(strport), |
| 1774 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 1775 | |
| 1776 | if (err != 0) { |
| 1777 | if (err == EAI_SYSTEM) |
| 1778 | perror("getnameinfo EAI_SYSTEM"); |
| 1779 | else |
| 1780 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 1781 | gai_strerror(err)); |
| 1782 | exit(2); |
| 1783 | } |
| 1784 | |
| 1785 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 1786 | if (sock < 0) |
| 1787 | perror("socket"); |
| 1788 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 1789 | if (errno == EBADF) |
| 1790 | exit(3); |
| 1791 | } |
| 1792 | } |
| 1793 | exit(0); |
| 1794 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1795 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1796 | [ |
| 1797 | AC_MSG_RESULT(yes) |
| 1798 | ], |
| 1799 | [ |
| 1800 | AC_MSG_RESULT(no) |
| 1801 | AC_DEFINE(BROKEN_GETADDRINFO) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1802 | ], |
| 1803 | [ |
| 1804 | AC_MSG_RESULT(cross-compiling, assuming yes) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 1805 | ] |
| 1806 | ) |
| 1807 | fi |
| 1808 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 1809 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 1810 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 1811 | AC_MSG_CHECKING(if getaddrinfo seems to work) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1812 | AC_RUN_IFELSE( |
| 1813 | [AC_LANG_SOURCE([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 1814 | #include <stdio.h> |
| 1815 | #include <sys/socket.h> |
| 1816 | #include <netdb.h> |
| 1817 | #include <errno.h> |
| 1818 | #include <netinet/in.h> |
| 1819 | |
| 1820 | #define TEST_PORT "2222" |
| 1821 | |
| 1822 | int |
| 1823 | main(void) |
| 1824 | { |
| 1825 | int err, sock; |
| 1826 | struct addrinfo *gai_ai, *ai, hints; |
| 1827 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 1828 | |
| 1829 | memset(&hints, 0, sizeof(hints)); |
| 1830 | hints.ai_family = PF_UNSPEC; |
| 1831 | hints.ai_socktype = SOCK_STREAM; |
| 1832 | hints.ai_flags = AI_PASSIVE; |
| 1833 | |
| 1834 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 1835 | if (err != 0) { |
| 1836 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 1837 | exit(1); |
| 1838 | } |
| 1839 | |
| 1840 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 1841 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 1842 | continue; |
| 1843 | |
| 1844 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 1845 | sizeof(ntop), strport, sizeof(strport), |
| 1846 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 1847 | |
| 1848 | if (ai->ai_family == AF_INET && err != 0) { |
| 1849 | perror("getnameinfo"); |
| 1850 | exit(2); |
| 1851 | } |
| 1852 | } |
| 1853 | exit(0); |
| 1854 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1855 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 1856 | [ |
| 1857 | AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1858 | AC_DEFINE(AIX_GETNAMEINFO_HACK, 1, |
| 1859 | [Define if you have a getaddrinfo that fails |
| 1860 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 1861 | ], |
| 1862 | [ |
| 1863 | AC_MSG_RESULT(no) |
| 1864 | AC_DEFINE(BROKEN_GETADDRINFO) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1865 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 1866 | [ |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1867 | AC_MSG_RESULT(cross-compiling, assuming no) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 1868 | ] |
| 1869 | ) |
| 1870 | fi |
| 1871 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 1872 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
| 1873 | AC_MSG_CHECKING(for conflicting getspnam in shadow.h) |
| 1874 | AC_COMPILE_IFELSE( |
| 1875 | [ |
| 1876 | #include <shadow.h> |
| 1877 | int main(void) {exit(0);} |
| 1878 | ], |
| 1879 | [ |
| 1880 | AC_MSG_RESULT(no) |
| 1881 | ], |
| 1882 | [ |
| 1883 | AC_MSG_RESULT(yes) |
| 1884 | AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1, |
| 1885 | [Conflicting defs for getspnam]) |
| 1886 | ] |
| 1887 | ) |
| 1888 | fi |
| 1889 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 1890 | AC_FUNC_GETPGRP |
| 1891 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1892 | # Search for OpenSSL |
| 1893 | saved_CPPFLAGS="$CPPFLAGS" |
| 1894 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1895 | AC_ARG_WITH(ssl-dir, |
| 1896 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 1897 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 1898 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 1899 | case "$withval" in |
| 1900 | # Relative paths |
| 1901 | ./*|../*) withval="`pwd`/$withval" |
| 1902 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1903 | if test -d "$withval/lib"; then |
| 1904 | if test -n "${need_dash_r}"; then |
| 1905 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1906 | else |
| 1907 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1908 | fi |
| 1909 | else |
| 1910 | if test -n "${need_dash_r}"; then |
| 1911 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 1912 | else |
| 1913 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 1914 | fi |
| 1915 | fi |
| 1916 | if test -d "$withval/include"; then |
| 1917 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 1918 | else |
| 1919 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 1920 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1921 | fi |
| 1922 | ] |
| 1923 | ) |
Tim Rice | 3d5352e | 2004-02-12 09:27:21 -0800 | [diff] [blame] | 1924 | LIBS="-lcrypto $LIBS" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1925 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1, |
| 1926 | [Define if your ssl headers are included |
| 1927 | with #include <openssl/header.h>]), |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 1928 | [ |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1929 | dnl Check default openssl install dir |
| 1930 | if test -n "${need_dash_r}"; then |
| 1931 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 1932 | else |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1933 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 1934 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1935 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
Darren Tucker | 83d8f28 | 2009-08-17 09:35:22 +1000 | [diff] [blame] | 1936 | AC_CHECK_HEADER([openssl/opensslv.h], , |
| 1937 | AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])) |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 1938 | AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), |
| 1939 | [ |
| 1940 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 1941 | ] |
| 1942 | ) |
| 1943 | ] |
| 1944 | ) |
| 1945 | |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1946 | # Determine OpenSSL header version |
| 1947 | AC_MSG_CHECKING([OpenSSL header version]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1948 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1949 | [AC_LANG_SOURCE([[ |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1950 | #include <stdio.h> |
| 1951 | #include <string.h> |
| 1952 | #include <openssl/opensslv.h> |
| 1953 | #define DATA "conftest.sslincver" |
| 1954 | int main(void) { |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1955 | FILE *fd; |
| 1956 | int rc; |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1957 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1958 | fd = fopen(DATA,"w"); |
| 1959 | if(fd == NULL) |
| 1960 | exit(1); |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1961 | |
| 1962 | if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0) |
| 1963 | exit(1); |
| 1964 | |
| 1965 | exit(0); |
| 1966 | } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1967 | ]])], |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1968 | [ |
| 1969 | ssl_header_ver=`cat conftest.sslincver` |
| 1970 | AC_MSG_RESULT($ssl_header_ver) |
| 1971 | ], |
| 1972 | [ |
| 1973 | AC_MSG_RESULT(not found) |
| 1974 | AC_MSG_ERROR(OpenSSL version header not found.) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1975 | ], |
| 1976 | [ |
| 1977 | AC_MSG_WARN([cross compiling: not checking]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1978 | ] |
| 1979 | ) |
| 1980 | |
| 1981 | # Determine OpenSSL library version |
| 1982 | AC_MSG_CHECKING([OpenSSL library version]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1983 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1984 | [AC_LANG_SOURCE([[ |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1985 | #include <stdio.h> |
| 1986 | #include <string.h> |
| 1987 | #include <openssl/opensslv.h> |
| 1988 | #include <openssl/crypto.h> |
| 1989 | #define DATA "conftest.ssllibver" |
| 1990 | int main(void) { |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1991 | FILE *fd; |
| 1992 | int rc; |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1993 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1994 | fd = fopen(DATA,"w"); |
| 1995 | if(fd == NULL) |
| 1996 | exit(1); |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 1997 | |
| 1998 | if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0) |
| 1999 | exit(1); |
| 2000 | |
| 2001 | exit(0); |
| 2002 | } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2003 | ]])], |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2004 | [ |
| 2005 | ssl_library_ver=`cat conftest.ssllibver` |
| 2006 | AC_MSG_RESULT($ssl_library_ver) |
| 2007 | ], |
| 2008 | [ |
| 2009 | AC_MSG_RESULT(not found) |
| 2010 | AC_MSG_ERROR(OpenSSL library not found.) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2011 | ], |
| 2012 | [ |
| 2013 | AC_MSG_WARN([cross compiling: not checking]) |
Tim Rice | d730b78 | 2002-08-13 18:52:10 -0700 | [diff] [blame] | 2014 | ] |
| 2015 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2016 | |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2017 | AC_ARG_WITH(openssl-header-check, |
| 2018 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
| 2019 | [ if test "x$withval" = "xno" ; then |
| 2020 | openssl_check_nonfatal=1 |
| 2021 | fi |
| 2022 | ] |
| 2023 | ) |
| 2024 | |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2025 | # Sanity check OpenSSL headers |
| 2026 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2027 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2028 | [AC_LANG_SOURCE([[ |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2029 | #include <string.h> |
| 2030 | #include <openssl/opensslv.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 2031 | int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2032 | ]])], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2033 | [ |
| 2034 | AC_MSG_RESULT(yes) |
| 2035 | ], |
| 2036 | [ |
| 2037 | AC_MSG_RESULT(no) |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2038 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2039 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2040 | library. Check config.log for details. |
| 2041 | If you are sure your installation is consistent, you can disable the check |
| 2042 | by running "./configure --without-openssl-header-check". |
| 2043 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2044 | ]) |
| 2045 | else |
| 2046 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2047 | library. Check config.log for details. |
Darren Tucker | a0472e0 | 2003-06-24 20:22:09 +1000 | [diff] [blame] | 2048 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2049 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2050 | ], |
| 2051 | [ |
| 2052 | AC_MSG_WARN([cross compiling: not checking]) |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2053 | ] |
| 2054 | ) |
| 2055 | |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2056 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2057 | AC_LINK_IFELSE( |
| 2058 | [AC_LANG_SOURCE([[ |
| 2059 | #include <openssl/evp.h> |
| 2060 | int main(void) { SSLeay_add_all_algorithms(); } |
| 2061 | ]])], |
| 2062 | [ |
| 2063 | AC_MSG_RESULT(yes) |
| 2064 | ], |
| 2065 | [ |
| 2066 | AC_MSG_RESULT(no) |
| 2067 | saved_LIBS="$LIBS" |
| 2068 | LIBS="$LIBS -ldl" |
| 2069 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2070 | AC_LINK_IFELSE( |
| 2071 | [AC_LANG_SOURCE([[ |
| 2072 | #include <openssl/evp.h> |
| 2073 | int main(void) { SSLeay_add_all_algorithms(); } |
| 2074 | ]])], |
| 2075 | [ |
| 2076 | AC_MSG_RESULT(yes) |
| 2077 | ], |
| 2078 | [ |
| 2079 | AC_MSG_RESULT(no) |
| 2080 | LIBS="$saved_LIBS" |
| 2081 | ] |
| 2082 | ) |
| 2083 | ] |
| 2084 | ) |
| 2085 | |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2086 | AC_ARG_WITH(ssl-engine, |
| 2087 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
| 2088 | [ if test "x$withval" != "xno" ; then |
| 2089 | AC_MSG_CHECKING(for OpenSSL ENGINE support) |
| 2090 | AC_TRY_COMPILE( |
| 2091 | [ #include <openssl/engine.h>], |
| 2092 | [ |
Darren Tucker | 5e8381e | 2006-09-29 20:16:51 +1000 | [diff] [blame] | 2093 | ENGINE_load_builtin_engines();ENGINE_register_all_complete(); |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2094 | ], |
| 2095 | [ AC_MSG_RESULT(yes) |
| 2096 | AC_DEFINE(USE_OPENSSL_ENGINE, 1, |
| 2097 | [Enable OpenSSL engine support]) |
| 2098 | ], |
| 2099 | [ AC_MSG_ERROR(OpenSSL ENGINE support not found)] |
| 2100 | ) |
| 2101 | fi ] |
| 2102 | ) |
| 2103 | |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2104 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2105 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
Darren Tucker | f1f4bdd | 2006-08-04 19:44:23 +1000 | [diff] [blame] | 2106 | AC_LINK_IFELSE( |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2107 | [AC_LANG_SOURCE([[ |
| 2108 | #include <string.h> |
| 2109 | #include <openssl/evp.h> |
Darren Tucker | cc7c212 | 2006-02-02 18:44:19 +1100 | [diff] [blame] | 2110 | int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);} |
Darren Tucker | 129d0bb | 2005-12-19 17:40:40 +1100 | [diff] [blame] | 2111 | ]])], |
| 2112 | [ |
| 2113 | AC_MSG_RESULT(no) |
| 2114 | ], |
| 2115 | [ |
| 2116 | AC_MSG_RESULT(yes) |
| 2117 | AC_DEFINE(OPENSSL_LOBOTOMISED_AES, 1, |
| 2118 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2119 | ] |
| 2120 | ) |
| 2121 | |
Darren Tucker | 3e7e15f | 2009-03-07 22:22:35 +1100 | [diff] [blame] | 2122 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2123 | AC_LINK_IFELSE( |
| 2124 | [AC_LANG_SOURCE([[ |
| 2125 | #include <string.h> |
| 2126 | #include <openssl/evp.h> |
| 2127 | int main(void) { if(EVP_DigestUpdate(NULL, NULL,0)) exit(0); } |
| 2128 | ]])], |
| 2129 | [ |
| 2130 | AC_MSG_RESULT(yes) |
| 2131 | ], |
| 2132 | [ |
| 2133 | AC_MSG_RESULT(no) |
| 2134 | AC_DEFINE(OPENSSL_EVP_DIGESTUPDATE_VOID, 1, |
| 2135 | [Define if EVP_DigestUpdate returns void]) |
| 2136 | ] |
| 2137 | ) |
| 2138 | |
Tim Rice | 3d5352e | 2004-02-12 09:27:21 -0800 | [diff] [blame] | 2139 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2140 | # because the system crypt() is more featureful. |
| 2141 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 2142 | AC_CHECK_LIB(crypt, crypt) |
| 2143 | fi |
| 2144 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2145 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
Tim Rice | 43fa557 | 2004-02-11 14:46:40 -0800 | [diff] [blame] | 2146 | # version in OpenSSL. |
Damien Miller | 4f9f42a | 2003-05-10 19:28:02 +1000 | [diff] [blame] | 2147 | if test "x$check_for_libcrypt_later" = "x1"; then |
Damien Miller | 95aa2d6 | 2001-03-01 09:16:11 +1100 | [diff] [blame] | 2148 | AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 2149 | fi |
| 2150 | |
Damien Miller | af87af1 | 2006-03-15 13:02:28 +1100 | [diff] [blame] | 2151 | # Search for SHA256 support in libc and/or OpenSSL |
| 2152 | AC_CHECK_FUNCS(SHA256_Update EVP_sha256) |
| 2153 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2154 | saved_LIBS="$LIBS" |
| 2155 | AC_CHECK_LIB(iaf, ia_openinfo, [ |
| 2156 | LIBS="$LIBS -liaf" |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 2157 | AC_CHECK_FUNCS(set_id, [SSHDLIBS="$SSHDLIBS -liaf" |
| 2158 | AC_DEFINE(HAVE_LIBIAF, 1, |
| 2159 | [Define if system has libiaf that supports set_id]) |
| 2160 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2161 | ]) |
| 2162 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2163 | |
| 2164 | ### Configure cryptographic random number support |
| 2165 | |
| 2166 | # Check wheter OpenSSL seeds itself |
| 2167 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2168 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2169 | [AC_LANG_SOURCE([[ |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2170 | #include <string.h> |
| 2171 | #include <openssl/rand.h> |
Tim Rice | 2c961ce | 2002-09-23 16:54:10 -0700 | [diff] [blame] | 2172 | int main(void) { exit(RAND_status() == 1 ? 0 : 1); } |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2173 | ]])], |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2174 | [ |
| 2175 | OPENSSL_SEEDS_ITSELF=yes |
| 2176 | AC_MSG_RESULT(yes) |
| 2177 | ], |
| 2178 | [ |
| 2179 | AC_MSG_RESULT(no) |
| 2180 | # Default to use of the rand helper if OpenSSL doesn't |
| 2181 | # seed itself |
| 2182 | USE_RAND_HELPER=yes |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2183 | ], |
| 2184 | [ |
| 2185 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 2186 | # This is safe, since all recent OpenSSL versions will |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2187 | # complain at runtime if not seeded correctly. |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2188 | OPENSSL_SEEDS_ITSELF=yes |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2189 | ] |
| 2190 | ) |
| 2191 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2192 | # Check for PAM libs |
| 2193 | PAM_MSG="no" |
| 2194 | AC_ARG_WITH(pam, |
| 2195 | [ --with-pam Enable PAM support ], |
| 2196 | [ |
| 2197 | if test "x$withval" != "xno" ; then |
| 2198 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 2199 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 2200 | AC_MSG_ERROR([PAM headers not found]) |
| 2201 | fi |
| 2202 | |
| 2203 | saved_LIBS="$LIBS" |
| 2204 | AC_CHECK_LIB(dl, dlopen, , ) |
| 2205 | AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing])) |
| 2206 | AC_CHECK_FUNCS(pam_getenvlist) |
| 2207 | AC_CHECK_FUNCS(pam_putenv) |
| 2208 | LIBS="$saved_LIBS" |
| 2209 | |
| 2210 | PAM_MSG="yes" |
| 2211 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 2212 | SSHDLIBS="$SSHDLIBS -lpam" |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2213 | AC_DEFINE(USE_PAM, 1, |
| 2214 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2215 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2216 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2217 | case "$LIBS" in |
| 2218 | *-ldl*) |
| 2219 | # libdl already in LIBS |
| 2220 | ;; |
| 2221 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 2222 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 2223 | ;; |
| 2224 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2225 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 2226 | fi |
| 2227 | ] |
| 2228 | ) |
| 2229 | |
| 2230 | # Check for older PAM |
| 2231 | if test "x$PAM_MSG" = "xyes" ; then |
| 2232 | # Check PAM strerror arguments (old PAM) |
| 2233 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 2234 | AC_TRY_COMPILE( |
| 2235 | [ |
| 2236 | #include <stdlib.h> |
| 2237 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 2238 | #include <security/pam_appl.h> |
| 2239 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 2240 | #include <pam/pam_appl.h> |
| 2241 | #endif |
| 2242 | ], |
| 2243 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 2244 | [AC_MSG_RESULT(no)], |
| 2245 | [ |
| 2246 | AC_DEFINE(HAVE_OLD_PAM, 1, |
| 2247 | [Define if you have an old version of PAM |
| 2248 | which takes only one argument to pam_strerror]) |
| 2249 | AC_MSG_RESULT(yes) |
| 2250 | PAM_MSG="yes (old library)" |
| 2251 | ] |
| 2252 | ) |
| 2253 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2254 | |
| 2255 | # Do we want to force the use of the rand helper? |
| 2256 | AC_ARG_WITH(rand-helper, |
| 2257 | [ --with-rand-helper Use subprocess to gather strong randomness ], |
| 2258 | [ |
| 2259 | if test "x$withval" = "xno" ; then |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2260 | # Force use of OpenSSL's internal RNG, even if |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2261 | # the previous test showed it to be unseeded. |
| 2262 | if test -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 2263 | AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG]) |
| 2264 | OPENSSL_SEEDS_ITSELF=yes |
| 2265 | USE_RAND_HELPER="" |
| 2266 | fi |
| 2267 | else |
| 2268 | USE_RAND_HELPER=yes |
| 2269 | fi |
| 2270 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2271 | ) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2272 | |
| 2273 | # Which randomness source do we use? |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2274 | if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2275 | # OpenSSL only |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2276 | AC_DEFINE(OPENSSL_PRNG_ONLY, 1, |
| 2277 | [Define if you want OpenSSL's internally seeded PRNG only]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2278 | RAND_MSG="OpenSSL internal ONLY" |
| 2279 | INSTALL_SSH_RAND_HELPER="" |
Tim Rice | 1e2c600 | 2002-01-30 22:14:03 -0800 | [diff] [blame] | 2280 | elif test ! -z "$USE_RAND_HELPER" ; then |
| 2281 | # install rand helper |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2282 | RAND_MSG="ssh-rand-helper" |
| 2283 | INSTALL_SSH_RAND_HELPER="yes" |
| 2284 | fi |
| 2285 | AC_SUBST(INSTALL_SSH_RAND_HELPER) |
| 2286 | |
| 2287 | ### Configuration of ssh-rand-helper |
| 2288 | |
| 2289 | # PRNGD TCP socket |
| 2290 | AC_ARG_WITH(prngd-port, |
| 2291 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 2292 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 2293 | case "$withval" in |
| 2294 | no) |
| 2295 | withval="" |
| 2296 | ;; |
| 2297 | [[0-9]]*) |
| 2298 | ;; |
| 2299 | *) |
| 2300 | AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port) |
| 2301 | ;; |
| 2302 | esac |
| 2303 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2304 | PRNGD_PORT="$withval" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2305 | AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT, |
| 2306 | [Port number of PRNGD/EGD random number socket]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2307 | fi |
| 2308 | ] |
| 2309 | ) |
| 2310 | |
| 2311 | # PRNGD Unix domain socket |
| 2312 | AC_ARG_WITH(prngd-socket, |
| 2313 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 2314 | [ |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 2315 | case "$withval" in |
| 2316 | yes) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2317 | withval="/var/run/egd-pool" |
Damien Miller | e996d72 | 2002-01-23 11:20:59 +1100 | [diff] [blame] | 2318 | ;; |
| 2319 | no) |
| 2320 | withval="" |
| 2321 | ;; |
| 2322 | /*) |
| 2323 | ;; |
| 2324 | *) |
| 2325 | AC_MSG_ERROR(You must specify an absolute path to the entropy socket) |
| 2326 | ;; |
| 2327 | esac |
| 2328 | |
| 2329 | if test ! -z "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2330 | if test ! -z "$PRNGD_PORT" ; then |
| 2331 | AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket) |
| 2332 | fi |
Damien Miller | 6385ba0 | 2002-01-23 08:12:36 +1100 | [diff] [blame] | 2333 | if test ! -r "$withval" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2334 | AC_MSG_WARN(Entropy socket is not readable) |
| 2335 | fi |
| 2336 | PRNGD_SOCKET="$withval" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2337 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", |
| 2338 | [Location of PRNGD/EGD random number socket]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2339 | fi |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2340 | ], |
| 2341 | [ |
| 2342 | # Check for existing socket only if we don't have a random device already |
| 2343 | if test "$USE_RAND_HELPER" = yes ; then |
| 2344 | AC_MSG_CHECKING(for PRNGD/EGD socket) |
| 2345 | # Insert other locations here |
| 2346 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 2347 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 2348 | PRNGD_SOCKET="$sock" |
| 2349 | AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") |
| 2350 | break; |
| 2351 | fi |
| 2352 | done |
| 2353 | if test ! -z "$PRNGD_SOCKET" ; then |
| 2354 | AC_MSG_RESULT($PRNGD_SOCKET) |
| 2355 | else |
| 2356 | AC_MSG_RESULT(not found) |
| 2357 | fi |
| 2358 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2359 | ] |
| 2360 | ) |
| 2361 | |
| 2362 | # Change default command timeout for hashing entropy source |
| 2363 | entropy_timeout=200 |
| 2364 | AC_ARG_WITH(entropy-timeout, |
| 2365 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 2366 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 2367 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 2368 | test "x${withval}" != "xyes"; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2369 | entropy_timeout=$withval |
| 2370 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2371 | ] |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2372 | ) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2373 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout, |
| 2374 | [Builtin PRNG command timeout]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2375 | |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 2376 | SSH_PRIVSEP_USER=sshd |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2377 | AC_ARG_WITH(privsep-user, |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 2378 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2379 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 2380 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 2381 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 2382 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2383 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 2384 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2385 | ) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2386 | AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER", |
| 2387 | [non-privileged user for privilege separation]) |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 2388 | AC_SUBST(SSH_PRIVSEP_USER) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 2389 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 2390 | # We do this little dance with the search path to insure |
| 2391 | # that programs that we select for use by installed programs |
| 2392 | # (which may be run by the super-user) come from trusted |
| 2393 | # locations before they come from the user's private area. |
| 2394 | # This should help avoid accidentally configuring some |
| 2395 | # random version of a program in someone's personal bin. |
| 2396 | |
| 2397 | OPATH=$PATH |
| 2398 | PATH=/bin:/usr/bin |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 2399 | test -h /bin 2> /dev/null && PATH=/usr/bin |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 2400 | test -d /sbin && PATH=$PATH:/sbin |
| 2401 | test -d /usr/sbin && PATH=$PATH:/usr/sbin |
| 2402 | PATH=$PATH:/etc:$OPATH |
| 2403 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2404 | # These programs are used by the command hashing source to gather entropy |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2405 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 2406 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 2407 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 2408 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 2409 | OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat) |
| 2410 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 2411 | OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar) |
| 2412 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 2413 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 2414 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 2415 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 2416 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 2417 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 2418 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 2419 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 2420 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 2421 | # restore PATH |
| 2422 | PATH=$OPATH |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2423 | |
| 2424 | # Where does ssh-rand-helper get its randomness from? |
| 2425 | INSTALL_SSH_PRNG_CMDS="" |
| 2426 | if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then |
| 2427 | if test ! -z "$PRNGD_PORT" ; then |
| 2428 | RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT" |
| 2429 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 2430 | RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\"" |
| 2431 | else |
| 2432 | RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)" |
| 2433 | RAND_HELPER_CMDHASH=yes |
| 2434 | INSTALL_SSH_PRNG_CMDS="yes" |
| 2435 | fi |
| 2436 | fi |
| 2437 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 2438 | |
| 2439 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 2440 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 2441 | if test ! -z "$SONY" ; then |
| 2442 | LIBS="$LIBS -liberty"; |
| 2443 | fi |
| 2444 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2445 | # Check for long long datatypes |
| 2446 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 2447 | |
| 2448 | # Check datatype sizes |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 2449 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 2450 | AC_CHECK_SIZEOF(short int, 2) |
| 2451 | AC_CHECK_SIZEOF(int, 4) |
| 2452 | AC_CHECK_SIZEOF(long int, 4) |
| 2453 | AC_CHECK_SIZEOF(long long int, 8) |
| 2454 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 2455 | # Sanity check long long for some platforms (AIX) |
| 2456 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 2457 | ac_cv_sizeof_long_long_int=0 |
| 2458 | fi |
| 2459 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2460 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 2461 | if test -z "$have_llong_max"; then |
| 2462 | AC_MSG_CHECKING([for max value of long long]) |
| 2463 | AC_RUN_IFELSE( |
| 2464 | [AC_LANG_SOURCE([[ |
| 2465 | #include <stdio.h> |
| 2466 | /* Why is this so damn hard? */ |
| 2467 | #ifdef __GNUC__ |
| 2468 | # undef __GNUC__ |
| 2469 | #endif |
| 2470 | #define __USE_ISOC99 |
| 2471 | #include <limits.h> |
| 2472 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2473 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 2474 | |
| 2475 | /* |
| 2476 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 2477 | * we do this the hard way. |
| 2478 | */ |
| 2479 | static int |
| 2480 | fprint_ll(FILE *f, long long n) |
| 2481 | { |
| 2482 | unsigned int i; |
| 2483 | int l[sizeof(long long) * 8]; |
| 2484 | |
| 2485 | if (n < 0) |
| 2486 | if (fprintf(f, "-") < 0) |
| 2487 | return -1; |
| 2488 | for (i = 0; n != 0; i++) { |
| 2489 | l[i] = my_abs(n % 10); |
| 2490 | n /= 10; |
| 2491 | } |
| 2492 | do { |
| 2493 | if (fprintf(f, "%d", l[--i]) < 0) |
| 2494 | return -1; |
| 2495 | } while (i != 0); |
| 2496 | if (fprintf(f, " ") < 0) |
| 2497 | return -1; |
| 2498 | return 0; |
| 2499 | } |
| 2500 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2501 | int main(void) { |
| 2502 | FILE *f; |
| 2503 | long long i, llmin, llmax = 0; |
| 2504 | |
| 2505 | if((f = fopen(DATA,"w")) == NULL) |
| 2506 | exit(1); |
| 2507 | |
| 2508 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 2509 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 2510 | llmin = LLONG_MIN; |
| 2511 | llmax = LLONG_MAX; |
| 2512 | #else |
| 2513 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 2514 | /* This will work on one's complement and two's complement */ |
| 2515 | for (i = 1; i > llmax; i <<= 1, i++) |
| 2516 | llmax = i; |
| 2517 | llmin = llmax + 1LL; /* wrap */ |
| 2518 | #endif |
| 2519 | |
| 2520 | /* Sanity check */ |
| 2521 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2522 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 2523 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2524 | fprintf(f, "unknown unknown\n"); |
| 2525 | exit(2); |
| 2526 | } |
| 2527 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2528 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2529 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 2530 | if (fprint_ll(f, llmax) < 0) |
| 2531 | exit(4); |
| 2532 | if (fclose(f) < 0) |
| 2533 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2534 | exit(0); |
| 2535 | } |
| 2536 | ]])], |
| 2537 | [ |
| 2538 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 2539 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 2540 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 2541 | AC_MSG_RESULT($llong_max) |
| 2542 | AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL], |
| 2543 | [max value of long long calculated by configure]) |
| 2544 | AC_MSG_CHECKING([for min value of long long]) |
| 2545 | AC_MSG_RESULT($llong_min) |
| 2546 | AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL], |
| 2547 | [min value of long long calculated by configure]) |
| 2548 | ], |
| 2549 | [ |
| 2550 | AC_MSG_RESULT(not found) |
| 2551 | ], |
| 2552 | [ |
| 2553 | AC_MSG_WARN([cross compiling: not checking]) |
| 2554 | ] |
| 2555 | ) |
| 2556 | fi |
| 2557 | |
| 2558 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2559 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 2560 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
| 2561 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2562 | [ #include <sys/types.h> ], |
| 2563 | [ u_int a; a = 1;], |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 2564 | [ ac_cv_have_u_int="yes" ], |
| 2565 | [ ac_cv_have_u_int="no" ] |
| 2566 | ) |
| 2567 | ]) |
| 2568 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2569 | AC_DEFINE(HAVE_U_INT, 1, [define if you have u_int data type]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 2570 | have_u_int=1 |
| 2571 | fi |
| 2572 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2573 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 2574 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2575 | [ #include <sys/types.h> ], |
| 2576 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2577 | [ ac_cv_have_intxx_t="yes" ], |
| 2578 | [ ac_cv_have_intxx_t="no" ] |
| 2579 | ) |
| 2580 | ]) |
| 2581 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2582 | AC_DEFINE(HAVE_INTXX_T, 1, [define if you have intxx_t data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2583 | have_intxx_t=1 |
| 2584 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2585 | |
| 2586 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2587 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2588 | then |
| 2589 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
| 2590 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2591 | [ #include <stdint.h> ], |
| 2592 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2593 | [ |
| 2594 | AC_DEFINE(HAVE_INTXX_T) |
| 2595 | AC_MSG_RESULT(yes) |
| 2596 | ], |
| 2597 | [ AC_MSG_RESULT(no) ] |
| 2598 | ) |
| 2599 | fi |
| 2600 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2601 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
| 2602 | AC_TRY_COMPILE( |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 2603 | [ |
| 2604 | #include <sys/types.h> |
| 2605 | #ifdef HAVE_STDINT_H |
| 2606 | # include <stdint.h> |
| 2607 | #endif |
| 2608 | #include <sys/socket.h> |
| 2609 | #ifdef HAVE_SYS_BITYPES_H |
| 2610 | # include <sys/bitypes.h> |
| 2611 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2612 | ], |
| 2613 | [ int64_t a; a = 1;], |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2614 | [ ac_cv_have_int64_t="yes" ], |
| 2615 | [ ac_cv_have_int64_t="no" ] |
| 2616 | ) |
| 2617 | ]) |
| 2618 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2619 | AC_DEFINE(HAVE_INT64_T, 1, [define if you have int64_t data type]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2620 | fi |
| 2621 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2622 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 2623 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2624 | [ #include <sys/types.h> ], |
| 2625 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2626 | [ ac_cv_have_u_intxx_t="yes" ], |
| 2627 | [ ac_cv_have_u_intxx_t="no" ] |
| 2628 | ) |
| 2629 | ]) |
| 2630 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2631 | AC_DEFINE(HAVE_U_INTXX_T, 1, [define if you have u_intxx_t data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2632 | have_u_intxx_t=1 |
| 2633 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 2634 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2635 | if test -z "$have_u_intxx_t" ; then |
| 2636 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
| 2637 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2638 | [ #include <sys/socket.h> ], |
| 2639 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2640 | [ |
| 2641 | AC_DEFINE(HAVE_U_INTXX_T) |
| 2642 | AC_MSG_RESULT(yes) |
| 2643 | ], |
| 2644 | [ AC_MSG_RESULT(no) ] |
| 2645 | ) |
| 2646 | fi |
| 2647 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2648 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
| 2649 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2650 | [ #include <sys/types.h> ], |
| 2651 | [ u_int64_t a; a = 1;], |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2652 | [ ac_cv_have_u_int64_t="yes" ], |
| 2653 | [ ac_cv_have_u_int64_t="no" ] |
| 2654 | ) |
| 2655 | ]) |
| 2656 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2657 | AC_DEFINE(HAVE_U_INT64_T, 1, [define if you have u_int64_t data type]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 2658 | have_u_int64_t=1 |
| 2659 | fi |
| 2660 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2661 | if test -z "$have_u_int64_t" ; then |
| 2662 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
| 2663 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2664 | [ #include <sys/bitypes.h> ], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2665 | [ u_int64_t a; a = 1], |
| 2666 | [ |
| 2667 | AC_DEFINE(HAVE_U_INT64_T) |
| 2668 | AC_MSG_RESULT(yes) |
| 2669 | ], |
| 2670 | [ AC_MSG_RESULT(no) ] |
| 2671 | ) |
| 2672 | fi |
| 2673 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2674 | if test -z "$have_u_intxx_t" ; then |
| 2675 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 2676 | AC_TRY_COMPILE( |
| 2677 | [ |
| 2678 | #include <sys/types.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2679 | ], |
| 2680 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2681 | [ ac_cv_have_uintxx_t="yes" ], |
| 2682 | [ ac_cv_have_uintxx_t="no" ] |
| 2683 | ) |
| 2684 | ]) |
| 2685 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2686 | AC_DEFINE(HAVE_UINTXX_T, 1, |
| 2687 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2688 | fi |
| 2689 | fi |
| 2690 | |
| 2691 | if test -z "$have_uintxx_t" ; then |
| 2692 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
| 2693 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2694 | [ #include <stdint.h> ], |
| 2695 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;], |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 2696 | [ |
| 2697 | AC_DEFINE(HAVE_UINTXX_T) |
| 2698 | AC_MSG_RESULT(yes) |
| 2699 | ], |
| 2700 | [ AC_MSG_RESULT(no) ] |
| 2701 | ) |
| 2702 | fi |
| 2703 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 2704 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2705 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2706 | then |
| 2707 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 2708 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2709 | [ |
| 2710 | #include <sys/bitypes.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2711 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2712 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 2713 | int8_t a; int16_t b; int32_t c; |
| 2714 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 2715 | a = b = c = e = f = g = 1; |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2716 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2717 | [ |
| 2718 | AC_DEFINE(HAVE_U_INTXX_T) |
| 2719 | AC_DEFINE(HAVE_INTXX_T) |
| 2720 | AC_MSG_RESULT(yes) |
| 2721 | ], |
| 2722 | [AC_MSG_RESULT(no)] |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2723 | ) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 2724 | fi |
| 2725 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 2726 | |
| 2727 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
| 2728 | AC_TRY_COMPILE( |
| 2729 | [ |
| 2730 | #include <sys/types.h> |
| 2731 | ], |
| 2732 | [ u_char foo; foo = 125; ], |
| 2733 | [ ac_cv_have_u_char="yes" ], |
| 2734 | [ ac_cv_have_u_char="no" ] |
| 2735 | ) |
| 2736 | ]) |
| 2737 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2738 | AC_DEFINE(HAVE_U_CHAR, 1, [define if you have u_char data type]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 2739 | fi |
| 2740 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 2741 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 2742 | |
Tim Rice | 200a5c0 | 2002-02-26 22:12:34 -0800 | [diff] [blame] | 2743 | AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 2744 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t],,,[ |
| 2745 | #include <sys/types.h> |
| 2746 | #ifdef HAVE_SYS_BITYPES_H |
| 2747 | #include <sys/bitypes.h> |
| 2748 | #endif |
| 2749 | #ifdef HAVE_SYS_STATFS_H |
| 2750 | #include <sys/statfs.h> |
| 2751 | #endif |
| 2752 | #ifdef HAVE_SYS_STATVFS_H |
| 2753 | #include <sys/statvfs.h> |
| 2754 | #endif |
| 2755 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 2756 | |
Darren Tucker | 30ed668 | 2009-03-07 18:06:22 +1100 | [diff] [blame] | 2757 | AC_CHECK_TYPES([in_addr_t, in_port_t],,, |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 2758 | [#include <sys/types.h> |
| 2759 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 2760 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2761 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 2762 | AC_TRY_COMPILE( |
| 2763 | [ |
| 2764 | #include <sys/types.h> |
| 2765 | ], |
| 2766 | [ size_t foo; foo = 1235; ], |
| 2767 | [ ac_cv_have_size_t="yes" ], |
| 2768 | [ ac_cv_have_size_t="no" ] |
| 2769 | ) |
| 2770 | ]) |
| 2771 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2772 | AC_DEFINE(HAVE_SIZE_T, 1, [define if you have size_t data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2773 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 2774 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 2775 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 2776 | AC_TRY_COMPILE( |
| 2777 | [ |
| 2778 | #include <sys/types.h> |
| 2779 | ], |
| 2780 | [ ssize_t foo; foo = 1235; ], |
| 2781 | [ ac_cv_have_ssize_t="yes" ], |
| 2782 | [ ac_cv_have_ssize_t="no" ] |
| 2783 | ) |
| 2784 | ]) |
| 2785 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2786 | AC_DEFINE(HAVE_SSIZE_T, 1, [define if you have ssize_t data type]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 2787 | fi |
| 2788 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 2789 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
| 2790 | AC_TRY_COMPILE( |
| 2791 | [ |
| 2792 | #include <time.h> |
| 2793 | ], |
| 2794 | [ clock_t foo; foo = 1235; ], |
| 2795 | [ ac_cv_have_clock_t="yes" ], |
| 2796 | [ ac_cv_have_clock_t="no" ] |
| 2797 | ) |
| 2798 | ]) |
| 2799 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2800 | AC_DEFINE(HAVE_CLOCK_T, 1, [define if you have clock_t data type]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 2801 | fi |
| 2802 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 2803 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 2804 | AC_TRY_COMPILE( |
| 2805 | [ |
| 2806 | #include <sys/types.h> |
| 2807 | #include <sys/socket.h> |
| 2808 | ], |
| 2809 | [ sa_family_t foo; foo = 1235; ], |
| 2810 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2811 | [ AC_TRY_COMPILE( |
| 2812 | [ |
| 2813 | #include <sys/types.h> |
| 2814 | #include <sys/socket.h> |
| 2815 | #include <netinet/in.h> |
| 2816 | ], |
| 2817 | [ sa_family_t foo; foo = 1235; ], |
| 2818 | [ ac_cv_have_sa_family_t="yes" ], |
| 2819 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 2820 | [ ac_cv_have_sa_family_t="no" ] |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2821 | )] |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 2822 | ) |
| 2823 | ]) |
| 2824 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2825 | AC_DEFINE(HAVE_SA_FAMILY_T, 1, |
| 2826 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 2827 | fi |
| 2828 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 2829 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 2830 | AC_TRY_COMPILE( |
| 2831 | [ |
| 2832 | #include <sys/types.h> |
| 2833 | ], |
| 2834 | [ pid_t foo; foo = 1235; ], |
| 2835 | [ ac_cv_have_pid_t="yes" ], |
| 2836 | [ ac_cv_have_pid_t="no" ] |
| 2837 | ) |
| 2838 | ]) |
| 2839 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2840 | AC_DEFINE(HAVE_PID_T, 1, [define if you have pid_t data type]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 2841 | fi |
| 2842 | |
| 2843 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 2844 | AC_TRY_COMPILE( |
| 2845 | [ |
| 2846 | #include <sys/types.h> |
| 2847 | ], |
| 2848 | [ mode_t foo; foo = 1235; ], |
| 2849 | [ ac_cv_have_mode_t="yes" ], |
| 2850 | [ ac_cv_have_mode_t="no" ] |
| 2851 | ) |
| 2852 | ]) |
| 2853 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2854 | AC_DEFINE(HAVE_MODE_T, 1, [define if you have mode_t data type]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 2855 | fi |
| 2856 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2857 | |
| 2858 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 2859 | AC_TRY_COMPILE( |
| 2860 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 2861 | #include <sys/types.h> |
| 2862 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2863 | ], |
| 2864 | [ struct sockaddr_storage s; ], |
| 2865 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 2866 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 2867 | ) |
| 2868 | ]) |
| 2869 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2870 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, |
| 2871 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2872 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 2873 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2874 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 2875 | AC_TRY_COMPILE( |
| 2876 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2877 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2878 | #include <netinet/in.h> |
| 2879 | ], |
| 2880 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 2881 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 2882 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 2883 | ) |
| 2884 | ]) |
| 2885 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2886 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, |
| 2887 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2888 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 2889 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2890 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 2891 | AC_TRY_COMPILE( |
| 2892 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 2893 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2894 | #include <netinet/in.h> |
| 2895 | ], |
| 2896 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 2897 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 2898 | [ ac_cv_have_struct_in6_addr="no" ] |
| 2899 | ) |
| 2900 | ]) |
| 2901 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2902 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, |
| 2903 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 2904 | |
| 2905 | dnl Now check for sin6_scope_id |
| 2906 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, |
| 2907 | [ |
| 2908 | #ifdef HAVE_SYS_TYPES_H |
| 2909 | #include <sys/types.h> |
| 2910 | #endif |
| 2911 | #include <netinet/in.h> |
| 2912 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2913 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 2914 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2915 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 2916 | AC_TRY_COMPILE( |
| 2917 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 2918 | #include <sys/types.h> |
| 2919 | #include <sys/socket.h> |
| 2920 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2921 | ], |
| 2922 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 2923 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 2924 | [ ac_cv_have_struct_addrinfo="no" ] |
| 2925 | ) |
| 2926 | ]) |
| 2927 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2928 | AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, |
| 2929 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2930 | fi |
| 2931 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 2932 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
| 2933 | AC_TRY_COMPILE( |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2934 | [ #include <sys/time.h> ], |
| 2935 | [ struct timeval tv; tv.tv_sec = 1;], |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 2936 | [ ac_cv_have_struct_timeval="yes" ], |
| 2937 | [ ac_cv_have_struct_timeval="no" ] |
| 2938 | ) |
| 2939 | ]) |
| 2940 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2941 | AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 2942 | have_struct_timeval=1 |
| 2943 | fi |
| 2944 | |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 2945 | AC_CHECK_TYPES(struct timespec) |
| 2946 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 2947 | # We need int64_t or else certian parts of the compile will fail. |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2948 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 2949 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 2950 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 2951 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 2952 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 2953 | echo "" |
| 2954 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2955 | else |
| 2956 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2957 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2958 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2959 | #include <stdio.h> |
| 2960 | #include <string.h> |
| 2961 | #ifdef HAVE_SNPRINTF |
| 2962 | main() |
| 2963 | { |
| 2964 | char buf[50]; |
| 2965 | char expected_out[50]; |
| 2966 | int mazsize = 50 ; |
| 2967 | #if (SIZEOF_LONG_INT == 8) |
| 2968 | long int num = 0x7fffffffffffffff; |
| 2969 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 2970 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2971 | #endif |
| 2972 | strcpy(expected_out, "9223372036854775807"); |
| 2973 | snprintf(buf, mazsize, "%lld", num); |
| 2974 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2975 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2976 | exit(0); |
| 2977 | } |
| 2978 | #else |
| 2979 | main() { exit(0); } |
| 2980 | #endif |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2981 | ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2982 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 2983 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 2984 | fi |
| 2985 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 2986 | dnl Checks for structure members |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2987 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 2988 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 2989 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 2990 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 2991 | OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP) |
Damien Miller | ad1bc5f | 2000-05-20 14:53:09 +1000 | [diff] [blame] | 2992 | OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2993 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 2994 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP) |
Damien Miller | 8e81ed3 | 2000-07-01 13:17:42 +1000 | [diff] [blame] | 2995 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 2996 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 2997 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 2998 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 2999 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3000 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 3001 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 3002 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 3003 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3004 | |
| 3005 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3006 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE(__res_state, state, |
| 3007 | [Define if we don't have struct __res_state in resolv.h])], |
| 3008 | [ |
| 3009 | #include <stdio.h> |
| 3010 | #if HAVE_SYS_TYPES_H |
| 3011 | # include <sys/types.h> |
| 3012 | #endif |
| 3013 | #include <netinet/in.h> |
| 3014 | #include <arpa/nameser.h> |
| 3015 | #include <resolv.h> |
| 3016 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3017 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3018 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 3019 | ac_cv_have_ss_family_in_struct_ss, [ |
| 3020 | AC_TRY_COMPILE( |
| 3021 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3022 | #include <sys/types.h> |
| 3023 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3024 | ], |
| 3025 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 3026 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 3027 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 3028 | ) |
| 3029 | ]) |
| 3030 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3031 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3032 | fi |
| 3033 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3034 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 3035 | ac_cv_have___ss_family_in_struct_ss, [ |
| 3036 | AC_TRY_COMPILE( |
| 3037 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3038 | #include <sys/types.h> |
| 3039 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3040 | ], |
| 3041 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 3042 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 3043 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 3044 | ) |
| 3045 | ]) |
| 3046 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3047 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, |
| 3048 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3049 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 3050 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 3051 | AC_CACHE_CHECK([for pw_class field in struct passwd], |
| 3052 | ac_cv_have_pw_class_in_struct_passwd, [ |
| 3053 | AC_TRY_COMPILE( |
| 3054 | [ |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 3055 | #include <pwd.h> |
| 3056 | ], |
Kevin Steves | 48b7cc0 | 2000-10-07 13:24:00 +0000 | [diff] [blame] | 3057 | [ struct passwd p; p.pw_class = 0; ], |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 3058 | [ ac_cv_have_pw_class_in_struct_passwd="yes" ], |
| 3059 | [ ac_cv_have_pw_class_in_struct_passwd="no" ] |
| 3060 | ) |
| 3061 | ]) |
| 3062 | if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3063 | AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD, 1, |
| 3064 | [Define if your password has a pw_class field]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 3065 | fi |
| 3066 | |
Kevin Steves | 8245695 | 2001-06-22 21:14:18 +0000 | [diff] [blame] | 3067 | AC_CACHE_CHECK([for pw_expire field in struct passwd], |
| 3068 | ac_cv_have_pw_expire_in_struct_passwd, [ |
| 3069 | AC_TRY_COMPILE( |
| 3070 | [ |
| 3071 | #include <pwd.h> |
| 3072 | ], |
| 3073 | [ struct passwd p; p.pw_expire = 0; ], |
| 3074 | [ ac_cv_have_pw_expire_in_struct_passwd="yes" ], |
| 3075 | [ ac_cv_have_pw_expire_in_struct_passwd="no" ] |
| 3076 | ) |
| 3077 | ]) |
| 3078 | if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3079 | AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD, 1, |
| 3080 | [Define if your password has a pw_expire field]) |
Kevin Steves | 8245695 | 2001-06-22 21:14:18 +0000 | [diff] [blame] | 3081 | fi |
| 3082 | |
| 3083 | AC_CACHE_CHECK([for pw_change field in struct passwd], |
| 3084 | ac_cv_have_pw_change_in_struct_passwd, [ |
| 3085 | AC_TRY_COMPILE( |
| 3086 | [ |
| 3087 | #include <pwd.h> |
| 3088 | ], |
| 3089 | [ struct passwd p; p.pw_change = 0; ], |
| 3090 | [ ac_cv_have_pw_change_in_struct_passwd="yes" ], |
| 3091 | [ ac_cv_have_pw_change_in_struct_passwd="no" ] |
| 3092 | ) |
| 3093 | ]) |
| 3094 | if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3095 | AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD, 1, |
| 3096 | [Define if your password has a pw_change field]) |
Kevin Steves | 8245695 | 2001-06-22 21:14:18 +0000 | [diff] [blame] | 3097 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3098 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3099 | dnl make sure we're using the real structure members and not defines |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3100 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 3101 | ac_cv_have_accrights_in_msghdr, [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3102 | AC_COMPILE_IFELSE( |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3103 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3104 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3105 | #include <sys/socket.h> |
| 3106 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3107 | int main() { |
| 3108 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3109 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3110 | exit(1); |
| 3111 | #endif |
| 3112 | struct msghdr m; |
| 3113 | m.msg_accrights = 0; |
| 3114 | exit(0); |
| 3115 | } |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3116 | ], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3117 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 3118 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 3119 | ) |
| 3120 | ]) |
| 3121 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3122 | AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR, 1, |
| 3123 | [Define if your system uses access rights style |
| 3124 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3125 | fi |
| 3126 | |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3127 | AC_MSG_CHECKING(if struct statvfs.f_fsid is integral type) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3128 | AC_TRY_COMPILE([ |
| 3129 | #include <sys/types.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3130 | #include <sys/stat.h> |
| 3131 | #ifdef HAVE_SYS_TIME_H |
| 3132 | # include <sys/time.h> |
| 3133 | #endif |
| 3134 | #ifdef HAVE_SYS_MOUNT_H |
| 3135 | #include <sys/mount.h> |
| 3136 | #endif |
| 3137 | #ifdef HAVE_SYS_STATVFS_H |
| 3138 | #include <sys/statvfs.h> |
| 3139 | #endif |
| 3140 | ], [struct statvfs s; s.f_fsid = 0;], |
| 3141 | [ AC_MSG_RESULT(yes) ], |
| 3142 | [ AC_MSG_RESULT(no) |
| 3143 | |
| 3144 | AC_MSG_CHECKING(if fsid_t has member val) |
| 3145 | AC_TRY_COMPILE([ |
| 3146 | #include <sys/types.h> |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3147 | #include <sys/statvfs.h>], |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3148 | [fsid_t t; t.val[0] = 0;], |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3149 | [ AC_MSG_RESULT(yes) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3150 | AC_DEFINE(FSID_HAS_VAL, 1, fsid_t has member val) ], |
| 3151 | [ AC_MSG_RESULT(no) ]) |
| 3152 | |
| 3153 | AC_MSG_CHECKING(if f_fsid has member __val) |
| 3154 | AC_TRY_COMPILE([ |
| 3155 | #include <sys/types.h> |
| 3156 | #include <sys/statvfs.h>], |
| 3157 | [fsid_t t; t.__val[0] = 0;], |
| 3158 | [ AC_MSG_RESULT(yes) |
| 3159 | AC_DEFINE(FSID_HAS___VAL, 1, fsid_t has member __val) ], |
| 3160 | [ AC_MSG_RESULT(no) ]) |
| 3161 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3162 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3163 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 3164 | ac_cv_have_control_in_msghdr, [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3165 | AC_COMPILE_IFELSE( |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3166 | [ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3167 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3168 | #include <sys/socket.h> |
| 3169 | #include <sys/uio.h> |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3170 | int main() { |
| 3171 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3172 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3173 | exit(1); |
| 3174 | #endif |
| 3175 | struct msghdr m; |
| 3176 | m.msg_control = 0; |
| 3177 | exit(0); |
| 3178 | } |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3179 | ], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3180 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 3181 | [ ac_cv_have_control_in_msghdr="no" ] |
| 3182 | ) |
| 3183 | ]) |
| 3184 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3185 | AC_DEFINE(HAVE_CONTROL_IN_MSGHDR, 1, |
| 3186 | [Define if your system uses ancillary data style |
| 3187 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3188 | fi |
| 3189 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3190 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3191 | AC_TRY_LINK([], |
| 3192 | [ extern char *__progname; printf("%s", __progname); ], |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3193 | [ ac_cv_libc_defines___progname="yes" ], |
| 3194 | [ ac_cv_libc_defines___progname="no" ] |
| 3195 | ) |
| 3196 | ]) |
| 3197 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3198 | AC_DEFINE(HAVE___PROGNAME, 1, [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3199 | fi |
| 3200 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3201 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
| 3202 | AC_TRY_LINK([ |
| 3203 | #include <stdio.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3204 | ], |
| 3205 | [ printf("%s", __FUNCTION__); ], |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3206 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
| 3207 | [ ac_cv_cc_implements___FUNCTION__="no" ] |
| 3208 | ) |
| 3209 | ]) |
| 3210 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3211 | AC_DEFINE(HAVE___FUNCTION__, 1, |
| 3212 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3213 | fi |
| 3214 | |
| 3215 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
| 3216 | AC_TRY_LINK([ |
| 3217 | #include <stdio.h> |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3218 | ], |
| 3219 | [ printf("%s", __func__); ], |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3220 | [ ac_cv_cc_implements___func__="yes" ], |
| 3221 | [ ac_cv_cc_implements___func__="no" ] |
| 3222 | ) |
| 3223 | ]) |
| 3224 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3225 | AC_DEFINE(HAVE___func__, 1, [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3226 | fi |
| 3227 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3228 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
| 3229 | AC_TRY_LINK( |
| 3230 | [#include <stdarg.h> |
| 3231 | va_list x,y;], |
| 3232 | [va_copy(x,y);], |
| 3233 | [ ac_cv_have_va_copy="yes" ], |
| 3234 | [ ac_cv_have_va_copy="no" ] |
| 3235 | ) |
| 3236 | ]) |
| 3237 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
| 3238 | AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy exists]) |
| 3239 | fi |
| 3240 | |
| 3241 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
| 3242 | AC_TRY_LINK( |
| 3243 | [#include <stdarg.h> |
| 3244 | va_list x,y;], |
| 3245 | [__va_copy(x,y);], |
| 3246 | [ ac_cv_have___va_copy="yes" ], |
| 3247 | [ ac_cv_have___va_copy="no" ] |
| 3248 | ) |
| 3249 | ]) |
| 3250 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
| 3251 | AC_DEFINE(HAVE___VA_COPY, 1, [Define if __va_copy exists]) |
| 3252 | fi |
| 3253 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3254 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 3255 | ac_cv_have_getopt_optreset, [ |
| 3256 | AC_TRY_LINK( |
| 3257 | [ |
| 3258 | #include <getopt.h> |
| 3259 | ], |
| 3260 | [ extern int optreset; optreset = 0; ], |
| 3261 | [ ac_cv_have_getopt_optreset="yes" ], |
| 3262 | [ ac_cv_have_getopt_optreset="no" ] |
| 3263 | ) |
| 3264 | ]) |
| 3265 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3266 | AC_DEFINE(HAVE_GETOPT_OPTRESET, 1, |
| 3267 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 3268 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3269 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3270 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3271 | AC_TRY_LINK([], |
| 3272 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3273 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 3274 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 3275 | ) |
| 3276 | ]) |
| 3277 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3278 | AC_DEFINE(HAVE_SYS_ERRLIST, 1, |
| 3279 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 3280 | fi |
| 3281 | |
| 3282 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 3283 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3284 | AC_TRY_LINK([], |
| 3285 | [ extern int sys_nerr; printf("%i", sys_nerr);], |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 3286 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 3287 | [ ac_cv_libc_defines_sys_nerr="no" ] |
| 3288 | ) |
| 3289 | ]) |
| 3290 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3291 | AC_DEFINE(HAVE_SYS_NERR, 1, [Define if your system defines sys_nerr]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 3292 | fi |
| 3293 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3294 | # Check libraries needed by DNS fingerprint support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3295 | AC_SEARCH_LIBS(getrrsetbyname, resolv, |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3296 | [AC_DEFINE(HAVE_GETRRSETBYNAME, 1, |
| 3297 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 3298 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3299 | # Needed by our getrrsetbyname() |
| 3300 | AC_SEARCH_LIBS(res_query, resolv) |
| 3301 | AC_SEARCH_LIBS(dn_expand, resolv) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3302 | AC_MSG_CHECKING(if res_query will link) |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3303 | AC_LINK_IFELSE([ |
| 3304 | #include "confdefs.h" |
| 3305 | #include <sys/types.h> |
| 3306 | #include <netinet/in.h> |
| 3307 | #include <arpa/nameser.h> |
| 3308 | #include <netdb.h> |
| 3309 | #include <resolv.h> |
| 3310 | int main() |
| 3311 | { |
| 3312 | res_query (0, 0, 0, 0, 0); |
| 3313 | return 0; |
| 3314 | } |
| 3315 | ], |
| 3316 | AC_MSG_RESULT(yes), |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3317 | [AC_MSG_RESULT(no) |
| 3318 | saved_LIBS="$LIBS" |
| 3319 | LIBS="$LIBS -lresolv" |
| 3320 | AC_MSG_CHECKING(for res_query in -lresolv) |
| 3321 | AC_LINK_IFELSE([ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3322 | #include "confdefs.h" |
| 3323 | #include <sys/types.h> |
| 3324 | #include <netinet/in.h> |
| 3325 | #include <arpa/nameser.h> |
| 3326 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3327 | #include <resolv.h> |
| 3328 | int main() |
| 3329 | { |
| 3330 | res_query (0, 0, 0, 0, 0); |
| 3331 | return 0; |
| 3332 | } |
| 3333 | ], |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 3334 | [AC_MSG_RESULT(yes)], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 3335 | [LIBS="$saved_LIBS" |
| 3336 | AC_MSG_RESULT(no)]) |
| 3337 | ]) |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3338 | AC_CHECK_FUNCS(_getshort _getlong) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 3339 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 3340 | [#include <sys/types.h> |
| 3341 | #include <arpa/nameser.h>]) |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3342 | AC_CHECK_MEMBER(HEADER.ad, |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3343 | [AC_DEFINE(HAVE_HEADER_AD, 1, |
| 3344 | [Define if HEADER.ad exists in arpa/nameser.h])],, |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 3345 | [#include <arpa/nameser.h>]) |
| 3346 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 3347 | |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 3348 | AC_MSG_CHECKING(if struct __res_state _res is an extern) |
| 3349 | AC_LINK_IFELSE([ |
| 3350 | #include <stdio.h> |
| 3351 | #if HAVE_SYS_TYPES_H |
| 3352 | # include <sys/types.h> |
| 3353 | #endif |
| 3354 | #include <netinet/in.h> |
| 3355 | #include <arpa/nameser.h> |
| 3356 | #include <resolv.h> |
| 3357 | extern struct __res_state _res; |
| 3358 | int main() { return 0; } |
| 3359 | ], |
| 3360 | [AC_MSG_RESULT(yes) |
| 3361 | AC_DEFINE(HAVE__RES_EXTERN, 1, |
| 3362 | [Define if you have struct __res_state _res as an extern]) |
| 3363 | ], |
| 3364 | [ AC_MSG_RESULT(no) ] |
| 3365 | ) |
| 3366 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3367 | # Check whether user wants SELinux support |
| 3368 | SELINUX_MSG="no" |
| 3369 | LIBSELINUX="" |
| 3370 | AC_ARG_WITH(selinux, |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 3371 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3372 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3373 | save_LIBS="$LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3374 | AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.]) |
| 3375 | SELINUX_MSG="yes" |
| 3376 | AC_CHECK_HEADER([selinux/selinux.h], , |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 3377 | AC_MSG_ERROR(SELinux support requires selinux.h header)) |
| 3378 | AC_CHECK_LIB(selinux, setexeccon, |
| 3379 | [ LIBSELINUX="-lselinux" |
| 3380 | LIBS="$LIBS -lselinux" |
| 3381 | ], |
| 3382 | AC_MSG_ERROR(SELinux support requires libselinux library)) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3383 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3384 | AC_CHECK_FUNCS(getseuserbyname get_default_context_with_level) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 3385 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3386 | fi ] |
| 3387 | ) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 3388 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3389 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3390 | KRB5_MSG="no" |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3391 | AC_ARG_WITH(kerberos5, |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3392 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3393 | [ if test "x$withval" != "xno" ; then |
| 3394 | if test "x$withval" = "xyes" ; then |
| 3395 | KRB5ROOT="/usr/local" |
| 3396 | else |
| 3397 | KRB5ROOT=${withval} |
| 3398 | fi |
| 3399 | |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3400 | AC_DEFINE(KRB5, 1, [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3401 | KRB5_MSG="yes" |
| 3402 | |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 3403 | AC_PATH_PROG([KRB5CONF],[krb5-config], |
| 3404 | [$KRB5ROOT/bin/krb5-config], |
| 3405 | [$KRB5ROOT/bin:$PATH]) |
| 3406 | if test -x $KRB5CONF ; then |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3407 | |
| 3408 | AC_MSG_CHECKING(for gssapi support) |
| 3409 | if $KRB5CONF | grep gssapi >/dev/null ; then |
| 3410 | AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3411 | AC_DEFINE(GSSAPI, 1, |
| 3412 | [Define this if you want GSSAPI |
| 3413 | support in the version 2 protocol]) |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 3414 | k5confopts=gssapi |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3415 | else |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3416 | AC_MSG_RESULT(no) |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 3417 | k5confopts="" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3418 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 3419 | K5CFLAGS="`$KRB5CONF --cflags $k5confopts`" |
| 3420 | K5LIBS="`$KRB5CONF --libs $k5confopts`" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3421 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3422 | AC_MSG_CHECKING(whether we are using Heimdal) |
| 3423 | AC_TRY_COMPILE([ #include <krb5.h> ], |
| 3424 | [ char *tmp = heimdal_version; ], |
| 3425 | [ AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3426 | AC_DEFINE(HEIMDAL, 1, |
| 3427 | [Define this if you are using the |
| 3428 | Heimdal version of Kerberos V5]) ], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3429 | AC_MSG_RESULT(no) |
| 3430 | ) |
| 3431 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3432 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3433 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3434 | AC_MSG_CHECKING(whether we are using Heimdal) |
| 3435 | AC_TRY_COMPILE([ #include <krb5.h> ], |
| 3436 | [ char *tmp = heimdal_version; ], |
| 3437 | [ AC_MSG_RESULT(yes) |
| 3438 | AC_DEFINE(HEIMDAL) |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 3439 | K5LIBS="-lkrb5 -ldes" |
| 3440 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3441 | AC_CHECK_LIB(roken, net_write, |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 3442 | [K5LIBS="$K5LIBS -lroken"]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3443 | ], |
| 3444 | [ AC_MSG_RESULT(no) |
| 3445 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
| 3446 | ] |
| 3447 | ) |
Damien Miller | 200d0a7 | 2003-06-30 19:21:36 +1000 | [diff] [blame] | 3448 | AC_SEARCH_LIBS(dn_expand, resolv) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3449 | |
Darren Tucker | 30fd49e | 2008-06-14 09:14:46 +1000 | [diff] [blame] | 3450 | AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3451 | [ AC_DEFINE(GSSAPI) |
Darren Tucker | 30fd49e | 2008-06-14 09:14:46 +1000 | [diff] [blame] | 3452 | K5LIBS="-lgssapi_krb5 $K5LIBS" ], |
| 3453 | [ AC_CHECK_LIB(gssapi, gss_init_sec_context, |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3454 | [ AC_DEFINE(GSSAPI) |
Darren Tucker | 30fd49e | 2008-06-14 09:14:46 +1000 | [diff] [blame] | 3455 | K5LIBS="-lgssapi $K5LIBS" ], |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3456 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]), |
| 3457 | $K5LIBS) |
| 3458 | ], |
| 3459 | $K5LIBS) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3460 | |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3461 | AC_CHECK_HEADER(gssapi.h, , |
| 3462 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3463 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3464 | AC_CHECK_HEADERS(gssapi.h, , |
| 3465 | AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3466 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 3467 | ] |
| 3468 | ) |
| 3469 | |
| 3470 | oldCPP="$CPPFLAGS" |
| 3471 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
| 3472 | AC_CHECK_HEADER(gssapi_krb5.h, , |
| 3473 | [ CPPFLAGS="$oldCPP" ]) |
| 3474 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3475 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 3476 | if test ! -z "$need_dash_r" ; then |
| 3477 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 3478 | fi |
| 3479 | if test ! -z "$blibpath" ; then |
| 3480 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 3481 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 3482 | |
| 3483 | AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h) |
| 3484 | AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h) |
| 3485 | AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h) |
| 3486 | |
| 3487 | LIBS="$LIBS $K5LIBS" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3488 | AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS, 1, |
| 3489 | [Define this if you want to use libkafs' AFS support])) |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 3490 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 3491 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 3492 | ) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 3493 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3494 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3495 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3496 | PRIVSEP_PATH=/var/empty |
| 3497 | AC_ARG_WITH(privsep-path, |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 3498 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3499 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3500 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3501 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 3502 | PRIVSEP_PATH=$withval |
| 3503 | fi |
| 3504 | ] |
| 3505 | ) |
| 3506 | AC_SUBST(PRIVSEP_PATH) |
| 3507 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3508 | AC_ARG_WITH(xauth, |
| 3509 | [ --with-xauth=PATH Specify path to xauth program ], |
| 3510 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3511 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3512 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3513 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3514 | fi |
| 3515 | ], |
| 3516 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 3517 | TestPath="$PATH" |
| 3518 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 3519 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 3520 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 3521 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
| 3522 | AC_PATH_PROG(xauth_path, xauth, , $TestPath) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3523 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3524 | xauth_path="/usr/openwin/bin/xauth" |
| 3525 | fi |
| 3526 | ] |
| 3527 | ) |
| 3528 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 3529 | STRIP_OPT=-s |
| 3530 | AC_ARG_ENABLE(strip, |
| 3531 | [ --disable-strip Disable calling strip(1) on install], |
| 3532 | [ |
| 3533 | if test "x$enableval" = "xno" ; then |
| 3534 | STRIP_OPT= |
| 3535 | fi |
| 3536 | ] |
| 3537 | ) |
| 3538 | AC_SUBST(STRIP_OPT) |
| 3539 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 3540 | if test -z "$xauth_path" ; then |
| 3541 | XAUTH_PATH="undefined" |
| 3542 | AC_SUBST(XAUTH_PATH) |
| 3543 | else |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3544 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path", |
| 3545 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 3546 | XAUTH_PATH=$xauth_path |
| 3547 | AC_SUBST(XAUTH_PATH) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3548 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3549 | |
| 3550 | # Check for mail directory (last resort if we cannot get it from headers) |
| 3551 | if test ! -z "$MAIL" ; then |
| 3552 | maildir=`dirname $MAIL` |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3553 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir", |
| 3554 | [Set this to your mail directory if you don't have maillock.h]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3555 | fi |
| 3556 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3557 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3558 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 3559 | disable_ptmx_check=yes |
| 3560 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3561 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 3562 | if test "x$disable_ptmx_check" != "xyes" ; then |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3563 | AC_CHECK_FILE("/dev/ptmx", |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 3564 | [ |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3565 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, |
| 3566 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 3567 | have_dev_ptmx=1 |
| 3568 | ] |
| 3569 | ) |
| 3570 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3571 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3572 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3573 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3574 | AC_CHECK_FILE("/dev/ptc", |
| 3575 | [ |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3576 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, |
| 3577 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3578 | have_dev_ptc=1 |
| 3579 | ] |
| 3580 | ) |
| 3581 | else |
| 3582 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 3583 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 3584 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3585 | # Options from here on. Some of these are preset by platform above |
Ben Lindstrom | 9841b0a | 2001-06-09 02:26:58 +0000 | [diff] [blame] | 3586 | AC_ARG_WITH(mantype, |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 3587 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 3588 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 3589 | case "$withval" in |
| 3590 | man|cat|doc) |
| 3591 | MANTYPE=$withval |
| 3592 | ;; |
| 3593 | *) |
| 3594 | AC_MSG_ERROR(invalid man type: $withval) |
| 3595 | ;; |
| 3596 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 3597 | ] |
| 3598 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 3599 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 3600 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
| 3601 | AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 3602 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 3603 | MANTYPE=doc |
| 3604 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 3605 | MANTYPE=man |
| 3606 | else |
| 3607 | MANTYPE=cat |
| 3608 | fi |
| 3609 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 3610 | AC_SUBST(MANTYPE) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 3611 | if test "$MANTYPE" = "doc"; then |
| 3612 | mansubdir=man; |
| 3613 | else |
| 3614 | mansubdir=$MANTYPE; |
| 3615 | fi |
| 3616 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 3617 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3618 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3619 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 3620 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 3621 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 3622 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 3623 | if test "x$withval" != "xno" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3624 | AC_DEFINE(HAVE_MD5_PASSWORDS, 1, |
| 3625 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3626 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 3627 | fi |
| 3628 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 3629 | ) |
| 3630 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3631 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 3632 | AC_ARG_WITH(shadow, |
| 3633 | [ --without-shadow Disable shadow password support], |
| 3634 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3635 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 3636 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3637 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 3638 | fi |
| 3639 | ] |
| 3640 | ) |
| 3641 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3642 | if test -z "$disable_shadow" ; then |
| 3643 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 3644 | AC_TRY_COMPILE( |
| 3645 | [ |
| 3646 | #include <sys/types.h> |
| 3647 | #include <shadow.h> |
| 3648 | struct spwd sp; |
| 3649 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 3650 | [ sp_expire_available=yes ], [] |
| 3651 | ) |
| 3652 | |
| 3653 | if test "x$sp_expire_available" = "xyes" ; then |
| 3654 | AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3655 | AC_DEFINE(HAS_SHADOW_EXPIRE, 1, |
| 3656 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 3657 | else |
| 3658 | AC_MSG_RESULT(no) |
| 3659 | fi |
| 3660 | fi |
| 3661 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3662 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 3663 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 3664 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3665 | AC_DEFINE(IPADDR_IN_DISPLAY, 1, |
| 3666 | [Define if you need to use IP address |
| 3667 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 3668 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3669 | DISPLAY_HACK_MSG="no" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 3670 | AC_ARG_WITH(ipaddr-display, |
| 3671 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 3672 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3673 | if test "x$withval" != "xno" ; then |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 3674 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3675 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 3676 | fi |
| 3677 | ] |
| 3678 | ) |
| 3679 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 3680 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3681 | # check for /etc/default/login and use it if present. |
Tim Rice | 7ff4e6d | 2003-09-22 19:50:14 -0700 | [diff] [blame] | 3682 | AC_ARG_ENABLE(etc-default-login, |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 3683 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 3684 | [ if test "x$enableval" = "xno"; then |
| 3685 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 3686 | etc_default_login=no |
| 3687 | else |
| 3688 | etc_default_login=yes |
| 3689 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 3690 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 3691 | then |
| 3692 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 3693 | etc_default_login=no |
| 3694 | else |
| 3695 | etc_default_login=yes |
| 3696 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 3697 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3698 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 3699 | if test "x$etc_default_login" != "xno"; then |
| 3700 | AC_CHECK_FILE("/etc/default/login", |
| 3701 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 3702 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3703 | AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN, 1, |
| 3704 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3705 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 3706 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3707 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3708 | dnl BSD systems use /etc/login.conf so --with-default-path= has no effect |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 3709 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 3710 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3711 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3712 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3713 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3714 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3715 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 3716 | AC_ARG_WITH(default-path, |
Damien Miller | f71d2a5 | 2002-05-13 15:14:08 +1000 | [diff] [blame] | 3717 | [ --with-default-path= Specify default \$PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 3718 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3719 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3720 | AC_MSG_WARN([ |
| 3721 | --with-default-path=PATH has no effect on this system. |
| 3722 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3723 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 3724 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3725 | AC_MSG_WARN([ |
| 3726 | --with-default-path=PATH will only be used if PATH is not defined in |
| 3727 | $external_path_file .]) |
| 3728 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3729 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3730 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 3731 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3732 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3733 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 3734 | AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3735 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 3736 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3737 | AC_MSG_WARN([ |
| 3738 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 3739 | otherwise scp will not work.]) |
| 3740 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 3741 | AC_RUN_IFELSE( |
| 3742 | [AC_LANG_SOURCE([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3743 | /* find out what STDPATH is */ |
| 3744 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3745 | #ifdef HAVE_PATHS_H |
| 3746 | # include <paths.h> |
| 3747 | #endif |
| 3748 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 3749 | # ifdef _PATH_USERPATH /* Irix */ |
| 3750 | # define _PATH_STDPATH _PATH_USERPATH |
| 3751 | # else |
| 3752 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 3753 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3754 | #endif |
| 3755 | #include <sys/types.h> |
| 3756 | #include <sys/stat.h> |
| 3757 | #include <fcntl.h> |
| 3758 | #define DATA "conftest.stdpath" |
| 3759 | |
| 3760 | main() |
| 3761 | { |
| 3762 | FILE *fd; |
| 3763 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3764 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3765 | fd = fopen(DATA,"w"); |
| 3766 | if(fd == NULL) |
| 3767 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3768 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3769 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 3770 | exit(1); |
| 3771 | |
| 3772 | exit(0); |
| 3773 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 3774 | ]])], |
| 3775 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 3776 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 3777 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 3778 | ) |
| 3779 | # make sure $bindir is in USER_PATH so scp will work |
| 3780 | t_bindir=`eval echo ${bindir}` |
| 3781 | case $t_bindir in |
| 3782 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 3783 | esac |
| 3784 | case $t_bindir in |
| 3785 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 3786 | esac |
| 3787 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 3788 | if test $? -ne 0 ; then |
| 3789 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 3790 | if test $? -ne 0 ; then |
| 3791 | user_path=$user_path:$t_bindir |
| 3792 | AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) |
| 3793 | fi |
| 3794 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3795 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 3796 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 3797 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3798 | AC_DEFINE_UNQUOTED(USER_PATH, "$user_path", [Specify default $PATH]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 3799 | AC_SUBST(user_path) |
| 3800 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 3801 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3802 | # Set superuser path separately to user path |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3803 | AC_ARG_WITH(superuser-path, |
| 3804 | [ --with-superuser-path= Specify different path for super-user], |
| 3805 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3806 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3807 | test "x${withval}" != "xyes"; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3808 | AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval", |
| 3809 | [Define if you want a different $PATH |
| 3810 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 3811 | superuser_path=$withval |
| 3812 | fi |
| 3813 | ] |
| 3814 | ) |
| 3815 | |
| 3816 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3817 | AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3818 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 3819 | AC_ARG_WITH(4in6, |
| 3820 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 3821 | [ |
| 3822 | if test "x$withval" != "xno" ; then |
| 3823 | AC_MSG_RESULT(yes) |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3824 | AC_DEFINE(IPV4_IN_IPV6, 1, |
| 3825 | [Detect IPv4 in IPv6 mapped addresses |
| 3826 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3827 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 3828 | else |
| 3829 | AC_MSG_RESULT(no) |
| 3830 | fi |
| 3831 | ],[ |
| 3832 | if test "x$inet6_default_4in6" = "xyes"; then |
| 3833 | AC_MSG_RESULT([yes (default)]) |
| 3834 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3835 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 3836 | else |
| 3837 | AC_MSG_RESULT([no (default)]) |
| 3838 | fi |
| 3839 | ] |
| 3840 | ) |
| 3841 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3842 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3843 | BSD_AUTH_MSG=no |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3844 | AC_ARG_WITH(bsd-auth, |
| 3845 | [ --with-bsd-auth Enable BSD auth support], |
| 3846 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3847 | if test "x$withval" != "xno" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3848 | AC_DEFINE(BSD_AUTH, 1, |
| 3849 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3850 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 3851 | fi |
| 3852 | ] |
| 3853 | ) |
| 3854 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3855 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 3856 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3857 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3858 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3859 | piddir=`eval echo ${sysconfdir}` |
| 3860 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3861 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3862 | esac |
| 3863 | fi |
| 3864 | |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 3865 | AC_ARG_WITH(pid-dir, |
| 3866 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 3867 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3868 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3869 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 3870 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3871 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 3872 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 3873 | fi |
| 3874 | fi |
| 3875 | ] |
| 3876 | ) |
| 3877 | |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3878 | AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir", [Specify location of ssh.pid]) |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 3879 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 3880 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3881 | dnl allow user to disable some login recording features |
| 3882 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3883 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3884 | [ |
| 3885 | if test "x$enableval" = "xno" ; then |
| 3886 | AC_DEFINE(DISABLE_LASTLOG) |
| 3887 | fi |
| 3888 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3889 | ) |
| 3890 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3891 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3892 | [ |
| 3893 | if test "x$enableval" = "xno" ; then |
| 3894 | AC_DEFINE(DISABLE_UTMP) |
| 3895 | fi |
| 3896 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3897 | ) |
| 3898 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3899 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3900 | [ |
| 3901 | if test "x$enableval" = "xno" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3902 | AC_DEFINE(DISABLE_UTMPX, 1, |
| 3903 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3904 | fi |
| 3905 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3906 | ) |
| 3907 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3908 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3909 | [ |
| 3910 | if test "x$enableval" = "xno" ; then |
| 3911 | AC_DEFINE(DISABLE_WTMP) |
| 3912 | fi |
| 3913 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3914 | ) |
| 3915 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3916 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3917 | [ |
| 3918 | if test "x$enableval" = "xno" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3919 | AC_DEFINE(DISABLE_WTMPX, 1, |
| 3920 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3921 | fi |
| 3922 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3923 | ) |
| 3924 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3925 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3926 | [ |
| 3927 | if test "x$enableval" = "xno" ; then |
| 3928 | AC_DEFINE(DISABLE_LOGIN) |
| 3929 | fi |
| 3930 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3931 | ) |
| 3932 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3933 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3934 | [ |
| 3935 | if test "x$enableval" = "xno" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3936 | AC_DEFINE(DISABLE_PUTUTLINE, 1, |
| 3937 | [Define if you don't want to use pututline() |
| 3938 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3939 | fi |
| 3940 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3941 | ) |
| 3942 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3943 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3944 | [ |
| 3945 | if test "x$enableval" = "xno" ; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3946 | AC_DEFINE(DISABLE_PUTUTXLINE, 1, |
| 3947 | [Define if you don't want to use pututxline() |
| 3948 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 3949 | fi |
| 3950 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3951 | ) |
| 3952 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 3953 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 3954 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3955 | if test "x$withval" = "xno" ; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 3956 | AC_DEFINE(DISABLE_LASTLOG) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3957 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 3958 | conf_lastlog_location=$withval |
| 3959 | fi |
| 3960 | ] |
| 3961 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3962 | |
| 3963 | dnl lastlog, [uw]tmpx? detection |
| 3964 | dnl NOTE: set the paths in the platform section to avoid the |
| 3965 | dnl need for command-line parameters |
| 3966 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 3967 | |
| 3968 | dnl lastlog detection |
| 3969 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 3970 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 3971 | AC_TRY_COMPILE([ |
| 3972 | #include <sys/types.h> |
| 3973 | #include <utmp.h> |
| 3974 | #ifdef HAVE_LASTLOG_H |
| 3975 | # include <lastlog.h> |
| 3976 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3977 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3978 | # include <paths.h> |
| 3979 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3980 | #ifdef HAVE_LOGIN_H |
| 3981 | # include <login.h> |
| 3982 | #endif |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3983 | ], |
| 3984 | [ char *lastlog = LASTLOG_FILE; ], |
| 3985 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 3986 | [ |
| 3987 | AC_MSG_RESULT(no) |
| 3988 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 3989 | AC_TRY_COMPILE([ |
| 3990 | #include <sys/types.h> |
| 3991 | #include <utmp.h> |
| 3992 | #ifdef HAVE_LASTLOG_H |
| 3993 | # include <lastlog.h> |
| 3994 | #endif |
| 3995 | #ifdef HAVE_PATHS_H |
| 3996 | # include <paths.h> |
| 3997 | #endif |
| 3998 | ], |
| 3999 | [ char *lastlog = _PATH_LASTLOG; ], |
| 4000 | [ AC_MSG_RESULT(yes) ], |
| 4001 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 4002 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4003 | system_lastlog_path=no |
| 4004 | ]) |
| 4005 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4006 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4007 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4008 | if test -z "$conf_lastlog_location"; then |
| 4009 | if test x"$system_lastlog_path" = x"no" ; then |
| 4010 | for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 4011 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4012 | conf_lastlog_location=$f |
| 4013 | fi |
| 4014 | done |
| 4015 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 4016 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 4017 | dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4018 | fi |
| 4019 | fi |
| 4020 | fi |
| 4021 | |
| 4022 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4023 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location", |
| 4024 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4025 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4026 | |
| 4027 | dnl utmp detection |
| 4028 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 4029 | AC_TRY_COMPILE([ |
| 4030 | #include <sys/types.h> |
| 4031 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4032 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4033 | # include <paths.h> |
| 4034 | #endif |
| 4035 | ], |
| 4036 | [ char *utmp = UTMP_FILE; ], |
| 4037 | [ AC_MSG_RESULT(yes) ], |
| 4038 | [ AC_MSG_RESULT(no) |
| 4039 | system_utmp_path=no ] |
| 4040 | ) |
| 4041 | if test -z "$conf_utmp_location"; then |
| 4042 | if test x"$system_utmp_path" = x"no" ; then |
| 4043 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 4044 | if test -f $f ; then |
| 4045 | conf_utmp_location=$f |
| 4046 | fi |
| 4047 | done |
| 4048 | if test -z "$conf_utmp_location"; then |
| 4049 | AC_DEFINE(DISABLE_UTMP) |
| 4050 | fi |
| 4051 | fi |
| 4052 | fi |
| 4053 | if test -n "$conf_utmp_location"; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4054 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location", |
| 4055 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4056 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4057 | |
| 4058 | dnl wtmp detection |
| 4059 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 4060 | AC_TRY_COMPILE([ |
| 4061 | #include <sys/types.h> |
| 4062 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4063 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4064 | # include <paths.h> |
| 4065 | #endif |
| 4066 | ], |
| 4067 | [ char *wtmp = WTMP_FILE; ], |
| 4068 | [ AC_MSG_RESULT(yes) ], |
| 4069 | [ AC_MSG_RESULT(no) |
| 4070 | system_wtmp_path=no ] |
| 4071 | ) |
| 4072 | if test -z "$conf_wtmp_location"; then |
| 4073 | if test x"$system_wtmp_path" = x"no" ; then |
| 4074 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 4075 | if test -f $f ; then |
| 4076 | conf_wtmp_location=$f |
| 4077 | fi |
| 4078 | done |
| 4079 | if test -z "$conf_wtmp_location"; then |
| 4080 | AC_DEFINE(DISABLE_WTMP) |
| 4081 | fi |
| 4082 | fi |
| 4083 | fi |
| 4084 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4085 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location", |
| 4086 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4087 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4088 | |
| 4089 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4090 | dnl wtmpx detection |
| 4091 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 4092 | AC_TRY_COMPILE([ |
| 4093 | #include <sys/types.h> |
| 4094 | #include <utmp.h> |
| 4095 | #ifdef HAVE_UTMPX_H |
| 4096 | #include <utmpx.h> |
| 4097 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4098 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4099 | # include <paths.h> |
| 4100 | #endif |
| 4101 | ], |
| 4102 | [ char *wtmpx = WTMPX_FILE; ], |
| 4103 | [ AC_MSG_RESULT(yes) ], |
| 4104 | [ AC_MSG_RESULT(no) |
| 4105 | system_wtmpx_path=no ] |
| 4106 | ) |
| 4107 | if test -z "$conf_wtmpx_location"; then |
| 4108 | if test x"$system_wtmpx_path" = x"no" ; then |
| 4109 | AC_DEFINE(DISABLE_WTMPX) |
| 4110 | fi |
| 4111 | else |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4112 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location", |
| 4113 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4114 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4115 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 4116 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4117 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 4118 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 4119 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4120 | fi |
| 4121 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 4122 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 4123 | dnl Add now. |
| 4124 | CFLAGS="$CFLAGS $werror_flags" |
| 4125 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 4126 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 4127 | TEST_SSH_IPV6=no |
| 4128 | else |
| 4129 | TEST_SSH_IPV6=yes |
| 4130 | fi |
| 4131 | AC_CHECK_DECL(BROKEN_GETADDRINFO, TEST_SSH_IPV6=no) |
| 4132 | AC_SUBST(TEST_SSH_IPV6, $TEST_SSH_IPV6) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 4133 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 4134 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 4135 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 4136 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | d8f6002 | 2010-02-12 09:34:22 +1100 | [diff] [blame] | 4137 | ssh_prng_cmds survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 4138 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 4139 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4140 | # Print summary of options |
| 4141 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4142 | # Someone please show me a better way :) |
| 4143 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 4144 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 4145 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 4146 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 4147 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4148 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4149 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4150 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 4151 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 4152 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4153 | |
| 4154 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 4155 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4156 | echo " User binaries: $B" |
| 4157 | echo " System binaries: $C" |
| 4158 | echo " Configuration files: $D" |
| 4159 | echo " Askpass program: $E" |
| 4160 | echo " Manual pages: $F" |
| 4161 | echo " PID file: $G" |
| 4162 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4163 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4164 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 4165 | echo " Make sure the path to scp is present, otherwise scp will not work" |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4166 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4167 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4168 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4169 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 4170 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 4171 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4172 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4173 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4174 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4175 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4176 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4177 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 4178 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4179 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4180 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4181 | echo " Smartcard support: $SCARD_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4182 | echo " S/KEY support: $SKEY_MSG" |
| 4183 | echo " TCP Wrappers support: $TCPW_MSG" |
| 4184 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 4185 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 4186 | echo " Solaris process contract support: $SPC_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 4187 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4188 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 4189 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 4190 | echo " Random number source: $RAND_MSG" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4191 | if test ! -z "$USE_RAND_HELPER" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4192 | echo " ssh-rand-helper collects from: $RAND_HELPER_MSG" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4193 | fi |
| 4194 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4195 | echo "" |
| 4196 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 4197 | echo " Host: ${host}" |
| 4198 | echo " Compiler: ${CC}" |
| 4199 | echo " Compiler flags: ${CFLAGS}" |
| 4200 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 4201 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4202 | echo " Libraries: ${LIBS}" |
| 4203 | if test ! -z "${SSHDLIBS}"; then |
| 4204 | echo " +for sshd: ${SSHDLIBS}" |
| 4205 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4206 | |
| 4207 | echo "" |
| 4208 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 4209 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 4210 | echo "SVR4 style packages are supported with \"make package\"" |
| 4211 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 4212 | fi |
| 4213 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 4214 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4215 | echo "PAM is enabled. You may need to install a PAM control file " |
| 4216 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4217 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4218 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 4219 | echo "" |
| 4220 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 4221 | |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4222 | if test ! -z "$RAND_HELPER_CMDHASH" ; then |
| 4223 | echo "WARNING: you are using the builtin random number collection " |
| 4224 | echo "service. Please read WARNING.RNG and request that your OS " |
| 4225 | echo "vendor includes kernel-based random number collection in " |
| 4226 | echo "future versions of your OS." |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 4227 | echo "" |
| 4228 | fi |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4229 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 4230 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 4231 | echo "WARNING: the operating system that you are using does not" |
| 4232 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 4233 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 4234 | echo "enforce security checks to prevent unauthorised connections to" |
| 4235 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 4236 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 4237 | echo "" |
| 4238 | fi |
| 4239 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 4240 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 4241 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 4242 | echo "See the Solaris section in README.platform for details." |
| 4243 | fi |