Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1 | # $Id: configure.ac,v 1.583 2014/08/26 20:32:01 djm Exp $ |
Damien Miller | 4fefe24 | 2004-03-11 14:20:10 +1100 | [diff] [blame] | 2 | # |
| 3 | # Copyright (c) 1999-2004 Damien Miller |
| 4 | # |
| 5 | # Permission to use, copy, modify, and distribute this software for any |
| 6 | # purpose with or without fee is hereby granted, provided that the above |
| 7 | # copyright notice and this permission notice appear in all copies. |
| 8 | # |
| 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Damien Miller | e9cf357 | 2001-02-09 12:55:35 +1100 | [diff] [blame] | 16 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 18 | AC_REVISION($Revision: 1.583 $) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 20 | AC_LANG([C]) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 21 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 22 | AC_CONFIG_HEADER([config.h]) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 23 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 24 | AC_CANONICAL_HOST |
Damien Miller | 4df5c76 | 2001-02-28 08:14:22 +1100 | [diff] [blame] | 25 | AC_C_BIGENDIAN |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 26 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 27 | # Checks for programs. |
Darren Tucker | 167bd9c | 2003-09-07 12:34:54 +1000 | [diff] [blame] | 28 | AC_PROG_AWK |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 29 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 30 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 31 | AC_PROG_INSTALL |
Tim Rice | fd80ddc | 2006-02-02 19:11:56 -0800 | [diff] [blame] | 32 | AC_PROG_EGREP |
Darren Tucker | 6c8a246 | 2017-12-01 17:11:47 +1100 | [diff] [blame] | 33 | AC_PROG_MKDIR_P |
Darren Tucker | 408f4c2 | 2015-04-17 09:39:58 +1000 | [diff] [blame] | 34 | AC_CHECK_TOOLS([AR], [ar]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 35 | AC_PATH_PROG([CAT], [cat]) |
| 36 | AC_PATH_PROG([KILL], [kill]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 37 | AC_PATH_PROG([SED], [sed]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 38 | AC_PATH_PROG([ENT], [ent]) |
| 39 | AC_SUBST([ENT]) |
| 40 | AC_PATH_PROG([TEST_MINUS_S_SH], [bash]) |
| 41 | AC_PATH_PROG([TEST_MINUS_S_SH], [ksh]) |
| 42 | AC_PATH_PROG([TEST_MINUS_S_SH], [sh]) |
| 43 | AC_PATH_PROG([SH], [sh]) |
| 44 | AC_PATH_PROG([GROFF], [groff]) |
| 45 | AC_PATH_PROG([NROFF], [nroff]) |
| 46 | AC_PATH_PROG([MANDOC], [mandoc]) |
| 47 | AC_SUBST([TEST_SHELL], [sh]) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 48 | |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 49 | dnl select manpage formatter |
| 50 | if test "x$MANDOC" != "x" ; then |
| 51 | MANFMT="$MANDOC" |
| 52 | elif test "x$NROFF" != "x" ; then |
| 53 | MANFMT="$NROFF -mandoc" |
| 54 | elif test "x$GROFF" != "x" ; then |
| 55 | MANFMT="$GROFF -mandoc -Tascii" |
| 56 | else |
| 57 | AC_MSG_WARN([no manpage formatted found]) |
| 58 | MANFMT="false" |
| 59 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 60 | AC_SUBST([MANFMT]) |
Damien Miller | 30a69e7 | 2011-01-04 08:16:27 +1100 | [diff] [blame] | 61 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 62 | dnl for buildpkg.sh |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 63 | AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd], |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 64 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 65 | AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd], |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 66 | [/usr/sbin${PATH_SEPARATOR}/etc]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 67 | AC_CHECK_PROG([MAKE_PACKAGE_SUPPORTED], [pkgmk], [yes], [no]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 68 | if test -x /sbin/sh; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 69 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/sbin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 70 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 71 | AC_SUBST([STARTUP_SCRIPT_SHELL], [/bin/sh]) |
Darren Tucker | fbea764 | 2006-01-30 00:22:39 +1100 | [diff] [blame] | 72 | fi |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 73 | |
Damien Miller | e8bb450 | 2001-09-25 16:39:35 +1000 | [diff] [blame] | 74 | # System features |
| 75 | AC_SYS_LARGEFILE |
| 76 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 77 | if test -z "$AR" ; then |
| 78 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 79 | fi |
| 80 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 81 | AC_PATH_PROG([PATH_PASSWD_PROG], [passwd]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 82 | if test ! -z "$PATH_PASSWD_PROG" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 83 | AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 84 | [Full path of your "passwd" program]) |
Darren Tucker | 23bc8d0 | 2004-02-06 16:24:31 +1100 | [diff] [blame] | 85 | fi |
| 86 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 87 | if test -z "$LD" ; then |
| 88 | LD=$CC |
| 89 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 90 | AC_SUBST([LD]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 91 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 92 | AC_C_INLINE |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 93 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 94 | AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 95 | AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ |
| 96 | #include <sys/types.h> |
| 97 | #include <sys/param.h> |
| 98 | #include <dev/systrace.h> |
| 99 | ]) |
| 100 | AC_CHECK_DECL([RLIMIT_NPROC], |
| 101 | [AC_DEFINE([HAVE_RLIMIT_NPROC], [], [sys/resource.h has RLIMIT_NPROC])], , [ |
| 102 | #include <sys/types.h> |
| 103 | #include <sys/resource.h> |
| 104 | ]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 105 | AC_CHECK_DECL([PR_SET_NO_NEW_PRIVS], [have_linux_no_new_privs=1], , [ |
| 106 | #include <sys/types.h> |
| 107 | #include <linux/prctl.h> |
| 108 | ]) |
Damien Miller | 868ea1e | 2014-01-17 16:47:04 +1100 | [diff] [blame] | 109 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 110 | openssl=yes |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 111 | AC_ARG_WITH([openssl], |
| 112 | [ --without-openssl Disable use of OpenSSL; use only limited internal crypto **EXPERIMENTAL** ], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 113 | [ if test "x$withval" = "xno" ; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 114 | openssl=no |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 115 | fi |
| 116 | ] |
| 117 | ) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 118 | AC_MSG_CHECKING([whether OpenSSL will be used for cryptography]) |
| 119 | if test "x$openssl" = "xyes" ; then |
| 120 | AC_MSG_RESULT([yes]) |
| 121 | AC_DEFINE_UNQUOTED([WITH_OPENSSL], [1], [use libcrypto for cryptography]) |
| 122 | else |
| 123 | AC_MSG_RESULT([no]) |
| 124 | fi |
| 125 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 126 | use_stack_protector=1 |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 127 | use_toolchain_hardening=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 128 | AC_ARG_WITH([stackprotect], |
Damien Miller | da3155e | 2008-03-27 12:30:18 +1100 | [diff] [blame] | 129 | [ --without-stackprotect Don't use compiler's stack protection], [ |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 130 | if test "x$withval" = "xno"; then |
| 131 | use_stack_protector=0 |
| 132 | fi ]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 133 | AC_ARG_WITH([hardening], |
| 134 | [ --without-hardening Don't use toolchain hardening flags], [ |
| 135 | if test "x$withval" = "xno"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 136 | use_toolchain_hardening=0 |
| 137 | fi ]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 138 | |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 139 | # We use -Werror for the tests only so that we catch warnings like "this is |
| 140 | # on by default" for things like -fPIE. |
| 141 | AC_MSG_CHECKING([if $CC supports -Werror]) |
| 142 | saved_CFLAGS="$CFLAGS" |
| 143 | CFLAGS="$CFLAGS -Werror" |
| 144 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], |
| 145 | [ AC_MSG_RESULT([yes]) |
| 146 | WERROR="-Werror"], |
| 147 | [ AC_MSG_RESULT([no]) |
| 148 | WERROR="" ] |
| 149 | ) |
| 150 | CFLAGS="$saved_CFLAGS" |
Damien Miller | 134d02a | 2011-01-12 16:00:37 +1100 | [diff] [blame] | 151 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 152 | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then |
Darren Tucker | d904886 | 2017-03-31 11:04:43 +1100 | [diff] [blame] | 153 | OSSH_CHECK_CFLAG_COMPILE([-pipe]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 154 | OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) |
| 155 | OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 156 | OSSH_CHECK_CFLAG_COMPILE([-Wall]) |
| 157 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) |
| 158 | OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) |
| 159 | OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) |
| 160 | OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) |
Darren Tucker | abbc7a7 | 2013-05-10 13:54:23 +1000 | [diff] [blame] | 161 | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) |
Damien Miller | b176362 | 2011-05-20 11:45:25 +1000 | [diff] [blame] | 162 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) |
| 163 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) |
| 164 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 165 | if test "x$use_toolchain_hardening" = "x1"; then |
Damien Miller | 161af8f | 2017-09-19 10:18:56 +1000 | [diff] [blame] | 166 | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 167 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) |
| 168 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) |
| 169 | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 170 | # NB. -ftrapv expects certain support functions to be present in |
| 171 | # the compiler library (libgcc or similar) to detect integer operations |
| 172 | # that can overflow. We must check that the result of enabling it |
| 173 | # actually links. The test program compiled/linked includes a number |
| 174 | # of integer operations that should exercise this. |
| 175 | OSSH_CHECK_CFLAG_LINK([-ftrapv]) |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 176 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 177 | AC_MSG_CHECKING([gcc version]) |
Darren Tucker | 3f9545e | 2005-11-12 15:20:52 +1100 | [diff] [blame] | 178 | GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 179 | case $GCC_VER in |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 180 | 1.*) no_attrib_nonnull=1 ;; |
| 181 | 2.8* | 2.9*) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 182 | no_attrib_nonnull=1 |
| 183 | ;; |
| 184 | 2.*) no_attrib_nonnull=1 ;; |
Darren Tucker | f032435 | 2005-11-10 21:30:36 +1100 | [diff] [blame] | 185 | *) ;; |
Tim Rice | 3db1e3f | 2005-08-23 17:11:26 -0700 | [diff] [blame] | 186 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 187 | AC_MSG_RESULT([$GCC_VER]) |
Damien Miller | de3cb0a | 2005-05-26 20:48:25 +1000 | [diff] [blame] | 188 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 189 | AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 190 | saved_CFLAGS="$CFLAGS" |
| 191 | CFLAGS="$CFLAGS -fno-builtin-memset" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 192 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], |
| 193 | [[ char b[10]; memset(b, 0, sizeof(b)); ]])], |
| 194 | [ AC_MSG_RESULT([yes]) ], |
| 195 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 196 | CFLAGS="$saved_CFLAGS" ] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 197 | ) |
Darren Tucker | 330c93f | 2008-06-16 02:27:48 +1000 | [diff] [blame] | 198 | |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 199 | # -fstack-protector-all doesn't always work for some GCC versions |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 200 | # 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] | 201 | # 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] | 202 | if test "x$use_stack_protector" = "x1"; then |
Darren Tucker | fd99437 | 2014-01-17 09:53:24 +1100 | [diff] [blame] | 203 | for t in -fstack-protector-strong -fstack-protector-all \ |
| 204 | -fstack-protector; do |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 205 | AC_MSG_CHECKING([if $CC supports $t]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 206 | saved_CFLAGS="$CFLAGS" |
| 207 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 208 | CFLAGS="$CFLAGS $t -Werror" |
| 209 | LDFLAGS="$LDFLAGS $t -Werror" |
| 210 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 211 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 212 | [[ |
| 213 | char x[256]; |
| 214 | snprintf(x, sizeof(x), "XXX"); |
| 215 | ]])], |
| 216 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 217 | CFLAGS="$saved_CFLAGS $t" |
| 218 | LDFLAGS="$saved_LDFLAGS $t" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 219 | AC_MSG_CHECKING([if $t works]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 220 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 221 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 222 | [[ |
| 223 | char x[256]; |
| 224 | snprintf(x, sizeof(x), "XXX"); |
| 225 | ]])], |
| 226 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 227 | break ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 228 | [ AC_MSG_RESULT([no]) ], |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 229 | [ AC_MSG_WARN([cross compiling: cannot test]) |
| 230 | break ] |
Darren Tucker | fe1cf97 | 2008-03-09 22:50:50 +1100 | [diff] [blame] | 231 | ) |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 232 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 233 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | b7918af | 2008-03-09 11:34:23 +1100 | [diff] [blame] | 234 | ) |
| 235 | CFLAGS="$saved_CFLAGS" |
| 236 | LDFLAGS="$saved_LDFLAGS" |
| 237 | done |
| 238 | fi |
Darren Tucker | 319b3d9 | 2007-12-02 21:02:22 +1100 | [diff] [blame] | 239 | |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 240 | if test -z "$have_llong_max"; then |
| 241 | # retry LLONG_MAX with -std=gnu99, needed on some Linuxes |
| 242 | unset ac_cv_have_decl_LLONG_MAX |
| 243 | saved_CFLAGS="$CFLAGS" |
| 244 | CFLAGS="$CFLAGS -std=gnu99" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 245 | AC_CHECK_DECL([LLONG_MAX], |
Darren Tucker | 67b3703 | 2005-06-03 17:58:31 +1000 | [diff] [blame] | 246 | [have_llong_max=1], |
| 247 | [CFLAGS="$saved_CFLAGS"], |
| 248 | [#include <limits.h>] |
| 249 | ) |
| 250 | fi |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 251 | fi |
| 252 | |
Darren Tucker | 951b53b | 2013-02-08 11:50:09 +1100 | [diff] [blame] | 253 | AC_MSG_CHECKING([if compiler allows __attribute__ on return types]) |
| 254 | AC_COMPILE_IFELSE( |
| 255 | [AC_LANG_PROGRAM([[ |
| 256 | #include <stdlib.h> |
| 257 | __attribute__((__unused__)) static void foo(void){return;}]], |
| 258 | [[ exit(0); ]])], |
| 259 | [ AC_MSG_RESULT([yes]) ], |
| 260 | [ AC_MSG_RESULT([no]) |
| 261 | AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1, |
| 262 | [compiler does not accept __attribute__ on return types]) ] |
| 263 | ) |
| 264 | |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 265 | if test "x$no_attrib_nonnull" != "x1" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 266 | AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) |
Darren Tucker | 391de5c | 2007-04-29 14:49:21 +1000 | [diff] [blame] | 267 | fi |
| 268 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 269 | AC_ARG_WITH([rpath], |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 270 | [ --without-rpath Disable auto-added -R linker paths], |
| 271 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 272 | if test "x$withval" = "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 273 | need_dash_r="" |
| 274 | fi |
| 275 | if test "x$withval" = "xyes" ; then |
| 276 | need_dash_r=1 |
| 277 | fi |
| 278 | ] |
| 279 | ) |
| 280 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 281 | # Allow user to specify flags |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 282 | AC_ARG_WITH([cflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 283 | [ --with-cflags Specify additional flags to pass to compiler], |
| 284 | [ |
| 285 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 286 | test "x${withval}" != "xyes"; then |
| 287 | CFLAGS="$CFLAGS $withval" |
| 288 | fi |
| 289 | ] |
| 290 | ) |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 291 | |
| 292 | AC_ARG_WITH([cflags-after], |
| 293 | [ --with-cflags-after Specify additional flags to pass to compiler after configure], |
| 294 | [ |
| 295 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 296 | test "x${withval}" != "xyes"; then |
| 297 | CFLAGS_AFTER="$withval" |
| 298 | fi |
| 299 | ] |
| 300 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 301 | AC_ARG_WITH([cppflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 302 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
| 303 | [ |
| 304 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 305 | test "x${withval}" != "xyes"; then |
| 306 | CPPFLAGS="$CPPFLAGS $withval" |
| 307 | fi |
| 308 | ] |
| 309 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 310 | AC_ARG_WITH([ldflags], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 311 | [ --with-ldflags Specify additional flags to pass to linker], |
| 312 | [ |
| 313 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 314 | test "x${withval}" != "xyes"; then |
| 315 | LDFLAGS="$LDFLAGS $withval" |
| 316 | fi |
| 317 | ] |
| 318 | ) |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 319 | AC_ARG_WITH([ldflags-after], |
| 320 | [ --with-ldflags-after Specify additional flags to pass to linker after configure], |
| 321 | [ |
| 322 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 323 | test "x${withval}" != "xyes"; then |
| 324 | LDFLAGS_AFTER="$withval" |
| 325 | fi |
| 326 | ] |
| 327 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 328 | AC_ARG_WITH([libs], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 329 | [ --with-libs Specify additional libraries to link with], |
| 330 | [ |
| 331 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 332 | test "x${withval}" != "xyes"; then |
| 333 | LIBS="$LIBS $withval" |
| 334 | fi |
| 335 | ] |
| 336 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 337 | AC_ARG_WITH([Werror], |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 338 | [ --with-Werror Build main code with -Werror], |
| 339 | [ |
| 340 | if test -n "$withval" && test "x$withval" != "xno"; then |
| 341 | werror_flags="-Werror" |
| 342 | if test "x${withval}" != "xyes"; then |
| 343 | werror_flags="$withval" |
| 344 | fi |
| 345 | fi |
| 346 | ] |
| 347 | ) |
| 348 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 349 | AC_CHECK_HEADERS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 350 | blf.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 351 | bstring.h \ |
| 352 | crypt.h \ |
| 353 | crypto/sha2.h \ |
| 354 | dirent.h \ |
| 355 | endian.h \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 356 | elf.h \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 357 | err.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 358 | features.h \ |
| 359 | fcntl.h \ |
| 360 | floatingpoint.h \ |
| 361 | getopt.h \ |
| 362 | glob.h \ |
| 363 | ia.h \ |
| 364 | iaf.h \ |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 365 | inttypes.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 366 | langinfo.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 367 | limits.h \ |
Darren Tucker | ae133d4 | 2013-06-06 08:30:20 +1000 | [diff] [blame] | 368 | locale.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 369 | login.h \ |
| 370 | maillock.h \ |
| 371 | ndir.h \ |
| 372 | net/if_tun.h \ |
| 373 | netdb.h \ |
| 374 | netgroup.h \ |
| 375 | pam/pam_appl.h \ |
| 376 | paths.h \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 377 | poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 378 | pty.h \ |
| 379 | readpassphrase.h \ |
| 380 | rpc/types.h \ |
| 381 | security/pam_appl.h \ |
| 382 | sha2.h \ |
| 383 | shadow.h \ |
| 384 | stddef.h \ |
| 385 | stdint.h \ |
| 386 | string.h \ |
| 387 | strings.h \ |
| 388 | sys/audit.h \ |
| 389 | sys/bitypes.h \ |
| 390 | sys/bsdtty.h \ |
| 391 | sys/cdefs.h \ |
| 392 | sys/dir.h \ |
| 393 | sys/mman.h \ |
| 394 | sys/ndir.h \ |
Darren Tucker | 7c92a65 | 2007-09-27 07:00:09 +1000 | [diff] [blame] | 395 | sys/poll.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 396 | sys/prctl.h \ |
| 397 | sys/pstat.h \ |
Darren Tucker | 5ee3fb5 | 2016-11-01 08:12:33 +1100 | [diff] [blame] | 398 | sys/ptrace.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 399 | sys/select.h \ |
| 400 | sys/stat.h \ |
| 401 | sys/stream.h \ |
| 402 | sys/stropts.h \ |
| 403 | sys/strtio.h \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 404 | sys/statvfs.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 405 | sys/sysmacros.h \ |
| 406 | sys/time.h \ |
| 407 | sys/timers.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 408 | time.h \ |
| 409 | tmpdir.h \ |
| 410 | ttyent.h \ |
Tim Rice | aa8954f | 2007-05-09 15:57:43 -0700 | [diff] [blame] | 411 | ucred.h \ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 412 | unistd.h \ |
| 413 | usersec.h \ |
| 414 | util.h \ |
| 415 | utime.h \ |
| 416 | utmp.h \ |
| 417 | utmpx.h \ |
| 418 | vis.h \ |
Darren Tucker | f3f2cc8 | 2016-07-11 17:23:38 +1000 | [diff] [blame] | 419 | wchar.h \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 420 | ]) |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 421 | |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 422 | # sys/capsicum.h requires sys/types.h |
| 423 | AC_CHECK_HEADERS([sys/capsicum.h], [], [], [ |
| 424 | #ifdef HAVE_SYS_TYPES_H |
| 425 | # include <sys/types.h> |
| 426 | #endif |
| 427 | ]) |
| 428 | |
Darren Tucker | fa1b834 | 2017-11-03 14:09:45 +1100 | [diff] [blame] | 429 | # net/route.h requires sys/socket.h and sys/types.h. |
| 430 | # sys/sysctl.h also requires sys/param.h |
| 431 | AC_CHECK_HEADERS([net/route.h sys/sysctl.h], [], [], [ |
| 432 | #ifdef HAVE_SYS_TYPES_H |
| 433 | # include <sys/types.h> |
| 434 | #endif |
| 435 | #include <sys/param.h> |
Damien Miller | 3235473 | 2017-10-25 11:25:43 +1100 | [diff] [blame] | 436 | #include <sys/socket.h> |
| 437 | ]) |
| 438 | |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 439 | # lastlog.h requires sys/time.h to be included first on Solaris |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 440 | AC_CHECK_HEADERS([lastlog.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 441 | #ifdef HAVE_SYS_TIME_H |
| 442 | # include <sys/time.h> |
| 443 | #endif |
| 444 | ]) |
| 445 | |
| 446 | # 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] | 447 | AC_CHECK_HEADERS([sys/ptms.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 448 | #ifdef HAVE_SYS_STREAM_H |
| 449 | # include <sys/stream.h> |
| 450 | #endif |
| 451 | ]) |
| 452 | |
| 453 | # login_cap.h requires sys/types.h on NetBSD |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 454 | AC_CHECK_HEADERS([login_cap.h], [], [], [ |
Tim Rice | 1cfab23 | 2006-10-03 09:34:35 -0700 | [diff] [blame] | 455 | #include <sys/types.h> |
| 456 | ]) |
| 457 | |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 458 | # older BSDs need sys/param.h before sys/mount.h |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 459 | AC_CHECK_HEADERS([sys/mount.h], [], [], [ |
Darren Tucker | c4b22ca | 2009-07-12 21:56:29 +1000 | [diff] [blame] | 460 | #include <sys/param.h> |
| 461 | ]) |
| 462 | |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 463 | # Android requires sys/socket.h to be included before sys/un.h |
| 464 | AC_CHECK_HEADERS([sys/un.h], [], [], [ |
Darren Tucker | 0b43ffe | 2013-06-03 09:30:44 +1000 | [diff] [blame] | 465 | #include <sys/types.h> |
Darren Tucker | 16cac19 | 2013-06-04 12:55:24 +1000 | [diff] [blame] | 466 | #include <sys/socket.h> |
Darren Tucker | ef4901c | 2013-06-03 01:59:13 +1000 | [diff] [blame] | 467 | ]) |
| 468 | |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 469 | # Messages for features tested for in target-specific section |
| 470 | SIA_MSG="no" |
| 471 | SPC_MSG="no" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 472 | SP_MSG="no" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 473 | SPP_MSG="no" |
| 474 | |
| 475 | # Support for Solaris/Illumos privileges (this test is used by both |
| 476 | # the --with-solaris-privs option and --with-sandbox=solaris). |
| 477 | SOLARIS_PRIVS="no" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 478 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 479 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 480 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 481 | *-*-aix*) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 482 | # Some versions of VAC won't allow macro redefinitions at |
| 483 | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that |
| 484 | # particularly with older versions of vac or xlc. |
| 485 | # It also throws errors about null macro argments, but these are |
| 486 | # not fatal. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 487 | AC_MSG_CHECKING([if compiler allows macro redefinitions]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 488 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 489 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 490 | #define testmacro foo |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 491 | #define testmacro bar]], |
| 492 | [[ exit(0); ]])], |
| 493 | [ AC_MSG_RESULT([yes]) ], |
| 494 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 9216c37 | 2006-09-18 23:17:40 +1000 | [diff] [blame] | 495 | CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" |
| 496 | LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" |
| 497 | CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 498 | CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" |
| 499 | ] |
| 500 | ) |
| 501 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 502 | AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 503 | if (test -z "$blibpath"); then |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 504 | blibpath="/usr/lib:/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 505 | fi |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 506 | saved_LDFLAGS="$LDFLAGS" |
Darren Tucker | bdc1212 | 2006-07-06 11:56:25 +1000 | [diff] [blame] | 507 | if test "$GCC" = "yes"; then |
| 508 | flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:" |
| 509 | else |
| 510 | flags="-blibpath: -Wl,-blibpath: -Wl,-rpath," |
| 511 | fi |
| 512 | for tryflags in $flags ;do |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 513 | if (test -z "$blibflags"); then |
| 514 | LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 515 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], |
| 516 | [blibflags=$tryflags], []) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 517 | fi |
| 518 | done |
| 519 | if (test -z "$blibflags"); then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 520 | AC_MSG_RESULT([not found]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 521 | AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) |
| 522 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 523 | AC_MSG_RESULT([$blibflags]) |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 524 | fi |
| 525 | LDFLAGS="$saved_LDFLAGS" |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 526 | dnl Check for authenticate. Might be in libs.a on older AIXes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 527 | AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 528 | [Define if you want to enable AIX4's authenticate function])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 529 | [AC_CHECK_LIB([s], [authenticate], |
| 530 | [ AC_DEFINE([WITH_AIXAUTHENTICATE]) |
Tim Rice | e958ed3 | 2002-07-05 07:12:33 -0700 | [diff] [blame] | 531 | LIBS="$LIBS -ls" |
| 532 | ]) |
| 533 | ]) |
Darren Tucker | 3c774c5 | 2005-02-16 22:49:31 +1100 | [diff] [blame] | 534 | dnl Check for various auth function declarations in headers. |
Darren Tucker | 04cfbe0 | 2005-02-20 23:27:11 +1100 | [diff] [blame] | 535 | AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, |
Darren Tucker | e66519d | 2005-03-21 22:46:34 +1100 | [diff] [blame] | 536 | passwdexpired, setauthdb], , , [#include <usersec.h>]) |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 537 | 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] | 538 | AC_CHECK_DECLS([loginfailed], |
| 539 | [AC_MSG_CHECKING([if loginfailed takes 4 arguments]) |
| 540 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]], |
| 541 | [[ (void)loginfailed("user","host","tty",0); ]])], |
| 542 | [AC_MSG_RESULT([yes]) |
| 543 | AC_DEFINE([AIX_LOGINFAILED_4ARG], [1], |
| 544 | [Define if your AIX loginfailed() function |
| 545 | takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no]) |
| 546 | ])], |
| 547 | [], |
| 548 | [#include <usersec.h>] |
Darren Tucker | 5c6a91a | 2003-07-14 16:21:44 +1000 | [diff] [blame] | 549 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 550 | AC_CHECK_FUNCS([getgrset setauthdb]) |
| 551 | AC_CHECK_DECL([F_CLOSEM], |
| 552 | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), |
Darren Tucker | 3083bc2 | 2006-08-17 19:35:49 +1000 | [diff] [blame] | 553 | [], |
| 554 | [ #include <limits.h> |
| 555 | #include <fcntl.h> ] |
| 556 | ) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 557 | check_for_aix_broken_getaddrinfo=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 558 | AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) |
| 559 | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 560 | [Define if your platform breaks doing a seteuid before a setuid]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 561 | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) |
| 562 | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 563 | dnl AIX handles lastlog as part of its login message |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 564 | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) |
| 565 | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 566 | [Some systems need a utmpx entry for /bin/login to work]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 567 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 568 | [Define to a Set Process Title type if your system is |
| 569 | supported by bsd-setproctitle.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 570 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Darren Tucker | 91d25a0 | 2005-11-26 22:24:09 +1100 | [diff] [blame] | 571 | [AIX 5.2 and 5.3 (and presumably newer) require this]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 572 | 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] | 573 | AC_DEFINE([PLATFORM_SYS_DIR_UID], 2, [System dirs owned by bin (uid 2)]) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 574 | ;; |
Darren Tucker | 898ac93 | 2013-06-03 02:03:25 +1000 | [diff] [blame] | 575 | *-*-android*) |
| 576 | AC_DEFINE([DISABLE_UTMP], [1], [Define if you don't want to use utmp]) |
| 577 | AC_DEFINE([DISABLE_WTMP], [1], [Define if you don't want to use wtmp]) |
| 578 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 579 | *-*-cygwin*) |
Damien Miller | c8936ac | 2003-02-11 10:04:03 +1100 | [diff] [blame] | 580 | check_for_libcrypt_later=1 |
Darren Tucker | 573e387 | 2007-03-02 17:50:03 +1100 | [diff] [blame] | 581 | LIBS="$LIBS /usr/lib/textreadmode.o" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 582 | AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin]) |
| 583 | AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 584 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 585 | [Define to disable UID restoration test]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 586 | AC_DEFINE([DISABLE_SHADOW], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 587 | [Define if you want to disable shadow passwords]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 588 | AC_DEFINE([NO_X11_UNIX_SOCKETS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 589 | [Define if X11 doesn't support AF_UNIX sockets on that system]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 590 | AC_DEFINE([DISABLE_FD_PASSING], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 591 | [Define if your platform needs to skip post auth |
| 592 | file descriptor passing]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 593 | AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) |
Darren Tucker | fdce373 | 2014-01-18 21:12:42 +1100 | [diff] [blame] | 594 | AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) |
| 595 | # Cygwin defines optargs, optargs as declspec(dllimport) for historical |
| 596 | # reasons which cause compile warnings, so we disable those warnings. |
| 597 | OSSH_CHECK_CFLAG_COMPILE([-Wno-attributes]) |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 598 | ;; |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 599 | *-*-dgux*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 600 | AC_DEFINE([IP_TOS_IS_BROKEN], [1], |
Tim Rice | a74000e | 2009-03-18 11:25:02 -0700 | [diff] [blame] | 601 | [Define if your system choked on IP TOS setting]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 602 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 603 | AC_DEFINE([BROKEN_SETREUID]) |
| 604 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 5805513 | 2001-02-15 18:34:29 +0000 | [diff] [blame] | 605 | ;; |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 606 | *-*-darwin*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 607 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 608 | AC_MSG_CHECKING([if we have working getaddrinfo]) |
| 609 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 610 | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) |
| 611 | exit(0); |
| 612 | else |
| 613 | exit(1); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 614 | } |
| 615 | ]])], |
| 616 | [AC_MSG_RESULT([working])], |
| 617 | [AC_MSG_RESULT([buggy]) |
| 618 | AC_DEFINE([BROKEN_GETADDRINFO], [1], |
| 619 | [getaddrinfo is broken (if present)]) |
| 620 | ], |
| 621 | [AC_MSG_RESULT([assume it is working])]) |
| 622 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 623 | AC_DEFINE([BROKEN_SETREUID]) |
| 624 | AC_DEFINE([BROKEN_SETREGID]) |
| 625 | AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect]) |
| 626 | AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 627 | [Define if your resolver libs need this for getrrsetbyname]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 628 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
| 629 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 630 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 631 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Darren Tucker | 3eb4834 | 2006-06-23 21:05:12 +1000 | [diff] [blame] | 632 | [Prepend the address family to IP tunnel traffic]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 633 | m4_pattern_allow([AU_IPv]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 634 | AC_CHECK_DECL([AU_IPv4], [], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 635 | AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 636 | [#include <bsm/audit.h>] |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 637 | AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1], |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 638 | [Define if pututxline updates lastlog too]) |
Darren Tucker | acada07 | 2008-02-25 21:05:04 +1100 | [diff] [blame] | 639 | ) |
Damien Miller | c09182f | 2011-06-03 12:11:38 +1000 | [diff] [blame] | 640 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], |
| 641 | [Define to a Set Process Title type if your system is |
| 642 | supported by bsd-setproctitle.c]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 643 | AC_CHECK_FUNCS([sandbox_init]) |
| 644 | AC_CHECK_HEADERS([sandbox.h]) |
Damien Miller | 39f303b | 2016-02-23 12:56:59 +1100 | [diff] [blame] | 645 | AC_CHECK_LIB([sandbox], [sandbox_apply], [ |
| 646 | SSHDLIBS="$SSHDLIBS -lsandbox" |
| 647 | ]) |
Ben Lindstrom | fed7bb4 | 2001-07-15 18:30:42 +0000 | [diff] [blame] | 648 | ;; |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 649 | *-*-dragonfly*) |
| 650 | SSHDLIBS="$SSHDLIBS -lcrypt" |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 651 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 57b2920 | 2006-09-10 20:25:51 +1000 | [diff] [blame] | 652 | ;; |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 653 | *-*-haiku*) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 654 | LIBS="$LIBS -lbsd " |
| 655 | AC_CHECK_LIB([network], [socket]) |
| 656 | AC_DEFINE([HAVE_U_INT64_T]) |
| 657 | MANTYPE=man |
| 658 | ;; |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 659 | *-*-hpux*) |
| 660 | # 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] | 661 | 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] | 662 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 663 | AC_DEFINE([USE_PIPES]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 664 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
| 665 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 666 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 667 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
Darren Tucker | aa97d13 | 2013-03-12 11:31:05 +1100 | [diff] [blame] | 668 | 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] | 669 | maildir="/var/mail" |
Tim Rice | f028f1e | 2002-07-19 12:41:10 -0700 | [diff] [blame] | 670 | LIBS="$LIBS -lsec" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 671 | AC_CHECK_LIB([xnet], [t_error], , |
| 672 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 673 | |
| 674 | # next, we define all of the options specific to major releases |
| 675 | case "$host" in |
| 676 | *-*-hpux10*) |
| 677 | if test -z "$GCC"; then |
| 678 | CFLAGS="$CFLAGS -Ae" |
| 679 | fi |
| 680 | ;; |
| 681 | *-*-hpux11*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 682 | AC_DEFINE([PAM_SUN_CODEBASE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 683 | [Define if you are using Solaris-derived PAM which |
| 684 | passes pam_messages to the conversation function |
| 685 | with an extra level of indirection]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 686 | AC_DEFINE([DISABLE_UTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 687 | [Define if you don't want to use utmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 688 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 689 | check_for_hpux_broken_getaddrinfo=1 |
| 690 | check_for_conflicting_getspnam=1 |
| 691 | ;; |
| 692 | esac |
| 693 | |
| 694 | # lastly, we define options specific to minor releases |
| 695 | case "$host" in |
| 696 | *-*-hpux10.26) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 697 | AC_DEFINE([HAVE_SECUREWARE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 698 | [Define if you have SecureWare-based |
| 699 | protected password database]) |
Darren Tucker | fd33328 | 2005-05-28 18:31:42 +1000 | [diff] [blame] | 700 | disable_ptmx_check=yes |
| 701 | LIBS="$LIBS -lsecpw" |
| 702 | ;; |
| 703 | esac |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 704 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 705 | *-*-irix5*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 706 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 707 | AC_DEFINE([BROKEN_INET_NTOA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 708 | [Define if you system's inet_ntoa is busted |
| 709 | (e.g. Irix gcc issue)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 710 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 711 | AC_DEFINE([BROKEN_SETREUID]) |
| 712 | AC_DEFINE([BROKEN_SETREGID]) |
| 713 | AC_DEFINE([WITH_ABBREV_NO_TTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 714 | [Define if you shouldn't strip 'tty' from your |
| 715 | ttyname in [uw]tmp]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 716 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 717 | ;; |
| 718 | *-*-irix6*) |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 719 | PATH="$PATH:/usr/etc" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 720 | AC_DEFINE([WITH_IRIX_ARRAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 721 | [Define if you have/want arrays |
| 722 | (cluster-wide session managment, not C arrays)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 723 | AC_DEFINE([WITH_IRIX_PROJECT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 724 | [Define if you want IRIX project management]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 725 | AC_DEFINE([WITH_IRIX_AUDIT], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 726 | [Define if you want IRIX audit trails]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 727 | AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 728 | [Define if you want IRIX kernel jobs])]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 729 | AC_DEFINE([BROKEN_INET_NTOA]) |
| 730 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 731 | AC_DEFINE([BROKEN_SETREUID]) |
| 732 | AC_DEFINE([BROKEN_SETREGID]) |
| 733 | AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)]) |
| 734 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 735 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 736 | ;; |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 737 | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) |
| 738 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 739 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 740 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"]) |
| 741 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 742 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 743 | AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins]) |
Damien Miller | 9055172 | 2009-02-16 15:37:03 +1100 | [diff] [blame] | 744 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 745 | *-*-linux*) |
| 746 | no_dev_ptmx=1 |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 747 | use_pie=auto |
Damien Miller | a64b57a | 2001-01-17 10:44:13 +1100 | [diff] [blame] | 748 | check_for_libcrypt_later=1 |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 749 | check_for_openpty_ctty_bug=1 |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 750 | dnl Target SUSv3/POSIX.1-2001 plus BSD specifics. |
| 751 | dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE |
| 752 | CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 753 | AC_DEFINE([PAM_TTY_KLUDGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 754 | [Work around problematic Linux PAM modules handling of PAM_TTY]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 755 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 756 | [String used in /etc/passwd to denote locked account]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 757 | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) |
| 758 | AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 759 | [Define to whatever link() returns for "not supported" |
| 760 | if it doesn't return EOPNOTSUPP.]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 761 | AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts]) |
| 762 | AC_DEFINE([USE_BTMP]) |
| 763 | AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 764 | inet6_default_4in6=yes |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 765 | case `uname -r` in |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 766 | 1.*|2.0.*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 767 | AC_DEFINE([BROKEN_CMSG_TYPE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 768 | [Define if cmsg_type is not passed correctly]) |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 769 | ;; |
Darren Tucker | 3c01654 | 2003-05-02 20:48:21 +1000 | [diff] [blame] | 770 | esac |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 771 | # tun(4) forwarding compat code |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 772 | AC_CHECK_HEADERS([linux/if_tun.h]) |
Damien Miller | bd4e410 | 2006-01-01 21:03:30 +1100 | [diff] [blame] | 773 | if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 774 | AC_DEFINE([SSH_TUN_LINUX], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 775 | [Open tunnel devices the Linux tun/tap way]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 776 | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 777 | [Use tunnel device compatibility to OpenBSD]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 778 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 89e03ba | 2005-12-31 16:42:03 +1100 | [diff] [blame] | 779 | [Prepend the address family to IP tunnel traffic]) |
| 780 | fi |
Darren Tucker | 81c9ccd | 2017-11-03 14:52:51 +1100 | [diff] [blame] | 781 | AC_CHECK_HEADER([linux/if.h], |
| 782 | AC_DEFINE([SYS_RDOMAIN_LINUX], [1], |
| 783 | [Support routing domains using Linux VRF])) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 784 | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], |
| 785 | [], [#include <linux/types.h>]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 786 | AC_MSG_CHECKING([for seccomp architecture]) |
| 787 | seccomp_audit_arch= |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 788 | case "$host" in |
| 789 | x86_64-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 790 | seccomp_audit_arch=AUDIT_ARCH_X86_64 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 791 | ;; |
| 792 | i*86-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 793 | seccomp_audit_arch=AUDIT_ARCH_I386 |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 794 | ;; |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 795 | arm*-*) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 796 | seccomp_audit_arch=AUDIT_ARCH_ARM |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 797 | ;; |
| 798 | aarch64*-*) |
| 799 | seccomp_audit_arch=AUDIT_ARCH_AARCH64 |
Damien Miller | 5c15e22 | 2015-06-18 15:07:56 +1000 | [diff] [blame] | 800 | ;; |
Damien Miller | b9c5061 | 2016-07-08 13:59:13 +1000 | [diff] [blame] | 801 | s390x-*) |
| 802 | seccomp_audit_arch=AUDIT_ARCH_S390X |
| 803 | ;; |
| 804 | s390-*) |
| 805 | seccomp_audit_arch=AUDIT_ARCH_S390 |
| 806 | ;; |
| 807 | powerpc64-*) |
| 808 | seccomp_audit_arch=AUDIT_ARCH_PPC64 |
| 809 | ;; |
| 810 | powerpc64le-*) |
| 811 | seccomp_audit_arch=AUDIT_ARCH_PPC64LE |
| 812 | ;; |
| 813 | mips-*) |
| 814 | seccomp_audit_arch=AUDIT_ARCH_MIPS |
| 815 | ;; |
| 816 | mipsel-*) |
| 817 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL |
| 818 | ;; |
| 819 | mips64-*) |
| 820 | seccomp_audit_arch=AUDIT_ARCH_MIPS64 |
| 821 | ;; |
| 822 | mips64el-*) |
| 823 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64 |
| 824 | ;; |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 825 | esac |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 826 | if test "x$seccomp_audit_arch" != "x" ; then |
| 827 | AC_MSG_RESULT(["$seccomp_audit_arch"]) |
Damien Miller | 99f33d7 | 2015-06-17 10:50:51 +1000 | [diff] [blame] | 828 | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], |
| 829 | [Specify the system call convention in use]) |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 830 | else |
| 831 | AC_MSG_RESULT([architecture not supported]) |
| 832 | fi |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 833 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 834 | mips-sony-bsd|mips-sony-newsos4) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 835 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty]) |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 836 | SONY=1 |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 837 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 838 | *-*-netbsd*) |
Damien Miller | fc93d4b | 2002-09-04 23:26:29 +1000 | [diff] [blame] | 839 | check_for_libcrypt_before=1 |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 840 | if test "x$withval" != "xno" ; then |
Tim Rice | 88368a3 | 2003-12-08 12:35:59 -0800 | [diff] [blame] | 841 | need_dash_r=1 |
| 842 | fi |
Damien Miller | 99522ba | 2016-07-28 08:54:27 +1000 | [diff] [blame] | 843 | CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 844 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 845 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 846 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 847 | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 848 | [Prepend the address family to IP tunnel traffic]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 849 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | f5bbd3b | 2014-01-30 11:26:46 +1100 | [diff] [blame] | 850 | AC_DEFINE([BROKEN_READ_COMPARISON], [1], |
| 851 | [NetBSD read function is sometimes redirected, breaking atomicio comparisons against it]) |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 852 | ;; |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 853 | *-*-freebsd*) |
| 854 | check_for_libcrypt_later=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 855 | AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)]) |
| 856 | AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way]) |
Damien Miller | 2dcddbf | 2006-01-01 19:47:05 +1100 | [diff] [blame] | 857 | AC_CHECK_HEADER([net/if_tap.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 858 | AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) |
| 859 | 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] | 860 | TEST_MALLOC_OPTIONS="AJRX" |
Damien Miller | 2035b22 | 2014-01-26 09:39:53 +1100 | [diff] [blame] | 861 | # Preauth crypto occasionally uses file descriptors for crypto offload |
| 862 | # and will crash if they cannot be opened. |
Damien Miller | 5b447c0 | 2014-01-26 09:46:53 +1100 | [diff] [blame] | 863 | AC_DEFINE([SANDBOX_SKIP_RLIMIT_NOFILE], [1], |
Tim Rice | 03ae081 | 2014-02-21 09:09:34 -0800 | [diff] [blame] | 864 | [define if setrlimit RLIMIT_NOFILE breaks things]) |
Damien Miller | fbd884a | 2001-02-27 08:39:07 +1100 | [diff] [blame] | 865 | ;; |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 866 | *-*-bsdi*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 867 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 868 | AC_DEFINE([BROKEN_SETREUID]) |
| 869 | AC_DEFINE([BROKEN_SETREGID]) |
Darren Tucker | ed9eb02 | 2003-09-22 11:18:47 +1000 | [diff] [blame] | 870 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 871 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 872 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 873 | conf_utmp_location=/etc/utmp |
| 874 | conf_wtmp_location=/usr/adm/wtmp |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 875 | maildir=/usr/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 876 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
| 877 | AC_DEFINE([BROKEN_REALPATH]) |
| 878 | AC_DEFINE([USE_PIPES]) |
| 879 | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 880 | ;; |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 881 | *-*-openbsd*) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 882 | use_pie=auto |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 883 | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) |
| 884 | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) |
| 885 | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) |
| 886 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
Damien Miller | bb59814 | 2006-08-19 08:38:23 +1000 | [diff] [blame] | 887 | [syslog_r function is safe to use in in a signal handler]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 888 | TEST_MALLOC_OPTIONS="AFGJPRX" |
Darren Tucker | 4a42257 | 2005-07-14 17:22:11 +1000 | [diff] [blame] | 889 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 890 | *-*-solaris*) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 891 | if test "x$withval" != "xno" ; then |
Tim Rice | ad4a188 | 2004-02-29 15:53:37 -0800 | [diff] [blame] | 892 | need_dash_r=1 |
| 893 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 894 | AC_DEFINE([PAM_SUN_CODEBASE]) |
| 895 | AC_DEFINE([LOGIN_NEEDS_UTMPX]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 896 | AC_DEFINE([PAM_TTY_KLUDGE]) |
| 897 | AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 898 | [Define if pam_chauthtok wants real uid set |
| 899 | to the unpriv'ed user]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 900 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Darren Tucker | c437cda | 2003-05-10 17:05:46 +1000 | [diff] [blame] | 901 | # Pushing STREAMS modules will cause sshd to acquire a controlling tty. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 902 | AC_DEFINE([SSHD_ACQUIRES_CTTY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 903 | [Define if sshd somehow reacquires a controlling TTY |
| 904 | after setsid()]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 905 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd |
Darren Tucker | 0249f93 | 2006-06-24 12:10:07 +1000 | [diff] [blame] | 906 | in case the name is longer than 8 chars]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 907 | AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 908 | external_path_file=/etc/default/login |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 909 | # hardwire lastlog location (can't detect it on some versions) |
| 910 | conf_lastlog_location="/var/adm/lastlog" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 911 | AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 912 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 913 | if test "$sol2ver" -ge 8; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 914 | AC_MSG_RESULT([yes]) |
| 915 | AC_DEFINE([DISABLE_UTMP]) |
| 916 | AC_DEFINE([DISABLE_WTMP], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 917 | [Define if you don't want to use wtmp]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 918 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 919 | AC_MSG_RESULT([no]) |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 920 | fi |
Darren Tucker | a86ec4d | 2016-06-14 10:48:27 +1000 | [diff] [blame] | 921 | AC_CHECK_FUNCS([setpflags]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 922 | AC_CHECK_FUNCS([setppriv]) |
| 923 | AC_CHECK_FUNCS([priv_basicset]) |
| 924 | AC_CHECK_HEADERS([priv.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 925 | AC_ARG_WITH([solaris-contracts], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 926 | [ --with-solaris-contracts Enable Solaris process contracts (experimental)], |
| 927 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 928 | AC_CHECK_LIB([contract], [ct_tmpl_activate], |
| 929 | [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1], |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 930 | [Define if you have Solaris process contracts]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 931 | LIBS="$LIBS -lcontract" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 932 | SPC_MSG="yes" ], ) |
| 933 | ], |
| 934 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 935 | AC_ARG_WITH([solaris-projects], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 936 | [ --with-solaris-projects Enable Solaris projects (experimental)], |
| 937 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 938 | AC_CHECK_LIB([project], [setproject], |
| 939 | [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1], |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 940 | [Define if you have Solaris projects]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 941 | LIBS="$LIBS -lproject" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 942 | SP_MSG="yes" ], ) |
| 943 | ], |
| 944 | ) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 945 | AC_ARG_WITH([solaris-privs], |
| 946 | [ --with-solaris-privs Enable Solaris/Illumos privileges (experimental)], |
| 947 | [ |
| 948 | AC_MSG_CHECKING([for Solaris/Illumos privilege support]) |
Darren Tucker | 907091a | 2016-02-19 09:05:39 +1100 | [diff] [blame] | 949 | if test "x$ac_cv_func_setppriv" = "xyes" -a \ |
| 950 | "x$ac_cv_header_priv_h" = "xyes" ; then |
| 951 | SOLARIS_PRIVS=yes |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 952 | AC_MSG_RESULT([found]) |
| 953 | AC_DEFINE([NO_UID_RESTORATION_TEST], [1], |
| 954 | [Define to disable UID restoration test]) |
| 955 | AC_DEFINE([USE_SOLARIS_PRIVS], [1], |
| 956 | [Define if you have Solaris privileges]) |
| 957 | SPP_MSG="yes" |
| 958 | else |
| 959 | AC_MSG_RESULT([not found]) |
| 960 | AC_MSG_ERROR([*** must have support for Solaris privileges to use --with-solaris-privs]) |
| 961 | fi |
| 962 | ], |
| 963 | ) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 964 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 965 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 966 | *-*-sunos4*) |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 967 | CPPFLAGS="$CPPFLAGS -DSUNOS4" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 968 | AC_CHECK_FUNCS([getpwanam]) |
| 969 | AC_DEFINE([PAM_SUN_CODEBASE]) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 970 | conf_utmp_location=/etc/utmp |
| 971 | conf_wtmp_location=/var/adm/wtmp |
| 972 | conf_lastlog_location=/var/adm/lastlog |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 973 | AC_DEFINE([USE_PIPES]) |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 974 | ;; |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 975 | *-ncr-sysv*) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 976 | LIBS="$LIBS -lc89" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 977 | AC_DEFINE([USE_PIPES]) |
| 978 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 979 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 980 | AC_DEFINE([BROKEN_SETREUID]) |
| 981 | AC_DEFINE([BROKEN_SETREGID]) |
Ben Lindstrom | 603bdfd | 2001-02-12 07:29:45 +0000 | [diff] [blame] | 982 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 983 | *-sni-sysv*) |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 984 | # /usr/ucblib MUST NOT be searched on ReliantUNIX |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 985 | AC_CHECK_LIB([dl], [dlsym], ,) |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 986 | # -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] | 987 | AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ]) |
Damien Miller | fd9885e | 2001-01-10 08:16:53 +1100 | [diff] [blame] | 988 | IPADDR_IN_DISPLAY=yes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 989 | AC_DEFINE([USE_PIPES]) |
| 990 | AC_DEFINE([IP_TOS_IS_BROKEN]) |
| 991 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 992 | AC_DEFINE([BROKEN_SETREUID]) |
| 993 | AC_DEFINE([BROKEN_SETREGID]) |
| 994 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 995 | external_path_file=/etc/default/login |
Tim Rice | ffdf4aa | 2001-10-27 10:45:36 -0700 | [diff] [blame] | 996 | # /usr/ucblib/libucb.a no longer needed on ReliantUNIX |
| 997 | # Attention: always take care to bind libsocket and libnsl before libc, |
| 998 | # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 999 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1000 | # 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] | 1001 | *-*-sysv4.2*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1002 | AC_DEFINE([USE_PIPES]) |
| 1003 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1004 | AC_DEFINE([BROKEN_SETREUID]) |
| 1005 | AC_DEFINE([BROKEN_SETREGID]) |
| 1006 | AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) |
| 1007 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1008 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1009 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1010 | # UnixWare 7.x, OpenUNIX 8 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1011 | *-*-sysv5*) |
Tim Rice | 641ebf1 | 2010-01-17 17:05:39 -0800 | [diff] [blame] | 1012 | CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1013 | AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars]) |
| 1014 | AC_DEFINE([USE_PIPES]) |
| 1015 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1016 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1017 | AC_DEFINE([BROKEN_SETREUID]) |
| 1018 | AC_DEFINE([BROKEN_SETREGID]) |
| 1019 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
Tim Rice | 8433d51 | 2017-07-11 18:47:56 -0700 | [diff] [blame] | 1020 | AC_DEFINE([BROKEN_TCGETATTR_ICANON]) |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1021 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1022 | case "$host" in |
| 1023 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 1024 | maildir=/var/spool/mail |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1025 | AC_DEFINE([BROKEN_LIBIAF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1026 | [ia_uinfo routines not supported by OS yet]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1027 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1028 | AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot" |
| 1029 | AC_CHECK_FUNCS([getluid setluid], , , [-lprot]) |
| 1030 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1031 | AC_DEFINE([DISABLE_SHADOW]) |
| 1032 | ], , ) |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1033 | ;; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1034 | *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) |
Tim Rice | 2676791 | 2009-01-07 20:50:08 -0800 | [diff] [blame] | 1035 | check_for_libcrypt_later=1 |
Tim Rice | 46259d8 | 2005-11-28 18:40:34 -0800 | [diff] [blame] | 1036 | ;; |
Tim Rice | 4dbacff | 2005-06-01 20:09:28 -0700 | [diff] [blame] | 1037 | esac |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1038 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1039 | *-*-sysv*) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 1040 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1041 | # SCO UNIX and OEM versions of SCO UNIX |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1042 | *-*-sco3.2v4*) |
Tim Rice | c390c8d | 2005-03-07 01:21:37 -0800 | [diff] [blame] | 1043 | AC_MSG_ERROR("This Platform is no longer supported.") |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1044 | ;; |
Tim Rice | 0f83d29 | 2004-12-08 18:29:58 -0800 | [diff] [blame] | 1045 | # SCO OpenServer 5.x |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1046 | *-*-sco3.2v5*) |
Tim Rice | 89fe3f3 | 2003-01-19 20:20:24 -0800 | [diff] [blame] | 1047 | if test -z "$GCC"; then |
| 1048 | CFLAGS="$CFLAGS -belf" |
| 1049 | fi |
Damien Miller | 5dfe976 | 2001-02-16 12:05:39 +1100 | [diff] [blame] | 1050 | LIBS="$LIBS -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1051 | no_dev_ptmx=1 |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1052 | AC_DEFINE([USE_PIPES]) |
| 1053 | AC_DEFINE([HAVE_SECUREWARE]) |
| 1054 | AC_DEFINE([DISABLE_SHADOW]) |
| 1055 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1056 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1057 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1058 | AC_DEFINE([BROKEN_SETREUID]) |
| 1059 | AC_DEFINE([BROKEN_SETREGID]) |
| 1060 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1061 | AC_DEFINE([BROKEN_UPDWTMPX]) |
| 1062 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
| 1063 | AC_CHECK_FUNCS([getluid setluid]) |
Tim Rice | 07183b8 | 2001-04-25 21:40:28 -0700 | [diff] [blame] | 1064 | MANTYPE=man |
Tim Rice | 5ab9b63 | 2013-06-02 14:05:48 -0700 | [diff] [blame] | 1065 | TEST_SHELL=$SHELL # let configure find us a capable shell |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 1066 | SKIP_DISABLE_LASTLOG_DEFINE=yes |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 1067 | ;; |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1068 | *-*-unicosmk*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1069 | AC_DEFINE([NO_SSH_LASTLOG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1070 | [Define if you don't want to use lastlog in session.c]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1071 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1072 | AC_DEFINE([BROKEN_SETREUID]) |
| 1073 | AC_DEFINE([BROKEN_SETREGID]) |
| 1074 | AC_DEFINE([USE_PIPES]) |
| 1075 | AC_DEFINE([DISABLE_FD_PASSING]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1076 | LDFLAGS="$LDFLAGS" |
| 1077 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1078 | MANTYPE=cat |
Ben Lindstrom | 762104e | 2002-07-23 00:00:05 +0000 | [diff] [blame] | 1079 | ;; |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1080 | *-*-unicosmp*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1081 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1082 | AC_DEFINE([BROKEN_SETREUID]) |
| 1083 | AC_DEFINE([BROKEN_SETREGID]) |
| 1084 | AC_DEFINE([WITH_ABBREV_NO_TTY]) |
| 1085 | AC_DEFINE([USE_PIPES]) |
| 1086 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1087 | LDFLAGS="$LDFLAGS" |
Darren Tucker | 2df3343 | 2004-01-30 14:34:21 +1100 | [diff] [blame] | 1088 | LIBS="$LIBS -lgen -lacid -ldb" |
Darren Tucker | 9f7ffc5 | 2003-09-10 11:39:05 +1000 | [diff] [blame] | 1089 | MANTYPE=cat |
| 1090 | ;; |
Ben Lindstrom | d9e0824 | 2001-07-22 19:32:00 +0000 | [diff] [blame] | 1091 | *-*-unicos*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1092 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1093 | AC_DEFINE([BROKEN_SETREUID]) |
| 1094 | AC_DEFINE([BROKEN_SETREGID]) |
| 1095 | AC_DEFINE([USE_PIPES]) |
| 1096 | AC_DEFINE([DISABLE_FD_PASSING]) |
| 1097 | AC_DEFINE([NO_SSH_LASTLOG]) |
Ben Lindstrom | 232ccf7 | 2002-07-22 23:34:25 +0000 | [diff] [blame] | 1098 | LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" |
| 1099 | LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" |
| 1100 | MANTYPE=cat |
Tim Rice | e991e3c | 2001-08-07 15:29:07 -0700 | [diff] [blame] | 1101 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1102 | *-dec-osf*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1103 | AC_MSG_CHECKING([for Digital Unix SIA]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1104 | no_osfsia="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1105 | AC_ARG_WITH([osfsia], |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1106 | [ --with-osfsia Enable Digital Unix SIA], |
| 1107 | [ |
| 1108 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1109 | AC_MSG_RESULT([disabled]) |
Ben Lindstrom | 72af2ef | 2001-05-08 20:42:28 +0000 | [diff] [blame] | 1110 | no_osfsia=1 |
| 1111 | fi |
| 1112 | ], |
| 1113 | ) |
| 1114 | if test -z "$no_osfsia" ; then |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1115 | if test -f /etc/sia/matrix.conf; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1116 | AC_MSG_RESULT([yes]) |
| 1117 | AC_DEFINE([HAVE_OSF_SIA], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1118 | [Define if you have Digital Unix Security |
| 1119 | Integration Architecture]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1120 | AC_DEFINE([DISABLE_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1121 | [Define if you don't want to use your |
| 1122 | system's login() call]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1123 | AC_DEFINE([DISABLE_FD_PASSING]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1124 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 1125 | SIA_MSG="yes" |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1126 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1127 | AC_MSG_RESULT([no]) |
| 1128 | AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1129 | [String used in /etc/passwd to denote locked account]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1130 | fi |
| 1131 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1132 | AC_DEFINE([BROKEN_GETADDRINFO]) |
| 1133 | AC_DEFINE([SETEUID_BREAKS_SETUID]) |
| 1134 | AC_DEFINE([BROKEN_SETREUID]) |
| 1135 | AC_DEFINE([BROKEN_SETREGID]) |
| 1136 | AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv]) |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 1137 | ;; |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1138 | |
Tim Rice | 70335a6 | 2006-02-04 17:42:58 -0800 | [diff] [blame] | 1139 | *-*-nto-qnx*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1140 | AC_DEFINE([USE_PIPES]) |
| 1141 | AC_DEFINE([NO_X11_UNIX_SOCKETS]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1142 | AC_DEFINE([DISABLE_LASTLOG]) |
| 1143 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
| 1144 | AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) |
Tim Rice | 2f99346 | 2006-02-11 18:37:48 -0800 | [diff] [blame] | 1145 | enable_etc_default_login=no # has incompatible /etc/default/login |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1146 | case "$host" in |
| 1147 | *-*-nto-qnx6*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1148 | AC_DEFINE([DISABLE_FD_PASSING]) |
Darren Tucker | 8acb3b6 | 2007-08-10 14:36:12 +1000 | [diff] [blame] | 1149 | ;; |
| 1150 | esac |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 1151 | ;; |
Darren Tucker | 2be1cbb | 2005-05-27 21:13:40 +1000 | [diff] [blame] | 1152 | |
| 1153 | *-*-ultrix*) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1154 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1155 | AC_DEFINE([NEED_SETPGRP]) |
| 1156 | 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] | 1157 | ;; |
Darren Tucker | 93e7e8f | 2005-08-23 08:06:55 +1000 | [diff] [blame] | 1158 | |
| 1159 | *-*-lynxos) |
Darren Tucker | 5faa52d | 2016-08-02 15:22:40 +1000 | [diff] [blame] | 1160 | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" |
| 1161 | AC_DEFINE([BROKEN_SETVBUF], [1], |
| 1162 | [LynxOS has broken setvbuf() implementation]) |
| 1163 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1164 | esac |
| 1165 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1166 | AC_MSG_CHECKING([compiler and flags for sanity]) |
| 1167 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], |
| 1168 | [ AC_MSG_RESULT([yes]) ], |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1169 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1170 | AC_MSG_RESULT([no]) |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1171 | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1172 | ], |
| 1173 | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] |
Darren Tucker | 6eb9304 | 2003-06-29 21:30:41 +1000 | [diff] [blame] | 1174 | ) |
| 1175 | |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1176 | dnl Checks for header files. |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1177 | # Checks for libraries. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1178 | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1179 | |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1180 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1181 | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ |
| 1182 | AC_CHECK_LIB([gen], [dirname], [ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1183 | AC_CACHE_CHECK([for broken dirname], |
| 1184 | ac_cv_have_broken_dirname, [ |
| 1185 | save_LIBS="$LIBS" |
| 1186 | LIBS="$LIBS -lgen" |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1187 | AC_RUN_IFELSE( |
| 1188 | [AC_LANG_SOURCE([[ |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1189 | #include <libgen.h> |
| 1190 | #include <string.h> |
| 1191 | |
| 1192 | int main(int argc, char **argv) { |
| 1193 | char *s, buf[32]; |
| 1194 | |
| 1195 | strncpy(buf,"/etc", 32); |
| 1196 | s = dirname(buf); |
| 1197 | if (!s || strncmp(s, "/", 32) != 0) { |
| 1198 | exit(1); |
| 1199 | } else { |
| 1200 | exit(0); |
| 1201 | } |
| 1202 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1203 | ]])], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1204 | [ ac_cv_have_broken_dirname="no" ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1205 | [ ac_cv_have_broken_dirname="yes" ], |
| 1206 | [ ac_cv_have_broken_dirname="no" ], |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1207 | ) |
| 1208 | LIBS="$save_LIBS" |
| 1209 | ]) |
| 1210 | if test "x$ac_cv_have_broken_dirname" = "xno" ; then |
| 1211 | LIBS="$LIBS -lgen" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1212 | AC_DEFINE([HAVE_DIRNAME]) |
| 1213 | AC_CHECK_HEADERS([libgen.h]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1214 | fi |
| 1215 | ]) |
| 1216 | ]) |
| 1217 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1218 | AC_CHECK_FUNC([getspnam], , |
| 1219 | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) |
| 1220 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
| 1221 | [Define if you have the basename function.])]) |
Tim Rice | 1e1ef64 | 2003-09-11 22:19:31 -0700 | [diff] [blame] | 1222 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1223 | dnl zlib is required |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1224 | AC_ARG_WITH([zlib], |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1225 | [ --with-zlib=PATH Use zlib in PATH], |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1226 | [ if test "x$withval" = "xno" ; then |
| 1227 | AC_MSG_ERROR([*** zlib is required ***]) |
| 1228 | elif test "x$withval" != "xyes"; then |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1229 | if test -d "$withval/lib"; then |
| 1230 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1231 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1232 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1233 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1234 | fi |
| 1235 | else |
| 1236 | if test -n "${need_dash_r}"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1237 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1238 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1239 | LDFLAGS="-L${withval} ${LDFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1240 | fi |
| 1241 | fi |
| 1242 | if test -d "$withval/include"; then |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1243 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1244 | else |
Tim Rice | 02cebcd | 2001-10-25 10:01:30 -0700 | [diff] [blame] | 1245 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1246 | fi |
Darren Tucker | 86a5f8d | 2005-03-21 09:55:17 +1100 | [diff] [blame] | 1247 | fi ] |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1248 | ) |
| 1249 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1250 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) |
| 1251 | AC_CHECK_LIB([z], [deflate], , |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1252 | [ |
| 1253 | saved_CPPFLAGS="$CPPFLAGS" |
| 1254 | saved_LDFLAGS="$LDFLAGS" |
| 1255 | save_LIBS="$LIBS" |
| 1256 | dnl Check default zlib install dir |
| 1257 | if test -n "${need_dash_r}"; then |
| 1258 | LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}" |
| 1259 | else |
| 1260 | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" |
| 1261 | fi |
| 1262 | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" |
| 1263 | LIBS="$LIBS -lz" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1264 | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], |
Tim Rice | fcb6220 | 2004-01-23 18:35:16 -0800 | [diff] [blame] | 1265 | [ |
| 1266 | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) |
| 1267 | ] |
| 1268 | ) |
| 1269 | ] |
| 1270 | ) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1271 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1272 | AC_ARG_WITH([zlib-version-check], |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1273 | [ --without-zlib-version-check Disable zlib version check], |
| 1274 | [ if test "x$withval" = "xno" ; then |
| 1275 | zlib_check_nonfatal=1 |
| 1276 | fi |
| 1277 | ] |
| 1278 | ) |
| 1279 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1280 | AC_MSG_CHECKING([for possibly buggy zlib]) |
| 1281 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1282 | #include <stdio.h> |
Darren Tucker | c8a0f27 | 2013-03-22 12:49:14 +1100 | [diff] [blame] | 1283 | #include <stdlib.h> |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1284 | #include <zlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1285 | ]], |
| 1286 | [[ |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1287 | int a=0, b=0, c=0, d=0, n, v; |
| 1288 | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); |
| 1289 | if (n != 3 && n != 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1290 | exit(1); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1291 | v = a*1000000 + b*10000 + c*100 + d; |
| 1292 | fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); |
| 1293 | |
| 1294 | /* 1.1.4 is OK */ |
| 1295 | if (a == 1 && b == 1 && c >= 4) |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1296 | exit(0); |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1297 | |
Darren Tucker | 41097ed | 2005-07-25 15:24:21 +1000 | [diff] [blame] | 1298 | /* 1.2.3 and up are OK */ |
| 1299 | if (v >= 1020300) |
Darren Tucker | 2f0b5c4 | 2005-04-24 17:52:22 +1000 | [diff] [blame] | 1300 | exit(0); |
| 1301 | |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1302 | exit(2); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1303 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1304 | AC_MSG_RESULT([no]), |
| 1305 | [ AC_MSG_RESULT([yes]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1306 | if test -z "$zlib_check_nonfatal" ; then |
| 1307 | AC_MSG_ERROR([*** zlib too old - check config.log *** |
| 1308 | Your reported zlib version has known security problems. It's possible your |
| 1309 | vendor has fixed these problems without changing the version number. If you |
| 1310 | are sure this is the case, you can disable the check by running |
| 1311 | "./configure --without-zlib-version-check". |
Darren Tucker | ac1910f | 2005-07-26 12:00:42 +1000 | [diff] [blame] | 1312 | 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] | 1313 | See http://www.gzip.org/zlib/ for details.]) |
Darren Tucker | dcc736b | 2004-01-30 14:20:59 +1100 | [diff] [blame] | 1314 | else |
| 1315 | AC_MSG_WARN([zlib version may have security problems]) |
| 1316 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1317 | ], |
| 1318 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
Darren Tucker | 2dcd239 | 2004-01-23 17:13:33 +1100 | [diff] [blame] | 1319 | ) |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1320 | |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1321 | dnl UnixWare 2.x |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1322 | AC_CHECK_FUNC([strcasecmp], |
| 1323 | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1324 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1325 | AC_CHECK_FUNCS([utimes], |
| 1326 | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 1327 | LIBS="$LIBS -lc89"]) ] |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 1328 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1329 | |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1330 | dnl Checks for libutil functions |
Damien Miller | b87f6b7 | 2013-02-23 09:12:23 +1100 | [diff] [blame] | 1331 | AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1332 | AC_SEARCH_LIBS([fmt_scaled], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1333 | AC_SEARCH_LIBS([scan_scaled], [util bsd]) |
Damien Miller | 398c0ff | 2012-04-19 21:46:35 +1000 | [diff] [blame] | 1334 | AC_SEARCH_LIBS([login], [util bsd]) |
| 1335 | AC_SEARCH_LIBS([logout], [util bsd]) |
| 1336 | AC_SEARCH_LIBS([logwtmp], [util bsd]) |
| 1337 | AC_SEARCH_LIBS([openpty], [util bsd]) |
| 1338 | AC_SEARCH_LIBS([updwtmp], [util bsd]) |
Darren Tucker | e194ba4 | 2013-05-16 20:47:31 +1000 | [diff] [blame] | 1339 | AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp]) |
Tim Rice | e589a29 | 2001-11-03 11:09:32 -0800 | [diff] [blame] | 1340 | |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1341 | # On some platforms, inet_ntop and gethostbyname may be found in libresolv |
| 1342 | # or libnsl. |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1343 | AC_SEARCH_LIBS([inet_ntop], [resolv nsl]) |
Darren Tucker | 2fee909 | 2016-02-17 09:48:15 +1100 | [diff] [blame] | 1344 | AC_SEARCH_LIBS([gethostbyname], [resolv nsl]) |
Damien Miller | ab03949 | 2014-01-28 15:07:10 +1100 | [diff] [blame] | 1345 | |
Darren Tucker | 74c1c36 | 2017-09-27 07:44:41 +1000 | [diff] [blame] | 1346 | # "Particular Function Checks" |
| 1347 | # 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] | 1348 | AC_FUNC_STRFTIME |
Darren Tucker | 74c1c36 | 2017-09-27 07:44:41 +1000 | [diff] [blame] | 1349 | AC_FUNC_MALLOC |
| 1350 | AC_FUNC_REALLOC |
| 1351 | # autoconf doesn't have AC_FUNC_CALLOC so fake it if malloc returns NULL; |
| 1352 | if test "x$ac_cv_func_malloc_0_nonnull" != "xyes"; then |
| 1353 | AC_DEFINE(HAVE_CALLOC, 0, [calloc(x, 0) returns NULL]) |
| 1354 | AC_DEFINE(calloc, rpl_calloc, |
| 1355 | [Define to rpl_calloc if the replacement function should be used.]) |
| 1356 | fi |
Ben Lindstrom | 8697e08 | 2001-02-24 21:41:10 +0000 | [diff] [blame] | 1357 | |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1358 | # Check for ALTDIRFUNC glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1359 | AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support]) |
| 1360 | AC_EGREP_CPP([FOUNDIT], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1361 | [ |
| 1362 | #include <glob.h> |
| 1363 | #ifdef GLOB_ALTDIRFUNC |
| 1364 | FOUNDIT |
| 1365 | #endif |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1366 | ], |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1367 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1368 | AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1369 | [Define if your system glob() function has |
| 1370 | the GLOB_ALTDIRFUNC extension]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1371 | AC_MSG_RESULT([yes]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1372 | ], |
| 1373 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1374 | AC_MSG_RESULT([no]) |
Damien Miller | 3c02768 | 2001-03-14 11:39:45 +1100 | [diff] [blame] | 1375 | ] |
| 1376 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1377 | |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1378 | # Check for g.gl_matchc glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1379 | AC_MSG_CHECKING([for gl_matchc field in glob_t]) |
| 1380 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], |
| 1381 | [[ glob_t g; g.gl_matchc = 1; ]])], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1382 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1383 | AC_DEFINE([GLOB_HAS_GL_MATCHC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1384 | [Define if your system glob() function has |
| 1385 | gl_matchc options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1386 | AC_MSG_RESULT([yes]) |
| 1387 | ], [ |
| 1388 | AC_MSG_RESULT([no]) |
| 1389 | ]) |
Ben Lindstrom | 45b14db | 2001-03-17 01:15:38 +0000 | [diff] [blame] | 1390 | |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1391 | # Check for g.gl_statv glob() extension |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1392 | AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob]) |
| 1393 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[ |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1394 | #ifndef GLOB_KEEPSTAT |
| 1395 | #error "glob does not support GLOB_KEEPSTAT extension" |
| 1396 | #endif |
| 1397 | glob_t g; |
| 1398 | g.gl_statv = NULL; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1399 | ]])], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1400 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1401 | AC_DEFINE([GLOB_HAS_GL_STATV], [1], |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1402 | [Define if your system glob() function has |
| 1403 | gl_statv options in glob_t]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1404 | AC_MSG_RESULT([yes]) |
| 1405 | ], [ |
| 1406 | AC_MSG_RESULT([no]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1407 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1408 | ]) |
Damien Miller | a6e121a | 2010-10-07 21:39:17 +1100 | [diff] [blame] | 1409 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1410 | AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>]) |
Darren Tucker | 096faec | 2006-09-01 20:29:10 +1000 | [diff] [blame] | 1411 | |
Darren Tucker | 7df91b0 | 2016-07-14 12:25:24 +1000 | [diff] [blame] | 1412 | AC_CHECK_DECL([VIS_ALL], , |
| 1413 | AC_DEFINE(BROKEN_STRNVIS, 1, [missing VIS_ALL]), [#include <vis.h>]) |
| 1414 | |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1415 | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1416 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1417 | [AC_LANG_PROGRAM([[ |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1418 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1419 | #include <dirent.h>]], |
| 1420 | [[ |
| 1421 | struct dirent d; |
| 1422 | exit(sizeof(d.d_name)<=sizeof(char)); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1423 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1424 | [AC_MSG_RESULT([yes])], |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1425 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1426 | AC_MSG_RESULT([no]) |
| 1427 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], |
Darren Tucker | 79d09fa | 2005-11-24 22:34:54 +1100 | [diff] [blame] | 1428 | [Define if your struct dirent expects you to |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1429 | allocate extra space for d_name]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1430 | ], |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1431 | [ |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1432 | AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1433 | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME]) |
Damien Miller | 18bb473 | 2001-03-28 14:35:30 +1000 | [diff] [blame] | 1434 | ] |
| 1435 | ) |
| 1436 | |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1437 | AC_MSG_CHECKING([for /proc/pid/fd directory]) |
| 1438 | if test -d "/proc/$$/fd" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1439 | AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) |
| 1440 | AC_MSG_RESULT([yes]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1441 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1442 | AC_MSG_RESULT([no]) |
Damien Miller | 36f4965 | 2004-08-15 18:40:59 +1000 | [diff] [blame] | 1443 | fi |
| 1444 | |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1445 | # Check whether user wants S/Key support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1446 | SKEY_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1447 | AC_ARG_WITH([skey], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1448 | [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1449 | [ |
| 1450 | if test "x$withval" != "xno" ; then |
| 1451 | |
| 1452 | if test "x$withval" != "xyes" ; then |
| 1453 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1454 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1455 | fi |
| 1456 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1457 | AC_DEFINE([SKEY], [1], [Define if you want S/Key support]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1458 | LIBS="-lskey $LIBS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 1459 | SKEY_MSG="yes" |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 1460 | |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1461 | AC_MSG_CHECKING([for s/key support]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1462 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1463 | [AC_LANG_PROGRAM([[ |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1464 | #include <stdio.h> |
| 1465 | #include <skey.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1466 | ]], [[ |
| 1467 | char *ff = skey_keyinfo(""); ff=""; |
| 1468 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 1469 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1470 | [AC_MSG_RESULT([yes])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 1471 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1472 | AC_MSG_RESULT([no]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1473 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1474 | ]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1475 | AC_MSG_CHECKING([if skeychallenge takes 4 arguments]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1476 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1477 | #include <stdio.h> |
| 1478 | #include <skey.h> |
| 1479 | ]], [[ |
| 1480 | (void)skeychallenge(NULL,"name","",0); |
| 1481 | ]])], |
| 1482 | [ |
| 1483 | AC_MSG_RESULT([yes]) |
| 1484 | AC_DEFINE([SKEYCHALLENGE_4ARG], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1485 | [Define if your skeychallenge() |
| 1486 | function takes 4 arguments (NetBSD)])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1487 | [ |
| 1488 | AC_MSG_RESULT([no]) |
| 1489 | ]) |
Damien Miller | c547bf1 | 2001-02-16 10:18:12 +1100 | [diff] [blame] | 1490 | fi |
| 1491 | ] |
| 1492 | ) |
| 1493 | |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1494 | # Check whether user wants to use ldns |
| 1495 | LDNS_MSG="no" |
| 1496 | AC_ARG_WITH(ldns, |
| 1497 | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1498 | [ |
| 1499 | ldns="" |
| 1500 | if test "x$withval" = "xyes" ; then |
| 1501 | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) |
Darren Tucker | f001de8 | 2017-12-11 13:42:51 +1100 | [diff] [blame] | 1502 | if test "x$LDNSCONFIG" = "xno"; then |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1503 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1504 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1505 | LIBS="-lldns $LIBS" |
| 1506 | ldns=yes |
| 1507 | else |
| 1508 | LIBS="$LIBS `$LDNSCONFIG --libs`" |
| 1509 | CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`" |
Darren Tucker | 7af27bf | 2017-03-24 09:44:56 +1100 | [diff] [blame] | 1510 | ldns=yes |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1511 | fi |
| 1512 | elif test "x$withval" != "xno" ; then |
| 1513 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1514 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1515 | LIBS="-lldns $LIBS" |
| 1516 | ldns=yes |
| 1517 | fi |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1518 | |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1519 | # Verify that it works. |
| 1520 | if test "x$ldns" = "xyes" ; then |
| 1521 | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) |
| 1522 | LDNS_MSG="yes" |
| 1523 | AC_MSG_CHECKING([for ldns support]) |
| 1524 | AC_LINK_IFELSE( |
| 1525 | [AC_LANG_SOURCE([[ |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1526 | #include <stdio.h> |
| 1527 | #include <stdlib.h> |
| 1528 | #include <stdint.h> |
| 1529 | #include <ldns/ldns.h> |
| 1530 | 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] | 1531 | ]]) |
| 1532 | ], |
| 1533 | [AC_MSG_RESULT(yes)], |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1534 | [ |
| 1535 | AC_MSG_RESULT(no) |
| 1536 | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) |
| 1537 | ]) |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 1538 | fi |
| 1539 | ]) |
Darren Tucker | aa3cbd1 | 2011-11-04 11:25:24 +1100 | [diff] [blame] | 1540 | |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1541 | # Check whether user wants libedit support |
| 1542 | LIBEDIT_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1543 | AC_ARG_WITH([libedit], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 1544 | [ --with-libedit[[=PATH]] Enable libedit support for sftp], |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1545 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1546 | if test "x$withval" = "xyes" ; then |
Darren Tucker | 5935389 | 2012-05-19 15:24:37 +1000 | [diff] [blame] | 1547 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1548 | if test "x$PKGCONFIG" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1549 | AC_MSG_CHECKING([if $PKGCONFIG knows about libedit]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1550 | if "$PKGCONFIG" libedit; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1551 | AC_MSG_RESULT([yes]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1552 | use_pkgconfig_for_libedit=yes |
| 1553 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1554 | AC_MSG_RESULT([no]) |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1555 | fi |
| 1556 | fi |
| 1557 | else |
Darren Tucker | c373a56 | 2005-09-22 20:15:08 +1000 | [diff] [blame] | 1558 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
| 1559 | if test -n "${need_dash_r}"; then |
| 1560 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 1561 | else |
| 1562 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 1563 | fi |
Darren Tucker | 1df6145 | 2005-03-21 09:58:07 +1100 | [diff] [blame] | 1564 | fi |
Damien Miller | 1f78980 | 2010-10-11 22:35:22 +1100 | [diff] [blame] | 1565 | if test "x$use_pkgconfig_for_libedit" = "xyes"; then |
Darren Tucker | 8369c8e | 2013-12-05 11:00:16 +1100 | [diff] [blame] | 1566 | LIBEDIT=`$PKGCONFIG --libs libedit` |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1567 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" |
| 1568 | else |
| 1569 | LIBEDIT="-ledit -lcurses" |
| 1570 | fi |
| 1571 | OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1572 | AC_CHECK_LIB([edit], [el_init], |
| 1573 | [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1574 | LIBEDIT_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1575 | AC_SUBST([LIBEDIT]) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1576 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1577 | [ AC_MSG_ERROR([libedit not found]) ], |
Darren Tucker | c4ccb12 | 2010-04-09 14:04:35 +1000 | [diff] [blame] | 1578 | [ $OTHERLIBS ] |
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_CHECKING([if libedit version is compatible]) |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1581 | AC_COMPILE_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1582 | [AC_LANG_PROGRAM([[ #include <histedit.h> ]], |
| 1583 | [[ |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1584 | int i = H_SETSIZE; |
| 1585 | el_init("", NULL, NULL, NULL); |
| 1586 | exit(0); |
Tim Rice | c1819c8 | 2005-08-15 17:48:40 -0700 | [diff] [blame] | 1587 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1588 | [ AC_MSG_RESULT([yes]) ], |
| 1589 | [ AC_MSG_RESULT([no]) |
| 1590 | AC_MSG_ERROR([libedit version is not compatible]) ] |
Darren Tucker | c7572b2 | 2005-08-10 20:34:15 +1000 | [diff] [blame] | 1591 | ) |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 1592 | fi ] |
| 1593 | ) |
| 1594 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1595 | AUDIT_MODULE=none |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1596 | AC_ARG_WITH([audit], |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1597 | [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1598 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1599 | AC_MSG_CHECKING([for supported audit module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1600 | case "$withval" in |
| 1601 | bsm) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1602 | AC_MSG_RESULT([bsm]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1603 | AUDIT_MODULE=bsm |
| 1604 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1605 | AC_CHECK_HEADERS([bsm/audit.h], [], |
| 1606 | [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])], |
Darren Tucker | 6d0d6fb | 2006-09-09 01:05:21 +1000 | [diff] [blame] | 1607 | [ |
| 1608 | #ifdef HAVE_TIME_H |
| 1609 | # include <time.h> |
| 1610 | #endif |
| 1611 | ] |
| 1612 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1613 | AC_CHECK_LIB([bsm], [getaudit], [], |
| 1614 | [AC_MSG_ERROR([BSM enabled and required library not found])]) |
| 1615 | AC_CHECK_FUNCS([getaudit], [], |
| 1616 | [AC_MSG_ERROR([BSM enabled and required function not found])]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1617 | # These are optional |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1618 | AC_CHECK_FUNCS([getaudit_addr aug_get_machine]) |
| 1619 | AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module]) |
Darren Tucker | 1fcec9d | 2013-12-19 11:00:12 +1100 | [diff] [blame] | 1620 | if test "$sol2ver" -ge 11; then |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 1621 | SSHDLIBS="$SSHDLIBS -lscf" |
| 1622 | AC_DEFINE([BROKEN_BSM_API], [1], |
| 1623 | [The system has incomplete BSM API]) |
Darren Tucker | 93a2d41 | 2012-02-24 10:40:41 +1100 | [diff] [blame] | 1624 | fi |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1625 | ;; |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1626 | linux) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1627 | AC_MSG_RESULT([linux]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1628 | AUDIT_MODULE=linux |
| 1629 | dnl Checks for headers, libs and functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1630 | AC_CHECK_HEADERS([libaudit.h]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1631 | SSHDLIBS="$SSHDLIBS -laudit" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1632 | AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module]) |
Darren Tucker | ea52a82 | 2011-01-17 21:15:27 +1100 | [diff] [blame] | 1633 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1634 | debug) |
| 1635 | AUDIT_MODULE=debug |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1636 | AC_MSG_RESULT([debug]) |
| 1637 | AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1638 | ;; |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1639 | no) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1640 | AC_MSG_RESULT([no]) |
Tim Rice | 8bc6b90 | 2005-08-09 10:09:53 -0700 | [diff] [blame] | 1641 | ;; |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 1642 | *) |
| 1643 | AC_MSG_ERROR([Unknown audit module $withval]) |
| 1644 | ;; |
| 1645 | esac ] |
| 1646 | ) |
| 1647 | |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1648 | AC_ARG_WITH([pie], |
Damien Miller | 76c0480 | 2015-01-13 19:38:18 +1100 | [diff] [blame] | 1649 | [ --with-pie Build Position Independent Executables if possible], [ |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1650 | if test "x$withval" = "xno"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1651 | use_pie=no |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1652 | fi |
| 1653 | if test "x$withval" = "xyes"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1654 | use_pie=yes |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1655 | fi |
| 1656 | ] |
| 1657 | ) |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1658 | if test "x$use_pie" = "x"; then |
| 1659 | use_pie=no |
| 1660 | fi |
| 1661 | if test "x$use_toolchain_hardening" != "x1" && test "x$use_pie" = "xauto"; then |
| 1662 | # Turn off automatic PIE when toolchain hardening is off. |
| 1663 | use_pie=no |
| 1664 | fi |
Damien Miller | c161fc9 | 2014-01-29 21:01:33 +1100 | [diff] [blame] | 1665 | if test "x$use_pie" = "xauto"; then |
Damien Miller | 852472a | 2014-01-22 16:31:18 +1100 | [diff] [blame] | 1666 | # Automatic PIE requires gcc >= 4.x |
| 1667 | AC_MSG_CHECKING([for gcc >= 4.x]) |
| 1668 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
| 1669 | #if !defined(__GNUC__) || __GNUC__ < 4 |
| 1670 | #error gcc is too old |
| 1671 | #endif |
| 1672 | ]])], |
| 1673 | [ AC_MSG_RESULT([yes]) ], |
| 1674 | [ AC_MSG_RESULT([no]) |
| 1675 | use_pie=no ] |
| 1676 | ) |
| 1677 | fi |
| 1678 | if test "x$use_pie" != "xno"; then |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1679 | SAVED_CFLAGS="$CFLAGS" |
| 1680 | SAVED_LDFLAGS="$LDFLAGS" |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1681 | OSSH_CHECK_CFLAG_COMPILE([-fPIE]) |
| 1682 | OSSH_CHECK_LDFLAG_LINK([-pie]) |
Damien Miller | 5c2ff5e | 2014-01-22 21:30:12 +1100 | [diff] [blame] | 1683 | # We use both -fPIE and -pie or neither. |
| 1684 | AC_MSG_CHECKING([whether both -fPIE and -pie are supported]) |
| 1685 | if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ |
| 1686 | echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then |
| 1687 | AC_MSG_RESULT([yes]) |
| 1688 | else |
| 1689 | AC_MSG_RESULT([no]) |
| 1690 | CFLAGS="$SAVED_CFLAGS" |
| 1691 | LDFLAGS="$SAVED_LDFLAGS" |
| 1692 | fi |
Darren Tucker | 096118d | 2014-01-21 12:48:51 +1100 | [diff] [blame] | 1693 | fi |
| 1694 | |
Damien Miller | fe1f143 | 2003-02-24 15:45:42 +1100 | [diff] [blame] | 1695 | dnl Checks for library functions. Please keep in alphabetical order |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1696 | AC_CHECK_FUNCS([ \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1697 | Blowfish_initstate \ |
| 1698 | Blowfish_expandstate \ |
| 1699 | Blowfish_expand0state \ |
| 1700 | Blowfish_stream2word \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1701 | asprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1702 | b64_ntop \ |
| 1703 | __b64_ntop \ |
| 1704 | b64_pton \ |
| 1705 | __b64_pton \ |
| 1706 | bcopy \ |
Damien Miller | a913442 | 2013-12-07 11:35:36 +1100 | [diff] [blame] | 1707 | bcrypt_pbkdf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1708 | bindresvport_sa \ |
Damien Miller | 1ff130d | 2013-12-07 11:51:51 +1100 | [diff] [blame] | 1709 | blf_enc \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 1710 | cap_rights_limit \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1711 | clock \ |
| 1712 | closefrom \ |
| 1713 | dirfd \ |
Darren Tucker | efdf534 | 2013-05-30 08:29:08 +1000 | [diff] [blame] | 1714 | endgrent \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1715 | err \ |
| 1716 | errx \ |
Damien Miller | 1d2c456 | 2014-02-04 11:18:20 +1100 | [diff] [blame] | 1717 | explicit_bzero \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1718 | fchmod \ |
| 1719 | fchown \ |
| 1720 | freeaddrinfo \ |
Damien Miller | b795691 | 2017-09-19 12:29:23 +1000 | [diff] [blame] | 1721 | freezero \ |
Darren Tucker | a5cf1e2 | 2014-01-17 18:10:58 +1100 | [diff] [blame] | 1722 | fstatfs \ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 1723 | fstatvfs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1724 | futimes \ |
| 1725 | getaddrinfo \ |
| 1726 | getcwd \ |
| 1727 | getgrouplist \ |
| 1728 | getnameinfo \ |
| 1729 | getopt \ |
Damien Miller | 151c6e4 | 2017-06-01 15:25:13 +1000 | [diff] [blame] | 1730 | getpagesize \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1731 | getpeereid \ |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 1732 | getpeerucred \ |
Darren Tucker | 3c4a24c | 2013-02-15 11:41:35 +1100 | [diff] [blame] | 1733 | getpgid \ |
| 1734 | getpgrp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1735 | _getpty \ |
| 1736 | getrlimit \ |
| 1737 | getttyent \ |
| 1738 | glob \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1739 | group_from_gid \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1740 | inet_aton \ |
| 1741 | inet_ntoa \ |
| 1742 | inet_ntop \ |
| 1743 | innetgr \ |
Darren Tucker | d38f05d | 2017-03-20 13:38:27 +1100 | [diff] [blame] | 1744 | llabs \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1745 | login_getcapbool \ |
| 1746 | md5_crypt \ |
| 1747 | memmove \ |
Damien Miller | 3d673d1 | 2014-08-27 06:32:01 +1000 | [diff] [blame] | 1748 | memset_s \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1749 | mkdtemp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1750 | ngetaddrinfo \ |
| 1751 | nsleep \ |
| 1752 | ogetaddrinfo \ |
| 1753 | openlog_r \ |
Darren Tucker | 3ddd15e | 2015-11-30 07:23:53 +1100 | [diff] [blame] | 1754 | pledge \ |
Darren Tucker | febf0f5 | 2007-06-25 22:15:12 +1000 | [diff] [blame] | 1755 | poll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1756 | prctl \ |
| 1757 | pstat \ |
| 1758 | readpassphrase \ |
Darren Tucker | 642652d | 2014-12-10 01:32:23 +1100 | [diff] [blame] | 1759 | reallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1760 | recvmsg \ |
Damien Miller | 151c6e4 | 2017-06-01 15:25:13 +1000 | [diff] [blame] | 1761 | recallocarray \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1762 | rresvport_af \ |
| 1763 | sendmsg \ |
| 1764 | setdtablesize \ |
| 1765 | setegid \ |
| 1766 | setenv \ |
| 1767 | seteuid \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1768 | setgroupent \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1769 | setgroups \ |
Darren Tucker | 34f702a | 2012-07-04 08:50:09 +1000 | [diff] [blame] | 1770 | setlinebuf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1771 | setlogin \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1772 | setpassent\ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1773 | setpcred \ |
| 1774 | setproctitle \ |
| 1775 | setregid \ |
| 1776 | setreuid \ |
| 1777 | setrlimit \ |
| 1778 | setsid \ |
| 1779 | setvbuf \ |
| 1780 | sigaction \ |
| 1781 | sigvec \ |
| 1782 | snprintf \ |
| 1783 | socketpair \ |
Darren Tucker | 5b2e2ba | 2008-06-08 09:25:28 +1000 | [diff] [blame] | 1784 | statfs \ |
| 1785 | statvfs \ |
Darren Tucker | afec077 | 2016-12-13 10:23:03 +1100 | [diff] [blame] | 1786 | strcasestr \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1787 | strdup \ |
| 1788 | strerror \ |
| 1789 | strlcat \ |
| 1790 | strlcpy \ |
| 1791 | strmode \ |
Darren Tucker | b54f50e | 2011-09-29 23:17:18 +1000 | [diff] [blame] | 1792 | strnlen \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1793 | strnvis \ |
Darren Tucker | aa74f67 | 2010-08-16 13:15:23 +1000 | [diff] [blame] | 1794 | strptime \ |
Darren Tucker | 44fc334 | 2017-09-25 09:48:10 +1000 | [diff] [blame] | 1795 | strsignal \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1796 | strtonum \ |
Darren Tucker | 81eb5d5 | 2005-06-01 21:39:33 +1000 | [diff] [blame] | 1797 | strtoll \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1798 | strtoul \ |
Darren Tucker | 8e6fb78 | 2013-02-15 12:13:01 +1100 | [diff] [blame] | 1799 | strtoull \ |
Damien Miller | 34a1769 | 2007-06-11 14:15:42 +1000 | [diff] [blame] | 1800 | swap32 \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1801 | sysconf \ |
| 1802 | tcgetpgrp \ |
Damien Miller | aa18063 | 2010-10-07 21:25:27 +1100 | [diff] [blame] | 1803 | timingsafe_bcmp \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1804 | truncate \ |
| 1805 | unsetenv \ |
| 1806 | updwtmpx \ |
Darren Tucker | 909a390 | 2010-01-15 12:38:30 +1100 | [diff] [blame] | 1807 | user_from_uid \ |
Damien Miller | f4db77d | 2013-03-15 10:34:25 +1100 | [diff] [blame] | 1808 | usleep \ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 1809 | vasprintf \ |
Darren Tucker | 0c9653f | 2005-05-28 15:58:14 +1000 | [diff] [blame] | 1810 | vsnprintf \ |
| 1811 | waitpid \ |
Darren Tucker | 6310ef2 | 2016-07-13 14:42:35 +1000 | [diff] [blame] | 1812 | warn \ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1813 | ]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 1814 | |
Darren Tucker | c61d5ec | 2017-02-03 14:10:34 +1100 | [diff] [blame] | 1815 | dnl Wide character support. |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1816 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) |
Darren Tucker | a233358 | 2016-07-14 10:59:09 +1000 | [diff] [blame] | 1817 | |
Darren Tucker | 10e290e | 2016-12-13 13:51:32 +1100 | [diff] [blame] | 1818 | TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes} |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1819 | AC_MSG_CHECKING([for utf8 locale support]) |
| 1820 | AC_RUN_IFELSE( |
| 1821 | [AC_LANG_PROGRAM([[ |
| 1822 | #include <locale.h> |
Darren Tucker | c359950 | 2016-12-09 12:52:02 +1100 | [diff] [blame] | 1823 | #include <stdlib.h> |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 1824 | ]], [[ |
| 1825 | char *loc = setlocale(LC_CTYPE, "en_US.UTF-8"); |
| 1826 | if (loc != NULL) |
| 1827 | exit(0); |
| 1828 | exit(1); |
| 1829 | ]])], |
| 1830 | AC_MSG_RESULT(yes), |
| 1831 | [AC_MSG_RESULT(no) |
| 1832 | TEST_SSH_UTF8=no], |
| 1833 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 1834 | ) |
| 1835 | |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1836 | AC_LINK_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1837 | [AC_LANG_PROGRAM( |
| 1838 | [[ #include <ctype.h> ]], |
| 1839 | [[ return (isblank('a')); ]])], |
| 1840 | [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).]) |
Tim Rice | c7a8af0 | 2010-11-08 14:26:23 -0800 | [diff] [blame] | 1841 | ]) |
| 1842 | |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1843 | disable_pkcs11= |
| 1844 | AC_ARG_ENABLE([pkcs11], |
| 1845 | [ --disable-pkcs11 disable PKCS#11 support code [no]], |
| 1846 | [ |
| 1847 | if test "x$enableval" = "xno" ; then |
| 1848 | disable_pkcs11=1 |
| 1849 | fi |
| 1850 | ] |
| 1851 | ) |
| 1852 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1853 | # PKCS11 depends on OpenSSL. |
Damien Miller | 5fbe93f | 2016-07-15 13:54:31 +1000 | [diff] [blame] | 1854 | if test "x$openssl" = "xyes" && test "x$disable_pkcs11" = "x"; then |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 1855 | # PKCS#11 support requires dlopen() and co |
| 1856 | AC_SEARCH_LIBS([dlopen], [dl], |
| 1857 | [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])] |
| 1858 | ) |
| 1859 | fi |
Damien Miller | b3c9f78 | 2010-02-12 10:11:34 +1100 | [diff] [blame] | 1860 | |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1861 | # IRIX has a const char return value for gai_strerror() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1862 | AC_CHECK_FUNCS([gai_strerror], [ |
| 1863 | AC_DEFINE([HAVE_GAI_STRERROR]) |
| 1864 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1865 | #include <sys/types.h> |
| 1866 | #include <sys/socket.h> |
| 1867 | #include <netdb.h> |
| 1868 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1869 | const char *gai_strerror(int); |
| 1870 | ]], [[ |
| 1871 | char *str; |
| 1872 | str = gai_strerror(0); |
| 1873 | ]])], [ |
| 1874 | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], |
| 1875 | [Define if gai_strerror() returns const char *])], [])]) |
Darren Tucker | d5e082f | 2003-09-22 12:08:23 +1000 | [diff] [blame] | 1876 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1877 | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], |
| 1878 | [Some systems put nanosleep outside of libc])]) |
Damien Miller | cd6853c | 2003-01-28 11:33:42 +1100 | [diff] [blame] | 1879 | |
Darren Tucker | a710891 | 2013-06-02 08:18:31 +1000 | [diff] [blame] | 1880 | AC_SEARCH_LIBS([clock_gettime], [rt], |
| 1881 | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) |
| 1882 | |
Darren Tucker | f1159b5 | 2003-07-07 19:44:01 +1000 | [diff] [blame] | 1883 | dnl Make sure prototypes are defined for these before using them. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1884 | AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) |
| 1885 | AC_CHECK_DECL([strsep], |
| 1886 | [AC_CHECK_FUNCS([strsep])], |
Darren Tucker | 390b6d5 | 2005-05-28 16:54:36 +1000 | [diff] [blame] | 1887 | [], |
| 1888 | [ |
| 1889 | #ifdef HAVE_STRING_H |
| 1890 | # include <string.h> |
| 1891 | #endif |
| 1892 | ]) |
Ben Lindstrom | 3e00647 | 2002-10-16 00:24:03 +0000 | [diff] [blame] | 1893 | |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1894 | dnl tcsendbreak might be a macro |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1895 | AC_CHECK_DECL([tcsendbreak], |
| 1896 | [AC_DEFINE([HAVE_TCSENDBREAK])], |
| 1897 | [AC_CHECK_FUNCS([tcsendbreak])], |
Darren Tucker | b2427c8 | 2003-09-10 15:22:44 +1000 | [diff] [blame] | 1898 | [#include <termios.h>] |
| 1899 | ) |
| 1900 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1901 | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) |
Darren Tucker | 5bb1400 | 2004-04-23 18:53:10 +1000 | [diff] [blame] | 1902 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1903 | AC_CHECK_DECLS([SHUT_RD], , , |
Darren Tucker | 128a089 | 2006-07-12 19:02:56 +1000 | [diff] [blame] | 1904 | [ |
| 1905 | #include <sys/types.h> |
| 1906 | #include <sys/socket.h> |
| 1907 | ]) |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1908 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1909 | AC_CHECK_DECLS([O_NONBLOCK], , , |
Darren Tucker | 248469b | 2006-07-12 14:14:31 +1000 | [diff] [blame] | 1910 | [ |
| 1911 | #include <sys/types.h> |
| 1912 | #ifdef HAVE_SYS_STAT_H |
| 1913 | # include <sys/stat.h> |
| 1914 | #endif |
| 1915 | #ifdef HAVE_FCNTL_H |
| 1916 | # include <fcntl.h> |
| 1917 | #endif |
| 1918 | ]) |
| 1919 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1920 | AC_CHECK_DECLS([writev], , , [ |
Darren Tucker | ed0b592 | 2006-09-03 22:44:49 +1000 | [diff] [blame] | 1921 | #include <sys/types.h> |
| 1922 | #include <sys/uio.h> |
| 1923 | #include <unistd.h> |
| 1924 | ]) |
| 1925 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1926 | AC_CHECK_DECLS([MAXSYMLINKS], , , [ |
Darren Tucker | 6d862a5 | 2007-04-29 14:39:02 +1000 | [diff] [blame] | 1927 | #include <sys/param.h> |
| 1928 | ]) |
| 1929 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1930 | AC_CHECK_DECLS([offsetof], , , [ |
Darren Tucker | dca0edf | 2007-04-29 15:06:44 +1000 | [diff] [blame] | 1931 | #include <stddef.h> |
| 1932 | ]) |
| 1933 | |
Darren Tucker | c7aad00 | 2013-06-02 07:18:47 +1000 | [diff] [blame] | 1934 | # extra bits for select(2) |
| 1935 | AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ |
| 1936 | #include <sys/param.h> |
| 1937 | #include <sys/types.h> |
| 1938 | #ifdef HAVE_SYS_SYSMACROS_H |
| 1939 | #include <sys/sysmacros.h> |
| 1940 | #endif |
| 1941 | #ifdef HAVE_SYS_SELECT_H |
| 1942 | #include <sys/select.h> |
| 1943 | #endif |
| 1944 | #ifdef HAVE_SYS_TIME_H |
| 1945 | #include <sys/time.h> |
| 1946 | #endif |
| 1947 | #ifdef HAVE_UNISTD_H |
| 1948 | #include <unistd.h> |
| 1949 | #endif |
| 1950 | ]]) |
| 1951 | AC_CHECK_TYPES([fd_mask], [], [], [[ |
| 1952 | #include <sys/param.h> |
| 1953 | #include <sys/types.h> |
| 1954 | #ifdef HAVE_SYS_SELECT_H |
| 1955 | #include <sys/select.h> |
| 1956 | #endif |
| 1957 | #ifdef HAVE_SYS_TIME_H |
| 1958 | #include <sys/time.h> |
| 1959 | #endif |
| 1960 | #ifdef HAVE_UNISTD_H |
| 1961 | #include <unistd.h> |
| 1962 | #endif |
| 1963 | ]]) |
| 1964 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1965 | AC_CHECK_FUNCS([setresuid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1966 | dnl Some platorms have setresuid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1967 | AC_MSG_CHECKING([if setresuid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1968 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1969 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1970 | #include <stdlib.h> |
| 1971 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1972 | ]], [[ |
| 1973 | errno=0; |
| 1974 | setresuid(0,0,0); |
| 1975 | if (errno==ENOSYS) |
| 1976 | exit(1); |
| 1977 | else |
| 1978 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1979 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1980 | [AC_MSG_RESULT([yes])], |
| 1981 | [AC_DEFINE([BROKEN_SETRESUID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 1982 | [Define if your setresuid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1983 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 1984 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1985 | ) |
| 1986 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1987 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1988 | AC_CHECK_FUNCS([setresgid], [ |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 1989 | dnl Some platorms have setresgid that isn't implemented, test for this |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1990 | AC_MSG_CHECKING([if setresgid seems to work]) |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 1991 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1992 | [AC_LANG_PROGRAM([[ |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 1993 | #include <stdlib.h> |
| 1994 | #include <errno.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 1995 | ]], [[ |
| 1996 | errno=0; |
| 1997 | setresgid(0,0,0); |
| 1998 | if (errno==ENOSYS) |
| 1999 | exit(1); |
| 2000 | else |
| 2001 | exit(0); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2002 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2003 | [AC_MSG_RESULT([yes])], |
| 2004 | [AC_DEFINE([BROKEN_SETRESGID], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2005 | [Define if your setresgid() is broken]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2006 | AC_MSG_RESULT([not implemented])], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2007 | [AC_MSG_WARN([cross compiling: not checking setresuid])] |
Darren Tucker | 2a6b029 | 2003-12-31 14:59:17 +1100 | [diff] [blame] | 2008 | ) |
| 2009 | ]) |
Darren Tucker | e937be3 | 2003-12-17 18:53:26 +1100 | [diff] [blame] | 2010 | |
Darren Tucker | d3e2aee | 2015-07-17 12:52:34 +1000 | [diff] [blame] | 2011 | AC_CHECK_FUNCS([realpath], [ |
| 2012 | dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given |
| 2013 | dnl path name", however some implementations of realpath (and some |
| 2014 | dnl versions of the POSIX spec) do not work on non-existent files, |
| 2015 | dnl so we use the OpenBSD implementation on those platforms. |
| 2016 | AC_MSG_CHECKING([if realpath works with non-existent files]) |
| 2017 | AC_RUN_IFELSE( |
| 2018 | [AC_LANG_PROGRAM([[ |
| 2019 | #include <limits.h> |
| 2020 | #include <stdlib.h> |
| 2021 | #include <errno.h> |
| 2022 | ]], [[ |
| 2023 | char buf[PATH_MAX]; |
| 2024 | if (realpath("/opensshnonexistentfilename1234", buf) == NULL) |
| 2025 | if (errno == ENOENT) |
| 2026 | exit(1); |
| 2027 | exit(0); |
| 2028 | ]])], |
| 2029 | [AC_MSG_RESULT([yes])], |
| 2030 | [AC_DEFINE([BROKEN_REALPATH], [1], |
| 2031 | [realpath does not work with nonexistent files]) |
| 2032 | AC_MSG_RESULT([no])], |
| 2033 | [AC_MSG_WARN([cross compiling: assuming working])] |
| 2034 | ) |
| 2035 | ]) |
| 2036 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2037 | dnl Checks for time functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2038 | AC_CHECK_FUNCS([gettimeofday time]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2039 | dnl Checks for utmp functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2040 | AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent]) |
| 2041 | AC_CHECK_FUNCS([utmpname]) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 2042 | dnl Checks for utmpx functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2043 | AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline]) |
| 2044 | AC_CHECK_FUNCS([setutxdb setutxent utmpxname]) |
Damien Miller | 20e231f | 2009-02-12 13:12:21 +1100 | [diff] [blame] | 2045 | dnl Checks for lastlog functions |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2046 | AC_CHECK_FUNCS([getlastlogxbyname]) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 2047 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2048 | AC_CHECK_FUNC([daemon], |
| 2049 | [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])], |
| 2050 | [AC_CHECK_LIB([bsd], [daemon], |
| 2051 | [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])] |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 2052 | ) |
| 2053 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2054 | AC_CHECK_FUNC([getpagesize], |
| 2055 | [AC_DEFINE([HAVE_GETPAGESIZE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2056 | [Define if your libraries define getpagesize()])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2057 | [AC_CHECK_LIB([ucb], [getpagesize], |
| 2058 | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 2059 | ) |
| 2060 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2061 | # Check for broken snprintf |
| 2062 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 2063 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2064 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2065 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 2066 | [[ |
| 2067 | char b[5]; |
| 2068 | snprintf(b,5,"123456789"); |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2069 | exit(b[4]!='\0'); |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 2070 | ]])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2071 | [AC_MSG_RESULT([yes])], |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2072 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2073 | AC_MSG_RESULT([no]) |
| 2074 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2075 | [Define if your snprintf is busted]) |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2076 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 2077 | ], |
| 2078 | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 2079 | ) |
| 2080 | fi |
| 2081 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2082 | # We depend on vsnprintf returning the right thing on overflow: the |
| 2083 | # number of characters it tried to create (as per SUSv3) |
| 2084 | if test "x$ac_cv_func_vsnprintf" = "xyes" ; then |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2085 | AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) |
| 2086 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2087 | [AC_LANG_PROGRAM([[ |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2088 | #include <sys/types.h> |
| 2089 | #include <stdio.h> |
| 2090 | #include <stdarg.h> |
| 2091 | |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2092 | int x_snprintf(char *str, size_t count, const char *fmt, ...) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2093 | { |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2094 | size_t ret; |
| 2095 | va_list ap; |
| 2096 | |
| 2097 | va_start(ap, fmt); |
| 2098 | ret = vsnprintf(str, count, fmt, ap); |
| 2099 | va_end(ap); |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2100 | return ret; |
| 2101 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2102 | ]], [[ |
Damien Miller | d244a58 | 2014-08-23 17:06:49 +1000 | [diff] [blame] | 2103 | char x[1]; |
| 2104 | if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11) |
| 2105 | return 1; |
| 2106 | if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11) |
| 2107 | return 1; |
| 2108 | return 0; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2109 | ]])], |
| 2110 | [AC_MSG_RESULT([yes])], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2111 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2112 | AC_MSG_RESULT([no]) |
| 2113 | AC_DEFINE([BROKEN_SNPRINTF], [1], |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 2114 | [Define if your snprintf is busted]) |
| 2115 | AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) |
| 2116 | ], |
| 2117 | [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ] |
| 2118 | ) |
| 2119 | fi |
| 2120 | |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2121 | # On systems where [v]snprintf is broken, but is declared in stdio, |
| 2122 | # check that the fmt argument is const char * or just char *. |
| 2123 | # This is only useful for when BROKEN_SNPRINTF |
| 2124 | AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2125 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2126 | #include <stdio.h> |
| 2127 | int snprintf(char *a, size_t b, const char *c, ...) { return 0; } |
| 2128 | ]], [[ |
| 2129 | snprintf(0, 0, 0); |
| 2130 | ]])], |
| 2131 | [AC_MSG_RESULT([yes]) |
| 2132 | AC_DEFINE([SNPRINTF_CONST], [const], |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2133 | [Define as const if snprintf() can declare const char *fmt])], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2134 | [AC_MSG_RESULT([no]) |
| 2135 | AC_DEFINE([SNPRINTF_CONST], [/* not const */])]) |
Darren Tucker | d40c66c | 2005-12-17 22:32:03 +1100 | [diff] [blame] | 2136 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2137 | # Check for missing getpeereid (or equiv) support |
| 2138 | NO_PEERCHECK="" |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 2139 | 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] | 2140 | AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2141 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2142 | #include <sys/types.h> |
| 2143 | #include <sys/socket.h>]], [[int i = SO_PEERCRED;]])], |
| 2144 | [ AC_MSG_RESULT([yes]) |
| 2145 | AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option]) |
| 2146 | ], [AC_MSG_RESULT([no]) |
| 2147 | NO_PEERCHECK=1 |
| 2148 | ]) |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 2149 | fi |
| 2150 | |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2151 | dnl see whether mkstemp() requires XXXXXX |
| 2152 | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then |
| 2153 | AC_MSG_CHECKING([for (overly) strict mkstemp]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2154 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2155 | [AC_LANG_PROGRAM([[ |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2156 | #include <stdlib.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2157 | ]], [[ |
| 2158 | char template[]="conftest.mkstemp-test"; |
| 2159 | if (mkstemp(template) == -1) |
| 2160 | exit(1); |
| 2161 | unlink(template); |
| 2162 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2163 | ]])], |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2164 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2165 | AC_MSG_RESULT([no]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2166 | ], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2167 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2168 | AC_MSG_RESULT([yes]) |
| 2169 | AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2170 | ], |
| 2171 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2172 | AC_MSG_RESULT([yes]) |
| 2173 | AC_DEFINE([HAVE_STRICT_MKSTEMP]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2174 | ] |
Damien Miller | e832819 | 2003-01-07 15:18:32 +1100 | [diff] [blame] | 2175 | ) |
| 2176 | fi |
| 2177 | |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2178 | dnl make sure that openpty does not reacquire controlling terminal |
| 2179 | if test ! -z "$check_for_openpty_ctty_bug"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2180 | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2181 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2182 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2183 | #include <stdio.h> |
| 2184 | #include <sys/fcntl.h> |
| 2185 | #include <sys/types.h> |
| 2186 | #include <sys/wait.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2187 | ]], [[ |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2188 | pid_t pid; |
| 2189 | int fd, ptyfd, ttyfd, status; |
| 2190 | |
| 2191 | pid = fork(); |
| 2192 | if (pid < 0) { /* failed */ |
| 2193 | exit(1); |
| 2194 | } else if (pid > 0) { /* parent */ |
| 2195 | waitpid(pid, &status, 0); |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 2196 | if (WIFEXITED(status)) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2197 | exit(WEXITSTATUS(status)); |
| 2198 | else |
| 2199 | exit(2); |
| 2200 | } else { /* child */ |
| 2201 | close(0); close(1); close(2); |
| 2202 | setsid(); |
| 2203 | openpty(&ptyfd, &ttyfd, NULL, NULL, NULL); |
| 2204 | fd = open("/dev/tty", O_RDWR | O_NOCTTY); |
| 2205 | if (fd >= 0) |
| 2206 | exit(3); /* Acquired ctty: broken */ |
| 2207 | else |
| 2208 | exit(0); /* Did not acquire ctty: OK */ |
| 2209 | } |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2210 | ]])], |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2211 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2212 | AC_MSG_RESULT([yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2213 | ], |
| 2214 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2215 | AC_MSG_RESULT([no]) |
| 2216 | AC_DEFINE([SSHD_ACQUIRES_CTTY]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2217 | ], |
| 2218 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2219 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 70a3d55 | 2003-08-21 17:58:29 +1000 | [diff] [blame] | 2220 | ] |
| 2221 | ) |
| 2222 | fi |
| 2223 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2224 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2225 | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2226 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2227 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2228 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2229 | #include <stdio.h> |
| 2230 | #include <sys/socket.h> |
| 2231 | #include <netdb.h> |
| 2232 | #include <errno.h> |
| 2233 | #include <netinet/in.h> |
| 2234 | |
| 2235 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2236 | ]], [[ |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2237 | int err, sock; |
| 2238 | struct addrinfo *gai_ai, *ai, hints; |
| 2239 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2240 | |
| 2241 | memset(&hints, 0, sizeof(hints)); |
| 2242 | hints.ai_family = PF_UNSPEC; |
| 2243 | hints.ai_socktype = SOCK_STREAM; |
| 2244 | hints.ai_flags = AI_PASSIVE; |
| 2245 | |
| 2246 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2247 | if (err != 0) { |
| 2248 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2249 | exit(1); |
| 2250 | } |
| 2251 | |
| 2252 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2253 | if (ai->ai_family != AF_INET6) |
| 2254 | continue; |
| 2255 | |
| 2256 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2257 | sizeof(ntop), strport, sizeof(strport), |
| 2258 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2259 | |
| 2260 | if (err != 0) { |
| 2261 | if (err == EAI_SYSTEM) |
| 2262 | perror("getnameinfo EAI_SYSTEM"); |
| 2263 | else |
| 2264 | fprintf(stderr, "getnameinfo failed: %s\n", |
| 2265 | gai_strerror(err)); |
| 2266 | exit(2); |
| 2267 | } |
| 2268 | |
| 2269 | sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 2270 | if (sock < 0) |
| 2271 | perror("socket"); |
| 2272 | if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 2273 | if (errno == EBADF) |
| 2274 | exit(3); |
| 2275 | } |
| 2276 | } |
| 2277 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2278 | ]])], |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2279 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2280 | AC_MSG_RESULT([yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2281 | ], |
| 2282 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2283 | AC_MSG_RESULT([no]) |
| 2284 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2285 | ], |
| 2286 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2287 | AC_MSG_RESULT([cross-compiling, assuming yes]) |
Darren Tucker | 4398cf5 | 2004-04-06 21:39:02 +1000 | [diff] [blame] | 2288 | ] |
| 2289 | ) |
| 2290 | fi |
| 2291 | |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 2292 | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ |
| 2293 | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2294 | AC_MSG_CHECKING([if getaddrinfo seems to work]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2295 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2296 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2297 | #include <stdio.h> |
| 2298 | #include <sys/socket.h> |
| 2299 | #include <netdb.h> |
| 2300 | #include <errno.h> |
| 2301 | #include <netinet/in.h> |
| 2302 | |
| 2303 | #define TEST_PORT "2222" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2304 | ]], [[ |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2305 | int err, sock; |
| 2306 | struct addrinfo *gai_ai, *ai, hints; |
| 2307 | char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; |
| 2308 | |
| 2309 | memset(&hints, 0, sizeof(hints)); |
| 2310 | hints.ai_family = PF_UNSPEC; |
| 2311 | hints.ai_socktype = SOCK_STREAM; |
| 2312 | hints.ai_flags = AI_PASSIVE; |
| 2313 | |
| 2314 | err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); |
| 2315 | if (err != 0) { |
| 2316 | fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); |
| 2317 | exit(1); |
| 2318 | } |
| 2319 | |
| 2320 | for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { |
| 2321 | if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) |
| 2322 | continue; |
| 2323 | |
| 2324 | err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, |
| 2325 | sizeof(ntop), strport, sizeof(strport), |
| 2326 | NI_NUMERICHOST|NI_NUMERICSERV); |
| 2327 | |
| 2328 | if (ai->ai_family == AF_INET && err != 0) { |
| 2329 | perror("getnameinfo"); |
| 2330 | exit(2); |
| 2331 | } |
| 2332 | } |
| 2333 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2334 | ]])], |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2335 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2336 | AC_MSG_RESULT([yes]) |
| 2337 | AC_DEFINE([AIX_GETNAMEINFO_HACK], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 2338 | [Define if you have a getaddrinfo that fails |
| 2339 | for the all-zeros IPv6 address]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2340 | ], |
| 2341 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2342 | AC_MSG_RESULT([no]) |
| 2343 | AC_DEFINE([BROKEN_GETADDRINFO]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 2344 | ], |
Darren Tucker | 8b272ab | 2006-06-27 11:20:28 +1000 | [diff] [blame] | 2345 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2346 | AC_MSG_RESULT([cross-compiling, assuming no]) |
Darren Tucker | 691d523 | 2005-02-15 21:45:57 +1100 | [diff] [blame] | 2347 | ] |
| 2348 | ) |
| 2349 | fi |
| 2350 | |
Darren Tucker | e50e8c9 | 2015-02-21 15:10:33 +1100 | [diff] [blame] | 2351 | if test "x$ac_cv_func_getaddrinfo" = "xyes"; then |
| 2352 | AC_CHECK_DECLS(AI_NUMERICSERV, , , |
| 2353 | [#include <sys/types.h> |
| 2354 | #include <sys/socket.h> |
| 2355 | #include <netdb.h>]) |
| 2356 | fi |
| 2357 | |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2358 | if test "x$check_for_conflicting_getspnam" = "x1"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2359 | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) |
| 2360 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], |
| 2361 | [[ exit(0); ]])], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2362 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2363 | AC_MSG_RESULT([no]) |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2364 | ], |
| 2365 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2366 | AC_MSG_RESULT([yes]) |
| 2367 | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], |
Darren Tucker | a56f191 | 2004-11-02 20:30:54 +1100 | [diff] [blame] | 2368 | [Conflicting defs for getspnam]) |
| 2369 | ] |
| 2370 | ) |
| 2371 | fi |
| 2372 | |
Darren Tucker | 20e5e8b | 2016-08-02 12:16:34 +1000 | [diff] [blame] | 2373 | dnl NetBSD added an strnvis and unfortunately made it incompatible with the |
| 2374 | dnl existing one in OpenBSD and Linux's libbsd (the former having existed |
| 2375 | dnl for over ten years). Despite this incompatibility being reported during |
| 2376 | dnl development (see http://gnats.netbsd.org/44977) they still shipped it. |
| 2377 | dnl Even more unfortunately FreeBSD and later MacOS picked up this incompatible |
| 2378 | dnl implementation. Try to detect this mess, and assume the only safe option |
| 2379 | dnl if we're cross compiling. |
| 2380 | dnl |
| 2381 | dnl OpenBSD, 2001: strnvis(char *dst, const char *src, size_t dlen, int flag); |
| 2382 | dnl NetBSD: 2012, strnvis(char *dst, size_t dlen, const char *src, int flag); |
| 2383 | if test "x$ac_cv_func_strnvis" = "xyes"; then |
| 2384 | AC_MSG_CHECKING([for working strnvis]) |
| 2385 | AC_RUN_IFELSE( |
| 2386 | [AC_LANG_PROGRAM([[ |
| 2387 | #include <signal.h> |
| 2388 | #include <stdlib.h> |
| 2389 | #include <string.h> |
| 2390 | #include <vis.h> |
| 2391 | static void sighandler(int sig) { _exit(1); } |
| 2392 | ]], [[ |
| 2393 | char dst[16]; |
| 2394 | |
| 2395 | signal(SIGSEGV, sighandler); |
| 2396 | if (strnvis(dst, "src", 4, 0) && strcmp(dst, "src") == 0) |
| 2397 | exit(0); |
| 2398 | exit(1) |
| 2399 | ]])], |
| 2400 | [AC_MSG_RESULT([yes])], |
| 2401 | [AC_MSG_RESULT([no]) |
| 2402 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis detected broken])], |
| 2403 | [AC_MSG_WARN([cross compiling: assuming broken]) |
| 2404 | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis assumed broken])] |
| 2405 | ) |
| 2406 | fi |
| 2407 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 2408 | AC_FUNC_GETPGRP |
| 2409 | |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2410 | # Search for OpenSSL |
| 2411 | saved_CPPFLAGS="$CPPFLAGS" |
| 2412 | saved_LDFLAGS="$LDFLAGS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2413 | AC_ARG_WITH([ssl-dir], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2414 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 2415 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2416 | if test "x$openssl" = "xno" ; then |
| 2417 | AC_MSG_ERROR([cannot use --with-ssl-dir when OpenSSL disabled]) |
| 2418 | fi |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 2419 | if test "x$withval" != "xno" ; then |
Darren Tucker | c7e38d5 | 2005-02-09 22:12:30 +1100 | [diff] [blame] | 2420 | case "$withval" in |
| 2421 | # Relative paths |
| 2422 | ./*|../*) withval="`pwd`/$withval" |
| 2423 | esac |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2424 | if test -d "$withval/lib"; then |
| 2425 | if test -n "${need_dash_r}"; then |
| 2426 | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" |
| 2427 | else |
| 2428 | LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
| 2429 | fi |
Darren Tucker | 9f8703b | 2010-04-23 11:12:06 +1000 | [diff] [blame] | 2430 | elif test -d "$withval/lib64"; then |
| 2431 | if test -n "${need_dash_r}"; then |
| 2432 | LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" |
| 2433 | else |
| 2434 | LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" |
| 2435 | fi |
Tim Rice | aef7371 | 2002-05-11 13:17:42 -0700 | [diff] [blame] | 2436 | else |
| 2437 | if test -n "${need_dash_r}"; then |
| 2438 | LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" |
| 2439 | else |
| 2440 | LDFLAGS="-L${withval} ${LDFLAGS}" |
| 2441 | fi |
| 2442 | fi |
| 2443 | if test -d "$withval/include"; then |
| 2444 | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
| 2445 | else |
| 2446 | CPPFLAGS="-I${withval} ${CPPFLAGS}" |
| 2447 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 2448 | fi |
| 2449 | ] |
| 2450 | ) |
Damien Miller | b9c5667 | 2014-05-15 14:43:37 +1000 | [diff] [blame] | 2451 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2452 | AC_ARG_WITH([openssl-header-check], |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2453 | [ --without-openssl-header-check Disable OpenSSL version consistency check], |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2454 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2455 | if test "x$withval" = "xno" ; then |
| 2456 | openssl_check_nonfatal=1 |
Damien Miller | 9975e48 | 2007-03-05 11:51:27 +1100 | [diff] [blame] | 2457 | fi |
Damien Miller | ec93237 | 2002-01-22 22:16:03 +1100 | [diff] [blame] | 2458 | ] |
| 2459 | ) |
| 2460 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2461 | openssl_engine=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2462 | AC_ARG_WITH([ssl-engine], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2463 | [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2464 | [ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2465 | if test "x$withval" != "xno" ; then |
Darren Tucker | b5fa0cd | 2015-12-15 15:10:32 +1100 | [diff] [blame] | 2466 | if test "x$openssl" = "xno" ; then |
| 2467 | AC_MSG_ERROR([cannot use --with-ssl-engine when OpenSSL disabled]) |
| 2468 | fi |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2469 | openssl_engine=yes |
| 2470 | fi |
| 2471 | ] |
| 2472 | ) |
| 2473 | |
| 2474 | if test "x$openssl" = "xyes" ; then |
| 2475 | LIBS="-lcrypto $LIBS" |
| 2476 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1], |
| 2477 | [Define if your ssl headers are included |
| 2478 | with #include <openssl/header.h>])], |
| 2479 | [ |
| 2480 | dnl Check default openssl install dir |
| 2481 | if test -n "${need_dash_r}"; then |
| 2482 | LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2483 | else |
| 2484 | LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}" |
| 2485 | fi |
| 2486 | CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" |
| 2487 | AC_CHECK_HEADER([openssl/opensslv.h], , |
| 2488 | [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])]) |
| 2489 | AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])], |
| 2490 | [ |
| 2491 | AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) |
| 2492 | ] |
| 2493 | ) |
| 2494 | ] |
| 2495 | ) |
| 2496 | |
| 2497 | # Determine OpenSSL header version |
| 2498 | AC_MSG_CHECKING([OpenSSL header version]) |
| 2499 | AC_RUN_IFELSE( |
| 2500 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 1560596 | 2015-11-10 11:14:47 +1100 | [diff] [blame] | 2501 | #include <stdlib.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2502 | #include <stdio.h> |
| 2503 | #include <string.h> |
| 2504 | #include <openssl/opensslv.h> |
| 2505 | #define DATA "conftest.sslincver" |
| 2506 | ]], [[ |
| 2507 | FILE *fd; |
| 2508 | int rc; |
| 2509 | |
| 2510 | fd = fopen(DATA,"w"); |
| 2511 | if(fd == NULL) |
| 2512 | exit(1); |
| 2513 | |
Darren Tucker | b341353 | 2016-04-04 11:09:21 +1000 | [diff] [blame] | 2514 | if ((rc = fprintf(fd, "%08lx (%s)\n", |
| 2515 | (unsigned long)OPENSSL_VERSION_NUMBER, |
| 2516 | OPENSSL_VERSION_TEXT)) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2517 | exit(1); |
| 2518 | |
| 2519 | exit(0); |
| 2520 | ]])], |
| 2521 | [ |
| 2522 | ssl_header_ver=`cat conftest.sslincver` |
| 2523 | AC_MSG_RESULT([$ssl_header_ver]) |
| 2524 | ], |
| 2525 | [ |
| 2526 | AC_MSG_RESULT([not found]) |
| 2527 | AC_MSG_ERROR([OpenSSL version header not found.]) |
| 2528 | ], |
| 2529 | [ |
| 2530 | AC_MSG_WARN([cross compiling: not checking]) |
| 2531 | ] |
| 2532 | ) |
| 2533 | |
| 2534 | # Determine OpenSSL library version |
| 2535 | AC_MSG_CHECKING([OpenSSL library version]) |
| 2536 | AC_RUN_IFELSE( |
| 2537 | [AC_LANG_PROGRAM([[ |
| 2538 | #include <stdio.h> |
| 2539 | #include <string.h> |
| 2540 | #include <openssl/opensslv.h> |
| 2541 | #include <openssl/crypto.h> |
| 2542 | #define DATA "conftest.ssllibver" |
| 2543 | ]], [[ |
| 2544 | FILE *fd; |
| 2545 | int rc; |
| 2546 | |
| 2547 | fd = fopen(DATA,"w"); |
| 2548 | if(fd == NULL) |
| 2549 | exit(1); |
| 2550 | |
Darren Tucker | 815bcac | 2016-04-04 11:07:59 +1000 | [diff] [blame] | 2551 | if ((rc = fprintf(fd, "%08lx (%s)\n", (unsigned long)SSLeay(), |
| 2552 | SSLeay_version(SSLEAY_VERSION))) < 0) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2553 | exit(1); |
| 2554 | |
| 2555 | exit(0); |
| 2556 | ]])], |
| 2557 | [ |
| 2558 | ssl_library_ver=`cat conftest.ssllibver` |
| 2559 | # Check version is supported. |
| 2560 | case "$ssl_library_ver" in |
Damien Miller | 2429cf7 | 2017-03-14 18:01:52 +1100 | [diff] [blame] | 2561 | 10000*|0*) |
| 2562 | AC_MSG_ERROR([OpenSSL >= 1.0.1 required (have "$ssl_library_ver")]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2563 | ;; |
Damien Miller | 04dc070 | 2017-09-28 14:54:34 -0700 | [diff] [blame] | 2564 | 100*) ;; # 1.0.x |
Damien Miller | bba69c2 | 2017-09-28 16:06:21 -0700 | [diff] [blame] | 2565 | 200*) ;; # LibreSSL |
Damien Miller | 04dc070 | 2017-09-28 14:54:34 -0700 | [diff] [blame] | 2566 | *) |
| 2567 | AC_MSG_ERROR([OpenSSL >= 1.1.0 is not yet supported (have "$ssl_library_ver")]) |
| 2568 | ;; |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2569 | esac |
| 2570 | AC_MSG_RESULT([$ssl_library_ver]) |
| 2571 | ], |
| 2572 | [ |
| 2573 | AC_MSG_RESULT([not found]) |
| 2574 | AC_MSG_ERROR([OpenSSL library not found.]) |
| 2575 | ], |
| 2576 | [ |
| 2577 | AC_MSG_WARN([cross compiling: not checking]) |
| 2578 | ] |
| 2579 | ) |
| 2580 | |
| 2581 | # Sanity check OpenSSL headers |
| 2582 | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) |
| 2583 | AC_RUN_IFELSE( |
| 2584 | [AC_LANG_PROGRAM([[ |
| 2585 | #include <string.h> |
| 2586 | #include <openssl/opensslv.h> |
Darren Tucker | c1d7e54 | 2015-12-15 14:27:09 +1100 | [diff] [blame] | 2587 | #include <openssl/crypto.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2588 | ]], [[ |
| 2589 | exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
| 2590 | ]])], |
| 2591 | [ |
| 2592 | AC_MSG_RESULT([yes]) |
| 2593 | ], |
| 2594 | [ |
| 2595 | AC_MSG_RESULT([no]) |
| 2596 | if test "x$openssl_check_nonfatal" = "x"; then |
| 2597 | AC_MSG_ERROR([Your OpenSSL headers do not match your |
| 2598 | library. Check config.log for details. |
| 2599 | If you are sure your installation is consistent, you can disable the check |
| 2600 | by running "./configure --without-openssl-header-check". |
| 2601 | Also see contrib/findssl.sh for help identifying header/library mismatches. |
| 2602 | ]) |
| 2603 | else |
| 2604 | AC_MSG_WARN([Your OpenSSL headers do not match your |
| 2605 | library. Check config.log for details. |
| 2606 | Also see contrib/findssl.sh for help identifying header/library mismatches.]) |
| 2607 | fi |
| 2608 | ], |
| 2609 | [ |
| 2610 | AC_MSG_WARN([cross compiling: not checking]) |
| 2611 | ] |
| 2612 | ) |
| 2613 | |
| 2614 | AC_MSG_CHECKING([if programs using OpenSSL functions will link]) |
| 2615 | AC_LINK_IFELSE( |
| 2616 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2617 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2618 | [ |
| 2619 | AC_MSG_RESULT([yes]) |
| 2620 | ], |
| 2621 | [ |
| 2622 | AC_MSG_RESULT([no]) |
| 2623 | saved_LIBS="$LIBS" |
| 2624 | LIBS="$LIBS -ldl" |
| 2625 | AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) |
| 2626 | AC_LINK_IFELSE( |
| 2627 | [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]], |
| 2628 | [[ SSLeay_add_all_algorithms(); ]])], |
| 2629 | [ |
| 2630 | AC_MSG_RESULT([yes]) |
| 2631 | ], |
| 2632 | [ |
| 2633 | AC_MSG_RESULT([no]) |
| 2634 | LIBS="$saved_LIBS" |
| 2635 | ] |
| 2636 | ) |
| 2637 | ] |
| 2638 | ) |
| 2639 | |
| 2640 | AC_CHECK_FUNCS([ \ |
| 2641 | BN_is_prime_ex \ |
| 2642 | DSA_generate_parameters_ex \ |
| 2643 | EVP_DigestInit_ex \ |
| 2644 | EVP_DigestFinal_ex \ |
| 2645 | EVP_MD_CTX_init \ |
| 2646 | EVP_MD_CTX_cleanup \ |
| 2647 | EVP_MD_CTX_copy_ex \ |
| 2648 | HMAC_CTX_init \ |
| 2649 | RSA_generate_key_ex \ |
| 2650 | RSA_get_default_method \ |
| 2651 | ]) |
| 2652 | |
| 2653 | if test "x$openssl_engine" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2654 | AC_MSG_CHECKING([for OpenSSL ENGINE support]) |
| 2655 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2656 | #include <openssl/engine.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2657 | ]], [[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2658 | ENGINE_load_builtin_engines(); |
| 2659 | ENGINE_register_all_complete(); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2660 | ]])], |
| 2661 | [ AC_MSG_RESULT([yes]) |
| 2662 | AC_DEFINE([USE_OPENSSL_ENGINE], [1], |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2663 | [Enable OpenSSL engine support]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2664 | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) |
| 2665 | ]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2666 | fi |
Darren Tucker | fabdb6c | 2006-02-20 20:17:35 +1100 | [diff] [blame] | 2667 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2668 | # Check for OpenSSL without EVP_aes_{192,256}_cbc |
| 2669 | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) |
| 2670 | AC_LINK_IFELSE( |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2671 | [AC_LANG_PROGRAM([[ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2672 | #include <string.h> |
| 2673 | #include <openssl/evp.h> |
| 2674 | ]], [[ |
| 2675 | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); |
| 2676 | ]])], |
| 2677 | [ |
| 2678 | AC_MSG_RESULT([no]) |
| 2679 | ], |
| 2680 | [ |
| 2681 | AC_MSG_RESULT([yes]) |
| 2682 | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], |
| 2683 | [libcrypto is missing AES 192 and 256 bit functions]) |
| 2684 | ] |
| 2685 | ) |
| 2686 | |
| 2687 | # Check for OpenSSL with EVP_aes_*ctr |
| 2688 | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) |
| 2689 | AC_LINK_IFELSE( |
| 2690 | [AC_LANG_PROGRAM([[ |
| 2691 | #include <string.h> |
| 2692 | #include <openssl/evp.h> |
| 2693 | ]], [[ |
| 2694 | exit(EVP_aes_128_ctr() == NULL || |
| 2695 | EVP_aes_192_cbc() == NULL || |
| 2696 | EVP_aes_256_cbc() == NULL); |
| 2697 | ]])], |
| 2698 | [ |
| 2699 | AC_MSG_RESULT([yes]) |
| 2700 | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], |
| 2701 | [libcrypto has EVP AES CTR]) |
| 2702 | ], |
| 2703 | [ |
| 2704 | AC_MSG_RESULT([no]) |
| 2705 | ] |
| 2706 | ) |
| 2707 | |
| 2708 | # Check for OpenSSL with EVP_aes_*gcm |
| 2709 | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) |
| 2710 | AC_LINK_IFELSE( |
| 2711 | [AC_LANG_PROGRAM([[ |
| 2712 | #include <string.h> |
| 2713 | #include <openssl/evp.h> |
| 2714 | ]], [[ |
| 2715 | exit(EVP_aes_128_gcm() == NULL || |
| 2716 | EVP_aes_256_gcm() == NULL || |
| 2717 | EVP_CTRL_GCM_SET_IV_FIXED == 0 || |
| 2718 | EVP_CTRL_GCM_IV_GEN == 0 || |
| 2719 | EVP_CTRL_GCM_SET_TAG == 0 || |
| 2720 | EVP_CTRL_GCM_GET_TAG == 0 || |
| 2721 | EVP_CIPHER_CTX_ctrl(NULL, 0, 0, NULL) == 0); |
| 2722 | ]])], |
| 2723 | [ |
| 2724 | AC_MSG_RESULT([yes]) |
| 2725 | AC_DEFINE([OPENSSL_HAVE_EVPGCM], [1], |
| 2726 | [libcrypto has EVP AES GCM]) |
| 2727 | ], |
| 2728 | [ |
| 2729 | AC_MSG_RESULT([no]) |
| 2730 | unsupported_algorithms="$unsupported_cipers \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2731 | aes128-gcm@openssh.com \ |
| 2732 | aes256-gcm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2733 | ] |
| 2734 | ) |
| 2735 | |
| 2736 | AC_SEARCH_LIBS([EVP_CIPHER_CTX_ctrl], [crypto], |
| 2737 | [AC_DEFINE([HAVE_EVP_CIPHER_CTX_CTRL], [1], |
| 2738 | [Define if libcrypto has EVP_CIPHER_CTX_ctrl])]) |
| 2739 | |
| 2740 | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) |
| 2741 | AC_LINK_IFELSE( |
| 2742 | [AC_LANG_PROGRAM([[ |
| 2743 | #include <string.h> |
| 2744 | #include <openssl/evp.h> |
| 2745 | ]], [[ |
| 2746 | if(EVP_DigestUpdate(NULL, NULL,0)) |
| 2747 | exit(0); |
| 2748 | ]])], |
| 2749 | [ |
| 2750 | AC_MSG_RESULT([yes]) |
| 2751 | ], |
| 2752 | [ |
| 2753 | AC_MSG_RESULT([no]) |
| 2754 | AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1], |
| 2755 | [Define if EVP_DigestUpdate returns void]) |
| 2756 | ] |
| 2757 | ) |
| 2758 | |
| 2759 | # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, |
| 2760 | # because the system crypt() is more featureful. |
| 2761 | if test "x$check_for_libcrypt_before" = "x1"; then |
| 2762 | AC_CHECK_LIB([crypt], [crypt]) |
| 2763 | fi |
| 2764 | |
| 2765 | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the |
| 2766 | # version in OpenSSL. |
| 2767 | if test "x$check_for_libcrypt_later" = "x1"; then |
| 2768 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
| 2769 | fi |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2770 | AC_CHECK_FUNCS([crypt DES_crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2771 | |
| 2772 | # Search for SHA256 support in libc and/or OpenSSL |
| 2773 | AC_CHECK_FUNCS([SHA256_Update EVP_sha256], , |
| 2774 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2775 | hmac-sha2-256 \ |
| 2776 | hmac-sha2-512 \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2777 | diffie-hellman-group-exchange-sha256 \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2778 | hmac-sha2-256-etm@openssh.com \ |
| 2779 | hmac-sha2-512-etm@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2780 | ] |
| 2781 | ) |
| 2782 | # Search for RIPE-MD support in OpenSSL |
| 2783 | AC_CHECK_FUNCS([EVP_ripemd160], , |
| 2784 | [unsupported_algorithms="$unsupported_algorithms \ |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2785 | hmac-ripemd160 \ |
| 2786 | hmac-ripemd160@openssh.com \ |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2787 | hmac-ripemd160-etm@openssh.com" |
| 2788 | ] |
| 2789 | ) |
| 2790 | |
| 2791 | # Check complete ECC support in OpenSSL |
| 2792 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) |
| 2793 | AC_LINK_IFELSE( |
| 2794 | [AC_LANG_PROGRAM([[ |
| 2795 | #include <openssl/ec.h> |
| 2796 | #include <openssl/ecdh.h> |
| 2797 | #include <openssl/ecdsa.h> |
| 2798 | #include <openssl/evp.h> |
| 2799 | #include <openssl/objects.h> |
| 2800 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2801 | ]], [[ |
| 2802 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
| 2803 | const EVP_MD *m = EVP_sha256(); /* We need this too */ |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2804 | ]])], |
| 2805 | [ AC_MSG_RESULT([yes]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2806 | enable_nistp256=1 ], |
| 2807 | [ AC_MSG_RESULT([no]) ] |
| 2808 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2809 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2810 | AC_MSG_CHECKING([whether OpenSSL has NID_secp384r1]) |
| 2811 | AC_LINK_IFELSE( |
| 2812 | [AC_LANG_PROGRAM([[ |
| 2813 | #include <openssl/ec.h> |
| 2814 | #include <openssl/ecdh.h> |
| 2815 | #include <openssl/ecdsa.h> |
| 2816 | #include <openssl/evp.h> |
| 2817 | #include <openssl/objects.h> |
| 2818 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2819 | ]], [[ |
| 2820 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1); |
| 2821 | const EVP_MD *m = EVP_sha384(); /* We need this too */ |
| 2822 | ]])], |
| 2823 | [ AC_MSG_RESULT([yes]) |
| 2824 | enable_nistp384=1 ], |
| 2825 | [ AC_MSG_RESULT([no]) ] |
| 2826 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2827 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2828 | AC_MSG_CHECKING([whether OpenSSL has NID_secp521r1]) |
| 2829 | AC_LINK_IFELSE( |
| 2830 | [AC_LANG_PROGRAM([[ |
| 2831 | #include <openssl/ec.h> |
| 2832 | #include <openssl/ecdh.h> |
| 2833 | #include <openssl/ecdsa.h> |
| 2834 | #include <openssl/evp.h> |
| 2835 | #include <openssl/objects.h> |
| 2836 | #include <openssl/opensslv.h> |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2837 | ]], [[ |
| 2838 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2839 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2840 | ]])], |
| 2841 | [ AC_MSG_RESULT([yes]) |
| 2842 | AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) |
| 2843 | AC_RUN_IFELSE( |
| 2844 | [AC_LANG_PROGRAM([[ |
| 2845 | #include <openssl/ec.h> |
| 2846 | #include <openssl/ecdh.h> |
| 2847 | #include <openssl/ecdsa.h> |
| 2848 | #include <openssl/evp.h> |
| 2849 | #include <openssl/objects.h> |
| 2850 | #include <openssl/opensslv.h> |
| 2851 | ]],[[ |
| 2852 | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 2853 | const EVP_MD *m = EVP_sha512(); /* We need this too */ |
| 2854 | exit(e == NULL || m == NULL); |
| 2855 | ]])], |
| 2856 | [ AC_MSG_RESULT([yes]) |
| 2857 | enable_nistp521=1 ], |
| 2858 | [ AC_MSG_RESULT([no]) ], |
| 2859 | [ AC_MSG_WARN([cross-compiling: assuming yes]) |
| 2860 | enable_nistp521=1 ] |
| 2861 | )], |
| 2862 | AC_MSG_RESULT([no]) |
| 2863 | ) |
Darren Tucker | 37bcef5 | 2013-11-09 18:39:25 +1100 | [diff] [blame] | 2864 | |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2865 | COMMENT_OUT_ECC="#no ecc#" |
| 2866 | TEST_SSH_ECC=no |
| 2867 | |
| 2868 | if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ |
| 2869 | test x$enable_nistp521 = x1; then |
| 2870 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) |
| 2871 | fi |
| 2872 | if test x$enable_nistp256 = x1; then |
| 2873 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], |
| 2874 | [libcrypto has NID_X9_62_prime256v1]) |
| 2875 | TEST_SSH_ECC=yes |
| 2876 | COMMENT_OUT_ECC="" |
| 2877 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2878 | unsupported_algorithms="$unsupported_algorithms \ |
| 2879 | ecdsa-sha2-nistp256 \ |
| 2880 | ecdh-sha2-nistp256 \ |
| 2881 | ecdsa-sha2-nistp256-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2882 | fi |
| 2883 | if test x$enable_nistp384 = x1; then |
| 2884 | AC_DEFINE([OPENSSL_HAS_NISTP384], [1], [libcrypto has NID_secp384r1]) |
| 2885 | TEST_SSH_ECC=yes |
| 2886 | COMMENT_OUT_ECC="" |
| 2887 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2888 | unsupported_algorithms="$unsupported_algorithms \ |
| 2889 | ecdsa-sha2-nistp384 \ |
| 2890 | ecdh-sha2-nistp384 \ |
| 2891 | ecdsa-sha2-nistp384-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2892 | fi |
| 2893 | if test x$enable_nistp521 = x1; then |
| 2894 | AC_DEFINE([OPENSSL_HAS_NISTP521], [1], [libcrypto has NID_secp521r1]) |
| 2895 | TEST_SSH_ECC=yes |
| 2896 | COMMENT_OUT_ECC="" |
| 2897 | else |
Damien Miller | 679ce88 | 2016-07-15 13:44:38 +1000 | [diff] [blame] | 2898 | unsupported_algorithms="$unsupported_algorithms \ |
| 2899 | ecdh-sha2-nistp521 \ |
| 2900 | ecdsa-sha2-nistp521 \ |
| 2901 | ecdsa-sha2-nistp521-cert-v01@openssh.com" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2902 | fi |
| 2903 | |
| 2904 | AC_SUBST([TEST_SSH_ECC]) |
| 2905 | AC_SUBST([COMMENT_OUT_ECC]) |
| 2906 | else |
| 2907 | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) |
Damien Miller | 00797e8 | 2015-03-04 05:02:45 +1100 | [diff] [blame] | 2908 | AC_CHECK_FUNCS([crypt]) |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2909 | fi |
Damien Miller | 6af914a | 2010-09-10 11:39:26 +1000 | [diff] [blame] | 2910 | |
Damien Miller | 00f9cd2 | 2014-07-15 10:41:38 +1000 | [diff] [blame] | 2911 | AC_CHECK_FUNCS([ \ |
| 2912 | arc4random \ |
| 2913 | arc4random_buf \ |
| 2914 | arc4random_stir \ |
| 2915 | arc4random_uniform \ |
| 2916 | ]) |
| 2917 | |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2918 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2919 | AC_CHECK_LIB([iaf], [ia_openinfo], [ |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2920 | LIBS="$LIBS -liaf" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 2921 | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" |
| 2922 | AC_DEFINE([HAVE_LIBIAF], [1], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 2923 | [Define if system has libiaf that supports set_id]) |
Tim Rice | 0eeaf12 | 2007-09-10 16:24:17 -0700 | [diff] [blame] | 2924 | ]) |
Tim Rice | 99203ec | 2007-03-26 09:35:28 -0700 | [diff] [blame] | 2925 | ]) |
| 2926 | LIBS="$saved_LIBS" |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2927 | |
| 2928 | ### Configure cryptographic random number support |
| 2929 | |
| 2930 | # Check wheter OpenSSL seeds itself |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 2931 | if test "x$openssl" = "xyes" ; then |
| 2932 | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) |
| 2933 | AC_RUN_IFELSE( |
| 2934 | [AC_LANG_PROGRAM([[ |
| 2935 | #include <string.h> |
| 2936 | #include <openssl/rand.h> |
| 2937 | ]], [[ |
| 2938 | exit(RAND_status() == 1 ? 0 : 1); |
| 2939 | ]])], |
| 2940 | [ |
| 2941 | OPENSSL_SEEDS_ITSELF=yes |
| 2942 | AC_MSG_RESULT([yes]) |
| 2943 | ], |
| 2944 | [ |
| 2945 | AC_MSG_RESULT([no]) |
| 2946 | ], |
| 2947 | [ |
| 2948 | AC_MSG_WARN([cross compiling: assuming yes]) |
| 2949 | # This is safe, since we will fatal() at runtime if |
| 2950 | # OpenSSL is not seeded correctly. |
| 2951 | OPENSSL_SEEDS_ITSELF=yes |
| 2952 | ] |
| 2953 | ) |
| 2954 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 2955 | |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 2956 | # PRNGD TCP socket |
| 2957 | AC_ARG_WITH([prngd-port], |
| 2958 | [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], |
| 2959 | [ |
| 2960 | case "$withval" in |
| 2961 | no) |
| 2962 | withval="" |
| 2963 | ;; |
| 2964 | [[0-9]]*) |
| 2965 | ;; |
| 2966 | *) |
| 2967 | AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port]) |
| 2968 | ;; |
| 2969 | esac |
| 2970 | if test ! -z "$withval" ; then |
| 2971 | PRNGD_PORT="$withval" |
| 2972 | AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT], |
| 2973 | [Port number of PRNGD/EGD random number socket]) |
| 2974 | fi |
| 2975 | ] |
| 2976 | ) |
| 2977 | |
| 2978 | # PRNGD Unix domain socket |
| 2979 | AC_ARG_WITH([prngd-socket], |
| 2980 | [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], |
| 2981 | [ |
| 2982 | case "$withval" in |
| 2983 | yes) |
| 2984 | withval="/var/run/egd-pool" |
| 2985 | ;; |
| 2986 | no) |
| 2987 | withval="" |
| 2988 | ;; |
| 2989 | /*) |
| 2990 | ;; |
| 2991 | *) |
| 2992 | AC_MSG_ERROR([You must specify an absolute path to the entropy socket]) |
| 2993 | ;; |
| 2994 | esac |
| 2995 | |
| 2996 | if test ! -z "$withval" ; then |
| 2997 | if test ! -z "$PRNGD_PORT" ; then |
| 2998 | AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket]) |
| 2999 | fi |
| 3000 | if test ! -r "$withval" ; then |
| 3001 | AC_MSG_WARN([Entropy socket is not readable]) |
| 3002 | fi |
| 3003 | PRNGD_SOCKET="$withval" |
| 3004 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"], |
| 3005 | [Location of PRNGD/EGD random number socket]) |
| 3006 | fi |
| 3007 | ], |
| 3008 | [ |
| 3009 | # Check for existing socket only if we don't have a random device already |
| 3010 | if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then |
| 3011 | AC_MSG_CHECKING([for PRNGD/EGD socket]) |
| 3012 | # Insert other locations here |
| 3013 | for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do |
| 3014 | if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then |
| 3015 | PRNGD_SOCKET="$sock" |
| 3016 | AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"]) |
| 3017 | break; |
| 3018 | fi |
| 3019 | done |
| 3020 | if test ! -z "$PRNGD_SOCKET" ; then |
| 3021 | AC_MSG_RESULT([$PRNGD_SOCKET]) |
| 3022 | else |
| 3023 | AC_MSG_RESULT([not found]) |
| 3024 | fi |
| 3025 | fi |
| 3026 | ] |
| 3027 | ) |
| 3028 | |
| 3029 | # Which randomness source do we use? |
| 3030 | if test ! -z "$PRNGD_PORT" ; then |
| 3031 | RAND_MSG="PRNGd port $PRNGD_PORT" |
| 3032 | elif test ! -z "$PRNGD_SOCKET" ; then |
| 3033 | RAND_MSG="PRNGd socket $PRNGD_SOCKET" |
| 3034 | elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then |
| 3035 | AC_DEFINE([OPENSSL_PRNG_ONLY], [1], |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3036 | [Define if you want the OpenSSL internally seeded PRNG only]) |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 3037 | RAND_MSG="OpenSSL internal ONLY" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3038 | elif test "x$openssl" = "xno" ; then |
| 3039 | 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] | 3040 | else |
| 3041 | 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]) |
| 3042 | fi |
| 3043 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3044 | # Check for PAM libs |
| 3045 | PAM_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3046 | AC_ARG_WITH([pam], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3047 | [ --with-pam Enable PAM support ], |
| 3048 | [ |
| 3049 | if test "x$withval" != "xno" ; then |
| 3050 | if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ |
| 3051 | test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then |
| 3052 | AC_MSG_ERROR([PAM headers not found]) |
| 3053 | fi |
| 3054 | |
| 3055 | saved_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3056 | AC_CHECK_LIB([dl], [dlopen], , ) |
| 3057 | AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) |
| 3058 | AC_CHECK_FUNCS([pam_getenvlist]) |
| 3059 | AC_CHECK_FUNCS([pam_putenv]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3060 | LIBS="$saved_LIBS" |
| 3061 | |
| 3062 | PAM_MSG="yes" |
| 3063 | |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3064 | SSHDLIBS="$SSHDLIBS -lpam" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3065 | AC_DEFINE([USE_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3066 | [Define if you want to enable PAM support]) |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3067 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3068 | if test $ac_cv_lib_dl_dlopen = yes; then |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3069 | case "$LIBS" in |
| 3070 | *-ldl*) |
| 3071 | # libdl already in LIBS |
| 3072 | ;; |
| 3073 | *) |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 3074 | SSHDLIBS="$SSHDLIBS -ldl" |
Darren Tucker | 639bbe8 | 2006-08-20 20:17:53 +1000 | [diff] [blame] | 3075 | ;; |
| 3076 | esac |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3077 | fi |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3078 | fi |
| 3079 | ] |
| 3080 | ) |
| 3081 | |
Damien Miller | 8bd81e1 | 2016-08-16 13:30:56 +1000 | [diff] [blame] | 3082 | AC_ARG_WITH([pam-service], |
| 3083 | [ --with-pam-service=name Specify PAM service name ], |
| 3084 | [ |
| 3085 | if test "x$withval" != "xno" && \ |
| 3086 | test "x$withval" != "xyes" ; then |
| 3087 | AC_DEFINE_UNQUOTED([SSHD_PAM_SERVICE], |
| 3088 | ["$withval"], [sshd PAM service name]) |
| 3089 | fi |
| 3090 | ] |
| 3091 | ) |
| 3092 | |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3093 | # Check for older PAM |
| 3094 | if test "x$PAM_MSG" = "xyes" ; then |
| 3095 | # Check PAM strerror arguments (old PAM) |
| 3096 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3097 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3098 | #include <stdlib.h> |
| 3099 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
| 3100 | #include <security/pam_appl.h> |
| 3101 | #elif defined (HAVE_PAM_PAM_APPL_H) |
| 3102 | #include <pam/pam_appl.h> |
| 3103 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3104 | ]], [[ |
| 3105 | (void)pam_strerror((pam_handle_t *)NULL, -1); |
| 3106 | ]])], [AC_MSG_RESULT([no])], [ |
| 3107 | AC_DEFINE([HAVE_OLD_PAM], [1], |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3108 | [Define if you have an old version of PAM |
| 3109 | which takes only one argument to pam_strerror]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3110 | AC_MSG_RESULT([yes]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3111 | PAM_MSG="yes (old library)" |
Damien Miller | 72ef7c1 | 2015-01-15 02:21:31 +1100 | [diff] [blame] | 3112 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3113 | ]) |
Darren Tucker | 3e6bde4 | 2006-08-20 20:03:50 +1000 | [diff] [blame] | 3114 | fi |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 3115 | |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3116 | case "$host" in |
| 3117 | *-*-cygwin*) |
| 3118 | SSH_PRIVSEP_USER=CYGWIN_SSH_PRIVSEP_USER |
| 3119 | ;; |
| 3120 | *) |
| 3121 | SSH_PRIVSEP_USER=sshd |
| 3122 | ;; |
| 3123 | esac |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3124 | AC_ARG_WITH([privsep-user], |
Kevin Steves | c81e129 | 2002-05-13 03:51:40 +0000 | [diff] [blame] | 3125 | [ --with-privsep-user=user Specify non-privileged user for privilege separation], |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3126 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 3127 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 3128 | test "x${withval}" != "xyes"; then |
Damien Miller | d3f6ad2 | 2002-06-25 10:24:47 +1000 | [diff] [blame] | 3129 | SSH_PRIVSEP_USER=$withval |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3130 | fi |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 3131 | ] |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3132 | ) |
Damien Miller | 6482d90 | 2014-05-27 14:34:42 +1000 | [diff] [blame] | 3133 | if test "x$SSH_PRIVSEP_USER" = "xCYGWIN_SSH_PRIVSEP_USER" ; then |
| 3134 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], [CYGWIN_SSH_PRIVSEP_USER], |
| 3135 | [Cygwin function to fetch non-privileged user for privilege separation]) |
| 3136 | else |
| 3137 | AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"], |
| 3138 | [non-privileged user for privilege separation]) |
| 3139 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3140 | AC_SUBST([SSH_PRIVSEP_USER]) |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 3141 | |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3142 | if test "x$have_linux_no_new_privs" = "x1" ; then |
| 3143 | AC_CHECK_DECL([SECCOMP_MODE_FILTER], [have_seccomp_filter=1], , [ |
| 3144 | #include <sys/types.h> |
| 3145 | #include <linux/seccomp.h> |
| 3146 | ]) |
| 3147 | fi |
| 3148 | if test "x$have_seccomp_filter" = "x1" ; then |
| 3149 | AC_MSG_CHECKING([kernel for seccomp_filter support]) |
| 3150 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3151 | #include <errno.h> |
| 3152 | #include <elf.h> |
| 3153 | #include <linux/audit.h> |
| 3154 | #include <linux/seccomp.h> |
| 3155 | #include <stdlib.h> |
| 3156 | #include <sys/prctl.h> |
| 3157 | ]], |
| 3158 | [[ int i = $seccomp_audit_arch; |
| 3159 | errno = 0; |
| 3160 | prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0); |
| 3161 | exit(errno == EFAULT ? 0 : 1); ]])], |
| 3162 | [ AC_MSG_RESULT([yes]) ], [ |
| 3163 | AC_MSG_RESULT([no]) |
| 3164 | # Disable seccomp filter as a target |
| 3165 | have_seccomp_filter=0 |
| 3166 | ] |
| 3167 | ) |
| 3168 | fi |
| 3169 | |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3170 | # Decide which sandbox style to use |
| 3171 | sandbox_arg="" |
| 3172 | AC_ARG_WITH([sandbox], |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3173 | [ --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] | 3174 | [ |
| 3175 | if test "x$withval" = "xyes" ; then |
| 3176 | sandbox_arg="" |
| 3177 | else |
| 3178 | sandbox_arg="$withval" |
| 3179 | fi |
| 3180 | ] |
| 3181 | ) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3182 | |
| 3183 | # Some platforms (seems to be the ones that have a kernel poll(2)-type |
| 3184 | # function with which they implement select(2)) use an extra file descriptor |
| 3185 | # when calling select(2), which means we can't use the rlimit sandbox. |
| 3186 | AC_MSG_CHECKING([if select works with descriptor rlimit]) |
| 3187 | AC_RUN_IFELSE( |
| 3188 | [AC_LANG_PROGRAM([[ |
| 3189 | #include <sys/types.h> |
| 3190 | #ifdef HAVE_SYS_TIME_H |
| 3191 | # include <sys/time.h> |
| 3192 | #endif |
| 3193 | #include <sys/resource.h> |
| 3194 | #ifdef HAVE_SYS_SELECT_H |
| 3195 | # include <sys/select.h> |
| 3196 | #endif |
| 3197 | #include <errno.h> |
| 3198 | #include <fcntl.h> |
| 3199 | #include <stdlib.h> |
| 3200 | ]],[[ |
| 3201 | struct rlimit rl_zero; |
| 3202 | int fd, r; |
| 3203 | fd_set fds; |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3204 | struct timeval tv; |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3205 | |
| 3206 | fd = open("/dev/null", O_RDONLY); |
| 3207 | FD_ZERO(&fds); |
| 3208 | FD_SET(fd, &fds); |
| 3209 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3210 | setrlimit(RLIMIT_FSIZE, &rl_zero); |
| 3211 | setrlimit(RLIMIT_NOFILE, &rl_zero); |
Damien Miller | e4f4347 | 2013-03-08 12:14:22 +1100 | [diff] [blame] | 3212 | tv.tv_sec = 1; |
| 3213 | tv.tv_usec = 0; |
| 3214 | r = select(fd+1, &fds, NULL, NULL, &tv); |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3215 | exit (r == -1 ? 1 : 0); |
| 3216 | ]])], |
| 3217 | [AC_MSG_RESULT([yes]) |
| 3218 | select_works_with_rlimit=yes], |
| 3219 | [AC_MSG_RESULT([no]) |
| 3220 | select_works_with_rlimit=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame] | 3221 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3222 | select_works_with_rlimit=yes] |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3223 | ) |
| 3224 | |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3225 | AC_MSG_CHECKING([if setrlimit(RLIMIT_NOFILE,{0,0}) works]) |
| 3226 | AC_RUN_IFELSE( |
| 3227 | [AC_LANG_PROGRAM([[ |
| 3228 | #include <sys/types.h> |
| 3229 | #ifdef HAVE_SYS_TIME_H |
| 3230 | # include <sys/time.h> |
| 3231 | #endif |
| 3232 | #include <sys/resource.h> |
| 3233 | #include <errno.h> |
| 3234 | #include <stdlib.h> |
| 3235 | ]],[[ |
| 3236 | struct rlimit rl_zero; |
| 3237 | int fd, r; |
| 3238 | fd_set fds; |
| 3239 | |
| 3240 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3241 | r = setrlimit(RLIMIT_NOFILE, &rl_zero); |
| 3242 | exit (r == -1 ? 1 : 0); |
| 3243 | ]])], |
| 3244 | [AC_MSG_RESULT([yes]) |
| 3245 | rlimit_nofile_zero_works=yes], |
| 3246 | [AC_MSG_RESULT([no]) |
| 3247 | rlimit_nofile_zero_works=no], |
Mike Frysinger | dcc714c | 2017-05-24 23:21:19 -0400 | [diff] [blame] | 3248 | [AC_MSG_WARN([cross compiling: assuming yes]) |
| 3249 | rlimit_nofile_zero_works=yes] |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3250 | ) |
| 3251 | |
Darren Tucker | d545a4b | 2012-07-03 22:48:31 +1000 | [diff] [blame] | 3252 | AC_MSG_CHECKING([if setrlimit RLIMIT_FSIZE works]) |
| 3253 | AC_RUN_IFELSE( |
| 3254 | [AC_LANG_PROGRAM([[ |
| 3255 | #include <sys/types.h> |
| 3256 | #include <sys/resource.h> |
| 3257 | #include <stdlib.h> |
| 3258 | ]],[[ |
| 3259 | struct rlimit rl_zero; |
| 3260 | |
| 3261 | rl_zero.rlim_cur = rl_zero.rlim_max = 0; |
| 3262 | exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); |
| 3263 | ]])], |
| 3264 | [AC_MSG_RESULT([yes])], |
| 3265 | [AC_MSG_RESULT([no]) |
| 3266 | AC_DEFINE(SANDBOX_SKIP_RLIMIT_FSIZE, 1, |
| 3267 | [setrlimit RLIMIT_FSIZE works])], |
| 3268 | [AC_MSG_WARN([cross compiling: assuming yes])] |
| 3269 | ) |
| 3270 | |
deraadt@openbsd.org | 2539dce | 2015-10-09 01:37:08 +0000 | [diff] [blame] | 3271 | if test "x$sandbox_arg" = "xpledge" || \ |
| 3272 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_pledge" = "xyes" ) ; then |
| 3273 | test "x$ac_cv_func_pledge" != "xyes" && \ |
| 3274 | AC_MSG_ERROR([pledge sandbox requires pledge(2) support]) |
| 3275 | SANDBOX_STYLE="pledge" |
Damien Miller | fafe1d8 | 2015-10-14 09:22:15 -0700 | [diff] [blame] | 3276 | AC_DEFINE([SANDBOX_PLEDGE], [1], [Sandbox using pledge(2)]) |
Damien Miller | 9846a2f | 2015-10-08 04:30:48 +1100 | [diff] [blame] | 3277 | elif test "x$sandbox_arg" = "xsystrace" || \ |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3278 | ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3279 | test "x$have_systr_policy_kill" != "x1" && \ |
| 3280 | 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] | 3281 | SANDBOX_STYLE="systrace" |
| 3282 | AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)]) |
Damien Miller | cd5e52e | 2011-06-27 07:18:18 +1000 | [diff] [blame] | 3283 | elif test "x$sandbox_arg" = "xdarwin" || \ |
| 3284 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \ |
| 3285 | test "x$ac_cv_header_sandbox_h" = "xyes") ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3286 | test "x$ac_cv_func_sandbox_init" != "xyes" -o \ |
| 3287 | "x$ac_cv_header_sandbox_h" != "xyes" && \ |
| 3288 | 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] | 3289 | SANDBOX_STYLE="darwin" |
| 3290 | AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)]) |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3291 | elif test "x$sandbox_arg" = "xseccomp_filter" || \ |
| 3292 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | d0494fd | 2012-05-19 14:25:39 +1000 | [diff] [blame] | 3293 | test "x$have_seccomp_filter" = "x1" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3294 | test "x$ac_cv_header_elf_h" = "xyes" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3295 | test "x$ac_cv_header_linux_audit_h" = "xyes" && \ |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3296 | test "x$ac_cv_header_linux_filter_h" = "xyes" && \ |
| 3297 | test "x$seccomp_audit_arch" != "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3298 | test "x$have_linux_no_new_privs" = "x1" && \ |
| 3299 | test "x$ac_cv_func_prctl" = "xyes" ) ; then |
Damien Miller | 91f40d8 | 2013-02-22 11:37:00 +1100 | [diff] [blame] | 3300 | test "x$seccomp_audit_arch" = "x" && \ |
Damien Miller | e0956e3 | 2012-04-04 11:27:54 +1000 | [diff] [blame] | 3301 | AC_MSG_ERROR([seccomp_filter sandbox not supported on $host]) |
| 3302 | test "x$have_linux_no_new_privs" != "x1" && \ |
| 3303 | AC_MSG_ERROR([seccomp_filter sandbox requires PR_SET_NO_NEW_PRIVS]) |
| 3304 | test "x$have_seccomp_filter" != "x1" && \ |
| 3305 | AC_MSG_ERROR([seccomp_filter sandbox requires seccomp headers]) |
| 3306 | test "x$ac_cv_func_prctl" != "xyes" && \ |
| 3307 | AC_MSG_ERROR([seccomp_filter sandbox requires prctl function]) |
| 3308 | SANDBOX_STYLE="seccomp_filter" |
| 3309 | AC_DEFINE([SANDBOX_SECCOMP_FILTER], [1], [Sandbox using seccomp filter]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3310 | elif test "x$sandbox_arg" = "xcapsicum" || \ |
| 3311 | ( test -z "$sandbox_arg" && \ |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 3312 | test "x$ac_cv_header_sys_capsicum_h" = "xyes" && \ |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3313 | test "x$ac_cv_func_cap_rights_limit" = "xyes") ; then |
Darren Tucker | dd9d9b3 | 2017-08-28 16:48:27 +1000 | [diff] [blame] | 3314 | test "x$ac_cv_header_sys_capsicum_h" != "xyes" && \ |
| 3315 | AC_MSG_ERROR([capsicum sandbox requires sys/capsicum.h header]) |
Damien Miller | 603b8f4 | 2014-01-25 13:16:59 +1100 | [diff] [blame] | 3316 | test "x$ac_cv_func_cap_rights_limit" != "xyes" && \ |
Damien Miller | c96d853 | 2014-01-25 13:12:28 +1100 | [diff] [blame] | 3317 | AC_MSG_ERROR([capsicum sandbox requires cap_rights_limit function]) |
Damien Miller | f62ecef | 2014-01-25 12:34:38 +1100 | [diff] [blame] | 3318 | SANDBOX_STYLE="capsicum" |
| 3319 | AC_DEFINE([SANDBOX_CAPSICUM], [1], [Sandbox using capsicum]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3320 | elif test "x$sandbox_arg" = "xrlimit" || \ |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3321 | ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ |
Darren Tucker | ff008de | 2013-03-06 17:48:48 +1100 | [diff] [blame] | 3322 | test "x$select_works_with_rlimit" = "xyes" && \ |
| 3323 | test "x$rlimit_nofile_zero_works" = "xyes" ) ; then |
Damien Miller | 1a91c0f | 2011-08-17 11:59:25 +1000 | [diff] [blame] | 3324 | test "x$ac_cv_func_setrlimit" != "xyes" && \ |
| 3325 | AC_MSG_ERROR([rlimit sandbox requires setrlimit function]) |
Darren Tucker | 60395f9 | 2012-07-03 14:31:18 +1000 | [diff] [blame] | 3326 | test "x$select_works_with_rlimit" != "xyes" && \ |
| 3327 | AC_MSG_ERROR([rlimit sandbox requires select to work with rlimit]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3328 | SANDBOX_STYLE="rlimit" |
| 3329 | AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)]) |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 3330 | elif test "x$sandbox_arg" = "xsolaris" || \ |
| 3331 | ( test -z "$sandbox_arg" && test "x$SOLARIS_PRIVS" = "xyes" ) ; then |
| 3332 | SANDBOX_STYLE="solaris" |
| 3333 | AC_DEFINE([SANDBOX_SOLARIS], [1], [Sandbox using Solaris/Illumos privileges]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3334 | elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \ |
| 3335 | test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then |
| 3336 | SANDBOX_STYLE="none" |
| 3337 | AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing]) |
| 3338 | else |
Tim Rice | a6e6061 | 2011-08-17 21:48:22 -0700 | [diff] [blame] | 3339 | AC_MSG_ERROR([unsupported --with-sandbox]) |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 3340 | fi |
| 3341 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 3342 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 3343 | if test ! -z "$SONY" ; then |
| 3344 | LIBS="$LIBS -liberty"; |
| 3345 | fi |
| 3346 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 3347 | # Check for long long datatypes |
| 3348 | AC_CHECK_TYPES([long long, unsigned long long, long double]) |
| 3349 | |
| 3350 | # Check datatype sizes |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3351 | AC_CHECK_SIZEOF([short int], [2]) |
| 3352 | AC_CHECK_SIZEOF([int], [4]) |
| 3353 | AC_CHECK_SIZEOF([long int], [4]) |
| 3354 | AC_CHECK_SIZEOF([long long int], [8]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3355 | |
Damien Miller | fa2bb69 | 2002-04-23 23:22:25 +1000 | [diff] [blame] | 3356 | # Sanity check long long for some platforms (AIX) |
| 3357 | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then |
| 3358 | ac_cv_sizeof_long_long_int=0 |
| 3359 | fi |
| 3360 | |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3361 | # compute LLONG_MIN and LLONG_MAX if we don't know them. |
| 3362 | if test -z "$have_llong_max"; then |
| 3363 | AC_MSG_CHECKING([for max value of long long]) |
| 3364 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3365 | [AC_LANG_PROGRAM([[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3366 | #include <stdio.h> |
| 3367 | /* Why is this so damn hard? */ |
| 3368 | #ifdef __GNUC__ |
| 3369 | # undef __GNUC__ |
| 3370 | #endif |
| 3371 | #define __USE_ISOC99 |
| 3372 | #include <limits.h> |
| 3373 | #define DATA "conftest.llminmax" |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3374 | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) |
| 3375 | |
| 3376 | /* |
| 3377 | * printf in libc on some platforms (eg old Tru64) does not understand %lld so |
| 3378 | * we do this the hard way. |
| 3379 | */ |
| 3380 | static int |
| 3381 | fprint_ll(FILE *f, long long n) |
| 3382 | { |
| 3383 | unsigned int i; |
| 3384 | int l[sizeof(long long) * 8]; |
| 3385 | |
| 3386 | if (n < 0) |
| 3387 | if (fprintf(f, "-") < 0) |
| 3388 | return -1; |
| 3389 | for (i = 0; n != 0; i++) { |
| 3390 | l[i] = my_abs(n % 10); |
| 3391 | n /= 10; |
| 3392 | } |
| 3393 | do { |
| 3394 | if (fprintf(f, "%d", l[--i]) < 0) |
| 3395 | return -1; |
| 3396 | } while (i != 0); |
| 3397 | if (fprintf(f, " ") < 0) |
| 3398 | return -1; |
| 3399 | return 0; |
| 3400 | } |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3401 | ]], [[ |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3402 | FILE *f; |
| 3403 | long long i, llmin, llmax = 0; |
| 3404 | |
| 3405 | if((f = fopen(DATA,"w")) == NULL) |
| 3406 | exit(1); |
| 3407 | |
| 3408 | #if defined(LLONG_MIN) && defined(LLONG_MAX) |
| 3409 | fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); |
| 3410 | llmin = LLONG_MIN; |
| 3411 | llmax = LLONG_MAX; |
| 3412 | #else |
| 3413 | fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); |
| 3414 | /* This will work on one's complement and two's complement */ |
| 3415 | for (i = 1; i > llmax; i <<= 1, i++) |
| 3416 | llmax = i; |
| 3417 | llmin = llmax + 1LL; /* wrap */ |
| 3418 | #endif |
| 3419 | |
| 3420 | /* Sanity check */ |
| 3421 | if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3422 | || llmax - 1 > llmax || llmin == llmax || llmin == 0 |
| 3423 | || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) { |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3424 | fprintf(f, "unknown unknown\n"); |
| 3425 | exit(2); |
| 3426 | } |
| 3427 | |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3428 | if (fprint_ll(f, llmin) < 0) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3429 | exit(3); |
Darren Tucker | d1450db | 2006-03-13 19:06:51 +1100 | [diff] [blame] | 3430 | if (fprint_ll(f, llmax) < 0) |
| 3431 | exit(4); |
| 3432 | if (fclose(f) < 0) |
| 3433 | exit(5); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3434 | exit(0); |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3435 | ]])], |
| 3436 | [ |
| 3437 | llong_min=`$AWK '{print $1}' conftest.llminmax` |
| 3438 | llong_max=`$AWK '{print $2}' conftest.llminmax` |
| 3439 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3440 | AC_MSG_RESULT([$llong_max]) |
| 3441 | AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3442 | [max value of long long calculated by configure]) |
| 3443 | AC_MSG_CHECKING([for min value of long long]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3444 | AC_MSG_RESULT([$llong_min]) |
| 3445 | AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL], |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3446 | [min value of long long calculated by configure]) |
| 3447 | ], |
| 3448 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3449 | AC_MSG_RESULT([not found]) |
Darren Tucker | 537f1ed | 2005-10-25 18:38:33 +1000 | [diff] [blame] | 3450 | ], |
| 3451 | [ |
| 3452 | AC_MSG_WARN([cross compiling: not checking]) |
| 3453 | ] |
| 3454 | ) |
| 3455 | fi |
| 3456 | |
| 3457 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 3458 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3459 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3460 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3461 | [[ u_int a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3462 | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3463 | ]) |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 3464 | ]) |
| 3465 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3466 | 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] | 3467 | have_u_int=1 |
| 3468 | fi |
| 3469 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3470 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3471 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3472 | [[ 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] | 3473 | [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3474 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3475 | ]) |
| 3476 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3477 | 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] | 3478 | have_intxx_t=1 |
| 3479 | fi |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3480 | |
| 3481 | if (test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3482 | test "x$ac_cv_header_stdint_h" = "xyes") |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3483 | then |
| 3484 | AC_MSG_CHECKING([for intXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3485 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3486 | [[ 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] | 3487 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3488 | AC_DEFINE([HAVE_INTXX_T]) |
| 3489 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3490 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3491 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3492 | fi |
| 3493 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3494 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3495 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | 907881e | 2002-07-18 11:44:50 -0700 | [diff] [blame] | 3496 | #include <sys/types.h> |
| 3497 | #ifdef HAVE_STDINT_H |
| 3498 | # include <stdint.h> |
| 3499 | #endif |
| 3500 | #include <sys/socket.h> |
| 3501 | #ifdef HAVE_SYS_BITYPES_H |
| 3502 | # include <sys/bitypes.h> |
| 3503 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3504 | ]], [[ |
| 3505 | int64_t a; a = 1; |
| 3506 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3507 | [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3508 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3509 | ]) |
| 3510 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3511 | 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] | 3512 | fi |
| 3513 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3514 | 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] | 3515 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3516 | [[ 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] | 3517 | [ 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] | 3518 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3519 | ]) |
| 3520 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3521 | 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] | 3522 | have_u_intxx_t=1 |
| 3523 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 3524 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3525 | if test -z "$have_u_intxx_t" ; then |
| 3526 | AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3527 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], |
| 3528 | [[ 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] | 3529 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3530 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3531 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3532 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3533 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3534 | fi |
| 3535 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3536 | 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] | 3537 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3538 | [[ u_int64_t a; a = 1;]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3539 | [ 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] | 3540 | ]) |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 3541 | ]) |
| 3542 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3543 | 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] | 3544 | have_u_int64_t=1 |
| 3545 | fi |
| 3546 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3547 | if (test -z "$have_u_int64_t" && \ |
| 3548 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
| 3549 | then |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3550 | AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3551 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], |
| 3552 | [[ u_int64_t a; a = 1]])], |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3553 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3554 | AC_DEFINE([HAVE_U_INT64_T]) |
| 3555 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3556 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3557 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3558 | fi |
| 3559 | |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3560 | if test -z "$have_u_intxx_t" ; then |
| 3561 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3562 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3563 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3564 | ]], [[ |
| 3565 | uint8_t a; |
| 3566 | uint16_t b; |
| 3567 | uint32_t c; |
| 3568 | a = b = c = 1; |
| 3569 | ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3570 | [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3571 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3572 | ]) |
| 3573 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3574 | AC_DEFINE([HAVE_UINTXX_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3575 | [define if you have uintxx_t data type]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3576 | fi |
| 3577 | fi |
| 3578 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3579 | if (test -z "$have_uintxx_t" && \ |
| 3580 | test "x$ac_cv_header_stdint_h" = "xyes") |
| 3581 | then |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3582 | AC_MSG_CHECKING([for uintXX_t types in stdint.h]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3583 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], |
| 3584 | [[ 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] | 3585 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3586 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3587 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3588 | ], [ AC_MSG_RESULT([no]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3589 | ]) |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 3590 | fi |
| 3591 | |
Damien Miller | c286819 | 2014-01-30 10:21:19 +1100 | [diff] [blame] | 3592 | if (test -z "$have_uintxx_t" && \ |
| 3593 | test "x$ac_cv_header_inttypes_h" = "xyes") |
| 3594 | then |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3595 | AC_MSG_CHECKING([for uintXX_t types in inttypes.h]) |
| 3596 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <inttypes.h> ]], |
| 3597 | [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])], |
| 3598 | [ |
| 3599 | AC_DEFINE([HAVE_UINTXX_T]) |
| 3600 | AC_MSG_RESULT([yes]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3601 | ], [ AC_MSG_RESULT([no]) |
Darren Tucker | 6d72568 | 2014-01-17 19:17:34 +1100 | [diff] [blame] | 3602 | ]) |
| 3603 | fi |
| 3604 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 3605 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3606 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3607 | then |
| 3608 | 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] | 3609 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3610 | #include <sys/bitypes.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3611 | ]], [[ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 3612 | int8_t a; int16_t b; int32_t c; |
| 3613 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 3614 | a = b = c = e = f = g = 1; |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3615 | ]])], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3616 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3617 | AC_DEFINE([HAVE_U_INTXX_T]) |
| 3618 | AC_DEFINE([HAVE_INTXX_T]) |
| 3619 | AC_MSG_RESULT([yes]) |
| 3620 | ], [AC_MSG_RESULT([no]) |
| 3621 | ]) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 3622 | fi |
| 3623 | |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3624 | |
| 3625 | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3626 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3627 | [[ u_char foo; foo = 125; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3628 | [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3629 | ]) |
Damien Miller | 58be738 | 2001-09-15 21:31:54 +1000 | [diff] [blame] | 3630 | ]) |
| 3631 | if test "x$ac_cv_have_u_char" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3632 | 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] | 3633 | fi |
| 3634 | |
Darren Tucker | 007e3b3 | 2013-11-03 18:43:55 +1100 | [diff] [blame] | 3635 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ |
| 3636 | #include <sys/types.h> |
| 3637 | #include <stdint.h> |
| 3638 | ]) |
| 3639 | |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 3640 | TYPE_SOCKLEN_T |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 3641 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3642 | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) |
| 3643 | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ |
Darren Tucker | 598eaa6 | 2008-06-09 03:32:29 +1000 | [diff] [blame] | 3644 | #include <sys/types.h> |
| 3645 | #ifdef HAVE_SYS_BITYPES_H |
| 3646 | #include <sys/bitypes.h> |
| 3647 | #endif |
| 3648 | #ifdef HAVE_SYS_STATFS_H |
| 3649 | #include <sys/statfs.h> |
| 3650 | #endif |
| 3651 | #ifdef HAVE_SYS_STATVFS_H |
| 3652 | #include <sys/statvfs.h> |
| 3653 | #endif |
| 3654 | ]) |
Tim Rice | 4cec93f | 2002-02-26 08:40:48 -0800 | [diff] [blame] | 3655 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3656 | AC_CHECK_TYPES([in_addr_t, in_port_t], , , |
Damien Miller | 848b993 | 2005-02-24 12:12:34 +1100 | [diff] [blame] | 3657 | [#include <sys/types.h> |
| 3658 | #include <netinet/in.h>]) |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 3659 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3660 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3661 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3662 | [[ size_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3663 | [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3664 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3665 | ]) |
| 3666 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3667 | 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] | 3668 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 3669 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3670 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3671 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3672 | [[ ssize_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3673 | [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3674 | ]) |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 3675 | ]) |
| 3676 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3677 | 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] | 3678 | fi |
| 3679 | |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3680 | AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3681 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]], |
| 3682 | [[ clock_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3683 | [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3684 | ]) |
Ben Lindstrom | 0d5af60 | 2001-01-09 00:50:29 +0000 | [diff] [blame] | 3685 | ]) |
| 3686 | if test "x$ac_cv_have_clock_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3687 | 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] | 3688 | fi |
| 3689 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3690 | 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] | 3691 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3692 | #include <sys/types.h> |
| 3693 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3694 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
| 3695 | [ ac_cv_have_sa_family_t="yes" ], |
| 3696 | [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3697 | #include <sys/types.h> |
| 3698 | #include <sys/socket.h> |
| 3699 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3700 | ]], [[ sa_family_t foo; foo = 1235; ]])], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3701 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3702 | [ ac_cv_have_sa_family_t="no" ] |
| 3703 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3704 | ]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3705 | ]) |
| 3706 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3707 | AC_DEFINE([HAVE_SA_FAMILY_T], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3708 | [define if you have sa_family_t data type]) |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 3709 | fi |
| 3710 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3711 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3712 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3713 | [[ pid_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3714 | [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3715 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3716 | ]) |
| 3717 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3718 | 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] | 3719 | fi |
| 3720 | |
| 3721 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3722 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], |
| 3723 | [[ mode_t foo; foo = 1235; ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3724 | [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3725 | ]) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 3726 | ]) |
| 3727 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3728 | 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] | 3729 | fi |
| 3730 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3731 | |
| 3732 | 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] | 3733 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3734 | #include <sys/types.h> |
| 3735 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3736 | ]], [[ struct sockaddr_storage s; ]])], |
| 3737 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3738 | [ ac_cv_have_struct_sockaddr_storage="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3739 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3740 | ]) |
| 3741 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3742 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3743 | [define if you have struct sockaddr_storage data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3744 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3745 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3746 | 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] | 3747 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3748 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3749 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3750 | ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], |
| 3751 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3752 | [ ac_cv_have_struct_sockaddr_in6="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3753 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3754 | ]) |
| 3755 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3756 | AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3757 | [define if you have struct sockaddr_in6 data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3758 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3759 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3760 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3761 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 3762 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3763 | #include <netinet/in.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3764 | ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], |
| 3765 | [ ac_cv_have_struct_in6_addr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3766 | [ ac_cv_have_struct_in6_addr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3767 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3768 | ]) |
| 3769 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3770 | AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3771 | [define if you have struct in6_addr data type]) |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3772 | |
| 3773 | dnl Now check for sin6_scope_id |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3774 | AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , , |
Tim Rice | 0f4d2c0 | 2008-11-18 21:26:41 -0800 | [diff] [blame] | 3775 | [ |
| 3776 | #ifdef HAVE_SYS_TYPES_H |
| 3777 | #include <sys/types.h> |
| 3778 | #endif |
| 3779 | #include <netinet/in.h> |
| 3780 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3781 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 3782 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3783 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3784 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3785 | #include <sys/types.h> |
| 3786 | #include <sys/socket.h> |
| 3787 | #include <netdb.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3788 | ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], |
| 3789 | [ ac_cv_have_struct_addrinfo="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3790 | [ ac_cv_have_struct_addrinfo="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3791 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3792 | ]) |
| 3793 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3794 | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3795 | [define if you have struct addrinfo data type]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3796 | fi |
| 3797 | |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3798 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3799 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
| 3800 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
| 3801 | [ ac_cv_have_struct_timeval="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3802 | [ ac_cv_have_struct_timeval="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3803 | ]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3804 | ]) |
| 3805 | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3806 | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) |
Ben Lindstrom | 42202bc | 2001-01-15 02:34:37 +0000 | [diff] [blame] | 3807 | have_struct_timeval=1 |
| 3808 | fi |
| 3809 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3810 | AC_CHECK_TYPES([struct timespec]) |
Tim Rice | 4e4dc56 | 2003-03-18 10:21:40 -0800 | [diff] [blame] | 3811 | |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3812 | # We need int64_t or else certian parts of the compile will fail. |
Tim Rice | 8bb561b | 2005-03-17 16:23:19 -0800 | [diff] [blame] | 3813 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
| 3814 | test "x$ac_cv_sizeof_long_int" != "x8" && \ |
| 3815 | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then |
Ben Lindstrom | 5bd6eb7 | 2003-03-21 00:34:34 +0000 | [diff] [blame] | 3816 | echo "OpenSSH requires int64_t support. Contact your vendor or install" |
| 3817 | echo "an alternative compiler (I.E., GCC) before continuing." |
| 3818 | echo "" |
| 3819 | exit 1; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3820 | else |
| 3821 | dnl test snprintf (broken on SCO w/gcc) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3822 | AC_RUN_IFELSE( |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 3823 | [AC_LANG_SOURCE([[ |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3824 | #include <stdio.h> |
| 3825 | #include <string.h> |
| 3826 | #ifdef HAVE_SNPRINTF |
| 3827 | main() |
| 3828 | { |
| 3829 | char buf[50]; |
| 3830 | char expected_out[50]; |
| 3831 | int mazsize = 50 ; |
| 3832 | #if (SIZEOF_LONG_INT == 8) |
| 3833 | long int num = 0x7fffffffffffffff; |
| 3834 | #else |
Kevin Steves | 6482ec8 | 2001-07-15 02:09:28 +0000 | [diff] [blame] | 3835 | long long num = 0x7fffffffffffffffll; |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3836 | #endif |
| 3837 | strcpy(expected_out, "9223372036854775807"); |
| 3838 | snprintf(buf, mazsize, "%lld", num); |
| 3839 | if(strcmp(buf, expected_out) != 0) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 3840 | exit(1); |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3841 | exit(0); |
| 3842 | } |
| 3843 | #else |
| 3844 | main() { exit(0); } |
| 3845 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3846 | ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3847 | AC_MSG_WARN([cross compiling: Assuming working snprintf()]) |
Tim Rice | bee3f22 | 2001-03-11 17:32:12 -0800 | [diff] [blame] | 3848 | ) |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 3849 | fi |
| 3850 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 3851 | dnl Checks for structure members |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3852 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP]) |
| 3853 | OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX]) |
| 3854 | OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX]) |
| 3855 | OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP]) |
| 3856 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP]) |
| 3857 | OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX]) |
| 3858 | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP]) |
| 3859 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP]) |
| 3860 | OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX]) |
| 3861 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) |
| 3862 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) |
| 3863 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) |
| 3864 | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) |
| 3865 | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) |
| 3866 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) |
| 3867 | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) |
| 3868 | 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] | 3869 | |
| 3870 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Damien Miller | bcd1485 | 2017-06-10 23:41:25 +1000 | [diff] [blame] | 3871 | AC_CHECK_MEMBERS([struct stat.st_mtim]) |
| 3872 | AC_CHECK_MEMBERS([struct stat.st_mtime]) |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3873 | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, |
| 3874 | struct passwd.pw_change, struct passwd.pw_expire], |
| 3875 | [], [], [[ |
| 3876 | #include <sys/types.h> |
| 3877 | #include <pwd.h> |
| 3878 | ]]) |
| 3879 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3880 | AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3881 | [Define if we don't have struct __res_state in resolv.h])], |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3882 | [[ |
Darren Tucker | 58e298d | 2005-11-25 13:14:58 +1100 | [diff] [blame] | 3883 | #include <stdio.h> |
| 3884 | #if HAVE_SYS_TYPES_H |
| 3885 | # include <sys/types.h> |
| 3886 | #endif |
| 3887 | #include <netinet/in.h> |
| 3888 | #include <arpa/nameser.h> |
| 3889 | #include <resolv.h> |
Damien Miller | 6332da2 | 2013-04-23 14:25:52 +1000 | [diff] [blame] | 3890 | ]]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 3891 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3892 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 3893 | ac_cv_have_ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3894 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3895 | #include <sys/types.h> |
| 3896 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3897 | ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])], |
| 3898 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 3899 | [ ac_cv_have_ss_family_in_struct_ss="no" ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3900 | ]) |
| 3901 | 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] | 3902 | 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] | 3903 | fi |
| 3904 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3905 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 3906 | ac_cv_have___ss_family_in_struct_ss, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3907 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 3908 | #include <sys/types.h> |
| 3909 | #include <sys/socket.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3910 | ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])], |
| 3911 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 3912 | [ ac_cv_have___ss_family_in_struct_ss="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3913 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3914 | ]) |
| 3915 | 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] | 3916 | AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3917 | [Fields in struct sockaddr_storage]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 3918 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 3919 | |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3920 | 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] | 3921 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
| 3922 | ac_cv_have_accrights_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3923 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3924 | #include <sys/types.h> |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3925 | #include <sys/socket.h> |
| 3926 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3927 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3928 | #ifdef msg_accrights |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3929 | #error "msg_accrights is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3930 | exit(1); |
| 3931 | #endif |
| 3932 | struct msghdr m; |
| 3933 | m.msg_accrights = 0; |
| 3934 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3935 | ]])], |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3936 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
| 3937 | [ ac_cv_have_accrights_in_msghdr="no" ] |
| 3938 | ) |
| 3939 | ]) |
| 3940 | if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3941 | AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 3942 | [Define if your system uses access rights style |
| 3943 | file descriptor passing]) |
Kevin Steves | 939c9db | 2002-03-22 17:23:25 +0000 | [diff] [blame] | 3944 | fi |
| 3945 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3946 | AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type]) |
| 3947 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e1a3ddf | 2012-05-04 11:05:45 +1000 | [diff] [blame] | 3948 | #include <sys/param.h> |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3949 | #include <sys/stat.h> |
| 3950 | #ifdef HAVE_SYS_TIME_H |
| 3951 | # include <sys/time.h> |
| 3952 | #endif |
| 3953 | #ifdef HAVE_SYS_MOUNT_H |
| 3954 | #include <sys/mount.h> |
| 3955 | #endif |
| 3956 | #ifdef HAVE_SYS_STATVFS_H |
| 3957 | #include <sys/statvfs.h> |
| 3958 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3959 | ]], [[ struct statvfs s; s.f_fsid = 0; ]])], |
| 3960 | [ AC_MSG_RESULT([yes]) ], |
| 3961 | [ AC_MSG_RESULT([no]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3962 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3963 | AC_MSG_CHECKING([if fsid_t has member val]) |
| 3964 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3965 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3966 | #include <sys/statvfs.h> |
| 3967 | ]], [[ fsid_t t; t.val[0] = 0; ]])], |
| 3968 | [ AC_MSG_RESULT([yes]) |
| 3969 | AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ], |
| 3970 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3971 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3972 | AC_MSG_CHECKING([if f_fsid has member __val]) |
| 3973 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3974 | #include <sys/types.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3975 | #include <sys/statvfs.h> |
| 3976 | ]], [[ fsid_t t; t.__val[0] = 0; ]])], |
| 3977 | [ AC_MSG_RESULT([yes]) |
| 3978 | AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ], |
| 3979 | [ AC_MSG_RESULT([no]) ]) |
Darren Tucker | 3278062 | 2009-06-16 16:11:02 +1000 | [diff] [blame] | 3980 | ]) |
Darren Tucker | 7700138 | 2008-06-09 06:17:53 +1000 | [diff] [blame] | 3981 | |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3982 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
| 3983 | ac_cv_have_control_in_msghdr, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3984 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Tim Rice | ae49fe6 | 2002-04-12 10:26:21 -0700 | [diff] [blame] | 3985 | #include <sys/types.h> |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3986 | #include <sys/socket.h> |
| 3987 | #include <sys/uio.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3988 | ]], [[ |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3989 | #ifdef msg_control |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 3990 | #error "msg_control is a macro" |
Tim Rice | 28bbb0c | 2002-05-27 17:37:32 -0700 | [diff] [blame] | 3991 | exit(1); |
| 3992 | #endif |
| 3993 | struct msghdr m; |
| 3994 | m.msg_control = 0; |
| 3995 | exit(0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 3996 | ]])], |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 3997 | [ ac_cv_have_control_in_msghdr="yes" ], |
| 3998 | [ ac_cv_have_control_in_msghdr="no" ] |
| 3999 | ) |
| 4000 | ]) |
| 4001 | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4002 | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4003 | [Define if your system uses ancillary data style |
| 4004 | file descriptor passing]) |
Kevin Steves | a44e035 | 2002-04-07 16:18:03 +0000 | [diff] [blame] | 4005 | fi |
| 4006 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4007 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4008 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4009 | [[ extern char *__progname; printf("%s", __progname); ]])], |
| 4010 | [ ac_cv_libc_defines___progname="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4011 | [ ac_cv_libc_defines___progname="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4012 | ]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4013 | ]) |
| 4014 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4015 | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4016 | fi |
| 4017 | |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4018 | AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4019 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 4020 | [[ printf("%s", __FUNCTION__); ]])], |
| 4021 | [ ac_cv_cc_implements___FUNCTION__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4022 | [ ac_cv_cc_implements___FUNCTION__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4023 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4024 | ]) |
| 4025 | if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4026 | AC_DEFINE([HAVE___FUNCTION__], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4027 | [Define if compiler implements __FUNCTION__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4028 | fi |
| 4029 | |
| 4030 | AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4031 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], |
| 4032 | [[ printf("%s", __func__); ]])], |
| 4033 | [ ac_cv_cc_implements___func__="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4034 | [ ac_cv_cc_implements___func__="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4035 | ]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4036 | ]) |
| 4037 | if test "x$ac_cv_cc_implements___func__" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4038 | AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) |
Kevin Steves | 4846f4a | 2002-03-22 18:19:53 +0000 | [diff] [blame] | 4039 | fi |
| 4040 | |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4041 | AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4042 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4043 | #include <stdarg.h> |
| 4044 | va_list x,y; |
| 4045 | ]], [[ va_copy(x,y); ]])], |
| 4046 | [ ac_cv_have_va_copy="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4047 | [ ac_cv_have_va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4048 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4049 | ]) |
| 4050 | if test "x$ac_cv_have_va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4051 | AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4052 | fi |
| 4053 | |
| 4054 | AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4055 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 4056 | #include <stdarg.h> |
| 4057 | va_list x,y; |
| 4058 | ]], [[ __va_copy(x,y); ]])], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4059 | [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4060 | ]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4061 | ]) |
| 4062 | if test "x$ac_cv_have___va_copy" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4063 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
Damien Miller | 57f3915 | 2005-11-24 19:58:19 +1100 | [diff] [blame] | 4064 | fi |
| 4065 | |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4066 | AC_CACHE_CHECK([whether getopt has optreset support], |
| 4067 | ac_cv_have_getopt_optreset, [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4068 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]], |
| 4069 | [[ extern int optreset; optreset = 0; ]])], |
| 4070 | [ ac_cv_have_getopt_optreset="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4071 | [ ac_cv_have_getopt_optreset="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4072 | ]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4073 | ]) |
| 4074 | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4075 | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4076 | [Define if your getopt(3) defines and uses optreset]) |
Damien Miller | 4f8e669 | 2001-07-14 13:22:53 +1000 | [diff] [blame] | 4077 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4078 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4079 | 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] | 4080 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4081 | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], |
| 4082 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4083 | [ ac_cv_libc_defines_sys_errlist="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4084 | ]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4085 | ]) |
| 4086 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4087 | AC_DEFINE([HAVE_SYS_ERRLIST], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4088 | [Define if your system defines sys_errlist[]]) |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 4089 | fi |
| 4090 | |
| 4091 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4092 | 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] | 4093 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], |
| 4094 | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], |
| 4095 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4096 | [ ac_cv_libc_defines_sys_nerr="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4097 | ]) |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 4098 | ]) |
| 4099 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4100 | 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] | 4101 | fi |
| 4102 | |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4103 | # Check libraries needed by DNS fingerprint support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4104 | AC_SEARCH_LIBS([getrrsetbyname], [resolv], |
| 4105 | [AC_DEFINE([HAVE_GETRRSETBYNAME], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4106 | [Define if getrrsetbyname() exists])], |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4107 | [ |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4108 | # Needed by our getrrsetbyname() |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4109 | AC_SEARCH_LIBS([res_query], [resolv]) |
| 4110 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
| 4111 | AC_MSG_CHECKING([if res_query will link]) |
| 4112 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4113 | #include <sys/types.h> |
| 4114 | #include <netinet/in.h> |
| 4115 | #include <arpa/nameser.h> |
| 4116 | #include <netdb.h> |
| 4117 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4118 | ]], [[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4119 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4120 | ]])], |
| 4121 | AC_MSG_RESULT([yes]), |
| 4122 | [AC_MSG_RESULT([no]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4123 | saved_LIBS="$LIBS" |
| 4124 | LIBS="$LIBS -lresolv" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4125 | AC_MSG_CHECKING([for res_query in -lresolv]) |
| 4126 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | e02b49a | 2009-09-11 14:56:08 +1000 | [diff] [blame] | 4127 | #include <sys/types.h> |
| 4128 | #include <netinet/in.h> |
| 4129 | #include <arpa/nameser.h> |
| 4130 | #include <netdb.h> |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4131 | #include <resolv.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4132 | ]], [[ |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4133 | res_query (0, 0, 0, 0, 0); |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4134 | ]])], |
| 4135 | [AC_MSG_RESULT([yes])], |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4136 | [LIBS="$saved_LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4137 | AC_MSG_RESULT([no])]) |
Darren Tucker | 8e968a5 | 2004-05-13 11:56:16 +1000 | [diff] [blame] | 4138 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4139 | AC_CHECK_FUNCS([_getshort _getlong]) |
Darren Tucker | d886e1c | 2005-06-01 18:57:45 +1000 | [diff] [blame] | 4140 | AC_CHECK_DECLS([_getshort, _getlong], , , |
Tim Rice | fcc7ff1 | 2005-06-02 20:28:29 -0700 | [diff] [blame] | 4141 | [#include <sys/types.h> |
| 4142 | #include <arpa/nameser.h>]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4143 | AC_CHECK_MEMBER([HEADER.ad], |
| 4144 | [AC_DEFINE([HAVE_HEADER_AD], [1], |
| 4145 | [Define if HEADER.ad exists in arpa/nameser.h])], , |
Darren Tucker | 5f88d34 | 2003-10-15 16:57:57 +1000 | [diff] [blame] | 4146 | [#include <arpa/nameser.h>]) |
| 4147 | ]) |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 4148 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4149 | AC_MSG_CHECKING([if struct __res_state _res is an extern]) |
| 4150 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4151 | #include <stdio.h> |
| 4152 | #if HAVE_SYS_TYPES_H |
| 4153 | # include <sys/types.h> |
| 4154 | #endif |
| 4155 | #include <netinet/in.h> |
| 4156 | #include <arpa/nameser.h> |
| 4157 | #include <resolv.h> |
| 4158 | extern struct __res_state _res; |
Darren Tucker | 7ad8b28 | 2015-09-11 13:11:02 +1000 | [diff] [blame] | 4159 | ]], [[ |
| 4160 | struct __res_state *volatile p = &_res; /* force resolution of _res */ |
| 4161 | return 0; |
| 4162 | ]],)], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4163 | [AC_MSG_RESULT([yes]) |
| 4164 | AC_DEFINE([HAVE__RES_EXTERN], [1], |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4165 | [Define if you have struct __res_state _res as an extern]) |
| 4166 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4167 | [ AC_MSG_RESULT([no]) ] |
Darren Tucker | cc40d5e | 2007-04-29 13:58:06 +1000 | [diff] [blame] | 4168 | ) |
| 4169 | |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4170 | # Check whether user wants SELinux support |
| 4171 | SELINUX_MSG="no" |
| 4172 | LIBSELINUX="" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4173 | AC_ARG_WITH([selinux], |
Damien Miller | 5b1c8b3 | 2008-03-27 12:33:07 +1100 | [diff] [blame] | 4174 | [ --with-selinux Enable SELinux support], |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4175 | [ if test "x$withval" != "xno" ; then |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4176 | save_LIBS="$LIBS" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4177 | AC_DEFINE([WITH_SELINUX], [1], |
| 4178 | [Define if you want SELinux support.]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4179 | SELINUX_MSG="yes" |
| 4180 | AC_CHECK_HEADER([selinux/selinux.h], , |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4181 | AC_MSG_ERROR([SELinux support requires selinux.h header])) |
| 4182 | AC_CHECK_LIB([selinux], [setexeccon], |
Damien Miller | 1d2bfc4 | 2010-02-10 10:19:29 +1100 | [diff] [blame] | 4183 | [ LIBSELINUX="-lselinux" |
| 4184 | LIBS="$LIBS -lselinux" |
| 4185 | ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4186 | AC_MSG_ERROR([SELinux support requires libselinux library])) |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 4187 | SSHLIBS="$SSHLIBS $LIBSELINUX" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 4188 | SSHDLIBS="$SSHDLIBS $LIBSELINUX" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4189 | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) |
Darren Tucker | adc947d | 2006-10-07 09:07:20 +1000 | [diff] [blame] | 4190 | LIBS="$save_LIBS" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4191 | fi ] |
| 4192 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4193 | AC_SUBST([SSHLIBS]) |
| 4194 | AC_SUBST([SSHDLIBS]) |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 4195 | |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4196 | # Check whether user wants Kerberos 5 support |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4197 | KRB5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4198 | AC_ARG_WITH([kerberos5], |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4199 | [ --with-kerberos5=PATH Enable Kerberos 5 support], |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4200 | [ if test "x$withval" != "xno" ; then |
| 4201 | if test "x$withval" = "xyes" ; then |
| 4202 | KRB5ROOT="/usr/local" |
| 4203 | else |
| 4204 | KRB5ROOT=${withval} |
| 4205 | fi |
| 4206 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4207 | AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4208 | KRB5_MSG="yes" |
| 4209 | |
Darren Tucker | 4089fc1 | 2016-12-08 12:57:24 +1100 | [diff] [blame] | 4210 | AC_PATH_TOOL([KRB5CONF], [krb5-config], |
Darren Tucker | dad48e7 | 2009-09-01 18:26:00 +1000 | [diff] [blame] | 4211 | [$KRB5ROOT/bin/krb5-config], |
| 4212 | [$KRB5ROOT/bin:$PATH]) |
| 4213 | if test -x $KRB5CONF ; then |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4214 | K5CFLAGS="`$KRB5CONF --cflags`" |
| 4215 | K5LIBS="`$KRB5CONF --libs`" |
| 4216 | CPPFLAGS="$CPPFLAGS $K5CFLAGS" |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4217 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4218 | AC_MSG_CHECKING([for gssapi support]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4219 | if $KRB5CONF | grep gssapi >/dev/null ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4220 | AC_MSG_RESULT([yes]) |
| 4221 | AC_DEFINE([GSSAPI], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4222 | [Define this if you want GSSAPI |
| 4223 | support in the version 2 protocol]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4224 | GSSCFLAGS="`$KRB5CONF --cflags gssapi`" |
| 4225 | GSSLIBS="`$KRB5CONF --libs gssapi`" |
| 4226 | CPPFLAGS="$CPPFLAGS $GSSCFLAGS" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4227 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4228 | AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4229 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4230 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4231 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4232 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4233 | [ AC_MSG_RESULT([yes]) |
| 4234 | AC_DEFINE([HEIMDAL], [1], |
| 4235 | [Define this if you are using the Heimdal |
| 4236 | version of Kerberos V5]) ], |
| 4237 | [AC_MSG_RESULT([no]) |
| 4238 | ]) |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4239 | else |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4240 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4241 | LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4242 | AC_MSG_CHECKING([whether we are using Heimdal]) |
| 4243 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> |
| 4244 | ]], [[ char *tmp = heimdal_version; ]])], |
| 4245 | [ AC_MSG_RESULT([yes]) |
| 4246 | AC_DEFINE([HEIMDAL]) |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4247 | K5LIBS="-lkrb5" |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4248 | K5LIBS="$K5LIBS -lcom_err -lasn1" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4249 | AC_CHECK_LIB([roken], [net_write], |
Damien Miller | 5561e0b | 2004-04-20 20:28:55 +1000 | [diff] [blame] | 4250 | [K5LIBS="$K5LIBS -lroken"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4251 | AC_CHECK_LIB([des], [des_cbc_encrypt], |
Damien Miller | 41bccf7 | 2011-01-02 21:53:07 +1100 | [diff] [blame] | 4252 | [K5LIBS="$K5LIBS -ldes"]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4253 | ], [ AC_MSG_RESULT([no]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4254 | K5LIBS="-lkrb5 -lk5crypto -lcom_err" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4255 | ]) |
| 4256 | AC_SEARCH_LIBS([dn_expand], [resolv]) |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4257 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4258 | AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], |
| 4259 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4260 | GSSLIBS="-lgssapi_krb5" ], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4261 | [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], |
| 4262 | [ AC_DEFINE([GSSAPI]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4263 | GSSLIBS="-lgssapi" ], |
Darren Tucker | a2b5a4c | 2013-02-22 10:43:15 +1100 | [diff] [blame] | 4264 | [ AC_CHECK_LIB([gss], [gss_init_sec_context], |
| 4265 | [ AC_DEFINE([GSSAPI]) |
| 4266 | GSSLIBS="-lgss" ], |
| 4267 | AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) |
| 4268 | ]) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4269 | ]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4270 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4271 | AC_CHECK_HEADER([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4272 | [ unset ac_cv_header_gssapi_h |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4273 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4274 | AC_CHECK_HEADERS([gssapi.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4275 | 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] | 4276 | ) |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4277 | ] |
| 4278 | ) |
| 4279 | |
| 4280 | oldCPP="$CPPFLAGS" |
| 4281 | CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4282 | AC_CHECK_HEADER([gssapi_krb5.h], , |
Darren Tucker | 49aaf4a | 2003-08-26 11:58:16 +1000 | [diff] [blame] | 4283 | [ CPPFLAGS="$oldCPP" ]) |
| 4284 | |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4285 | fi |
Darren Tucker | 1d3ca58 | 2004-01-22 12:05:34 +1100 | [diff] [blame] | 4286 | if test ! -z "$need_dash_r" ; then |
| 4287 | LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" |
| 4288 | fi |
| 4289 | if test ! -z "$blibpath" ; then |
| 4290 | blibpath="$blibpath:${KRB5ROOT}/lib" |
| 4291 | fi |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4292 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4293 | AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h]) |
| 4294 | AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h]) |
| 4295 | AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h]) |
Tim Rice | fd9e9e3 | 2005-09-12 17:36:10 -0700 | [diff] [blame] | 4296 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4297 | AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1], |
| 4298 | [Define this if you want to use libkafs' AFS support])]) |
Darren Tucker | 03978c6 | 2013-02-25 11:24:44 +1100 | [diff] [blame] | 4299 | |
| 4300 | AC_CHECK_DECLS([GSS_C_NT_HOSTBASED_SERVICE], [], [], [[ |
| 4301 | #ifdef HAVE_GSSAPI_H |
| 4302 | # include <gssapi.h> |
| 4303 | #elif defined(HAVE_GSSAPI_GSSAPI_H) |
| 4304 | # include <gssapi/gssapi.h> |
| 4305 | #endif |
| 4306 | |
| 4307 | #ifdef HAVE_GSSAPI_GENERIC_H |
| 4308 | # include <gssapi_generic.h> |
| 4309 | #elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H) |
| 4310 | # include <gssapi/gssapi_generic.h> |
| 4311 | #endif |
| 4312 | ]]) |
Darren Tucker | f3ab2c5 | 2013-08-04 21:48:41 +1000 | [diff] [blame] | 4313 | saved_LIBS="$LIBS" |
| 4314 | LIBS="$LIBS $K5LIBS" |
| 4315 | AC_CHECK_FUNCS([krb5_cc_new_unique krb5_get_error_message krb5_free_error_message]) |
| 4316 | LIBS="$saved_LIBS" |
| 4317 | |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4318 | fi |
Darren Tucker | 0d27ed1 | 2004-02-24 10:37:33 +1100 | [diff] [blame] | 4319 | ] |
Damien Miller | fd4c9ee | 2002-04-13 11:04:40 +1000 | [diff] [blame] | 4320 | ) |
Darren Tucker | 964de18 | 2013-02-22 10:39:59 +1100 | [diff] [blame] | 4321 | AC_SUBST([GSSLIBS]) |
| 4322 | AC_SUBST([K5LIBS]) |
Damien Miller | c79bc0d | 2001-03-28 13:03:42 +1000 | [diff] [blame] | 4323 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4324 | # Looking for programs, paths and files |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4325 | |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4326 | PRIVSEP_PATH=/var/empty |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4327 | AC_ARG_WITH([privsep-path], |
Tim Rice | cbb9066 | 2002-07-08 19:17:10 -0700 | [diff] [blame] | 4328 | [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4329 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4330 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4331 | test "x${withval}" != "xyes"; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4332 | PRIVSEP_PATH=$withval |
| 4333 | fi |
| 4334 | ] |
| 4335 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4336 | AC_SUBST([PRIVSEP_PATH]) |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 4337 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4338 | AC_ARG_WITH([xauth], |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4339 | [ --with-xauth=PATH Specify path to xauth program ], |
| 4340 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4341 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4342 | test "x${withval}" != "xyes"; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 4343 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4344 | fi |
| 4345 | ], |
| 4346 | [ |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4347 | TestPath="$PATH" |
| 4348 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" |
| 4349 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" |
| 4350 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" |
| 4351 | TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4352 | AC_PATH_PROG([xauth_path], [xauth], , [$TestPath]) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 4353 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4354 | xauth_path="/usr/openwin/bin/xauth" |
| 4355 | fi |
| 4356 | ] |
| 4357 | ) |
| 4358 | |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4359 | STRIP_OPT=-s |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4360 | AC_ARG_ENABLE([strip], |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4361 | [ --disable-strip Disable calling strip(1) on install], |
| 4362 | [ |
| 4363 | if test "x$enableval" = "xno" ; then |
| 4364 | STRIP_OPT= |
| 4365 | fi |
| 4366 | ] |
| 4367 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4368 | AC_SUBST([STRIP_OPT]) |
Damien Miller | 7d90127 | 2003-01-13 16:55:22 +1100 | [diff] [blame] | 4369 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4370 | if test -z "$xauth_path" ; then |
| 4371 | XAUTH_PATH="undefined" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4372 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4373 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4374 | AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4375 | [Define if xauth is found in your path]) |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 4376 | XAUTH_PATH=$xauth_path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4377 | AC_SUBST([XAUTH_PATH]) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4378 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4379 | |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4380 | dnl # --with-maildir=/path/to/mail gets top priority. |
| 4381 | dnl # if maildir is set in the platform case statement above we use that. |
| 4382 | dnl # Otherwise we run a program to get the dir from system headers. |
| 4383 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
| 4384 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
| 4385 | dnl # session.c expects anyway. Otherwise we set to the value found |
| 4386 | dnl # stripping any trailing slash. If for some strage reason our program |
| 4387 | dnl # does not find what it needs, we default to /var/spool/mail. |
| 4388 | # Check for mail directory |
| 4389 | AC_ARG_WITH([maildir], |
| 4390 | [ --with-maildir=/path/to/mail Specify your system mail directory], |
| 4391 | [ |
| 4392 | if test "X$withval" != X && test "x$withval" != xno && \ |
| 4393 | test "x${withval}" != xyes; then |
| 4394 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], |
| 4395 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) |
| 4396 | fi |
| 4397 | ],[ |
| 4398 | if test "X$maildir" != "X"; then |
| 4399 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4400 | else |
| 4401 | AC_MSG_CHECKING([Discovering system mail directory]) |
| 4402 | AC_RUN_IFELSE( |
| 4403 | [AC_LANG_PROGRAM([[ |
| 4404 | #include <stdio.h> |
| 4405 | #include <string.h> |
| 4406 | #ifdef HAVE_PATHS_H |
| 4407 | #include <paths.h> |
| 4408 | #endif |
| 4409 | #ifdef HAVE_MAILLOCK_H |
| 4410 | #include <maillock.h> |
| 4411 | #endif |
| 4412 | #define DATA "conftest.maildir" |
| 4413 | ]], [[ |
| 4414 | FILE *fd; |
| 4415 | int rc; |
| 4416 | |
| 4417 | fd = fopen(DATA,"w"); |
| 4418 | if(fd == NULL) |
| 4419 | exit(1); |
| 4420 | |
| 4421 | #if defined (_PATH_MAILDIR) |
| 4422 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) |
| 4423 | exit(1); |
| 4424 | #elif defined (MAILDIR) |
| 4425 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) |
| 4426 | exit(1); |
| 4427 | #elif defined (_PATH_MAIL) |
| 4428 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) |
| 4429 | exit(1); |
| 4430 | #else |
| 4431 | exit (2); |
| 4432 | #endif |
| 4433 | |
| 4434 | exit(0); |
| 4435 | ]])], |
| 4436 | [ |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4437 | maildir_what=`awk -F: '{print $1}' conftest.maildir` |
Tim Rice | 90f42b0 | 2011-06-02 18:17:49 -0700 | [diff] [blame] | 4438 | maildir=`awk -F: '{print $2}' conftest.maildir \ |
| 4439 | | sed 's|/$||'` |
| 4440 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) |
| 4441 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then |
| 4442 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) |
| 4443 | fi |
| 4444 | ], |
| 4445 | [ |
| 4446 | if test "X$ac_status" = "X2";then |
| 4447 | # our test program didn't find it. Default to /var/spool/mail |
| 4448 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) |
| 4449 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) |
| 4450 | else |
| 4451 | AC_MSG_RESULT([*** not found ***]) |
| 4452 | fi |
| 4453 | ], |
| 4454 | [ |
| 4455 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) |
| 4456 | ] |
| 4457 | ) |
| 4458 | fi |
| 4459 | ] |
| 4460 | ) # maildir |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4461 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4462 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4463 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
| 4464 | disable_ptmx_check=yes |
| 4465 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4466 | if test -z "$no_dev_ptmx" ; then |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4467 | if test "x$disable_ptmx_check" != "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4468 | AC_CHECK_FILE(["/dev/ptmx"], |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4469 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4470 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4471 | [Define if you have /dev/ptmx]) |
Kevin Steves | 0ea1d9d | 2002-04-25 18:17:04 +0000 | [diff] [blame] | 4472 | have_dev_ptmx=1 |
| 4473 | ] |
| 4474 | ) |
| 4475 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4476 | fi |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4477 | |
Darren Tucker | 623d92f | 2004-09-12 22:36:15 +1000 | [diff] [blame] | 4478 | if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4479 | AC_CHECK_FILE(["/dev/ptc"], |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4480 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4481 | AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4482 | [Define if you have /dev/ptc]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4483 | have_dev_ptc=1 |
| 4484 | ] |
| 4485 | ) |
| 4486 | else |
| 4487 | AC_MSG_WARN([cross compiling: Disabling /dev/ptc test]) |
| 4488 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 4489 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4490 | # Options from here on. Some of these are preset by platform above |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4491 | AC_ARG_WITH([mantype], |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4492 | [ --with-mantype=man|cat|doc Set man page type], |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4493 | [ |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4494 | case "$withval" in |
| 4495 | man|cat|doc) |
| 4496 | MANTYPE=$withval |
| 4497 | ;; |
| 4498 | *) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4499 | AC_MSG_ERROR([invalid man type: $withval]) |
Damien Miller | 897741e | 2001-04-16 10:41:46 +1000 | [diff] [blame] | 4500 | ;; |
| 4501 | esac |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 4502 | ] |
| 4503 | ) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4504 | if test -z "$MANTYPE"; then |
Tim Rice | e22be3b | 2002-07-17 19:20:07 -0700 | [diff] [blame] | 4505 | TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4506 | AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4507 | if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4508 | MANTYPE=doc |
| 4509 | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then |
| 4510 | MANTYPE=man |
| 4511 | else |
| 4512 | MANTYPE=cat |
| 4513 | fi |
| 4514 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4515 | AC_SUBST([MANTYPE]) |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 4516 | if test "$MANTYPE" = "doc"; then |
| 4517 | mansubdir=man; |
| 4518 | else |
| 4519 | mansubdir=$MANTYPE; |
| 4520 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4521 | AC_SUBST([mansubdir]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4522 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4523 | # Check whether to enable MD5 passwords |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4524 | MD5_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4525 | AC_ARG_WITH([md5-passwords], |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4526 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4527 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 4528 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4529 | AC_DEFINE([HAVE_MD5_PASSWORDS], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4530 | [Define if you want to allow MD5 passwords]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4531 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 4532 | fi |
| 4533 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 4534 | ) |
| 4535 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4536 | # Whether to disable shadow password support |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4537 | AC_ARG_WITH([shadow], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4538 | [ --without-shadow Disable shadow password support], |
| 4539 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4540 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4541 | AC_DEFINE([DISABLE_SHADOW]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4542 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4543 | fi |
| 4544 | ] |
| 4545 | ) |
| 4546 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4547 | if test -z "$disable_shadow" ; then |
| 4548 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4549 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4550 | #include <sys/types.h> |
| 4551 | #include <shadow.h> |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4552 | struct spwd sp; |
| 4553 | ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])], |
| 4554 | [ sp_expire_available=yes ], [ |
| 4555 | ]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4556 | |
| 4557 | if test "x$sp_expire_available" = "xyes" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4558 | AC_MSG_RESULT([yes]) |
| 4559 | AC_DEFINE([HAS_SHADOW_EXPIRE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4560 | [Define if you want to use shadow password expire field]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4561 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4562 | AC_MSG_RESULT([no]) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 4563 | fi |
| 4564 | fi |
| 4565 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4566 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4567 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 4568 | DISPLAY_HACK_MSG="yes" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4569 | AC_DEFINE([IPADDR_IN_DISPLAY], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4570 | [Define if you need to use IP address |
| 4571 | instead of hostname in $DISPLAY]) |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4572 | else |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4573 | DISPLAY_HACK_MSG="no" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4574 | AC_ARG_WITH([ipaddr-display], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4575 | [ --with-ipaddr-display Use ip address instead of hostname in $DISPLAY], |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4576 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4577 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4578 | AC_DEFINE([IPADDR_IN_DISPLAY]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4579 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 4580 | fi |
| 4581 | ] |
| 4582 | ) |
| 4583 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 4584 | |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4585 | # check for /etc/default/login and use it if present. |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4586 | AC_ARG_ENABLE([etc-default-login], |
Darren Tucker | 1b6f229 | 2005-02-11 16:11:49 +1100 | [diff] [blame] | 4587 | [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4588 | [ if test "x$enableval" = "xno"; then |
| 4589 | AC_MSG_NOTICE([/etc/default/login handling disabled]) |
| 4590 | etc_default_login=no |
| 4591 | else |
| 4592 | etc_default_login=yes |
| 4593 | fi ], |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4594 | [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; |
| 4595 | then |
| 4596 | AC_MSG_WARN([cross compiling: not checking /etc/default/login]) |
| 4597 | etc_default_login=no |
| 4598 | else |
| 4599 | etc_default_login=yes |
| 4600 | fi ] |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4601 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4602 | |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4603 | if test "x$etc_default_login" != "xno"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4604 | AC_CHECK_FILE(["/etc/default/login"], |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4605 | [ external_path_file=/etc/default/login ]) |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4606 | if test "x$external_path_file" = "x/etc/default/login"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4607 | AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4608 | [Define if your system has /etc/default/login]) |
Darren Tucker | a0c2b39 | 2004-09-11 23:26:37 +1000 | [diff] [blame] | 4609 | fi |
Darren Tucker | 2f9573d | 2005-02-10 22:28:54 +1100 | [diff] [blame] | 4610 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4611 | |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4612 | 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] | 4613 | if test $ac_cv_func_login_getcapbool = "yes" && \ |
| 4614 | test $ac_cv_header_login_cap_h = "yes" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4615 | external_path_file=/etc/login.conf |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4616 | fi |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4617 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4618 | # Whether to mess with the default path |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4619 | SERVER_PATH_MSG="(default)" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4620 | AC_ARG_WITH([default-path], |
Tim Rice | 6397eed | 2015-06-03 21:41:11 -0700 | [diff] [blame] | 4621 | [ --with-default-path= Specify default $PATH environment for server], |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4622 | [ |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4623 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4624 | AC_MSG_WARN([ |
| 4625 | --with-default-path=PATH has no effect on this system. |
| 4626 | Edit /etc/login.conf instead.]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4627 | elif test "x$withval" != "xno" ; then |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4628 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4629 | AC_MSG_WARN([ |
| 4630 | --with-default-path=PATH will only be used if PATH is not defined in |
| 4631 | $external_path_file .]) |
| 4632 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4633 | user_path="$withval" |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4634 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4635 | fi |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4636 | ], |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4637 | [ if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 4638 | 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] | 4639 | else |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 4640 | if test ! -z "$external_path_file" ; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4641 | AC_MSG_WARN([ |
| 4642 | If PATH is defined in $external_path_file, ensure the path to scp is included, |
| 4643 | otherwise scp will not work.]) |
| 4644 | fi |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4645 | AC_RUN_IFELSE( |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4646 | [AC_LANG_PROGRAM([[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4647 | /* find out what STDPATH is */ |
| 4648 | #include <stdio.h> |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4649 | #ifdef HAVE_PATHS_H |
| 4650 | # include <paths.h> |
| 4651 | #endif |
| 4652 | #ifndef _PATH_STDPATH |
Tim Rice | 1c9e688 | 2002-11-22 13:29:01 -0800 | [diff] [blame] | 4653 | # ifdef _PATH_USERPATH /* Irix */ |
| 4654 | # define _PATH_STDPATH _PATH_USERPATH |
| 4655 | # else |
| 4656 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" |
| 4657 | # endif |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4658 | #endif |
| 4659 | #include <sys/types.h> |
| 4660 | #include <sys/stat.h> |
| 4661 | #include <fcntl.h> |
| 4662 | #define DATA "conftest.stdpath" |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4663 | ]], [[ |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4664 | FILE *fd; |
| 4665 | int rc; |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4666 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4667 | fd = fopen(DATA,"w"); |
| 4668 | if(fd == NULL) |
| 4669 | exit(1); |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4670 | |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4671 | if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) |
| 4672 | exit(1); |
| 4673 | |
| 4674 | exit(0); |
Darren Tucker | 314d89e | 2005-10-17 23:29:23 +1000 | [diff] [blame] | 4675 | ]])], |
| 4676 | [ user_path=`cat conftest.stdpath` ], |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4677 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], |
| 4678 | [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ] |
| 4679 | ) |
| 4680 | # make sure $bindir is in USER_PATH so scp will work |
Damien Miller | 77eab7b | 2012-07-06 11:49:28 +1000 | [diff] [blame] | 4681 | t_bindir="${bindir}" |
| 4682 | while echo "${t_bindir}" | egrep '\$\{|NONE/' >/dev/null 2>&1; do |
| 4683 | t_bindir=`eval echo ${t_bindir}` |
| 4684 | case $t_bindir in |
| 4685 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; |
| 4686 | esac |
| 4687 | case $t_bindir in |
| 4688 | NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 4689 | esac |
| 4690 | done |
Tim Rice | 59ea0a0 | 2001-03-10 13:50:45 -0800 | [diff] [blame] | 4691 | echo $user_path | grep ":$t_bindir" > /dev/null 2>&1 |
| 4692 | if test $? -ne 0 ; then |
| 4693 | echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 |
| 4694 | if test $? -ne 0 ; then |
| 4695 | user_path=$user_path:$t_bindir |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4696 | 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] | 4697 | fi |
| 4698 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4699 | fi ] |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4700 | ) |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 4701 | if test "x$external_path_file" != "x/etc/login.conf" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4702 | AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH]) |
| 4703 | AC_SUBST([user_path]) |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 4704 | fi |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 4705 | |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4706 | # Set superuser path separately to user path |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4707 | AC_ARG_WITH([superuser-path], |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4708 | [ --with-superuser-path= Specify different path for super-user], |
| 4709 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4710 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4711 | test "x${withval}" != "xyes"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4712 | AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4713 | [Define if you want a different $PATH |
| 4714 | for the superuser]) |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 4715 | superuser_path=$withval |
| 4716 | fi |
| 4717 | ] |
| 4718 | ) |
| 4719 | |
| 4720 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 4721 | 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] | 4722 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4723 | AC_ARG_WITH(4in6, |
| 4724 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 4725 | [ |
| 4726 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4727 | AC_MSG_RESULT([yes]) |
| 4728 | AC_DEFINE([IPV4_IN_IPV6], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4729 | [Detect IPv4 in IPv6 mapped addresses |
| 4730 | and treat as IPv4]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4731 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4732 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4733 | AC_MSG_RESULT([no]) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4734 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4735 | ], [ |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4736 | if test "x$inet6_default_4in6" = "xyes"; then |
| 4737 | AC_MSG_RESULT([yes (default)]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4738 | AC_DEFINE([IPV4_IN_IPV6]) |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4739 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 4740 | else |
| 4741 | AC_MSG_RESULT([no (default)]) |
| 4742 | fi |
| 4743 | ] |
| 4744 | ) |
| 4745 | |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4746 | # Whether to enable BSD auth support |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4747 | BSD_AUTH_MSG=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4748 | AC_ARG_WITH([bsd-auth], |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4749 | [ --with-bsd-auth Enable BSD auth support], |
| 4750 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4751 | if test "x$withval" != "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4752 | AC_DEFINE([BSD_AUTH], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4753 | [Define if you have BSD auth support]) |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 4754 | BSD_AUTH_MSG=yes |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 4755 | fi |
| 4756 | ] |
| 4757 | ) |
| 4758 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 4759 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 4760 | piddir=/var/run |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4761 | # make sure the directory exists |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4762 | if test ! -d $piddir ; then |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4763 | piddir=`eval echo ${sysconfdir}` |
| 4764 | case $piddir in |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 4765 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 4766 | esac |
| 4767 | fi |
| 4768 | |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4769 | AC_ARG_WITH([pid-dir], |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4770 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 4771 | [ |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4772 | if test -n "$withval" && test "x$withval" != "xno" && \ |
| 4773 | test "x${withval}" != "xyes"; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4774 | piddir=$withval |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4775 | if test ! -d $piddir ; then |
Tim Rice | 88f2ab5 | 2002-03-17 12:17:34 -0800 | [diff] [blame] | 4776 | AC_MSG_WARN([** no $piddir directory on this system **]) |
| 4777 | fi |
| 4778 | fi |
| 4779 | ] |
| 4780 | ) |
| 4781 | |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4782 | AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"], |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4783 | [Specify location of ssh.pid]) |
| 4784 | AC_SUBST([piddir]) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 4785 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4786 | dnl allow user to disable some login recording features |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4787 | AC_ARG_ENABLE([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4788 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4789 | [ |
| 4790 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4791 | AC_DEFINE([DISABLE_LASTLOG]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4792 | fi |
| 4793 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4794 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4795 | AC_ARG_ENABLE([utmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4796 | [ --disable-utmp disable use of utmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4797 | [ |
| 4798 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4799 | AC_DEFINE([DISABLE_UTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4800 | fi |
| 4801 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4802 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4803 | AC_ARG_ENABLE([utmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4804 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4805 | [ |
| 4806 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4807 | AC_DEFINE([DISABLE_UTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4808 | [Define if you don't want to use utmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4809 | fi |
| 4810 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4811 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4812 | AC_ARG_ENABLE([wtmp], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4813 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4814 | [ |
| 4815 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4816 | AC_DEFINE([DISABLE_WTMP]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4817 | fi |
| 4818 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4819 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4820 | AC_ARG_ENABLE([wtmpx], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4821 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4822 | [ |
| 4823 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4824 | AC_DEFINE([DISABLE_WTMPX], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4825 | [Define if you don't want to use wtmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4826 | fi |
| 4827 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4828 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4829 | AC_ARG_ENABLE([libutil], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4830 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4831 | [ |
| 4832 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4833 | AC_DEFINE([DISABLE_LOGIN]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4834 | fi |
| 4835 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4836 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4837 | AC_ARG_ENABLE([pututline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4838 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4839 | [ |
| 4840 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4841 | AC_DEFINE([DISABLE_PUTUTLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4842 | [Define if you don't want to use pututline() |
| 4843 | etc. to write [uw]tmp]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4844 | fi |
| 4845 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4846 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4847 | AC_ARG_ENABLE([pututxline], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4848 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4849 | [ |
| 4850 | if test "x$enableval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4851 | AC_DEFINE([DISABLE_PUTUTXLINE], [1], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4852 | [Define if you don't want to use pututxline() |
| 4853 | etc. to write [uw]tmpx]) |
Darren Tucker | a3020db | 2003-06-28 12:54:33 +1000 | [diff] [blame] | 4854 | fi |
| 4855 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4856 | ) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4857 | AC_ARG_WITH([lastlog], |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 4858 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4859 | [ |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4860 | if test "x$withval" = "xno" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4861 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | 35cc69d | 2005-03-17 16:44:25 -0800 | [diff] [blame] | 4862 | elif test -n "$withval" && test "x${withval}" != "xyes"; then |
Damien Miller | 709528a | 2001-01-31 09:57:55 +1100 | [diff] [blame] | 4863 | conf_lastlog_location=$withval |
| 4864 | fi |
| 4865 | ] |
| 4866 | ) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4867 | |
| 4868 | dnl lastlog, [uw]tmpx? detection |
| 4869 | dnl NOTE: set the paths in the platform section to avoid the |
| 4870 | dnl need for command-line parameters |
| 4871 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 4872 | |
| 4873 | dnl lastlog detection |
| 4874 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 4875 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4876 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4877 | #include <sys/types.h> |
| 4878 | #include <utmp.h> |
| 4879 | #ifdef HAVE_LASTLOG_H |
| 4880 | # include <lastlog.h> |
| 4881 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4882 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4883 | # include <paths.h> |
| 4884 | #endif |
Ben Lindstrom | 19d7b8d | 2001-08-16 00:09:49 +0000 | [diff] [blame] | 4885 | #ifdef HAVE_LOGIN_H |
| 4886 | # include <login.h> |
| 4887 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4888 | ]], [[ char *lastlog = LASTLOG_FILE; ]])], |
| 4889 | [ AC_MSG_RESULT([yes]) ], |
| 4890 | [ |
| 4891 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4892 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4893 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4894 | #include <sys/types.h> |
| 4895 | #include <utmp.h> |
| 4896 | #ifdef HAVE_LASTLOG_H |
| 4897 | # include <lastlog.h> |
| 4898 | #endif |
| 4899 | #ifdef HAVE_PATHS_H |
| 4900 | # include <paths.h> |
| 4901 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4902 | ]], [[ char *lastlog = _PATH_LASTLOG; ]])], |
| 4903 | [ AC_MSG_RESULT([yes]) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4904 | [ |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4905 | AC_MSG_RESULT([no]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4906 | system_lastlog_path=no |
| 4907 | ]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4908 | ]) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4909 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4910 | if test -z "$conf_lastlog_location"; then |
| 4911 | if test x"$system_lastlog_path" = x"no" ; then |
| 4912 | 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] | 4913 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4914 | conf_lastlog_location=$f |
| 4915 | fi |
| 4916 | done |
| 4917 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 4918 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 4919 | 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] | 4920 | fi |
| 4921 | fi |
| 4922 | fi |
| 4923 | |
| 4924 | if test -n "$conf_lastlog_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4925 | AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4926 | [Define if you want to specify the path to your lastlog file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4927 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4928 | |
| 4929 | dnl utmp detection |
| 4930 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4931 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4932 | #include <sys/types.h> |
| 4933 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4934 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4935 | # include <paths.h> |
| 4936 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4937 | ]], [[ char *utmp = UTMP_FILE; ]])], |
| 4938 | [ AC_MSG_RESULT([yes]) ], |
| 4939 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4940 | system_utmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4941 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4942 | if test -z "$conf_utmp_location"; then |
| 4943 | if test x"$system_utmp_path" = x"no" ; then |
| 4944 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 4945 | if test -f $f ; then |
| 4946 | conf_utmp_location=$f |
| 4947 | fi |
| 4948 | done |
| 4949 | if test -z "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4950 | AC_DEFINE([DISABLE_UTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4951 | fi |
| 4952 | fi |
| 4953 | fi |
| 4954 | if test -n "$conf_utmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4955 | AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4956 | [Define if you want to specify the path to your utmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4957 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4958 | |
| 4959 | dnl wtmp detection |
| 4960 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4961 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4962 | #include <sys/types.h> |
| 4963 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4964 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4965 | # include <paths.h> |
| 4966 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4967 | ]], [[ char *wtmp = WTMP_FILE; ]])], |
| 4968 | [ AC_MSG_RESULT([yes]) ], |
| 4969 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 4970 | system_wtmp_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4971 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4972 | if test -z "$conf_wtmp_location"; then |
| 4973 | if test x"$system_wtmp_path" = x"no" ; then |
| 4974 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 4975 | if test -f $f ; then |
| 4976 | conf_wtmp_location=$f |
| 4977 | fi |
| 4978 | done |
| 4979 | if test -z "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4980 | AC_DEFINE([DISABLE_WTMP]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4981 | fi |
| 4982 | fi |
| 4983 | fi |
| 4984 | if test -n "$conf_wtmp_location"; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4985 | AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 4986 | [Define if you want to specify the path to your wtmp file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 4987 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4988 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4989 | dnl wtmpx detection |
| 4990 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 4991 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4992 | #include <sys/types.h> |
| 4993 | #include <utmp.h> |
| 4994 | #ifdef HAVE_UTMPX_H |
| 4995 | #include <utmpx.h> |
| 4996 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 4997 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 4998 | # include <paths.h> |
| 4999 | #endif |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5000 | ]], [[ char *wtmpx = WTMPX_FILE; ]])], |
| 5001 | [ AC_MSG_RESULT([yes]) ], |
| 5002 | [ AC_MSG_RESULT([no]) |
Tim Rice | e1d9370 | 2016-05-31 11:13:22 -0700 | [diff] [blame] | 5003 | system_wtmpx_path=no |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5004 | ]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5005 | if test -z "$conf_wtmpx_location"; then |
| 5006 | if test x"$system_wtmpx_path" = x"no" ; then |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5007 | AC_DEFINE([DISABLE_WTMPX]) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5008 | fi |
| 5009 | else |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5010 | AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"], |
Tim Rice | 7df8d39 | 2005-09-19 09:33:39 -0700 | [diff] [blame] | 5011 | [Define if you want to specify the path to your wtmpx file]) |
Tim Rice | eae17cc | 2005-03-17 16:52:20 -0800 | [diff] [blame] | 5012 | fi |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 5013 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 5014 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 5015 | if test ! -z "$blibpath" ; then |
Damien Miller | eab4bae | 2003-04-29 23:22:40 +1000 | [diff] [blame] | 5016 | LDFLAGS="$LDFLAGS $blibflags$blibpath" |
| 5017 | AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 5018 | fi |
| 5019 | |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5020 | AC_CHECK_MEMBER([struct lastlog.ll_line], [], [ |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 5021 | if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5022 | AC_DEFINE([DISABLE_LASTLOG]) |
Tim Rice | aa86c39 | 2013-03-16 20:55:46 -0700 | [diff] [blame] | 5023 | fi |
Damien Miller | a2438bb | 2013-03-15 10:23:07 +1100 | [diff] [blame] | 5024 | ], [ |
| 5025 | #ifdef HAVE_SYS_TYPES_H |
| 5026 | #include <sys/types.h> |
| 5027 | #endif |
| 5028 | #ifdef HAVE_UTMP_H |
| 5029 | #include <utmp.h> |
| 5030 | #endif |
| 5031 | #ifdef HAVE_UTMPX_H |
| 5032 | #include <utmpx.h> |
| 5033 | #endif |
| 5034 | #ifdef HAVE_LASTLOG_H |
| 5035 | #include <lastlog.h> |
| 5036 | #endif |
| 5037 | ]) |
| 5038 | |
| 5039 | AC_CHECK_MEMBER([struct utmp.ut_line], [], [ |
| 5040 | AC_DEFINE([DISABLE_UTMP]) |
| 5041 | AC_DEFINE([DISABLE_WTMP]) |
| 5042 | ], [ |
| 5043 | #ifdef HAVE_SYS_TYPES_H |
| 5044 | #include <sys/types.h> |
| 5045 | #endif |
| 5046 | #ifdef HAVE_UTMP_H |
| 5047 | #include <utmp.h> |
| 5048 | #endif |
| 5049 | #ifdef HAVE_UTMPX_H |
| 5050 | #include <utmpx.h> |
| 5051 | #endif |
| 5052 | #ifdef HAVE_LASTLOG_H |
| 5053 | #include <lastlog.h> |
| 5054 | #endif |
| 5055 | ]) |
| 5056 | |
Darren Tucker | 7da23cb | 2005-08-03 00:20:15 +1000 | [diff] [blame] | 5057 | dnl Adding -Werror to CFLAGS early prevents configure tests from running. |
| 5058 | dnl Add now. |
| 5059 | CFLAGS="$CFLAGS $werror_flags" |
| 5060 | |
Darren Tucker | 627337d | 2010-04-10 22:58:01 +1000 | [diff] [blame] | 5061 | if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then |
| 5062 | TEST_SSH_IPV6=no |
| 5063 | else |
| 5064 | TEST_SSH_IPV6=yes |
| 5065 | fi |
Tim Rice | 648f876 | 2011-01-26 12:38:57 -0800 | [diff] [blame] | 5066 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
| 5067 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
Darren Tucker | 47b8c99 | 2016-12-08 15:48:34 +1100 | [diff] [blame] | 5068 | AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) |
Darren Tucker | 882abfd | 2013-11-09 00:17:41 +1100 | [diff] [blame] | 5069 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
Darren Tucker | 6d8bd57 | 2013-06-11 11:26:10 +1000 | [diff] [blame] | 5070 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
Darren Tucker | 79c0e1d | 2017-12-11 14:38:33 +1100 | [diff] [blame] | 5071 | AC_SUBST([DEPEND], [$(cat $srcdir/.depend)]) |
Darren Tucker | 5d37690 | 2008-06-11 04:15:05 +1000 | [diff] [blame] | 5072 | |
Damien Miller | de35c38 | 2017-09-08 12:38:31 +1000 | [diff] [blame] | 5073 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" |
| 5074 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" |
| 5075 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 5076 | AC_EXEEXT |
Damien Miller | 223897a | 2006-09-12 21:54:10 +1000 | [diff] [blame] | 5077 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
| 5078 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
Damien Miller | f22019b | 2011-05-05 13:48:37 +1000 | [diff] [blame] | 5079 | survey.sh]) |
Tim Rice | 13aae5e | 2001-10-21 17:53:58 -0700 | [diff] [blame] | 5080 | AC_OUTPUT |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 5081 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5082 | # Print summary of options |
| 5083 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5084 | # Someone please show me a better way :) |
| 5085 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 5086 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 5087 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 5088 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 5089 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Ben Lindstrom | bc70992 | 2001-04-18 18:04:21 +0000 | [diff] [blame] | 5090 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5091 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5092 | H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}` |
| 5093 | I=`eval echo ${user_path}` ; I=`eval echo ${I}` |
| 5094 | J=`eval echo ${superuser_path}` ; J=`eval echo ${J}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5095 | |
| 5096 | echo "" |
Kevin Steves | 393d2f7 | 2001-04-08 22:50:43 +0000 | [diff] [blame] | 5097 | echo "OpenSSH has been configured with the following options:" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5098 | echo " User binaries: $B" |
| 5099 | echo " System binaries: $C" |
| 5100 | echo " Configuration files: $D" |
| 5101 | echo " Askpass program: $E" |
| 5102 | echo " Manual pages: $F" |
| 5103 | echo " PID file: $G" |
| 5104 | echo " Privilege separation chroot path: $H" |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5105 | if test "x$external_path_file" = "x/etc/login.conf" ; then |
| 5106 | echo " At runtime, sshd will use the path defined in $external_path_file" |
| 5107 | 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] | 5108 | else |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5109 | echo " sshd default user PATH: $I" |
Tim Rice | b925b4b | 2003-09-15 22:40:49 -0700 | [diff] [blame] | 5110 | if test ! -z "$external_path_file"; then |
Darren Tucker | e1a790d | 2003-09-16 11:52:19 +1000 | [diff] [blame] | 5111 | echo " (If PATH is set in $external_path_file it will be used instead. If" |
| 5112 | echo " used, ensure the path to scp is present, otherwise scp will not work.)" |
| 5113 | fi |
Tim Rice | 43a1c13 | 2002-04-17 21:19:14 -0700 | [diff] [blame] | 5114 | fi |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5115 | if test ! -z "$superuser_path" ; then |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5116 | echo " sshd superuser user PATH: $J" |
Damien Miller | a18bbd3 | 2002-05-13 10:48:57 +1000 | [diff] [blame] | 5117 | fi |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5118 | echo " Manpage format: $MANTYPE" |
Damien Miller | 7abe09b | 2003-05-15 10:53:49 +1000 | [diff] [blame] | 5119 | echo " PAM support: $PAM_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5120 | echo " OSF SIA support: $SIA_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5121 | echo " KerberosV support: $KRB5_MSG" |
Damien Miller | 73b42d2 | 2006-04-22 21:26:08 +1000 | [diff] [blame] | 5122 | echo " SELinux support: $SELINUX_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5123 | echo " S/KEY support: $SKEY_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5124 | echo " MD5 password support: $MD5_MSG" |
Darren Tucker | 16bcc1c | 2004-11-07 20:14:34 +1100 | [diff] [blame] | 5125 | echo " libedit support: $LIBEDIT_MSG" |
Damien Miller | 523db85 | 2017-02-03 16:01:22 +1100 | [diff] [blame] | 5126 | echo " libldns support: $LDNS_MSG" |
Damien Miller | 1b06dc3 | 2006-08-31 03:24:41 +1000 | [diff] [blame] | 5127 | echo " Solaris process contract support: $SPC_MSG" |
Darren Tucker | 9752835 | 2010-11-05 12:03:05 +1100 | [diff] [blame] | 5128 | echo " Solaris project support: $SP_MSG" |
Damien Miller | 4626cba | 2016-01-08 14:24:56 +1100 | [diff] [blame] | 5129 | echo " Solaris privilege support: $SPP_MSG" |
Damien Miller | 903e115 | 2002-05-13 14:41:31 +1000 | [diff] [blame] | 5130 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
Damien Miller | f58c672 | 2002-05-13 13:15:42 +1000 | [diff] [blame] | 5131 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 5132 | echo " BSD Auth support: $BSD_AUTH_MSG" |
| 5133 | echo " Random number source: $RAND_MSG" |
Damien Miller | 69ff1df | 2011-06-23 08:30:03 +1000 | [diff] [blame] | 5134 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
Damien Miller | 60396b0 | 2001-02-18 17:01:00 +1100 | [diff] [blame] | 5135 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5136 | echo "" |
| 5137 | |
Ben Lindstrom | 28bfc0d | 2000-12-18 19:58:57 +0000 | [diff] [blame] | 5138 | echo " Host: ${host}" |
| 5139 | echo " Compiler: ${CC}" |
| 5140 | echo " Compiler flags: ${CFLAGS}" |
| 5141 | echo "Preprocessor flags: ${CPPFLAGS}" |
| 5142 | echo " Linker flags: ${LDFLAGS}" |
Darren Tucker | 20e9f97 | 2007-03-25 18:26:01 +1000 | [diff] [blame] | 5143 | echo " Libraries: ${LIBS}" |
| 5144 | if test ! -z "${SSHDLIBS}"; then |
| 5145 | echo " +for sshd: ${SSHDLIBS}" |
| 5146 | fi |
Damien Miller | 71adf12 | 2011-01-25 12:16:15 +1100 | [diff] [blame] | 5147 | if test ! -z "${SSHLIBS}"; then |
| 5148 | echo " +for ssh: ${SSHLIBS}" |
| 5149 | fi |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 5150 | |
| 5151 | echo "" |
| 5152 | |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5153 | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then |
Darren Tucker | cf59d31 | 2004-08-29 21:18:09 +1000 | [diff] [blame] | 5154 | echo "SVR4 style packages are supported with \"make package\"" |
| 5155 | echo "" |
Tim Rice | 6f1f758 | 2004-05-30 21:38:51 -0700 | [diff] [blame] | 5156 | fi |
| 5157 | |
Damien Miller | 82cf0ce | 2000-12-20 13:34:48 +1100 | [diff] [blame] | 5158 | if test "x$PAM_MSG" = "xyes" ; then |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5159 | echo "PAM is enabled. You may need to install a PAM control file " |
| 5160 | echo "for sshd, otherwise password authentication may fail. " |
Damien Miller | a8e06ce | 2003-11-21 23:48:55 +1100 | [diff] [blame] | 5161 | echo "Example PAM control files can be found in the contrib/ " |
Damien Miller | 6c21c51 | 2002-01-22 21:57:53 +1100 | [diff] [blame] | 5162 | echo "subdirectory" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 5163 | echo "" |
| 5164 | fi |
Ben Lindstrom | 3ad650a | 2001-01-03 06:02:51 +0000 | [diff] [blame] | 5165 | |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5166 | if test ! -z "$NO_PEERCHECK" ; then |
Darren Tucker | 164aa30 | 2007-03-21 21:39:57 +1100 | [diff] [blame] | 5167 | echo "WARNING: the operating system that you are using does not" |
| 5168 | echo "appear to support getpeereid(), getpeerucred() or the" |
| 5169 | echo "SO_PEERCRED getsockopt() option. These facilities are used to" |
| 5170 | echo "enforce security checks to prevent unauthorised connections to" |
| 5171 | echo "ssh-agent. Their absence increases the risk that a malicious" |
| 5172 | echo "user can connect to your agent." |
Damien Miller | b409718 | 2004-05-23 14:09:40 +1000 | [diff] [blame] | 5173 | echo "" |
| 5174 | fi |
| 5175 | |
Darren Tucker | d9f8891 | 2005-02-20 21:01:48 +1100 | [diff] [blame] | 5176 | if test "$AUDIT_MODULE" = "bsm" ; then |
| 5177 | echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." |
| 5178 | echo "See the Solaris section in README.platform for details." |
| 5179 | fi |