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