Damien Miller | 4fefe24 | 2004-03-11 14:20:10 +1100 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 1999-2004 Damien Miller |
| 3 | # |
| 4 | # Permission to use, copy, modify, and distribute this software for any |
| 5 | # purpose with or without fee is hereby granted, provided that the above |
| 6 | # copyright notice and this permission notice appear in all copies. |
| 7 | # |
| 8 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 15 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 16 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 17 | AC_REVISION($Revision: 1.583 $) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 18 | AC_CONFIG_SRCDIR([ssh.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 19 | AC_LANG([C]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 20 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 21 | AC_CONFIG_HEADER([config.h]) |
Darren Tucker | c90a792 | 2019-01-21 09:22:36 +1100 | [diff] [blame] | 22 | AC_PROG_CC([cc gcc]) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 23 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 24 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 25 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 26 | # Checks for programs. |
Darren Tucker | 167bd9c | 2003-09-07 12:34:54 +1000 | [diff] [blame] | 27 | AC_PROG_AWK |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 28 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 29 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 30 | AC_PROG_INSTALL |
Tim Rice | fd80ddc | 2006-02-02 19:11:56 -0800 | [diff] [blame] | 31 | AC_PROG_EGREP |
Darren Tucker | 6c8a246 | 2017-12-01 17:11:47 +1100 | [diff] [blame] | 32 | AC_PROG_MKDIR_P |
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]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 36 | AC_PATH_PROG([SED], [sed]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 37 | AC_PATH_PROG([ENT], [ent]) |
| 38 | AC_SUBST([ENT]) |
| 39 | AC_PATH_PROG([TEST_MINUS_S_SH], [bash]) |
| 40 | AC_PATH_PROG([TEST_MINUS_S_SH], [ksh]) |
| 41 | AC_PATH_PROG([TEST_MINUS_S_SH], [sh]) |
| 42 | AC_PATH_PROG([SH], [sh]) |
| 43 | AC_PATH_PROG([GROFF], [groff]) |
| 44 | AC_PATH_PROG([NROFF], [nroff]) |
| 45 | AC_PATH_PROG([MANDOC], [mandoc]) |
| 46 | AC_SUBST([TEST_SHELL], [sh]) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 47 | |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 48 | dnl select manpage formatter |
| 49 | if test "x$MANDOC" != "x" ; then |
| 50 | MANFMT="$MANDOC" |
| 51 | elif test "x$NROFF" != "x" ; then |
| 52 | MANFMT="$NROFF -mandoc" |
| 53 | elif test "x$GROFF" != "x" ; then |
| 54 | MANFMT="$GROFF -mandoc -Tascii" |
| 55 | else |
| 56 | AC_MSG_WARN([no manpage formatted found]) |
| 57 | MANFMT="false" |
| 58 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 59 | AC_SUBST([MANFMT]) |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 60 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 61 | dnl for buildpkg.sh |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 62 | AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd], |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 63 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 64 | AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd], |
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_CHECK_PROG([MAKE_PACKAGE_SUPPORTED], [pkgmk], [yes], [no]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 67 | if test -x /sbin/sh; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 68 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/sbin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 69 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 70 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/bin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 71 | fi |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 72 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 73 | # System features |
| 74 | AC_SYS_LARGEFILE |
| 75 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 76 | if test -z "$AR" ; then |
| 77 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 78 | fi |
| 79 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 80 | AC_PATH_PROG([PATH_PASSWD_PROG], [passwd]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 81 | if test ! -z "$PATH_PASSWD_PROG" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 82 | AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 83 | [Full path of your "passwd" program]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 84 | fi |
| 85 | |
Darren Tucker | f2c06ab | 2018-06-08 17:43:36 +1000 | [diff] [blame] | 86 | dnl Since autoconf doesn't support it very well, we no longer allow users to |
| 87 | dnl override LD, however keeping the hook here for now in case there's a use |
| 88 | dnl use case we overlooked and someone needs to re-enable it. Unless a good |
| 89 | dnl reason is found we'll be removing this in future. |
| 90 | LD="$CC" |
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 |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 112 | AC_ARG_WITH([openssl], |
| 113 | [ --without-openssl Disable use of OpenSSL; use only limited internal crypto **EXPERIMENTAL** ], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 114 | [ if test "x$withval" = "xno" ; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 115 | openssl=no |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 116 | fi |
| 117 | ] |
| 118 | ) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 119 | AC_MSG_CHECKING([whether OpenSSL will be used for cryptography]) |
| 120 | if test "x$openssl" = "xyes" ; then |
| 121 | AC_MSG_RESULT([yes]) |
| 122 | AC_DEFINE_UNQUOTED([WITH_OPENSSL], [1], [use libcrypto for cryptography]) |
| 123 | else |
| 124 | AC_MSG_RESULT([no]) |
| 125 | fi |
| 126 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 127 | use_stack_protector=1 |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 128 | use_toolchain_hardening=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 129 | AC_ARG_WITH([stackprotect], |
Damien Miller | da3155e | 2008-03-27 12:30:18 +1100 | [diff] [blame] | 130 | [ --without-stackprotect Don't use compiler's stack protection], [ |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 131 | if test "x$withval" = "xno"; then |
| 132 | use_stack_protector=0 |
| 133 | fi ]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 134 | AC_ARG_WITH([hardening], |
| 135 | [ --without-hardening Don't use toolchain hardening flags], [ |
| 136 | if test "x$withval" = "xno"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 137 | use_toolchain_hardening=0 |
| 138 | fi ]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 139 | |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 140 | # We use -Werror for the tests only so that we catch warnings like "this is |
| 141 | # on by default" for things like -fPIE. |
| 142 | AC_MSG_CHECKING([if $CC supports -Werror]) |
| 143 | saved_CFLAGS="$CFLAGS" |
| 144 | CFLAGS="$CFLAGS -Werror" |
| 145 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], |
| 146 | [ AC_MSG_RESULT([yes]) |
| 147 | WERROR="-Werror"], |
| 148 | [ AC_MSG_RESULT([no]) |
| 149 | WERROR="" ] |
| 150 | ) |
| 151 | CFLAGS="$saved_CFLAGS" |
Damien Miller | 134d02a | 2011-01-12 16:00:37 +1100 | [diff] [blame] | 152 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 153 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Darren Tucker | d904886 | 2017-03-31 11:04:43 +1100 | [diff] [blame] | 154 | OSSH_CHECK_CFLAG_COMPILE([-pipe]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 155 | OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) |
| 156 | OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 157 | OSSH_CHECK_CFLAG_COMPILE([-Wall]) |
| 158 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) |
| 159 | OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) |
| 160 | OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) |
| 161 | OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) |
Darren Tucker | abbc7a7 | 2013-05-10 13:54:23 +1000 | [diff] [blame] | 162 | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 163 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) |
| 164 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) |
| 165 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 166 | if test "x$use_toolchain_hardening" = "x1"; then |
Darren Tucker | 3377df0 | 2018-02-11 09:32:37 +1100 | [diff] [blame] | 167 | OSSH_CHECK_CFLAG_COMPILE([-mretpoline]) # clang |
Darren Tucker | 174bed6 | 2018-02-13 18:12:47 +1100 | [diff] [blame] | 168 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,retpolineplt]) |
Damien Miller | 161af8f | 2017-09-19 10:18:56 +1000 | [diff] [blame] | 169 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 170 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) |
| 171 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) |
| 172 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 173 | # NB. -ftrapv expects certain support functions to be present in |
| 174 | # the compiler library (libgcc or similar) to detect integer operations |
| 175 | # that can overflow. We must check that the result of enabling it |
| 176 | # actually links. The test program compiled/linked includes a number |
| 177 | # of integer operations that should exercise this. |
| 178 | OSSH_CHECK_CFLAG_LINK([-ftrapv]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 179 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 180 | AC_MSG_CHECKING([gcc version]) |
Darren Tucker | 3f9545e | 2005-11-12 15:20:52 +1100 | [diff] [blame] | 181 | GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 182 | case $GCC_VER in |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 183 | 1.*) no_attrib_nonnull=1 ;; |
| 184 | 2.8* | 2.9*) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 185 | no_attrib_nonnull=1 |
| 186 | ;; |
| 187 | 2.*) no_attrib_nonnull=1 ;; |
Darren Tucker | f032435 | 2005-11-10 21:30:36 +1100 | [diff] [blame] | 188 | *) ;; |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 189 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 190 | AC_MSG_RESULT([$GCC_VER]) |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 191 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 192 | AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 193 | saved_CFLAGS="$CFLAGS" |
| 194 | CFLAGS="$CFLAGS -fno-builtin-memset" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 195 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], |
| 196 | [[ char b[10]; memset(b, 0, sizeof(b)); ]])], |
| 197 | [ AC_MSG_RESULT([yes]) ], |
| 198 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 199 | CFLAGS="$saved_CFLAGS" ] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 200 | ) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 201 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 202 | # -fstack-protector-all doesn't always work for some GCC versions |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 203 | # 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] | 204 | # 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] | 205 | if test "x$use_stack_protector" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 206 | for t in -fstack-protector-strong -fstack-protector-all \ |
| 207 | -fstack-protector; do |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 208 | AC_MSG_CHECKING([if $CC supports $t]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 209 | saved_CFLAGS="$CFLAGS" |
| 210 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 211 | CFLAGS="$CFLAGS $t -Werror" |
| 212 | LDFLAGS="$LDFLAGS $t -Werror" |
| 213 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 214 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 215 | [[ |
| 216 | char x[256]; |
| 217 | snprintf(x, sizeof(x), "XXX"); |
| 218 | ]])], |
| 219 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 220 | CFLAGS="$saved_CFLAGS $t" |
| 221 | LDFLAGS="$saved_LDFLAGS $t" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 222 | AC_MSG_CHECKING([if $t works]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 223 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 224 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 225 | [[ |
| 226 | char x[256]; |
| 227 | snprintf(x, sizeof(x), "XXX"); |
| 228 | ]])], |
| 229 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 230 | break ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 231 | [ AC_MSG_RESULT([no]) ], |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 232 | [ AC_MSG_WARN([cross compiling: cannot test]) |
| 233 | break ] |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 234 | ) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 235 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 236 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 237 | ) |
| 238 | CFLAGS="$saved_CFLAGS" |
| 239 | LDFLAGS="$saved_LDFLAGS" |
| 240 | done |
| 241 | fi |
Darren Tucker | 319b3d9 | 2007-12-02 21:02:22 +1100 | [diff] [blame] | 242 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 243 | if test -z "$have_llong_max"; then |
| 244 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 245 | unset ac_cv_have_decl_LLONG_MAX |
| 246 | saved_CFLAGS="$CFLAGS" |
| 247 | CFLAGS="$CFLAGS -std=gnu99" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 248 | AC_CHECK_DECL([LLONG_MAX], |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 249 | [have_llong_max=1], |
| 250 | [CFLAGS="$saved_CFLAGS"], |
| 251 | [#include <limits.h>] |
| 252 | ) |
| 253 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 254 | fi |
| 255 | |
Darren Tucker | 951b53b | 2013-02-08 11:50:09 +1100 | [diff] [blame] | 256 | AC_MSG_CHECKING([if compiler allows __attribute__ on return types]) |
| 257 | AC_COMPILE_IFELSE( |
| 258 | [AC_LANG_PROGRAM([[ |
| 259 | #include <stdlib.h> |
| 260 | __attribute__((__unused__)) static void foo(void){return;}]], |
| 261 | [[ exit(0); ]])], |
| 262 | [ AC_MSG_RESULT([yes]) ], |
| 263 | [ AC_MSG_RESULT([no]) |
| 264 | AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1, |
| 265 | [compiler does not accept __attribute__ on return types]) ] |
| 266 | ) |
| 267 | |
Darren Tucker | 1323f12 | 2018-02-27 08:41:25 +1100 | [diff] [blame] | 268 | AC_MSG_CHECKING([if compiler allows __attribute__ prototype args]) |
| 269 | AC_COMPILE_IFELSE( |
| 270 | [AC_LANG_PROGRAM([[ |
| 271 | #include <stdlib.h> |
| 272 | typedef void foo(const char *, ...) __attribute__((format(printf, 1, 2)));]], |
| 273 | [[ exit(0); ]])], |
| 274 | [ AC_MSG_RESULT([yes]) ], |
| 275 | [ AC_MSG_RESULT([no]) |
| 276 | AC_DEFINE(NO_ATTRIBUTE_ON_PROTOTYPE_ARGS, 1, |
Damien Miller | 10479cc | 2018-04-10 10:19:02 +1000 | [diff] [blame] | 277 | [compiler does not accept __attribute__ on prototype args]) ] |
Darren Tucker | 1323f12 | 2018-02-27 08:41:25 +1100 | [diff] [blame] | 278 | ) |
| 279 | |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 280 | if test "x$no_attrib_nonnull" != "x1" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 281 | AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 282 | fi |
| 283 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 284 | AC_ARG_WITH([rpath], |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 285 | [ --without-rpath Disable auto-added -R linker paths], |
| 286 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 287 | if test "x$withval" = "xno" ; then |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 288 | rpath_opt="" |
| 289 | elif test "x$withval" = "xyes" ; then |
| 290 | rpath_opt="-R" |
| 291 | else |
| 292 | rpath_opt="$withval" |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 293 | fi |
| 294 | ] |
| 295 | ) |
| 296 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 297 | # Allow user to specify flags |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 298 | AC_ARG_WITH([cflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 299 | [ --with-cflags Specify additional flags to pass to compiler], |
| 300 | [ |
| 301 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 302 | test "x${withval}" != "xyes"; then |
| 303 | CFLAGS="$CFLAGS $withval" |
| 304 | fi |
| 305 | ] |
| 306 | ) |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 307 | |
| 308 | AC_ARG_WITH([cflags-after], |
| 309 | [ --with-cflags-after Specify additional flags to pass to compiler after configure], |
| 310 | [ |
| 311 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 312 | test "x${withval}" != "xyes"; then |
| 313 | CFLAGS_AFTER="$withval" |
| 314 | fi |
| 315 | ] |
| 316 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 317 | AC_ARG_WITH([cppflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 318 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 319 | [ |
| 320 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 321 | test "x${withval}" != "xyes"; then |
| 322 | CPPFLAGS="$CPPFLAGS $withval" |
| 323 | fi |
| 324 | ] |
| 325 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 326 | AC_ARG_WITH([ldflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 327 | [ --with-ldflags Specify additional flags to pass to linker], |
| 328 | [ |
| 329 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 330 | test "x${withval}" != "xyes"; then |
| 331 | LDFLAGS="$LDFLAGS $withval" |
| 332 | fi |
| 333 | ] |
| 334 | ) |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 335 | AC_ARG_WITH([ldflags-after], |
| 336 | [ --with-ldflags-after Specify additional flags to pass to linker after configure], |
| 337 | [ |
| 338 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 339 | test "x${withval}" != "xyes"; then |
| 340 | LDFLAGS_AFTER="$withval" |
| 341 | fi |
| 342 | ] |
| 343 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 344 | AC_ARG_WITH([libs], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 345 | [ --with-libs Specify additional libraries to link with], |
| 346 | [ |
| 347 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 348 | test "x${withval}" != "xyes"; then |
| 349 | LIBS="$LIBS $withval" |
| 350 | fi |
| 351 | ] |
| 352 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 353 | AC_ARG_WITH([Werror], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 354 | [ --with-Werror Build main code with -Werror], |
| 355 | [ |
| 356 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 357 | werror_flags="-Werror" |
| 358 | if test "x${withval}" != "xyes"; then |
| 359 | werror_flags="$withval" |
| 360 | fi |
| 361 | fi |
| 362 | ] |
| 363 | ) |
| 364 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 365 | AC_CHECK_HEADERS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 366 | blf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 367 | bstring.h \ |
| 368 | crypt.h \ |
| 369 | crypto/sha2.h \ |
| 370 | dirent.h \ |
| 371 | endian.h \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 372 | elf.h \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 373 | err.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 374 | features.h \ |
| 375 | fcntl.h \ |
| 376 | floatingpoint.h \ |
| 377 | getopt.h \ |
| 378 | glob.h \ |
| 379 | ia.h \ |
| 380 | iaf.h \ |
Darren Tucker | b59162d | 2018-02-23 15:20:42 +1100 | [diff] [blame] | 381 | ifaddrs.h \ |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 382 | inttypes.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 383 | langinfo.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 384 | limits.h \ |
Darren Tucker | ae133d4 | 2013-06-06 08:30:20 +1000 | [diff] [blame] | 385 | locale.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 386 | login.h \ |
| 387 | maillock.h \ |
| 388 | ndir.h \ |
| 389 | net/if_tun.h \ |
| 390 | netdb.h \ |
| 391 | netgroup.h \ |
| 392 | pam/pam_appl.h \ |
| 393 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 394 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 395 | pty.h \ |
| 396 | readpassphrase.h \ |
| 397 | rpc/types.h \ |
| 398 | security/pam_appl.h \ |
| 399 | sha2.h \ |
| 400 | shadow.h \ |
| 401 | stddef.h \ |
| 402 | stdint.h \ |
| 403 | string.h \ |
| 404 | strings.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 405 | sys/bitypes.h \ |
| 406 | sys/bsdtty.h \ |
| 407 | sys/cdefs.h \ |
| 408 | sys/dir.h \ |
Damien Miller | f885474 | 2018-02-26 12:18:14 +1100 | [diff] [blame] | 409 | sys/file.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 410 | sys/mman.h \ |
Darren Tucker | ce066f6 | 2018-02-22 20:45:09 +1100 | [diff] [blame] | 411 | sys/label.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 412 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 413 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 414 | sys/prctl.h \ |
| 415 | sys/pstat.h \ |
Darren Tucker | 5ee3fb5 | 2016-11-01 08:12:33 +1100 | [diff] [blame] | 416 | sys/ptrace.h \ |
Damien Miller | afa6e79 | 2018-04-13 13:31:42 +1000 | [diff] [blame] | 417 | sys/random.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 418 | sys/select.h \ |
| 419 | sys/stat.h \ |
| 420 | sys/stream.h \ |
| 421 | sys/stropts.h \ |
| 422 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 423 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 424 | sys/sysmacros.h \ |
| 425 | sys/time.h \ |
| 426 | sys/timers.h \ |
Darren Tucker | 1105756 | 2018-02-25 11:22:57 +1100 | [diff] [blame] | 427 | sys/vfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 428 | time.h \ |
| 429 | tmpdir.h \ |
| 430 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 431 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 432 | unistd.h \ |
| 433 | usersec.h \ |
| 434 | util.h \ |
| 435 | utime.h \ |
| 436 | utmp.h \ |
| 437 | utmpx.h \ |
| 438 | vis.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 439 | wchar.h \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 440 | ]) |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 441 | |
Darren Tucker | ce066f6 | 2018-02-22 20:45:09 +1100 | [diff] [blame] | 442 | # On some platforms (eg SunOS4) sys/audit.h requires sys/[time|types|label.h] |
| 443 | # to be included first. |
| 444 | AC_CHECK_HEADERS([sys/audit.h], [], [], [ |
| 445 | #ifdef HAVE_SYS_TIME_H |
| 446 | # include <sys/time.h> |
| 447 | #endif |
| 448 | #ifdef HAVE_SYS_TYPES_H |
| 449 | # include <sys/types.h> |
| 450 | #endif |
| 451 | #ifdef HAVE_SYS_LABEL_H |
| 452 | # include <sys/label.h> |
| 453 | #endif |
| 454 | ]) |
| 455 | |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 456 | # sys/capsicum.h requires sys/types.h |
| 457 | AC_CHECK_HEADERS([sys/capsicum.h], [], [], [ |
| 458 | #ifdef HAVE_SYS_TYPES_H |
| 459 | # include <sys/types.h> |
| 460 | #endif |
| 461 | ]) |
| 462 | |
Darren Tucker | fa1b834 | 2017-11-03 14:09:45 +1100 | [diff] [blame] | 463 | # net/route.h requires sys/socket.h and sys/types.h. |
| 464 | # sys/sysctl.h also requires sys/param.h |
| 465 | AC_CHECK_HEADERS([net/route.h sys/sysctl.h], [], [], [ |
| 466 | #ifdef HAVE_SYS_TYPES_H |
| 467 | # include <sys/types.h> |
| 468 | #endif |
| 469 | #include <sys/param.h> |
Damien Miller | 3235473 | 2017-10-25 11:25:43 +1100 | [diff] [blame] | 470 | #include <sys/socket.h> |
| 471 | ]) |
| 472 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 473 | # lastlog.h requires sys/time.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 474 | AC_CHECK_HEADERS([lastlog.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 475 | #ifdef HAVE_SYS_TIME_H |
| 476 | # include <sys/time.h> |
| 477 | #endif |
| 478 | ]) |
| 479 | |
| 480 | # 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] | 481 | AC_CHECK_HEADERS([sys/ptms.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 482 | #ifdef HAVE_SYS_STREAM_H |
| 483 | # include <sys/stream.h> |
| 484 | #endif |
| 485 | ]) |
| 486 | |
| 487 | # login_cap.h requires sys/types.h on NetBSD |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 488 | AC_CHECK_HEADERS([login_cap.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 489 | #include <sys/types.h> |
| 490 | ]) |
| 491 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 492 | # older BSDs need sys/param.h before sys/mount.h |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 493 | AC_CHECK_HEADERS([sys/mount.h], [], [], [ |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 494 | #include <sys/param.h> |
| 495 | ]) |
| 496 | |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 497 | # Android requires sys/socket.h to be included before sys/un.h |
| 498 | AC_CHECK_HEADERS([sys/un.h], [], [], [ |
Darren Tucker | 0b43ffe | 2013-06-03 09:30:44 +1000 | [diff] [blame] | 499 | #include <sys/types.h> |
Darren Tucker | 16cac19 | 2013-06-04 12:55:24 +1000 | [diff] [blame] | 500 | #include <sys/socket.h> |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 501 | ]) |
| 502 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 503 | # Messages for features tested for in target-specific section |
| 504 | SIA_MSG="no" |
| 505 | SPC_MSG="no" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 506 | SP_MSG="no" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 507 | SPP_MSG="no" |
| 508 | |
| 509 | # Support for Solaris/Illumos privileges (this test is used by both |
| 510 | # the --with-solaris-privs option and --with-sandbox=solaris). |
| 511 | SOLARIS_PRIVS="no" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 512 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 513 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 514 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 515 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 516 | # Some versions of VAC won't allow macro redefinitions at |
| 517 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 518 | # particularly with older versions of vac or xlc. |
Damien Miller | 10479cc | 2018-04-10 10:19:02 +1000 | [diff] [blame] | 519 | # It also throws errors about null macro arguments, but these are |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 520 | # not fatal. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 521 | AC_MSG_CHECKING([if compiler allows macro redefinitions]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 522 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 523 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 524 | #define testmacro foo |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 525 | #define testmacro bar]], |
| 526 | [[ exit(0); ]])], |
| 527 | [ AC_MSG_RESULT([yes]) ], |
| 528 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 529 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 530 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 531 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 532 | ] |
| 533 | ) |
| 534 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 535 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 536 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 537 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 538 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 539 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 540 | if test "$GCC" = "yes"; then |
| 541 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 542 | else |
| 543 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 544 | fi |
| 545 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 546 | if (test -z "$blibflags"); then |
| 547 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 548 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
| 549 | [blibflags=$tryflags], []) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 550 | fi |
| 551 | done |
| 552 | if (test -z "$blibflags"); then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 553 | AC_MSG_RESULT([not found]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 554 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 555 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 556 | AC_MSG_RESULT([$blibflags]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 557 | fi |
| 558 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 559 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 560 | AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 561 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 562 | [AC_CHECK_LIB([s], [authenticate], |
| 563 | [ AC_DEFINE([WITH_AIXAUTHENTICATE]) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 564 | LIBS="$LIBS -ls" |
| 565 | ]) |
| 566 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 567 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 568 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 569 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 570 | 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] | 571 | AC_CHECK_DECLS([loginfailed], |
| 572 | [AC_MSG_CHECKING([if loginfailed takes 4 arguments]) |
| 573 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]], |
| 574 | [[ (void)loginfailed("user","host","tty",0); ]])], |
| 575 | [AC_MSG_RESULT([yes]) |
| 576 | AC_DEFINE([AIX_LOGINFAILED_4ARG], [1], |
| 577 | [Define if your AIX loginfailed() function |
| 578 | takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no]) |
| 579 | ])], |
| 580 | [], |
| 581 | [#include <usersec.h>] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 582 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 583 | AC_CHECK_FUNCS([getgrset setauthdb]) |
| 584 | AC_CHECK_DECL([F_CLOSEM], |
| 585 | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 586 | [], |
| 587 | [ #include <limits.h> |
| 588 | #include <fcntl.h> ] |
| 589 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 590 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 591 | AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) |
| 592 | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 593 | [Define if your platform breaks doing a seteuid before a setuid]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 594 | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) |
| 595 | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 596 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 597 | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) |
| 598 | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 599 | [Some systems need a utmpx entry for /bin/login to work]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 600 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 601 | [Define to a Set Process Title type if your system is |
| 602 | supported by bsd-setproctitle.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 603 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 604 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 605 | 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] | 606 | AC_DEFINE([PLATFORM_SYS_DIR_UID], 2, [System dirs owned by bin (uid 2)]) |
Darren Tucker | 2c71ca1 | 2018-03-30 18:23:07 +1100 | [diff] [blame] | 607 | AC_DEFINE([BROKEN_STRNDUP], 1, [strndup broken, see APAR IY61211]) |
| 608 | AC_DEFINE([BROKEN_STRNLEN], 1, [strnlen broken, see APAR IY62551]) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 609 | ;; |
Darren Tucker | 898ac93 | 2013-06-03 02:03:25 +1000 | [diff] [blame] | 610 | *-*-android*) |
| 611 | AC_DEFINE([DISABLE_UTMP], [1], [Define if you don't want to use utmp]) |
| 612 | AC_DEFINE([DISABLE_WTMP], [1], [Define if you don't want to use wtmp]) |
| 613 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 614 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 615 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 616 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 617 | AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin]) |
| 618 | AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 619 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 620 | [Define to disable UID restoration test]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 621 | AC_DEFINE([DISABLE_SHADOW], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 622 | [Define if you want to disable shadow passwords]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 623 | AC_DEFINE([NO_X11_UNIX_SOCKETS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 624 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 625 | AC_DEFINE([DISABLE_FD_PASSING], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 626 | [Define if your platform needs to skip post auth |
| 627 | file descriptor passing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 628 | AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) |
Darren Tucker | fdce373 | 2014-01-18 21:12:42 +1100 | [diff] [blame] | 629 | AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) |
| 630 | # Cygwin defines optargs, optargs as declspec(dllimport) for historical |
| 631 | # reasons which cause compile warnings, so we disable those warnings. |
| 632 | OSSH_CHECK_CFLAG_COMPILE([-Wno-attributes]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 633 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 634 | *-*-dgux*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 635 | AC_DEFINE([IP_TOS_IS_BROKEN], [1], |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 636 | [Define if your system choked on IP TOS setting]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 637 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 638 | AC_DEFINE([BROKEN_SETREUID]) |
| 639 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 640 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 641 | *-*-darwin*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 642 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 643 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
| 644 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 645 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 646 | exit(0); |
| 647 | else |
| 648 | exit(1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 649 | } |
| 650 | ]])], |
| 651 | [AC_MSG_RESULT([working])], |
| 652 | [AC_MSG_RESULT([buggy]) |
| 653 | AC_DEFINE([BROKEN_GETADDRINFO], [1], |
| 654 | [getaddrinfo is broken (if present)]) |
| 655 | ], |
| 656 | [AC_MSG_RESULT([assume it is working])]) |
| 657 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 658 | AC_DEFINE([BROKEN_SETREUID]) |
| 659 | AC_DEFINE([BROKEN_SETREGID]) |
| 660 | AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) |
| 661 | AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 662 | [Define if your resolver libs need this for getrrsetbyname]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 663 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
| 664 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 665 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 666 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 667 | [Prepend the address family to IP tunnel traffic]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 668 | m4_pattern_allow([AU_IPv]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 669 | AC_CHECK_DECL([AU_IPv4], [], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 670 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 671 | [#include <bsm/audit.h>] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 672 | AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 673 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 674 | ) |
Damien Miller | c09182f | 2011-06-03 12:11:38 +1000 | [diff] [blame] | 675 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
| 676 | [Define to a Set Process Title type if your system is |
| 677 | supported by bsd-setproctitle.c]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 678 | AC_CHECK_FUNCS([sandbox_init]) |
| 679 | AC_CHECK_HEADERS([sandbox.h]) |
Damien Miller | 39f303b | 2016-02-23 12:56:59 +1100 | [diff] [blame] | 680 | AC_CHECK_LIB([sandbox], [sandbox_apply], [ |
| 681 | SSHDLIBS="$SSHDLIBS -lsandbox" |
| 682 | ]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 683 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 684 | *-*-dragonfly*) |
| 685 | SSHDLIBS="$SSHDLIBS -lcrypt" |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 686 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 687 | ;; |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 688 | *-*-haiku*) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 689 | LIBS="$LIBS -lbsd " |
| 690 | AC_CHECK_LIB([network], [socket]) |
| 691 | AC_DEFINE([HAVE_U_INT64_T]) |
| 692 | MANTYPE=man |
| 693 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 694 | *-*-hpux*) |
| 695 | # 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] | 696 | 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] | 697 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 698 | AC_DEFINE([USE_PIPES]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 699 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 700 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 701 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 702 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 703 | 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] | 704 | maildir="/var/mail" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 705 | LIBS="$LIBS -lsec" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 706 | AC_CHECK_LIB([xnet], [t_error], , |
| 707 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 708 | |
| 709 | # next, we define all of the options specific to major releases |
| 710 | case "$host" in |
| 711 | *-*-hpux10*) |
| 712 | if test -z "$GCC"; then |
| 713 | CFLAGS="$CFLAGS -Ae" |
| 714 | fi |
| 715 | ;; |
| 716 | *-*-hpux11*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 717 | AC_DEFINE([PAM_SUN_CODEBASE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 718 | [Define if you are using Solaris-derived PAM which |
| 719 | passes pam_messages to the conversation function |
| 720 | with an extra level of indirection]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 721 | AC_DEFINE([DISABLE_UTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 722 | [Define if you don't want to use utmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 723 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 724 | check_for_hpux_broken_getaddrinfo=1 |
| 725 | check_for_conflicting_getspnam=1 |
| 726 | ;; |
| 727 | esac |
| 728 | |
| 729 | # lastly, we define options specific to minor releases |
| 730 | case "$host" in |
| 731 | *-*-hpux10.26) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 732 | AC_DEFINE([HAVE_SECUREWARE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 733 | [Define if you have SecureWare-based |
| 734 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 735 | disable_ptmx_check=yes |
| 736 | LIBS="$LIBS -lsecpw" |
| 737 | ;; |
| 738 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 739 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 740 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 741 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 742 | AC_DEFINE([BROKEN_INET_NTOA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 743 | [Define if you system's inet_ntoa is busted |
| 744 | (e.g. Irix gcc issue)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 745 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 746 | AC_DEFINE([BROKEN_SETREUID]) |
| 747 | AC_DEFINE([BROKEN_SETREGID]) |
| 748 | AC_DEFINE([WITH_ABBREV_NO_TTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 749 | [Define if you shouldn't strip 'tty' from your |
| 750 | ttyname in [uw]tmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 751 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 752 | ;; |
| 753 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 754 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 755 | AC_DEFINE([WITH_IRIX_ARRAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 756 | [Define if you have/want arrays |
Damien Miller | 10479cc | 2018-04-10 10:19:02 +1000 | [diff] [blame] | 757 | (cluster-wide session management, not C arrays)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 758 | AC_DEFINE([WITH_IRIX_PROJECT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 759 | [Define if you want IRIX project management]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 760 | AC_DEFINE([WITH_IRIX_AUDIT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 761 | [Define if you want IRIX audit trails]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 762 | AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 763 | [Define if you want IRIX kernel jobs])]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 764 | AC_DEFINE([BROKEN_INET_NTOA]) |
| 765 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 766 | AC_DEFINE([BROKEN_SETREUID]) |
| 767 | AC_DEFINE([BROKEN_SETREGID]) |
| 768 | AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)]) |
| 769 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 770 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 771 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 772 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 773 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 774 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 775 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"]) |
| 776 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 777 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 778 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 779 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 780 | *-*-linux*) |
| 781 | no_dev_ptmx=1 |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 782 | use_pie=auto |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 783 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 784 | check_for_openpty_ctty_bug=1 |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 785 | dnl Target SUSv3/POSIX.1-2001 plus BSD specifics. |
| 786 | dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE |
| 787 | CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 788 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 789 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 790 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 791 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 792 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 793 | AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 794 | [Define to whatever link() returns for "not supported" |
| 795 | if it doesn't return EOPNOTSUPP.]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 796 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 797 | AC_DEFINE([USE_BTMP]) |
| 798 | AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 799 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 800 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 801 | 1.*|2.0.*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 802 | AC_DEFINE([BROKEN_CMSG_TYPE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 803 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 804 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 805 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 806 | # tun(4) forwarding compat code |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 807 | AC_CHECK_HEADERS([linux/if_tun.h]) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 808 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 809 | AC_DEFINE([SSH_TUN_LINUX], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 810 | [Open tunnel devices the Linux tun/tap way]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 811 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 812 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 813 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 814 | [Prepend the address family to IP tunnel traffic]) |
| 815 | fi |
Darren Tucker | 81c9ccd | 2017-11-03 14:52:51 +1100 | [diff] [blame] | 816 | AC_CHECK_HEADER([linux/if.h], |
| 817 | AC_DEFINE([SYS_RDOMAIN_LINUX], [1], |
Darren Tucker | 24d2a33 | 2018-02-11 21:20:39 +1300 | [diff] [blame] | 818 | [Support routing domains using Linux VRF]), [], [ |
| 819 | #ifdef HAVE_SYS_TYPES_H |
| 820 | # include <sys/types.H> |
| 821 | #endif |
| 822 | ]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 823 | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], |
| 824 | [], [#include <linux/types.h>]) |
Vicente Olivert Riera | 5800867 | 2017-06-20 16:42:11 +0100 | [diff] [blame] | 825 | # Obtain MIPS ABI |
| 826 | case "$host" in |
| 827 | mips*) |
Darren Tucker | fbd733a | 2018-03-12 19:17:26 +1100 | [diff] [blame] | 828 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Vicente Olivert Riera | 5800867 | 2017-06-20 16:42:11 +0100 | [diff] [blame] | 829 | #if _MIPS_SIM != _ABIO32 |
| 830 | #error |
| 831 | #endif |
Darren Tucker | fbd733a | 2018-03-12 19:17:26 +1100 | [diff] [blame] | 832 | ]])],[mips_abi="o32"],[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Vicente Olivert Riera | 5800867 | 2017-06-20 16:42:11 +0100 | [diff] [blame] | 833 | #if _MIPS_SIM != _ABIN32 |
| 834 | #error |
| 835 | #endif |
Darren Tucker | fbd733a | 2018-03-12 19:17:26 +1100 | [diff] [blame] | 836 | ]])],[mips_abi="n32"],[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Vicente Olivert Riera | 5800867 | 2017-06-20 16:42:11 +0100 | [diff] [blame] | 837 | #if _MIPS_SIM != _ABI64 |
| 838 | #error |
| 839 | #endif |
Darren Tucker | fbd733a | 2018-03-12 19:17:26 +1100 | [diff] [blame] | 840 | ]])],[mips_abi="n64"],[AC_MSG_ERROR([unknown MIPS ABI]) |
Vicente Olivert Riera | 5800867 | 2017-06-20 16:42:11 +0100 | [diff] [blame] | 841 | ]) |
| 842 | ]) |
| 843 | ]) |
| 844 | ;; |
| 845 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 846 | AC_MSG_CHECKING([for seccomp architecture]) |
| 847 | seccomp_audit_arch= |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 848 | case "$host" in |
| 849 | x86_64-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 850 | seccomp_audit_arch=AUDIT_ARCH_X86_64 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 851 | ;; |
| 852 | i*86-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 853 | seccomp_audit_arch=AUDIT_ARCH_I386 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 854 | ;; |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 855 | arm*-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 856 | seccomp_audit_arch=AUDIT_ARCH_ARM |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 857 | ;; |
| 858 | aarch64*-*) |
| 859 | seccomp_audit_arch=AUDIT_ARCH_AARCH64 |
Damien Miller | 5c15e22 | 2015-06-18 15:07:56 +1000 | [diff] [blame] | 860 | ;; |
Damien Miller | b9c5061 | 2016-07-08 13:59:13 +1000 | [diff] [blame] | 861 | s390x-*) |
| 862 | seccomp_audit_arch=AUDIT_ARCH_S390X |
| 863 | ;; |
| 864 | s390-*) |
| 865 | seccomp_audit_arch=AUDIT_ARCH_S390 |
| 866 | ;; |
| 867 | powerpc64-*) |
| 868 | seccomp_audit_arch=AUDIT_ARCH_PPC64 |
| 869 | ;; |
| 870 | powerpc64le-*) |
| 871 | seccomp_audit_arch=AUDIT_ARCH_PPC64LE |
| 872 | ;; |
| 873 | mips-*) |
| 874 | seccomp_audit_arch=AUDIT_ARCH_MIPS |
| 875 | ;; |
| 876 | mipsel-*) |
| 877 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL |
| 878 | ;; |
| 879 | mips64-*) |
Vicente Olivert Riera | 4501151 | 2017-06-20 16:42:28 +0100 | [diff] [blame] | 880 | case "$mips_abi" in |
| 881 | "n32") |
| 882 | seccomp_audit_arch=AUDIT_ARCH_MIPS64N32 |
| 883 | ;; |
| 884 | "n64") |
| 885 | seccomp_audit_arch=AUDIT_ARCH_MIPS64 |
| 886 | ;; |
| 887 | esac |
Damien Miller | b9c5061 | 2016-07-08 13:59:13 +1000 | [diff] [blame] | 888 | ;; |
| 889 | mips64el-*) |
Vicente Olivert Riera | 4501151 | 2017-06-20 16:42:28 +0100 | [diff] [blame] | 890 | case "$mips_abi" in |
| 891 | "n32") |
| 892 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64N32 |
| 893 | ;; |
| 894 | "n64") |
| 895 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64 |
| 896 | ;; |
| 897 | esac |
Damien Miller | b9c5061 | 2016-07-08 13:59:13 +1000 | [diff] [blame] | 898 | ;; |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 899 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 900 | if test "x$seccomp_audit_arch" != "x" ; then |
| 901 | AC_MSG_RESULT(["$seccomp_audit_arch"]) |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 902 | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], |
| 903 | [Specify the system call convention in use]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 904 | else |
| 905 | AC_MSG_RESULT([architecture not supported]) |
| 906 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 907 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 908 | mips-sony-bsd|mips-sony-newsos4) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 909 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 910 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 911 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 912 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 913 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 914 | if test "x$withval" != "xno" ; then |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 915 | rpath_opt="-R" |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 916 | fi |
Damien Miller | 99522ba | 2016-07-28 08:54:27 +1000 | [diff] [blame] | 917 | CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 918 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 919 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 920 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 921 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 922 | [Prepend the address family to IP tunnel traffic]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 923 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | f5bbd3b | 2014-01-30 11:26:46 +1100 | [diff] [blame] | 924 | AC_DEFINE([BROKEN_READ_COMPARISON], [1], |
| 925 | [NetBSD read function is sometimes redirected, breaking atomicio comparisons against it]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 926 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 927 | *-*-freebsd*) |
| 928 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 929 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)]) |
| 930 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 931 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 932 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 933 | 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] | 934 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | 2035b22 | 2014-01-26 09:39:53 +1100 | [diff] [blame] | 935 | # Preauth crypto occasionally uses file descriptors for crypto offload |
| 936 | # and will crash if they cannot be opened. |
Damien Miller | 5b447c0 | 2014-01-26 09:46:53 +1100 | [diff] [blame] | 937 | AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE], [1], |
Tim Rice | 03ae081 | 2014-02-21 09:09:34 -0800 | [diff] [blame] | 938 | [define if setrlimit RLIMIT_NOFILE breaks things]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 939 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 940 | *-*-bsdi*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 941 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 942 | AC_DEFINE([BROKEN_SETREUID]) |
| 943 | AC_DEFINE([BROKEN_SETREGID]) |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 944 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 945 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 946 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 947 | conf_utmp_location=/etc/utmp |
| 948 | conf_wtmp_location=/usr/adm/wtmp |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 949 | maildir=/usr/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 950 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
| 951 | AC_DEFINE([BROKEN_REALPATH]) |
| 952 | AC_DEFINE([USE_PIPES]) |
| 953 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 954 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 955 | *-*-openbsd*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 956 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 957 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
| 958 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
| 959 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
| 960 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 961 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 962 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 963 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 964 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 965 | if test "x$withval" != "xno" ; then |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 966 | rpath_opt="-R" |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 967 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 968 | AC_DEFINE([PAM_SUN_CODEBASE]) |
| 969 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 970 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 971 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 972 | [Define if pam_chauthtok wants real uid set |
| 973 | to the unpriv'ed user]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 974 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 975 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 976 | AC_DEFINE([SSHD_ACQUIRES_CTTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 977 | [Define if sshd somehow reacquires a controlling TTY |
| 978 | after setsid()]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 979 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 980 | in case the name is longer than 8 chars]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 981 | AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 982 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 983 | # hardwire lastlog location (can't detect it on some versions) |
| 984 | conf_lastlog_location="/var/adm/lastlog" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 985 | AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 986 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 987 | if test "$sol2ver" -ge 8; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 988 | AC_MSG_RESULT([yes]) |
| 989 | AC_DEFINE([DISABLE_UTMP]) |
| 990 | AC_DEFINE([DISABLE_WTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 991 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 992 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 993 | AC_MSG_RESULT([no]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 994 | fi |
Darren Tucker | a86ec4d | 2016-06-14 10:48:27 +1000 | [diff] [blame] | 995 | AC_CHECK_FUNCS([setpflags]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 996 | AC_CHECK_FUNCS([setppriv]) |
| 997 | AC_CHECK_FUNCS([priv_basicset]) |
| 998 | AC_CHECK_HEADERS([priv.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 999 | AC_ARG_WITH([solaris-contracts], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1000 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 1001 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1002 | AC_CHECK_LIB([contract], [ct_tmpl_activate], |
| 1003 | [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1004 | [Define if you have Solaris process contracts]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 1005 | LIBS="$LIBS -lcontract" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1006 | SPC_MSG="yes" ], ) |
| 1007 | ], |
| 1008 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1009 | AC_ARG_WITH([solaris-projects], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 1010 | [ --with-solaris-projects Enable Solaris projects (experimental)], |
| 1011 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1012 | AC_CHECK_LIB([project], [setproject], |
| 1013 | [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 1014 | [Define if you have Solaris projects]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 1015 | LIBS="$LIBS -lproject" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 1016 | SP_MSG="yes" ], ) |
| 1017 | ], |
| 1018 | ) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 1019 | AC_ARG_WITH([solaris-privs], |
| 1020 | [ --with-solaris-privs Enable Solaris/Illumos privileges (experimental)], |
| 1021 | [ |
| 1022 | AC_MSG_CHECKING([for Solaris/Illumos privilege support]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 1023 | if test "x$ac_cv_func_setppriv" = "xyes" -a \ |
| 1024 | "x$ac_cv_header_priv_h" = "xyes" ; then |
| 1025 | SOLARIS_PRIVS=yes |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 1026 | AC_MSG_RESULT([found]) |
| 1027 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 1028 | [Define to disable UID restoration test]) |
| 1029 | AC_DEFINE([USE_SOLARIS_PRIVS], [1], |
| 1030 | [Define if you have Solaris privileges]) |
| 1031 | SPP_MSG="yes" |
| 1032 | else |
| 1033 | AC_MSG_RESULT([not found]) |
| 1034 | AC_MSG_ERROR([*** must have support for Solaris privileges to use --with-solaris-privs]) |
| 1035 | fi |
| 1036 | ], |
| 1037 | ) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1038 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1039 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 1040 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 1041 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1042 | AC_CHECK_FUNCS([getpwanam]) |
| 1043 | AC_DEFINE([PAM_SUN_CODEBASE]) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 1044 | conf_utmp_location=/etc/utmp |
| 1045 | conf_wtmp_location=/var/adm/wtmp |
| 1046 | conf_lastlog_location=/var/adm/lastlog |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1047 | AC_DEFINE([USE_PIPES]) |
Darren Tucker | c0a0c3f | 2018-03-05 20:03:07 +1100 | [diff] [blame] | 1048 | AC_DEFINE([DISABLE_UTMPX], [1], [no utmpx]) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 1049 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 1050 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1051 | LIBS="$LIBS -lc89" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1052 | AC_DEFINE([USE_PIPES]) |
| 1053 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 1054 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1055 | AC_DEFINE([BROKEN_SETREUID]) |
| 1056 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 1057 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 1058 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 1059 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1060 | AC_CHECK_LIB([dl], [dlsym], ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1061 | # -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] | 1062 | AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 1063 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1064 | AC_DEFINE([USE_PIPES]) |
| 1065 | AC_DEFINE([IP_TOS_IS_BROKEN]) |
| 1066 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1067 | AC_DEFINE([BROKEN_SETREUID]) |
| 1068 | AC_DEFINE([BROKEN_SETREGID]) |
| 1069 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 1070 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 1071 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 1072 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 1073 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 1074 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1075 | # 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] | 1076 | *-*-sysv4.2*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1077 | AC_DEFINE([USE_PIPES]) |
| 1078 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1079 | AC_DEFINE([BROKEN_SETREUID]) |
| 1080 | AC_DEFINE([BROKEN_SETREGID]) |
| 1081 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) |
| 1082 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1083 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1084 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1085 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1086 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 1087 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1088 | AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars]) |
| 1089 | AC_DEFINE([USE_PIPES]) |
| 1090 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1091 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1092 | AC_DEFINE([BROKEN_SETREUID]) |
| 1093 | AC_DEFINE([BROKEN_SETREGID]) |
| 1094 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
Tim Rice | 8433d51 | 2017-07-11 18:47:56 -0700 | [diff] [blame] | 1095 | AC_DEFINE([BROKEN_TCGETATTR_ICANON]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1096 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | 4afeaf3 | 2018-03-25 10:00:21 -0700 | [diff] [blame] | 1097 | check_for_libcrypt_later=1 |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1098 | case "$host" in |
| 1099 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 1100 | maildir=/var/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1101 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1102 | AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot" |
| 1103 | AC_CHECK_FUNCS([getluid setluid], , , [-lprot]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1104 | ], , ) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1105 | ;; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1106 | *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 1107 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1108 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1109 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1110 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1111 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1112 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1113 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 1114 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1115 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1116 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1117 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 1118 | if test -z "$GCC"; then |
| 1119 | CFLAGS="$CFLAGS -belf" |
| 1120 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 1121 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1122 | no_dev_ptmx=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1123 | AC_DEFINE([USE_PIPES]) |
| 1124 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1125 | AC_DEFINE([DISABLE_SHADOW]) |
| 1126 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1127 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1128 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1129 | AC_DEFINE([BROKEN_SETREUID]) |
| 1130 | AC_DEFINE([BROKEN_SETREGID]) |
| 1131 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1132 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1133 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
| 1134 | AC_CHECK_FUNCS([getluid setluid]) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1135 | MANTYPE=man |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1136 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 1137 | SKIP_DISABLE_LASTLOG_DEFINE=yes |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1138 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1139 | *-dec-osf*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1140 | AC_MSG_CHECKING([for Digital Unix SIA]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1141 | no_osfsia="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1142 | AC_ARG_WITH([osfsia], |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1143 | [ --with-osfsia Enable Digital Unix SIA], |
| 1144 | [ |
| 1145 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1146 | AC_MSG_RESULT([disabled]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1147 | no_osfsia=1 |
| 1148 | fi |
| 1149 | ], |
| 1150 | ) |
| 1151 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1152 | if test -f /etc/sia/matrix.conf; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1153 | AC_MSG_RESULT([yes]) |
| 1154 | AC_DEFINE([HAVE_OSF_SIA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1155 | [Define if you have Digital Unix Security |
| 1156 | Integration Architecture]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1157 | AC_DEFINE([DISABLE_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1158 | [Define if you don't want to use your |
| 1159 | system's login() call]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1160 | AC_DEFINE([DISABLE_FD_PASSING]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1161 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1162 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1163 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1164 | AC_MSG_RESULT([no]) |
| 1165 | AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1166 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1167 | fi |
| 1168 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1169 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1170 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1171 | AC_DEFINE([BROKEN_SETREUID]) |
| 1172 | AC_DEFINE([BROKEN_SETREGID]) |
| 1173 | AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1174 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1175 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 1176 | *-*-nto-qnx*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1177 | AC_DEFINE([USE_PIPES]) |
| 1178 | AC_DEFINE([NO_X11_UNIX_SOCKETS]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1179 | AC_DEFINE([DISABLE_LASTLOG]) |
| 1180 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 1181 | AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 1182 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1183 | case "$host" in |
| 1184 | *-*-nto-qnx6*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1185 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1186 | ;; |
| 1187 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1188 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 1189 | |
| 1190 | *-*-ultrix*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1191 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1192 | AC_DEFINE([NEED_SETPGRP]) |
| 1193 | 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] | 1194 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1195 | |
| 1196 | *-*-lynxos) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 1197 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
| 1198 | AC_DEFINE([BROKEN_SETVBUF], [1], |
| 1199 | [LynxOS has broken setvbuf() implementation]) |
| 1200 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1201 | esac |
| 1202 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1203 | AC_MSG_CHECKING([compiler and flags for sanity]) |
| 1204 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], |
| 1205 | [ AC_MSG_RESULT([yes]) ], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1206 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1207 | AC_MSG_RESULT([no]) |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1208 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1209 | ], |
| 1210 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1211 | ) |
| 1212 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1213 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1214 | # Checks for libraries. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1215 | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1216 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1217 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1218 | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ |
| 1219 | AC_CHECK_LIB([gen], [dirname], [ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1220 | AC_CACHE_CHECK([for broken dirname], |
| 1221 | ac_cv_have_broken_dirname, [ |
| 1222 | save_LIBS="$LIBS" |
| 1223 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1224 | AC_RUN_IFELSE( |
| 1225 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1226 | #include <libgen.h> |
| 1227 | #include <string.h> |
| 1228 | |
| 1229 | int main(int argc, char **argv) { |
| 1230 | char *s, buf[32]; |
| 1231 | |
| 1232 | strncpy(buf,"/etc", 32); |
| 1233 | s = dirname(buf); |
| 1234 | if (!s || strncmp(s, "/", 32) != 0) { |
| 1235 | exit(1); |
| 1236 | } else { |
| 1237 | exit(0); |
| 1238 | } |
| 1239 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1240 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1241 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1242 | [ ac_cv_have_broken_dirname="yes" ], |
| 1243 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1244 | ) |
| 1245 | LIBS="$save_LIBS" |
| 1246 | ]) |
| 1247 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 1248 | LIBS="$LIBS -lgen" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1249 | AC_DEFINE([HAVE_DIRNAME]) |
| 1250 | AC_CHECK_HEADERS([libgen.h]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1251 | fi |
| 1252 | ]) |
| 1253 | ]) |
| 1254 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1255 | AC_CHECK_FUNC([getspnam], , |
| 1256 | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) |
| 1257 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
| 1258 | [Define if you have the basename function.])]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1259 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1260 | dnl zlib is required |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1261 | AC_ARG_WITH([zlib], |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1262 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1263 | [ if test "x$withval" = "xno" ; then |
| 1264 | AC_MSG_ERROR([*** zlib is required ***]) |
| 1265 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1266 | if test -d "$withval/lib"; then |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 1267 | if test -n "${rpath_opt}"; then |
| 1268 | LDFLAGS="-L${withval}/lib ${rpath_opt}${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1269 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1270 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1271 | fi |
| 1272 | else |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 1273 | if test -n "${rpath_opt}"; then |
| 1274 | LDFLAGS="-L${withval} ${rpath_opt}${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1275 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1276 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1277 | fi |
| 1278 | fi |
| 1279 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1280 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1281 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1282 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1283 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1284 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1285 | ) |
| 1286 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1287 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) |
| 1288 | AC_CHECK_LIB([z], [deflate], , |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1289 | [ |
| 1290 | saved_CPPFLAGS="$CPPFLAGS" |
| 1291 | saved_LDFLAGS="$LDFLAGS" |
| 1292 | save_LIBS="$LIBS" |
| 1293 | dnl Check default zlib install dir |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 1294 | if test -n "${rpath_opt}"; then |
| 1295 | LDFLAGS="-L/usr/local/lib ${rpath_opt}/usr/local/lib ${saved_LDFLAGS}" |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1296 | else |
| 1297 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1298 | fi |
| 1299 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1300 | LIBS="$LIBS -lz" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1301 | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1302 | [ |
| 1303 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1304 | ] |
| 1305 | ) |
| 1306 | ] |
| 1307 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1308 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1309 | AC_ARG_WITH([zlib-version-check], |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1310 | [ --without-zlib-version-check Disable zlib version check], |
| 1311 | [ if test "x$withval" = "xno" ; then |
| 1312 | zlib_check_nonfatal=1 |
| 1313 | fi |
| 1314 | ] |
| 1315 | ) |
| 1316 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1317 | AC_MSG_CHECKING([for possibly buggy zlib]) |
| 1318 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1319 | #include <stdio.h> |
Darren Tucker | c8a0f27 | 2013-03-22 12:49:14 +1100 | [diff] [blame] | 1320 | #include <stdlib.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1321 | #include <zlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1322 | ]], |
| 1323 | [[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1324 | int a=0, b=0, c=0, d=0, n, v; |
| 1325 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1326 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1327 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1328 | v = a*1000000 + b*10000 + c*100 + d; |
| 1329 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1330 | |
| 1331 | /* 1.1.4 is OK */ |
| 1332 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1333 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1334 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1335 | /* 1.2.3 and up are OK */ |
| 1336 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1337 | exit(0); |
| 1338 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1339 | exit(2); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1340 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1341 | AC_MSG_RESULT([no]), |
| 1342 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1343 | if test -z "$zlib_check_nonfatal" ; then |
| 1344 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1345 | Your reported zlib version has known security problems. It's possible your |
| 1346 | vendor has fixed these problems without changing the version number. If you |
| 1347 | are sure this is the case, you can disable the check by running |
| 1348 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1349 | 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] | 1350 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1351 | else |
| 1352 | AC_MSG_WARN([zlib version may have security problems]) |
| 1353 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1354 | ], |
| 1355 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1356 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1357 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1358 | dnl UnixWare 2.x |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1359 | AC_CHECK_FUNC([strcasecmp], |
| 1360 | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1361 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1362 | AC_CHECK_FUNCS([utimes], |
| 1363 | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1364 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1365 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1366 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1367 | dnl Checks for libutil functions |
Damien Miller | b87f6b7 | 2013-02-23 09:12:23 +1100 | [diff] [blame] | 1368 | AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1369 | AC_SEARCH_LIBS([fmt_scaled], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1370 | AC_SEARCH_LIBS([scan_scaled], [util bsd]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1371 | AC_SEARCH_LIBS([login], [util bsd]) |
| 1372 | AC_SEARCH_LIBS([logout], [util bsd]) |
| 1373 | AC_SEARCH_LIBS([logwtmp], [util bsd]) |
| 1374 | AC_SEARCH_LIBS([openpty], [util bsd]) |
| 1375 | AC_SEARCH_LIBS([updwtmp], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1376 | AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp]) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1377 | |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1378 | # On some platforms, inet_ntop and gethostbyname may be found in libresolv |
| 1379 | # or libnsl. |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1380 | AC_SEARCH_LIBS([inet_ntop], [resolv nsl]) |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1381 | AC_SEARCH_LIBS([gethostbyname], [resolv nsl]) |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1382 | |
Darren Tucker | 74c1c36 | 2017-09-27 07:44:41 +1000 | [diff] [blame] | 1383 | # "Particular Function Checks" |
| 1384 | # see https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Functions.html |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1385 | AC_FUNC_STRFTIME |
Darren Tucker | 74c1c36 | 2017-09-27 07:44:41 +1000 | [diff] [blame] | 1386 | AC_FUNC_MALLOC |
| 1387 | AC_FUNC_REALLOC |
| 1388 | # autoconf doesn't have AC_FUNC_CALLOC so fake it if malloc returns NULL; |
Darren Tucker | e9dede0 | 2018-02-25 10:20:31 +1100 | [diff] [blame] | 1389 | AC_MSG_CHECKING([if calloc(0, N) returns non-null]) |
| 1390 | AC_RUN_IFELSE( |
| 1391 | [AC_LANG_PROGRAM( |
| 1392 | [[ #include <stdlib.h> ]], |
| 1393 | [[ void *p = calloc(0, 1); exit(p == NULL); ]] |
| 1394 | )], |
| 1395 | [ func_calloc_0_nonnull=yes ], |
| 1396 | [ func_calloc_0_nonnull=no ], |
| 1397 | [ AC_MSG_WARN([cross compiling: assuming same as malloc]) |
| 1398 | func_calloc_0_nonnull="$ac_cv_func_malloc_0_nonnull"] |
| 1399 | ) |
| 1400 | AC_MSG_RESULT([$func_calloc_0_nonnull]) |
| 1401 | |
Darren Tucker | d97874c | 2018-04-13 13:43:55 +1000 | [diff] [blame] | 1402 | if test "x$func_calloc_0_nonnull" = "xyes"; then |
Darren Tucker | e9dede0 | 2018-02-25 10:20:31 +1100 | [diff] [blame] | 1403 | AC_DEFINE(HAVE_CALLOC, 1, [calloc(0, x) returns non-null]) |
| 1404 | else |
| 1405 | AC_DEFINE(HAVE_CALLOC, 0, [calloc(0, x) returns NULL]) |
Darren Tucker | 74c1c36 | 2017-09-27 07:44:41 +1000 | [diff] [blame] | 1406 | AC_DEFINE(calloc, rpl_calloc, |
| 1407 | [Define to rpl_calloc if the replacement function should be used.]) |
| 1408 | fi |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1409 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1410 | # Check for ALTDIRFUNC glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1411 | AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support]) |
| 1412 | AC_EGREP_CPP([FOUNDIT], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1413 | [ |
| 1414 | #include <glob.h> |
| 1415 | #ifdef GLOB_ALTDIRFUNC |
| 1416 | FOUNDIT |
| 1417 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1418 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1419 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1420 | AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1421 | [Define if your system glob() function has |
| 1422 | the GLOB_ALTDIRFUNC extension]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1423 | AC_MSG_RESULT([yes]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1424 | ], |
| 1425 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1426 | AC_MSG_RESULT([no]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1427 | ] |
| 1428 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1429 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1430 | # Check for g.gl_matchc glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1431 | AC_MSG_CHECKING([for gl_matchc field in glob_t]) |
| 1432 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], |
| 1433 | [[ glob_t g; g.gl_matchc = 1; ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1434 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1435 | AC_DEFINE([GLOB_HAS_GL_MATCHC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1436 | [Define if your system glob() function has |
| 1437 | gl_matchc options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1438 | AC_MSG_RESULT([yes]) |
| 1439 | ], [ |
| 1440 | AC_MSG_RESULT([no]) |
| 1441 | ]) |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1442 | |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1443 | # Check for g.gl_statv glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1444 | AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob]) |
| 1445 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[ |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1446 | #ifndef GLOB_KEEPSTAT |
| 1447 | #error "glob does not support GLOB_KEEPSTAT extension" |
| 1448 | #endif |
| 1449 | glob_t g; |
| 1450 | g.gl_statv = NULL; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1451 | ]])], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1452 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1453 | AC_DEFINE([GLOB_HAS_GL_STATV], [1], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1454 | [Define if your system glob() function has |
| 1455 | gl_statv options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1456 | AC_MSG_RESULT([yes]) |
| 1457 | ], [ |
| 1458 | AC_MSG_RESULT([no]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1459 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1460 | ]) |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1461 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1462 | AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>]) |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1463 | |
Darren Tucker | 7df91b0 | 2016-07-14 12:25:24 +1000 | [diff] [blame] | 1464 | AC_CHECK_DECL([VIS_ALL], , |
| 1465 | AC_DEFINE(BROKEN_STRNVIS, 1, [missing VIS_ALL]), [#include <vis.h>]) |
| 1466 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1467 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1468 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1469 | [AC_LANG_PROGRAM([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1470 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1471 | #include <dirent.h>]], |
| 1472 | [[ |
| 1473 | struct dirent d; |
| 1474 | exit(sizeof(d.d_name)<=sizeof(char)); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1475 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1476 | [AC_MSG_RESULT([yes])], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1477 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1478 | AC_MSG_RESULT([no]) |
| 1479 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1480 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1481 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1482 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1483 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1484 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1485 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1486 | ] |
| 1487 | ) |
| 1488 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1489 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1490 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1491 | AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) |
| 1492 | AC_MSG_RESULT([yes]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1493 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1494 | AC_MSG_RESULT([no]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1495 | fi |
| 1496 | |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1497 | # Check whether user wants to use ldns |
| 1498 | LDNS_MSG="no" |
| 1499 | AC_ARG_WITH(ldns, |
| 1500 | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1501 | [ |
| 1502 | ldns="" |
| 1503 | if test "x$withval" = "xyes" ; then |
| 1504 | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) |
Darren Tucker | f001de8 | 2017-12-11 13:42:51 +1100 | [diff] [blame] | 1505 | if test "x$LDNSCONFIG" = "xno"; then |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1506 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1507 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1508 | LIBS="-lldns $LIBS" |
| 1509 | ldns=yes |
| 1510 | else |
| 1511 | LIBS="$LIBS `$LDNSCONFIG --libs`" |
| 1512 | CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`" |
Darren Tucker | 7af27bf | 2017-03-24 09:44:56 +1100 | [diff] [blame] | 1513 | ldns=yes |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1514 | fi |
| 1515 | elif test "x$withval" != "xno" ; then |
| 1516 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1517 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1518 | LIBS="-lldns $LIBS" |
| 1519 | ldns=yes |
| 1520 | fi |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1521 | |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1522 | # Verify that it works. |
| 1523 | if test "x$ldns" = "xyes" ; then |
| 1524 | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) |
| 1525 | LDNS_MSG="yes" |
| 1526 | AC_MSG_CHECKING([for ldns support]) |
| 1527 | AC_LINK_IFELSE( |
| 1528 | [AC_LANG_SOURCE([[ |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1529 | #include <stdio.h> |
| 1530 | #include <stdlib.h> |
| 1531 | #include <stdint.h> |
| 1532 | #include <ldns/ldns.h> |
| 1533 | 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] | 1534 | ]]) |
| 1535 | ], |
| 1536 | [AC_MSG_RESULT(yes)], |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1537 | [ |
| 1538 | AC_MSG_RESULT(no) |
| 1539 | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) |
| 1540 | ]) |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1541 | fi |
| 1542 | ]) |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1543 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1544 | # Check whether user wants libedit support |
| 1545 | LIBEDIT_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1546 | AC_ARG_WITH([libedit], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1547 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1548 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1549 | if test "x$withval" = "xyes" ; then |
Darren Tucker | 5935389 | 2012-05-19 15:24:37 +1000 | [diff] [blame] | 1550 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1551 | if test "x$PKGCONFIG" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1552 | AC_MSG_CHECKING([if $PKGCONFIG knows about libedit]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1553 | if "$PKGCONFIG" libedit; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1554 | AC_MSG_RESULT([yes]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1555 | use_pkgconfig_for_libedit=yes |
| 1556 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1557 | AC_MSG_RESULT([no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1558 | fi |
| 1559 | fi |
| 1560 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1561 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 1562 | if test -n "${rpath_opt}"; then |
| 1563 | LDFLAGS="-L${withval}/lib ${rpath_opt}${withval}/lib ${LDFLAGS}" |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1564 | else |
| 1565 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1566 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1567 | fi |
Damien Miller | 1f78980 | 2010-10-11 22:35:22 +1100 | [diff] [blame] | 1568 | if test "x$use_pkgconfig_for_libedit" = "xyes"; then |
Darren Tucker | 8369c8e | 2013-12-05 11:00:16 +1100 | [diff] [blame] | 1569 | LIBEDIT=`$PKGCONFIG --libs libedit` |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1570 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1571 | else |
| 1572 | LIBEDIT="-ledit -lcurses" |
| 1573 | fi |
| 1574 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1575 | AC_CHECK_LIB([edit], [el_init], |
| 1576 | [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1577 | LIBEDIT_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1578 | AC_SUBST([LIBEDIT]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1579 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1580 | [ AC_MSG_ERROR([libedit not found]) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1581 | [ $OTHERLIBS ] |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1582 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1583 | AC_MSG_CHECKING([if libedit version is compatible]) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1584 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1585 | [AC_LANG_PROGRAM([[ #include <histedit.h> ]], |
| 1586 | [[ |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1587 | int i = H_SETSIZE; |
| 1588 | el_init("", NULL, NULL, NULL); |
| 1589 | exit(0); |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1590 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1591 | [ AC_MSG_RESULT([yes]) ], |
| 1592 | [ AC_MSG_RESULT([no]) |
| 1593 | AC_MSG_ERROR([libedit version is not compatible]) ] |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1594 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1595 | fi ] |
| 1596 | ) |
| 1597 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1598 | AUDIT_MODULE=none |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1599 | AC_ARG_WITH([audit], |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1600 | [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1601 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1602 | AC_MSG_CHECKING([for supported audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1603 | case "$withval" in |
| 1604 | bsm) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1605 | AC_MSG_RESULT([bsm]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1606 | AUDIT_MODULE=bsm |
| 1607 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1608 | AC_CHECK_HEADERS([bsm/audit.h], [], |
| 1609 | [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1610 | [ |
| 1611 | #ifdef HAVE_TIME_H |
| 1612 | # include <time.h> |
| 1613 | #endif |
| 1614 | ] |
| 1615 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1616 | AC_CHECK_LIB([bsm], [getaudit], [], |
| 1617 | [AC_MSG_ERROR([BSM enabled and required library not found])]) |
| 1618 | AC_CHECK_FUNCS([getaudit], [], |
| 1619 | [AC_MSG_ERROR([BSM enabled and required function not found])]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1620 | # These are optional |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1621 | AC_CHECK_FUNCS([getaudit_addr aug_get_machine]) |
| 1622 | AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module]) |
Darren Tucker | 1fcec9d | 2013-12-19 11:00:12 +1100 | [diff] [blame] | 1623 | if test "$sol2ver" -ge 11; then |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1624 | SSHDLIBS="$SSHDLIBS -lscf" |
| 1625 | AC_DEFINE([BROKEN_BSM_API], [1], |
| 1626 | [The system has incomplete BSM API]) |
Darren Tucker | 93a2d41 | 2012-02-24 10:40:41 +1100 | [diff] [blame] | 1627 | fi |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1628 | ;; |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1629 | linux) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1630 | AC_MSG_RESULT([linux]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1631 | AUDIT_MODULE=linux |
| 1632 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1633 | AC_CHECK_HEADERS([libaudit.h]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1634 | SSHDLIBS="$SSHDLIBS -laudit" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1635 | AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1636 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1637 | debug) |
| 1638 | AUDIT_MODULE=debug |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1639 | AC_MSG_RESULT([debug]) |
| 1640 | AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1641 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1642 | no) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1643 | AC_MSG_RESULT([no]) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1644 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1645 | *) |
| 1646 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1647 | ;; |
| 1648 | esac ] |
| 1649 | ) |
| 1650 | |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1651 | AC_ARG_WITH([pie], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 1652 | [ --with-pie Build Position Independent Executables if possible], [ |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1653 | if test "x$withval" = "xno"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1654 | use_pie=no |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1655 | fi |
| 1656 | if test "x$withval" = "xyes"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1657 | use_pie=yes |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1658 | fi |
| 1659 | ] |
| 1660 | ) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1661 | if test "x$use_pie" = "x"; then |
| 1662 | use_pie=no |
| 1663 | fi |
| 1664 | if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then |
| 1665 | # Turn off automatic PIE when toolchain hardening is off. |
| 1666 | use_pie=no |
| 1667 | fi |
Damien Miller | c161fc9 | 2014-01-29 21:01:33 +1100 | [diff] [blame] | 1668 | if test "x$use_pie" = "xauto"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1669 | # Automatic PIE requires gcc >= 4.x |
| 1670 | AC_MSG_CHECKING([for gcc >= 4.x]) |
| 1671 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
| 1672 | #if !defined(__GNUC__) || __GNUC__ < 4 |
| 1673 | #error gcc is too old |
| 1674 | #endif |
| 1675 | ]])], |
| 1676 | [ AC_MSG_RESULT([yes]) ], |
| 1677 | [ AC_MSG_RESULT([no]) |
| 1678 | use_pie=no ] |
| 1679 | ) |
| 1680 | fi |
| 1681 | if test "x$use_pie" != "xno"; then |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1682 | SAVED_CFLAGS="$CFLAGS" |
| 1683 | SAVED_LDFLAGS="$LDFLAGS" |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1684 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) |
| 1685 | OSSH_CHECK_LDFLAG_LINK([-pie]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1686 | # We use both -fPIE and -pie or neither. |
| 1687 | AC_MSG_CHECKING([whether both -fPIE and -pie are supported]) |
| 1688 | if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ |
| 1689 | echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then |
| 1690 | AC_MSG_RESULT([yes]) |
| 1691 | else |
| 1692 | AC_MSG_RESULT([no]) |
| 1693 | CFLAGS="$SAVED_CFLAGS" |
| 1694 | LDFLAGS="$SAVED_LDFLAGS" |
| 1695 | fi |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1696 | fi |
| 1697 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1698 | dnl Checks for library functions. Please keep in alphabetical order |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1699 | AC_CHECK_FUNCS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1700 | Blowfish_initstate \ |
| 1701 | Blowfish_expandstate \ |
| 1702 | Blowfish_expand0state \ |
| 1703 | Blowfish_stream2word \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1704 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1705 | b64_ntop \ |
| 1706 | __b64_ntop \ |
| 1707 | b64_pton \ |
| 1708 | __b64_pton \ |
| 1709 | bcopy \ |
Damien Miller | a913442 | 2013-12-07 11:35:36 +1100 | [diff] [blame] | 1710 | bcrypt_pbkdf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1711 | bindresvport_sa \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1712 | blf_enc \ |
Darren Tucker | a900442 | 2018-02-24 20:25:22 +1100 | [diff] [blame] | 1713 | bzero \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 1714 | cap_rights_limit \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1715 | clock \ |
| 1716 | closefrom \ |
| 1717 | dirfd \ |
Darren Tucker | efdf534 | 2013-05-30 08:29:08 +1000 | [diff] [blame] | 1718 | endgrent \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1719 | err \ |
| 1720 | errx \ |
Damien Miller | 1d2c456 | 2014-02-04 11:18:20 +1100 | [diff] [blame] | 1721 | explicit_bzero \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1722 | fchmod \ |
Darren Tucker | a6258e5 | 2019-01-18 11:09:01 +1100 | [diff] [blame] | 1723 | fchmodat \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1724 | fchown \ |
Darren Tucker | a6258e5 | 2019-01-18 11:09:01 +1100 | [diff] [blame] | 1725 | fchownat \ |
Darren Tucker | cd3ab57 | 2018-02-26 14:37:06 +1100 | [diff] [blame] | 1726 | flock \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1727 | freeaddrinfo \ |
Damien Miller | b795691 | 2017-09-19 12:29:23 +1000 | [diff] [blame] | 1728 | freezero \ |
Darren Tucker | a5cf1e2 | 2014-01-17 18:10:58 +1100 | [diff] [blame] | 1729 | fstatfs \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1730 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1731 | futimes \ |
| 1732 | getaddrinfo \ |
| 1733 | getcwd \ |
| 1734 | getgrouplist \ |
Darren Tucker | 6301e6c | 2018-07-02 21:16:58 +1000 | [diff] [blame] | 1735 | getline \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1736 | getnameinfo \ |
| 1737 | getopt \ |
Damien Miller | 151c6e4 | 2017-06-01 15:25:13 +1000 | [diff] [blame] | 1738 | getpagesize \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1739 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1740 | getpeerucred \ |
Darren Tucker | 3c4a24c | 2013-02-15 11:41:35 +1100 | [diff] [blame] | 1741 | getpgid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1742 | _getpty \ |
| 1743 | getrlimit \ |
Damien Miller | afa6e79 | 2018-04-13 13:31:42 +1000 | [diff] [blame] | 1744 | getrandom \ |
Darren Tucker | b39593a | 2018-02-25 13:25:15 +1100 | [diff] [blame] | 1745 | getsid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1746 | getttyent \ |
| 1747 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1748 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1749 | inet_aton \ |
| 1750 | inet_ntoa \ |
| 1751 | inet_ntop \ |
| 1752 | innetgr \ |
Darren Tucker | d38f05d | 2017-03-20 13:38:27 +1100 | [diff] [blame] | 1753 | llabs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1754 | login_getcapbool \ |
| 1755 | md5_crypt \ |
| 1756 | memmove \ |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1757 | memset_s \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1758 | mkdtemp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1759 | ngetaddrinfo \ |
| 1760 | nsleep \ |
| 1761 | ogetaddrinfo \ |
| 1762 | openlog_r \ |
Darren Tucker | 3ddd15e | 2015-11-30 07:23:53 +1100 | [diff] [blame] | 1763 | pledge \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1764 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1765 | prctl \ |
| 1766 | pstat \ |
Darren Tucker | 6c8c9a6 | 2018-02-24 20:46:37 +1100 | [diff] [blame] | 1767 | raise \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1768 | readpassphrase \ |
Darren Tucker | 642652d | 2014-12-10 01:32:23 +1100 | [diff] [blame] | 1769 | reallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1770 | recvmsg \ |
Damien Miller | 151c6e4 | 2017-06-01 15:25:13 +1000 | [diff] [blame] | 1771 | recallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1772 | rresvport_af \ |
| 1773 | sendmsg \ |
| 1774 | setdtablesize \ |
| 1775 | setegid \ |
| 1776 | setenv \ |
| 1777 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1778 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1779 | setgroups \ |
Darren Tucker | 34f702a | 2012-07-04 08:50:09 +1000 | [diff] [blame] | 1780 | setlinebuf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1781 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1782 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1783 | setpcred \ |
| 1784 | setproctitle \ |
| 1785 | setregid \ |
| 1786 | setreuid \ |
| 1787 | setrlimit \ |
| 1788 | setsid \ |
| 1789 | setvbuf \ |
| 1790 | sigaction \ |
| 1791 | sigvec \ |
| 1792 | snprintf \ |
| 1793 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1794 | statfs \ |
| 1795 | statvfs \ |
Darren Tucker | afec077 | 2016-12-13 10:23:03 +1100 | [diff] [blame] | 1796 | strcasestr \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1797 | strdup \ |
| 1798 | strerror \ |
| 1799 | strlcat \ |
| 1800 | strlcpy \ |
| 1801 | strmode \ |
Darren Tucker | 33561e6 | 2018-03-03 14:56:09 +1100 | [diff] [blame] | 1802 | strndup \ |
Darren Tucker | b54f50e | 2011-09-29 23:17:18 +1000 | [diff] [blame] | 1803 | strnlen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1804 | strnvis \ |
Darren Tucker | aa74f67 | 2010-08-16 13:15:23 +1000 | [diff] [blame] | 1805 | strptime \ |
Darren Tucker | 44fc334 | 2017-09-25 09:48:10 +1000 | [diff] [blame] | 1806 | strsignal \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1807 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1808 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1809 | strtoul \ |
Darren Tucker | 8e6fb78 | 2013-02-15 12:13:01 +1100 | [diff] [blame] | 1810 | strtoull \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1811 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1812 | sysconf \ |
| 1813 | tcgetpgrp \ |
Damien Miller | aa18063 | 2010-10-07 21:25:27 +1100 | [diff] [blame] | 1814 | timingsafe_bcmp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1815 | truncate \ |
| 1816 | unsetenv \ |
| 1817 | updwtmpx \ |
Darren Tucker | 091093d | 2019-01-18 12:11:42 +1300 | [diff] [blame] | 1818 | utimensat \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1819 | user_from_uid \ |
Damien Miller | f4db77d | 2013-03-15 10:34:25 +1100 | [diff] [blame] | 1820 | usleep \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1821 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1822 | vsnprintf \ |
| 1823 | waitpid \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1824 | warn \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1825 | ]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1826 | |
Darren Tucker | a900442 | 2018-02-24 20:25:22 +1100 | [diff] [blame] | 1827 | AC_CHECK_DECLS([bzero]) |
| 1828 | |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 1829 | dnl Wide character support. |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1830 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1831 | |
Darren Tucker | 10e290e | 2016-12-13 13:51:32 +1100 | [diff] [blame] | 1832 | TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes} |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1833 | AC_MSG_CHECKING([for utf8 locale support]) |
| 1834 | AC_RUN_IFELSE( |
| 1835 | [AC_LANG_PROGRAM([[ |
| 1836 | #include <locale.h> |
Darren Tucker | c359950 | 2016-12-09 12:52:02 +1100 | [diff] [blame] | 1837 | #include <stdlib.h> |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1838 | ]], [[ |
| 1839 | char *loc = setlocale(LC_CTYPE, "en_US.UTF-8"); |
| 1840 | if (loc != NULL) |
| 1841 | exit(0); |
| 1842 | exit(1); |
| 1843 | ]])], |
| 1844 | AC_MSG_RESULT(yes), |
| 1845 | [AC_MSG_RESULT(no) |
| 1846 | TEST_SSH_UTF8=no], |
| 1847 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 1848 | ) |
| 1849 | |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1850 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1851 | [AC_LANG_PROGRAM( |
| 1852 | [[ #include <ctype.h> ]], |
| 1853 | [[ return (isblank('a')); ]])], |
| 1854 | [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).]) |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1855 | ]) |
| 1856 | |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1857 | disable_pkcs11= |
| 1858 | AC_ARG_ENABLE([pkcs11], |
| 1859 | [ --disable-pkcs11 disable PKCS#11 support code [no]], |
| 1860 | [ |
| 1861 | if test "x$enableval" = "xno" ; then |
| 1862 | disable_pkcs11=1 |
| 1863 | fi |
| 1864 | ] |
| 1865 | ) |
| 1866 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1867 | # PKCS11 depends on OpenSSL. |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1868 | if test "x$openssl" = "xyes" && test "x$disable_pkcs11" = "x"; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1869 | # PKCS#11 support requires dlopen() and co |
| 1870 | AC_SEARCH_LIBS([dlopen], [dl], |
Darren Tucker | 146c3bd | 2018-02-26 12:51:29 +1100 | [diff] [blame] | 1871 | AC_CHECK_DECL([RTLD_NOW], |
| 1872 | AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]), |
| 1873 | [], [#include <dlfcn.h>] |
| 1874 | ) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1875 | ) |
| 1876 | fi |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1877 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1878 | # IRIX has a const char return value for gai_strerror() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1879 | AC_CHECK_FUNCS([gai_strerror], [ |
| 1880 | AC_DEFINE([HAVE_GAI_STRERROR]) |
| 1881 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1882 | #include <sys/types.h> |
| 1883 | #include <sys/socket.h> |
| 1884 | #include <netdb.h> |
| 1885 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1886 | const char *gai_strerror(int); |
| 1887 | ]], [[ |
| 1888 | char *str; |
| 1889 | str = gai_strerror(0); |
| 1890 | ]])], [ |
| 1891 | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], |
| 1892 | [Define if gai_strerror() returns const char *])], [])]) |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1893 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1894 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
| 1895 | [Some systems put nanosleep outside of libc])]) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1896 | |
Darren Tucker | a710891 | 2013-06-02 08:18:31 +1000 | [diff] [blame] | 1897 | AC_SEARCH_LIBS([clock_gettime], [rt], |
| 1898 | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) |
| 1899 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1900 | dnl Make sure prototypes are defined for these before using them. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1901 | AC_CHECK_DECL([strsep], |
| 1902 | [AC_CHECK_FUNCS([strsep])], |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1903 | [], |
| 1904 | [ |
| 1905 | #ifdef HAVE_STRING_H |
| 1906 | # include <string.h> |
| 1907 | #endif |
| 1908 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1909 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1910 | dnl tcsendbreak might be a macro |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1911 | AC_CHECK_DECL([tcsendbreak], |
| 1912 | [AC_DEFINE([HAVE_TCSENDBREAK])], |
| 1913 | [AC_CHECK_FUNCS([tcsendbreak])], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1914 | [#include <termios.h>] |
| 1915 | ) |
| 1916 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1917 | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1918 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1919 | AC_CHECK_DECLS([SHUT_RD], , , |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1920 | [ |
| 1921 | #include <sys/types.h> |
| 1922 | #include <sys/socket.h> |
| 1923 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1924 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1925 | AC_CHECK_DECLS([O_NONBLOCK], , , |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1926 | [ |
| 1927 | #include <sys/types.h> |
| 1928 | #ifdef HAVE_SYS_STAT_H |
| 1929 | # include <sys/stat.h> |
| 1930 | #endif |
| 1931 | #ifdef HAVE_FCNTL_H |
| 1932 | # include <fcntl.h> |
| 1933 | #endif |
| 1934 | ]) |
| 1935 | |
Darren Tucker | 2eb4041 | 2018-02-24 21:06:48 +1100 | [diff] [blame] | 1936 | AC_CHECK_DECLS([readv, writev], , , [ |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1937 | #include <sys/types.h> |
| 1938 | #include <sys/uio.h> |
| 1939 | #include <unistd.h> |
| 1940 | ]) |
| 1941 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1942 | AC_CHECK_DECLS([MAXSYMLINKS], , , [ |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1943 | #include <sys/param.h> |
| 1944 | ]) |
| 1945 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1946 | AC_CHECK_DECLS([offsetof], , , [ |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1947 | #include <stddef.h> |
| 1948 | ]) |
| 1949 | |
Darren Tucker | c7aad00 | 2013-06-02 07:18:47 +1000 | [diff] [blame] | 1950 | # extra bits for select(2) |
| 1951 | AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ |
| 1952 | #include <sys/param.h> |
| 1953 | #include <sys/types.h> |
| 1954 | #ifdef HAVE_SYS_SYSMACROS_H |
| 1955 | #include <sys/sysmacros.h> |
| 1956 | #endif |
| 1957 | #ifdef HAVE_SYS_SELECT_H |
| 1958 | #include <sys/select.h> |
| 1959 | #endif |
| 1960 | #ifdef HAVE_SYS_TIME_H |
| 1961 | #include <sys/time.h> |
| 1962 | #endif |
| 1963 | #ifdef HAVE_UNISTD_H |
| 1964 | #include <unistd.h> |
| 1965 | #endif |
| 1966 | ]]) |
| 1967 | AC_CHECK_TYPES([fd_mask], [], [], [[ |
| 1968 | #include <sys/param.h> |
| 1969 | #include <sys/types.h> |
| 1970 | #ifdef HAVE_SYS_SELECT_H |
| 1971 | #include <sys/select.h> |
| 1972 | #endif |
| 1973 | #ifdef HAVE_SYS_TIME_H |
| 1974 | #include <sys/time.h> |
| 1975 | #endif |
| 1976 | #ifdef HAVE_UNISTD_H |
| 1977 | #include <unistd.h> |
| 1978 | #endif |
| 1979 | ]]) |
| 1980 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1981 | AC_CHECK_FUNCS([setresuid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1982 | dnl Some platorms have setresuid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1983 | AC_MSG_CHECKING([if setresuid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1984 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1985 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1986 | #include <stdlib.h> |
| 1987 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1988 | ]], [[ |
| 1989 | errno=0; |
| 1990 | setresuid(0,0,0); |
| 1991 | if (errno==ENOSYS) |
| 1992 | exit(1); |
| 1993 | else |
| 1994 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1995 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1996 | [AC_MSG_RESULT([yes])], |
| 1997 | [AC_DEFINE([BROKEN_SETRESUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1998 | [Define if your setresuid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1999 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2000 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 2001 | ) |
| 2002 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 2003 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2004 | AC_CHECK_FUNCS([setresgid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 2005 | dnl Some platorms have setresgid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2006 | AC_MSG_CHECKING([if setresgid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2007 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2008 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 2009 | #include <stdlib.h> |
| 2010 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2011 | ]], [[ |
| 2012 | errno=0; |
| 2013 | setresgid(0,0,0); |
| 2014 | if (errno==ENOSYS) |
| 2015 | exit(1); |
| 2016 | else |
| 2017 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2018 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2019 | [AC_MSG_RESULT([yes])], |
| 2020 | [AC_DEFINE([BROKEN_SETRESGID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2021 | [Define if your setresgid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2022 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2023 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 2024 | ) |
| 2025 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 2026 | |
Darren Tucker | d3e2aee | 2015-07-17 12:52:34 +1000 | [diff] [blame] | 2027 | AC_CHECK_FUNCS([realpath], [ |
| 2028 | dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given |
| 2029 | dnl path name", however some implementations of realpath (and some |
| 2030 | dnl versions of the POSIX spec) do not work on non-existent files, |
| 2031 | dnl so we use the OpenBSD implementation on those platforms. |
| 2032 | AC_MSG_CHECKING([if realpath works with non-existent files]) |
| 2033 | AC_RUN_IFELSE( |
| 2034 | [AC_LANG_PROGRAM([[ |
| 2035 | #include <limits.h> |
| 2036 | #include <stdlib.h> |
| 2037 | #include <errno.h> |
| 2038 | ]], [[ |
| 2039 | char buf[PATH_MAX]; |
| 2040 | if (realpath("/opensshnonexistentfilename1234", buf) == NULL) |
| 2041 | if (errno == ENOENT) |
| 2042 | exit(1); |
| 2043 | exit(0); |
| 2044 | ]])], |
| 2045 | [AC_MSG_RESULT([yes])], |
| 2046 | [AC_DEFINE([BROKEN_REALPATH], [1], |
| 2047 | [realpath does not work with nonexistent files]) |
| 2048 | AC_MSG_RESULT([no])], |
| 2049 | [AC_MSG_WARN([cross compiling: assuming working])] |
| 2050 | ) |
| 2051 | ]) |
| 2052 | |
Darren Tucker | 58fd4c5 | 2018-03-05 19:28:08 +1100 | [diff] [blame] | 2053 | AC_MSG_CHECKING([for working fflush(NULL)]) |
| 2054 | AC_RUN_IFELSE( |
| 2055 | [AC_LANG_PROGRAM([[#include <stdio.h>]], [[fflush(NULL); exit(0);]])], |
| 2056 | AC_MSG_RESULT([yes]), |
| 2057 | [AC_MSG_RESULT([no]) |
| 2058 | AC_DEFINE([FFLUSH_NULL_BUG], [1], |
| 2059 | [define if fflush(NULL) does not work])], |
| 2060 | AC_MSG_WARN([cross compiling: assuming working]) |
| 2061 | ) |
| 2062 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2063 | dnl Checks for time functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2064 | AC_CHECK_FUNCS([gettimeofday time]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2065 | dnl Checks for utmp functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2066 | AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent]) |
| 2067 | AC_CHECK_FUNCS([utmpname]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2068 | dnl Checks for utmpx functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2069 | AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline]) |
| 2070 | AC_CHECK_FUNCS([setutxdb setutxent utmpxname]) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 2071 | dnl Checks for lastlog functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2072 | AC_CHECK_FUNCS([getlastlogxbyname]) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 2073 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2074 | AC_CHECK_FUNC([daemon], |
| 2075 | [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])], |
| 2076 | [AC_CHECK_LIB([bsd], [daemon], |
| 2077 | [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 2078 | ) |
| 2079 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2080 | AC_CHECK_FUNC([getpagesize], |
| 2081 | [AC_DEFINE([HAVE_GETPAGESIZE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2082 | [Define if your libraries define getpagesize()])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2083 | [AC_CHECK_LIB([ucb], [getpagesize], |
| 2084 | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 2085 | ) |
| 2086 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2087 | # Check for broken snprintf |
| 2088 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 2089 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2090 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2091 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 2092 | [[ |
| 2093 | char b[5]; |
| 2094 | snprintf(b,5,"123456789"); |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2095 | exit(b[4]!='\0'); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2096 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2097 | [AC_MSG_RESULT([yes])], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2098 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2099 | AC_MSG_RESULT([no]) |
| 2100 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2101 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2102 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2103 | ], |
| 2104 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2105 | ) |
| 2106 | fi |
| 2107 | |
Darren Tucker | e526127 | 2018-10-12 16:43:35 +1100 | [diff] [blame] | 2108 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 2109 | AC_MSG_CHECKING([whether snprintf understands %zu]) |
| 2110 | AC_RUN_IFELSE( |
| 2111 | [AC_LANG_PROGRAM([[ |
| 2112 | #include <sys/types.h> |
| 2113 | #include <stdio.h> |
| 2114 | ]], |
| 2115 | [[ |
| 2116 | size_t a = 1, b = 2; |
| 2117 | char z[128]; |
| 2118 | snprintf(z, sizeof z, "%zu%zu", a, b); |
| 2119 | exit(strcmp(z, "12")); |
| 2120 | ]])], |
| 2121 | [AC_MSG_RESULT([yes])], |
| 2122 | [ |
| 2123 | AC_MSG_RESULT([no]) |
| 2124 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
| 2125 | [snprintf does not understand %zu]) |
| 2126 | ], |
| 2127 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
| 2128 | ) |
| 2129 | fi |
| 2130 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2131 | # We depend on vsnprintf returning the right thing on overflow: the |
| 2132 | # number of characters it tried to create (as per SUSv3) |
| 2133 | if test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2134 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 2135 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2136 | [AC_LANG_PROGRAM([[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2137 | #include <sys/types.h> |
| 2138 | #include <stdio.h> |
| 2139 | #include <stdarg.h> |
| 2140 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2141 | int x_snprintf(char *str, size_t count, const char *fmt, ...) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2142 | { |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2143 | size_t ret; |
| 2144 | va_list ap; |
| 2145 | |
| 2146 | va_start(ap, fmt); |
| 2147 | ret = vsnprintf(str, count, fmt, ap); |
| 2148 | va_end(ap); |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2149 | return ret; |
| 2150 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2151 | ]], [[ |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2152 | char x[1]; |
| 2153 | if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11) |
| 2154 | return 1; |
| 2155 | if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11) |
| 2156 | return 1; |
| 2157 | return 0; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2158 | ]])], |
| 2159 | [AC_MSG_RESULT([yes])], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2160 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2161 | AC_MSG_RESULT([no]) |
| 2162 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2163 | [Define if your snprintf is busted]) |
| 2164 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 2165 | ], |
| 2166 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 2167 | ) |
| 2168 | fi |
| 2169 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2170 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 2171 | # check that the fmt argument is const char * or just char *. |
| 2172 | # This is only useful for when BROKEN_SNPRINTF |
| 2173 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2174 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2175 | #include <stdio.h> |
| 2176 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 2177 | ]], [[ |
| 2178 | snprintf(0, 0, 0); |
| 2179 | ]])], |
| 2180 | [AC_MSG_RESULT([yes]) |
| 2181 | AC_DEFINE([SNPRINTF_CONST], [const], |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2182 | [Define as const if snprintf() can declare const char *fmt])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2183 | [AC_MSG_RESULT([no]) |
| 2184 | AC_DEFINE([SNPRINTF_CONST], [/* not const */])]) |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2185 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2186 | # Check for missing getpeereid (or equiv) support |
| 2187 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 2188 | 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] | 2189 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2190 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2191 | #include <sys/types.h> |
| 2192 | #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])], |
| 2193 | [ AC_MSG_RESULT([yes]) |
| 2194 | AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option]) |
| 2195 | ], [AC_MSG_RESULT([no]) |
| 2196 | NO_PEERCHECK=1 |
| 2197 | ]) |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2198 | fi |
| 2199 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2200 | dnl see whether mkstemp() requires XXXXXX |
| 2201 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 2202 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2203 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2204 | [AC_LANG_PROGRAM([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2205 | #include <stdlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2206 | ]], [[ |
| 2207 | char template[]="conftest.mkstemp-test"; |
| 2208 | if (mkstemp(template) == -1) |
| 2209 | exit(1); |
| 2210 | unlink(template); |
| 2211 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2212 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2213 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2214 | AC_MSG_RESULT([no]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2215 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2216 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2217 | AC_MSG_RESULT([yes]) |
| 2218 | AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2219 | ], |
| 2220 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2221 | AC_MSG_RESULT([yes]) |
| 2222 | AC_DEFINE([HAVE_STRICT_MKSTEMP]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2223 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2224 | ) |
| 2225 | fi |
| 2226 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2227 | dnl make sure that openpty does not reacquire controlling terminal |
| 2228 | if test ! -z "$check_for_openpty_ctty_bug"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2229 | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2230 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2231 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2232 | #include <stdio.h> |
| 2233 | #include <sys/fcntl.h> |
| 2234 | #include <sys/types.h> |
| 2235 | #include <sys/wait.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2236 | ]], [[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2237 | pid_t pid; |
| 2238 | int fd, ptyfd, ttyfd, status; |
| 2239 | |
| 2240 | pid = fork(); |
| 2241 | if (pid < 0) { /* failed */ |
| 2242 | exit(1); |
| 2243 | } else if (pid > 0) { /* parent */ |
| 2244 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2245 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2246 | exit(WEXITSTATUS(status)); |
| 2247 | else |
| 2248 | exit(2); |
| 2249 | } else { /* child */ |
| 2250 | close(0); close(1); close(2); |
| 2251 | setsid(); |
| 2252 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 2253 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 2254 | if (fd >= 0) |
| 2255 | exit(3); /* Acquired ctty: broken */ |
| 2256 | else |
| 2257 | exit(0); /* Did not acquire ctty: OK */ |
| 2258 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2259 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2260 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2261 | AC_MSG_RESULT([yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2262 | ], |
| 2263 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2264 | AC_MSG_RESULT([no]) |
| 2265 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2266 | ], |
| 2267 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2268 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2269 | ] |
| 2270 | ) |
| 2271 | fi |
| 2272 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2273 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2274 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2275 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2276 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2277 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2278 | #include <stdio.h> |
| 2279 | #include <sys/socket.h> |
| 2280 | #include <netdb.h> |
| 2281 | #include <errno.h> |
| 2282 | #include <netinet/in.h> |
| 2283 | |
| 2284 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2285 | ]], [[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2286 | int err, sock; |
| 2287 | struct addrinfo *gai_ai, *ai, hints; |
| 2288 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2289 | |
| 2290 | memset(&hints, 0, sizeof(hints)); |
| 2291 | hints.ai_family = PF_UNSPEC; |
| 2292 | hints.ai_socktype = SOCK_STREAM; |
| 2293 | hints.ai_flags = AI_PASSIVE; |
| 2294 | |
| 2295 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2296 | if (err != 0) { |
| 2297 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2298 | exit(1); |
| 2299 | } |
| 2300 | |
| 2301 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2302 | if (ai->ai_family != AF_INET6) |
| 2303 | continue; |
| 2304 | |
| 2305 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2306 | sizeof(ntop), strport, sizeof(strport), |
| 2307 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2308 | |
| 2309 | if (err != 0) { |
| 2310 | if (err == EAI_SYSTEM) |
| 2311 | perror("getnameinfo EAI_SYSTEM"); |
| 2312 | else |
| 2313 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 2314 | gai_strerror(err)); |
| 2315 | exit(2); |
| 2316 | } |
| 2317 | |
| 2318 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 2319 | if (sock < 0) |
| 2320 | perror("socket"); |
| 2321 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 2322 | if (errno == EBADF) |
| 2323 | exit(3); |
| 2324 | } |
| 2325 | } |
| 2326 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2327 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2328 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2329 | AC_MSG_RESULT([yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2330 | ], |
| 2331 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2332 | AC_MSG_RESULT([no]) |
| 2333 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2334 | ], |
| 2335 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2336 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2337 | ] |
| 2338 | ) |
| 2339 | fi |
| 2340 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2341 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2342 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2343 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2344 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2345 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2346 | #include <stdio.h> |
| 2347 | #include <sys/socket.h> |
| 2348 | #include <netdb.h> |
| 2349 | #include <errno.h> |
| 2350 | #include <netinet/in.h> |
| 2351 | |
| 2352 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2353 | ]], [[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2354 | int err, sock; |
| 2355 | struct addrinfo *gai_ai, *ai, hints; |
| 2356 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2357 | |
| 2358 | memset(&hints, 0, sizeof(hints)); |
| 2359 | hints.ai_family = PF_UNSPEC; |
| 2360 | hints.ai_socktype = SOCK_STREAM; |
| 2361 | hints.ai_flags = AI_PASSIVE; |
| 2362 | |
| 2363 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2364 | if (err != 0) { |
| 2365 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2366 | exit(1); |
| 2367 | } |
| 2368 | |
| 2369 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2370 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 2371 | continue; |
| 2372 | |
| 2373 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2374 | sizeof(ntop), strport, sizeof(strport), |
| 2375 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2376 | |
| 2377 | if (ai->ai_family == AF_INET && err != 0) { |
| 2378 | perror("getnameinfo"); |
| 2379 | exit(2); |
| 2380 | } |
| 2381 | } |
| 2382 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2383 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2384 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2385 | AC_MSG_RESULT([yes]) |
| 2386 | AC_DEFINE([AIX_GETNAMEINFO_HACK], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2387 | [Define if you have a getaddrinfo that fails |
| 2388 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2389 | ], |
| 2390 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2391 | AC_MSG_RESULT([no]) |
| 2392 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2393 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 2394 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2395 | AC_MSG_RESULT([cross-compiling, assuming no]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2396 | ] |
| 2397 | ) |
| 2398 | fi |
| 2399 | |
Darren Tucker | e50e8c9 | 2015-02-21 15:10:33 +1100 | [diff] [blame] | 2400 | if test "x$ac_cv_func_getaddrinfo" = "xyes"; then |
| 2401 | AC_CHECK_DECLS(AI_NUMERICSERV, , , |
| 2402 | [#include <sys/types.h> |
| 2403 | #include <sys/socket.h> |
| 2404 | #include <netdb.h>]) |
| 2405 | fi |
| 2406 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2407 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2408 | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) |
| 2409 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], |
| 2410 | [[ exit(0); ]])], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2411 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2412 | AC_MSG_RESULT([no]) |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2413 | ], |
| 2414 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2415 | AC_MSG_RESULT([yes]) |
| 2416 | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2417 | [Conflicting defs for getspnam]) |
| 2418 | ] |
| 2419 | ) |
| 2420 | fi |
| 2421 | |
Darren Tucker | 20e5e8b | 2016-08-02 12:16:34 +1000 | [diff] [blame] | 2422 | dnl NetBSD added an strnvis and unfortunately made it incompatible with the |
| 2423 | dnl existing one in OpenBSD and Linux's libbsd (the former having existed |
| 2424 | dnl for over ten years). Despite this incompatibility being reported during |
| 2425 | dnl development (see http://gnats.netbsd.org/44977) they still shipped it. |
| 2426 | dnl Even more unfortunately FreeBSD and later MacOS picked up this incompatible |
| 2427 | dnl implementation. Try to detect this mess, and assume the only safe option |
| 2428 | dnl if we're cross compiling. |
| 2429 | dnl |
| 2430 | dnl OpenBSD, 2001: strnvis(char *dst, const char *src, size_t dlen, int flag); |
| 2431 | dnl NetBSD: 2012, strnvis(char *dst, size_t dlen, const char *src, int flag); |
| 2432 | if test "x$ac_cv_func_strnvis" = "xyes"; then |
| 2433 | AC_MSG_CHECKING([for working strnvis]) |
| 2434 | AC_RUN_IFELSE( |
| 2435 | [AC_LANG_PROGRAM([[ |
| 2436 | #include <signal.h> |
| 2437 | #include <stdlib.h> |
| 2438 | #include <string.h> |
| 2439 | #include <vis.h> |
| 2440 | static void sighandler(int sig) { _exit(1); } |
| 2441 | ]], [[ |
| 2442 | char dst[16]; |
| 2443 | |
| 2444 | signal(SIGSEGV, sighandler); |
| 2445 | if (strnvis(dst, "src", 4, 0) && strcmp(dst, "src") == 0) |
| 2446 | exit(0); |
| 2447 | exit(1) |
| 2448 | ]])], |
| 2449 | [AC_MSG_RESULT([yes])], |
| 2450 | [AC_MSG_RESULT([no]) |
| 2451 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis detected broken])], |
| 2452 | [AC_MSG_WARN([cross compiling: assuming broken]) |
| 2453 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis assumed broken])] |
| 2454 | ) |
| 2455 | fi |
| 2456 | |
Darren Tucker | c7b5a47 | 2018-02-25 23:55:41 +1100 | [diff] [blame] | 2457 | AC_CHECK_FUNCS([getpgrp],[ |
| 2458 | AC_MSG_CHECKING([if getpgrp accepts zero args]) |
| 2459 | AC_COMPILE_IFELSE( |
| 2460 | [AC_LANG_PROGRAM([[$ac_includes_default]], [[ getpgrp(); ]])], |
| 2461 | [ AC_MSG_RESULT([yes]) |
| 2462 | AC_DEFINE([GETPGRP_VOID], [1], [getpgrp takes zero args])], |
| 2463 | [ AC_MSG_RESULT([no]) |
| 2464 | AC_DEFINE([GETPGRP_VOID], [0], [getpgrp takes one arg])] |
| 2465 | ) |
| 2466 | ]) |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 2467 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2468 | # Search for OpenSSL |
| 2469 | saved_CPPFLAGS="$CPPFLAGS" |
| 2470 | saved_LDFLAGS="$LDFLAGS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2471 | AC_ARG_WITH([ssl-dir], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2472 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 2473 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2474 | if test "x$openssl" = "xno" ; then |
| 2475 | AC_MSG_ERROR([cannot use --with-ssl-dir when OpenSSL disabled]) |
| 2476 | fi |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 2477 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 2478 | case "$withval" in |
| 2479 | # Relative paths |
| 2480 | ./*|../*) withval="`pwd`/$withval" |
| 2481 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2482 | if test -d "$withval/lib"; then |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 2483 | if test -n "${rpath_opt}"; then |
| 2484 | LDFLAGS="-L${withval}/lib ${rpath_opt}${withval}/lib ${LDFLAGS}" |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2485 | else |
| 2486 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 2487 | fi |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2488 | elif test -d "$withval/lib64"; then |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 2489 | if test -n "${rpath_opt}"; then |
| 2490 | LDFLAGS="-L${withval}/lib64 ${rpath_opt}${withval}/lib64 ${LDFLAGS}" |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2491 | else |
| 2492 | LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" |
| 2493 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2494 | else |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 2495 | if test -n "${rpath_opt}"; then |
| 2496 | LDFLAGS="-L${withval} ${rpath_opt}${withval} ${LDFLAGS}" |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2497 | else |
| 2498 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 2499 | fi |
| 2500 | fi |
| 2501 | if test -d "$withval/include"; then |
| 2502 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 2503 | else |
| 2504 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 2505 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2506 | fi |
| 2507 | ] |
| 2508 | ) |
Damien Miller | b9c5667 | 2014-05-15 14:43:37 +1000 | [diff] [blame] | 2509 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2510 | AC_ARG_WITH([openssl-header-check], |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2511 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2512 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2513 | if test "x$withval" = "xno" ; then |
| 2514 | openssl_check_nonfatal=1 |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2515 | fi |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2516 | ] |
| 2517 | ) |
| 2518 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2519 | openssl_engine=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2520 | AC_ARG_WITH([ssl-engine], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2521 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2522 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2523 | if test "x$withval" != "xno" ; then |
Darren Tucker | b5fa0cd | 2015-12-15 15:10:32 +1100 | [diff] [blame] | 2524 | if test "x$openssl" = "xno" ; then |
| 2525 | AC_MSG_ERROR([cannot use --with-ssl-engine when OpenSSL disabled]) |
| 2526 | fi |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2527 | openssl_engine=yes |
| 2528 | fi |
| 2529 | ] |
| 2530 | ) |
| 2531 | |
| 2532 | if test "x$openssl" = "xyes" ; then |
| 2533 | LIBS="-lcrypto $LIBS" |
Darren Tucker | 8d8340e | 2018-11-16 13:32:13 +1100 | [diff] [blame] | 2534 | AC_TRY_LINK_FUNC([RAND_add], , |
| 2535 | [AC_MSG_ERROR([*** working libcrypto not found, check config.log])]) |
| 2536 | AC_CHECK_HEADER([openssl/opensslv.h], , |
| 2537 | [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2538 | |
| 2539 | # Determine OpenSSL header version |
| 2540 | AC_MSG_CHECKING([OpenSSL header version]) |
| 2541 | AC_RUN_IFELSE( |
| 2542 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 1560596 | 2015-11-10 11:14:47 +1100 | [diff] [blame] | 2543 | #include <stdlib.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2544 | #include <stdio.h> |
| 2545 | #include <string.h> |
| 2546 | #include <openssl/opensslv.h> |
| 2547 | #define DATA "conftest.sslincver" |
| 2548 | ]], [[ |
| 2549 | FILE *fd; |
| 2550 | int rc; |
| 2551 | |
| 2552 | fd = fopen(DATA,"w"); |
| 2553 | if(fd == NULL) |
| 2554 | exit(1); |
| 2555 | |
Darren Tucker | b341353 | 2016-04-04 11:09:21 +1000 | [diff] [blame] | 2556 | if ((rc = fprintf(fd, "%08lx (%s)\n", |
| 2557 | (unsigned long)OPENSSL_VERSION_NUMBER, |
| 2558 | OPENSSL_VERSION_TEXT)) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2559 | exit(1); |
| 2560 | |
| 2561 | exit(0); |
| 2562 | ]])], |
| 2563 | [ |
| 2564 | ssl_header_ver=`cat conftest.sslincver` |
| 2565 | AC_MSG_RESULT([$ssl_header_ver]) |
| 2566 | ], |
| 2567 | [ |
| 2568 | AC_MSG_RESULT([not found]) |
| 2569 | AC_MSG_ERROR([OpenSSL version header not found.]) |
| 2570 | ], |
| 2571 | [ |
| 2572 | AC_MSG_WARN([cross compiling: not checking]) |
| 2573 | ] |
| 2574 | ) |
| 2575 | |
Darren Tucker | 262d81a | 2018-10-27 16:45:59 +1100 | [diff] [blame] | 2576 | # Determining OpenSSL library version is version dependent. |
| 2577 | AC_CHECK_FUNCS([OpenSSL_version OpenSSL_version_num]) |
| 2578 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2579 | # Determine OpenSSL library version |
| 2580 | AC_MSG_CHECKING([OpenSSL library version]) |
| 2581 | AC_RUN_IFELSE( |
| 2582 | [AC_LANG_PROGRAM([[ |
| 2583 | #include <stdio.h> |
| 2584 | #include <string.h> |
| 2585 | #include <openssl/opensslv.h> |
| 2586 | #include <openssl/crypto.h> |
| 2587 | #define DATA "conftest.ssllibver" |
| 2588 | ]], [[ |
| 2589 | FILE *fd; |
| 2590 | int rc; |
| 2591 | |
| 2592 | fd = fopen(DATA,"w"); |
| 2593 | if(fd == NULL) |
| 2594 | exit(1); |
Darren Tucker | 262d81a | 2018-10-27 16:45:59 +1100 | [diff] [blame] | 2595 | #ifndef OPENSSL_VERSION |
| 2596 | # define OPENSSL_VERSION SSLEAY_VERSION |
| 2597 | #endif |
| 2598 | #ifndef HAVE_OPENSSL_VERSION |
Damien Miller | 406a24b | 2018-10-26 13:43:28 +1100 | [diff] [blame] | 2599 | # define OpenSSL_version SSLeay_version |
Darren Tucker | 262d81a | 2018-10-27 16:45:59 +1100 | [diff] [blame] | 2600 | #endif |
| 2601 | #ifndef HAVE_OPENSSL_VERSION_NUM |
| 2602 | # define OpenSSL_version_num SSLeay |
Damien Miller | 406a24b | 2018-10-26 13:43:28 +1100 | [diff] [blame] | 2603 | #endif |
Damien Miller | 859754b | 2018-10-23 17:10:41 +1100 | [diff] [blame] | 2604 | if ((rc = fprintf(fd, "%08lx (%s)\n", |
| 2605 | (unsigned long)OpenSSL_version_num(), |
| 2606 | OpenSSL_version(OPENSSL_VERSION))) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2607 | exit(1); |
| 2608 | |
| 2609 | exit(0); |
| 2610 | ]])], |
| 2611 | [ |
| 2612 | ssl_library_ver=`cat conftest.ssllibver` |
| 2613 | # Check version is supported. |
| 2614 | case "$ssl_library_ver" in |
Damien Miller | aede1c3 | 2018-10-17 11:01:20 +1100 | [diff] [blame] | 2615 | 10000*|0*) |
| 2616 | AC_MSG_ERROR([OpenSSL >= 1.0.1 required (have "$ssl_library_ver")]) |
| 2617 | ;; |
| 2618 | 100*) ;; # 1.0.x |
Damien Miller | 28c7b2c | 2018-11-23 10:45:20 +1100 | [diff] [blame] | 2619 | 101000[[0123456]]*) |
Damien Miller | aede1c3 | 2018-10-17 11:01:20 +1100 | [diff] [blame] | 2620 | # https://github.com/openssl/openssl/pull/4613 |
| 2621 | AC_MSG_ERROR([OpenSSL 1.1.x versions prior to 1.1.0g have a bug that breaks their use with OpenSSH (have "$ssl_library_ver")]) |
| 2622 | ;; |
| 2623 | 101*) ;; # 1.1.x |
| 2624 | 200*) ;; # LibreSSL |
Darren Tucker | c882d74 | 2019-01-22 20:38:40 +1100 | [diff] [blame] | 2625 | 300*) ;; # OpenSSL development branch. |
Damien Miller | aede1c3 | 2018-10-17 11:01:20 +1100 | [diff] [blame] | 2626 | *) |
Darren Tucker | c882d74 | 2019-01-22 20:38:40 +1100 | [diff] [blame] | 2627 | AC_MSG_ERROR([Unknown/unsupported OpenSSL version ("$ssl_library_ver")]) |
Damien Miller | aede1c3 | 2018-10-17 11:01:20 +1100 | [diff] [blame] | 2628 | ;; |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2629 | esac |
| 2630 | AC_MSG_RESULT([$ssl_library_ver]) |
| 2631 | ], |
| 2632 | [ |
| 2633 | AC_MSG_RESULT([not found]) |
| 2634 | AC_MSG_ERROR([OpenSSL library not found.]) |
| 2635 | ], |
| 2636 | [ |
| 2637 | AC_MSG_WARN([cross compiling: not checking]) |
| 2638 | ] |
| 2639 | ) |
| 2640 | |
| 2641 | # Sanity check OpenSSL headers |
| 2642 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 2643 | AC_RUN_IFELSE( |
| 2644 | [AC_LANG_PROGRAM([[ |
| 2645 | #include <string.h> |
| 2646 | #include <openssl/opensslv.h> |
Darren Tucker | c1d7e54 | 2015-12-15 14:27:09 +1100 | [diff] [blame] | 2647 | #include <openssl/crypto.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2648 | ]], [[ |
Darren Tucker | 262d81a | 2018-10-27 16:45:59 +1100 | [diff] [blame] | 2649 | #ifndef HAVE_OPENSSL_VERSION_NUM |
| 2650 | # define OpenSSL_version_num SSLeay |
Damien Miller | 406a24b | 2018-10-26 13:43:28 +1100 | [diff] [blame] | 2651 | #endif |
Damien Miller | 859754b | 2018-10-23 17:10:41 +1100 | [diff] [blame] | 2652 | exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2653 | ]])], |
| 2654 | [ |
| 2655 | AC_MSG_RESULT([yes]) |
| 2656 | ], |
| 2657 | [ |
| 2658 | AC_MSG_RESULT([no]) |
| 2659 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2660 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2661 | library. Check config.log for details. |
| 2662 | If you are sure your installation is consistent, you can disable the check |
| 2663 | by running "./configure --without-openssl-header-check". |
| 2664 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2665 | ]) |
| 2666 | else |
| 2667 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2668 | library. Check config.log for details. |
| 2669 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
| 2670 | fi |
| 2671 | ], |
| 2672 | [ |
| 2673 | AC_MSG_WARN([cross compiling: not checking]) |
| 2674 | ] |
| 2675 | ) |
| 2676 | |
| 2677 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2678 | AC_LINK_IFELSE( |
Damien Miller | 42c5ec4 | 2018-11-23 10:40:06 +1100 | [diff] [blame] | 2679 | [AC_LANG_PROGRAM([[ #include <openssl/err.h> ]], |
| 2680 | [[ ERR_load_crypto_strings(); ]])], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2681 | [ |
| 2682 | AC_MSG_RESULT([yes]) |
| 2683 | ], |
| 2684 | [ |
| 2685 | AC_MSG_RESULT([no]) |
| 2686 | saved_LIBS="$LIBS" |
| 2687 | LIBS="$LIBS -ldl" |
| 2688 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2689 | AC_LINK_IFELSE( |
Damien Miller | 42c5ec4 | 2018-11-23 10:40:06 +1100 | [diff] [blame] | 2690 | [AC_LANG_PROGRAM([[ #include <openssl/err.h> ]], |
| 2691 | [[ ERR_load_crypto_strings(); ]])], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2692 | [ |
| 2693 | AC_MSG_RESULT([yes]) |
| 2694 | ], |
| 2695 | [ |
| 2696 | AC_MSG_RESULT([no]) |
| 2697 | LIBS="$saved_LIBS" |
| 2698 | ] |
| 2699 | ) |
| 2700 | ] |
| 2701 | ) |
| 2702 | |
| 2703 | AC_CHECK_FUNCS([ \ |
| 2704 | BN_is_prime_ex \ |
| 2705 | DSA_generate_parameters_ex \ |
Damien Miller | 42c5ec4 | 2018-11-23 10:40:06 +1100 | [diff] [blame] | 2706 | EVP_CIPHER_CTX_ctrl \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2707 | EVP_DigestFinal_ex \ |
Damien Miller | 42c5ec4 | 2018-11-23 10:40:06 +1100 | [diff] [blame] | 2708 | EVP_DigestInit_ex \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2709 | EVP_MD_CTX_cleanup \ |
| 2710 | EVP_MD_CTX_copy_ex \ |
Damien Miller | 42c5ec4 | 2018-11-23 10:40:06 +1100 | [diff] [blame] | 2711 | EVP_MD_CTX_init \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2712 | HMAC_CTX_init \ |
| 2713 | RSA_generate_key_ex \ |
| 2714 | RSA_get_default_method \ |
Darren Tucker | 1801cd1 | 2018-11-08 15:03:11 +1100 | [diff] [blame] | 2715 | ]) |
Darren Tucker | 98f878d | 2018-11-25 14:05:08 +1100 | [diff] [blame] | 2716 | |
| 2717 | # OpenSSL_add_all_algorithms may be a macro. |
| 2718 | AC_CHECK_FUNC(OpenSSL_add_all_algorithms, |
| 2719 | AC_DEFINE(HAVE_OPENSSL_ADD_ALL_ALGORITHMS, 1, [as a function]), |
| 2720 | AC_CHECK_DECL(OpenSSL_add_all_algorithms, |
| 2721 | AC_DEFINE(HAVE_OPENSSL_ADD_ALL_ALGORITHMS, 1, [as a macro]), , |
| 2722 | [[#include <openssl/evp.h>]] |
| 2723 | ) |
| 2724 | ) |
| 2725 | |
Darren Tucker | 1801cd1 | 2018-11-08 15:03:11 +1100 | [diff] [blame] | 2726 | # LibreSSL/OpenSSL 1.1x API |
| 2727 | AC_CHECK_FUNCS([ \ |
Darren Tucker | d0d1dfa | 2018-11-16 14:11:44 +1100 | [diff] [blame] | 2728 | OPENSSL_init_crypto \ |
Darren Tucker | 1801cd1 | 2018-11-08 15:03:11 +1100 | [diff] [blame] | 2729 | DH_get0_key \ |
| 2730 | DH_get0_pqg \ |
| 2731 | DH_set0_key \ |
| 2732 | DH_set_length \ |
| 2733 | DH_set0_pqg \ |
| 2734 | DSA_get0_key \ |
| 2735 | DSA_get0_pqg \ |
| 2736 | DSA_set0_key \ |
| 2737 | DSA_set0_pqg \ |
| 2738 | DSA_SIG_get0 \ |
| 2739 | DSA_SIG_set0 \ |
| 2740 | ECDSA_SIG_get0 \ |
| 2741 | ECDSA_SIG_set0 \ |
| 2742 | EVP_CIPHER_CTX_iv \ |
| 2743 | EVP_CIPHER_CTX_iv_noconst \ |
| 2744 | EVP_CIPHER_CTX_get_iv \ |
| 2745 | EVP_CIPHER_CTX_set_iv \ |
| 2746 | RSA_get0_crt_params \ |
| 2747 | RSA_get0_factors \ |
| 2748 | RSA_get0_key \ |
| 2749 | RSA_set0_crt_params \ |
| 2750 | RSA_set0_factors \ |
| 2751 | RSA_set0_key \ |
| 2752 | RSA_meth_free \ |
| 2753 | RSA_meth_dup \ |
| 2754 | RSA_meth_set1_name \ |
| 2755 | RSA_meth_get_finish \ |
| 2756 | RSA_meth_set_priv_enc \ |
| 2757 | RSA_meth_set_priv_dec \ |
| 2758 | RSA_meth_set_finish \ |
| 2759 | EVP_PKEY_get0_RSA \ |
| 2760 | EVP_MD_CTX_new \ |
| 2761 | EVP_MD_CTX_free \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2762 | ]) |
| 2763 | |
| 2764 | if test "x$openssl_engine" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2765 | AC_MSG_CHECKING([for OpenSSL ENGINE support]) |
| 2766 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2767 | #include <openssl/engine.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2768 | ]], [[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2769 | ENGINE_load_builtin_engines(); |
| 2770 | ENGINE_register_all_complete(); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2771 | ]])], |
| 2772 | [ AC_MSG_RESULT([yes]) |
| 2773 | AC_DEFINE([USE_OPENSSL_ENGINE], [1], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2774 | [Enable OpenSSL engine support]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2775 | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) |
| 2776 | ]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2777 | fi |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2778 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2779 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2780 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
| 2781 | AC_LINK_IFELSE( |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2782 | [AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2783 | #include <string.h> |
| 2784 | #include <openssl/evp.h> |
| 2785 | ]], [[ |
| 2786 | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); |
| 2787 | ]])], |
| 2788 | [ |
| 2789 | AC_MSG_RESULT([no]) |
| 2790 | ], |
| 2791 | [ |
| 2792 | AC_MSG_RESULT([yes]) |
| 2793 | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], |
| 2794 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2795 | ] |
| 2796 | ) |
| 2797 | |
| 2798 | # Check for OpenSSL with EVP_aes_*ctr |
| 2799 | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) |
| 2800 | AC_LINK_IFELSE( |
| 2801 | [AC_LANG_PROGRAM([[ |
| 2802 | #include <string.h> |
| 2803 | #include <openssl/evp.h> |
| 2804 | ]], [[ |
| 2805 | exit(EVP_aes_128_ctr() == NULL || |
| 2806 | EVP_aes_192_cbc() == NULL || |
| 2807 | EVP_aes_256_cbc() == NULL); |
| 2808 | ]])], |
| 2809 | [ |
| 2810 | AC_MSG_RESULT([yes]) |
| 2811 | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], |
| 2812 | [libcrypto has EVP AES CTR]) |
| 2813 | ], |
| 2814 | [ |
| 2815 | AC_MSG_RESULT([no]) |
| 2816 | ] |
| 2817 | ) |
| 2818 | |
| 2819 | # Check for OpenSSL with EVP_aes_*gcm |
| 2820 | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) |
| 2821 | AC_LINK_IFELSE( |
| 2822 | [AC_LANG_PROGRAM([[ |
| 2823 | #include <string.h> |
| 2824 | #include <openssl/evp.h> |
| 2825 | ]], [[ |
| 2826 | exit(EVP_aes_128_gcm() == NULL || |
| 2827 | EVP_aes_256_gcm() == NULL || |
| 2828 | EVP_CTRL_GCM_SET_IV_FIXED == 0 || |
| 2829 | EVP_CTRL_GCM_IV_GEN == 0 || |
| 2830 | EVP_CTRL_GCM_SET_TAG == 0 || |
| 2831 | EVP_CTRL_GCM_GET_TAG == 0 || |
| 2832 | EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0); |
| 2833 | ]])], |
| 2834 | [ |
| 2835 | AC_MSG_RESULT([yes]) |
| 2836 | AC_DEFINE([OPENSSL_HAVE_EVPGCM], [1], |
| 2837 | [libcrypto has EVP AES GCM]) |
| 2838 | ], |
| 2839 | [ |
| 2840 | AC_MSG_RESULT([no]) |
| 2841 | unsupported_algorithms="$unsupported_cipers \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2842 | aes128-gcm@openssh.com \ |
| 2843 | aes256-gcm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2844 | ] |
| 2845 | ) |
| 2846 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2847 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2848 | AC_LINK_IFELSE( |
| 2849 | [AC_LANG_PROGRAM([[ |
| 2850 | #include <string.h> |
| 2851 | #include <openssl/evp.h> |
| 2852 | ]], [[ |
| 2853 | if(EVP_DigestUpdate(NULL, NULL,0)) |
| 2854 | exit(0); |
| 2855 | ]])], |
| 2856 | [ |
| 2857 | AC_MSG_RESULT([yes]) |
| 2858 | ], |
| 2859 | [ |
| 2860 | AC_MSG_RESULT([no]) |
| 2861 | AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1], |
| 2862 | [Define if EVP_DigestUpdate returns void]) |
| 2863 | ] |
| 2864 | ) |
| 2865 | |
| 2866 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2867 | # because the system crypt() is more featureful. |
| 2868 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 2869 | AC_CHECK_LIB([crypt], [crypt]) |
| 2870 | fi |
| 2871 | |
| 2872 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 2873 | # version in OpenSSL. |
| 2874 | if test "x$check_for_libcrypt_later" = "x1"; then |
| 2875 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
| 2876 | fi |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2877 | AC_CHECK_FUNCS([crypt DES_crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2878 | |
| 2879 | # Search for SHA256 support in libc and/or OpenSSL |
| 2880 | AC_CHECK_FUNCS([SHA256_Update EVP_sha256], , |
| 2881 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2882 | hmac-sha2-256 \ |
| 2883 | hmac-sha2-512 \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2884 | diffie-hellman-group-exchange-sha256 \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2885 | hmac-sha2-256-etm@openssh.com \ |
| 2886 | hmac-sha2-512-etm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2887 | ] |
| 2888 | ) |
| 2889 | # Search for RIPE-MD support in OpenSSL |
| 2890 | AC_CHECK_FUNCS([EVP_ripemd160], , |
| 2891 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2892 | hmac-ripemd160 \ |
| 2893 | hmac-ripemd160@openssh.com \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2894 | hmac-ripemd160-etm@openssh.com" |
| 2895 | ] |
| 2896 | ) |
| 2897 | |
| 2898 | # Check complete ECC support in OpenSSL |
| 2899 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) |
| 2900 | AC_LINK_IFELSE( |
| 2901 | [AC_LANG_PROGRAM([[ |
| 2902 | #include <openssl/ec.h> |
| 2903 | #include <openssl/ecdh.h> |
| 2904 | #include <openssl/ecdsa.h> |
| 2905 | #include <openssl/evp.h> |
| 2906 | #include <openssl/objects.h> |
| 2907 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2908 | ]], [[ |
| 2909 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
| 2910 | const EVP_MD *m = EVP_sha256(); /* We need this too */ |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2911 | ]])], |
| 2912 | [ AC_MSG_RESULT([yes]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2913 | enable_nistp256=1 ], |
| 2914 | [ AC_MSG_RESULT([no]) ] |
| 2915 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2916 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2917 | AC_MSG_CHECKING([whether OpenSSL has NID_secp384r1]) |
| 2918 | AC_LINK_IFELSE( |
| 2919 | [AC_LANG_PROGRAM([[ |
| 2920 | #include <openssl/ec.h> |
| 2921 | #include <openssl/ecdh.h> |
| 2922 | #include <openssl/ecdsa.h> |
| 2923 | #include <openssl/evp.h> |
| 2924 | #include <openssl/objects.h> |
| 2925 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2926 | ]], [[ |
| 2927 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1); |
| 2928 | const EVP_MD *m = EVP_sha384(); /* We need this too */ |
| 2929 | ]])], |
| 2930 | [ AC_MSG_RESULT([yes]) |
| 2931 | enable_nistp384=1 ], |
| 2932 | [ AC_MSG_RESULT([no]) ] |
| 2933 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2934 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2935 | AC_MSG_CHECKING([whether OpenSSL has NID_secp521r1]) |
| 2936 | AC_LINK_IFELSE( |
| 2937 | [AC_LANG_PROGRAM([[ |
| 2938 | #include <openssl/ec.h> |
| 2939 | #include <openssl/ecdh.h> |
| 2940 | #include <openssl/ecdsa.h> |
| 2941 | #include <openssl/evp.h> |
| 2942 | #include <openssl/objects.h> |
| 2943 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2944 | ]], [[ |
| 2945 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2946 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2947 | ]])], |
| 2948 | [ AC_MSG_RESULT([yes]) |
| 2949 | AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) |
| 2950 | AC_RUN_IFELSE( |
| 2951 | [AC_LANG_PROGRAM([[ |
| 2952 | #include <openssl/ec.h> |
| 2953 | #include <openssl/ecdh.h> |
| 2954 | #include <openssl/ecdsa.h> |
| 2955 | #include <openssl/evp.h> |
| 2956 | #include <openssl/objects.h> |
| 2957 | #include <openssl/opensslv.h> |
| 2958 | ]],[[ |
| 2959 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2960 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2961 | exit(e == NULL || m == NULL); |
| 2962 | ]])], |
| 2963 | [ AC_MSG_RESULT([yes]) |
| 2964 | enable_nistp521=1 ], |
| 2965 | [ AC_MSG_RESULT([no]) ], |
| 2966 | [ AC_MSG_WARN([cross-compiling: assuming yes]) |
| 2967 | enable_nistp521=1 ] |
| 2968 | )], |
| 2969 | AC_MSG_RESULT([no]) |
| 2970 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2971 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2972 | COMMENT_OUT_ECC="#no ecc#" |
| 2973 | TEST_SSH_ECC=no |
| 2974 | |
| 2975 | if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ |
| 2976 | test x$enable_nistp521 = x1; then |
| 2977 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) |
Damien Miller | e2cb445 | 2019-01-21 11:32:28 +1100 | [diff] [blame] | 2978 | AC_CHECK_FUNCS([EC_KEY_METHOD_new]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2979 | fi |
| 2980 | if test x$enable_nistp256 = x1; then |
| 2981 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], |
| 2982 | [libcrypto has NID_X9_62_prime256v1]) |
| 2983 | TEST_SSH_ECC=yes |
| 2984 | COMMENT_OUT_ECC="" |
| 2985 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2986 | unsupported_algorithms="$unsupported_algorithms \ |
| 2987 | ecdsa-sha2-nistp256 \ |
| 2988 | ecdh-sha2-nistp256 \ |
| 2989 | ecdsa-sha2-nistp256-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2990 | fi |
| 2991 | if test x$enable_nistp384 = x1; then |
| 2992 | AC_DEFINE([OPENSSL_HAS_NISTP384], [1], [libcrypto has NID_secp384r1]) |
| 2993 | TEST_SSH_ECC=yes |
| 2994 | COMMENT_OUT_ECC="" |
| 2995 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2996 | unsupported_algorithms="$unsupported_algorithms \ |
| 2997 | ecdsa-sha2-nistp384 \ |
| 2998 | ecdh-sha2-nistp384 \ |
| 2999 | ecdsa-sha2-nistp384-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3000 | fi |
| 3001 | if test x$enable_nistp521 = x1; then |
| 3002 | AC_DEFINE([OPENSSL_HAS_NISTP521], [1], [libcrypto has NID_secp521r1]) |
| 3003 | TEST_SSH_ECC=yes |
| 3004 | COMMENT_OUT_ECC="" |
| 3005 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 3006 | unsupported_algorithms="$unsupported_algorithms \ |
| 3007 | ecdh-sha2-nistp521 \ |
| 3008 | ecdsa-sha2-nistp521 \ |
| 3009 | ecdsa-sha2-nistp521-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3010 | fi |
| 3011 | |
| 3012 | AC_SUBST([TEST_SSH_ECC]) |
| 3013 | AC_SUBST([COMMENT_OUT_ECC]) |
| 3014 | else |
| 3015 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 3016 | AC_CHECK_FUNCS([crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3017 | fi |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 3018 | |
Damien Miller | 00f9cd2 | 2014-07-15 10:41:38 +1000 | [diff] [blame] | 3019 | AC_CHECK_FUNCS([ \ |
| 3020 | arc4random \ |
| 3021 | arc4random_buf \ |
| 3022 | arc4random_stir \ |
| 3023 | arc4random_uniform \ |
| 3024 | ]) |
| 3025 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 3026 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3027 | AC_CHECK_LIB([iaf], [ia_openinfo], [ |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 3028 | LIBS="$LIBS -liaf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3029 | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" |
| 3030 | AC_DEFINE([HAVE_LIBIAF], [1], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3031 | [Define if system has libiaf that supports set_id]) |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 3032 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 3033 | ]) |
| 3034 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3035 | |
| 3036 | ### Configure cryptographic random number support |
| 3037 | |
Damien Miller | 10479cc | 2018-04-10 10:19:02 +1000 | [diff] [blame] | 3038 | # Check whether OpenSSL seeds itself |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3039 | if test "x$openssl" = "xyes" ; then |
| 3040 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 3041 | AC_RUN_IFELSE( |
| 3042 | [AC_LANG_PROGRAM([[ |
| 3043 | #include <string.h> |
| 3044 | #include <openssl/rand.h> |
| 3045 | ]], [[ |
| 3046 | exit(RAND_status() == 1 ? 0 : 1); |
| 3047 | ]])], |
| 3048 | [ |
| 3049 | OPENSSL_SEEDS_ITSELF=yes |
| 3050 | AC_MSG_RESULT([yes]) |
| 3051 | ], |
| 3052 | [ |
| 3053 | AC_MSG_RESULT([no]) |
| 3054 | ], |
| 3055 | [ |
| 3056 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 3057 | # This is safe, since we will fatal() at runtime if |
| 3058 | # OpenSSL is not seeded correctly. |
| 3059 | OPENSSL_SEEDS_ITSELF=yes |
| 3060 | ] |
| 3061 | ) |
| 3062 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3063 | |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 3064 | # PRNGD TCP socket |
| 3065 | AC_ARG_WITH([prngd-port], |
| 3066 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 3067 | [ |
| 3068 | case "$withval" in |
| 3069 | no) |
| 3070 | withval="" |
| 3071 | ;; |
| 3072 | [[0-9]]*) |
| 3073 | ;; |
| 3074 | *) |
| 3075 | AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port]) |
| 3076 | ;; |
| 3077 | esac |
| 3078 | if test ! -z "$withval" ; then |
| 3079 | PRNGD_PORT="$withval" |
| 3080 | AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT], |
| 3081 | [Port number of PRNGD/EGD random number socket]) |
| 3082 | fi |
| 3083 | ] |
| 3084 | ) |
| 3085 | |
| 3086 | # PRNGD Unix domain socket |
| 3087 | AC_ARG_WITH([prngd-socket], |
| 3088 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 3089 | [ |
| 3090 | case "$withval" in |
| 3091 | yes) |
| 3092 | withval="/var/run/egd-pool" |
| 3093 | ;; |
| 3094 | no) |
| 3095 | withval="" |
| 3096 | ;; |
| 3097 | /*) |
| 3098 | ;; |
| 3099 | *) |
| 3100 | AC_MSG_ERROR([You must specify an absolute path to the entropy socket]) |
| 3101 | ;; |
| 3102 | esac |
| 3103 | |
| 3104 | if test ! -z "$withval" ; then |
| 3105 | if test ! -z "$PRNGD_PORT" ; then |
| 3106 | AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket]) |
| 3107 | fi |
| 3108 | if test ! -r "$withval" ; then |
| 3109 | AC_MSG_WARN([Entropy socket is not readable]) |
| 3110 | fi |
| 3111 | PRNGD_SOCKET="$withval" |
| 3112 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"], |
| 3113 | [Location of PRNGD/EGD random number socket]) |
| 3114 | fi |
| 3115 | ], |
| 3116 | [ |
| 3117 | # Check for existing socket only if we don't have a random device already |
| 3118 | if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then |
| 3119 | AC_MSG_CHECKING([for PRNGD/EGD socket]) |
| 3120 | # Insert other locations here |
| 3121 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 3122 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 3123 | PRNGD_SOCKET="$sock" |
| 3124 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"]) |
| 3125 | break; |
| 3126 | fi |
| 3127 | done |
| 3128 | if test ! -z "$PRNGD_SOCKET" ; then |
| 3129 | AC_MSG_RESULT([$PRNGD_SOCKET]) |
| 3130 | else |
| 3131 | AC_MSG_RESULT([not found]) |
| 3132 | fi |
| 3133 | fi |
| 3134 | ] |
| 3135 | ) |
| 3136 | |
| 3137 | # Which randomness source do we use? |
| 3138 | if test ! -z "$PRNGD_PORT" ; then |
| 3139 | RAND_MSG="PRNGd port $PRNGD_PORT" |
| 3140 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 3141 | RAND_MSG="PRNGd socket $PRNGD_SOCKET" |
| 3142 | elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 3143 | AC_DEFINE([OPENSSL_PRNG_ONLY], [1], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3144 | [Define if you want the OpenSSL internally seeded PRNG only]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 3145 | RAND_MSG="OpenSSL internal ONLY" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3146 | elif test "x$openssl" = "xno" ; then |
| 3147 | 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] | 3148 | else |
| 3149 | 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]) |
| 3150 | fi |
| 3151 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3152 | # Check for PAM libs |
| 3153 | PAM_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3154 | AC_ARG_WITH([pam], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3155 | [ --with-pam Enable PAM support ], |
| 3156 | [ |
| 3157 | if test "x$withval" != "xno" ; then |
| 3158 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 3159 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 3160 | AC_MSG_ERROR([PAM headers not found]) |
| 3161 | fi |
| 3162 | |
| 3163 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3164 | AC_CHECK_LIB([dl], [dlopen], , ) |
| 3165 | AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) |
| 3166 | AC_CHECK_FUNCS([pam_getenvlist]) |
| 3167 | AC_CHECK_FUNCS([pam_putenv]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3168 | LIBS="$saved_LIBS" |
| 3169 | |
| 3170 | PAM_MSG="yes" |
| 3171 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3172 | SSHDLIBS="$SSHDLIBS -lpam" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3173 | AC_DEFINE([USE_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3174 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3175 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3176 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3177 | case "$LIBS" in |
| 3178 | *-ldl*) |
| 3179 | # libdl already in LIBS |
| 3180 | ;; |
| 3181 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3182 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3183 | ;; |
| 3184 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3185 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3186 | fi |
| 3187 | ] |
| 3188 | ) |
| 3189 | |
Damien Miller | 8bd81e1 | 2016-08-16 13:30:56 +1000 | [diff] [blame] | 3190 | AC_ARG_WITH([pam-service], |
| 3191 | [ --with-pam-service=name Specify PAM service name ], |
| 3192 | [ |
| 3193 | if test "x$withval" != "xno" && \ |
| 3194 | test "x$withval" != "xyes" ; then |
| 3195 | AC_DEFINE_UNQUOTED([SSHD_PAM_SERVICE], |
| 3196 | ["$withval"], [sshd PAM service name]) |
| 3197 | fi |
| 3198 | ] |
| 3199 | ) |
| 3200 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3201 | # Check for older PAM |
| 3202 | if test "x$PAM_MSG" = "xyes" ; then |
| 3203 | # Check PAM strerror arguments (old PAM) |
| 3204 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3205 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3206 | #include <stdlib.h> |
| 3207 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 3208 | #include <security/pam_appl.h> |
| 3209 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 3210 | #include <pam/pam_appl.h> |
| 3211 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3212 | ]], [[ |
| 3213 | (void)pam_strerror((pam_handle_t *)NULL, -1); |
| 3214 | ]])], [AC_MSG_RESULT([no])], [ |
| 3215 | AC_DEFINE([HAVE_OLD_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3216 | [Define if you have an old version of PAM |
| 3217 | which takes only one argument to pam_strerror]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3218 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3219 | PAM_MSG="yes (old library)" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3220 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3221 | ]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3222 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3223 | |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3224 | case "$host" in |
| 3225 | *-*-cygwin*) |
| 3226 | SSH_PRIVSEP_USER=CYGWIN_SSH_PRIVSEP_USER |
| 3227 | ;; |
| 3228 | *) |
| 3229 | SSH_PRIVSEP_USER=sshd |
| 3230 | ;; |
| 3231 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3232 | AC_ARG_WITH([privsep-user], |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 3233 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3234 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3235 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3236 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 3237 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3238 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3239 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3240 | ) |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3241 | if test "x$SSH_PRIVSEP_USER" = "xCYGWIN_SSH_PRIVSEP_USER" ; then |
| 3242 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], [CYGWIN_SSH_PRIVSEP_USER], |
| 3243 | [Cygwin function to fetch non-privileged user for privilege separation]) |
| 3244 | else |
| 3245 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"], |
| 3246 | [non-privileged user for privilege separation]) |
| 3247 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3248 | AC_SUBST([SSH_PRIVSEP_USER]) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3249 | |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3250 | if test "x$have_linux_no_new_privs" = "x1" ; then |
| 3251 | AC_CHECK_DECL([SECCOMP_MODE_FILTER], [have_seccomp_filter=1], , [ |
| 3252 | #include <sys/types.h> |
| 3253 | #include <linux/seccomp.h> |
| 3254 | ]) |
| 3255 | fi |
| 3256 | if test "x$have_seccomp_filter" = "x1" ; then |
| 3257 | AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 3258 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3259 | #include <errno.h> |
| 3260 | #include <elf.h> |
| 3261 | #include <linux/audit.h> |
| 3262 | #include <linux/seccomp.h> |
| 3263 | #include <stdlib.h> |
| 3264 | #include <sys/prctl.h> |
| 3265 | ]], |
| 3266 | [[ int i = $seccomp_audit_arch; |
| 3267 | errno = 0; |
| 3268 | prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 3269 | exit(errno == EFAULT ? 0 : 1); ]])], |
| 3270 | [ AC_MSG_RESULT([yes]) ], [ |
| 3271 | AC_MSG_RESULT([no]) |
| 3272 | # Disable seccomp filter as a target |
| 3273 | have_seccomp_filter=0 |
| 3274 | ] |
| 3275 | ) |
| 3276 | fi |
| 3277 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3278 | # Decide which sandbox style to use |
| 3279 | sandbox_arg="" |
| 3280 | AC_ARG_WITH([sandbox], |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3281 | [ --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] | 3282 | [ |
| 3283 | if test "x$withval" = "xyes" ; then |
| 3284 | sandbox_arg="" |
| 3285 | else |
| 3286 | sandbox_arg="$withval" |
| 3287 | fi |
| 3288 | ] |
| 3289 | ) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3290 | |
| 3291 | # Some platforms (seems to be the ones that have a kernel poll(2)-type |
| 3292 | # function with which they implement select(2)) use an extra file descriptor |
| 3293 | # when calling select(2), which means we can't use the rlimit sandbox. |
| 3294 | AC_MSG_CHECKING([if select works with descriptor rlimit]) |
| 3295 | AC_RUN_IFELSE( |
| 3296 | [AC_LANG_PROGRAM([[ |
| 3297 | #include <sys/types.h> |
| 3298 | #ifdef HAVE_SYS_TIME_H |
| 3299 | # include <sys/time.h> |
| 3300 | #endif |
| 3301 | #include <sys/resource.h> |
| 3302 | #ifdef HAVE_SYS_SELECT_H |
| 3303 | # include <sys/select.h> |
| 3304 | #endif |
| 3305 | #include <errno.h> |
| 3306 | #include <fcntl.h> |
| 3307 | #include <stdlib.h> |
| 3308 | ]],[[ |
| 3309 | struct rlimit rl_zero; |
| 3310 | int fd, r; |
| 3311 | fd_set fds; |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3312 | struct timeval tv; |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3313 | |
| 3314 | fd = open("/dev/null", O_RDONLY); |
| 3315 | FD_ZERO(&fds); |
| 3316 | FD_SET(fd, &fds); |
| 3317 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3318 | setrlimit(RLIMIT_FSIZE, &rl_zero); |
| 3319 | setrlimit(RLIMIT_NOFILE, &rl_zero); |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3320 | tv.tv_sec = 1; |
| 3321 | tv.tv_usec = 0; |
| 3322 | r = select(fd+1, &fds, NULL, NULL, &tv); |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3323 | exit (r == -1 ? 1 : 0); |
| 3324 | ]])], |
| 3325 | [AC_MSG_RESULT([yes]) |
| 3326 | select_works_with_rlimit=yes], |
| 3327 | [AC_MSG_RESULT([no]) |
| 3328 | select_works_with_rlimit=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame] | 3329 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3330 | select_works_with_rlimit=yes] |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3331 | ) |
| 3332 | |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3333 | AC_MSG_CHECKING([if setrlimit(RLIMIT_NOFILE,{0,0}) works]) |
| 3334 | AC_RUN_IFELSE( |
| 3335 | [AC_LANG_PROGRAM([[ |
| 3336 | #include <sys/types.h> |
| 3337 | #ifdef HAVE_SYS_TIME_H |
| 3338 | # include <sys/time.h> |
| 3339 | #endif |
| 3340 | #include <sys/resource.h> |
| 3341 | #include <errno.h> |
| 3342 | #include <stdlib.h> |
| 3343 | ]],[[ |
| 3344 | struct rlimit rl_zero; |
| 3345 | int fd, r; |
| 3346 | fd_set fds; |
| 3347 | |
| 3348 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3349 | r = setrlimit(RLIMIT_NOFILE, &rl_zero); |
| 3350 | exit (r == -1 ? 1 : 0); |
| 3351 | ]])], |
| 3352 | [AC_MSG_RESULT([yes]) |
| 3353 | rlimit_nofile_zero_works=yes], |
| 3354 | [AC_MSG_RESULT([no]) |
| 3355 | rlimit_nofile_zero_works=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame] | 3356 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3357 | rlimit_nofile_zero_works=yes] |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3358 | ) |
| 3359 | |
Darren Tucker | d545a4b | 2012-07-03 22:48:31 +1000 | [diff] [blame] | 3360 | AC_MSG_CHECKING([if setrlimit RLIMIT_FSIZE works]) |
| 3361 | AC_RUN_IFELSE( |
| 3362 | [AC_LANG_PROGRAM([[ |
| 3363 | #include <sys/types.h> |
| 3364 | #include <sys/resource.h> |
| 3365 | #include <stdlib.h> |
| 3366 | ]],[[ |
| 3367 | struct rlimit rl_zero; |
| 3368 | |
| 3369 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3370 | exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); |
| 3371 | ]])], |
| 3372 | [AC_MSG_RESULT([yes])], |
| 3373 | [AC_MSG_RESULT([no]) |
| 3374 | AC_DEFINE(SANDBOX_SKIP_RLIMIT_FSIZE, 1, |
| 3375 | [setrlimit RLIMIT_FSIZE works])], |
| 3376 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3377 | ) |
| 3378 | |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3379 | if test "x$sandbox_arg" = "xpledge" || \ |
| 3380 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_pledge" = "xyes" ) ; then |
| 3381 | test "x$ac_cv_func_pledge" != "xyes" && \ |
| 3382 | AC_MSG_ERROR([pledge sandbox requires pledge(2) support]) |
| 3383 | SANDBOX_STYLE="pledge" |
Damien Miller | fafe1d8 | 2015-10-14 09:22:15 -0700 | [diff] [blame] | 3384 | AC_DEFINE([SANDBOX_PLEDGE], [1], [Sandbox using pledge(2)]) |
Damien Miller | 9846a2f | 2015-10-08 04:30:48 +1100 | [diff] [blame] | 3385 | elif test "x$sandbox_arg" = "xsystrace" || \ |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3386 | ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3387 | test "x$have_systr_policy_kill" != "x1" && \ |
| 3388 | 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] | 3389 | SANDBOX_STYLE="systrace" |
| 3390 | AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 3391 | elif test "x$sandbox_arg" = "xdarwin" || \ |
| 3392 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 3393 | test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3394 | test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 3395 | "x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 3396 | 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] | 3397 | SANDBOX_STYLE="darwin" |
| 3398 | AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3399 | elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 3400 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | d0494fd | 2012-05-19 14:25:39 +1000 | [diff] [blame] | 3401 | test "x$have_seccomp_filter" = "x1" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3402 | test "x$ac_cv_header_elf_h" = "xyes" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3403 | test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3404 | test "x$ac_cv_header_linux_filter_h" = "xyes" && \ |
| 3405 | test "x$seccomp_audit_arch" != "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3406 | test "x$have_linux_no_new_privs" = "x1" && \ |
| 3407 | test "x$ac_cv_func_prctl" = "xyes" ) ; then |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3408 | test "x$seccomp_audit_arch" = "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3409 | AC_MSG_ERROR([seccomp_filter sandbox not supported on $host]) |
| 3410 | test "x$have_linux_no_new_privs" != "x1" && \ |
| 3411 | AC_MSG_ERROR([seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS]) |
| 3412 | test "x$have_seccomp_filter" != "x1" && \ |
| 3413 | AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 3414 | test "x$ac_cv_func_prctl" != "xyes" && \ |
| 3415 | AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 3416 | SANDBOX_STYLE="seccomp_filter" |
| 3417 | AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3418 | elif test "x$sandbox_arg" = "xcapsicum" || \ |
| 3419 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 3420 | test "x$ac_cv_header_sys_capsicum_h" = "xyes" && \ |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3421 | test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 3422 | test "x$ac_cv_header_sys_capsicum_h" != "xyes" && \ |
| 3423 | AC_MSG_ERROR([capsicum sandbox requires sys/capsicum.h header]) |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3424 | test "x$ac_cv_func_cap_rights_limit" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3425 | AC_MSG_ERROR([capsicum sandbox requires cap_rights_limit function]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3426 | SANDBOX_STYLE="capsicum" |
| 3427 | AC_DEFINE([SANDBOX_CAPSICUM], [1], [Sandbox using capsicum]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3428 | elif test "x$sandbox_arg" = "xrlimit" || \ |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3429 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3430 | test "x$select_works_with_rlimit" = "xyes" && \ |
| 3431 | test "x$rlimit_nofile_zero_works" = "xyes" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3432 | test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 3433 | AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3434 | test "x$select_works_with_rlimit" != "xyes" && \ |
| 3435 | AC_MSG_ERROR([rlimit sandbox requires select to work with rlimit]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3436 | SANDBOX_STYLE="rlimit" |
| 3437 | AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 3438 | elif test "x$sandbox_arg" = "xsolaris" || \ |
| 3439 | ( test -z "$sandbox_arg" && test "x$SOLARIS_PRIVS" = "xyes" ) ; then |
| 3440 | SANDBOX_STYLE="solaris" |
| 3441 | AC_DEFINE([SANDBOX_SOLARIS], [1], [Sandbox using Solaris/Illumos privileges]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3442 | elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 3443 | test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 3444 | SANDBOX_STYLE="none" |
| 3445 | AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
| 3446 | else |
Tim Rice | a6e6061 | 2011-08-17 21:48:22 -0700 | [diff] [blame] | 3447 | AC_MSG_ERROR([unsupported --with-sandbox]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3448 | fi |
| 3449 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 3450 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 3451 | if test ! -z "$SONY" ; then |
| 3452 | LIBS="$LIBS -liberty"; |
| 3453 | fi |
| 3454 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3455 | # Check for long long datatypes |
| 3456 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 3457 | |
| 3458 | # Check datatype sizes |
Dag-Erling Smørgrav | d0153c7 | 2018-10-09 23:03:40 +0200 | [diff] [blame] | 3459 | AC_CHECK_SIZEOF([short int]) |
| 3460 | AC_CHECK_SIZEOF([int]) |
| 3461 | AC_CHECK_SIZEOF([long int]) |
| 3462 | AC_CHECK_SIZEOF([long long int]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3463 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 3464 | # Sanity check long long for some platforms (AIX) |
| 3465 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 3466 | ac_cv_sizeof_long_long_int=0 |
| 3467 | fi |
| 3468 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3469 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 3470 | if test -z "$have_llong_max"; then |
| 3471 | AC_MSG_CHECKING([for max value of long long]) |
| 3472 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3473 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3474 | #include <stdio.h> |
| 3475 | /* Why is this so damn hard? */ |
| 3476 | #ifdef __GNUC__ |
| 3477 | # undef __GNUC__ |
| 3478 | #endif |
| 3479 | #define __USE_ISOC99 |
| 3480 | #include <limits.h> |
| 3481 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3482 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 3483 | |
| 3484 | /* |
| 3485 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 3486 | * we do this the hard way. |
| 3487 | */ |
| 3488 | static int |
| 3489 | fprint_ll(FILE *f, long long n) |
| 3490 | { |
| 3491 | unsigned int i; |
| 3492 | int l[sizeof(long long) * 8]; |
| 3493 | |
| 3494 | if (n < 0) |
| 3495 | if (fprintf(f, "-") < 0) |
| 3496 | return -1; |
| 3497 | for (i = 0; n != 0; i++) { |
| 3498 | l[i] = my_abs(n % 10); |
| 3499 | n /= 10; |
| 3500 | } |
| 3501 | do { |
| 3502 | if (fprintf(f, "%d", l[--i]) < 0) |
| 3503 | return -1; |
| 3504 | } while (i != 0); |
| 3505 | if (fprintf(f, " ") < 0) |
| 3506 | return -1; |
| 3507 | return 0; |
| 3508 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3509 | ]], [[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3510 | FILE *f; |
| 3511 | long long i, llmin, llmax = 0; |
| 3512 | |
| 3513 | if((f = fopen(DATA,"w")) == NULL) |
| 3514 | exit(1); |
| 3515 | |
| 3516 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 3517 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 3518 | llmin = LLONG_MIN; |
| 3519 | llmax = LLONG_MAX; |
| 3520 | #else |
| 3521 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 3522 | /* This will work on one's complement and two's complement */ |
| 3523 | for (i = 1; i > llmax; i <<= 1, i++) |
| 3524 | llmax = i; |
| 3525 | llmin = llmax + 1LL; /* wrap */ |
| 3526 | #endif |
| 3527 | |
| 3528 | /* Sanity check */ |
| 3529 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3530 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 3531 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3532 | fprintf(f, "unknown unknown\n"); |
| 3533 | exit(2); |
| 3534 | } |
| 3535 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3536 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3537 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3538 | if (fprint_ll(f, llmax) < 0) |
| 3539 | exit(4); |
| 3540 | if (fclose(f) < 0) |
| 3541 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3542 | exit(0); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3543 | ]])], |
| 3544 | [ |
| 3545 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 3546 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 3547 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3548 | AC_MSG_RESULT([$llong_max]) |
| 3549 | AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3550 | [max value of long long calculated by configure]) |
| 3551 | AC_MSG_CHECKING([for min value of long long]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3552 | AC_MSG_RESULT([$llong_min]) |
| 3553 | AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3554 | [min value of long long calculated by configure]) |
| 3555 | ], |
| 3556 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3557 | AC_MSG_RESULT([not found]) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3558 | ], |
| 3559 | [ |
| 3560 | AC_MSG_WARN([cross compiling: not checking]) |
| 3561 | ] |
| 3562 | ) |
| 3563 | fi |
| 3564 | |
| 3565 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3566 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3567 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3568 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3569 | [[ u_int a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3570 | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3571 | ]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3572 | ]) |
| 3573 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3574 | 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] | 3575 | have_u_int=1 |
| 3576 | fi |
| 3577 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3578 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3579 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3580 | [[ 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] | 3581 | [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3582 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3583 | ]) |
| 3584 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3585 | 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] | 3586 | have_intxx_t=1 |
| 3587 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3588 | |
| 3589 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3590 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3591 | then |
| 3592 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3593 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3594 | [[ 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] | 3595 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3596 | AC_DEFINE([HAVE_INTXX_T]) |
| 3597 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3598 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3599 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3600 | fi |
| 3601 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3602 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3603 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 3604 | #include <sys/types.h> |
| 3605 | #ifdef HAVE_STDINT_H |
| 3606 | # include <stdint.h> |
| 3607 | #endif |
| 3608 | #include <sys/socket.h> |
| 3609 | #ifdef HAVE_SYS_BITYPES_H |
| 3610 | # include <sys/bitypes.h> |
| 3611 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3612 | ]], [[ |
| 3613 | int64_t a; a = 1; |
| 3614 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3615 | [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3616 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3617 | ]) |
| 3618 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3619 | 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] | 3620 | fi |
| 3621 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3622 | 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] | 3623 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3624 | [[ 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] | 3625 | [ 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] | 3626 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3627 | ]) |
| 3628 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3629 | 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] | 3630 | have_u_intxx_t=1 |
| 3631 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3632 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3633 | if test -z "$have_u_intxx_t" ; then |
| 3634 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3635 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], |
| 3636 | [[ 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] | 3637 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3638 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3639 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3640 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3641 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3642 | fi |
| 3643 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3644 | 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] | 3645 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3646 | [[ u_int64_t a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3647 | [ 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] | 3648 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3649 | ]) |
| 3650 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3651 | 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] | 3652 | have_u_int64_t=1 |
| 3653 | fi |
| 3654 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3655 | if (test -z "$have_u_int64_t" && \ |
| 3656 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
| 3657 | then |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3658 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3659 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], |
| 3660 | [[ u_int64_t a; a = 1]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3661 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3662 | AC_DEFINE([HAVE_U_INT64_T]) |
| 3663 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3664 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3665 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3666 | fi |
| 3667 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3668 | if test -z "$have_u_intxx_t" ; then |
| 3669 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3670 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3671 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3672 | ]], [[ |
| 3673 | uint8_t a; |
| 3674 | uint16_t b; |
| 3675 | uint32_t c; |
| 3676 | a = b = c = 1; |
| 3677 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3678 | [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3679 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3680 | ]) |
| 3681 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3682 | AC_DEFINE([HAVE_UINTXX_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3683 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3684 | fi |
| 3685 | fi |
| 3686 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3687 | if (test -z "$have_uintxx_t" && \ |
| 3688 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 3689 | then |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3690 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3691 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3692 | [[ 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] | 3693 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3694 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3695 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3696 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3697 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3698 | fi |
| 3699 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3700 | if (test -z "$have_uintxx_t" && \ |
| 3701 | test "x$ac_cv_header_inttypes_h" = "xyes") |
| 3702 | then |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3703 | AC_MSG_CHECKING([for uintXX_t types in inttypes.h]) |
| 3704 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <inttypes.h> ]], |
| 3705 | [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])], |
| 3706 | [ |
| 3707 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3708 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3709 | ], [ AC_MSG_RESULT([no]) |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3710 | ]) |
| 3711 | fi |
| 3712 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3713 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3714 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3715 | then |
| 3716 | 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] | 3717 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3718 | #include <sys/bitypes.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3719 | ]], [[ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 3720 | int8_t a; int16_t b; int32_t c; |
| 3721 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 3722 | a = b = c = e = f = g = 1; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3723 | ]])], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3724 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3725 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3726 | AC_DEFINE([HAVE_INTXX_T]) |
| 3727 | AC_MSG_RESULT([yes]) |
| 3728 | ], [AC_MSG_RESULT([no]) |
| 3729 | ]) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3730 | fi |
| 3731 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3732 | |
| 3733 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3734 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3735 | [[ u_char foo; foo = 125; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3736 | [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3737 | ]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3738 | ]) |
| 3739 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3740 | 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] | 3741 | fi |
| 3742 | |
Darren Tucker | 007e3b3 | 2013-11-03 18:43:55 +1100 | [diff] [blame] | 3743 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ |
| 3744 | #include <sys/types.h> |
| 3745 | #include <stdint.h> |
| 3746 | ]) |
| 3747 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3748 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 3749 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3750 | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) |
| 3751 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 3752 | #include <sys/types.h> |
| 3753 | #ifdef HAVE_SYS_BITYPES_H |
| 3754 | #include <sys/bitypes.h> |
| 3755 | #endif |
| 3756 | #ifdef HAVE_SYS_STATFS_H |
| 3757 | #include <sys/statfs.h> |
| 3758 | #endif |
| 3759 | #ifdef HAVE_SYS_STATVFS_H |
| 3760 | #include <sys/statvfs.h> |
| 3761 | #endif |
| 3762 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3763 | |
Darren Tucker | 1105756 | 2018-02-25 11:22:57 +1100 | [diff] [blame] | 3764 | AC_CHECK_MEMBERS([struct statfs.f_flags], [], [], [[ |
| 3765 | #include <sys/types.h> |
| 3766 | #ifdef HAVE_SYS_BITYPES_H |
| 3767 | #include <sys/bitypes.h> |
| 3768 | #endif |
| 3769 | #ifdef HAVE_SYS_STATFS_H |
| 3770 | #include <sys/statfs.h> |
| 3771 | #endif |
| 3772 | #ifdef HAVE_SYS_STATVFS_H |
| 3773 | #include <sys/statvfs.h> |
| 3774 | #endif |
| 3775 | #ifdef HAVE_SYS_VFS_H |
| 3776 | #include <sys/vfs.h> |
| 3777 | #endif |
| 3778 | ]]) |
| 3779 | |
| 3780 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3781 | AC_CHECK_TYPES([in_addr_t, in_port_t], , , |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 3782 | [#include <sys/types.h> |
| 3783 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3784 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3785 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3786 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3787 | [[ size_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3788 | [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3789 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3790 | ]) |
| 3791 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3792 | 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] | 3793 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 3794 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3795 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3796 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3797 | [[ ssize_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3798 | [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3799 | ]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3800 | ]) |
| 3801 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3802 | 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] | 3803 | fi |
| 3804 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3805 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3806 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]], |
| 3807 | [[ clock_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3808 | [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3809 | ]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3810 | ]) |
| 3811 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3812 | 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] | 3813 | fi |
| 3814 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3815 | 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] | 3816 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3817 | #include <sys/types.h> |
| 3818 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3819 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
| 3820 | [ ac_cv_have_sa_family_t="yes" ], |
| 3821 | [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3822 | #include <sys/types.h> |
| 3823 | #include <sys/socket.h> |
| 3824 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3825 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3826 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3827 | [ ac_cv_have_sa_family_t="no" ] |
| 3828 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3829 | ]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3830 | ]) |
| 3831 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3832 | AC_DEFINE([HAVE_SA_FAMILY_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3833 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3834 | fi |
| 3835 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3836 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3837 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3838 | [[ pid_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3839 | [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3840 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3841 | ]) |
| 3842 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3843 | 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] | 3844 | fi |
| 3845 | |
| 3846 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3847 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3848 | [[ mode_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3849 | [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3850 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3851 | ]) |
| 3852 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3853 | 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] | 3854 | fi |
| 3855 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3856 | |
| 3857 | 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] | 3858 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3859 | #include <sys/types.h> |
| 3860 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3861 | ]], [[ struct sockaddr_storage s; ]])], |
| 3862 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3863 | [ ac_cv_have_struct_sockaddr_storage="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3864 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3865 | ]) |
| 3866 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3867 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3868 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3869 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3870 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3871 | 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] | 3872 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3873 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3874 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3875 | ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], |
| 3876 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3877 | [ ac_cv_have_struct_sockaddr_in6="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3878 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3879 | ]) |
| 3880 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3881 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3882 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3883 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3884 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3885 | 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] | 3886 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3887 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3888 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3889 | ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], |
| 3890 | [ ac_cv_have_struct_in6_addr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3891 | [ ac_cv_have_struct_in6_addr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3892 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3893 | ]) |
| 3894 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3895 | AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3896 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3897 | |
| 3898 | dnl Now check for sin6_scope_id |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3899 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , , |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3900 | [ |
| 3901 | #ifdef HAVE_SYS_TYPES_H |
| 3902 | #include <sys/types.h> |
| 3903 | #endif |
| 3904 | #include <netinet/in.h> |
| 3905 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3906 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3907 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3908 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3909 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3910 | #include <sys/types.h> |
| 3911 | #include <sys/socket.h> |
| 3912 | #include <netdb.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3913 | ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], |
| 3914 | [ ac_cv_have_struct_addrinfo="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3915 | [ ac_cv_have_struct_addrinfo="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3916 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3917 | ]) |
| 3918 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3919 | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3920 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3921 | fi |
| 3922 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3923 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3924 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
| 3925 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
| 3926 | [ ac_cv_have_struct_timeval="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3927 | [ ac_cv_have_struct_timeval="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3928 | ]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3929 | ]) |
| 3930 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3931 | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3932 | have_struct_timeval=1 |
| 3933 | fi |
| 3934 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3935 | AC_CHECK_TYPES([struct timespec]) |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 3936 | |
Damien Miller | 10479cc | 2018-04-10 10:19:02 +1000 | [diff] [blame] | 3937 | # We need int64_t or else certain parts of the compile will fail. |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 3938 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 3939 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 3940 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3941 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 3942 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 3943 | echo "" |
| 3944 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3945 | else |
| 3946 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3947 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3948 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3949 | #include <stdio.h> |
| 3950 | #include <string.h> |
| 3951 | #ifdef HAVE_SNPRINTF |
| 3952 | main() |
| 3953 | { |
| 3954 | char buf[50]; |
| 3955 | char expected_out[50]; |
| 3956 | int mazsize = 50 ; |
| 3957 | #if (SIZEOF_LONG_INT == 8) |
| 3958 | long int num = 0x7fffffffffffffff; |
| 3959 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 3960 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3961 | #endif |
| 3962 | strcpy(expected_out, "9223372036854775807"); |
| 3963 | snprintf(buf, mazsize, "%lld", num); |
| 3964 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3965 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3966 | exit(0); |
| 3967 | } |
| 3968 | #else |
| 3969 | main() { exit(0); } |
| 3970 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3971 | ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3972 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3973 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3974 | fi |
| 3975 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3976 | dnl Checks for structure members |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3977 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP]) |
| 3978 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX]) |
| 3979 | OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX]) |
| 3980 | OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP]) |
| 3981 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP]) |
| 3982 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX]) |
| 3983 | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP]) |
| 3984 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP]) |
| 3985 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX]) |
| 3986 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) |
| 3987 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) |
| 3988 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) |
| 3989 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) |
| 3990 | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) |
| 3991 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) |
| 3992 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) |
| 3993 | 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] | 3994 | |
| 3995 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Damien Miller | bcd1485 | 2017-06-10 23:41:25 +1000 | [diff] [blame] | 3996 | AC_CHECK_MEMBERS([struct stat.st_mtim]) |
| 3997 | AC_CHECK_MEMBERS([struct stat.st_mtime]) |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3998 | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, |
| 3999 | struct passwd.pw_change, struct passwd.pw_expire], |
| 4000 | [], [], [[ |
| 4001 | #include <sys/types.h> |
| 4002 | #include <pwd.h> |
| 4003 | ]]) |
| 4004 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4005 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 4006 | [Define if we don't have struct __res_state in resolv.h])], |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 4007 | [[ |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 4008 | #include <stdio.h> |
| 4009 | #if HAVE_SYS_TYPES_H |
| 4010 | # include <sys/types.h> |
| 4011 | #endif |
| 4012 | #include <netinet/in.h> |
| 4013 | #include <arpa/nameser.h> |
| 4014 | #include <resolv.h> |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 4015 | ]]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4016 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4017 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 4018 | ac_cv_have_ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4019 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 4020 | #include <sys/types.h> |
| 4021 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4022 | ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])], |
| 4023 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 4024 | [ ac_cv_have_ss_family_in_struct_ss="no" ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4025 | ]) |
| 4026 | 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] | 4027 | 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] | 4028 | fi |
| 4029 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4030 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 4031 | ac_cv_have___ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4032 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 4033 | #include <sys/types.h> |
| 4034 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4035 | ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])], |
| 4036 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4037 | [ ac_cv_have___ss_family_in_struct_ss="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4038 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4039 | ]) |
| 4040 | 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] | 4041 | AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4042 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4043 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 4044 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 4045 | 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] | 4046 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 4047 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4048 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 4049 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 4050 | #include <sys/socket.h> |
| 4051 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4052 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 4053 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4054 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 4055 | exit(1); |
| 4056 | #endif |
| 4057 | struct msghdr m; |
| 4058 | m.msg_accrights = 0; |
| 4059 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4060 | ]])], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 4061 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 4062 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 4063 | ) |
| 4064 | ]) |
| 4065 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4066 | AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4067 | [Define if your system uses access rights style |
| 4068 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 4069 | fi |
| 4070 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4071 | AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type]) |
| 4072 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e1a3ddf | 2012-05-04 11:05:45 +1000 | [diff] [blame] | 4073 | #include <sys/param.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 4074 | #include <sys/stat.h> |
| 4075 | #ifdef HAVE_SYS_TIME_H |
| 4076 | # include <sys/time.h> |
| 4077 | #endif |
| 4078 | #ifdef HAVE_SYS_MOUNT_H |
| 4079 | #include <sys/mount.h> |
| 4080 | #endif |
| 4081 | #ifdef HAVE_SYS_STATVFS_H |
| 4082 | #include <sys/statvfs.h> |
| 4083 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4084 | ]], [[ struct statvfs s; s.f_fsid = 0; ]])], |
| 4085 | [ AC_MSG_RESULT([yes]) ], |
| 4086 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 4087 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4088 | AC_MSG_CHECKING([if fsid_t has member val]) |
| 4089 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 4090 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4091 | #include <sys/statvfs.h> |
| 4092 | ]], [[ fsid_t t; t.val[0] = 0; ]])], |
| 4093 | [ AC_MSG_RESULT([yes]) |
| 4094 | AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ], |
| 4095 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 4096 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4097 | AC_MSG_CHECKING([if f_fsid has member __val]) |
| 4098 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 4099 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4100 | #include <sys/statvfs.h> |
| 4101 | ]], [[ fsid_t t; t.__val[0] = 0; ]])], |
| 4102 | [ AC_MSG_RESULT([yes]) |
| 4103 | AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ], |
| 4104 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 4105 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 4106 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 4107 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 4108 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4109 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 4110 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 4111 | #include <sys/socket.h> |
| 4112 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4113 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 4114 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4115 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 4116 | exit(1); |
| 4117 | #endif |
| 4118 | struct msghdr m; |
| 4119 | m.msg_control = 0; |
| 4120 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4121 | ]])], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 4122 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 4123 | [ ac_cv_have_control_in_msghdr="no" ] |
| 4124 | ) |
| 4125 | ]) |
| 4126 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4127 | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4128 | [Define if your system uses ancillary data style |
| 4129 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 4130 | fi |
| 4131 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4132 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4133 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4134 | [[ extern char *__progname; printf("%s", __progname); ]])], |
| 4135 | [ ac_cv_libc_defines___progname="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4136 | [ ac_cv_libc_defines___progname="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4137 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4138 | ]) |
| 4139 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4140 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4141 | fi |
| 4142 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4143 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4144 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 4145 | [[ printf("%s", __FUNCTION__); ]])], |
| 4146 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4147 | [ ac_cv_cc_implements___FUNCTION__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4148 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4149 | ]) |
| 4150 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4151 | AC_DEFINE([HAVE___FUNCTION__], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4152 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4153 | fi |
| 4154 | |
| 4155 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4156 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 4157 | [[ printf("%s", __func__); ]])], |
| 4158 | [ ac_cv_cc_implements___func__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4159 | [ ac_cv_cc_implements___func__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4160 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4161 | ]) |
| 4162 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4163 | AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4164 | fi |
| 4165 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4166 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4167 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4168 | #include <stdarg.h> |
| 4169 | va_list x,y; |
| 4170 | ]], [[ va_copy(x,y); ]])], |
| 4171 | [ ac_cv_have_va_copy="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4172 | [ ac_cv_have_va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4173 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4174 | ]) |
| 4175 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4176 | AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4177 | fi |
| 4178 | |
| 4179 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4180 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4181 | #include <stdarg.h> |
| 4182 | va_list x,y; |
| 4183 | ]], [[ __va_copy(x,y); ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4184 | [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4185 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4186 | ]) |
| 4187 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4188 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4189 | fi |
| 4190 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4191 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 4192 | ac_cv_have_getopt_optreset, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4193 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]], |
| 4194 | [[ extern int optreset; optreset = 0; ]])], |
| 4195 | [ ac_cv_have_getopt_optreset="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4196 | [ ac_cv_have_getopt_optreset="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4197 | ]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4198 | ]) |
| 4199 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4200 | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4201 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4202 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4203 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4204 | 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] | 4205 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4206 | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], |
| 4207 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4208 | [ ac_cv_libc_defines_sys_errlist="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4209 | ]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4210 | ]) |
| 4211 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4212 | AC_DEFINE([HAVE_SYS_ERRLIST], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4213 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4214 | fi |
| 4215 | |
| 4216 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4217 | 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] | 4218 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4219 | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], |
| 4220 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4221 | [ ac_cv_libc_defines_sys_nerr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4222 | ]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4223 | ]) |
| 4224 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4225 | 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] | 4226 | fi |
| 4227 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4228 | # Check libraries needed by DNS fingerprint support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4229 | AC_SEARCH_LIBS([getrrsetbyname], [resolv], |
| 4230 | [AC_DEFINE([HAVE_GETRRSETBYNAME], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4231 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4232 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4233 | # Needed by our getrrsetbyname() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4234 | AC_SEARCH_LIBS([res_query], [resolv]) |
| 4235 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
| 4236 | AC_MSG_CHECKING([if res_query will link]) |
| 4237 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4238 | #include <sys/types.h> |
| 4239 | #include <netinet/in.h> |
| 4240 | #include <arpa/nameser.h> |
| 4241 | #include <netdb.h> |
| 4242 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4243 | ]], [[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4244 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4245 | ]])], |
| 4246 | AC_MSG_RESULT([yes]), |
| 4247 | [AC_MSG_RESULT([no]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4248 | saved_LIBS="$LIBS" |
| 4249 | LIBS="$LIBS -lresolv" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4250 | AC_MSG_CHECKING([for res_query in -lresolv]) |
| 4251 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4252 | #include <sys/types.h> |
| 4253 | #include <netinet/in.h> |
| 4254 | #include <arpa/nameser.h> |
| 4255 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4256 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4257 | ]], [[ |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4258 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4259 | ]])], |
| 4260 | [AC_MSG_RESULT([yes])], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4261 | [LIBS="$saved_LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4262 | AC_MSG_RESULT([no])]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4263 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4264 | AC_CHECK_FUNCS([_getshort _getlong]) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 4265 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 4266 | [#include <sys/types.h> |
| 4267 | #include <arpa/nameser.h>]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4268 | AC_CHECK_MEMBER([HEADER.ad], |
| 4269 | [AC_DEFINE([HAVE_HEADER_AD], [1], |
| 4270 | [Define if HEADER.ad exists in arpa/nameser.h])], , |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4271 | [#include <arpa/nameser.h>]) |
| 4272 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4273 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4274 | AC_MSG_CHECKING([if struct __res_state _res is an extern]) |
| 4275 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4276 | #include <stdio.h> |
| 4277 | #if HAVE_SYS_TYPES_H |
| 4278 | # include <sys/types.h> |
| 4279 | #endif |
| 4280 | #include <netinet/in.h> |
| 4281 | #include <arpa/nameser.h> |
| 4282 | #include <resolv.h> |
| 4283 | extern struct __res_state _res; |
Darren Tucker | 7ad8b28 | 2015-09-11 13:11:02 +1000 | [diff] [blame] | 4284 | ]], [[ |
| 4285 | struct __res_state *volatile p = &_res; /* force resolution of _res */ |
| 4286 | return 0; |
| 4287 | ]],)], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4288 | [AC_MSG_RESULT([yes]) |
| 4289 | AC_DEFINE([HAVE__RES_EXTERN], [1], |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4290 | [Define if you have struct __res_state _res as an extern]) |
| 4291 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4292 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4293 | ) |
| 4294 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4295 | # Check whether user wants SELinux support |
| 4296 | SELINUX_MSG="no" |
| 4297 | LIBSELINUX="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4298 | AC_ARG_WITH([selinux], |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 4299 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4300 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4301 | save_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4302 | AC_DEFINE([WITH_SELINUX], [1], |
| 4303 | [Define if you want SELinux support.]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4304 | SELINUX_MSG="yes" |
| 4305 | AC_CHECK_HEADER([selinux/selinux.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4306 | AC_MSG_ERROR([SELinux support requires selinux.h header])) |
| 4307 | AC_CHECK_LIB([selinux], [setexeccon], |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 4308 | [ LIBSELINUX="-lselinux" |
| 4309 | LIBS="$LIBS -lselinux" |
| 4310 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4311 | AC_MSG_ERROR([SELinux support requires libselinux library])) |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 4312 | SSHLIBS="$SSHLIBS $LIBSELINUX" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4313 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4314 | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 4315 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4316 | fi ] |
| 4317 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4318 | AC_SUBST([SSHLIBS]) |
| 4319 | AC_SUBST([SSHDLIBS]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4320 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4321 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4322 | KRB5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4323 | AC_ARG_WITH([kerberos5], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4324 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4325 | [ if test "x$withval" != "xno" ; then |
| 4326 | if test "x$withval" = "xyes" ; then |
| 4327 | KRB5ROOT="/usr/local" |
| 4328 | else |
| 4329 | KRB5ROOT=${withval} |
| 4330 | fi |
| 4331 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4332 | AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4333 | KRB5_MSG="yes" |
| 4334 | |
Darren Tucker | 4089fc1 | 2016-12-08 12:57:24 +1100 | [diff] [blame] | 4335 | AC_PATH_TOOL([KRB5CONF], [krb5-config], |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 4336 | [$KRB5ROOT/bin/krb5-config], |
| 4337 | [$KRB5ROOT/bin:$PATH]) |
| 4338 | if test -x $KRB5CONF ; then |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4339 | K5CFLAGS="`$KRB5CONF --cflags`" |
| 4340 | K5LIBS="`$KRB5CONF --libs`" |
| 4341 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4342 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4343 | AC_MSG_CHECKING([for gssapi support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4344 | if $KRB5CONF | grep gssapi >/dev/null ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4345 | AC_MSG_RESULT([yes]) |
| 4346 | AC_DEFINE([GSSAPI], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4347 | [Define this if you want GSSAPI |
| 4348 | support in the version 2 protocol]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4349 | GSSCFLAGS="`$KRB5CONF --cflags gssapi`" |
| 4350 | GSSLIBS="`$KRB5CONF --libs gssapi`" |
| 4351 | CPPFLAGS="$CPPFLAGS $GSSCFLAGS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4352 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4353 | AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4354 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4355 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4356 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4357 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4358 | [ AC_MSG_RESULT([yes]) |
| 4359 | AC_DEFINE([HEIMDAL], [1], |
| 4360 | [Define this if you are using the Heimdal |
| 4361 | version of Kerberos V5]) ], |
| 4362 | [AC_MSG_RESULT([no]) |
| 4363 | ]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4364 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4365 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4366 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4367 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4368 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4369 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4370 | [ AC_MSG_RESULT([yes]) |
| 4371 | AC_DEFINE([HEIMDAL]) |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4372 | K5LIBS="-lkrb5" |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4373 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4374 | AC_CHECK_LIB([roken], [net_write], |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4375 | [K5LIBS="$K5LIBS -lroken"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4376 | AC_CHECK_LIB([des], [des_cbc_encrypt], |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4377 | [K5LIBS="$K5LIBS -ldes"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4378 | ], [ AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4379 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4380 | ]) |
| 4381 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4382 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4383 | AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], |
| 4384 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4385 | GSSLIBS="-lgssapi_krb5" ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4386 | [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], |
| 4387 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4388 | GSSLIBS="-lgssapi" ], |
Darren Tucker | a2b5a4c | 2013-02-22 10:43:15 +1100 | [diff] [blame] | 4389 | [ AC_CHECK_LIB([gss], [gss_init_sec_context], |
| 4390 | [ AC_DEFINE([GSSAPI]) |
| 4391 | GSSLIBS="-lgss" ], |
| 4392 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) |
| 4393 | ]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4394 | ]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4395 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4396 | AC_CHECK_HEADER([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4397 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4398 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4399 | AC_CHECK_HEADERS([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4400 | 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] | 4401 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4402 | ] |
| 4403 | ) |
| 4404 | |
| 4405 | oldCPP="$CPPFLAGS" |
| 4406 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4407 | AC_CHECK_HEADER([gssapi_krb5.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4408 | [ CPPFLAGS="$oldCPP" ]) |
| 4409 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4410 | fi |
Darren Tucker | 2f0bad2 | 2019-01-21 21:28:27 +1100 | [diff] [blame] | 4411 | if test -n "${rpath_opt}" ; then |
| 4412 | LDFLAGS="$LDFLAGS ${rpath_opt}${KRB5ROOT}/lib" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4413 | fi |
| 4414 | if test ! -z "$blibpath" ; then |
| 4415 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 4416 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4417 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4418 | AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h]) |
| 4419 | AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h]) |
| 4420 | AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h]) |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4421 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4422 | AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1], |
| 4423 | [Define this if you want to use libkafs' AFS support])]) |
Darren Tucker | 03978c6 | 2013-02-25 11:24:44 +1100 | [diff] [blame] | 4424 | |
| 4425 | AC_CHECK_DECLS([GSS_C_NT_HOSTBASED_SERVICE], [], [], [[ |
| 4426 | #ifdef HAVE_GSSAPI_H |
| 4427 | # include <gssapi.h> |
| 4428 | #elif defined(HAVE_GSSAPI_GSSAPI_H) |
| 4429 | # include <gssapi/gssapi.h> |
| 4430 | #endif |
| 4431 | |
| 4432 | #ifdef HAVE_GSSAPI_GENERIC_H |
| 4433 | # include <gssapi_generic.h> |
| 4434 | #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H) |
| 4435 | # include <gssapi/gssapi_generic.h> |
| 4436 | #endif |
| 4437 | ]]) |
Darren Tucker | f3ab2c5 | 2013-08-04 21:48:41 +1000 | [diff] [blame] | 4438 | saved_LIBS="$LIBS" |
| 4439 | LIBS="$LIBS $K5LIBS" |
| 4440 | AC_CHECK_FUNCS([krb5_cc_new_unique krb5_get_error_message krb5_free_error_message]) |
| 4441 | LIBS="$saved_LIBS" |
| 4442 | |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4443 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4444 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4445 | ) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4446 | AC_SUBST([GSSLIBS]) |
| 4447 | AC_SUBST([K5LIBS]) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 4448 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4449 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4450 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4451 | PRIVSEP_PATH=/var/empty |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4452 | AC_ARG_WITH([privsep-path], |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 4453 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4454 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4455 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4456 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4457 | PRIVSEP_PATH=$withval |
| 4458 | fi |
| 4459 | ] |
| 4460 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4461 | AC_SUBST([PRIVSEP_PATH]) |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4462 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4463 | AC_ARG_WITH([xauth], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4464 | [ --with-xauth=PATH Specify path to xauth program ], |
| 4465 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4466 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4467 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4468 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4469 | fi |
| 4470 | ], |
| 4471 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4472 | TestPath="$PATH" |
| 4473 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 4474 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 4475 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 4476 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4477 | AC_PATH_PROG([xauth_path], [xauth], , [$TestPath]) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 4478 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4479 | xauth_path="/usr/openwin/bin/xauth" |
| 4480 | fi |
| 4481 | ] |
| 4482 | ) |
| 4483 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4484 | STRIP_OPT=-s |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4485 | AC_ARG_ENABLE([strip], |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4486 | [ --disable-strip Disable calling strip(1) on install], |
| 4487 | [ |
| 4488 | if test "x$enableval" = "xno" ; then |
| 4489 | STRIP_OPT= |
| 4490 | fi |
| 4491 | ] |
| 4492 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4493 | AC_SUBST([STRIP_OPT]) |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4494 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4495 | if test -z "$xauth_path" ; then |
| 4496 | XAUTH_PATH="undefined" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4497 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4498 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4499 | AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4500 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4501 | XAUTH_PATH=$xauth_path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4502 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4503 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4504 | |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4505 | dnl # --with-maildir=/path/to/mail gets top priority. |
| 4506 | dnl # if maildir is set in the platform case statement above we use that. |
| 4507 | dnl # Otherwise we run a program to get the dir from system headers. |
| 4508 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
| 4509 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
| 4510 | dnl # session.c expects anyway. Otherwise we set to the value found |
| 4511 | dnl # stripping any trailing slash. If for some strage reason our program |
| 4512 | dnl # does not find what it needs, we default to /var/spool/mail. |
| 4513 | # Check for mail directory |
| 4514 | AC_ARG_WITH([maildir], |
| 4515 | [ --with-maildir=/path/to/mail Specify your system mail directory], |
| 4516 | [ |
| 4517 | if test "X$withval" != X && test "x$withval" != xno && \ |
| 4518 | test "x${withval}" != xyes; then |
| 4519 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], |
| 4520 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) |
| 4521 | fi |
| 4522 | ],[ |
| 4523 | if test "X$maildir" != "X"; then |
| 4524 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4525 | else |
| 4526 | AC_MSG_CHECKING([Discovering system mail directory]) |
| 4527 | AC_RUN_IFELSE( |
| 4528 | [AC_LANG_PROGRAM([[ |
| 4529 | #include <stdio.h> |
| 4530 | #include <string.h> |
| 4531 | #ifdef HAVE_PATHS_H |
| 4532 | #include <paths.h> |
| 4533 | #endif |
| 4534 | #ifdef HAVE_MAILLOCK_H |
| 4535 | #include <maillock.h> |
| 4536 | #endif |
| 4537 | #define DATA "conftest.maildir" |
| 4538 | ]], [[ |
| 4539 | FILE *fd; |
| 4540 | int rc; |
| 4541 | |
| 4542 | fd = fopen(DATA,"w"); |
| 4543 | if(fd == NULL) |
| 4544 | exit(1); |
| 4545 | |
| 4546 | #if defined (_PATH_MAILDIR) |
| 4547 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) |
| 4548 | exit(1); |
| 4549 | #elif defined (MAILDIR) |
| 4550 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) |
| 4551 | exit(1); |
| 4552 | #elif defined (_PATH_MAIL) |
| 4553 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) |
| 4554 | exit(1); |
| 4555 | #else |
| 4556 | exit (2); |
| 4557 | #endif |
| 4558 | |
| 4559 | exit(0); |
| 4560 | ]])], |
| 4561 | [ |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4562 | maildir_what=`awk -F: '{print $1}' conftest.maildir` |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4563 | maildir=`awk -F: '{print $2}' conftest.maildir \ |
| 4564 | | sed 's|/$||'` |
| 4565 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) |
| 4566 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then |
| 4567 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4568 | fi |
| 4569 | ], |
| 4570 | [ |
| 4571 | if test "X$ac_status" = "X2";then |
| 4572 | # our test program didn't find it. Default to /var/spool/mail |
| 4573 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) |
| 4574 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) |
| 4575 | else |
| 4576 | AC_MSG_RESULT([*** not found ***]) |
| 4577 | fi |
| 4578 | ], |
| 4579 | [ |
| 4580 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) |
| 4581 | ] |
| 4582 | ) |
| 4583 | fi |
| 4584 | ] |
| 4585 | ) # maildir |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4586 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4587 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4588 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 4589 | disable_ptmx_check=yes |
| 4590 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4591 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4592 | if test "x$disable_ptmx_check" != "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4593 | AC_CHECK_FILE(["/dev/ptmx"], |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4594 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4595 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4596 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4597 | have_dev_ptmx=1 |
| 4598 | ] |
| 4599 | ) |
| 4600 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4601 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4602 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4603 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4604 | AC_CHECK_FILE(["/dev/ptc"], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4605 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4606 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4607 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4608 | have_dev_ptc=1 |
| 4609 | ] |
| 4610 | ) |
| 4611 | else |
| 4612 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 4613 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 4614 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4615 | # Options from here on. Some of these are preset by platform above |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4616 | AC_ARG_WITH([mantype], |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4617 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4618 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4619 | case "$withval" in |
| 4620 | man|cat|doc) |
| 4621 | MANTYPE=$withval |
| 4622 | ;; |
| 4623 | *) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4624 | AC_MSG_ERROR([invalid man type: $withval]) |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4625 | ;; |
| 4626 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4627 | ] |
| 4628 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4629 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4630 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4631 | AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4632 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4633 | MANTYPE=doc |
| 4634 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4635 | MANTYPE=man |
| 4636 | else |
| 4637 | MANTYPE=cat |
| 4638 | fi |
| 4639 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4640 | AC_SUBST([MANTYPE]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4641 | if test "$MANTYPE" = "doc"; then |
| 4642 | mansubdir=man; |
| 4643 | else |
| 4644 | mansubdir=$MANTYPE; |
| 4645 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4646 | AC_SUBST([mansubdir]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4647 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4648 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4649 | MD5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4650 | AC_ARG_WITH([md5-passwords], |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4651 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4652 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 4653 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4654 | AC_DEFINE([HAVE_MD5_PASSWORDS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4655 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4656 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4657 | fi |
| 4658 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4659 | ) |
| 4660 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4661 | # Whether to disable shadow password support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4662 | AC_ARG_WITH([shadow], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4663 | [ --without-shadow Disable shadow password support], |
| 4664 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4665 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4666 | AC_DEFINE([DISABLE_SHADOW]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4667 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4668 | fi |
| 4669 | ] |
| 4670 | ) |
| 4671 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4672 | if test -z "$disable_shadow" ; then |
| 4673 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4674 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4675 | #include <sys/types.h> |
| 4676 | #include <shadow.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4677 | struct spwd sp; |
| 4678 | ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])], |
| 4679 | [ sp_expire_available=yes ], [ |
| 4680 | ]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4681 | |
| 4682 | if test "x$sp_expire_available" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4683 | AC_MSG_RESULT([yes]) |
| 4684 | AC_DEFINE([HAS_SHADOW_EXPIRE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4685 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4686 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4687 | AC_MSG_RESULT([no]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4688 | fi |
| 4689 | fi |
| 4690 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4691 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4692 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 4693 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4694 | AC_DEFINE([IPADDR_IN_DISPLAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4695 | [Define if you need to use IP address |
| 4696 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4697 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4698 | DISPLAY_HACK_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4699 | AC_ARG_WITH([ipaddr-display], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4700 | [ --with-ipaddr-display Use ip address instead of hostname in $DISPLAY], |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4701 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4702 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4703 | AC_DEFINE([IPADDR_IN_DISPLAY]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4704 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4705 | fi |
| 4706 | ] |
| 4707 | ) |
| 4708 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4709 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4710 | # check for /etc/default/login and use it if present. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4711 | AC_ARG_ENABLE([etc-default-login], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 4712 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4713 | [ if test "x$enableval" = "xno"; then |
| 4714 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 4715 | etc_default_login=no |
| 4716 | else |
| 4717 | etc_default_login=yes |
| 4718 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4719 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 4720 | then |
| 4721 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 4722 | etc_default_login=no |
| 4723 | else |
| 4724 | etc_default_login=yes |
| 4725 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4726 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4727 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4728 | if test "x$etc_default_login" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4729 | AC_CHECK_FILE(["/etc/default/login"], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4730 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4731 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4732 | AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4733 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4734 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4735 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4736 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4737 | 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] | 4738 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 4739 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4740 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4741 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4742 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4743 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4744 | SERVER_PATH_MSG="(default)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4745 | AC_ARG_WITH([default-path], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4746 | [ --with-default-path= Specify default $PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4747 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4748 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4749 | AC_MSG_WARN([ |
| 4750 | --with-default-path=PATH has no effect on this system. |
| 4751 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4752 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4753 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4754 | AC_MSG_WARN([ |
| 4755 | --with-default-path=PATH will only be used if PATH is not defined in |
| 4756 | $external_path_file .]) |
| 4757 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4758 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4759 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4760 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4761 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4762 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4763 | 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] | 4764 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4765 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4766 | AC_MSG_WARN([ |
| 4767 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 4768 | otherwise scp will not work.]) |
| 4769 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4770 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4771 | [AC_LANG_PROGRAM([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4772 | /* find out what STDPATH is */ |
| 4773 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4774 | #ifdef HAVE_PATHS_H |
| 4775 | # include <paths.h> |
| 4776 | #endif |
| 4777 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 4778 | # ifdef _PATH_USERPATH /* Irix */ |
| 4779 | # define _PATH_STDPATH _PATH_USERPATH |
| 4780 | # else |
| 4781 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 4782 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4783 | #endif |
| 4784 | #include <sys/types.h> |
| 4785 | #include <sys/stat.h> |
| 4786 | #include <fcntl.h> |
| 4787 | #define DATA "conftest.stdpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4788 | ]], [[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4789 | FILE *fd; |
| 4790 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4791 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4792 | fd = fopen(DATA,"w"); |
| 4793 | if(fd == NULL) |
| 4794 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4795 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4796 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 4797 | exit(1); |
| 4798 | |
| 4799 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4800 | ]])], |
| 4801 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4802 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 4803 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 4804 | ) |
| 4805 | # make sure $bindir is in USER_PATH so scp will work |
Damien Miller | 77eab7b | 2012-07-06 11:49:28 +1000 | [diff] [blame] | 4806 | t_bindir="${bindir}" |
| 4807 | while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do |
| 4808 | t_bindir=`eval echo ${t_bindir}` |
| 4809 | case $t_bindir in |
| 4810 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 4811 | esac |
| 4812 | case $t_bindir in |
| 4813 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 4814 | esac |
| 4815 | done |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4816 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 4817 | if test $? -ne 0 ; then |
| 4818 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 4819 | if test $? -ne 0 ; then |
| 4820 | user_path=$user_path:$t_bindir |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4821 | 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] | 4822 | fi |
| 4823 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4824 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4825 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4826 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4827 | AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH]) |
| 4828 | AC_SUBST([user_path]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4829 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4830 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4831 | # Set superuser path separately to user path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4832 | AC_ARG_WITH([superuser-path], |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4833 | [ --with-superuser-path= Specify different path for super-user], |
| 4834 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4835 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4836 | test "x${withval}" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4837 | AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4838 | [Define if you want a different $PATH |
| 4839 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4840 | superuser_path=$withval |
| 4841 | fi |
| 4842 | ] |
| 4843 | ) |
| 4844 | |
| 4845 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4846 | 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] | 4847 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4848 | AC_ARG_WITH(4in6, |
| 4849 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 4850 | [ |
| 4851 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4852 | AC_MSG_RESULT([yes]) |
| 4853 | AC_DEFINE([IPV4_IN_IPV6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4854 | [Detect IPv4 in IPv6 mapped addresses |
| 4855 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4856 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4857 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4858 | AC_MSG_RESULT([no]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4859 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4860 | ], [ |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4861 | if test "x$inet6_default_4in6" = "xyes"; then |
| 4862 | AC_MSG_RESULT([yes (default)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4863 | AC_DEFINE([IPV4_IN_IPV6]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4864 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4865 | else |
| 4866 | AC_MSG_RESULT([no (default)]) |
| 4867 | fi |
| 4868 | ] |
| 4869 | ) |
| 4870 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4871 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4872 | BSD_AUTH_MSG=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4873 | AC_ARG_WITH([bsd-auth], |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4874 | [ --with-bsd-auth Enable BSD auth support], |
| 4875 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4876 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4877 | AC_DEFINE([BSD_AUTH], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4878 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4879 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4880 | fi |
| 4881 | ] |
| 4882 | ) |
| 4883 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4884 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 4885 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4886 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4887 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4888 | piddir=`eval echo ${sysconfdir}` |
| 4889 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4890 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4891 | esac |
| 4892 | fi |
| 4893 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4894 | AC_ARG_WITH([pid-dir], |
Darren Tucker | 075e258 | 2018-02-13 17:36:43 +1100 | [diff] [blame] | 4895 | [ --with-pid-dir=PATH Specify location of sshd.pid file], |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4896 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4897 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4898 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4899 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4900 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4901 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 4902 | fi |
| 4903 | fi |
| 4904 | ] |
| 4905 | ) |
| 4906 | |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4907 | AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4908 | [Specify location of ssh.pid]) |
| 4909 | AC_SUBST([piddir]) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 4910 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4911 | dnl allow user to disable some login recording features |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4912 | AC_ARG_ENABLE([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4913 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4914 | [ |
| 4915 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4916 | AC_DEFINE([DISABLE_LASTLOG]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4917 | fi |
| 4918 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4919 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4920 | AC_ARG_ENABLE([utmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4921 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4922 | [ |
| 4923 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4924 | AC_DEFINE([DISABLE_UTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4925 | fi |
| 4926 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4927 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4928 | AC_ARG_ENABLE([utmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4929 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4930 | [ |
| 4931 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4932 | AC_DEFINE([DISABLE_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4933 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4934 | fi |
| 4935 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4936 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4937 | AC_ARG_ENABLE([wtmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4938 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4939 | [ |
| 4940 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4941 | AC_DEFINE([DISABLE_WTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4942 | fi |
| 4943 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4944 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4945 | AC_ARG_ENABLE([wtmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4946 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4947 | [ |
| 4948 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4949 | AC_DEFINE([DISABLE_WTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4950 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4951 | fi |
| 4952 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4953 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4954 | AC_ARG_ENABLE([libutil], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4955 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4956 | [ |
| 4957 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4958 | AC_DEFINE([DISABLE_LOGIN]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4959 | fi |
| 4960 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4961 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4962 | AC_ARG_ENABLE([pututline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4963 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4964 | [ |
| 4965 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4966 | AC_DEFINE([DISABLE_PUTUTLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4967 | [Define if you don't want to use pututline() |
| 4968 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4969 | fi |
| 4970 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4971 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4972 | AC_ARG_ENABLE([pututxline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4973 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4974 | [ |
| 4975 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4976 | AC_DEFINE([DISABLE_PUTUTXLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4977 | [Define if you don't want to use pututxline() |
| 4978 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4979 | fi |
| 4980 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4981 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4982 | AC_ARG_WITH([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4983 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4984 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4985 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4986 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4987 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4988 | conf_lastlog_location=$withval |
| 4989 | fi |
| 4990 | ] |
| 4991 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4992 | |
| 4993 | dnl lastlog, [uw]tmpx? detection |
| 4994 | dnl NOTE: set the paths in the platform section to avoid the |
| 4995 | dnl need for command-line parameters |
| 4996 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 4997 | |
| 4998 | dnl lastlog detection |
| 4999 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 5000 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5001 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5002 | #include <sys/types.h> |
| 5003 | #include <utmp.h> |
| 5004 | #ifdef HAVE_LASTLOG_H |
| 5005 | # include <lastlog.h> |
| 5006 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5007 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5008 | # include <paths.h> |
| 5009 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 5010 | #ifdef HAVE_LOGIN_H |
| 5011 | # include <login.h> |
| 5012 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5013 | ]], [[ char *lastlog = LASTLOG_FILE; ]])], |
| 5014 | [ AC_MSG_RESULT([yes]) ], |
| 5015 | [ |
| 5016 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5017 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5018 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5019 | #include <sys/types.h> |
| 5020 | #include <utmp.h> |
| 5021 | #ifdef HAVE_LASTLOG_H |
| 5022 | # include <lastlog.h> |
| 5023 | #endif |
| 5024 | #ifdef HAVE_PATHS_H |
| 5025 | # include <paths.h> |
| 5026 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5027 | ]], [[ char *lastlog = _PATH_LASTLOG; ]])], |
| 5028 | [ AC_MSG_RESULT([yes]) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5029 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5030 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5031 | system_lastlog_path=no |
| 5032 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5033 | ]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5034 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5035 | if test -z "$conf_lastlog_location"; then |
| 5036 | if test x"$system_lastlog_path" = x"no" ; then |
| 5037 | 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] | 5038 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5039 | conf_lastlog_location=$f |
| 5040 | fi |
| 5041 | done |
| 5042 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 5043 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 5044 | 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] | 5045 | fi |
| 5046 | fi |
| 5047 | fi |
| 5048 | |
| 5049 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5050 | AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 5051 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 5052 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5053 | |
| 5054 | dnl utmp detection |
| 5055 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5056 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5057 | #include <sys/types.h> |
| 5058 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5059 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5060 | # include <paths.h> |
| 5061 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5062 | ]], [[ char *utmp = UTMP_FILE; ]])], |
| 5063 | [ AC_MSG_RESULT([yes]) ], |
| 5064 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 5065 | system_utmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5066 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5067 | if test -z "$conf_utmp_location"; then |
| 5068 | if test x"$system_utmp_path" = x"no" ; then |
| 5069 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 5070 | if test -f $f ; then |
| 5071 | conf_utmp_location=$f |
| 5072 | fi |
| 5073 | done |
| 5074 | if test -z "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5075 | AC_DEFINE([DISABLE_UTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5076 | fi |
| 5077 | fi |
| 5078 | fi |
| 5079 | if test -n "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5080 | AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 5081 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 5082 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5083 | |
| 5084 | dnl wtmp detection |
| 5085 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5086 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5087 | #include <sys/types.h> |
| 5088 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5089 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5090 | # include <paths.h> |
| 5091 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5092 | ]], [[ char *wtmp = WTMP_FILE; ]])], |
| 5093 | [ AC_MSG_RESULT([yes]) ], |
| 5094 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 5095 | system_wtmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5096 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5097 | if test -z "$conf_wtmp_location"; then |
| 5098 | if test x"$system_wtmp_path" = x"no" ; then |
| 5099 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 5100 | if test -f $f ; then |
| 5101 | conf_wtmp_location=$f |
| 5102 | fi |
| 5103 | done |
| 5104 | if test -z "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5105 | AC_DEFINE([DISABLE_WTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5106 | fi |
| 5107 | fi |
| 5108 | fi |
| 5109 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5110 | AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 5111 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 5112 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5113 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5114 | dnl wtmpx detection |
| 5115 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5116 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5117 | #include <sys/types.h> |
| 5118 | #include <utmp.h> |
| 5119 | #ifdef HAVE_UTMPX_H |
| 5120 | #include <utmpx.h> |
| 5121 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 5122 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5123 | # include <paths.h> |
| 5124 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5125 | ]], [[ char *wtmpx = WTMPX_FILE; ]])], |
| 5126 | [ AC_MSG_RESULT([yes]) ], |
| 5127 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 5128 | system_wtmpx_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5129 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5130 | if test -z "$conf_wtmpx_location"; then |
| 5131 | if test x"$system_wtmpx_path" = x"no" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5132 | AC_DEFINE([DISABLE_WTMPX]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5133 | fi |
| 5134 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5135 | AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 5136 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 5137 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5138 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 5139 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 5140 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 5141 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 5142 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 5143 | fi |
| 5144 | |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5145 | AC_CHECK_MEMBER([struct lastlog.ll_line], [], [ |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 5146 | if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5147 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 5148 | fi |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5149 | ], [ |
| 5150 | #ifdef HAVE_SYS_TYPES_H |
| 5151 | #include <sys/types.h> |
| 5152 | #endif |
| 5153 | #ifdef HAVE_UTMP_H |
| 5154 | #include <utmp.h> |
| 5155 | #endif |
| 5156 | #ifdef HAVE_UTMPX_H |
| 5157 | #include <utmpx.h> |
| 5158 | #endif |
| 5159 | #ifdef HAVE_LASTLOG_H |
| 5160 | #include <lastlog.h> |
| 5161 | #endif |
| 5162 | ]) |
| 5163 | |
| 5164 | AC_CHECK_MEMBER([struct utmp.ut_line], [], [ |
| 5165 | AC_DEFINE([DISABLE_UTMP]) |
| 5166 | AC_DEFINE([DISABLE_WTMP]) |
| 5167 | ], [ |
| 5168 | #ifdef HAVE_SYS_TYPES_H |
| 5169 | #include <sys/types.h> |
| 5170 | #endif |
| 5171 | #ifdef HAVE_UTMP_H |
| 5172 | #include <utmp.h> |
| 5173 | #endif |
| 5174 | #ifdef HAVE_UTMPX_H |
| 5175 | #include <utmpx.h> |
| 5176 | #endif |
| 5177 | #ifdef HAVE_LASTLOG_H |
| 5178 | #include <lastlog.h> |
| 5179 | #endif |
| 5180 | ]) |
| 5181 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 5182 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 5183 | dnl Add now. |
| 5184 | CFLAGS="$CFLAGS $werror_flags" |
| 5185 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 5186 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 5187 | TEST_SSH_IPV6=no |
| 5188 | else |
| 5189 | TEST_SSH_IPV6=yes |
| 5190 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5191 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
| 5192 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 5193 | AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 5194 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
Darren Tucker | 6d8bd57 | 2013-06-11 11:26:10 +1000 | [diff] [blame] | 5195 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
Darren Tucker | 79c0e1d | 2017-12-11 14:38:33 +1100 | [diff] [blame] | 5196 | AC_SUBST([DEPEND], [$(cat $srcdir/.depend)]) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 5197 | |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 5198 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" |
| 5199 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" |
| 5200 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 5201 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 5202 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 5203 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 5204 | survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 5205 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 5206 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5207 | # Print summary of options |
| 5208 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5209 | # Someone please show me a better way :) |
| 5210 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 5211 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 5212 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 5213 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 5214 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 5215 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5216 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5217 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 5218 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 5219 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5220 | |
| 5221 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 5222 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5223 | echo " User binaries: $B" |
| 5224 | echo " System binaries: $C" |
| 5225 | echo " Configuration files: $D" |
| 5226 | echo " Askpass program: $E" |
| 5227 | echo " Manual pages: $F" |
| 5228 | echo " PID file: $G" |
| 5229 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5230 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 5231 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 5232 | 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] | 5233 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5234 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 5235 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5236 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 5237 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 5238 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 5239 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5240 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5241 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5242 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5243 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 5244 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5245 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5246 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 5247 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5248 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 5249 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 5250 | echo " libldns support: $LDNS_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5251 | echo " Solaris process contract support: $SPC_MSG" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 5252 | echo " Solaris project support: $SP_MSG" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 5253 | echo " Solaris privilege support: $SPP_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 5254 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5255 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 5256 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 5257 | echo " Random number source: $RAND_MSG" |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 5258 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 5259 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5260 | echo "" |
| 5261 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 5262 | echo " Host: ${host}" |
| 5263 | echo " Compiler: ${CC}" |
| 5264 | echo " Compiler flags: ${CFLAGS}" |
| 5265 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 5266 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 5267 | echo " Libraries: ${LIBS}" |
| 5268 | if test ! -z "${SSHDLIBS}"; then |
| 5269 | echo " +for sshd: ${SSHDLIBS}" |
| 5270 | fi |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 5271 | if test ! -z "${SSHLIBS}"; then |
| 5272 | echo " +for ssh: ${SSHLIBS}" |
| 5273 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5274 | |
| 5275 | echo "" |
| 5276 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5277 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 5278 | echo "SVR4 style packages are supported with \"make package\"" |
| 5279 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5280 | fi |
| 5281 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 5282 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5283 | echo "PAM is enabled. You may need to install a PAM control file " |
| 5284 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 5285 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5286 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 5287 | echo "" |
| 5288 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 5289 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5290 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 5291 | echo "WARNING: the operating system that you are using does not" |
| 5292 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 5293 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 5294 | echo "enforce security checks to prevent unauthorised connections to" |
| 5295 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 5296 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5297 | echo "" |
| 5298 | fi |
| 5299 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 5300 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 5301 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 5302 | echo "See the Solaris section in README.platform for details." |
| 5303 | fi |