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