Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.583 2014/08/26 20:32:01 djm 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 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 18 | AC_REVISION($Revision: 1.583 $) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 20 | AC_LANG([C]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 21 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 22 | AC_CONFIG_HEADER([config.h]) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 23 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 24 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 25 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 26 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 27 | # Checks for programs. |
Darren Tucker | 167bd9c | 2003-09-07 12:34:54 +1000 | [diff] [blame] | 28 | AC_PROG_AWK |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 29 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 30 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 31 | AC_PROG_INSTALL |
Tim Rice | fd80ddc | 2006-02-02 19:11:56 -0800 | [diff] [blame] | 32 | AC_PROG_EGREP |
Darren Tucker | 408f4c2 | 2015-04-17 09:39:58 +1000 | [diff] [blame] | 33 | AC_CHECK_TOOLS([AR], [ar]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 34 | AC_PATH_PROG([CAT], [cat]) |
| 35 | AC_PATH_PROG([KILL], [kill]) |
| 36 | AC_PATH_PROGS([PERL], [perl5 perl]) |
| 37 | AC_PATH_PROG([SED], [sed]) |
| 38 | AC_SUBST([PERL]) |
| 39 | AC_PATH_PROG([ENT], [ent]) |
| 40 | AC_SUBST([ENT]) |
| 41 | AC_PATH_PROG([TEST_MINUS_S_SH], [bash]) |
| 42 | AC_PATH_PROG([TEST_MINUS_S_SH], [ksh]) |
| 43 | AC_PATH_PROG([TEST_MINUS_S_SH], [sh]) |
| 44 | AC_PATH_PROG([SH], [sh]) |
| 45 | AC_PATH_PROG([GROFF], [groff]) |
| 46 | AC_PATH_PROG([NROFF], [nroff]) |
| 47 | AC_PATH_PROG([MANDOC], [mandoc]) |
| 48 | AC_SUBST([TEST_SHELL], [sh]) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 49 | |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 50 | dnl select manpage formatter |
| 51 | if test "x$MANDOC" != "x" ; then |
| 52 | MANFMT="$MANDOC" |
| 53 | elif test "x$NROFF" != "x" ; then |
| 54 | MANFMT="$NROFF -mandoc" |
| 55 | elif test "x$GROFF" != "x" ; then |
| 56 | MANFMT="$GROFF -mandoc -Tascii" |
| 57 | else |
| 58 | AC_MSG_WARN([no manpage formatted found]) |
| 59 | MANFMT="false" |
| 60 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 61 | AC_SUBST([MANFMT]) |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 62 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 63 | dnl for buildpkg.sh |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 64 | AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd], |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 65 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 66 | AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd], |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 67 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 68 | AC_CHECK_PROG([MAKE_PACKAGE_SUPPORTED], [pkgmk], [yes], [no]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 69 | if test -x /sbin/sh; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 70 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/sbin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 71 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 72 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/bin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 73 | fi |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 74 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 75 | # System features |
| 76 | AC_SYS_LARGEFILE |
| 77 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 78 | if test -z "$AR" ; then |
| 79 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 80 | fi |
| 81 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 82 | AC_PATH_PROG([PATH_PASSWD_PROG], [passwd]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 83 | if test ! -z "$PATH_PASSWD_PROG" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 84 | AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 85 | [Full path of your "passwd" program]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 86 | fi |
| 87 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 88 | if test -z "$LD" ; then |
| 89 | LD=$CC |
| 90 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 91 | AC_SUBST([LD]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 92 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 93 | AC_C_INLINE |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 94 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 95 | AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 96 | AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ |
| 97 | #include <sys/types.h> |
| 98 | #include <sys/param.h> |
| 99 | #include <dev/systrace.h> |
| 100 | ]) |
| 101 | AC_CHECK_DECL([RLIMIT_NPROC], |
| 102 | [AC_DEFINE([HAVE_RLIMIT_NPROC], [], [sys/resource.h has RLIMIT_NPROC])], , [ |
| 103 | #include <sys/types.h> |
| 104 | #include <sys/resource.h> |
| 105 | ]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 106 | AC_CHECK_DECL([PR_SET_NO_NEW_PRIVS], [have_linux_no_new_privs=1], , [ |
| 107 | #include <sys/types.h> |
| 108 | #include <linux/prctl.h> |
| 109 | ]) |
Damien Miller | 868ea1e | 2014-01-17 16:47:04 +1100 | [diff] [blame] | 110 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 111 | openssl=yes |
djm@openbsd.org | 564d63e | 2015-07-01 23:10:47 +0000 | [diff] [blame] | 112 | ssh1=no |
Tim Rice | cf3e0be | 2016-08-01 14:31:52 -0700 | [diff] [blame] | 113 | COMMENT_OUT_RSA1="#no ssh1#" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 114 | AC_ARG_WITH([openssl], |
| 115 | [ --without-openssl Disable use of OpenSSL; use only limited internal crypto **EXPERIMENTAL** ], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 116 | [ if test "x$withval" = "xno" ; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 117 | openssl=no |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 118 | ssh1=no |
| 119 | fi |
| 120 | ] |
| 121 | ) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 122 | AC_MSG_CHECKING([whether OpenSSL will be used for cryptography]) |
| 123 | if test "x$openssl" = "xyes" ; then |
| 124 | AC_MSG_RESULT([yes]) |
| 125 | AC_DEFINE_UNQUOTED([WITH_OPENSSL], [1], [use libcrypto for cryptography]) |
| 126 | else |
| 127 | AC_MSG_RESULT([no]) |
| 128 | fi |
| 129 | |
| 130 | AC_ARG_WITH([ssh1], |
Darren Tucker | 366bada | 2015-09-11 13:29:22 +1000 | [diff] [blame] | 131 | [ --with-ssh1 Enable support for SSH protocol 1], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 132 | [ |
djm@openbsd.org | 2aa9da1 | 2015-03-24 01:29:19 +0000 | [diff] [blame] | 133 | if test "x$withval" = "xyes" ; then |
| 134 | if test "x$openssl" = "xno" ; then |
| 135 | AC_MSG_ERROR([Cannot enable SSH protocol 1 with OpenSSL disabled]) |
| 136 | fi |
| 137 | ssh1=yes |
Tim Rice | cf3e0be | 2016-08-01 14:31:52 -0700 | [diff] [blame] | 138 | COMMENT_OUT_RSA1="" |
Damien Miller | 0c2a81d | 2015-05-29 17:08:28 +1000 | [diff] [blame] | 139 | elif test "x$withval" = "xno" ; then |
| 140 | ssh1=no |
| 141 | else |
| 142 | AC_MSG_ERROR([unknown --with-ssh1 argument]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 143 | fi |
| 144 | ] |
| 145 | ) |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 146 | AC_MSG_CHECKING([whether SSH protocol 1 support is enabled]) |
| 147 | if test "x$ssh1" = "xyes" ; then |
| 148 | AC_MSG_RESULT([yes]) |
| 149 | AC_DEFINE_UNQUOTED([WITH_SSH1], [1], [include SSH protocol version 1 support]) |
Tim Rice | cf3e0be | 2016-08-01 14:31:52 -0700 | [diff] [blame] | 150 | AC_SUBST([COMMENT_OUT_RSA1]) |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 151 | else |
| 152 | AC_MSG_RESULT([no]) |
| 153 | fi |
| 154 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 155 | use_stack_protector=1 |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 156 | use_toolchain_hardening=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 157 | AC_ARG_WITH([stackprotect], |
Damien Miller | da3155e | 2008-03-27 12:30:18 +1100 | [diff] [blame] | 158 | [ --without-stackprotect Don't use compiler's stack protection], [ |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 159 | if test "x$withval" = "xno"; then |
| 160 | use_stack_protector=0 |
| 161 | fi ]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 162 | AC_ARG_WITH([hardening], |
| 163 | [ --without-hardening Don't use toolchain hardening flags], [ |
| 164 | if test "x$withval" = "xno"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 165 | use_toolchain_hardening=0 |
| 166 | fi ]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 167 | |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 168 | # We use -Werror for the tests only so that we catch warnings like "this is |
| 169 | # on by default" for things like -fPIE. |
| 170 | AC_MSG_CHECKING([if $CC supports -Werror]) |
| 171 | saved_CFLAGS="$CFLAGS" |
| 172 | CFLAGS="$CFLAGS -Werror" |
| 173 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], |
| 174 | [ AC_MSG_RESULT([yes]) |
| 175 | WERROR="-Werror"], |
| 176 | [ AC_MSG_RESULT([no]) |
| 177 | WERROR="" ] |
| 178 | ) |
| 179 | CFLAGS="$saved_CFLAGS" |
Damien Miller | 134d02a | 2011-01-12 16:00:37 +1100 | [diff] [blame] | 180 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 181 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 182 | OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) |
| 183 | OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 184 | OSSH_CHECK_CFLAG_COMPILE([-Wall]) |
| 185 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) |
| 186 | OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) |
| 187 | OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) |
| 188 | OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) |
Darren Tucker | abbc7a7 | 2013-05-10 13:54:23 +1000 | [diff] [blame] | 189 | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 190 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) |
| 191 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) |
| 192 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) |
Darren Tucker | 4a725ef | 2011-11-21 16:38:48 +1100 | [diff] [blame] | 193 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 194 | if test "x$use_toolchain_hardening" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 195 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) |
| 196 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) |
| 197 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 198 | # NB. -ftrapv expects certain support functions to be present in |
| 199 | # the compiler library (libgcc or similar) to detect integer operations |
| 200 | # that can overflow. We must check that the result of enabling it |
| 201 | # actually links. The test program compiled/linked includes a number |
| 202 | # of integer operations that should exercise this. |
| 203 | OSSH_CHECK_CFLAG_LINK([-ftrapv]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 204 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 205 | AC_MSG_CHECKING([gcc version]) |
Darren Tucker | 3f9545e | 2005-11-12 15:20:52 +1100 | [diff] [blame] | 206 | GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 207 | case $GCC_VER in |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 208 | 1.*) no_attrib_nonnull=1 ;; |
| 209 | 2.8* | 2.9*) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 210 | no_attrib_nonnull=1 |
| 211 | ;; |
| 212 | 2.*) no_attrib_nonnull=1 ;; |
Darren Tucker | f032435 | 2005-11-10 21:30:36 +1100 | [diff] [blame] | 213 | *) ;; |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 214 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 215 | AC_MSG_RESULT([$GCC_VER]) |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 216 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 217 | AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 218 | saved_CFLAGS="$CFLAGS" |
| 219 | CFLAGS="$CFLAGS -fno-builtin-memset" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 220 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], |
| 221 | [[ char b[10]; memset(b, 0, sizeof(b)); ]])], |
| 222 | [ AC_MSG_RESULT([yes]) ], |
| 223 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 224 | CFLAGS="$saved_CFLAGS" ] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 225 | ) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 226 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 227 | # -fstack-protector-all doesn't always work for some GCC versions |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 228 | # and/or platforms, so we test if we can. If it's not supported |
Damien Miller | 7df2e40 | 2008-12-08 09:35:36 +1100 | [diff] [blame] | 229 | # on a given platform gcc will emit a warning so we use -Werror. |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 230 | if test "x$use_stack_protector" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 231 | for t in -fstack-protector-strong -fstack-protector-all \ |
| 232 | -fstack-protector; do |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 233 | AC_MSG_CHECKING([if $CC supports $t]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 234 | saved_CFLAGS="$CFLAGS" |
| 235 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 236 | CFLAGS="$CFLAGS $t -Werror" |
| 237 | LDFLAGS="$LDFLAGS $t -Werror" |
| 238 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 239 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 240 | [[ |
| 241 | char x[256]; |
| 242 | snprintf(x, sizeof(x), "XXX"); |
| 243 | ]])], |
| 244 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 245 | CFLAGS="$saved_CFLAGS $t" |
| 246 | LDFLAGS="$saved_LDFLAGS $t" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 247 | AC_MSG_CHECKING([if $t works]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 248 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 249 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 250 | [[ |
| 251 | char x[256]; |
| 252 | snprintf(x, sizeof(x), "XXX"); |
| 253 | ]])], |
| 254 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 255 | break ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 256 | [ AC_MSG_RESULT([no]) ], |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 257 | [ AC_MSG_WARN([cross compiling: cannot test]) |
| 258 | break ] |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 259 | ) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 260 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 261 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 262 | ) |
| 263 | CFLAGS="$saved_CFLAGS" |
| 264 | LDFLAGS="$saved_LDFLAGS" |
| 265 | done |
| 266 | fi |
Darren Tucker | 319b3d9 | 2007-12-02 21:02:22 +1100 | [diff] [blame] | 267 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 268 | if test -z "$have_llong_max"; then |
| 269 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 270 | unset ac_cv_have_decl_LLONG_MAX |
| 271 | saved_CFLAGS="$CFLAGS" |
| 272 | CFLAGS="$CFLAGS -std=gnu99" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 273 | AC_CHECK_DECL([LLONG_MAX], |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 274 | [have_llong_max=1], |
| 275 | [CFLAGS="$saved_CFLAGS"], |
| 276 | [#include <limits.h>] |
| 277 | ) |
| 278 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 279 | fi |
| 280 | |
Darren Tucker | 951b53b | 2013-02-08 11:50:09 +1100 | [diff] [blame] | 281 | AC_MSG_CHECKING([if compiler allows __attribute__ on return types]) |
| 282 | AC_COMPILE_IFELSE( |
| 283 | [AC_LANG_PROGRAM([[ |
| 284 | #include <stdlib.h> |
| 285 | __attribute__((__unused__)) static void foo(void){return;}]], |
| 286 | [[ exit(0); ]])], |
| 287 | [ AC_MSG_RESULT([yes]) ], |
| 288 | [ AC_MSG_RESULT([no]) |
| 289 | AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1, |
| 290 | [compiler does not accept __attribute__ on return types]) ] |
| 291 | ) |
| 292 | |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 293 | if test "x$no_attrib_nonnull" != "x1" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 294 | AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 295 | fi |
| 296 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 297 | AC_ARG_WITH([rpath], |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 298 | [ --without-rpath Disable auto-added -R linker paths], |
| 299 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 300 | if test "x$withval" = "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 301 | need_dash_r="" |
| 302 | fi |
| 303 | if test "x$withval" = "xyes" ; then |
| 304 | need_dash_r=1 |
| 305 | fi |
| 306 | ] |
| 307 | ) |
| 308 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 309 | # Allow user to specify flags |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 310 | AC_ARG_WITH([cflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 311 | [ --with-cflags Specify additional flags to pass to compiler], |
| 312 | [ |
| 313 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 314 | test "x${withval}" != "xyes"; then |
| 315 | CFLAGS="$CFLAGS $withval" |
| 316 | fi |
| 317 | ] |
| 318 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 319 | AC_ARG_WITH([cppflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 320 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 321 | [ |
| 322 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 323 | test "x${withval}" != "xyes"; then |
| 324 | CPPFLAGS="$CPPFLAGS $withval" |
| 325 | fi |
| 326 | ] |
| 327 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 328 | AC_ARG_WITH([ldflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 329 | [ --with-ldflags Specify additional flags to pass to linker], |
| 330 | [ |
| 331 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 332 | test "x${withval}" != "xyes"; then |
| 333 | LDFLAGS="$LDFLAGS $withval" |
| 334 | fi |
| 335 | ] |
| 336 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 337 | AC_ARG_WITH([libs], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 338 | [ --with-libs Specify additional libraries to link with], |
| 339 | [ |
| 340 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 341 | test "x${withval}" != "xyes"; then |
| 342 | LIBS="$LIBS $withval" |
| 343 | fi |
| 344 | ] |
| 345 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 346 | AC_ARG_WITH([Werror], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 347 | [ --with-Werror Build main code with -Werror], |
| 348 | [ |
| 349 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 350 | werror_flags="-Werror" |
| 351 | if test "x${withval}" != "xyes"; then |
| 352 | werror_flags="$withval" |
| 353 | fi |
| 354 | fi |
| 355 | ] |
| 356 | ) |
| 357 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 358 | AC_CHECK_HEADERS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 359 | blf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 360 | bstring.h \ |
| 361 | crypt.h \ |
| 362 | crypto/sha2.h \ |
| 363 | dirent.h \ |
| 364 | endian.h \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 365 | elf.h \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 366 | err.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 367 | features.h \ |
| 368 | fcntl.h \ |
| 369 | floatingpoint.h \ |
| 370 | getopt.h \ |
| 371 | glob.h \ |
| 372 | ia.h \ |
| 373 | iaf.h \ |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 374 | inttypes.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 375 | langinfo.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 376 | limits.h \ |
Darren Tucker | ae133d4 | 2013-06-06 08:30:20 +1000 | [diff] [blame] | 377 | locale.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 378 | login.h \ |
| 379 | maillock.h \ |
| 380 | ndir.h \ |
| 381 | net/if_tun.h \ |
| 382 | netdb.h \ |
| 383 | netgroup.h \ |
| 384 | pam/pam_appl.h \ |
| 385 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 386 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 387 | pty.h \ |
| 388 | readpassphrase.h \ |
| 389 | rpc/types.h \ |
| 390 | security/pam_appl.h \ |
| 391 | sha2.h \ |
| 392 | shadow.h \ |
| 393 | stddef.h \ |
| 394 | stdint.h \ |
| 395 | string.h \ |
| 396 | strings.h \ |
| 397 | sys/audit.h \ |
| 398 | sys/bitypes.h \ |
| 399 | sys/bsdtty.h \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 400 | sys/capability.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 401 | sys/cdefs.h \ |
| 402 | sys/dir.h \ |
| 403 | sys/mman.h \ |
| 404 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 405 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 406 | sys/prctl.h \ |
| 407 | sys/pstat.h \ |
Darren Tucker | 5ee3fb5 | 2016-11-01 08:12:33 +1100 | [diff] [blame] | 408 | sys/ptrace.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 409 | sys/select.h \ |
| 410 | sys/stat.h \ |
| 411 | sys/stream.h \ |
| 412 | sys/stropts.h \ |
| 413 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 414 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 415 | sys/sysmacros.h \ |
| 416 | sys/time.h \ |
| 417 | sys/timers.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 418 | time.h \ |
| 419 | tmpdir.h \ |
| 420 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 421 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 422 | unistd.h \ |
| 423 | usersec.h \ |
| 424 | util.h \ |
| 425 | utime.h \ |
| 426 | utmp.h \ |
| 427 | utmpx.h \ |
| 428 | vis.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 429 | wchar.h \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 430 | ]) |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 431 | |
| 432 | # lastlog.h requires sys/time.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 433 | AC_CHECK_HEADERS([lastlog.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 434 | #ifdef HAVE_SYS_TIME_H |
| 435 | # include <sys/time.h> |
| 436 | #endif |
| 437 | ]) |
| 438 | |
| 439 | # sys/ptms.h requires sys/stream.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 440 | AC_CHECK_HEADERS([sys/ptms.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 441 | #ifdef HAVE_SYS_STREAM_H |
| 442 | # include <sys/stream.h> |
| 443 | #endif |
| 444 | ]) |
| 445 | |
| 446 | # login_cap.h requires sys/types.h on NetBSD |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 447 | AC_CHECK_HEADERS([login_cap.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 448 | #include <sys/types.h> |
| 449 | ]) |
| 450 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 451 | # older BSDs need sys/param.h before sys/mount.h |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 452 | AC_CHECK_HEADERS([sys/mount.h], [], [], [ |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 453 | #include <sys/param.h> |
| 454 | ]) |
| 455 | |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 456 | # Android requires sys/socket.h to be included before sys/un.h |
| 457 | AC_CHECK_HEADERS([sys/un.h], [], [], [ |
Darren Tucker | 0b43ffe | 2013-06-03 09:30:44 +1000 | [diff] [blame] | 458 | #include <sys/types.h> |
Darren Tucker | 16cac19 | 2013-06-04 12:55:24 +1000 | [diff] [blame] | 459 | #include <sys/socket.h> |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 460 | ]) |
| 461 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 462 | # Messages for features tested for in target-specific section |
| 463 | SIA_MSG="no" |
| 464 | SPC_MSG="no" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 465 | SP_MSG="no" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 466 | SPP_MSG="no" |
| 467 | |
| 468 | # Support for Solaris/Illumos privileges (this test is used by both |
| 469 | # the --with-solaris-privs option and --with-sandbox=solaris). |
| 470 | SOLARIS_PRIVS="no" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 471 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 472 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 473 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 474 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 475 | # Some versions of VAC won't allow macro redefinitions at |
| 476 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 477 | # particularly with older versions of vac or xlc. |
| 478 | # It also throws errors about null macro argments, but these are |
| 479 | # not fatal. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 480 | AC_MSG_CHECKING([if compiler allows macro redefinitions]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 481 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 482 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 483 | #define testmacro foo |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 484 | #define testmacro bar]], |
| 485 | [[ exit(0); ]])], |
| 486 | [ AC_MSG_RESULT([yes]) ], |
| 487 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 488 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
| 489 | LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" |
| 490 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 491 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 492 | ] |
| 493 | ) |
| 494 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 495 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 496 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 497 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 498 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 499 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 500 | if test "$GCC" = "yes"; then |
| 501 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 502 | else |
| 503 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 504 | fi |
| 505 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 506 | if (test -z "$blibflags"); then |
| 507 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 508 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
| 509 | [blibflags=$tryflags], []) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 510 | fi |
| 511 | done |
| 512 | if (test -z "$blibflags"); then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 513 | AC_MSG_RESULT([not found]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 514 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 515 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 516 | AC_MSG_RESULT([$blibflags]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 517 | fi |
| 518 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 519 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 520 | AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 521 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 522 | [AC_CHECK_LIB([s], [authenticate], |
| 523 | [ AC_DEFINE([WITH_AIXAUTHENTICATE]) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 524 | LIBS="$LIBS -ls" |
| 525 | ]) |
| 526 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 527 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 528 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 529 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 530 | dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 531 | AC_CHECK_DECLS([loginfailed], |
| 532 | [AC_MSG_CHECKING([if loginfailed takes 4 arguments]) |
| 533 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]], |
| 534 | [[ (void)loginfailed("user","host","tty",0); ]])], |
| 535 | [AC_MSG_RESULT([yes]) |
| 536 | AC_DEFINE([AIX_LOGINFAILED_4ARG], [1], |
| 537 | [Define if your AIX loginfailed() function |
| 538 | takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no]) |
| 539 | ])], |
| 540 | [], |
| 541 | [#include <usersec.h>] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 542 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 543 | AC_CHECK_FUNCS([getgrset setauthdb]) |
| 544 | AC_CHECK_DECL([F_CLOSEM], |
| 545 | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 546 | [], |
| 547 | [ #include <limits.h> |
| 548 | #include <fcntl.h> ] |
| 549 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 550 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 551 | AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) |
| 552 | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 553 | [Define if your platform breaks doing a seteuid before a setuid]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 554 | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) |
| 555 | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 556 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 557 | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) |
| 558 | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 559 | [Some systems need a utmpx entry for /bin/login to work]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 560 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 561 | [Define to a Set Process Title type if your system is |
| 562 | supported by bsd-setproctitle.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 563 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 564 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 565 | AC_DEFINE([PTY_ZEROREAD], [1], [read(1) can return 0 for a non-closed fd]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 566 | AC_DEFINE([PLATFORM_SYS_DIR_UID], 2, [System dirs owned by bin (uid 2)]) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 567 | ;; |
Darren Tucker | 898ac93 | 2013-06-03 02:03:25 +1000 | [diff] [blame] | 568 | *-*-android*) |
| 569 | AC_DEFINE([DISABLE_UTMP], [1], [Define if you don't want to use utmp]) |
| 570 | AC_DEFINE([DISABLE_WTMP], [1], [Define if you don't want to use wtmp]) |
| 571 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 572 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 573 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 574 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 575 | AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin]) |
| 576 | AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 577 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 578 | [Define to disable UID restoration test]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 579 | AC_DEFINE([DISABLE_SHADOW], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 580 | [Define if you want to disable shadow passwords]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 581 | AC_DEFINE([NO_X11_UNIX_SOCKETS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 582 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 583 | AC_DEFINE([DISABLE_FD_PASSING], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 584 | [Define if your platform needs to skip post auth |
| 585 | file descriptor passing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 586 | AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) |
Darren Tucker | fdce373 | 2014-01-18 21:12:42 +1100 | [diff] [blame] | 587 | AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) |
| 588 | # Cygwin defines optargs, optargs as declspec(dllimport) for historical |
| 589 | # reasons which cause compile warnings, so we disable those warnings. |
| 590 | OSSH_CHECK_CFLAG_COMPILE([-Wno-attributes]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 591 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 592 | *-*-dgux*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 593 | AC_DEFINE([IP_TOS_IS_BROKEN], [1], |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 594 | [Define if your system choked on IP TOS setting]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 595 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 596 | AC_DEFINE([BROKEN_SETREUID]) |
| 597 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 598 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 599 | *-*-darwin*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 600 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 601 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
| 602 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 603 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 604 | exit(0); |
| 605 | else |
| 606 | exit(1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 607 | } |
| 608 | ]])], |
| 609 | [AC_MSG_RESULT([working])], |
| 610 | [AC_MSG_RESULT([buggy]) |
| 611 | AC_DEFINE([BROKEN_GETADDRINFO], [1], |
| 612 | [getaddrinfo is broken (if present)]) |
| 613 | ], |
| 614 | [AC_MSG_RESULT([assume it is working])]) |
| 615 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 616 | AC_DEFINE([BROKEN_SETREUID]) |
| 617 | AC_DEFINE([BROKEN_SETREGID]) |
| 618 | AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) |
| 619 | AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 620 | [Define if your resolver libs need this for getrrsetbyname]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 621 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
| 622 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 623 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 624 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 625 | [Prepend the address family to IP tunnel traffic]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 626 | m4_pattern_allow([AU_IPv]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 627 | AC_CHECK_DECL([AU_IPv4], [], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 628 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 629 | [#include <bsm/audit.h>] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 630 | AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 631 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 632 | ) |
Damien Miller | c09182f | 2011-06-03 12:11:38 +1000 | [diff] [blame] | 633 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
| 634 | [Define to a Set Process Title type if your system is |
| 635 | supported by bsd-setproctitle.c]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 636 | AC_CHECK_FUNCS([sandbox_init]) |
| 637 | AC_CHECK_HEADERS([sandbox.h]) |
Damien Miller | 39f303b | 2016-02-23 12:56:59 +1100 | [diff] [blame] | 638 | AC_CHECK_LIB([sandbox], [sandbox_apply], [ |
| 639 | SSHDLIBS="$SSHDLIBS -lsandbox" |
| 640 | ]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 641 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 642 | *-*-dragonfly*) |
| 643 | SSHDLIBS="$SSHDLIBS -lcrypt" |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 644 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 645 | ;; |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 646 | *-*-haiku*) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 647 | LIBS="$LIBS -lbsd " |
| 648 | AC_CHECK_LIB([network], [socket]) |
| 649 | AC_DEFINE([HAVE_U_INT64_T]) |
| 650 | MANTYPE=man |
| 651 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 652 | *-*-hpux*) |
| 653 | # 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] | 654 | 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] | 655 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 656 | AC_DEFINE([USE_PIPES]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 657 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 658 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 659 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 660 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 661 | AC_DEFINE([PLATFORM_SYS_DIR_UID], 2, [System dirs owned by bin (uid 2)]) |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 662 | maildir="/var/mail" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 663 | LIBS="$LIBS -lsec" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 664 | AC_CHECK_LIB([xnet], [t_error], , |
| 665 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 666 | |
| 667 | # next, we define all of the options specific to major releases |
| 668 | case "$host" in |
| 669 | *-*-hpux10*) |
| 670 | if test -z "$GCC"; then |
| 671 | CFLAGS="$CFLAGS -Ae" |
| 672 | fi |
| 673 | ;; |
| 674 | *-*-hpux11*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 675 | AC_DEFINE([PAM_SUN_CODEBASE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 676 | [Define if you are using Solaris-derived PAM which |
| 677 | passes pam_messages to the conversation function |
| 678 | with an extra level of indirection]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 679 | AC_DEFINE([DISABLE_UTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 680 | [Define if you don't want to use utmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 681 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 682 | check_for_hpux_broken_getaddrinfo=1 |
| 683 | check_for_conflicting_getspnam=1 |
| 684 | ;; |
| 685 | esac |
| 686 | |
| 687 | # lastly, we define options specific to minor releases |
| 688 | case "$host" in |
| 689 | *-*-hpux10.26) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 690 | AC_DEFINE([HAVE_SECUREWARE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 691 | [Define if you have SecureWare-based |
| 692 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 693 | disable_ptmx_check=yes |
| 694 | LIBS="$LIBS -lsecpw" |
| 695 | ;; |
| 696 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 697 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 698 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 699 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 700 | AC_DEFINE([BROKEN_INET_NTOA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 701 | [Define if you system's inet_ntoa is busted |
| 702 | (e.g. Irix gcc issue)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 703 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 704 | AC_DEFINE([BROKEN_SETREUID]) |
| 705 | AC_DEFINE([BROKEN_SETREGID]) |
| 706 | AC_DEFINE([WITH_ABBREV_NO_TTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 707 | [Define if you shouldn't strip 'tty' from your |
| 708 | ttyname in [uw]tmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 709 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 710 | ;; |
| 711 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 712 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 713 | AC_DEFINE([WITH_IRIX_ARRAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 714 | [Define if you have/want arrays |
| 715 | (cluster-wide session managment, not C arrays)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 716 | AC_DEFINE([WITH_IRIX_PROJECT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 717 | [Define if you want IRIX project management]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 718 | AC_DEFINE([WITH_IRIX_AUDIT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 719 | [Define if you want IRIX audit trails]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 720 | AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 721 | [Define if you want IRIX kernel jobs])]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 722 | AC_DEFINE([BROKEN_INET_NTOA]) |
| 723 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 724 | AC_DEFINE([BROKEN_SETREUID]) |
| 725 | AC_DEFINE([BROKEN_SETREGID]) |
| 726 | AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)]) |
| 727 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 728 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 729 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 730 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 731 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 732 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 733 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"]) |
| 734 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 735 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 736 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 737 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 738 | *-*-linux*) |
| 739 | no_dev_ptmx=1 |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 740 | use_pie=auto |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 741 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 742 | check_for_openpty_ctty_bug=1 |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 743 | dnl Target SUSv3/POSIX.1-2001 plus BSD specifics. |
| 744 | dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE |
| 745 | CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 746 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 747 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 748 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 749 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 750 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 751 | AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 752 | [Define to whatever link() returns for "not supported" |
| 753 | if it doesn't return EOPNOTSUPP.]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 754 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 755 | AC_DEFINE([USE_BTMP]) |
| 756 | AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 757 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 758 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 759 | 1.*|2.0.*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 760 | AC_DEFINE([BROKEN_CMSG_TYPE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 761 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 762 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 763 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 764 | # tun(4) forwarding compat code |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 765 | AC_CHECK_HEADERS([linux/if_tun.h]) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 766 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 767 | AC_DEFINE([SSH_TUN_LINUX], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 768 | [Open tunnel devices the Linux tun/tap way]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 769 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 770 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 771 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 772 | [Prepend the address family to IP tunnel traffic]) |
| 773 | fi |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 774 | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], |
| 775 | [], [#include <linux/types.h>]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 776 | AC_MSG_CHECKING([for seccomp architecture]) |
| 777 | seccomp_audit_arch= |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 778 | case "$host" in |
| 779 | x86_64-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 780 | seccomp_audit_arch=AUDIT_ARCH_X86_64 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 781 | ;; |
| 782 | i*86-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 783 | seccomp_audit_arch=AUDIT_ARCH_I386 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 784 | ;; |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 785 | arm*-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 786 | seccomp_audit_arch=AUDIT_ARCH_ARM |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 787 | ;; |
| 788 | aarch64*-*) |
| 789 | seccomp_audit_arch=AUDIT_ARCH_AARCH64 |
Damien Miller | 5c15e22 | 2015-06-18 15:07:56 +1000 | [diff] [blame] | 790 | ;; |
Damien Miller | b9c5061 | 2016-07-08 13:59:13 +1000 | [diff] [blame] | 791 | s390x-*) |
| 792 | seccomp_audit_arch=AUDIT_ARCH_S390X |
| 793 | ;; |
| 794 | s390-*) |
| 795 | seccomp_audit_arch=AUDIT_ARCH_S390 |
| 796 | ;; |
| 797 | powerpc64-*) |
| 798 | seccomp_audit_arch=AUDIT_ARCH_PPC64 |
| 799 | ;; |
| 800 | powerpc64le-*) |
| 801 | seccomp_audit_arch=AUDIT_ARCH_PPC64LE |
| 802 | ;; |
| 803 | mips-*) |
| 804 | seccomp_audit_arch=AUDIT_ARCH_MIPS |
| 805 | ;; |
| 806 | mipsel-*) |
| 807 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL |
| 808 | ;; |
| 809 | mips64-*) |
| 810 | seccomp_audit_arch=AUDIT_ARCH_MIPS64 |
| 811 | ;; |
| 812 | mips64el-*) |
| 813 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64 |
| 814 | ;; |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 815 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 816 | if test "x$seccomp_audit_arch" != "x" ; then |
| 817 | AC_MSG_RESULT(["$seccomp_audit_arch"]) |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 818 | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], |
| 819 | [Specify the system call convention in use]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 820 | else |
| 821 | AC_MSG_RESULT([architecture not supported]) |
| 822 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 823 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 824 | mips-sony-bsd|mips-sony-newsos4) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 825 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 826 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 827 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 828 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 829 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 830 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 831 | need_dash_r=1 |
| 832 | fi |
Damien Miller | 99522ba | 2016-07-28 08:54:27 +1000 | [diff] [blame] | 833 | CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 834 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 835 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 836 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 837 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 838 | [Prepend the address family to IP tunnel traffic]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 839 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | f5bbd3b | 2014-01-30 11:26:46 +1100 | [diff] [blame] | 840 | AC_DEFINE([BROKEN_READ_COMPARISON], [1], |
| 841 | [NetBSD read function is sometimes redirected, breaking atomicio comparisons against it]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 842 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 843 | *-*-freebsd*) |
| 844 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 845 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)]) |
| 846 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 847 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 848 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 849 | AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 850 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | 2035b22 | 2014-01-26 09:39:53 +1100 | [diff] [blame] | 851 | # Preauth crypto occasionally uses file descriptors for crypto offload |
| 852 | # and will crash if they cannot be opened. |
Damien Miller | 5b447c0 | 2014-01-26 09:46:53 +1100 | [diff] [blame] | 853 | AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE], [1], |
Tim Rice | 03ae081 | 2014-02-21 09:09:34 -0800 | [diff] [blame] | 854 | [define if setrlimit RLIMIT_NOFILE breaks things]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 855 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 856 | *-*-bsdi*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 857 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 858 | AC_DEFINE([BROKEN_SETREUID]) |
| 859 | AC_DEFINE([BROKEN_SETREGID]) |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 860 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 861 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 862 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 863 | conf_utmp_location=/etc/utmp |
| 864 | conf_wtmp_location=/usr/adm/wtmp |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 865 | maildir=/usr/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 866 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
| 867 | AC_DEFINE([BROKEN_REALPATH]) |
| 868 | AC_DEFINE([USE_PIPES]) |
| 869 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 870 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 871 | *-*-openbsd*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 872 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 873 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
| 874 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
| 875 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
| 876 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 877 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 878 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 879 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 880 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 881 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 882 | need_dash_r=1 |
| 883 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 884 | AC_DEFINE([PAM_SUN_CODEBASE]) |
| 885 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 886 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 887 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 888 | [Define if pam_chauthtok wants real uid set |
| 889 | to the unpriv'ed user]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 890 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 891 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 892 | AC_DEFINE([SSHD_ACQUIRES_CTTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 893 | [Define if sshd somehow reacquires a controlling TTY |
| 894 | after setsid()]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 895 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 896 | in case the name is longer than 8 chars]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 897 | AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 898 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 899 | # hardwire lastlog location (can't detect it on some versions) |
| 900 | conf_lastlog_location="/var/adm/lastlog" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 901 | AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 902 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 903 | if test "$sol2ver" -ge 8; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 904 | AC_MSG_RESULT([yes]) |
| 905 | AC_DEFINE([DISABLE_UTMP]) |
| 906 | AC_DEFINE([DISABLE_WTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 907 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 908 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 909 | AC_MSG_RESULT([no]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 910 | fi |
Darren Tucker | a86ec4d | 2016-06-14 10:48:27 +1000 | [diff] [blame] | 911 | AC_CHECK_FUNCS([setpflags]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 912 | AC_CHECK_FUNCS([setppriv]) |
| 913 | AC_CHECK_FUNCS([priv_basicset]) |
| 914 | AC_CHECK_HEADERS([priv.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 915 | AC_ARG_WITH([solaris-contracts], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 916 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 917 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 918 | AC_CHECK_LIB([contract], [ct_tmpl_activate], |
| 919 | [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 920 | [Define if you have Solaris process contracts]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 921 | LIBS="$LIBS -lcontract" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 922 | SPC_MSG="yes" ], ) |
| 923 | ], |
| 924 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 925 | AC_ARG_WITH([solaris-projects], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 926 | [ --with-solaris-projects Enable Solaris projects (experimental)], |
| 927 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 928 | AC_CHECK_LIB([project], [setproject], |
| 929 | [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 930 | [Define if you have Solaris projects]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 931 | LIBS="$LIBS -lproject" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 932 | SP_MSG="yes" ], ) |
| 933 | ], |
| 934 | ) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 935 | AC_ARG_WITH([solaris-privs], |
| 936 | [ --with-solaris-privs Enable Solaris/Illumos privileges (experimental)], |
| 937 | [ |
| 938 | AC_MSG_CHECKING([for Solaris/Illumos privilege support]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 939 | if test "x$ac_cv_func_setppriv" = "xyes" -a \ |
| 940 | "x$ac_cv_header_priv_h" = "xyes" ; then |
| 941 | SOLARIS_PRIVS=yes |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 942 | AC_MSG_RESULT([found]) |
| 943 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 944 | [Define to disable UID restoration test]) |
| 945 | AC_DEFINE([USE_SOLARIS_PRIVS], [1], |
| 946 | [Define if you have Solaris privileges]) |
| 947 | SPP_MSG="yes" |
| 948 | else |
| 949 | AC_MSG_RESULT([not found]) |
| 950 | AC_MSG_ERROR([*** must have support for Solaris privileges to use --with-solaris-privs]) |
| 951 | fi |
| 952 | ], |
| 953 | ) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 954 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 955 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 956 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 957 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 958 | AC_CHECK_FUNCS([getpwanam]) |
| 959 | AC_DEFINE([PAM_SUN_CODEBASE]) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 960 | conf_utmp_location=/etc/utmp |
| 961 | conf_wtmp_location=/var/adm/wtmp |
| 962 | conf_lastlog_location=/var/adm/lastlog |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 963 | AC_DEFINE([USE_PIPES]) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 964 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 965 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 966 | LIBS="$LIBS -lc89" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 967 | AC_DEFINE([USE_PIPES]) |
| 968 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 969 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 970 | AC_DEFINE([BROKEN_SETREUID]) |
| 971 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 972 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 973 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 974 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 975 | AC_CHECK_LIB([dl], [dlsym], ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 976 | # -lresolv needs to be at the end of LIBS or DNS lookups break |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 977 | AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 978 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 979 | AC_DEFINE([USE_PIPES]) |
| 980 | AC_DEFINE([IP_TOS_IS_BROKEN]) |
| 981 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 982 | AC_DEFINE([BROKEN_SETREUID]) |
| 983 | AC_DEFINE([BROKEN_SETREGID]) |
| 984 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 985 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 986 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 987 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 988 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 989 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 990 | # 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] | 991 | *-*-sysv4.2*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 992 | AC_DEFINE([USE_PIPES]) |
| 993 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 994 | AC_DEFINE([BROKEN_SETREUID]) |
| 995 | AC_DEFINE([BROKEN_SETREGID]) |
| 996 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) |
| 997 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 998 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 999 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1000 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1001 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 1002 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1003 | AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars]) |
| 1004 | AC_DEFINE([USE_PIPES]) |
| 1005 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1006 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1007 | AC_DEFINE([BROKEN_SETREUID]) |
| 1008 | AC_DEFINE([BROKEN_SETREGID]) |
| 1009 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1010 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1011 | case "$host" in |
| 1012 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 1013 | maildir=/var/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1014 | AC_DEFINE([BROKEN_LIBIAF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1015 | [ia_uinfo routines not supported by OS yet]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1016 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1017 | AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot" |
| 1018 | AC_CHECK_FUNCS([getluid setluid], , , [-lprot]) |
| 1019 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1020 | AC_DEFINE([DISABLE_SHADOW]) |
| 1021 | ], , ) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1022 | ;; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1023 | *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 2676791 | 2009-01-07 20:50:08 -0800 | [diff] [blame] | 1024 | check_for_libcrypt_later=1 |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 1025 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1026 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1027 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1028 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1029 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1030 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1031 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 1032 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1033 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1034 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1035 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 1036 | if test -z "$GCC"; then |
| 1037 | CFLAGS="$CFLAGS -belf" |
| 1038 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 1039 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1040 | no_dev_ptmx=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1041 | AC_DEFINE([USE_PIPES]) |
| 1042 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1043 | AC_DEFINE([DISABLE_SHADOW]) |
| 1044 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1045 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1046 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1047 | AC_DEFINE([BROKEN_SETREUID]) |
| 1048 | AC_DEFINE([BROKEN_SETREGID]) |
| 1049 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1050 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1051 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
| 1052 | AC_CHECK_FUNCS([getluid setluid]) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1053 | MANTYPE=man |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1054 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 1055 | SKIP_DISABLE_LASTLOG_DEFINE=yes |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1056 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1057 | *-*-unicosmk*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1058 | AC_DEFINE([NO_SSH_LASTLOG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1059 | [Define if you don't want to use lastlog in session.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1060 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1061 | AC_DEFINE([BROKEN_SETREUID]) |
| 1062 | AC_DEFINE([BROKEN_SETREGID]) |
| 1063 | AC_DEFINE([USE_PIPES]) |
| 1064 | AC_DEFINE([DISABLE_FD_PASSING]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1065 | LDFLAGS="$LDFLAGS" |
| 1066 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1067 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 1068 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1069 | *-*-unicosmp*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1070 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1071 | AC_DEFINE([BROKEN_SETREUID]) |
| 1072 | AC_DEFINE([BROKEN_SETREGID]) |
| 1073 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1074 | AC_DEFINE([USE_PIPES]) |
| 1075 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1076 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 1077 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1078 | MANTYPE=cat |
| 1079 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 1080 | *-*-unicos*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1081 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1082 | AC_DEFINE([BROKEN_SETREUID]) |
| 1083 | AC_DEFINE([BROKEN_SETREGID]) |
| 1084 | AC_DEFINE([USE_PIPES]) |
| 1085 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1086 | AC_DEFINE([NO_SSH_LASTLOG]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1087 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 1088 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1089 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 1090 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1091 | *-dec-osf*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1092 | AC_MSG_CHECKING([for Digital Unix SIA]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1093 | no_osfsia="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1094 | AC_ARG_WITH([osfsia], |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1095 | [ --with-osfsia Enable Digital Unix SIA], |
| 1096 | [ |
| 1097 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1098 | AC_MSG_RESULT([disabled]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1099 | no_osfsia=1 |
| 1100 | fi |
| 1101 | ], |
| 1102 | ) |
| 1103 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1104 | if test -f /etc/sia/matrix.conf; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1105 | AC_MSG_RESULT([yes]) |
| 1106 | AC_DEFINE([HAVE_OSF_SIA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1107 | [Define if you have Digital Unix Security |
| 1108 | Integration Architecture]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1109 | AC_DEFINE([DISABLE_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1110 | [Define if you don't want to use your |
| 1111 | system's login() call]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1112 | AC_DEFINE([DISABLE_FD_PASSING]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1113 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1114 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1115 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1116 | AC_MSG_RESULT([no]) |
| 1117 | AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1118 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1119 | fi |
| 1120 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1121 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1122 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1123 | AC_DEFINE([BROKEN_SETREUID]) |
| 1124 | AC_DEFINE([BROKEN_SETREGID]) |
| 1125 | AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1126 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1127 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 1128 | *-*-nto-qnx*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1129 | AC_DEFINE([USE_PIPES]) |
| 1130 | AC_DEFINE([NO_X11_UNIX_SOCKETS]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1131 | AC_DEFINE([DISABLE_LASTLOG]) |
| 1132 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 1133 | AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 1134 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1135 | case "$host" in |
| 1136 | *-*-nto-qnx6*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1137 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1138 | ;; |
| 1139 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1140 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 1141 | |
| 1142 | *-*-ultrix*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1143 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1144 | AC_DEFINE([NEED_SETPGRP]) |
| 1145 | AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix]) |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 1146 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1147 | |
| 1148 | *-*-lynxos) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 1149 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
| 1150 | AC_DEFINE([BROKEN_SETVBUF], [1], |
| 1151 | [LynxOS has broken setvbuf() implementation]) |
| 1152 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1153 | esac |
| 1154 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1155 | AC_MSG_CHECKING([compiler and flags for sanity]) |
| 1156 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], |
| 1157 | [ AC_MSG_RESULT([yes]) ], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1158 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1159 | AC_MSG_RESULT([no]) |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1160 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1161 | ], |
| 1162 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1163 | ) |
| 1164 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1165 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1166 | # Checks for libraries. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1167 | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1168 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1169 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1170 | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ |
| 1171 | AC_CHECK_LIB([gen], [dirname], [ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1172 | AC_CACHE_CHECK([for broken dirname], |
| 1173 | ac_cv_have_broken_dirname, [ |
| 1174 | save_LIBS="$LIBS" |
| 1175 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1176 | AC_RUN_IFELSE( |
| 1177 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1178 | #include <libgen.h> |
| 1179 | #include <string.h> |
| 1180 | |
| 1181 | int main(int argc, char **argv) { |
| 1182 | char *s, buf[32]; |
| 1183 | |
| 1184 | strncpy(buf,"/etc", 32); |
| 1185 | s = dirname(buf); |
| 1186 | if (!s || strncmp(s, "/", 32) != 0) { |
| 1187 | exit(1); |
| 1188 | } else { |
| 1189 | exit(0); |
| 1190 | } |
| 1191 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1192 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1193 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1194 | [ ac_cv_have_broken_dirname="yes" ], |
| 1195 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1196 | ) |
| 1197 | LIBS="$save_LIBS" |
| 1198 | ]) |
| 1199 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 1200 | LIBS="$LIBS -lgen" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1201 | AC_DEFINE([HAVE_DIRNAME]) |
| 1202 | AC_CHECK_HEADERS([libgen.h]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1203 | fi |
| 1204 | ]) |
| 1205 | ]) |
| 1206 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1207 | AC_CHECK_FUNC([getspnam], , |
| 1208 | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) |
| 1209 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
| 1210 | [Define if you have the basename function.])]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1211 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1212 | dnl zlib is required |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1213 | AC_ARG_WITH([zlib], |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1214 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1215 | [ if test "x$withval" = "xno" ; then |
| 1216 | AC_MSG_ERROR([*** zlib is required ***]) |
| 1217 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1218 | if test -d "$withval/lib"; then |
| 1219 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1220 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1221 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1222 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1223 | fi |
| 1224 | else |
| 1225 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1226 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1227 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1228 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1229 | fi |
| 1230 | fi |
| 1231 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1232 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1233 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1234 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1235 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1236 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1237 | ) |
| 1238 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1239 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) |
| 1240 | AC_CHECK_LIB([z], [deflate], , |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1241 | [ |
| 1242 | saved_CPPFLAGS="$CPPFLAGS" |
| 1243 | saved_LDFLAGS="$LDFLAGS" |
| 1244 | save_LIBS="$LIBS" |
| 1245 | dnl Check default zlib install dir |
| 1246 | if test -n "${need_dash_r}"; then |
| 1247 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 1248 | else |
| 1249 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1250 | fi |
| 1251 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1252 | LIBS="$LIBS -lz" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1253 | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1254 | [ |
| 1255 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1256 | ] |
| 1257 | ) |
| 1258 | ] |
| 1259 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1260 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1261 | AC_ARG_WITH([zlib-version-check], |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1262 | [ --without-zlib-version-check Disable zlib version check], |
| 1263 | [ if test "x$withval" = "xno" ; then |
| 1264 | zlib_check_nonfatal=1 |
| 1265 | fi |
| 1266 | ] |
| 1267 | ) |
| 1268 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1269 | AC_MSG_CHECKING([for possibly buggy zlib]) |
| 1270 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1271 | #include <stdio.h> |
Darren Tucker | c8a0f27 | 2013-03-22 12:49:14 +1100 | [diff] [blame] | 1272 | #include <stdlib.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1273 | #include <zlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1274 | ]], |
| 1275 | [[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1276 | int a=0, b=0, c=0, d=0, n, v; |
| 1277 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1278 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1279 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1280 | v = a*1000000 + b*10000 + c*100 + d; |
| 1281 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1282 | |
| 1283 | /* 1.1.4 is OK */ |
| 1284 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1285 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1286 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1287 | /* 1.2.3 and up are OK */ |
| 1288 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1289 | exit(0); |
| 1290 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1291 | exit(2); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1292 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1293 | AC_MSG_RESULT([no]), |
| 1294 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1295 | if test -z "$zlib_check_nonfatal" ; then |
| 1296 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1297 | Your reported zlib version has known security problems. It's possible your |
| 1298 | vendor has fixed these problems without changing the version number. If you |
| 1299 | are sure this is the case, you can disable the check by running |
| 1300 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1301 | 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] | 1302 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1303 | else |
| 1304 | AC_MSG_WARN([zlib version may have security problems]) |
| 1305 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1306 | ], |
| 1307 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1308 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1309 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1310 | dnl UnixWare 2.x |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1311 | AC_CHECK_FUNC([strcasecmp], |
| 1312 | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1313 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1314 | AC_CHECK_FUNCS([utimes], |
| 1315 | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1316 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1317 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1318 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1319 | dnl Checks for libutil functions |
Damien Miller | b87f6b7 | 2013-02-23 09:12:23 +1100 | [diff] [blame] | 1320 | AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1321 | AC_SEARCH_LIBS([fmt_scaled], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1322 | AC_SEARCH_LIBS([scan_scaled], [util bsd]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1323 | AC_SEARCH_LIBS([login], [util bsd]) |
| 1324 | AC_SEARCH_LIBS([logout], [util bsd]) |
| 1325 | AC_SEARCH_LIBS([logwtmp], [util bsd]) |
| 1326 | AC_SEARCH_LIBS([openpty], [util bsd]) |
| 1327 | AC_SEARCH_LIBS([updwtmp], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1328 | AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp]) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1329 | |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1330 | # On some platforms, inet_ntop and gethostbyname may be found in libresolv |
| 1331 | # or libnsl. |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1332 | AC_SEARCH_LIBS([inet_ntop], [resolv nsl]) |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1333 | AC_SEARCH_LIBS([gethostbyname], [resolv nsl]) |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1334 | |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1335 | AC_FUNC_STRFTIME |
| 1336 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1337 | # Check for ALTDIRFUNC glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1338 | AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support]) |
| 1339 | AC_EGREP_CPP([FOUNDIT], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1340 | [ |
| 1341 | #include <glob.h> |
| 1342 | #ifdef GLOB_ALTDIRFUNC |
| 1343 | FOUNDIT |
| 1344 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1345 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1346 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1347 | AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1348 | [Define if your system glob() function has |
| 1349 | the GLOB_ALTDIRFUNC extension]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1350 | AC_MSG_RESULT([yes]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1351 | ], |
| 1352 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1353 | AC_MSG_RESULT([no]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1354 | ] |
| 1355 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1356 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1357 | # Check for g.gl_matchc glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1358 | AC_MSG_CHECKING([for gl_matchc field in glob_t]) |
| 1359 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], |
| 1360 | [[ glob_t g; g.gl_matchc = 1; ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1361 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1362 | AC_DEFINE([GLOB_HAS_GL_MATCHC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1363 | [Define if your system glob() function has |
| 1364 | gl_matchc options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1365 | AC_MSG_RESULT([yes]) |
| 1366 | ], [ |
| 1367 | AC_MSG_RESULT([no]) |
| 1368 | ]) |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1369 | |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1370 | # Check for g.gl_statv glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1371 | AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob]) |
| 1372 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[ |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1373 | #ifndef GLOB_KEEPSTAT |
| 1374 | #error "glob does not support GLOB_KEEPSTAT extension" |
| 1375 | #endif |
| 1376 | glob_t g; |
| 1377 | g.gl_statv = NULL; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1378 | ]])], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1379 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1380 | AC_DEFINE([GLOB_HAS_GL_STATV], [1], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1381 | [Define if your system glob() function has |
| 1382 | gl_statv options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1383 | AC_MSG_RESULT([yes]) |
| 1384 | ], [ |
| 1385 | AC_MSG_RESULT([no]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1386 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1387 | ]) |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1388 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1389 | AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>]) |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1390 | |
Darren Tucker | 7df91b0 | 2016-07-14 12:25:24 +1000 | [diff] [blame] | 1391 | AC_CHECK_DECL([VIS_ALL], , |
| 1392 | AC_DEFINE(BROKEN_STRNVIS, 1, [missing VIS_ALL]), [#include <vis.h>]) |
| 1393 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1394 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1395 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1396 | [AC_LANG_PROGRAM([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1397 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1398 | #include <dirent.h>]], |
| 1399 | [[ |
| 1400 | struct dirent d; |
| 1401 | exit(sizeof(d.d_name)<=sizeof(char)); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1402 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1403 | [AC_MSG_RESULT([yes])], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1404 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1405 | AC_MSG_RESULT([no]) |
| 1406 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1407 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1408 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1409 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1410 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1411 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1412 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1413 | ] |
| 1414 | ) |
| 1415 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1416 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1417 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1418 | AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) |
| 1419 | AC_MSG_RESULT([yes]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1420 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1421 | AC_MSG_RESULT([no]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1422 | fi |
| 1423 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1424 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1425 | SKEY_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1426 | AC_ARG_WITH([skey], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1427 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1428 | [ |
| 1429 | if test "x$withval" != "xno" ; then |
| 1430 | |
| 1431 | if test "x$withval" != "xyes" ; then |
| 1432 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1433 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1434 | fi |
| 1435 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1436 | AC_DEFINE([SKEY], [1], [Define if you want S/Key support]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1437 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1438 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1439 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1440 | AC_MSG_CHECKING([for s/key support]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1441 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1442 | [AC_LANG_PROGRAM([[ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1443 | #include <stdio.h> |
| 1444 | #include <skey.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1445 | ]], [[ |
| 1446 | char *ff = skey_keyinfo(""); ff=""; |
| 1447 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1448 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1449 | [AC_MSG_RESULT([yes])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1450 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1451 | AC_MSG_RESULT([no]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1452 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1453 | ]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1454 | AC_MSG_CHECKING([if skeychallenge takes 4 arguments]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1455 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1456 | #include <stdio.h> |
| 1457 | #include <skey.h> |
| 1458 | ]], [[ |
| 1459 | (void)skeychallenge(NULL,"name","",0); |
| 1460 | ]])], |
| 1461 | [ |
| 1462 | AC_MSG_RESULT([yes]) |
| 1463 | AC_DEFINE([SKEYCHALLENGE_4ARG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1464 | [Define if your skeychallenge() |
| 1465 | function takes 4 arguments (NetBSD)])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1466 | [ |
| 1467 | AC_MSG_RESULT([no]) |
| 1468 | ]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1469 | fi |
| 1470 | ] |
| 1471 | ) |
| 1472 | |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1473 | # Check whether user wants to use ldns |
| 1474 | LDNS_MSG="no" |
| 1475 | AC_ARG_WITH(ldns, |
| 1476 | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1477 | [ |
| 1478 | ldns="" |
| 1479 | if test "x$withval" = "xyes" ; then |
| 1480 | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) |
| 1481 | if test "x$PKGCONFIG" = "xno"; then |
| 1482 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1483 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1484 | LIBS="-lldns $LIBS" |
| 1485 | ldns=yes |
| 1486 | else |
| 1487 | LIBS="$LIBS `$LDNSCONFIG --libs`" |
| 1488 | CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`" |
| 1489 | fi |
| 1490 | elif test "x$withval" != "xno" ; then |
| 1491 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1492 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1493 | LIBS="-lldns $LIBS" |
| 1494 | ldns=yes |
| 1495 | fi |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1496 | |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1497 | # Verify that it works. |
| 1498 | if test "x$ldns" = "xyes" ; then |
| 1499 | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) |
| 1500 | LDNS_MSG="yes" |
| 1501 | AC_MSG_CHECKING([for ldns support]) |
| 1502 | AC_LINK_IFELSE( |
| 1503 | [AC_LANG_SOURCE([[ |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1504 | #include <stdio.h> |
| 1505 | #include <stdlib.h> |
| 1506 | #include <stdint.h> |
| 1507 | #include <ldns/ldns.h> |
| 1508 | int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); } |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1509 | ]]) |
| 1510 | ], |
| 1511 | [AC_MSG_RESULT(yes)], |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1512 | [ |
| 1513 | AC_MSG_RESULT(no) |
| 1514 | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) |
| 1515 | ]) |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1516 | fi |
| 1517 | ]) |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1518 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1519 | # Check whether user wants libedit support |
| 1520 | LIBEDIT_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1521 | AC_ARG_WITH([libedit], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1522 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1523 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1524 | if test "x$withval" = "xyes" ; then |
Darren Tucker | 5935389 | 2012-05-19 15:24:37 +1000 | [diff] [blame] | 1525 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1526 | if test "x$PKGCONFIG" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1527 | AC_MSG_CHECKING([if $PKGCONFIG knows about libedit]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1528 | if "$PKGCONFIG" libedit; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1529 | AC_MSG_RESULT([yes]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1530 | use_pkgconfig_for_libedit=yes |
| 1531 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1532 | AC_MSG_RESULT([no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1533 | fi |
| 1534 | fi |
| 1535 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1536 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1537 | if test -n "${need_dash_r}"; then |
| 1538 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1539 | else |
| 1540 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1541 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1542 | fi |
Damien Miller | 1f78980 | 2010-10-11 22:35:22 +1100 | [diff] [blame] | 1543 | if test "x$use_pkgconfig_for_libedit" = "xyes"; then |
Darren Tucker | 8369c8e | 2013-12-05 11:00:16 +1100 | [diff] [blame] | 1544 | LIBEDIT=`$PKGCONFIG --libs libedit` |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1545 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1546 | else |
| 1547 | LIBEDIT="-ledit -lcurses" |
| 1548 | fi |
| 1549 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1550 | AC_CHECK_LIB([edit], [el_init], |
| 1551 | [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1552 | LIBEDIT_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1553 | AC_SUBST([LIBEDIT]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1554 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1555 | [ AC_MSG_ERROR([libedit not found]) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1556 | [ $OTHERLIBS ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1557 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1558 | AC_MSG_CHECKING([if libedit version is compatible]) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1559 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1560 | [AC_LANG_PROGRAM([[ #include <histedit.h> ]], |
| 1561 | [[ |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1562 | int i = H_SETSIZE; |
| 1563 | el_init("", NULL, NULL, NULL); |
| 1564 | exit(0); |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1565 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1566 | [ AC_MSG_RESULT([yes]) ], |
| 1567 | [ AC_MSG_RESULT([no]) |
| 1568 | AC_MSG_ERROR([libedit version is not compatible]) ] |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1569 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1570 | fi ] |
| 1571 | ) |
| 1572 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1573 | AUDIT_MODULE=none |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1574 | AC_ARG_WITH([audit], |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1575 | [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1576 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1577 | AC_MSG_CHECKING([for supported audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1578 | case "$withval" in |
| 1579 | bsm) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1580 | AC_MSG_RESULT([bsm]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1581 | AUDIT_MODULE=bsm |
| 1582 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1583 | AC_CHECK_HEADERS([bsm/audit.h], [], |
| 1584 | [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1585 | [ |
| 1586 | #ifdef HAVE_TIME_H |
| 1587 | # include <time.h> |
| 1588 | #endif |
| 1589 | ] |
| 1590 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1591 | AC_CHECK_LIB([bsm], [getaudit], [], |
| 1592 | [AC_MSG_ERROR([BSM enabled and required library not found])]) |
| 1593 | AC_CHECK_FUNCS([getaudit], [], |
| 1594 | [AC_MSG_ERROR([BSM enabled and required function not found])]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1595 | # These are optional |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1596 | AC_CHECK_FUNCS([getaudit_addr aug_get_machine]) |
| 1597 | AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module]) |
Darren Tucker | 1fcec9d | 2013-12-19 11:00:12 +1100 | [diff] [blame] | 1598 | if test "$sol2ver" -ge 11; then |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1599 | SSHDLIBS="$SSHDLIBS -lscf" |
| 1600 | AC_DEFINE([BROKEN_BSM_API], [1], |
| 1601 | [The system has incomplete BSM API]) |
Darren Tucker | 93a2d41 | 2012-02-24 10:40:41 +1100 | [diff] [blame] | 1602 | fi |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1603 | ;; |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1604 | linux) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1605 | AC_MSG_RESULT([linux]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1606 | AUDIT_MODULE=linux |
| 1607 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1608 | AC_CHECK_HEADERS([libaudit.h]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1609 | SSHDLIBS="$SSHDLIBS -laudit" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1610 | AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1611 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1612 | debug) |
| 1613 | AUDIT_MODULE=debug |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1614 | AC_MSG_RESULT([debug]) |
| 1615 | AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1616 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1617 | no) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1618 | AC_MSG_RESULT([no]) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1619 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1620 | *) |
| 1621 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1622 | ;; |
| 1623 | esac ] |
| 1624 | ) |
| 1625 | |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1626 | AC_ARG_WITH([pie], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 1627 | [ --with-pie Build Position Independent Executables if possible], [ |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1628 | if test "x$withval" = "xno"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1629 | use_pie=no |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1630 | fi |
| 1631 | if test "x$withval" = "xyes"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1632 | use_pie=yes |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1633 | fi |
| 1634 | ] |
| 1635 | ) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1636 | if test "x$use_pie" = "x"; then |
| 1637 | use_pie=no |
| 1638 | fi |
| 1639 | if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then |
| 1640 | # Turn off automatic PIE when toolchain hardening is off. |
| 1641 | use_pie=no |
| 1642 | fi |
Damien Miller | c161fc9 | 2014-01-29 21:01:33 +1100 | [diff] [blame] | 1643 | if test "x$use_pie" = "xauto"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1644 | # Automatic PIE requires gcc >= 4.x |
| 1645 | AC_MSG_CHECKING([for gcc >= 4.x]) |
| 1646 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
| 1647 | #if !defined(__GNUC__) || __GNUC__ < 4 |
| 1648 | #error gcc is too old |
| 1649 | #endif |
| 1650 | ]])], |
| 1651 | [ AC_MSG_RESULT([yes]) ], |
| 1652 | [ AC_MSG_RESULT([no]) |
| 1653 | use_pie=no ] |
| 1654 | ) |
| 1655 | fi |
| 1656 | if test "x$use_pie" != "xno"; then |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1657 | SAVED_CFLAGS="$CFLAGS" |
| 1658 | SAVED_LDFLAGS="$LDFLAGS" |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1659 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) |
| 1660 | OSSH_CHECK_LDFLAG_LINK([-pie]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1661 | # We use both -fPIE and -pie or neither. |
| 1662 | AC_MSG_CHECKING([whether both -fPIE and -pie are supported]) |
| 1663 | if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ |
| 1664 | echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then |
| 1665 | AC_MSG_RESULT([yes]) |
| 1666 | else |
| 1667 | AC_MSG_RESULT([no]) |
| 1668 | CFLAGS="$SAVED_CFLAGS" |
| 1669 | LDFLAGS="$SAVED_LDFLAGS" |
| 1670 | fi |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1671 | fi |
| 1672 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1673 | dnl Checks for library functions. Please keep in alphabetical order |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1674 | AC_CHECK_FUNCS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1675 | Blowfish_initstate \ |
| 1676 | Blowfish_expandstate \ |
| 1677 | Blowfish_expand0state \ |
| 1678 | Blowfish_stream2word \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1679 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1680 | b64_ntop \ |
| 1681 | __b64_ntop \ |
| 1682 | b64_pton \ |
| 1683 | __b64_pton \ |
| 1684 | bcopy \ |
Damien Miller | a913442 | 2013-12-07 11:35:36 +1100 | [diff] [blame] | 1685 | bcrypt_pbkdf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1686 | bindresvport_sa \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1687 | blf_enc \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 1688 | cap_rights_limit \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1689 | clock \ |
| 1690 | closefrom \ |
| 1691 | dirfd \ |
Darren Tucker | efdf534 | 2013-05-30 08:29:08 +1000 | [diff] [blame] | 1692 | endgrent \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1693 | err \ |
| 1694 | errx \ |
Damien Miller | 1d2c456 | 2014-02-04 11:18:20 +1100 | [diff] [blame] | 1695 | explicit_bzero \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1696 | fchmod \ |
| 1697 | fchown \ |
| 1698 | freeaddrinfo \ |
Darren Tucker | a5cf1e2 | 2014-01-17 18:10:58 +1100 | [diff] [blame] | 1699 | fstatfs \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1700 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1701 | futimes \ |
| 1702 | getaddrinfo \ |
| 1703 | getcwd \ |
| 1704 | getgrouplist \ |
| 1705 | getnameinfo \ |
| 1706 | getopt \ |
| 1707 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1708 | getpeerucred \ |
Darren Tucker | 3c4a24c | 2013-02-15 11:41:35 +1100 | [diff] [blame] | 1709 | getpgid \ |
| 1710 | getpgrp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1711 | _getpty \ |
| 1712 | getrlimit \ |
| 1713 | getttyent \ |
| 1714 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1715 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1716 | inet_aton \ |
| 1717 | inet_ntoa \ |
| 1718 | inet_ntop \ |
| 1719 | innetgr \ |
Darren Tucker | d38f05d | 2017-03-20 13:38:27 +1100 | [diff] [blame^] | 1720 | llabs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1721 | login_getcapbool \ |
| 1722 | md5_crypt \ |
| 1723 | memmove \ |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1724 | memset_s \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1725 | mkdtemp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1726 | ngetaddrinfo \ |
| 1727 | nsleep \ |
| 1728 | ogetaddrinfo \ |
| 1729 | openlog_r \ |
Darren Tucker | 3ddd15e | 2015-11-30 07:23:53 +1100 | [diff] [blame] | 1730 | pledge \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1731 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1732 | prctl \ |
| 1733 | pstat \ |
| 1734 | readpassphrase \ |
Darren Tucker | 642652d | 2014-12-10 01:32:23 +1100 | [diff] [blame] | 1735 | reallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1736 | recvmsg \ |
| 1737 | rresvport_af \ |
| 1738 | sendmsg \ |
| 1739 | setdtablesize \ |
| 1740 | setegid \ |
| 1741 | setenv \ |
| 1742 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1743 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1744 | setgroups \ |
Darren Tucker | 34f702a | 2012-07-04 08:50:09 +1000 | [diff] [blame] | 1745 | setlinebuf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1746 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1747 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1748 | setpcred \ |
| 1749 | setproctitle \ |
| 1750 | setregid \ |
| 1751 | setreuid \ |
| 1752 | setrlimit \ |
| 1753 | setsid \ |
| 1754 | setvbuf \ |
| 1755 | sigaction \ |
| 1756 | sigvec \ |
| 1757 | snprintf \ |
| 1758 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1759 | statfs \ |
| 1760 | statvfs \ |
Darren Tucker | afec077 | 2016-12-13 10:23:03 +1100 | [diff] [blame] | 1761 | strcasestr \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1762 | strdup \ |
| 1763 | strerror \ |
| 1764 | strlcat \ |
| 1765 | strlcpy \ |
| 1766 | strmode \ |
Darren Tucker | b54f50e | 2011-09-29 23:17:18 +1000 | [diff] [blame] | 1767 | strnlen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1768 | strnvis \ |
Darren Tucker | aa74f67 | 2010-08-16 13:15:23 +1000 | [diff] [blame] | 1769 | strptime \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1770 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1771 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1772 | strtoul \ |
Darren Tucker | 8e6fb78 | 2013-02-15 12:13:01 +1100 | [diff] [blame] | 1773 | strtoull \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1774 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1775 | sysconf \ |
| 1776 | tcgetpgrp \ |
Damien Miller | aa18063 | 2010-10-07 21:25:27 +1100 | [diff] [blame] | 1777 | timingsafe_bcmp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1778 | truncate \ |
| 1779 | unsetenv \ |
| 1780 | updwtmpx \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1781 | user_from_uid \ |
Damien Miller | f4db77d | 2013-03-15 10:34:25 +1100 | [diff] [blame] | 1782 | usleep \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1783 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1784 | vsnprintf \ |
| 1785 | waitpid \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1786 | warn \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1787 | ]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1788 | |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 1789 | dnl Wide character support. |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1790 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1791 | |
Darren Tucker | 10e290e | 2016-12-13 13:51:32 +1100 | [diff] [blame] | 1792 | TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes} |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1793 | AC_MSG_CHECKING([for utf8 locale support]) |
| 1794 | AC_RUN_IFELSE( |
| 1795 | [AC_LANG_PROGRAM([[ |
| 1796 | #include <locale.h> |
Darren Tucker | c359950 | 2016-12-09 12:52:02 +1100 | [diff] [blame] | 1797 | #include <stdlib.h> |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1798 | ]], [[ |
| 1799 | char *loc = setlocale(LC_CTYPE, "en_US.UTF-8"); |
| 1800 | if (loc != NULL) |
| 1801 | exit(0); |
| 1802 | exit(1); |
| 1803 | ]])], |
| 1804 | AC_MSG_RESULT(yes), |
| 1805 | [AC_MSG_RESULT(no) |
| 1806 | TEST_SSH_UTF8=no], |
| 1807 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 1808 | ) |
| 1809 | |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1810 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1811 | [AC_LANG_PROGRAM( |
| 1812 | [[ #include <ctype.h> ]], |
| 1813 | [[ return (isblank('a')); ]])], |
| 1814 | [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).]) |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1815 | ]) |
| 1816 | |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1817 | disable_pkcs11= |
| 1818 | AC_ARG_ENABLE([pkcs11], |
| 1819 | [ --disable-pkcs11 disable PKCS#11 support code [no]], |
| 1820 | [ |
| 1821 | if test "x$enableval" = "xno" ; then |
| 1822 | disable_pkcs11=1 |
| 1823 | fi |
| 1824 | ] |
| 1825 | ) |
| 1826 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1827 | # PKCS11 depends on OpenSSL. |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1828 | if test "x$openssl" = "xyes" && test "x$disable_pkcs11" = "x"; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1829 | # PKCS#11 support requires dlopen() and co |
| 1830 | AC_SEARCH_LIBS([dlopen], [dl], |
| 1831 | [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])] |
| 1832 | ) |
| 1833 | fi |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1834 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1835 | # IRIX has a const char return value for gai_strerror() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1836 | AC_CHECK_FUNCS([gai_strerror], [ |
| 1837 | AC_DEFINE([HAVE_GAI_STRERROR]) |
| 1838 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1839 | #include <sys/types.h> |
| 1840 | #include <sys/socket.h> |
| 1841 | #include <netdb.h> |
| 1842 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1843 | const char *gai_strerror(int); |
| 1844 | ]], [[ |
| 1845 | char *str; |
| 1846 | str = gai_strerror(0); |
| 1847 | ]])], [ |
| 1848 | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], |
| 1849 | [Define if gai_strerror() returns const char *])], [])]) |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1850 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1851 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
| 1852 | [Some systems put nanosleep outside of libc])]) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1853 | |
Darren Tucker | a710891 | 2013-06-02 08:18:31 +1000 | [diff] [blame] | 1854 | AC_SEARCH_LIBS([clock_gettime], [rt], |
| 1855 | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) |
| 1856 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1857 | dnl Make sure prototypes are defined for these before using them. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1858 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) |
| 1859 | AC_CHECK_DECL([strsep], |
| 1860 | [AC_CHECK_FUNCS([strsep])], |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1861 | [], |
| 1862 | [ |
| 1863 | #ifdef HAVE_STRING_H |
| 1864 | # include <string.h> |
| 1865 | #endif |
| 1866 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1867 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1868 | dnl tcsendbreak might be a macro |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1869 | AC_CHECK_DECL([tcsendbreak], |
| 1870 | [AC_DEFINE([HAVE_TCSENDBREAK])], |
| 1871 | [AC_CHECK_FUNCS([tcsendbreak])], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1872 | [#include <termios.h>] |
| 1873 | ) |
| 1874 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1875 | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1876 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1877 | AC_CHECK_DECLS([SHUT_RD], , , |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1878 | [ |
| 1879 | #include <sys/types.h> |
| 1880 | #include <sys/socket.h> |
| 1881 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1882 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1883 | AC_CHECK_DECLS([O_NONBLOCK], , , |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1884 | [ |
| 1885 | #include <sys/types.h> |
| 1886 | #ifdef HAVE_SYS_STAT_H |
| 1887 | # include <sys/stat.h> |
| 1888 | #endif |
| 1889 | #ifdef HAVE_FCNTL_H |
| 1890 | # include <fcntl.h> |
| 1891 | #endif |
| 1892 | ]) |
| 1893 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1894 | AC_CHECK_DECLS([writev], , , [ |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1895 | #include <sys/types.h> |
| 1896 | #include <sys/uio.h> |
| 1897 | #include <unistd.h> |
| 1898 | ]) |
| 1899 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1900 | AC_CHECK_DECLS([MAXSYMLINKS], , , [ |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1901 | #include <sys/param.h> |
| 1902 | ]) |
| 1903 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1904 | AC_CHECK_DECLS([offsetof], , , [ |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1905 | #include <stddef.h> |
| 1906 | ]) |
| 1907 | |
Darren Tucker | c7aad00 | 2013-06-02 07:18:47 +1000 | [diff] [blame] | 1908 | # extra bits for select(2) |
| 1909 | AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ |
| 1910 | #include <sys/param.h> |
| 1911 | #include <sys/types.h> |
| 1912 | #ifdef HAVE_SYS_SYSMACROS_H |
| 1913 | #include <sys/sysmacros.h> |
| 1914 | #endif |
| 1915 | #ifdef HAVE_SYS_SELECT_H |
| 1916 | #include <sys/select.h> |
| 1917 | #endif |
| 1918 | #ifdef HAVE_SYS_TIME_H |
| 1919 | #include <sys/time.h> |
| 1920 | #endif |
| 1921 | #ifdef HAVE_UNISTD_H |
| 1922 | #include <unistd.h> |
| 1923 | #endif |
| 1924 | ]]) |
| 1925 | AC_CHECK_TYPES([fd_mask], [], [], [[ |
| 1926 | #include <sys/param.h> |
| 1927 | #include <sys/types.h> |
| 1928 | #ifdef HAVE_SYS_SELECT_H |
| 1929 | #include <sys/select.h> |
| 1930 | #endif |
| 1931 | #ifdef HAVE_SYS_TIME_H |
| 1932 | #include <sys/time.h> |
| 1933 | #endif |
| 1934 | #ifdef HAVE_UNISTD_H |
| 1935 | #include <unistd.h> |
| 1936 | #endif |
| 1937 | ]]) |
| 1938 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1939 | AC_CHECK_FUNCS([setresuid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1940 | dnl Some platorms have setresuid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1941 | AC_MSG_CHECKING([if setresuid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1942 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1943 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1944 | #include <stdlib.h> |
| 1945 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1946 | ]], [[ |
| 1947 | errno=0; |
| 1948 | setresuid(0,0,0); |
| 1949 | if (errno==ENOSYS) |
| 1950 | exit(1); |
| 1951 | else |
| 1952 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1953 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1954 | [AC_MSG_RESULT([yes])], |
| 1955 | [AC_DEFINE([BROKEN_SETRESUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1956 | [Define if your setresuid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1957 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1958 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1959 | ) |
| 1960 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1961 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1962 | AC_CHECK_FUNCS([setresgid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1963 | dnl Some platorms have setresgid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1964 | AC_MSG_CHECKING([if setresgid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1965 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1966 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1967 | #include <stdlib.h> |
| 1968 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1969 | ]], [[ |
| 1970 | errno=0; |
| 1971 | setresgid(0,0,0); |
| 1972 | if (errno==ENOSYS) |
| 1973 | exit(1); |
| 1974 | else |
| 1975 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1976 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1977 | [AC_MSG_RESULT([yes])], |
| 1978 | [AC_DEFINE([BROKEN_SETRESGID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1979 | [Define if your setresgid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1980 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1981 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1982 | ) |
| 1983 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1984 | |
Darren Tucker | d3e2aee | 2015-07-17 12:52:34 +1000 | [diff] [blame] | 1985 | AC_CHECK_FUNCS([realpath], [ |
| 1986 | dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given |
| 1987 | dnl path name", however some implementations of realpath (and some |
| 1988 | dnl versions of the POSIX spec) do not work on non-existent files, |
| 1989 | dnl so we use the OpenBSD implementation on those platforms. |
| 1990 | AC_MSG_CHECKING([if realpath works with non-existent files]) |
| 1991 | AC_RUN_IFELSE( |
| 1992 | [AC_LANG_PROGRAM([[ |
| 1993 | #include <limits.h> |
| 1994 | #include <stdlib.h> |
| 1995 | #include <errno.h> |
| 1996 | ]], [[ |
| 1997 | char buf[PATH_MAX]; |
| 1998 | if (realpath("/opensshnonexistentfilename1234", buf) == NULL) |
| 1999 | if (errno == ENOENT) |
| 2000 | exit(1); |
| 2001 | exit(0); |
| 2002 | ]])], |
| 2003 | [AC_MSG_RESULT([yes])], |
| 2004 | [AC_DEFINE([BROKEN_REALPATH], [1], |
| 2005 | [realpath does not work with nonexistent files]) |
| 2006 | AC_MSG_RESULT([no])], |
| 2007 | [AC_MSG_WARN([cross compiling: assuming working])] |
| 2008 | ) |
| 2009 | ]) |
| 2010 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2011 | dnl Checks for time functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2012 | AC_CHECK_FUNCS([gettimeofday time]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2013 | dnl Checks for utmp functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2014 | AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent]) |
| 2015 | AC_CHECK_FUNCS([utmpname]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2016 | dnl Checks for utmpx functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2017 | AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline]) |
| 2018 | AC_CHECK_FUNCS([setutxdb setutxent utmpxname]) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 2019 | dnl Checks for lastlog functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2020 | AC_CHECK_FUNCS([getlastlogxbyname]) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 2021 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2022 | AC_CHECK_FUNC([daemon], |
| 2023 | [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])], |
| 2024 | [AC_CHECK_LIB([bsd], [daemon], |
| 2025 | [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 2026 | ) |
| 2027 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2028 | AC_CHECK_FUNC([getpagesize], |
| 2029 | [AC_DEFINE([HAVE_GETPAGESIZE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2030 | [Define if your libraries define getpagesize()])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2031 | [AC_CHECK_LIB([ucb], [getpagesize], |
| 2032 | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 2033 | ) |
| 2034 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2035 | # Check for broken snprintf |
| 2036 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 2037 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2038 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2039 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 2040 | [[ |
| 2041 | char b[5]; |
| 2042 | snprintf(b,5,"123456789"); |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2043 | exit(b[4]!='\0'); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2044 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2045 | [AC_MSG_RESULT([yes])], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2046 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2047 | AC_MSG_RESULT([no]) |
| 2048 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2049 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2050 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2051 | ], |
| 2052 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2053 | ) |
| 2054 | fi |
| 2055 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2056 | # We depend on vsnprintf returning the right thing on overflow: the |
| 2057 | # number of characters it tried to create (as per SUSv3) |
| 2058 | if test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2059 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 2060 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2061 | [AC_LANG_PROGRAM([[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2062 | #include <sys/types.h> |
| 2063 | #include <stdio.h> |
| 2064 | #include <stdarg.h> |
| 2065 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2066 | int x_snprintf(char *str, size_t count, const char *fmt, ...) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2067 | { |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2068 | size_t ret; |
| 2069 | va_list ap; |
| 2070 | |
| 2071 | va_start(ap, fmt); |
| 2072 | ret = vsnprintf(str, count, fmt, ap); |
| 2073 | va_end(ap); |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2074 | return ret; |
| 2075 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2076 | ]], [[ |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2077 | char x[1]; |
| 2078 | if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11) |
| 2079 | return 1; |
| 2080 | if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11) |
| 2081 | return 1; |
| 2082 | return 0; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2083 | ]])], |
| 2084 | [AC_MSG_RESULT([yes])], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2085 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2086 | AC_MSG_RESULT([no]) |
| 2087 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2088 | [Define if your snprintf is busted]) |
| 2089 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 2090 | ], |
| 2091 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 2092 | ) |
| 2093 | fi |
| 2094 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2095 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 2096 | # check that the fmt argument is const char * or just char *. |
| 2097 | # This is only useful for when BROKEN_SNPRINTF |
| 2098 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2099 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2100 | #include <stdio.h> |
| 2101 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 2102 | ]], [[ |
| 2103 | snprintf(0, 0, 0); |
| 2104 | ]])], |
| 2105 | [AC_MSG_RESULT([yes]) |
| 2106 | AC_DEFINE([SNPRINTF_CONST], [const], |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2107 | [Define as const if snprintf() can declare const char *fmt])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2108 | [AC_MSG_RESULT([no]) |
| 2109 | AC_DEFINE([SNPRINTF_CONST], [/* not const */])]) |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2110 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2111 | # Check for missing getpeereid (or equiv) support |
| 2112 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 2113 | 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] | 2114 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2115 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2116 | #include <sys/types.h> |
| 2117 | #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])], |
| 2118 | [ AC_MSG_RESULT([yes]) |
| 2119 | AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option]) |
| 2120 | ], [AC_MSG_RESULT([no]) |
| 2121 | NO_PEERCHECK=1 |
| 2122 | ]) |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2123 | fi |
| 2124 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2125 | dnl see whether mkstemp() requires XXXXXX |
| 2126 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 2127 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2128 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2129 | [AC_LANG_PROGRAM([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2130 | #include <stdlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2131 | ]], [[ |
| 2132 | char template[]="conftest.mkstemp-test"; |
| 2133 | if (mkstemp(template) == -1) |
| 2134 | exit(1); |
| 2135 | unlink(template); |
| 2136 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2137 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2138 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2139 | AC_MSG_RESULT([no]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2140 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2141 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2142 | AC_MSG_RESULT([yes]) |
| 2143 | AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2144 | ], |
| 2145 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2146 | AC_MSG_RESULT([yes]) |
| 2147 | AC_DEFINE([HAVE_STRICT_MKSTEMP]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2148 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2149 | ) |
| 2150 | fi |
| 2151 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2152 | dnl make sure that openpty does not reacquire controlling terminal |
| 2153 | if test ! -z "$check_for_openpty_ctty_bug"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2154 | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2155 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2156 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2157 | #include <stdio.h> |
| 2158 | #include <sys/fcntl.h> |
| 2159 | #include <sys/types.h> |
| 2160 | #include <sys/wait.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2161 | ]], [[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2162 | pid_t pid; |
| 2163 | int fd, ptyfd, ttyfd, status; |
| 2164 | |
| 2165 | pid = fork(); |
| 2166 | if (pid < 0) { /* failed */ |
| 2167 | exit(1); |
| 2168 | } else if (pid > 0) { /* parent */ |
| 2169 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2170 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2171 | exit(WEXITSTATUS(status)); |
| 2172 | else |
| 2173 | exit(2); |
| 2174 | } else { /* child */ |
| 2175 | close(0); close(1); close(2); |
| 2176 | setsid(); |
| 2177 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 2178 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 2179 | if (fd >= 0) |
| 2180 | exit(3); /* Acquired ctty: broken */ |
| 2181 | else |
| 2182 | exit(0); /* Did not acquire ctty: OK */ |
| 2183 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2184 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2185 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2186 | AC_MSG_RESULT([yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2187 | ], |
| 2188 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2189 | AC_MSG_RESULT([no]) |
| 2190 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2191 | ], |
| 2192 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2193 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2194 | ] |
| 2195 | ) |
| 2196 | fi |
| 2197 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2198 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2199 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2200 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2201 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2202 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2203 | #include <stdio.h> |
| 2204 | #include <sys/socket.h> |
| 2205 | #include <netdb.h> |
| 2206 | #include <errno.h> |
| 2207 | #include <netinet/in.h> |
| 2208 | |
| 2209 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2210 | ]], [[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2211 | int err, sock; |
| 2212 | struct addrinfo *gai_ai, *ai, hints; |
| 2213 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2214 | |
| 2215 | memset(&hints, 0, sizeof(hints)); |
| 2216 | hints.ai_family = PF_UNSPEC; |
| 2217 | hints.ai_socktype = SOCK_STREAM; |
| 2218 | hints.ai_flags = AI_PASSIVE; |
| 2219 | |
| 2220 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2221 | if (err != 0) { |
| 2222 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2223 | exit(1); |
| 2224 | } |
| 2225 | |
| 2226 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2227 | if (ai->ai_family != AF_INET6) |
| 2228 | continue; |
| 2229 | |
| 2230 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2231 | sizeof(ntop), strport, sizeof(strport), |
| 2232 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2233 | |
| 2234 | if (err != 0) { |
| 2235 | if (err == EAI_SYSTEM) |
| 2236 | perror("getnameinfo EAI_SYSTEM"); |
| 2237 | else |
| 2238 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 2239 | gai_strerror(err)); |
| 2240 | exit(2); |
| 2241 | } |
| 2242 | |
| 2243 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 2244 | if (sock < 0) |
| 2245 | perror("socket"); |
| 2246 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 2247 | if (errno == EBADF) |
| 2248 | exit(3); |
| 2249 | } |
| 2250 | } |
| 2251 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2252 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2253 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2254 | AC_MSG_RESULT([yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2255 | ], |
| 2256 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2257 | AC_MSG_RESULT([no]) |
| 2258 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2259 | ], |
| 2260 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2261 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2262 | ] |
| 2263 | ) |
| 2264 | fi |
| 2265 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2266 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2267 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2268 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2269 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2270 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2271 | #include <stdio.h> |
| 2272 | #include <sys/socket.h> |
| 2273 | #include <netdb.h> |
| 2274 | #include <errno.h> |
| 2275 | #include <netinet/in.h> |
| 2276 | |
| 2277 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2278 | ]], [[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2279 | int err, sock; |
| 2280 | struct addrinfo *gai_ai, *ai, hints; |
| 2281 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2282 | |
| 2283 | memset(&hints, 0, sizeof(hints)); |
| 2284 | hints.ai_family = PF_UNSPEC; |
| 2285 | hints.ai_socktype = SOCK_STREAM; |
| 2286 | hints.ai_flags = AI_PASSIVE; |
| 2287 | |
| 2288 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2289 | if (err != 0) { |
| 2290 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2291 | exit(1); |
| 2292 | } |
| 2293 | |
| 2294 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2295 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 2296 | continue; |
| 2297 | |
| 2298 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2299 | sizeof(ntop), strport, sizeof(strport), |
| 2300 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2301 | |
| 2302 | if (ai->ai_family == AF_INET && err != 0) { |
| 2303 | perror("getnameinfo"); |
| 2304 | exit(2); |
| 2305 | } |
| 2306 | } |
| 2307 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2308 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2309 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2310 | AC_MSG_RESULT([yes]) |
| 2311 | AC_DEFINE([AIX_GETNAMEINFO_HACK], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2312 | [Define if you have a getaddrinfo that fails |
| 2313 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2314 | ], |
| 2315 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2316 | AC_MSG_RESULT([no]) |
| 2317 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2318 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 2319 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2320 | AC_MSG_RESULT([cross-compiling, assuming no]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2321 | ] |
| 2322 | ) |
| 2323 | fi |
| 2324 | |
Darren Tucker | e50e8c9 | 2015-02-21 15:10:33 +1100 | [diff] [blame] | 2325 | if test "x$ac_cv_func_getaddrinfo" = "xyes"; then |
| 2326 | AC_CHECK_DECLS(AI_NUMERICSERV, , , |
| 2327 | [#include <sys/types.h> |
| 2328 | #include <sys/socket.h> |
| 2329 | #include <netdb.h>]) |
| 2330 | fi |
| 2331 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2332 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2333 | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) |
| 2334 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], |
| 2335 | [[ exit(0); ]])], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2336 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2337 | AC_MSG_RESULT([no]) |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2338 | ], |
| 2339 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2340 | AC_MSG_RESULT([yes]) |
| 2341 | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2342 | [Conflicting defs for getspnam]) |
| 2343 | ] |
| 2344 | ) |
| 2345 | fi |
| 2346 | |
Darren Tucker | 20e5e8b | 2016-08-02 12:16:34 +1000 | [diff] [blame] | 2347 | dnl NetBSD added an strnvis and unfortunately made it incompatible with the |
| 2348 | dnl existing one in OpenBSD and Linux's libbsd (the former having existed |
| 2349 | dnl for over ten years). Despite this incompatibility being reported during |
| 2350 | dnl development (see http://gnats.netbsd.org/44977) they still shipped it. |
| 2351 | dnl Even more unfortunately FreeBSD and later MacOS picked up this incompatible |
| 2352 | dnl implementation. Try to detect this mess, and assume the only safe option |
| 2353 | dnl if we're cross compiling. |
| 2354 | dnl |
| 2355 | dnl OpenBSD, 2001: strnvis(char *dst, const char *src, size_t dlen, int flag); |
| 2356 | dnl NetBSD: 2012, strnvis(char *dst, size_t dlen, const char *src, int flag); |
| 2357 | if test "x$ac_cv_func_strnvis" = "xyes"; then |
| 2358 | AC_MSG_CHECKING([for working strnvis]) |
| 2359 | AC_RUN_IFELSE( |
| 2360 | [AC_LANG_PROGRAM([[ |
| 2361 | #include <signal.h> |
| 2362 | #include <stdlib.h> |
| 2363 | #include <string.h> |
| 2364 | #include <vis.h> |
| 2365 | static void sighandler(int sig) { _exit(1); } |
| 2366 | ]], [[ |
| 2367 | char dst[16]; |
| 2368 | |
| 2369 | signal(SIGSEGV, sighandler); |
| 2370 | if (strnvis(dst, "src", 4, 0) && strcmp(dst, "src") == 0) |
| 2371 | exit(0); |
| 2372 | exit(1) |
| 2373 | ]])], |
| 2374 | [AC_MSG_RESULT([yes])], |
| 2375 | [AC_MSG_RESULT([no]) |
| 2376 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis detected broken])], |
| 2377 | [AC_MSG_WARN([cross compiling: assuming broken]) |
| 2378 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis assumed broken])] |
| 2379 | ) |
| 2380 | fi |
| 2381 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 2382 | AC_FUNC_GETPGRP |
| 2383 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2384 | # Search for OpenSSL |
| 2385 | saved_CPPFLAGS="$CPPFLAGS" |
| 2386 | saved_LDFLAGS="$LDFLAGS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2387 | AC_ARG_WITH([ssl-dir], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2388 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 2389 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2390 | if test "x$openssl" = "xno" ; then |
| 2391 | AC_MSG_ERROR([cannot use --with-ssl-dir when OpenSSL disabled]) |
| 2392 | fi |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 2393 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 2394 | case "$withval" in |
| 2395 | # Relative paths |
| 2396 | ./*|../*) withval="`pwd`/$withval" |
| 2397 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2398 | if test -d "$withval/lib"; then |
| 2399 | if test -n "${need_dash_r}"; then |
| 2400 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 2401 | else |
| 2402 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 2403 | fi |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2404 | elif test -d "$withval/lib64"; then |
| 2405 | if test -n "${need_dash_r}"; then |
| 2406 | LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" |
| 2407 | else |
| 2408 | LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" |
| 2409 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2410 | else |
| 2411 | if test -n "${need_dash_r}"; then |
| 2412 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 2413 | else |
| 2414 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 2415 | fi |
| 2416 | fi |
| 2417 | if test -d "$withval/include"; then |
| 2418 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 2419 | else |
| 2420 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 2421 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2422 | fi |
| 2423 | ] |
| 2424 | ) |
Damien Miller | b9c5667 | 2014-05-15 14:43:37 +1000 | [diff] [blame] | 2425 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2426 | AC_ARG_WITH([openssl-header-check], |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2427 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2428 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2429 | if test "x$withval" = "xno" ; then |
| 2430 | openssl_check_nonfatal=1 |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2431 | fi |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2432 | ] |
| 2433 | ) |
| 2434 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2435 | openssl_engine=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2436 | AC_ARG_WITH([ssl-engine], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2437 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2438 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2439 | if test "x$withval" != "xno" ; then |
Darren Tucker | b5fa0cd | 2015-12-15 15:10:32 +1100 | [diff] [blame] | 2440 | if test "x$openssl" = "xno" ; then |
| 2441 | AC_MSG_ERROR([cannot use --with-ssl-engine when OpenSSL disabled]) |
| 2442 | fi |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2443 | openssl_engine=yes |
| 2444 | fi |
| 2445 | ] |
| 2446 | ) |
| 2447 | |
| 2448 | if test "x$openssl" = "xyes" ; then |
| 2449 | LIBS="-lcrypto $LIBS" |
| 2450 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1], |
| 2451 | [Define if your ssl headers are included |
| 2452 | with #include <openssl/header.h>])], |
| 2453 | [ |
| 2454 | dnl Check default openssl install dir |
| 2455 | if test -n "${need_dash_r}"; then |
| 2456 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2457 | else |
| 2458 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2459 | fi |
| 2460 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 2461 | AC_CHECK_HEADER([openssl/opensslv.h], , |
| 2462 | [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])]) |
| 2463 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])], |
| 2464 | [ |
| 2465 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 2466 | ] |
| 2467 | ) |
| 2468 | ] |
| 2469 | ) |
| 2470 | |
| 2471 | # Determine OpenSSL header version |
| 2472 | AC_MSG_CHECKING([OpenSSL header version]) |
| 2473 | AC_RUN_IFELSE( |
| 2474 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 1560596 | 2015-11-10 11:14:47 +1100 | [diff] [blame] | 2475 | #include <stdlib.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2476 | #include <stdio.h> |
| 2477 | #include <string.h> |
| 2478 | #include <openssl/opensslv.h> |
| 2479 | #define DATA "conftest.sslincver" |
| 2480 | ]], [[ |
| 2481 | FILE *fd; |
| 2482 | int rc; |
| 2483 | |
| 2484 | fd = fopen(DATA,"w"); |
| 2485 | if(fd == NULL) |
| 2486 | exit(1); |
| 2487 | |
Darren Tucker | b341353 | 2016-04-04 11:09:21 +1000 | [diff] [blame] | 2488 | if ((rc = fprintf(fd, "%08lx (%s)\n", |
| 2489 | (unsigned long)OPENSSL_VERSION_NUMBER, |
| 2490 | OPENSSL_VERSION_TEXT)) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2491 | exit(1); |
| 2492 | |
| 2493 | exit(0); |
| 2494 | ]])], |
| 2495 | [ |
| 2496 | ssl_header_ver=`cat conftest.sslincver` |
| 2497 | AC_MSG_RESULT([$ssl_header_ver]) |
| 2498 | ], |
| 2499 | [ |
| 2500 | AC_MSG_RESULT([not found]) |
| 2501 | AC_MSG_ERROR([OpenSSL version header not found.]) |
| 2502 | ], |
| 2503 | [ |
| 2504 | AC_MSG_WARN([cross compiling: not checking]) |
| 2505 | ] |
| 2506 | ) |
| 2507 | |
| 2508 | # Determine OpenSSL library version |
| 2509 | AC_MSG_CHECKING([OpenSSL library version]) |
| 2510 | AC_RUN_IFELSE( |
| 2511 | [AC_LANG_PROGRAM([[ |
| 2512 | #include <stdio.h> |
| 2513 | #include <string.h> |
| 2514 | #include <openssl/opensslv.h> |
| 2515 | #include <openssl/crypto.h> |
| 2516 | #define DATA "conftest.ssllibver" |
| 2517 | ]], [[ |
| 2518 | FILE *fd; |
| 2519 | int rc; |
| 2520 | |
| 2521 | fd = fopen(DATA,"w"); |
| 2522 | if(fd == NULL) |
| 2523 | exit(1); |
| 2524 | |
Darren Tucker | 815bcac | 2016-04-04 11:07:59 +1000 | [diff] [blame] | 2525 | if ((rc = fprintf(fd, "%08lx (%s)\n", (unsigned long)SSLeay(), |
| 2526 | SSLeay_version(SSLEAY_VERSION))) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2527 | exit(1); |
| 2528 | |
| 2529 | exit(0); |
| 2530 | ]])], |
| 2531 | [ |
| 2532 | ssl_library_ver=`cat conftest.ssllibver` |
| 2533 | # Check version is supported. |
| 2534 | case "$ssl_library_ver" in |
Damien Miller | 2429cf7 | 2017-03-14 18:01:52 +1100 | [diff] [blame] | 2535 | 10000*|0*) |
| 2536 | AC_MSG_ERROR([OpenSSL >= 1.0.1 required (have "$ssl_library_ver")]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2537 | ;; |
| 2538 | *) ;; |
| 2539 | esac |
| 2540 | AC_MSG_RESULT([$ssl_library_ver]) |
| 2541 | ], |
| 2542 | [ |
| 2543 | AC_MSG_RESULT([not found]) |
| 2544 | AC_MSG_ERROR([OpenSSL library not found.]) |
| 2545 | ], |
| 2546 | [ |
| 2547 | AC_MSG_WARN([cross compiling: not checking]) |
| 2548 | ] |
| 2549 | ) |
| 2550 | |
| 2551 | # Sanity check OpenSSL headers |
| 2552 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 2553 | AC_RUN_IFELSE( |
| 2554 | [AC_LANG_PROGRAM([[ |
| 2555 | #include <string.h> |
| 2556 | #include <openssl/opensslv.h> |
Darren Tucker | c1d7e54 | 2015-12-15 14:27:09 +1100 | [diff] [blame] | 2557 | #include <openssl/crypto.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2558 | ]], [[ |
| 2559 | exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
| 2560 | ]])], |
| 2561 | [ |
| 2562 | AC_MSG_RESULT([yes]) |
| 2563 | ], |
| 2564 | [ |
| 2565 | AC_MSG_RESULT([no]) |
| 2566 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2567 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2568 | library. Check config.log for details. |
| 2569 | If you are sure your installation is consistent, you can disable the check |
| 2570 | by running "./configure --without-openssl-header-check". |
| 2571 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2572 | ]) |
| 2573 | else |
| 2574 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2575 | library. Check config.log for details. |
| 2576 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
| 2577 | fi |
| 2578 | ], |
| 2579 | [ |
| 2580 | AC_MSG_WARN([cross compiling: not checking]) |
| 2581 | ] |
| 2582 | ) |
| 2583 | |
| 2584 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2585 | AC_LINK_IFELSE( |
| 2586 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2587 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2588 | [ |
| 2589 | AC_MSG_RESULT([yes]) |
| 2590 | ], |
| 2591 | [ |
| 2592 | AC_MSG_RESULT([no]) |
| 2593 | saved_LIBS="$LIBS" |
| 2594 | LIBS="$LIBS -ldl" |
| 2595 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2596 | AC_LINK_IFELSE( |
| 2597 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2598 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2599 | [ |
| 2600 | AC_MSG_RESULT([yes]) |
| 2601 | ], |
| 2602 | [ |
| 2603 | AC_MSG_RESULT([no]) |
| 2604 | LIBS="$saved_LIBS" |
| 2605 | ] |
| 2606 | ) |
| 2607 | ] |
| 2608 | ) |
| 2609 | |
| 2610 | AC_CHECK_FUNCS([ \ |
| 2611 | BN_is_prime_ex \ |
| 2612 | DSA_generate_parameters_ex \ |
| 2613 | EVP_DigestInit_ex \ |
| 2614 | EVP_DigestFinal_ex \ |
| 2615 | EVP_MD_CTX_init \ |
| 2616 | EVP_MD_CTX_cleanup \ |
| 2617 | EVP_MD_CTX_copy_ex \ |
| 2618 | HMAC_CTX_init \ |
| 2619 | RSA_generate_key_ex \ |
| 2620 | RSA_get_default_method \ |
| 2621 | ]) |
| 2622 | |
| 2623 | if test "x$openssl_engine" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2624 | AC_MSG_CHECKING([for OpenSSL ENGINE support]) |
| 2625 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2626 | #include <openssl/engine.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2627 | ]], [[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2628 | ENGINE_load_builtin_engines(); |
| 2629 | ENGINE_register_all_complete(); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2630 | ]])], |
| 2631 | [ AC_MSG_RESULT([yes]) |
| 2632 | AC_DEFINE([USE_OPENSSL_ENGINE], [1], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2633 | [Enable OpenSSL engine support]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2634 | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) |
| 2635 | ]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2636 | fi |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2637 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2638 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2639 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
| 2640 | AC_LINK_IFELSE( |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2641 | [AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2642 | #include <string.h> |
| 2643 | #include <openssl/evp.h> |
| 2644 | ]], [[ |
| 2645 | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); |
| 2646 | ]])], |
| 2647 | [ |
| 2648 | AC_MSG_RESULT([no]) |
| 2649 | ], |
| 2650 | [ |
| 2651 | AC_MSG_RESULT([yes]) |
| 2652 | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], |
| 2653 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2654 | ] |
| 2655 | ) |
| 2656 | |
| 2657 | # Check for OpenSSL with EVP_aes_*ctr |
| 2658 | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) |
| 2659 | AC_LINK_IFELSE( |
| 2660 | [AC_LANG_PROGRAM([[ |
| 2661 | #include <string.h> |
| 2662 | #include <openssl/evp.h> |
| 2663 | ]], [[ |
| 2664 | exit(EVP_aes_128_ctr() == NULL || |
| 2665 | EVP_aes_192_cbc() == NULL || |
| 2666 | EVP_aes_256_cbc() == NULL); |
| 2667 | ]])], |
| 2668 | [ |
| 2669 | AC_MSG_RESULT([yes]) |
| 2670 | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], |
| 2671 | [libcrypto has EVP AES CTR]) |
| 2672 | ], |
| 2673 | [ |
| 2674 | AC_MSG_RESULT([no]) |
| 2675 | ] |
| 2676 | ) |
| 2677 | |
| 2678 | # Check for OpenSSL with EVP_aes_*gcm |
| 2679 | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) |
| 2680 | AC_LINK_IFELSE( |
| 2681 | [AC_LANG_PROGRAM([[ |
| 2682 | #include <string.h> |
| 2683 | #include <openssl/evp.h> |
| 2684 | ]], [[ |
| 2685 | exit(EVP_aes_128_gcm() == NULL || |
| 2686 | EVP_aes_256_gcm() == NULL || |
| 2687 | EVP_CTRL_GCM_SET_IV_FIXED == 0 || |
| 2688 | EVP_CTRL_GCM_IV_GEN == 0 || |
| 2689 | EVP_CTRL_GCM_SET_TAG == 0 || |
| 2690 | EVP_CTRL_GCM_GET_TAG == 0 || |
| 2691 | EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0); |
| 2692 | ]])], |
| 2693 | [ |
| 2694 | AC_MSG_RESULT([yes]) |
| 2695 | AC_DEFINE([OPENSSL_HAVE_EVPGCM], [1], |
| 2696 | [libcrypto has EVP AES GCM]) |
| 2697 | ], |
| 2698 | [ |
| 2699 | AC_MSG_RESULT([no]) |
| 2700 | unsupported_algorithms="$unsupported_cipers \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2701 | aes128-gcm@openssh.com \ |
| 2702 | aes256-gcm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2703 | ] |
| 2704 | ) |
| 2705 | |
| 2706 | AC_SEARCH_LIBS([EVP_CIPHER_CTX_ctrl], [crypto], |
| 2707 | [AC_DEFINE([HAVE_EVP_CIPHER_CTX_CTRL], [1], |
| 2708 | [Define if libcrypto has EVP_CIPHER_CTX_ctrl])]) |
| 2709 | |
| 2710 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2711 | AC_LINK_IFELSE( |
| 2712 | [AC_LANG_PROGRAM([[ |
| 2713 | #include <string.h> |
| 2714 | #include <openssl/evp.h> |
| 2715 | ]], [[ |
| 2716 | if(EVP_DigestUpdate(NULL, NULL,0)) |
| 2717 | exit(0); |
| 2718 | ]])], |
| 2719 | [ |
| 2720 | AC_MSG_RESULT([yes]) |
| 2721 | ], |
| 2722 | [ |
| 2723 | AC_MSG_RESULT([no]) |
| 2724 | AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1], |
| 2725 | [Define if EVP_DigestUpdate returns void]) |
| 2726 | ] |
| 2727 | ) |
| 2728 | |
| 2729 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2730 | # because the system crypt() is more featureful. |
| 2731 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 2732 | AC_CHECK_LIB([crypt], [crypt]) |
| 2733 | fi |
| 2734 | |
| 2735 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 2736 | # version in OpenSSL. |
| 2737 | if test "x$check_for_libcrypt_later" = "x1"; then |
| 2738 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
| 2739 | fi |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2740 | AC_CHECK_FUNCS([crypt DES_crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2741 | |
| 2742 | # Search for SHA256 support in libc and/or OpenSSL |
| 2743 | AC_CHECK_FUNCS([SHA256_Update EVP_sha256], , |
| 2744 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2745 | hmac-sha2-256 \ |
| 2746 | hmac-sha2-512 \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2747 | diffie-hellman-group-exchange-sha256 \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2748 | hmac-sha2-256-etm@openssh.com \ |
| 2749 | hmac-sha2-512-etm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2750 | ] |
| 2751 | ) |
| 2752 | # Search for RIPE-MD support in OpenSSL |
| 2753 | AC_CHECK_FUNCS([EVP_ripemd160], , |
| 2754 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2755 | hmac-ripemd160 \ |
| 2756 | hmac-ripemd160@openssh.com \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2757 | hmac-ripemd160-etm@openssh.com" |
| 2758 | ] |
| 2759 | ) |
| 2760 | |
| 2761 | # Check complete ECC support in OpenSSL |
| 2762 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) |
| 2763 | AC_LINK_IFELSE( |
| 2764 | [AC_LANG_PROGRAM([[ |
| 2765 | #include <openssl/ec.h> |
| 2766 | #include <openssl/ecdh.h> |
| 2767 | #include <openssl/ecdsa.h> |
| 2768 | #include <openssl/evp.h> |
| 2769 | #include <openssl/objects.h> |
| 2770 | #include <openssl/opensslv.h> |
| 2771 | #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ |
| 2772 | # error "OpenSSL < 0.9.8g has unreliable ECC code" |
| 2773 | #endif |
| 2774 | ]], [[ |
| 2775 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
| 2776 | const EVP_MD *m = EVP_sha256(); /* We need this too */ |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2777 | ]])], |
| 2778 | [ AC_MSG_RESULT([yes]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2779 | enable_nistp256=1 ], |
| 2780 | [ AC_MSG_RESULT([no]) ] |
| 2781 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2782 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2783 | AC_MSG_CHECKING([whether OpenSSL has NID_secp384r1]) |
| 2784 | AC_LINK_IFELSE( |
| 2785 | [AC_LANG_PROGRAM([[ |
| 2786 | #include <openssl/ec.h> |
| 2787 | #include <openssl/ecdh.h> |
| 2788 | #include <openssl/ecdsa.h> |
| 2789 | #include <openssl/evp.h> |
| 2790 | #include <openssl/objects.h> |
| 2791 | #include <openssl/opensslv.h> |
| 2792 | #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ |
| 2793 | # error "OpenSSL < 0.9.8g has unreliable ECC code" |
| 2794 | #endif |
| 2795 | ]], [[ |
| 2796 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1); |
| 2797 | const EVP_MD *m = EVP_sha384(); /* We need this too */ |
| 2798 | ]])], |
| 2799 | [ AC_MSG_RESULT([yes]) |
| 2800 | enable_nistp384=1 ], |
| 2801 | [ AC_MSG_RESULT([no]) ] |
| 2802 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2803 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2804 | AC_MSG_CHECKING([whether OpenSSL has NID_secp521r1]) |
| 2805 | AC_LINK_IFELSE( |
| 2806 | [AC_LANG_PROGRAM([[ |
| 2807 | #include <openssl/ec.h> |
| 2808 | #include <openssl/ecdh.h> |
| 2809 | #include <openssl/ecdsa.h> |
| 2810 | #include <openssl/evp.h> |
| 2811 | #include <openssl/objects.h> |
| 2812 | #include <openssl/opensslv.h> |
| 2813 | #if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ |
| 2814 | # error "OpenSSL < 0.9.8g has unreliable ECC code" |
| 2815 | #endif |
| 2816 | ]], [[ |
| 2817 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2818 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2819 | ]])], |
| 2820 | [ AC_MSG_RESULT([yes]) |
| 2821 | AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) |
| 2822 | AC_RUN_IFELSE( |
| 2823 | [AC_LANG_PROGRAM([[ |
| 2824 | #include <openssl/ec.h> |
| 2825 | #include <openssl/ecdh.h> |
| 2826 | #include <openssl/ecdsa.h> |
| 2827 | #include <openssl/evp.h> |
| 2828 | #include <openssl/objects.h> |
| 2829 | #include <openssl/opensslv.h> |
| 2830 | ]],[[ |
| 2831 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2832 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2833 | exit(e == NULL || m == NULL); |
| 2834 | ]])], |
| 2835 | [ AC_MSG_RESULT([yes]) |
| 2836 | enable_nistp521=1 ], |
| 2837 | [ AC_MSG_RESULT([no]) ], |
| 2838 | [ AC_MSG_WARN([cross-compiling: assuming yes]) |
| 2839 | enable_nistp521=1 ] |
| 2840 | )], |
| 2841 | AC_MSG_RESULT([no]) |
| 2842 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2843 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2844 | COMMENT_OUT_ECC="#no ecc#" |
| 2845 | TEST_SSH_ECC=no |
| 2846 | |
| 2847 | if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ |
| 2848 | test x$enable_nistp521 = x1; then |
| 2849 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) |
| 2850 | fi |
| 2851 | if test x$enable_nistp256 = x1; then |
| 2852 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], |
| 2853 | [libcrypto has NID_X9_62_prime256v1]) |
| 2854 | TEST_SSH_ECC=yes |
| 2855 | COMMENT_OUT_ECC="" |
| 2856 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2857 | unsupported_algorithms="$unsupported_algorithms \ |
| 2858 | ecdsa-sha2-nistp256 \ |
| 2859 | ecdh-sha2-nistp256 \ |
| 2860 | ecdsa-sha2-nistp256-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2861 | fi |
| 2862 | if test x$enable_nistp384 = x1; then |
| 2863 | AC_DEFINE([OPENSSL_HAS_NISTP384], [1], [libcrypto has NID_secp384r1]) |
| 2864 | TEST_SSH_ECC=yes |
| 2865 | COMMENT_OUT_ECC="" |
| 2866 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2867 | unsupported_algorithms="$unsupported_algorithms \ |
| 2868 | ecdsa-sha2-nistp384 \ |
| 2869 | ecdh-sha2-nistp384 \ |
| 2870 | ecdsa-sha2-nistp384-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2871 | fi |
| 2872 | if test x$enable_nistp521 = x1; then |
| 2873 | AC_DEFINE([OPENSSL_HAS_NISTP521], [1], [libcrypto has NID_secp521r1]) |
| 2874 | TEST_SSH_ECC=yes |
| 2875 | COMMENT_OUT_ECC="" |
| 2876 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2877 | unsupported_algorithms="$unsupported_algorithms \ |
| 2878 | ecdh-sha2-nistp521 \ |
| 2879 | ecdsa-sha2-nistp521 \ |
| 2880 | ecdsa-sha2-nistp521-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2881 | fi |
| 2882 | |
| 2883 | AC_SUBST([TEST_SSH_ECC]) |
| 2884 | AC_SUBST([COMMENT_OUT_ECC]) |
| 2885 | else |
| 2886 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2887 | AC_CHECK_FUNCS([crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2888 | fi |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2889 | |
Damien Miller | 00f9cd2 | 2014-07-15 10:41:38 +1000 | [diff] [blame] | 2890 | AC_CHECK_FUNCS([ \ |
| 2891 | arc4random \ |
| 2892 | arc4random_buf \ |
| 2893 | arc4random_stir \ |
| 2894 | arc4random_uniform \ |
| 2895 | ]) |
| 2896 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2897 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2898 | AC_CHECK_LIB([iaf], [ia_openinfo], [ |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2899 | LIBS="$LIBS -liaf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2900 | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" |
| 2901 | AC_DEFINE([HAVE_LIBIAF], [1], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2902 | [Define if system has libiaf that supports set_id]) |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 2903 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2904 | ]) |
| 2905 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2906 | |
| 2907 | ### Configure cryptographic random number support |
| 2908 | |
| 2909 | # Check wheter OpenSSL seeds itself |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2910 | if test "x$openssl" = "xyes" ; then |
| 2911 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 2912 | AC_RUN_IFELSE( |
| 2913 | [AC_LANG_PROGRAM([[ |
| 2914 | #include <string.h> |
| 2915 | #include <openssl/rand.h> |
| 2916 | ]], [[ |
| 2917 | exit(RAND_status() == 1 ? 0 : 1); |
| 2918 | ]])], |
| 2919 | [ |
| 2920 | OPENSSL_SEEDS_ITSELF=yes |
| 2921 | AC_MSG_RESULT([yes]) |
| 2922 | ], |
| 2923 | [ |
| 2924 | AC_MSG_RESULT([no]) |
| 2925 | ], |
| 2926 | [ |
| 2927 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 2928 | # This is safe, since we will fatal() at runtime if |
| 2929 | # OpenSSL is not seeded correctly. |
| 2930 | OPENSSL_SEEDS_ITSELF=yes |
| 2931 | ] |
| 2932 | ) |
| 2933 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2934 | |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2935 | # PRNGD TCP socket |
| 2936 | AC_ARG_WITH([prngd-port], |
| 2937 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 2938 | [ |
| 2939 | case "$withval" in |
| 2940 | no) |
| 2941 | withval="" |
| 2942 | ;; |
| 2943 | [[0-9]]*) |
| 2944 | ;; |
| 2945 | *) |
| 2946 | AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port]) |
| 2947 | ;; |
| 2948 | esac |
| 2949 | if test ! -z "$withval" ; then |
| 2950 | PRNGD_PORT="$withval" |
| 2951 | AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT], |
| 2952 | [Port number of PRNGD/EGD random number socket]) |
| 2953 | fi |
| 2954 | ] |
| 2955 | ) |
| 2956 | |
| 2957 | # PRNGD Unix domain socket |
| 2958 | AC_ARG_WITH([prngd-socket], |
| 2959 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 2960 | [ |
| 2961 | case "$withval" in |
| 2962 | yes) |
| 2963 | withval="/var/run/egd-pool" |
| 2964 | ;; |
| 2965 | no) |
| 2966 | withval="" |
| 2967 | ;; |
| 2968 | /*) |
| 2969 | ;; |
| 2970 | *) |
| 2971 | AC_MSG_ERROR([You must specify an absolute path to the entropy socket]) |
| 2972 | ;; |
| 2973 | esac |
| 2974 | |
| 2975 | if test ! -z "$withval" ; then |
| 2976 | if test ! -z "$PRNGD_PORT" ; then |
| 2977 | AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket]) |
| 2978 | fi |
| 2979 | if test ! -r "$withval" ; then |
| 2980 | AC_MSG_WARN([Entropy socket is not readable]) |
| 2981 | fi |
| 2982 | PRNGD_SOCKET="$withval" |
| 2983 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"], |
| 2984 | [Location of PRNGD/EGD random number socket]) |
| 2985 | fi |
| 2986 | ], |
| 2987 | [ |
| 2988 | # Check for existing socket only if we don't have a random device already |
| 2989 | if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then |
| 2990 | AC_MSG_CHECKING([for PRNGD/EGD socket]) |
| 2991 | # Insert other locations here |
| 2992 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 2993 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 2994 | PRNGD_SOCKET="$sock" |
| 2995 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"]) |
| 2996 | break; |
| 2997 | fi |
| 2998 | done |
| 2999 | if test ! -z "$PRNGD_SOCKET" ; then |
| 3000 | AC_MSG_RESULT([$PRNGD_SOCKET]) |
| 3001 | else |
| 3002 | AC_MSG_RESULT([not found]) |
| 3003 | fi |
| 3004 | fi |
| 3005 | ] |
| 3006 | ) |
| 3007 | |
| 3008 | # Which randomness source do we use? |
| 3009 | if test ! -z "$PRNGD_PORT" ; then |
| 3010 | RAND_MSG="PRNGd port $PRNGD_PORT" |
| 3011 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 3012 | RAND_MSG="PRNGd socket $PRNGD_SOCKET" |
| 3013 | elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 3014 | AC_DEFINE([OPENSSL_PRNG_ONLY], [1], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3015 | [Define if you want the OpenSSL internally seeded PRNG only]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 3016 | RAND_MSG="OpenSSL internal ONLY" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3017 | elif test "x$openssl" = "xno" ; then |
| 3018 | AC_MSG_WARN([OpenSSH will use /dev/urandom as a source of random numbers. It will fail if this device is not supported or accessible]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 3019 | else |
| 3020 | AC_MSG_ERROR([OpenSSH has no source of random numbers. Please configure OpenSSL with an entropy source or re-run configure using one of the --with-prngd-port or --with-prngd-socket options]) |
| 3021 | fi |
| 3022 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3023 | # Check for PAM libs |
| 3024 | PAM_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3025 | AC_ARG_WITH([pam], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3026 | [ --with-pam Enable PAM support ], |
| 3027 | [ |
| 3028 | if test "x$withval" != "xno" ; then |
| 3029 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 3030 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 3031 | AC_MSG_ERROR([PAM headers not found]) |
| 3032 | fi |
| 3033 | |
| 3034 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3035 | AC_CHECK_LIB([dl], [dlopen], , ) |
| 3036 | AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) |
| 3037 | AC_CHECK_FUNCS([pam_getenvlist]) |
| 3038 | AC_CHECK_FUNCS([pam_putenv]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3039 | LIBS="$saved_LIBS" |
| 3040 | |
| 3041 | PAM_MSG="yes" |
| 3042 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3043 | SSHDLIBS="$SSHDLIBS -lpam" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3044 | AC_DEFINE([USE_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3045 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3046 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3047 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3048 | case "$LIBS" in |
| 3049 | *-ldl*) |
| 3050 | # libdl already in LIBS |
| 3051 | ;; |
| 3052 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3053 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3054 | ;; |
| 3055 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3056 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3057 | fi |
| 3058 | ] |
| 3059 | ) |
| 3060 | |
Damien Miller | 8bd81e1 | 2016-08-16 13:30:56 +1000 | [diff] [blame] | 3061 | AC_ARG_WITH([pam-service], |
| 3062 | [ --with-pam-service=name Specify PAM service name ], |
| 3063 | [ |
| 3064 | if test "x$withval" != "xno" && \ |
| 3065 | test "x$withval" != "xyes" ; then |
| 3066 | AC_DEFINE_UNQUOTED([SSHD_PAM_SERVICE], |
| 3067 | ["$withval"], [sshd PAM service name]) |
| 3068 | fi |
| 3069 | ] |
| 3070 | ) |
| 3071 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3072 | # Check for older PAM |
| 3073 | if test "x$PAM_MSG" = "xyes" ; then |
| 3074 | # Check PAM strerror arguments (old PAM) |
| 3075 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3076 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3077 | #include <stdlib.h> |
| 3078 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 3079 | #include <security/pam_appl.h> |
| 3080 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 3081 | #include <pam/pam_appl.h> |
| 3082 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3083 | ]], [[ |
| 3084 | (void)pam_strerror((pam_handle_t *)NULL, -1); |
| 3085 | ]])], [AC_MSG_RESULT([no])], [ |
| 3086 | AC_DEFINE([HAVE_OLD_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3087 | [Define if you have an old version of PAM |
| 3088 | which takes only one argument to pam_strerror]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3089 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3090 | PAM_MSG="yes (old library)" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3091 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3092 | ]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3093 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3094 | |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3095 | case "$host" in |
| 3096 | *-*-cygwin*) |
| 3097 | SSH_PRIVSEP_USER=CYGWIN_SSH_PRIVSEP_USER |
| 3098 | ;; |
| 3099 | *) |
| 3100 | SSH_PRIVSEP_USER=sshd |
| 3101 | ;; |
| 3102 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3103 | AC_ARG_WITH([privsep-user], |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 3104 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3105 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3106 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3107 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 3108 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3109 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3110 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3111 | ) |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3112 | if test "x$SSH_PRIVSEP_USER" = "xCYGWIN_SSH_PRIVSEP_USER" ; then |
| 3113 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], [CYGWIN_SSH_PRIVSEP_USER], |
| 3114 | [Cygwin function to fetch non-privileged user for privilege separation]) |
| 3115 | else |
| 3116 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"], |
| 3117 | [non-privileged user for privilege separation]) |
| 3118 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3119 | AC_SUBST([SSH_PRIVSEP_USER]) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3120 | |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3121 | if test "x$have_linux_no_new_privs" = "x1" ; then |
| 3122 | AC_CHECK_DECL([SECCOMP_MODE_FILTER], [have_seccomp_filter=1], , [ |
| 3123 | #include <sys/types.h> |
| 3124 | #include <linux/seccomp.h> |
| 3125 | ]) |
| 3126 | fi |
| 3127 | if test "x$have_seccomp_filter" = "x1" ; then |
| 3128 | AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 3129 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3130 | #include <errno.h> |
| 3131 | #include <elf.h> |
| 3132 | #include <linux/audit.h> |
| 3133 | #include <linux/seccomp.h> |
| 3134 | #include <stdlib.h> |
| 3135 | #include <sys/prctl.h> |
| 3136 | ]], |
| 3137 | [[ int i = $seccomp_audit_arch; |
| 3138 | errno = 0; |
| 3139 | prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 3140 | exit(errno == EFAULT ? 0 : 1); ]])], |
| 3141 | [ AC_MSG_RESULT([yes]) ], [ |
| 3142 | AC_MSG_RESULT([no]) |
| 3143 | # Disable seccomp filter as a target |
| 3144 | have_seccomp_filter=0 |
| 3145 | ] |
| 3146 | ) |
| 3147 | fi |
| 3148 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3149 | # Decide which sandbox style to use |
| 3150 | sandbox_arg="" |
| 3151 | AC_ARG_WITH([sandbox], |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3152 | [ --with-sandbox=style Specify privilege separation sandbox (no, capsicum, darwin, rlimit, seccomp_filter, systrace, pledge)], |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3153 | [ |
| 3154 | if test "x$withval" = "xyes" ; then |
| 3155 | sandbox_arg="" |
| 3156 | else |
| 3157 | sandbox_arg="$withval" |
| 3158 | fi |
| 3159 | ] |
| 3160 | ) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3161 | |
| 3162 | # Some platforms (seems to be the ones that have a kernel poll(2)-type |
| 3163 | # function with which they implement select(2)) use an extra file descriptor |
| 3164 | # when calling select(2), which means we can't use the rlimit sandbox. |
| 3165 | AC_MSG_CHECKING([if select works with descriptor rlimit]) |
| 3166 | AC_RUN_IFELSE( |
| 3167 | [AC_LANG_PROGRAM([[ |
| 3168 | #include <sys/types.h> |
| 3169 | #ifdef HAVE_SYS_TIME_H |
| 3170 | # include <sys/time.h> |
| 3171 | #endif |
| 3172 | #include <sys/resource.h> |
| 3173 | #ifdef HAVE_SYS_SELECT_H |
| 3174 | # include <sys/select.h> |
| 3175 | #endif |
| 3176 | #include <errno.h> |
| 3177 | #include <fcntl.h> |
| 3178 | #include <stdlib.h> |
| 3179 | ]],[[ |
| 3180 | struct rlimit rl_zero; |
| 3181 | int fd, r; |
| 3182 | fd_set fds; |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3183 | struct timeval tv; |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3184 | |
| 3185 | fd = open("/dev/null", O_RDONLY); |
| 3186 | FD_ZERO(&fds); |
| 3187 | FD_SET(fd, &fds); |
| 3188 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3189 | setrlimit(RLIMIT_FSIZE, &rl_zero); |
| 3190 | setrlimit(RLIMIT_NOFILE, &rl_zero); |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3191 | tv.tv_sec = 1; |
| 3192 | tv.tv_usec = 0; |
| 3193 | r = select(fd+1, &fds, NULL, NULL, &tv); |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3194 | exit (r == -1 ? 1 : 0); |
| 3195 | ]])], |
| 3196 | [AC_MSG_RESULT([yes]) |
| 3197 | select_works_with_rlimit=yes], |
| 3198 | [AC_MSG_RESULT([no]) |
| 3199 | select_works_with_rlimit=no], |
| 3200 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3201 | ) |
| 3202 | |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3203 | AC_MSG_CHECKING([if setrlimit(RLIMIT_NOFILE,{0,0}) works]) |
| 3204 | AC_RUN_IFELSE( |
| 3205 | [AC_LANG_PROGRAM([[ |
| 3206 | #include <sys/types.h> |
| 3207 | #ifdef HAVE_SYS_TIME_H |
| 3208 | # include <sys/time.h> |
| 3209 | #endif |
| 3210 | #include <sys/resource.h> |
| 3211 | #include <errno.h> |
| 3212 | #include <stdlib.h> |
| 3213 | ]],[[ |
| 3214 | struct rlimit rl_zero; |
| 3215 | int fd, r; |
| 3216 | fd_set fds; |
| 3217 | |
| 3218 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3219 | r = setrlimit(RLIMIT_NOFILE, &rl_zero); |
| 3220 | exit (r == -1 ? 1 : 0); |
| 3221 | ]])], |
| 3222 | [AC_MSG_RESULT([yes]) |
| 3223 | rlimit_nofile_zero_works=yes], |
| 3224 | [AC_MSG_RESULT([no]) |
| 3225 | rlimit_nofile_zero_works=no], |
| 3226 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3227 | ) |
| 3228 | |
Darren Tucker | d545a4b | 2012-07-03 22:48:31 +1000 | [diff] [blame] | 3229 | AC_MSG_CHECKING([if setrlimit RLIMIT_FSIZE works]) |
| 3230 | AC_RUN_IFELSE( |
| 3231 | [AC_LANG_PROGRAM([[ |
| 3232 | #include <sys/types.h> |
| 3233 | #include <sys/resource.h> |
| 3234 | #include <stdlib.h> |
| 3235 | ]],[[ |
| 3236 | struct rlimit rl_zero; |
| 3237 | |
| 3238 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3239 | exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); |
| 3240 | ]])], |
| 3241 | [AC_MSG_RESULT([yes])], |
| 3242 | [AC_MSG_RESULT([no]) |
| 3243 | AC_DEFINE(SANDBOX_SKIP_RLIMIT_FSIZE, 1, |
| 3244 | [setrlimit RLIMIT_FSIZE works])], |
| 3245 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3246 | ) |
| 3247 | |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3248 | if test "x$sandbox_arg" = "xpledge" || \ |
| 3249 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_pledge" = "xyes" ) ; then |
| 3250 | test "x$ac_cv_func_pledge" != "xyes" && \ |
| 3251 | AC_MSG_ERROR([pledge sandbox requires pledge(2) support]) |
| 3252 | SANDBOX_STYLE="pledge" |
Damien Miller | fafe1d8 | 2015-10-14 09:22:15 -0700 | [diff] [blame] | 3253 | AC_DEFINE([SANDBOX_PLEDGE], [1], [Sandbox using pledge(2)]) |
Damien Miller | 9846a2f | 2015-10-08 04:30:48 +1100 | [diff] [blame] | 3254 | elif test "x$sandbox_arg" = "xsystrace" || \ |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3255 | ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3256 | test "x$have_systr_policy_kill" != "x1" && \ |
| 3257 | AC_MSG_ERROR([systrace sandbox requires systrace headers and SYSTR_POLICY_KILL support]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3258 | SANDBOX_STYLE="systrace" |
| 3259 | AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 3260 | elif test "x$sandbox_arg" = "xdarwin" || \ |
| 3261 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 3262 | test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3263 | test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 3264 | "x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 3265 | AC_MSG_ERROR([Darwin seatbelt sandbox requires sandbox.h and sandbox_init function]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 3266 | SANDBOX_STYLE="darwin" |
| 3267 | AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3268 | elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 3269 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | d0494fd | 2012-05-19 14:25:39 +1000 | [diff] [blame] | 3270 | test "x$have_seccomp_filter" = "x1" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3271 | test "x$ac_cv_header_elf_h" = "xyes" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3272 | test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3273 | test "x$ac_cv_header_linux_filter_h" = "xyes" && \ |
| 3274 | test "x$seccomp_audit_arch" != "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3275 | test "x$have_linux_no_new_privs" = "x1" && \ |
| 3276 | test "x$ac_cv_func_prctl" = "xyes" ) ; then |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3277 | test "x$seccomp_audit_arch" = "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3278 | AC_MSG_ERROR([seccomp_filter sandbox not supported on $host]) |
| 3279 | test "x$have_linux_no_new_privs" != "x1" && \ |
| 3280 | AC_MSG_ERROR([seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS]) |
| 3281 | test "x$have_seccomp_filter" != "x1" && \ |
| 3282 | AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 3283 | test "x$ac_cv_func_prctl" != "xyes" && \ |
| 3284 | AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 3285 | SANDBOX_STYLE="seccomp_filter" |
| 3286 | AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3287 | elif test "x$sandbox_arg" = "xcapsicum" || \ |
| 3288 | ( test -z "$sandbox_arg" && \ |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3289 | test "x$ac_cv_header_sys_capability_h" = "xyes" && \ |
| 3290 | test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then |
| 3291 | test "x$ac_cv_header_sys_capability_h" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3292 | AC_MSG_ERROR([capsicum sandbox requires sys/capability.h header]) |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3293 | test "x$ac_cv_func_cap_rights_limit" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3294 | AC_MSG_ERROR([capsicum sandbox requires cap_rights_limit function]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3295 | SANDBOX_STYLE="capsicum" |
| 3296 | AC_DEFINE([SANDBOX_CAPSICUM], [1], [Sandbox using capsicum]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3297 | elif test "x$sandbox_arg" = "xrlimit" || \ |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3298 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3299 | test "x$select_works_with_rlimit" = "xyes" && \ |
| 3300 | test "x$rlimit_nofile_zero_works" = "xyes" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3301 | test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 3302 | AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3303 | test "x$select_works_with_rlimit" != "xyes" && \ |
| 3304 | AC_MSG_ERROR([rlimit sandbox requires select to work with rlimit]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3305 | SANDBOX_STYLE="rlimit" |
| 3306 | AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 3307 | elif test "x$sandbox_arg" = "xsolaris" || \ |
| 3308 | ( test -z "$sandbox_arg" && test "x$SOLARIS_PRIVS" = "xyes" ) ; then |
| 3309 | SANDBOX_STYLE="solaris" |
| 3310 | AC_DEFINE([SANDBOX_SOLARIS], [1], [Sandbox using Solaris/Illumos privileges]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3311 | elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 3312 | test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 3313 | SANDBOX_STYLE="none" |
| 3314 | AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
| 3315 | else |
Tim Rice | a6e6061 | 2011-08-17 21:48:22 -0700 | [diff] [blame] | 3316 | AC_MSG_ERROR([unsupported --with-sandbox]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3317 | fi |
| 3318 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 3319 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 3320 | if test ! -z "$SONY" ; then |
| 3321 | LIBS="$LIBS -liberty"; |
| 3322 | fi |
| 3323 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3324 | # Check for long long datatypes |
| 3325 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 3326 | |
| 3327 | # Check datatype sizes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3328 | AC_CHECK_SIZEOF([short int], [2]) |
| 3329 | AC_CHECK_SIZEOF([int], [4]) |
| 3330 | AC_CHECK_SIZEOF([long int], [4]) |
| 3331 | AC_CHECK_SIZEOF([long long int], [8]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3332 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 3333 | # Sanity check long long for some platforms (AIX) |
| 3334 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 3335 | ac_cv_sizeof_long_long_int=0 |
| 3336 | fi |
| 3337 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3338 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 3339 | if test -z "$have_llong_max"; then |
| 3340 | AC_MSG_CHECKING([for max value of long long]) |
| 3341 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3342 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3343 | #include <stdio.h> |
| 3344 | /* Why is this so damn hard? */ |
| 3345 | #ifdef __GNUC__ |
| 3346 | # undef __GNUC__ |
| 3347 | #endif |
| 3348 | #define __USE_ISOC99 |
| 3349 | #include <limits.h> |
| 3350 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3351 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 3352 | |
| 3353 | /* |
| 3354 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 3355 | * we do this the hard way. |
| 3356 | */ |
| 3357 | static int |
| 3358 | fprint_ll(FILE *f, long long n) |
| 3359 | { |
| 3360 | unsigned int i; |
| 3361 | int l[sizeof(long long) * 8]; |
| 3362 | |
| 3363 | if (n < 0) |
| 3364 | if (fprintf(f, "-") < 0) |
| 3365 | return -1; |
| 3366 | for (i = 0; n != 0; i++) { |
| 3367 | l[i] = my_abs(n % 10); |
| 3368 | n /= 10; |
| 3369 | } |
| 3370 | do { |
| 3371 | if (fprintf(f, "%d", l[--i]) < 0) |
| 3372 | return -1; |
| 3373 | } while (i != 0); |
| 3374 | if (fprintf(f, " ") < 0) |
| 3375 | return -1; |
| 3376 | return 0; |
| 3377 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3378 | ]], [[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3379 | FILE *f; |
| 3380 | long long i, llmin, llmax = 0; |
| 3381 | |
| 3382 | if((f = fopen(DATA,"w")) == NULL) |
| 3383 | exit(1); |
| 3384 | |
| 3385 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 3386 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 3387 | llmin = LLONG_MIN; |
| 3388 | llmax = LLONG_MAX; |
| 3389 | #else |
| 3390 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 3391 | /* This will work on one's complement and two's complement */ |
| 3392 | for (i = 1; i > llmax; i <<= 1, i++) |
| 3393 | llmax = i; |
| 3394 | llmin = llmax + 1LL; /* wrap */ |
| 3395 | #endif |
| 3396 | |
| 3397 | /* Sanity check */ |
| 3398 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3399 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 3400 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3401 | fprintf(f, "unknown unknown\n"); |
| 3402 | exit(2); |
| 3403 | } |
| 3404 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3405 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3406 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3407 | if (fprint_ll(f, llmax) < 0) |
| 3408 | exit(4); |
| 3409 | if (fclose(f) < 0) |
| 3410 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3411 | exit(0); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3412 | ]])], |
| 3413 | [ |
| 3414 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 3415 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 3416 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3417 | AC_MSG_RESULT([$llong_max]) |
| 3418 | AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3419 | [max value of long long calculated by configure]) |
| 3420 | AC_MSG_CHECKING([for min value of long long]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3421 | AC_MSG_RESULT([$llong_min]) |
| 3422 | AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3423 | [min value of long long calculated by configure]) |
| 3424 | ], |
| 3425 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3426 | AC_MSG_RESULT([not found]) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3427 | ], |
| 3428 | [ |
| 3429 | AC_MSG_WARN([cross compiling: not checking]) |
| 3430 | ] |
| 3431 | ) |
| 3432 | fi |
| 3433 | |
| 3434 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3435 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3436 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3437 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3438 | [[ u_int a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3439 | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3440 | ]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3441 | ]) |
| 3442 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3443 | 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] | 3444 | have_u_int=1 |
| 3445 | fi |
| 3446 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3447 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3448 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3449 | [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3450 | [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3451 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3452 | ]) |
| 3453 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3454 | 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] | 3455 | have_intxx_t=1 |
| 3456 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3457 | |
| 3458 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3459 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3460 | then |
| 3461 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3462 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3463 | [[ 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] | 3464 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3465 | AC_DEFINE([HAVE_INTXX_T]) |
| 3466 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3467 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3468 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3469 | fi |
| 3470 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3471 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3472 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 3473 | #include <sys/types.h> |
| 3474 | #ifdef HAVE_STDINT_H |
| 3475 | # include <stdint.h> |
| 3476 | #endif |
| 3477 | #include <sys/socket.h> |
| 3478 | #ifdef HAVE_SYS_BITYPES_H |
| 3479 | # include <sys/bitypes.h> |
| 3480 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3481 | ]], [[ |
| 3482 | int64_t a; a = 1; |
| 3483 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3484 | [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3485 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3486 | ]) |
| 3487 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3488 | 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] | 3489 | fi |
| 3490 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3491 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3492 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3493 | [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3494 | [ ac_cv_have_u_intxx_t="yes" ], [ ac_cv_have_u_intxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3495 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3496 | ]) |
| 3497 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3498 | 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] | 3499 | have_u_intxx_t=1 |
| 3500 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3501 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3502 | if test -z "$have_u_intxx_t" ; then |
| 3503 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3504 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], |
| 3505 | [[ 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] | 3506 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3507 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3508 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3509 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3510 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3511 | fi |
| 3512 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3513 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3514 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3515 | [[ u_int64_t a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3516 | [ ac_cv_have_u_int64_t="yes" ], [ ac_cv_have_u_int64_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3517 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3518 | ]) |
| 3519 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3520 | 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] | 3521 | have_u_int64_t=1 |
| 3522 | fi |
| 3523 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3524 | if (test -z "$have_u_int64_t" && \ |
| 3525 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
| 3526 | then |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3527 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3528 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], |
| 3529 | [[ u_int64_t a; a = 1]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3530 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3531 | AC_DEFINE([HAVE_U_INT64_T]) |
| 3532 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3533 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3534 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3535 | fi |
| 3536 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3537 | if test -z "$have_u_intxx_t" ; then |
| 3538 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3539 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3540 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3541 | ]], [[ |
| 3542 | uint8_t a; |
| 3543 | uint16_t b; |
| 3544 | uint32_t c; |
| 3545 | a = b = c = 1; |
| 3546 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3547 | [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3548 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3549 | ]) |
| 3550 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3551 | AC_DEFINE([HAVE_UINTXX_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3552 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3553 | fi |
| 3554 | fi |
| 3555 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3556 | if (test -z "$have_uintxx_t" && \ |
| 3557 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 3558 | then |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3559 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3560 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3561 | [[ 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] | 3562 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3563 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3564 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3565 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3566 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3567 | fi |
| 3568 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3569 | if (test -z "$have_uintxx_t" && \ |
| 3570 | test "x$ac_cv_header_inttypes_h" = "xyes") |
| 3571 | then |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3572 | AC_MSG_CHECKING([for uintXX_t types in inttypes.h]) |
| 3573 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <inttypes.h> ]], |
| 3574 | [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])], |
| 3575 | [ |
| 3576 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3577 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3578 | ], [ AC_MSG_RESULT([no]) |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3579 | ]) |
| 3580 | fi |
| 3581 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3582 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3583 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3584 | then |
| 3585 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3586 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3587 | #include <sys/bitypes.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3588 | ]], [[ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 3589 | int8_t a; int16_t b; int32_t c; |
| 3590 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 3591 | a = b = c = e = f = g = 1; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3592 | ]])], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3593 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3594 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3595 | AC_DEFINE([HAVE_INTXX_T]) |
| 3596 | AC_MSG_RESULT([yes]) |
| 3597 | ], [AC_MSG_RESULT([no]) |
| 3598 | ]) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3599 | fi |
| 3600 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3601 | |
| 3602 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3603 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3604 | [[ u_char foo; foo = 125; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3605 | [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3606 | ]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3607 | ]) |
| 3608 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3609 | 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] | 3610 | fi |
| 3611 | |
Darren Tucker | 007e3b3 | 2013-11-03 18:43:55 +1100 | [diff] [blame] | 3612 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ |
| 3613 | #include <sys/types.h> |
| 3614 | #include <stdint.h> |
| 3615 | ]) |
| 3616 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3617 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 3618 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3619 | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) |
| 3620 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 3621 | #include <sys/types.h> |
| 3622 | #ifdef HAVE_SYS_BITYPES_H |
| 3623 | #include <sys/bitypes.h> |
| 3624 | #endif |
| 3625 | #ifdef HAVE_SYS_STATFS_H |
| 3626 | #include <sys/statfs.h> |
| 3627 | #endif |
| 3628 | #ifdef HAVE_SYS_STATVFS_H |
| 3629 | #include <sys/statvfs.h> |
| 3630 | #endif |
| 3631 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3632 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3633 | AC_CHECK_TYPES([in_addr_t, in_port_t], , , |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 3634 | [#include <sys/types.h> |
| 3635 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3636 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3637 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3638 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3639 | [[ size_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3640 | [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3641 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3642 | ]) |
| 3643 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3644 | 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] | 3645 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 3646 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3647 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3648 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3649 | [[ ssize_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3650 | [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3651 | ]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3652 | ]) |
| 3653 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3654 | 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] | 3655 | fi |
| 3656 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3657 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3658 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]], |
| 3659 | [[ clock_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3660 | [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3661 | ]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3662 | ]) |
| 3663 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3664 | 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] | 3665 | fi |
| 3666 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3667 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3668 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3669 | #include <sys/types.h> |
| 3670 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3671 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
| 3672 | [ ac_cv_have_sa_family_t="yes" ], |
| 3673 | [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3674 | #include <sys/types.h> |
| 3675 | #include <sys/socket.h> |
| 3676 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3677 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3678 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3679 | [ ac_cv_have_sa_family_t="no" ] |
| 3680 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3681 | ]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3682 | ]) |
| 3683 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3684 | AC_DEFINE([HAVE_SA_FAMILY_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3685 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3686 | fi |
| 3687 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3688 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3689 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3690 | [[ pid_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3691 | [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3692 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3693 | ]) |
| 3694 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3695 | 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] | 3696 | fi |
| 3697 | |
| 3698 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3699 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3700 | [[ mode_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3701 | [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3702 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3703 | ]) |
| 3704 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3705 | 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] | 3706 | fi |
| 3707 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3708 | |
| 3709 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3710 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3711 | #include <sys/types.h> |
| 3712 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3713 | ]], [[ struct sockaddr_storage s; ]])], |
| 3714 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3715 | [ ac_cv_have_struct_sockaddr_storage="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3716 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3717 | ]) |
| 3718 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3719 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3720 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3721 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3722 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3723 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3724 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3725 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3726 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3727 | ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], |
| 3728 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3729 | [ ac_cv_have_struct_sockaddr_in6="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3730 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3731 | ]) |
| 3732 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3733 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3734 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3735 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3736 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3737 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3738 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3739 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3740 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3741 | ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], |
| 3742 | [ ac_cv_have_struct_in6_addr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3743 | [ ac_cv_have_struct_in6_addr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3744 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3745 | ]) |
| 3746 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3747 | AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3748 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3749 | |
| 3750 | dnl Now check for sin6_scope_id |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3751 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , , |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3752 | [ |
| 3753 | #ifdef HAVE_SYS_TYPES_H |
| 3754 | #include <sys/types.h> |
| 3755 | #endif |
| 3756 | #include <netinet/in.h> |
| 3757 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3758 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3759 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3760 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3761 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3762 | #include <sys/types.h> |
| 3763 | #include <sys/socket.h> |
| 3764 | #include <netdb.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3765 | ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], |
| 3766 | [ ac_cv_have_struct_addrinfo="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3767 | [ ac_cv_have_struct_addrinfo="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3768 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3769 | ]) |
| 3770 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3771 | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3772 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3773 | fi |
| 3774 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3775 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3776 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
| 3777 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
| 3778 | [ ac_cv_have_struct_timeval="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3779 | [ ac_cv_have_struct_timeval="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3780 | ]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3781 | ]) |
| 3782 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3783 | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3784 | have_struct_timeval=1 |
| 3785 | fi |
| 3786 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3787 | AC_CHECK_TYPES([struct timespec]) |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 3788 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3789 | # 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] | 3790 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 3791 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 3792 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3793 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 3794 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 3795 | echo "" |
| 3796 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3797 | else |
| 3798 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3799 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3800 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3801 | #include <stdio.h> |
| 3802 | #include <string.h> |
| 3803 | #ifdef HAVE_SNPRINTF |
| 3804 | main() |
| 3805 | { |
| 3806 | char buf[50]; |
| 3807 | char expected_out[50]; |
| 3808 | int mazsize = 50 ; |
| 3809 | #if (SIZEOF_LONG_INT == 8) |
| 3810 | long int num = 0x7fffffffffffffff; |
| 3811 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 3812 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3813 | #endif |
| 3814 | strcpy(expected_out, "9223372036854775807"); |
| 3815 | snprintf(buf, mazsize, "%lld", num); |
| 3816 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3817 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3818 | exit(0); |
| 3819 | } |
| 3820 | #else |
| 3821 | main() { exit(0); } |
| 3822 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3823 | ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3824 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3825 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3826 | fi |
| 3827 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3828 | dnl Checks for structure members |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3829 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP]) |
| 3830 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX]) |
| 3831 | OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX]) |
| 3832 | OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP]) |
| 3833 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP]) |
| 3834 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX]) |
| 3835 | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP]) |
| 3836 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP]) |
| 3837 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX]) |
| 3838 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) |
| 3839 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) |
| 3840 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) |
| 3841 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) |
| 3842 | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) |
| 3843 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) |
| 3844 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) |
| 3845 | 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] | 3846 | |
| 3847 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3848 | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, |
| 3849 | struct passwd.pw_change, struct passwd.pw_expire], |
| 3850 | [], [], [[ |
| 3851 | #include <sys/types.h> |
| 3852 | #include <pwd.h> |
| 3853 | ]]) |
| 3854 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3855 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3856 | [Define if we don't have struct __res_state in resolv.h])], |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3857 | [[ |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3858 | #include <stdio.h> |
| 3859 | #if HAVE_SYS_TYPES_H |
| 3860 | # include <sys/types.h> |
| 3861 | #endif |
| 3862 | #include <netinet/in.h> |
| 3863 | #include <arpa/nameser.h> |
| 3864 | #include <resolv.h> |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3865 | ]]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3866 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3867 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 3868 | ac_cv_have_ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3869 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3870 | #include <sys/types.h> |
| 3871 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3872 | ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])], |
| 3873 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 3874 | [ ac_cv_have_ss_family_in_struct_ss="no" ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3875 | ]) |
| 3876 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3877 | 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] | 3878 | fi |
| 3879 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3880 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 3881 | ac_cv_have___ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3882 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3883 | #include <sys/types.h> |
| 3884 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3885 | ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])], |
| 3886 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3887 | [ ac_cv_have___ss_family_in_struct_ss="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3888 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3889 | ]) |
| 3890 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3891 | AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3892 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3893 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 3894 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3895 | 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] | 3896 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 3897 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3898 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3899 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3900 | #include <sys/socket.h> |
| 3901 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3902 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3903 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3904 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3905 | exit(1); |
| 3906 | #endif |
| 3907 | struct msghdr m; |
| 3908 | m.msg_accrights = 0; |
| 3909 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3910 | ]])], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3911 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 3912 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 3913 | ) |
| 3914 | ]) |
| 3915 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3916 | AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3917 | [Define if your system uses access rights style |
| 3918 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3919 | fi |
| 3920 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3921 | AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type]) |
| 3922 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e1a3ddf | 2012-05-04 11:05:45 +1000 | [diff] [blame] | 3923 | #include <sys/param.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3924 | #include <sys/stat.h> |
| 3925 | #ifdef HAVE_SYS_TIME_H |
| 3926 | # include <sys/time.h> |
| 3927 | #endif |
| 3928 | #ifdef HAVE_SYS_MOUNT_H |
| 3929 | #include <sys/mount.h> |
| 3930 | #endif |
| 3931 | #ifdef HAVE_SYS_STATVFS_H |
| 3932 | #include <sys/statvfs.h> |
| 3933 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3934 | ]], [[ struct statvfs s; s.f_fsid = 0; ]])], |
| 3935 | [ AC_MSG_RESULT([yes]) ], |
| 3936 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3937 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3938 | AC_MSG_CHECKING([if fsid_t has member val]) |
| 3939 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3940 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3941 | #include <sys/statvfs.h> |
| 3942 | ]], [[ fsid_t t; t.val[0] = 0; ]])], |
| 3943 | [ AC_MSG_RESULT([yes]) |
| 3944 | AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ], |
| 3945 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3946 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3947 | AC_MSG_CHECKING([if f_fsid has member __val]) |
| 3948 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3949 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3950 | #include <sys/statvfs.h> |
| 3951 | ]], [[ fsid_t t; t.__val[0] = 0; ]])], |
| 3952 | [ AC_MSG_RESULT([yes]) |
| 3953 | AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ], |
| 3954 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3955 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3956 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3957 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 3958 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3959 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3960 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3961 | #include <sys/socket.h> |
| 3962 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3963 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3964 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3965 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3966 | exit(1); |
| 3967 | #endif |
| 3968 | struct msghdr m; |
| 3969 | m.msg_control = 0; |
| 3970 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3971 | ]])], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3972 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 3973 | [ ac_cv_have_control_in_msghdr="no" ] |
| 3974 | ) |
| 3975 | ]) |
| 3976 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3977 | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3978 | [Define if your system uses ancillary data style |
| 3979 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3980 | fi |
| 3981 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3982 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3983 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 3984 | [[ extern char *__progname; printf("%s", __progname); ]])], |
| 3985 | [ ac_cv_libc_defines___progname="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3986 | [ ac_cv_libc_defines___progname="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3987 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3988 | ]) |
| 3989 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3990 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3991 | fi |
| 3992 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3993 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3994 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 3995 | [[ printf("%s", __FUNCTION__); ]])], |
| 3996 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3997 | [ ac_cv_cc_implements___FUNCTION__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3998 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 3999 | ]) |
| 4000 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4001 | AC_DEFINE([HAVE___FUNCTION__], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4002 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4003 | fi |
| 4004 | |
| 4005 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4006 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 4007 | [[ printf("%s", __func__); ]])], |
| 4008 | [ ac_cv_cc_implements___func__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4009 | [ ac_cv_cc_implements___func__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4010 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4011 | ]) |
| 4012 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4013 | AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4014 | fi |
| 4015 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4016 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4017 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4018 | #include <stdarg.h> |
| 4019 | va_list x,y; |
| 4020 | ]], [[ va_copy(x,y); ]])], |
| 4021 | [ ac_cv_have_va_copy="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4022 | [ ac_cv_have_va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4023 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4024 | ]) |
| 4025 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4026 | AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4027 | fi |
| 4028 | |
| 4029 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4030 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4031 | #include <stdarg.h> |
| 4032 | va_list x,y; |
| 4033 | ]], [[ __va_copy(x,y); ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4034 | [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4035 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4036 | ]) |
| 4037 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4038 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4039 | fi |
| 4040 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4041 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 4042 | ac_cv_have_getopt_optreset, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4043 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]], |
| 4044 | [[ extern int optreset; optreset = 0; ]])], |
| 4045 | [ ac_cv_have_getopt_optreset="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4046 | [ ac_cv_have_getopt_optreset="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4047 | ]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4048 | ]) |
| 4049 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4050 | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4051 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4052 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4053 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4054 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4055 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4056 | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], |
| 4057 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4058 | [ ac_cv_libc_defines_sys_errlist="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4059 | ]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4060 | ]) |
| 4061 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4062 | AC_DEFINE([HAVE_SYS_ERRLIST], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4063 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4064 | fi |
| 4065 | |
| 4066 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4067 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4068 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4069 | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], |
| 4070 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4071 | [ ac_cv_libc_defines_sys_nerr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4072 | ]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4073 | ]) |
| 4074 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4075 | 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] | 4076 | fi |
| 4077 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4078 | # Check libraries needed by DNS fingerprint support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4079 | AC_SEARCH_LIBS([getrrsetbyname], [resolv], |
| 4080 | [AC_DEFINE([HAVE_GETRRSETBYNAME], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4081 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4082 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4083 | # Needed by our getrrsetbyname() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4084 | AC_SEARCH_LIBS([res_query], [resolv]) |
| 4085 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
| 4086 | AC_MSG_CHECKING([if res_query will link]) |
| 4087 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4088 | #include <sys/types.h> |
| 4089 | #include <netinet/in.h> |
| 4090 | #include <arpa/nameser.h> |
| 4091 | #include <netdb.h> |
| 4092 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4093 | ]], [[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4094 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4095 | ]])], |
| 4096 | AC_MSG_RESULT([yes]), |
| 4097 | [AC_MSG_RESULT([no]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4098 | saved_LIBS="$LIBS" |
| 4099 | LIBS="$LIBS -lresolv" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4100 | AC_MSG_CHECKING([for res_query in -lresolv]) |
| 4101 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4102 | #include <sys/types.h> |
| 4103 | #include <netinet/in.h> |
| 4104 | #include <arpa/nameser.h> |
| 4105 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4106 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4107 | ]], [[ |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4108 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4109 | ]])], |
| 4110 | [AC_MSG_RESULT([yes])], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4111 | [LIBS="$saved_LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4112 | AC_MSG_RESULT([no])]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4113 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4114 | AC_CHECK_FUNCS([_getshort _getlong]) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 4115 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 4116 | [#include <sys/types.h> |
| 4117 | #include <arpa/nameser.h>]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4118 | AC_CHECK_MEMBER([HEADER.ad], |
| 4119 | [AC_DEFINE([HAVE_HEADER_AD], [1], |
| 4120 | [Define if HEADER.ad exists in arpa/nameser.h])], , |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4121 | [#include <arpa/nameser.h>]) |
| 4122 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4123 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4124 | AC_MSG_CHECKING([if struct __res_state _res is an extern]) |
| 4125 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4126 | #include <stdio.h> |
| 4127 | #if HAVE_SYS_TYPES_H |
| 4128 | # include <sys/types.h> |
| 4129 | #endif |
| 4130 | #include <netinet/in.h> |
| 4131 | #include <arpa/nameser.h> |
| 4132 | #include <resolv.h> |
| 4133 | extern struct __res_state _res; |
Darren Tucker | 7ad8b28 | 2015-09-11 13:11:02 +1000 | [diff] [blame] | 4134 | ]], [[ |
| 4135 | struct __res_state *volatile p = &_res; /* force resolution of _res */ |
| 4136 | return 0; |
| 4137 | ]],)], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4138 | [AC_MSG_RESULT([yes]) |
| 4139 | AC_DEFINE([HAVE__RES_EXTERN], [1], |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4140 | [Define if you have struct __res_state _res as an extern]) |
| 4141 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4142 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4143 | ) |
| 4144 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4145 | # Check whether user wants SELinux support |
| 4146 | SELINUX_MSG="no" |
| 4147 | LIBSELINUX="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4148 | AC_ARG_WITH([selinux], |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 4149 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4150 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4151 | save_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4152 | AC_DEFINE([WITH_SELINUX], [1], |
| 4153 | [Define if you want SELinux support.]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4154 | SELINUX_MSG="yes" |
| 4155 | AC_CHECK_HEADER([selinux/selinux.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4156 | AC_MSG_ERROR([SELinux support requires selinux.h header])) |
| 4157 | AC_CHECK_LIB([selinux], [setexeccon], |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 4158 | [ LIBSELINUX="-lselinux" |
| 4159 | LIBS="$LIBS -lselinux" |
| 4160 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4161 | AC_MSG_ERROR([SELinux support requires libselinux library])) |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 4162 | SSHLIBS="$SSHLIBS $LIBSELINUX" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4163 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4164 | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 4165 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4166 | fi ] |
| 4167 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4168 | AC_SUBST([SSHLIBS]) |
| 4169 | AC_SUBST([SSHDLIBS]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4170 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4171 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4172 | KRB5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4173 | AC_ARG_WITH([kerberos5], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4174 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4175 | [ if test "x$withval" != "xno" ; then |
| 4176 | if test "x$withval" = "xyes" ; then |
| 4177 | KRB5ROOT="/usr/local" |
| 4178 | else |
| 4179 | KRB5ROOT=${withval} |
| 4180 | fi |
| 4181 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4182 | AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4183 | KRB5_MSG="yes" |
| 4184 | |
Darren Tucker | 4089fc1 | 2016-12-08 12:57:24 +1100 | [diff] [blame] | 4185 | AC_PATH_TOOL([KRB5CONF], [krb5-config], |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 4186 | [$KRB5ROOT/bin/krb5-config], |
| 4187 | [$KRB5ROOT/bin:$PATH]) |
| 4188 | if test -x $KRB5CONF ; then |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4189 | K5CFLAGS="`$KRB5CONF --cflags`" |
| 4190 | K5LIBS="`$KRB5CONF --libs`" |
| 4191 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4192 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4193 | AC_MSG_CHECKING([for gssapi support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4194 | if $KRB5CONF | grep gssapi >/dev/null ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4195 | AC_MSG_RESULT([yes]) |
| 4196 | AC_DEFINE([GSSAPI], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4197 | [Define this if you want GSSAPI |
| 4198 | support in the version 2 protocol]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4199 | GSSCFLAGS="`$KRB5CONF --cflags gssapi`" |
| 4200 | GSSLIBS="`$KRB5CONF --libs gssapi`" |
| 4201 | CPPFLAGS="$CPPFLAGS $GSSCFLAGS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4202 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4203 | AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4204 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4205 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4206 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4207 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4208 | [ AC_MSG_RESULT([yes]) |
| 4209 | AC_DEFINE([HEIMDAL], [1], |
| 4210 | [Define this if you are using the Heimdal |
| 4211 | version of Kerberos V5]) ], |
| 4212 | [AC_MSG_RESULT([no]) |
| 4213 | ]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4214 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4215 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4216 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4217 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4218 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4219 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4220 | [ AC_MSG_RESULT([yes]) |
| 4221 | AC_DEFINE([HEIMDAL]) |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4222 | K5LIBS="-lkrb5" |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4223 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4224 | AC_CHECK_LIB([roken], [net_write], |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4225 | [K5LIBS="$K5LIBS -lroken"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4226 | AC_CHECK_LIB([des], [des_cbc_encrypt], |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4227 | [K5LIBS="$K5LIBS -ldes"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4228 | ], [ AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4229 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4230 | ]) |
| 4231 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4232 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4233 | AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], |
| 4234 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4235 | GSSLIBS="-lgssapi_krb5" ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4236 | [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], |
| 4237 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4238 | GSSLIBS="-lgssapi" ], |
Darren Tucker | a2b5a4c | 2013-02-22 10:43:15 +1100 | [diff] [blame] | 4239 | [ AC_CHECK_LIB([gss], [gss_init_sec_context], |
| 4240 | [ AC_DEFINE([GSSAPI]) |
| 4241 | GSSLIBS="-lgss" ], |
| 4242 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) |
| 4243 | ]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4244 | ]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4245 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4246 | AC_CHECK_HEADER([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4247 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4248 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4249 | AC_CHECK_HEADERS([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4250 | 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] | 4251 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4252 | ] |
| 4253 | ) |
| 4254 | |
| 4255 | oldCPP="$CPPFLAGS" |
| 4256 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4257 | AC_CHECK_HEADER([gssapi_krb5.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4258 | [ CPPFLAGS="$oldCPP" ]) |
| 4259 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4260 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4261 | if test ! -z "$need_dash_r" ; then |
| 4262 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 4263 | fi |
| 4264 | if test ! -z "$blibpath" ; then |
| 4265 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 4266 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4267 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4268 | AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h]) |
| 4269 | AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h]) |
| 4270 | AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h]) |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4271 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4272 | AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1], |
| 4273 | [Define this if you want to use libkafs' AFS support])]) |
Darren Tucker | 03978c6 | 2013-02-25 11:24:44 +1100 | [diff] [blame] | 4274 | |
| 4275 | AC_CHECK_DECLS([GSS_C_NT_HOSTBASED_SERVICE], [], [], [[ |
| 4276 | #ifdef HAVE_GSSAPI_H |
| 4277 | # include <gssapi.h> |
| 4278 | #elif defined(HAVE_GSSAPI_GSSAPI_H) |
| 4279 | # include <gssapi/gssapi.h> |
| 4280 | #endif |
| 4281 | |
| 4282 | #ifdef HAVE_GSSAPI_GENERIC_H |
| 4283 | # include <gssapi_generic.h> |
| 4284 | #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H) |
| 4285 | # include <gssapi/gssapi_generic.h> |
| 4286 | #endif |
| 4287 | ]]) |
Darren Tucker | f3ab2c5 | 2013-08-04 21:48:41 +1000 | [diff] [blame] | 4288 | saved_LIBS="$LIBS" |
| 4289 | LIBS="$LIBS $K5LIBS" |
| 4290 | AC_CHECK_FUNCS([krb5_cc_new_unique krb5_get_error_message krb5_free_error_message]) |
| 4291 | LIBS="$saved_LIBS" |
| 4292 | |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4293 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4294 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4295 | ) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4296 | AC_SUBST([GSSLIBS]) |
| 4297 | AC_SUBST([K5LIBS]) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 4298 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4299 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4300 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4301 | PRIVSEP_PATH=/var/empty |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4302 | AC_ARG_WITH([privsep-path], |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 4303 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4304 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4305 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4306 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4307 | PRIVSEP_PATH=$withval |
| 4308 | fi |
| 4309 | ] |
| 4310 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4311 | AC_SUBST([PRIVSEP_PATH]) |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4312 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4313 | AC_ARG_WITH([xauth], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4314 | [ --with-xauth=PATH Specify path to xauth program ], |
| 4315 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4316 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4317 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4318 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4319 | fi |
| 4320 | ], |
| 4321 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4322 | TestPath="$PATH" |
| 4323 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 4324 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 4325 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 4326 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4327 | AC_PATH_PROG([xauth_path], [xauth], , [$TestPath]) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 4328 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4329 | xauth_path="/usr/openwin/bin/xauth" |
| 4330 | fi |
| 4331 | ] |
| 4332 | ) |
| 4333 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4334 | STRIP_OPT=-s |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4335 | AC_ARG_ENABLE([strip], |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4336 | [ --disable-strip Disable calling strip(1) on install], |
| 4337 | [ |
| 4338 | if test "x$enableval" = "xno" ; then |
| 4339 | STRIP_OPT= |
| 4340 | fi |
| 4341 | ] |
| 4342 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4343 | AC_SUBST([STRIP_OPT]) |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4344 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4345 | if test -z "$xauth_path" ; then |
| 4346 | XAUTH_PATH="undefined" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4347 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4348 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4349 | AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4350 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4351 | XAUTH_PATH=$xauth_path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4352 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4353 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4354 | |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4355 | dnl # --with-maildir=/path/to/mail gets top priority. |
| 4356 | dnl # if maildir is set in the platform case statement above we use that. |
| 4357 | dnl # Otherwise we run a program to get the dir from system headers. |
| 4358 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
| 4359 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
| 4360 | dnl # session.c expects anyway. Otherwise we set to the value found |
| 4361 | dnl # stripping any trailing slash. If for some strage reason our program |
| 4362 | dnl # does not find what it needs, we default to /var/spool/mail. |
| 4363 | # Check for mail directory |
| 4364 | AC_ARG_WITH([maildir], |
| 4365 | [ --with-maildir=/path/to/mail Specify your system mail directory], |
| 4366 | [ |
| 4367 | if test "X$withval" != X && test "x$withval" != xno && \ |
| 4368 | test "x${withval}" != xyes; then |
| 4369 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], |
| 4370 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) |
| 4371 | fi |
| 4372 | ],[ |
| 4373 | if test "X$maildir" != "X"; then |
| 4374 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4375 | else |
| 4376 | AC_MSG_CHECKING([Discovering system mail directory]) |
| 4377 | AC_RUN_IFELSE( |
| 4378 | [AC_LANG_PROGRAM([[ |
| 4379 | #include <stdio.h> |
| 4380 | #include <string.h> |
| 4381 | #ifdef HAVE_PATHS_H |
| 4382 | #include <paths.h> |
| 4383 | #endif |
| 4384 | #ifdef HAVE_MAILLOCK_H |
| 4385 | #include <maillock.h> |
| 4386 | #endif |
| 4387 | #define DATA "conftest.maildir" |
| 4388 | ]], [[ |
| 4389 | FILE *fd; |
| 4390 | int rc; |
| 4391 | |
| 4392 | fd = fopen(DATA,"w"); |
| 4393 | if(fd == NULL) |
| 4394 | exit(1); |
| 4395 | |
| 4396 | #if defined (_PATH_MAILDIR) |
| 4397 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) |
| 4398 | exit(1); |
| 4399 | #elif defined (MAILDIR) |
| 4400 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) |
| 4401 | exit(1); |
| 4402 | #elif defined (_PATH_MAIL) |
| 4403 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) |
| 4404 | exit(1); |
| 4405 | #else |
| 4406 | exit (2); |
| 4407 | #endif |
| 4408 | |
| 4409 | exit(0); |
| 4410 | ]])], |
| 4411 | [ |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4412 | maildir_what=`awk -F: '{print $1}' conftest.maildir` |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4413 | maildir=`awk -F: '{print $2}' conftest.maildir \ |
| 4414 | | sed 's|/$||'` |
| 4415 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) |
| 4416 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then |
| 4417 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4418 | fi |
| 4419 | ], |
| 4420 | [ |
| 4421 | if test "X$ac_status" = "X2";then |
| 4422 | # our test program didn't find it. Default to /var/spool/mail |
| 4423 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) |
| 4424 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) |
| 4425 | else |
| 4426 | AC_MSG_RESULT([*** not found ***]) |
| 4427 | fi |
| 4428 | ], |
| 4429 | [ |
| 4430 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) |
| 4431 | ] |
| 4432 | ) |
| 4433 | fi |
| 4434 | ] |
| 4435 | ) # maildir |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4436 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4437 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4438 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 4439 | disable_ptmx_check=yes |
| 4440 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4441 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4442 | if test "x$disable_ptmx_check" != "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4443 | AC_CHECK_FILE(["/dev/ptmx"], |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4444 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4445 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4446 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4447 | have_dev_ptmx=1 |
| 4448 | ] |
| 4449 | ) |
| 4450 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4451 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4452 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4453 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4454 | AC_CHECK_FILE(["/dev/ptc"], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4455 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4456 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4457 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4458 | have_dev_ptc=1 |
| 4459 | ] |
| 4460 | ) |
| 4461 | else |
| 4462 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 4463 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 4464 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4465 | # Options from here on. Some of these are preset by platform above |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4466 | AC_ARG_WITH([mantype], |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4467 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4468 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4469 | case "$withval" in |
| 4470 | man|cat|doc) |
| 4471 | MANTYPE=$withval |
| 4472 | ;; |
| 4473 | *) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4474 | AC_MSG_ERROR([invalid man type: $withval]) |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4475 | ;; |
| 4476 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4477 | ] |
| 4478 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4479 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4480 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4481 | AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4482 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4483 | MANTYPE=doc |
| 4484 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4485 | MANTYPE=man |
| 4486 | else |
| 4487 | MANTYPE=cat |
| 4488 | fi |
| 4489 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4490 | AC_SUBST([MANTYPE]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4491 | if test "$MANTYPE" = "doc"; then |
| 4492 | mansubdir=man; |
| 4493 | else |
| 4494 | mansubdir=$MANTYPE; |
| 4495 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4496 | AC_SUBST([mansubdir]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4497 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4498 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4499 | MD5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4500 | AC_ARG_WITH([md5-passwords], |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4501 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4502 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 4503 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4504 | AC_DEFINE([HAVE_MD5_PASSWORDS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4505 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4506 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4507 | fi |
| 4508 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4509 | ) |
| 4510 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4511 | # Whether to disable shadow password support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4512 | AC_ARG_WITH([shadow], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4513 | [ --without-shadow Disable shadow password support], |
| 4514 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4515 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4516 | AC_DEFINE([DISABLE_SHADOW]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4517 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4518 | fi |
| 4519 | ] |
| 4520 | ) |
| 4521 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4522 | if test -z "$disable_shadow" ; then |
| 4523 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4524 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4525 | #include <sys/types.h> |
| 4526 | #include <shadow.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4527 | struct spwd sp; |
| 4528 | ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])], |
| 4529 | [ sp_expire_available=yes ], [ |
| 4530 | ]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4531 | |
| 4532 | if test "x$sp_expire_available" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4533 | AC_MSG_RESULT([yes]) |
| 4534 | AC_DEFINE([HAS_SHADOW_EXPIRE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4535 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4536 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4537 | AC_MSG_RESULT([no]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4538 | fi |
| 4539 | fi |
| 4540 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4541 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4542 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 4543 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4544 | AC_DEFINE([IPADDR_IN_DISPLAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4545 | [Define if you need to use IP address |
| 4546 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4547 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4548 | DISPLAY_HACK_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4549 | AC_ARG_WITH([ipaddr-display], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4550 | [ --with-ipaddr-display Use ip address instead of hostname in $DISPLAY], |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4551 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4552 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4553 | AC_DEFINE([IPADDR_IN_DISPLAY]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4554 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4555 | fi |
| 4556 | ] |
| 4557 | ) |
| 4558 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4559 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4560 | # check for /etc/default/login and use it if present. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4561 | AC_ARG_ENABLE([etc-default-login], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 4562 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4563 | [ if test "x$enableval" = "xno"; then |
| 4564 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 4565 | etc_default_login=no |
| 4566 | else |
| 4567 | etc_default_login=yes |
| 4568 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4569 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 4570 | then |
| 4571 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 4572 | etc_default_login=no |
| 4573 | else |
| 4574 | etc_default_login=yes |
| 4575 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4576 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4577 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4578 | if test "x$etc_default_login" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4579 | AC_CHECK_FILE(["/etc/default/login"], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4580 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4581 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4582 | AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4583 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4584 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4585 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4586 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4587 | 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] | 4588 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 4589 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4590 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4591 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4592 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4593 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4594 | SERVER_PATH_MSG="(default)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4595 | AC_ARG_WITH([default-path], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4596 | [ --with-default-path= Specify default $PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4597 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4598 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4599 | AC_MSG_WARN([ |
| 4600 | --with-default-path=PATH has no effect on this system. |
| 4601 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4602 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4603 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4604 | AC_MSG_WARN([ |
| 4605 | --with-default-path=PATH will only be used if PATH is not defined in |
| 4606 | $external_path_file .]) |
| 4607 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4608 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4609 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4610 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4611 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4612 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4613 | 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] | 4614 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4615 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4616 | AC_MSG_WARN([ |
| 4617 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 4618 | otherwise scp will not work.]) |
| 4619 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4620 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4621 | [AC_LANG_PROGRAM([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4622 | /* find out what STDPATH is */ |
| 4623 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4624 | #ifdef HAVE_PATHS_H |
| 4625 | # include <paths.h> |
| 4626 | #endif |
| 4627 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 4628 | # ifdef _PATH_USERPATH /* Irix */ |
| 4629 | # define _PATH_STDPATH _PATH_USERPATH |
| 4630 | # else |
| 4631 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 4632 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4633 | #endif |
| 4634 | #include <sys/types.h> |
| 4635 | #include <sys/stat.h> |
| 4636 | #include <fcntl.h> |
| 4637 | #define DATA "conftest.stdpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4638 | ]], [[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4639 | FILE *fd; |
| 4640 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4641 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4642 | fd = fopen(DATA,"w"); |
| 4643 | if(fd == NULL) |
| 4644 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4645 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4646 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 4647 | exit(1); |
| 4648 | |
| 4649 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4650 | ]])], |
| 4651 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4652 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 4653 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 4654 | ) |
| 4655 | # make sure $bindir is in USER_PATH so scp will work |
Damien Miller | 77eab7b | 2012-07-06 11:49:28 +1000 | [diff] [blame] | 4656 | t_bindir="${bindir}" |
| 4657 | while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do |
| 4658 | t_bindir=`eval echo ${t_bindir}` |
| 4659 | case $t_bindir in |
| 4660 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 4661 | esac |
| 4662 | case $t_bindir in |
| 4663 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 4664 | esac |
| 4665 | done |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4666 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 4667 | if test $? -ne 0 ; then |
| 4668 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 4669 | if test $? -ne 0 ; then |
| 4670 | user_path=$user_path:$t_bindir |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4671 | AC_MSG_RESULT([Adding $t_bindir to USER_PATH so scp will work]) |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4672 | fi |
| 4673 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4674 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4675 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4676 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4677 | AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH]) |
| 4678 | AC_SUBST([user_path]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4679 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4680 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4681 | # Set superuser path separately to user path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4682 | AC_ARG_WITH([superuser-path], |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4683 | [ --with-superuser-path= Specify different path for super-user], |
| 4684 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4685 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4686 | test "x${withval}" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4687 | AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4688 | [Define if you want a different $PATH |
| 4689 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4690 | superuser_path=$withval |
| 4691 | fi |
| 4692 | ] |
| 4693 | ) |
| 4694 | |
| 4695 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4696 | 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] | 4697 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4698 | AC_ARG_WITH(4in6, |
| 4699 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 4700 | [ |
| 4701 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4702 | AC_MSG_RESULT([yes]) |
| 4703 | AC_DEFINE([IPV4_IN_IPV6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4704 | [Detect IPv4 in IPv6 mapped addresses |
| 4705 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4706 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4707 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4708 | AC_MSG_RESULT([no]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4709 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4710 | ], [ |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4711 | if test "x$inet6_default_4in6" = "xyes"; then |
| 4712 | AC_MSG_RESULT([yes (default)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4713 | AC_DEFINE([IPV4_IN_IPV6]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4714 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4715 | else |
| 4716 | AC_MSG_RESULT([no (default)]) |
| 4717 | fi |
| 4718 | ] |
| 4719 | ) |
| 4720 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4721 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4722 | BSD_AUTH_MSG=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4723 | AC_ARG_WITH([bsd-auth], |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4724 | [ --with-bsd-auth Enable BSD auth support], |
| 4725 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4726 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4727 | AC_DEFINE([BSD_AUTH], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4728 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4729 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4730 | fi |
| 4731 | ] |
| 4732 | ) |
| 4733 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4734 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 4735 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4736 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4737 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4738 | piddir=`eval echo ${sysconfdir}` |
| 4739 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4740 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4741 | esac |
| 4742 | fi |
| 4743 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4744 | AC_ARG_WITH([pid-dir], |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4745 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 4746 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4747 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4748 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4749 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4750 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4751 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 4752 | fi |
| 4753 | fi |
| 4754 | ] |
| 4755 | ) |
| 4756 | |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4757 | AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4758 | [Specify location of ssh.pid]) |
| 4759 | AC_SUBST([piddir]) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 4760 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4761 | dnl allow user to disable some login recording features |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4762 | AC_ARG_ENABLE([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4763 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4764 | [ |
| 4765 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4766 | AC_DEFINE([DISABLE_LASTLOG]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4767 | fi |
| 4768 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4769 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4770 | AC_ARG_ENABLE([utmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4771 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4772 | [ |
| 4773 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4774 | AC_DEFINE([DISABLE_UTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4775 | fi |
| 4776 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4777 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4778 | AC_ARG_ENABLE([utmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4779 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4780 | [ |
| 4781 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4782 | AC_DEFINE([DISABLE_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4783 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4784 | fi |
| 4785 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4786 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4787 | AC_ARG_ENABLE([wtmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4788 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4789 | [ |
| 4790 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4791 | AC_DEFINE([DISABLE_WTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4792 | fi |
| 4793 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4794 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4795 | AC_ARG_ENABLE([wtmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4796 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4797 | [ |
| 4798 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4799 | AC_DEFINE([DISABLE_WTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4800 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4801 | fi |
| 4802 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4803 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4804 | AC_ARG_ENABLE([libutil], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4805 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4806 | [ |
| 4807 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4808 | AC_DEFINE([DISABLE_LOGIN]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4809 | fi |
| 4810 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4811 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4812 | AC_ARG_ENABLE([pututline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4813 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4814 | [ |
| 4815 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4816 | AC_DEFINE([DISABLE_PUTUTLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4817 | [Define if you don't want to use pututline() |
| 4818 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4819 | fi |
| 4820 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4821 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4822 | AC_ARG_ENABLE([pututxline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4823 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4824 | [ |
| 4825 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4826 | AC_DEFINE([DISABLE_PUTUTXLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4827 | [Define if you don't want to use pututxline() |
| 4828 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4829 | fi |
| 4830 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4831 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4832 | AC_ARG_WITH([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4833 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4834 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4835 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4836 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4837 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4838 | conf_lastlog_location=$withval |
| 4839 | fi |
| 4840 | ] |
| 4841 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4842 | |
| 4843 | dnl lastlog, [uw]tmpx? detection |
| 4844 | dnl NOTE: set the paths in the platform section to avoid the |
| 4845 | dnl need for command-line parameters |
| 4846 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 4847 | |
| 4848 | dnl lastlog detection |
| 4849 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 4850 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4851 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4852 | #include <sys/types.h> |
| 4853 | #include <utmp.h> |
| 4854 | #ifdef HAVE_LASTLOG_H |
| 4855 | # include <lastlog.h> |
| 4856 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4857 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4858 | # include <paths.h> |
| 4859 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 4860 | #ifdef HAVE_LOGIN_H |
| 4861 | # include <login.h> |
| 4862 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4863 | ]], [[ char *lastlog = LASTLOG_FILE; ]])], |
| 4864 | [ AC_MSG_RESULT([yes]) ], |
| 4865 | [ |
| 4866 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4867 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4868 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4869 | #include <sys/types.h> |
| 4870 | #include <utmp.h> |
| 4871 | #ifdef HAVE_LASTLOG_H |
| 4872 | # include <lastlog.h> |
| 4873 | #endif |
| 4874 | #ifdef HAVE_PATHS_H |
| 4875 | # include <paths.h> |
| 4876 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4877 | ]], [[ char *lastlog = _PATH_LASTLOG; ]])], |
| 4878 | [ AC_MSG_RESULT([yes]) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4879 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4880 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4881 | system_lastlog_path=no |
| 4882 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4883 | ]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4884 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4885 | if test -z "$conf_lastlog_location"; then |
| 4886 | if test x"$system_lastlog_path" = x"no" ; then |
| 4887 | 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] | 4888 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4889 | conf_lastlog_location=$f |
| 4890 | fi |
| 4891 | done |
| 4892 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 4893 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 4894 | 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] | 4895 | fi |
| 4896 | fi |
| 4897 | fi |
| 4898 | |
| 4899 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4900 | AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4901 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4902 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4903 | |
| 4904 | dnl utmp detection |
| 4905 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4906 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4907 | #include <sys/types.h> |
| 4908 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4909 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4910 | # include <paths.h> |
| 4911 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4912 | ]], [[ char *utmp = UTMP_FILE; ]])], |
| 4913 | [ AC_MSG_RESULT([yes]) ], |
| 4914 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4915 | system_utmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4916 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4917 | if test -z "$conf_utmp_location"; then |
| 4918 | if test x"$system_utmp_path" = x"no" ; then |
| 4919 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 4920 | if test -f $f ; then |
| 4921 | conf_utmp_location=$f |
| 4922 | fi |
| 4923 | done |
| 4924 | if test -z "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4925 | AC_DEFINE([DISABLE_UTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4926 | fi |
| 4927 | fi |
| 4928 | fi |
| 4929 | if test -n "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4930 | AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4931 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4932 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4933 | |
| 4934 | dnl wtmp detection |
| 4935 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4936 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4937 | #include <sys/types.h> |
| 4938 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4939 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4940 | # include <paths.h> |
| 4941 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4942 | ]], [[ char *wtmp = WTMP_FILE; ]])], |
| 4943 | [ AC_MSG_RESULT([yes]) ], |
| 4944 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4945 | system_wtmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4946 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4947 | if test -z "$conf_wtmp_location"; then |
| 4948 | if test x"$system_wtmp_path" = x"no" ; then |
| 4949 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 4950 | if test -f $f ; then |
| 4951 | conf_wtmp_location=$f |
| 4952 | fi |
| 4953 | done |
| 4954 | if test -z "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4955 | AC_DEFINE([DISABLE_WTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4956 | fi |
| 4957 | fi |
| 4958 | fi |
| 4959 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4960 | AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4961 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4962 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4963 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4964 | dnl wtmpx detection |
| 4965 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4966 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4967 | #include <sys/types.h> |
| 4968 | #include <utmp.h> |
| 4969 | #ifdef HAVE_UTMPX_H |
| 4970 | #include <utmpx.h> |
| 4971 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4972 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4973 | # include <paths.h> |
| 4974 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4975 | ]], [[ char *wtmpx = WTMPX_FILE; ]])], |
| 4976 | [ AC_MSG_RESULT([yes]) ], |
| 4977 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4978 | system_wtmpx_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4979 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4980 | if test -z "$conf_wtmpx_location"; then |
| 4981 | if test x"$system_wtmpx_path" = x"no" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4982 | AC_DEFINE([DISABLE_WTMPX]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4983 | fi |
| 4984 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4985 | AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4986 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4987 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4988 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 4989 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4990 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 4991 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 4992 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 4993 | fi |
| 4994 | |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4995 | AC_CHECK_MEMBER([struct lastlog.ll_line], [], [ |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4996 | if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4997 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 4998 | fi |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 4999 | ], [ |
| 5000 | #ifdef HAVE_SYS_TYPES_H |
| 5001 | #include <sys/types.h> |
| 5002 | #endif |
| 5003 | #ifdef HAVE_UTMP_H |
| 5004 | #include <utmp.h> |
| 5005 | #endif |
| 5006 | #ifdef HAVE_UTMPX_H |
| 5007 | #include <utmpx.h> |
| 5008 | #endif |
| 5009 | #ifdef HAVE_LASTLOG_H |
| 5010 | #include <lastlog.h> |
| 5011 | #endif |
| 5012 | ]) |
| 5013 | |
| 5014 | AC_CHECK_MEMBER([struct utmp.ut_line], [], [ |
| 5015 | AC_DEFINE([DISABLE_UTMP]) |
| 5016 | AC_DEFINE([DISABLE_WTMP]) |
| 5017 | ], [ |
| 5018 | #ifdef HAVE_SYS_TYPES_H |
| 5019 | #include <sys/types.h> |
| 5020 | #endif |
| 5021 | #ifdef HAVE_UTMP_H |
| 5022 | #include <utmp.h> |
| 5023 | #endif |
| 5024 | #ifdef HAVE_UTMPX_H |
| 5025 | #include <utmpx.h> |
| 5026 | #endif |
| 5027 | #ifdef HAVE_LASTLOG_H |
| 5028 | #include <lastlog.h> |
| 5029 | #endif |
| 5030 | ]) |
| 5031 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 5032 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 5033 | dnl Add now. |
| 5034 | CFLAGS="$CFLAGS $werror_flags" |
| 5035 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 5036 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 5037 | TEST_SSH_IPV6=no |
| 5038 | else |
| 5039 | TEST_SSH_IPV6=yes |
| 5040 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5041 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
| 5042 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 5043 | AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 5044 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
Darren Tucker | 6d8bd57 | 2013-06-11 11:26:10 +1000 | [diff] [blame] | 5045 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 5046 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 5047 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 5048 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 5049 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 5050 | survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 5051 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 5052 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5053 | # Print summary of options |
| 5054 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5055 | # Someone please show me a better way :) |
| 5056 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 5057 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 5058 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 5059 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 5060 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 5061 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5062 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5063 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 5064 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 5065 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5066 | |
| 5067 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 5068 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5069 | echo " User binaries: $B" |
| 5070 | echo " System binaries: $C" |
| 5071 | echo " Configuration files: $D" |
| 5072 | echo " Askpass program: $E" |
| 5073 | echo " Manual pages: $F" |
| 5074 | echo " PID file: $G" |
| 5075 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5076 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 5077 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 5078 | 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] | 5079 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5080 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 5081 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5082 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 5083 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 5084 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 5085 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5086 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5087 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5088 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5089 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 5090 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5091 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5092 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 5093 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5094 | echo " Smartcard support: $SCARD_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5095 | echo " S/KEY support: $SKEY_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5096 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 5097 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 5098 | echo " libldns support: $LDNS_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5099 | echo " Solaris process contract support: $SPC_MSG" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 5100 | echo " Solaris project support: $SP_MSG" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 5101 | echo " Solaris privilege support: $SPP_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 5102 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5103 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 5104 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 5105 | echo " Random number source: $RAND_MSG" |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 5106 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 5107 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5108 | echo "" |
| 5109 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 5110 | echo " Host: ${host}" |
| 5111 | echo " Compiler: ${CC}" |
| 5112 | echo " Compiler flags: ${CFLAGS}" |
| 5113 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 5114 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 5115 | echo " Libraries: ${LIBS}" |
| 5116 | if test ! -z "${SSHDLIBS}"; then |
| 5117 | echo " +for sshd: ${SSHDLIBS}" |
| 5118 | fi |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 5119 | if test ! -z "${SSHLIBS}"; then |
| 5120 | echo " +for ssh: ${SSHLIBS}" |
| 5121 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5122 | |
| 5123 | echo "" |
| 5124 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5125 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 5126 | echo "SVR4 style packages are supported with \"make package\"" |
| 5127 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5128 | fi |
| 5129 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 5130 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5131 | echo "PAM is enabled. You may need to install a PAM control file " |
| 5132 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 5133 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5134 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 5135 | echo "" |
| 5136 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 5137 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5138 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 5139 | echo "WARNING: the operating system that you are using does not" |
| 5140 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 5141 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 5142 | echo "enforce security checks to prevent unauthorised connections to" |
| 5143 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 5144 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5145 | echo "" |
| 5146 | fi |
| 5147 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 5148 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 5149 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 5150 | echo "See the Solaris section in README.platform for details." |
| 5151 | fi |